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

优化表格值规则校验提示

上级 93cdc68b
......@@ -715,16 +715,18 @@ import { Environment } from '@/environments/environment';
this.errorMessages = [];
let validateState = true;
let index = -1;
for(let item of this.items){
for (let item of this.items) {
let tempMessage: string = '';
index++;
if(item.rowDataState === "create" || item.rowDataState === "update"){
for(let property of Object.keys(this.rules)){
if(!await this.validate(property,item,index)){
if (item.rowDataState === "create" || item.rowDataState === "update") {
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);
tempMessage = tempMessage + '<p>' + this.gridItemsModel[index][property].error + '<p>';
}
}
}
this.errorMessages.push(tempMessage);
}
return validateState;
}
......@@ -1958,11 +1960,7 @@ import { Environment } from '@/environments/environment';
}
if (!await this.validateAll()) {
if(this.errorMessages && this.errorMessages.length > 0) {
let descMessage: string = '';
this.errorMessages.forEach((message: any) => {
descMessage = descMessage + '<p>' + message + '<p>';
})
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: descMessage });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: this.errorMessages[0] });
} else {
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: (this.$t('app.commonWords.rulesException') as string) });
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册