Commit 65b57bdf authored by 张伯涛's avatar 张伯涛

修改table默认勾选(进来显示勾选然后勾选消失)问题 :row-key="getRowKey"属性!!!!

parent 77c37d4d
......@@ -43,13 +43,14 @@
</div>
<el-table
ref="multipleTable"
:row-key="getRowKey"
:data="dataList"
border
@selection-change="handleSelectionChange"
@select="select"
@select-all="selectAll"
>
<el-table-column type="selection" width="55" />
<el-table-column type="selection" width="55" :reserve-selection="true" />
<el-table-column label="序号" type="index" width="55" />
<el-table-column label="单位中文名称" prop="ZBPNAME_ZH" :show-overflow-tooltip="true">
<template slot-scope="{ row }">
......@@ -137,10 +138,20 @@ export default {
}
}
},
watch: {
'fatherType': function(val) {
if (val === 'project') {
this.getList()
}
}
},
mounted() {
this.getList()
},
methods: {
getRowKey(row) {
return row.ZBP
},
/** 父组件把反显的数据(已选的)显示在列表上*/
toggleSelection(rows) {
if (rows) {
......@@ -194,6 +205,7 @@ export default {
},
/** 获取查询列表接口*/
getList() {
console.log('fatherType', this.fatherType)
if (this.fatherType === 'project') {
getIntercourseCompanyList(Object.assign(
this.serchForm,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment