提交 20a434ed 编写于 作者: Mosher's avatar Mosher

数据视图 国际化更新

上级 4ab992ae
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</i-col> </i-col>
</a> </a>
</row> </row>
<div v-else class="app-data-empty">暂无数据</div> <div v-else class="app-data-empty">{{ $t('app.commonWords.noData') }}</div>
</#if> </#if>
</div> </div>
</template> </template>
...@@ -410,7 +410,7 @@ ...@@ -410,7 +410,7 @@
*/ */
public load(opt: any = {}, isReset: boolean = false): void { public load(opt: any = {}, isReset: boolean = false): void {
if(!this.fetchAction){ if(!this.fetchAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图列表fetchAction参数未配置' }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.list.notConfig.fetchAction') as string) });
return; return;
} }
const arg: any = {...opt}; const arg: any = {...opt};
...@@ -434,7 +434,7 @@ ...@@ -434,7 +434,7 @@
post.then((response: any) => { post.then((response: any) => {
if (!response || response.status !== 200) { if (!response || response.status !== 200) {
if (response.errorMessage) { if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
} }
return; return;
} }
...@@ -463,7 +463,7 @@ ...@@ -463,7 +463,7 @@
if (response && response.status === 401) { if (response && response.status === 401) {
return; return;
} }
this.$Notice.error({ title: '错误', desc: response.errorMessage }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
}); });
} }
...@@ -476,7 +476,7 @@ ...@@ -476,7 +476,7 @@
*/ */
public async remove(datas: any[]): Promise<any> { public async remove(datas: any[]): Promise<any> {
if(!this.removeAction){ if(!this.removeAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格removeAction参数未配置' }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.gridpage.notConfig.removeAction') as string) });
return; return;
} }
let _datas:any[] = []; let _datas:any[] = [];
...@@ -509,9 +509,9 @@ ...@@ -509,9 +509,9 @@
}); });
if (_datas.length < 5) { if (_datas.length < 5) {
dataInfo = dataInfo + ' 共' + _datas.length + '条数据'; dataInfo = dataInfo + ' ' + (this.$t('app.dataView.sum') as string) + _datas.length + (this.$t('app.dataView.data') as string);
} else { } else {
dataInfo = dataInfo + '...' + ' 共' + _datas.length + '条数据'; dataInfo = dataInfo + '...' + ' ' + (this.$t('app.dataView.sum') as string) + _datas.length + (this.$t('app.dataView.data') as string);
} }
const removeData = () => { const removeData = () => {
...@@ -525,10 +525,10 @@ ...@@ -525,10 +525,10 @@
return new Promise((resolve: any, reject: any) => { return new Promise((resolve: any, reject: any) => {
post.then((response: any) => { post.then((response: any) => {
if (!response || response.status !== 200) { if (!response || response.status !== 200) {
this.$Notice.error({ title: '', desc: '删除数据失败,' + response.info }); this.$Notice.error({ title: '', desc: (this.$t('app.commonWords.delDataFail') as string) + ',' + response.info });
return; return;
} else { } else {
this.$Notice.success({ title: '', desc: '删除成功!' }); this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.deleteSuccess') as string) });
} }
//删除items中已删除的项 //删除items中已删除的项
_datas.forEach((data: any) => { _datas.forEach((data: any) => {
...@@ -547,7 +547,7 @@ ...@@ -547,7 +547,7 @@
return; return;
} }
if (!response || !response.status || !response.data) { if (!response || !response.status || !response.data) {
this.$Notice.error({ title: '错误', desc: '系统异常' }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.sysException') as string) });
reject(response); reject(response);
return; return;
} }
...@@ -558,8 +558,8 @@ ...@@ -558,8 +558,8 @@
dataInfo = dataInfo.replace(/[null]/g, '').replace(/[undefined]/g, '').replace(/[ ]/g, ''); dataInfo = dataInfo.replace(/[null]/g, '').replace(/[undefined]/g, '').replace(/[ ]/g, '');
this.$Modal.confirm({ this.$Modal.confirm({
title: '警告', title: (this.$t('app.commonWords.warning') as string),
content: '确认要删除 ' + dataInfo + ',删除操作将不可恢复?', content: (this.$t('app.gridpage.confirmDel') as string) + ' ' + dataInfo + ',' + (this.$t('app.gridpage.notRecoverable') as string),
onOk: () => { onOk: () => {
removeData(); removeData();
}, },
...@@ -585,7 +585,7 @@ ...@@ -585,7 +585,7 @@
try { try {
if(Object.is(item.rowDataState, 'create')){ if(Object.is(item.rowDataState, 'create')){
if(!this.createAction){ if(!this.createAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图列表createAction参数未配置' }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.list.notConfig.createAction') as string) });
}else{ }else{
Object.assign(item,{viewparams:this.viewparams}); Object.assign(item,{viewparams:this.viewparams});
let response = await this.service.add(this.createAction, JSON.parse(JSON.stringify(this.context)),item, this.showBusyIndicator); let response = await this.service.add(this.createAction, JSON.parse(JSON.stringify(this.context)),item, this.showBusyIndicator);
...@@ -593,7 +593,7 @@ ...@@ -593,7 +593,7 @@
} }
}else if(Object.is(item.rowDataState, 'update')){ }else if(Object.is(item.rowDataState, 'update')){
if(!this.updateAction){ if(!this.updateAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图列表updateAction参数未配置' }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}' + (this.$t('app.list.notConfig.updateAction') as string) });
}else{ }else{
Object.assign(item,{viewparams:this.viewparams}); Object.assign(item,{viewparams:this.viewparams});
<#if de??> <#if de??>
...@@ -613,10 +613,10 @@ ...@@ -613,10 +613,10 @@
this.$emit('save', successItems); this.$emit('save', successItems);
this.refresh(); this.refresh();
if(errorItems.length === 0){ if(errorItems.length === 0){
this.$Notice.success({ title: '', desc: '保存成功!' }); this.$Notice.success({ title: '', desc: (this.$t('app.commonWords.saveSuccess') as string) });
}else{ }else{
errorItems.forEach((item:any,index:number)=>{ errorItems.forEach((item:any,index:number)=>{
this.$Notice.error({ title: '保存失败', desc: item.majorentityname+'保存失败!' }); this.$Notice.error({ title: (this.$t('app.commonWords.saveFailed') as string), desc: item.majorentityname + (this.$t('app.commonWords.saveFailed') as string) + '!' });
console.error(errorMessage[index]); console.error(errorMessage[index]);
}); });
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册