查询指标依然保持指标的选中状态

zqqdev
CherrysChang 5 years ago
parent 5292c26b5c
commit 5995db5d95
  1. 24
      src/views/train/case-detail.vue

@ -24,8 +24,8 @@
<el-row :gutter="20" type="flex">
<el-col :span="1" style="text-align:center;padding-top: 182px;width: 88px;" class="item-required">量化指标</el-col>
<el-col :span="7">
<el-table ref="leftTable" :data="getFilterDataBySearchName" height="400" border highlight-current-row tooltip-effect="dark" @selection-change="leftSelectionChange">
<el-table-column type="selection" width="55"></el-table-column>
<el-table ref="leftTable" :data="getFilterDataBySearchName" :row-key="getRowKey" height="400" border highlight-current-row tooltip-effect="dark" @selection-change="leftSelectionChange">
<el-table-column type="selection" :reserve-selection="true" width="55"></el-table-column>
<el-table-column header-align="right" label="未选择 10/10">
<el-table-column prop="name" label="名称" show-overflow-tooltip>
<template slot="header" slot-scope="scope">
@ -192,25 +192,11 @@
console.info(error)
});
},
getRowKey (row) {// key
return row.id //idrowdatatableData
},
leftSelectionChange(selection) {
debugger;
//ZqqTODO
this.leftSelectedRows = selection;
let searchData = this.getFilterDataBySearchName;
searchData.forEach(item => {
if (selection.filter(itemTmp => {return itemTmp.id == item.id;}).length > 0) {
item._checked = true;
}else{
item._checked = false;
}
})
this.leftDictTargetList.forEach(item2 => {
for (let i = 0; i < searchData.length; i++) {
if (searchData[i].id==item2.id){
item2._checked = searchData[i]._checked; //searchData[i]._checked,true
}
}
})
},
addToRight() {
console.info("addToRight")

Loading…
Cancel
Save