提交 41ef7ca2 编写于 作者: WodahsOrez's avatar WodahsOrez

lxm--面板和多数据部件数据流向--fix6

上级 df4a371e
...@@ -222,7 +222,7 @@ import CodeListService from "@service/app/codelist-service"; ...@@ -222,7 +222,7 @@ import CodeListService from "@service/app/codelist-service";
/** /**
* 设置面板编辑项值变更 * 设置变更面板编辑项的值
* *
* @param data 面板数据 * @param data 面板数据
* @param {{ name: string, value: any }} $event * @param {{ name: string, value: any }} $event
...@@ -238,19 +238,10 @@ import CodeListService from "@service/app/codelist-service"; ...@@ -238,19 +238,10 @@ import CodeListService from "@service/app/codelist-service";
} }
data[$event.name] = $event.value; data[$event.name] = $event.value;
this.panelEditItemChange(data, $event.name, $event.value); this.panelEditItemChange(data, $event.name, $event.value);
// 面板数据变化事件
if((this.dataModel.getDataItems instanceof Function) && this.dataModel.getDataItems().length >0){
let modelitem =this.dataModel.getDataItems().find((item:any) =>{
return item.name === $event.name;
})
if(modelitem){
this.$emit('panelDataChange',{[modelitem.prop]: $event.value});
}
}
} }
/** /**
* 面板编辑项值变化 * 面板编辑项值变化后续操作
* *
* @public * @public
* @param data 面板数据 * @param data 面板数据
...@@ -260,7 +251,15 @@ import CodeListService from "@service/app/codelist-service"; ...@@ -260,7 +251,15 @@ import CodeListService from "@service/app/codelist-service";
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public panelEditItemChange(data: any, property: string, value: any){ public panelEditItemChange(data: any, property: string, value: any){
// 面板数据变化事件
if((this.dataModel.getDataItems instanceof Function) && this.dataModel.getDataItems().length >0){
let modelitem =this.dataModel.getDataItems().find((item:any) =>{
return item.name === property;
})
if(modelitem){
this.$emit('panelDataChange',{[modelitem.prop]: value});
}
}
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册