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

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

上级 32dc6846
......@@ -495,6 +495,14 @@ import { Environment } from '@/environments/environment';
*/
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';
* @memberof ${srfclassname('${ctrl.codeName}')}Base
*/
public async validateAll(){
this.errorMessages = [];
let validateState = true;
let index = -1;
for(let item of this.items){
......@@ -712,6 +721,7 @@ import { Environment } from '@/environments/environment';
for(let property of Object.keys(this.rules)){
if(!await this.validate(property,item,index)){
validateState = false;
this.errorMessages.push(this.gridItemsModel[index][property].error);
}
}
}
......@@ -1947,7 +1957,13 @@ import { Environment } from '@/environments/environment';
}
}
if(!await this.validateAll()){
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 [];
}
let successItems:any = [];
......@@ -2102,16 +2118,14 @@ import { Environment } from '@/environments/environment';
}
<#if ctrl.getAllPSDEGridColumns?? && ctrl.getAllPSDEGridColumns()??>
<#list ctrl.getAllPSDEGridColumns() as column>
<#if column.getPSAppDEField?? && column.getPSAppDEField()?? && column.getPSAppDEField().getPSDEField?? && column.getPSAppDEField().getPSDEField()?? >
<#if column.getPSAppDEField().getPSDEField().isKeyDEField() == true>
<#assign keyFieldName = column.getPSAppDEField().getPSDEField().getCodeName()?lower_case >
</#if>
<#if column.getPSAppDEField?? && column.getPSAppDEField()?? && column.getPSAppDEField().isKeyField() && appde.getKeyPSAppDEField()?? && appde.getKeyPSAppDEField().getCodeName() == column.getPSAppDEField().getCodeName()>
<#assign columnKeyName = column.getName()?lower_case >
</#if>
</#list>
</#if>
let tempContext: any = this.$util.deepCopy(this.context);
<#if keyFieldName??>
Object.is(tempContext, { ${keyFieldName?lower_case}: data.${keyFieldName?lower_case} });
<#if columnKeyName??>
Object.is(tempContext, { ${appde.getCodeName()?lower_case}: data.${columnKeyName} });
</#if>
const arg: any = JSON.parse(JSON.stringify(data));
Object.assign(arg,{viewparams:this.viewparams});
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册