提交 9a6030d5 编写于 作者: linjinyang's avatar linjinyang

表格国际化更新

上级 3e89a906
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
@row-dblclick="rowDBLClick($event)" @row-dblclick="rowDBLClick($event)"
ref='multipleTable' :data="items" :show-header="!isHideHeader"> ref='multipleTable' :data="items" :show-header="!isHideHeader">
<template slot="empty"> <template slot="empty">
无数据 {{$t('app.gridpage.noData')}}
<#if ctrl.getQuickPSDEToolbar?? && ctrl.getQuickPSDEToolbar()??> <#if ctrl.getQuickPSDEToolbar?? && ctrl.getQuickPSDEToolbar()??>
<span class="quick-toolbar"> <span class="quick-toolbar">
<#assign quickToolbar = ctrl.getQuickPSDEToolbar()/> <#assign quickToolbar = ctrl.getQuickPSDEToolbar()/>
...@@ -510,8 +510,8 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -510,8 +510,8 @@ import { FormItemModel } from '@/model/form-detail';
public rules: any = { public rules: any = {
<#list ctrl.getPSDEGridEditItems() as edititem> <#list ctrl.getPSDEGridEditItems() as edititem>
${edititem.getName()}: [ ${edititem.getName()}: [
{ required: <#if edititem.isAllowEmpty()>false<#else>true</#if>, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: <#if edititem.getCaption?? && edititem.getCaption()??>'${edititem.getCaption()} 值不能为空'<#else>'值不能为空'</#if>, trigger: 'change' }, { required: <#if edititem.isAllowEmpty()>false<#else>true</#if>, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: <#if edititem.getCaption?? && edititem.getCaption()??>'${edititem.getCaption()} '+(this.$t('app.gridpage.valueVail') as string)<#else>(this.$t('app.gridpage.valueVail') as string)</#if>, trigger: 'change' },
{ required: <#if edititem.isAllowEmpty()>false<#else>true</#if>, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: <#if edititem.getCaption?? && edititem.getCaption()??>'${edititem.getCaption()} 值不能为空'<#else>'值不能为空'</#if>, trigger: 'blur' }, { required: <#if edititem.isAllowEmpty()>false<#else>true</#if>, validator: (rule:any, value:any, callback:any) => { return (rule.required && (value === null || value === undefined || value === "")) ? false : true;}, message: <#if edititem.getCaption?? && edititem.getCaption()??>'${edititem.getCaption()} '+(this.$t('app.gridpage.valueVail') as string)<#else>(this.$t('app.gridpage.valueVail') as string)</#if>, trigger: 'blur' },
<#if ctrl.getPSDEGridEditItemVRs?? && ctrl.getPSDEGridEditItemVRs()??> <#if ctrl.getPSDEGridEditItemVRs?? && ctrl.getPSDEGridEditItemVRs()??>
<#list ctrl.getPSDEGridEditItemVRs() as fideValueRule> <#list ctrl.getPSDEGridEditItemVRs() as fideValueRule>
<#if fideValueRule.getPSDEGridEditItemName() == edititem.getName()> <#if fideValueRule.getPSDEGridEditItemName() == edititem.getName()>
...@@ -584,7 +584,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -584,7 +584,7 @@ import { FormItemModel } from '@/model/form-detail';
*/ */
public load(opt: any = {}, pageReset: boolean = false): void { public load(opt: any = {}, pageReset: 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.gridpage.notConfig.fetchAction') as string) });
return; return;
} }
if(pageReset){ if(pageReset){
...@@ -611,7 +611,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -611,7 +611,7 @@ import { FormItemModel } from '@/model/form-detail';
post.then((response: any) => { post.then((response: any) => {
if (!response.status || response.status !== 200) { if (!response.status || 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;
} }
...@@ -651,7 +651,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -651,7 +651,7 @@ import { FormItemModel } from '@/model/form-detail';
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 });
}); });
} }
...@@ -664,7 +664,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -664,7 +664,7 @@ import { FormItemModel } from '@/model/form-detail';
*/ */
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[] = [];
...@@ -698,9 +698,9 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -698,9 +698,9 @@ import { FormItemModel } from '@/model/form-detail';
}); });
if (_datas.length < 5) { if (_datas.length < 5) {
dataInfo = dataInfo + ' 共' + _datas.length + '条数据'; dataInfo = dataInfo + ' '+(this.$t('app.gridpage.totle') as string) + _datas.length + (this.$t('app.gridpage.records') as string)+(this.$t('app.gridpage.data') as string);
} else { } else {
dataInfo = dataInfo + '...' + ' 共' + _datas.length + '条数据'; dataInfo = dataInfo + '...' + ' '+(this.$t('app.gridpage.totle') as string) + _datas.length + (this.$t('app.gridpage.desc2') as string);
} }
const removeData = () => { const removeData = () => {
...@@ -715,10 +715,10 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -715,10 +715,10 @@ import { FormItemModel } from '@/model/form-detail';
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.gridpage.delDataFail') as string)+',' + response.info });
return; return;
} else { } else {
this.$Notice.success({ title: '', desc: '删除成功!' }); this.$Notice.success({ title: '', desc: (this.$t('app.gridpage.delSuccess') as string) });
} }
//删除items中已删除的项 //删除items中已删除的项
console.log(this.items); console.log(this.items);
...@@ -740,7 +740,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -740,7 +740,7 @@ import { FormItemModel } from '@/model/form-detail';
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;
} }
...@@ -751,8 +751,8 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -751,8 +751,8 @@ import { FormItemModel } from '@/model/form-detail';
dataInfo = dataInfo.replace(/[null]/g, '').replace(/[undefined]/g, ''); dataInfo = dataInfo.replace(/[null]/g, '').replace(/[undefined]/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();
}, },
...@@ -770,13 +770,13 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -770,13 +770,13 @@ import { FormItemModel } from '@/model/form-detail';
*/ */
public addBatch(arg: any = {}): void { public addBatch(arg: any = {}): 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.gridpage.notConfig.fetchAction') as string) });
return; return;
} }
if(!arg){ if(!arg){
arg = {}; arg = {};
} }
console.error("批量添加未实现"); console.error((this.$t('app.gridpage.notBatch') as string));
<#-- const post: Promise<any> = this.$http.post(this.fetchAction, arg, this.showBusyIndicator); <#-- const post: Promise<any> = this.$http.post(this.fetchAction, arg, this.showBusyIndicator);
post.then((response: any) => { post.then((response: any) => {
if (response.ret !== 200) { if (response.ret !== 200) {
...@@ -882,7 +882,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -882,7 +882,7 @@ import { FormItemModel } from '@/model/form-detail';
excel.export_json_to_excel({ excel.export_json_to_excel({
header: tHeader, //表头 必填 header: tHeader, //表头 必填
data, //具体数据 必填 data, //具体数据 必填
filename: "${ctrl.getPSAppDataEntity().getLogicName()}表", //非必填 filename: "${ctrl.getPSAppDataEntity().getLogicName()}"+(this.$t('app.gridpage.grid') as string), //非必填
autoWidth: true, //非必填 autoWidth: true, //非必填
bookType: "xlsx" //非必填 bookType: "xlsx" //非必填
}); });
...@@ -922,7 +922,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -922,7 +922,7 @@ import { FormItemModel } from '@/model/form-detail';
</#if> </#if>
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.gridpage.exportFail') as string)+',' + response.info });
return; return;
} }
try { try {
...@@ -934,7 +934,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -934,7 +934,7 @@ import { FormItemModel } from '@/model/form-detail';
if (response && response.status === 401) { if (response && response.status === 401) {
return; return;
} }
this.$Notice.error({ title: '', desc: '数据导出失败' }); this.$Notice.error({ title: '', desc: (this.$t('app.gridpage.exportFail') as string) });
}); });
} }
...@@ -1342,7 +1342,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -1342,7 +1342,7 @@ import { FormItemModel } from '@/model/form-detail';
const sums:Array<any> = []; const sums:Array<any> = [];
columns.forEach((column:any, index:number) => { columns.forEach((column:any, index:number) => {
if (index === 0) { if (index === 0) {
sums[index] = '合计'; sums[index] = (this.$t('app.gridpage.sum') as string);
return; return;
} }
if(index === (columns.length - 1)){ if(index === (columns.length - 1)){
...@@ -1422,7 +1422,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -1422,7 +1422,7 @@ import { FormItemModel } from '@/model/form-detail';
const sums:Array<any> = []; const sums:Array<any> = [];
columns.forEach((column:any, index:number) => { columns.forEach((column:any, index:number) => {
if (index === 0) { if (index === 0) {
sums[index] = '合计'; sums[index] = (this.$t('app.gridpage.sum') as string);
return; return;
}else if(index === (columns.length - 1)){ }else if(index === (columns.length - 1)){
sums[index] = ''; sums[index] = '';
...@@ -1466,7 +1466,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -1466,7 +1466,7 @@ import { FormItemModel } from '@/model/form-detail';
this.service.getAggData(this.aggAction,JSON.parse(JSON.stringify(this.context)),this.showBusyIndicator).then((response:any) =>{ this.service.getAggData(this.aggAction,JSON.parse(JSON.stringify(this.context)),this.showBusyIndicator).then((response:any) =>{
if (!response.status || response.status !== 200) { if (!response.status || 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;
} }
...@@ -1478,7 +1478,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -1478,7 +1478,7 @@ import { FormItemModel } from '@/model/form-detail';
} }
this.remoteData = {}; this.remoteData = {};
this.isDisplay = true; this.isDisplay = true;
this.$Notice.error({ title: '错误', desc: response.errorMessage }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: response.errorMessage });
}) })
} }
</#if> </#if>
...@@ -1568,7 +1568,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -1568,7 +1568,7 @@ import { FormItemModel } from '@/model/form-detail';
public async save(args: any[], params?: any, $event?: any, xData?: any){ public async save(args: any[], params?: any, $event?: any, xData?: any){
let _this = this; let _this = this;
if(!await this.validateAll()){ if(!await this.validateAll()){
this.$Notice.error({ title: '错误', desc: '值规则校验异常' }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.rulesException') as string) });
return []; return [];
} }
let successItems:any = []; let successItems:any = [];
...@@ -1578,7 +1578,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -1578,7 +1578,7 @@ import { FormItemModel } from '@/model/form-detail';
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.gridpage.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);
...@@ -1586,7 +1586,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -1586,7 +1586,7 @@ import { FormItemModel } from '@/model/form-detail';
} }
}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.gridpage.notConfig.updateAction') as string) });
}else{ }else{
Object.assign(item,{viewparams:this.viewparams}); Object.assign(item,{viewparams:this.viewparams});
<#if de??> <#if de??>
...@@ -1606,10 +1606,10 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -1606,10 +1606,10 @@ import { FormItemModel } from '@/model/form-detail';
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]);
}); });
} }
...@@ -1625,7 +1625,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -1625,7 +1625,7 @@ import { FormItemModel } from '@/model/form-detail';
*/ */
public newRow(args: any[], params?: any, $event?: any, xData?: any): void { public newRow(args: any[], params?: any, $event?: any, xData?: any): void {
if(!this.loaddraftAction){ if(!this.loaddraftAction){
this.$Notice.error({ title: '错误', desc: '${view.getName()}视图表格loaddraftAction参数未配置' }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: '${view.getName()}'+(this.$t('app.gridpage.notConfig.loaddraftAction') as string) });
return; return;
} }
let _this = this; let _this = this;
...@@ -1634,7 +1634,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -1634,7 +1634,7 @@ import { FormItemModel } from '@/model/form-detail';
post.then((response: any) => { post.then((response: any) => {
if (!response.status || response.status !== 200) { if (!response.status || 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;
} }
...@@ -1648,7 +1648,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -1648,7 +1648,7 @@ import { FormItemModel } from '@/model/form-detail';
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) });
return; return;
} }
}); });
...@@ -1718,7 +1718,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -1718,7 +1718,7 @@ import { FormItemModel } from '@/model/form-detail';
const post: Promise<any> = this.service.frontLogic(mode,JSON.parse(JSON.stringify(this.context)),arg, showloading); const post: Promise<any> = this.service.frontLogic(mode,JSON.parse(JSON.stringify(this.context)),arg, showloading);
post.then((response: any) => { post.then((response: any) => {
if (!response || response.status !== 200) { if (!response || response.status !== 200) {
this.$Notice.error({ title: '错误', desc: '表单项更新失败' }); this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.gridpage.formitemFailed') as string) });
return; return;
} }
const _data: any = response.data; const _data: any = response.data;
...@@ -1736,7 +1736,7 @@ import { FormItemModel } from '@/model/form-detail'; ...@@ -1736,7 +1736,7 @@ import { FormItemModel } from '@/model/form-detail';
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) });
return; return;
} }
}); });
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册