Compare commits
No commits in common. "10988dae960a8be3ea9f9fcddad6a0d04d85ea9d" and "a64c0f1f69376c31703ccd39caf0f0c2f9c6cf58" have entirely different histories.
10988dae96
...
a64c0f1f69
|
|
@ -12,7 +12,7 @@
|
||||||
<div class="scTable-table" :style="{ height: _table_height }">
|
<div class="scTable-table" :style="{ height: _table_height }">
|
||||||
<el-table v-bind="$attrs" :data="tableData" :row-key="rowKey" :key="toggleIndex" ref="scTable"
|
<el-table v-bind="$attrs" :data="tableData" :row-key="rowKey" :key="toggleIndex" ref="scTable"
|
||||||
:height="height == 'auto' ? null : '100%'" :size="config.size" :border="config.border" :stripe="config.stripe"
|
:height="height == 'auto' ? null : '100%'" :size="config.size" :border="config.border" :stripe="config.stripe"
|
||||||
:summary-method="remoteSummary ? remoteSummaryMethod : summaryMethod" :expand-row-keys="expandRowKeys" @sort-change="sortChange"
|
:summary-method="remoteSummary ? remoteSummaryMethod : summaryMethod" @sort-change="sortChange"
|
||||||
@filter-change="filterChange" @selection-change="selectionChange">
|
@filter-change="filterChange" @selection-change="selectionChange">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
<template v-for="(item, index) in userColumn" :key="index">
|
<template v-for="(item, index) in userColumn" :key="index">
|
||||||
|
|
@ -97,7 +97,6 @@ export default {
|
||||||
columnSetting,
|
columnSetting,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
expendShow:{ type: Boolean, default: false },
|
|
||||||
tableName: { type: String, default: "" },
|
tableName: { type: String, default: "" },
|
||||||
apiObj: { type: Object, default: () => { } },
|
apiObj: { type: Object, default: () => { } },
|
||||||
params: { type: Object, default: () => ({}) },
|
params: { type: Object, default: () => ({}) },
|
||||||
|
|
@ -135,9 +134,6 @@ export default {
|
||||||
this.tableData = this.data;
|
this.tableData = this.data;
|
||||||
this.total = this.tableData.length;
|
this.total = this.tableData.length;
|
||||||
},
|
},
|
||||||
expendShow(){
|
|
||||||
this.toggleExpandAll();
|
|
||||||
},
|
|
||||||
apiObj() {
|
apiObj() {
|
||||||
this.tableParams = this.params;
|
this.tableParams = this.params;
|
||||||
this.refresh();
|
this.refresh();
|
||||||
|
|
@ -165,7 +161,6 @@ export default {
|
||||||
emptyText: "暂无数据",
|
emptyText: "暂无数据",
|
||||||
toggleIndex: 0,
|
toggleIndex: 0,
|
||||||
tableData: [],
|
tableData: [],
|
||||||
expandRowKeys:[],
|
|
||||||
total: 0,
|
total: 0,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
prop: null,
|
prop: null,
|
||||||
|
|
@ -527,19 +522,6 @@ export default {
|
||||||
sort(prop, order) {
|
sort(prop, order) {
|
||||||
this.$refs.scTable.sort(prop, order);
|
this.$refs.scTable.sort(prop, order);
|
||||||
},
|
},
|
||||||
// 控制展开/收起所有行
|
|
||||||
toggleExpandAll() {
|
|
||||||
const isExpandAll = this.expandRowKeys.length === this.$refs.scTable.data.length;
|
|
||||||
if (isExpandAll) {
|
|
||||||
this.expandRowKeys = []; // 收起所有
|
|
||||||
} else {
|
|
||||||
this.expandRowKeys = this.$refs.scTable.data.map(item => item.id); // 展开所有
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 每次展开状态变化时更新 expandRowKeys
|
|
||||||
handleExpandChange(row, expandedRows) {
|
|
||||||
this.expandRowKeys = expandedRows.map(row => row.is); // 根据实际的唯一标识
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue