赞
踩
从列表【编辑】按钮进入能获取到选择的数据集与选择的算法等信息。
一开始以为是折叠面板刷新问题,勾选框消除不掉,只有折叠之后再打开,勾选框才会消除掉。
后来发现是初始化问题。修改后的代码如下。
<el-table :data="trainDataTable" ref="trainCheck" :span-method="objectSpanMethod" @selection-change="trainChoseSplit" :row-key="(row) => row.id" border height="550" > <el-table-column prop="sourceName" label="数据集"> </el-table-column> <el-table-column prop="groupName" label="分组"> </el-table-column> <el-table-column prop="splitName" label="分片"> </el-table-column> <el-table-column prop="weight" label="比重"> </el-table-column> <el-table-column prop="description" label="描述"> </el-table-column> <el-table-column prop="createTime" label="创建时间"> </el-table-column> <el-table-column label="选择" width='90px' align="center" type="selection" :reserve-selection="true"> <!-- <template slot-scope="scope"> <el-checkbox :value="trainData[scope.$index].checked" @change="trainChoseSplit(scope.row)" ></el-checkbox> </template> --> </el-table-column> </el-table>
defaultChecked(trainData) {
var that = this;
that.$nextTick(() => {
console.log(this.$refs.trainCheck);
that.trainDataTable.forEach(row => {
if (row.id === trainData) {
console.log('row');
that.trainMultipleSelection.push(row)
that.$refs.trainCheck.toggleRowSelection(row, true);
}
});
});
},
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。