提交 85be994a 编写于 作者: Mosher's avatar Mosher

表单国际化更新

上级 d229bbeb
......@@ -676,7 +676,7 @@ import schema from 'async-validator';
if (value && value.startsWith('%') && value.endsWith('%')) {
const key: string = value.substring(1, value.length - 1);
if (!this.data.hasOwnProperty(key)) {
this.$Notice.error({ title: '错误', desc: `操作失败,未能找到当前表单项${r'${key}'},无法继续操作` });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: `${(this.$t('app.formpage.desc1') as string)}${r'${key}'},${(this.$t('app.formpage.desc2') as string)}` });
return false;
}
value = this.data[key];
......@@ -906,7 +906,7 @@ import schema from 'async-validator';
*/
public load(opt: any = {}): void {
if(!this.loadAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表单loadAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: '${view.getName()}' + (this.$t('app.formpage.notconfig.loadAction') as string) });
return;
}
const arg: any = { ...opt };
......@@ -923,11 +923,11 @@ import schema from 'async-validator';
}
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: response.data.message });
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: (this.$t('app.formpage.sysabnormality') as string) });
return;
}
});
......@@ -941,7 +941,7 @@ import schema from 'async-validator';
*/
public loadDraft(opt: any = {}): void {
if(!this.loaddraftAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表单loaddraftAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: '${view.getName()}' + (this.$t('app.formpage.notconfig.loaddraftaction') as string) });
return;
}
const arg: any = { ...opt } ;
......@@ -950,7 +950,7 @@ import schema from 'async-validator';
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: response.data.message });
}
return;
}
......@@ -979,11 +979,11 @@ import schema from 'async-validator';
});
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: response.data.message });
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: (this.$t('app.formpage.sysabnormality') as string) });
return;
}
});
......@@ -1005,7 +1005,7 @@ import schema from 'async-validator';
const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction;
if(!action){
let actionName:any = Object.is(data.srfuf, '1')?"updateAction":"createAction";
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表单'+actionName+'参数未配置' });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: '${view.getName()}' + (this.$t('app.formpage.notconfig.actionname') });
return;
}
Object.assign(arg,{viewparams:this.viewparams});
......@@ -1013,7 +1013,7 @@ import schema from 'async-validator';
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: response.data.message });
}
return;
}
......@@ -1031,20 +1031,20 @@ import schema from 'async-validator';
if (response && response.status && response.data) {
if(response.data.errorKey && Object.is(response.data.errorKey,"versionCheck")){
this.$Modal.confirm({
title: '保存数据发生错误',
content: '数据不一致,可能后台数据已经被修改,是否要重新加载数据?',
title: (this.$t('app.formpage.saveerror') as string),
content: (this.$t('app.formpage.savecontent') as string),
onOk: () => {
this.refresh([]);
},
onCancel: () => { }
});
}else{
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: response.data.message });
}
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: (this.$t('app.formpage.sysabnormality') as string) });
return;
}
});
......@@ -1063,7 +1063,7 @@ import schema from 'async-validator';
return new Promise((resolve: any, reject: any) => {
showResultInfo = showResultInfo === undefined ? true : false;
if (!this.formValidateStatus()) {
this.$Notice.error({ title: '错误', desc: '值规则校验异常' });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: (this.$t('app.formpage.valuecheckex') as string) });
return;
}
const arg: any = { ...opt };
......@@ -1088,7 +1088,7 @@ import schema from 'async-validator';
const action: any = Object.is(data.srfuf, '1') ? this.updateAction : this.createAction;
if(!action){
let actionName:any = Object.is(data.srfuf, '1')?"updateAction":"createAction";
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表单'+actionName+'参数未配置' });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: '${view.getName()}' + (this.$t('app.formpage.notconfig.actionname') as string) });
return;
}
Object.assign(arg,{viewparams:this.viewparams});
......@@ -1096,7 +1096,7 @@ import schema from 'async-validator';
post.then((response: any) => {
if (!response.status || response.status !== 200) {
if (response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: response.data.message });
}
return;
}
......@@ -1112,7 +1112,7 @@ import schema from 'async-validator';
});
<#if ctrl.getFormFuncMode()?lower_case != 'wizardform'>
if (showResultInfo) {
this.$Notice.success({ title: '', desc: (data.srfmajortext ? data.srfmajortext : '') + '&nbsp;保存成功!' });
this.$Notice.success({ title: '', desc: (data.srfmajortext ? data.srfmajortext : '') + '&nbsp;'+ (this.$t('app.formpage.savesuccess') as string) });
}
</#if>
resolve(response);
......@@ -1120,21 +1120,21 @@ import schema from 'async-validator';
if (response && response.status && response.data) {
if(response.data.errorKey && Object.is(response.data.errorKey,"versionCheck")){
this.$Modal.confirm({
title: '保存数据发生错误',
content: '数据不一致,可能后台数据已经被修改,是否要重新加载数据?',
title: (this.$t('app.formpage.saveerror') as string),
content: (this.$t('app.formpage.savecontent') as string),
onOk: () => {
this.refresh([]);
},
onCancel: () => { }
});
}else{
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: response.data.message });
reject(response);
}
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: (this.$t('app.formpage.sysabnormality') as string) });
reject(response);
return;
}
......@@ -1153,7 +1153,7 @@ import schema from 'async-validator';
public remove(opt:Array<any> = [],showResultInfo?: boolean): Promise<any> {
return new Promise((resolve: any, reject: any) => {
if(!this.removeAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表单removeAction参数未配置' });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: '${view.getName()}' + (this.$t('app.formpage.notconfig.removeaction') as string) });
return;
}
const arg: any = opt[0];
......@@ -1165,7 +1165,7 @@ import schema from 'async-validator';
this.$emit('remove',data);
this.formState.next({ type: 'remove', data: data });
this.data.ismodify = false;
this.$Notice.success({ title: '', desc: (data.srfmajortext ? data.srfmajortext : '') + '&nbsp;删除成功!' });
this.$Notice.success({ title: '', desc: (data.srfmajortext ? data.srfmajortext : '') + '&nbsp;' + (this.$t('app.formpage.deletesuccess') as string) });
<#if ctrl.getControlType() == 'FORM'>
AppCenterService.notifyMessage({name:"${ctrl.getPSAppDataEntity().getCodeName()}",action:'appRefresh',data:data});
</#if>
......@@ -1201,20 +1201,20 @@ import schema from 'async-validator';
result.then((response: any) => {
if (!response || response.status !== 200) {
if(response.data){
this.$Notice.error({ title: '', desc: '工作流启动失败, ' + response.data.message });
this.$Notice.error({ title: '', desc: (this.$t('app.formpage.workflow.starterror') as string) + ', ' + response.data.message });
}
return;
}
this.$Notice.info({ title: '', desc: '工作流启动成功' });
this.$Notice.info({ title: '', desc: (this.$t('app.formpage.workflow.startsuccess') as string) });
resolve(response);
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: response.data.message });
reject(response);
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: (this.$t('app.formpage.sysabnormality') as string) });
reject(response);
return;
}
......@@ -1222,12 +1222,12 @@ import schema from 'async-validator';
});
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: response.data.message });
reject(response);
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: (this.$t('app.formpage.sysabnormality') as string) });
reject(response);
return;
}
......@@ -1276,22 +1276,22 @@ import schema from 'async-validator';
result.then((response: any) => {
if (!response || response.status !== 200) {
if(response.data){
this.$Notice.error({ title: '', desc: '工作流提交失败, ' + response.data.message });
this.$Notice.error({ title: '', desc: (this.$t('app.formpage.workflow.submiterror') as string) + ', ' + response.data.message });
}
return;
}
this.onFormLoad(arg,'submit');
this.$store.dispatch('viewaction/datasaved', { viewtag: this.viewtag });
this.$Notice.info({ title: '', desc: '工作流提交成功' });
this.$Notice.info({ title: '', desc: (this.$t('app.formpage.workflow.submitsuccess') as string) });
resolve(response);
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: response.data.message });
reject(response);
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: (this.$t('app.formpage.sysabnormality') as string) });
reject(response);
return;
}
......@@ -1299,12 +1299,12 @@ import schema from 'async-validator';
});
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: response.data.message });
reject(response);
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: (this.$t('app.formpage.sysabnormality') as string) });
reject(response);
return;
}
......@@ -1333,7 +1333,7 @@ import schema from 'async-validator';
const post: Promise<any> = this.service.frontLogic(mode,JSON.parse(JSON.stringify(this.context)),arg, showloading);
post.then((response: any) => {
if (!response || response.status !== 200) {
this.$Notice.error({ title: '错误', desc: '表单项更新失败' });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: (this.$t('app.formpage.updateerror') as string) });
return;
}
const data = response.data;
......@@ -1356,11 +1356,11 @@ import schema from 'async-validator';
});
}).catch((response: any) => {
if (response && response.status && response.data) {
this.$Notice.error({ title: '错误', desc: response.data.message });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: response.data.message });
return;
}
if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' });
this.$Notice.error({ title: (this.$t('app.formpage.error') as string), desc: (this.$t('app.formpage.sysabnormality') as string) });
return;
}
});
......
......@@ -85,6 +85,30 @@ export default {
},
</#list>
},
formpage:{
error: "Error",
desc1: "Operation failed, failed to find current form item",
desc2: "Can't continue",
notconfig: {
loadaction: "View form loadAction parameter is not configured",
loaddraftaction: "View form loaddraftAction parameter is not configured",
actionname: "View form actionName parameter is not configured",
removeaction: "View form removeAction parameter is not configured",
},
saveerror: "Error saving data",
savecontent: "The data is inconsistent. The background data may have been modified. Do you want to reload the data?",
sysabnormality: "System abnormality",
valuecheckex: "Value rule check exception",
savesuccess: "Saved successfully!",
deletesuccess: "Successfully deleted!",
workflow: {
starterror: "Workflow started successfully",
startsuccess: "Workflow failed to start",
submiterror: "Workflow submission failed",
submitsuccess: "Workflow submitted successfully",
},
updateerror: "Form item update failed",
}
},
entities: {
<#list app.getAllPSAppDataEntities() as dataEntitey>
......
......@@ -85,6 +85,30 @@ export default {
},
</#list>
},
formpage:{
error: "错误",
desc1: "操作失败,未能找到当前表单项",
desc2: "无法继续操作",
notconfig: {
loadaction: "视图表单loadAction参数未配置",
loaddraftaction: "视图表单loaddraftAction参数未配置",
actionname: "视图表单'+actionName+'参数未配置",
removeaction: "视图表单removeAction参数未配置",
},
saveerror: "保存数据发生错误",
savecontent: "数据不一致,可能后台数据已经被修改,是否要重新加载数据?",
sysabnormality: "系统异常",
valuecheckex: "值规则校验异常",
savesuccess: "保存成功!",
deletesuccess: "删除成功!",
workflow: {
starterror: "工作流启动失败",
startsuccess: "工作流启动成功",
submiterror: "工作流提交失败",
submitsuccess: "工作流提交成功",
}
updateerror: "表单项更新失败",
}
},
entities: {
<#list app.getAllPSAppDataEntities() as dataEntitey>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册