收益管理的图形分析
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
</el-row>
|
||||
<!-- 表格数据 -->
|
||||
<el-table v-loading="loading" :data="tableList" ref="selChangeList" @selection-change="handleSelectionChange">
|
||||
<el-table-column v-if="!config && config.colHiddenCheck" type="selection" width="55" align="center" />
|
||||
<el-table-column v-if="!(config && config.colHiddenCheck)" type="selection" width="55" align="center" />
|
||||
<template v-for="(column, key, index) of columns">
|
||||
<el-table-column :label="column.label" :key="key" :prop="key" :width="column.width" min-width="100px" v-if="column && column.visible" align="center" :show-overflow-tooltip="true">
|
||||
<!-- 插槽 自定义列表表头数据格式 -->
|
||||
@@ -27,6 +27,7 @@
|
||||
<!-- 传递行数据、行索引等信息到父组件的插槽 -->
|
||||
<slot
|
||||
:name="column.slotName"
|
||||
:valueKey="key"
|
||||
:row="scope.row"
|
||||
:rowIndex="scope.$index"
|
||||
:column="column"
|
||||
@@ -102,39 +103,44 @@
|
||||
|
||||
/** 多选框选中数据 */
|
||||
handleSelectionChange(selection) {
|
||||
this.selectList = [];
|
||||
this.ids = [];
|
||||
if (this.isProcessing) return;
|
||||
this.isProcessing = true;
|
||||
// 当选中行有关联值时,默认把所关联的的行选中
|
||||
selection.forEach(res => {
|
||||
if (res && res.relevance) {
|
||||
let selArr = [res];
|
||||
Object.keys(res.relevance).forEach(item => {
|
||||
res.relevance[item].forEach(val => {
|
||||
this.tableList.some(tabVal => {
|
||||
if (tabVal[item] === val) {
|
||||
selArr.push(tabVal);
|
||||
return true;
|
||||
}
|
||||
if (this.config && this.config['tableKey']) {
|
||||
this.selectList = [];
|
||||
this.ids = [];
|
||||
if (this.isProcessing) return;
|
||||
this.isProcessing = true;
|
||||
// 当选中行有关联值时,默认把所关联的的行选中
|
||||
selection.forEach(res => {
|
||||
if (res && res.relevance) {
|
||||
let selArr = [res];
|
||||
Object.keys(res.relevance).forEach(item => {
|
||||
res.relevance[item].forEach(val => {
|
||||
this.tableList.some(tabVal => {
|
||||
if (tabVal[item] === val) {
|
||||
selArr.push(tabVal);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
this.selectList = this.selectList.concat(selArr);
|
||||
this.ids = this.ids.concat(selArr.map(item => item.id));
|
||||
} else {
|
||||
if (!this.ids.includes(res.id)) {
|
||||
this.selectList = this.selectList.concat(res);
|
||||
this.ids = this.ids.concat(res.id);
|
||||
this.selectList = this.selectList.concat(selArr);
|
||||
this.ids = this.ids.concat(selArr.map(item => item.id));
|
||||
} else {
|
||||
if (!this.ids.includes(res.id)) {
|
||||
this.selectList = this.selectList.concat(res);
|
||||
this.ids = this.ids.concat(res.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.isProcessing = false;
|
||||
});
|
||||
this.selectList.forEach(val => {
|
||||
this.$refs.selChangeList.toggleRowSelection(val,true);
|
||||
});
|
||||
this.isProcessing = false;
|
||||
});
|
||||
this.selectList.forEach(val => {
|
||||
this.$refs.selChangeList.toggleRowSelection(val,true);
|
||||
});
|
||||
} else {
|
||||
this.selectList = selection;
|
||||
this.ids = selection.map(item => item.id);
|
||||
}
|
||||
},
|
||||
// 提供给父组件调用的方法:返回当前表格的选中数据
|
||||
// 提供给父组件调用的方法:返回当前表格的选中数据 资源监控策略和资源监控模块使用
|
||||
getSelectedData() {
|
||||
return {
|
||||
tableKey: this.config.tableKey, // 表格唯一标识
|
||||
|
||||
Reference in New Issue
Block a user