提交 dfe92cf0 编写于 作者: KK's avatar KK

值规则调整

上级 39d81085
...@@ -451,11 +451,13 @@ import { Util } from '@/ibiz-core/utils'; ...@@ -451,11 +451,13 @@ import { Util } from '@/ibiz-core/utils';
* @param name 属性名 * @param name 属性名
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
public validItem(name:string):Promise<any> { public validItem(property:string, data:any):Promise<any>{
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
Util.validateItem(name,this.data[name],this.rules[name]).then(()=>{ Util.validateItem(property,data,this.rules[property]).then(()=>{
this.detailsModel[property].setError("");
resolve(true); resolve(true);
}).catch(({ errors, fields }) => { }).catch(({ errors, fields }) => {
this.detailsModel[property].setError(errors[0].message);
resolve(false); resolve(false);
}); });
}); });
...@@ -474,6 +476,7 @@ import { Util } from '@/ibiz-core/utils'; ...@@ -474,6 +476,7 @@ import { Util } from '@/ibiz-core/utils';
if (this.ignorefieldvaluechange) { if (this.ignorefieldvaluechange) {
return; return;
} }
this.validate(name,this.data[name]);
this.resetFormData({ name: name, newVal: newVal, oldVal: oldVal }); this.resetFormData({ name: name, newVal: newVal, oldVal: oldVal });
this.formLogic({ name: name, newVal: newVal, oldVal: oldVal }); this.formLogic({ name: name, newVal: newVal, oldVal: oldVal });
this.dataChang.next(JSON.stringify(this.data)); this.dataChang.next(JSON.stringify(this.data));
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册