提交 9ac37b02 编写于 作者: WodahsOrez's avatar WodahsOrez

lxm--数据多选择视图逻辑调整

上级 8c5bd608
...@@ -87,6 +87,7 @@ if(this.viewparams.selectedData){ ...@@ -87,6 +87,7 @@ if(this.viewparams.selectedData){
} }
const removeSelect: boolean = this.viewSelections.some((selection: any) => selection._select); const removeSelect: boolean = this.viewSelections.some((selection: any) => selection._select);
this.containerModel.view_leftbtn.disabled = !removeSelect; this.containerModel.view_leftbtn.disabled = !removeSelect;
this.selectedData = JSON.stringify(this.viewSelections);
} }
/** /**
...@@ -107,6 +108,7 @@ if(this.viewparams.selectedData){ ...@@ -107,6 +108,7 @@ if(this.viewparams.selectedData){
}); });
const removeSelect: boolean = this.viewSelections.some((selection: any) => selection._select); const removeSelect: boolean = this.viewSelections.some((selection: any) => selection._select);
this.containerModel.view_leftbtn.disabled = !removeSelect; this.containerModel.view_leftbtn.disabled = !removeSelect;
this.selectedData = JSON.stringify(this.viewSelections);
} }
/** /**
...@@ -119,13 +121,17 @@ if(this.viewparams.selectedData){ ...@@ -119,13 +121,17 @@ if(this.viewparams.selectedData){
if (!Object.is(model.type, 'PICKUPVIEWPANEL')) { if (!Object.is(model.type, 'PICKUPVIEWPANEL')) {
return; return;
} }
let newSelections:any[] = [];
model.selections.forEach((item: any) => { model.selections.forEach((item: any) => {
const index: number = this.viewSelections.findIndex((selection: any) => Object.is(item.srfkey, selection.srfkey)); const index: number = this.viewSelections.findIndex((selection: any) => Object.is(item.srfkey, selection.srfkey));
if (index === -1) { if (index === -1) {
let _item: any = { ...JSON.parse(JSON.stringify(item)) }; let _item: any = { ...JSON.parse(JSON.stringify(item)) };
Object.assign(_item, { _select: false }) Object.assign(_item, { _select: false })
this.viewSelections.push(_item); newSelections.push(_item);
}else{
newSelections.push(this.viewSelections[index]);
} }
this.viewSelections = newSelections;
}); });
}); });
} }
...@@ -138,6 +144,7 @@ if(this.viewparams.selectedData){ ...@@ -138,6 +144,7 @@ if(this.viewparams.selectedData){
public onCLickAllLeft():void { public onCLickAllLeft():void {
this.viewSelections = []; this.viewSelections = [];
this.containerModel.view_leftbtn.disabled = true; this.containerModel.view_leftbtn.disabled = true;
this.selectedData = JSON.stringify(this.viewSelections);
} }
/** /**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册