提交 2e124c30 编写于 作者: Mosher's avatar Mosher

行编辑时合并行主键到上下文中 --- fix1

上级 32dc6846
...@@ -495,6 +495,14 @@ import { Environment } from '@/environments/environment'; ...@@ -495,6 +495,14 @@ import { Environment } from '@/environments/environment';
*/ */
public isDisplay:boolean = <#if ctrl.getAggMode() == "ALL">false<#else>true</#if>; public isDisplay:boolean = <#if ctrl.getAggMode() == "ALL">false<#else>true</#if>;
/**
* 表格行编辑项校验错误提示信息
*
* @type {boolean}
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public errorMessage: Array<any> = [];
/** /**
* 部件刷新 * 部件刷新
* *
...@@ -704,6 +712,7 @@ import { Environment } from '@/environments/environment'; ...@@ -704,6 +712,7 @@ import { Environment } from '@/environments/environment';
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public async validateAll(){ public async validateAll(){
this.errorMessages = [];
let validateState = true; let validateState = true;
let index = -1; let index = -1;
for(let item of this.items){ for(let item of this.items){
...@@ -712,6 +721,7 @@ import { Environment } from '@/environments/environment'; ...@@ -712,6 +721,7 @@ import { Environment } from '@/environments/environment';
for(let property of Object.keys(this.rules)){ for(let property of Object.keys(this.rules)){
if(!await this.validate(property,item,index)){ if(!await this.validate(property,item,index)){
validateState = false; validateState = false;
this.errorMessages.push(this.gridItemsModel[index][property].error);
} }
} }
} }
...@@ -1947,7 +1957,13 @@ import { Environment } from '@/environments/environment'; ...@@ -1947,7 +1957,13 @@ import { Environment } from '@/environments/environment';
} }
} }
if(!await this.validateAll()){ if(!await this.validateAll()){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.rulesException') as string) }); if(this.errorMessages $$ this.errorMessages.length > 0) {
this.errorMessages.forEach((message: any) => {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: message });
})
} else {
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 = [];
...@@ -2102,16 +2118,14 @@ import { Environment } from '@/environments/environment'; ...@@ -2102,16 +2118,14 @@ import { Environment } from '@/environments/environment';
} }
<#if ctrl.getAllPSDEGridColumns?? && ctrl.getAllPSDEGridColumns()??> <#if ctrl.getAllPSDEGridColumns?? && ctrl.getAllPSDEGridColumns()??>
<#list ctrl.getAllPSDEGridColumns() as column> <#list ctrl.getAllPSDEGridColumns() as column>
<#if column.getPSAppDEField?? && column.getPSAppDEField()?? && column.getPSAppDEField().getPSDEField?? && column.getPSAppDEField().getPSDEField()?? > <#if column.getPSAppDEField?? && column.getPSAppDEField()?? && column.getPSAppDEField().isKeyField() && appde.getKeyPSAppDEField()?? && appde.getKeyPSAppDEField().getCodeName() == column.getPSAppDEField().getCodeName()>
<#if column.getPSAppDEField().getPSDEField().isKeyDEField() == true> <#assign columnKeyName = column.getName()?lower_case >
<#assign keyFieldName = column.getPSAppDEField().getPSDEField().getCodeName()?lower_case >
</#if>
</#if> </#if>
</#list> </#list>
</#if> </#if>
let tempContext: any = this.$util.deepCopy(this.context); let tempContext: any = this.$util.deepCopy(this.context);
<#if keyFieldName??> <#if columnKeyName??>
Object.is(tempContext, { ${keyFieldName?lower_case}: data.${keyFieldName?lower_case} }); Object.is(tempContext, { ${appde.getCodeName()?lower_case}: data.${columnKeyName} });
</#if> </#if>
const arg: any = JSON.parse(JSON.stringify(data)); const arg: any = JSON.parse(JSON.stringify(data));
Object.assign(arg,{viewparams:this.viewparams}); Object.assign(arg,{viewparams:this.viewparams});
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册