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

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

parent 77c37d4d
...@@ -43,13 +43,14 @@ ...@@ -43,13 +43,14 @@
</div> </div>
<el-table <el-table
ref="multipleTable" ref="multipleTable"
:row-key="getRowKey"
:data="dataList" :data="dataList"
border border
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
@select="select" @select="select"
@select-all="selectAll" @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="序号" type="index" width="55" />
<el-table-column label="单位中文名称" prop="ZBPNAME_ZH" :show-overflow-tooltip="true"> <el-table-column label="单位中文名称" prop="ZBPNAME_ZH" :show-overflow-tooltip="true">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
...@@ -137,10 +138,20 @@ export default { ...@@ -137,10 +138,20 @@ export default {
} }
} }
}, },
watch: {
'fatherType': function(val) {
if (val === 'project') {
this.getList()
}
}
},
mounted() { mounted() {
this.getList() this.getList()
}, },
methods: { methods: {
getRowKey(row) {
return row.ZBP
},
/** 父组件把反显的数据(已选的)显示在列表上*/ /** 父组件把反显的数据(已选的)显示在列表上*/
toggleSelection(rows) { toggleSelection(rows) {
if (rows) { if (rows) {
...@@ -194,6 +205,7 @@ export default { ...@@ -194,6 +205,7 @@ export default {
}, },
/** 获取查询列表接口*/ /** 获取查询列表接口*/
getList() { getList() {
console.log('fatherType', this.fatherType)
if (this.fatherType === 'project') { if (this.fatherType === 'project') {
getIntercourseCompanyList(Object.assign( getIntercourseCompanyList(Object.assign(
this.serchForm, 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