From b325f42598f5e46c11c78aa96cca93877b2c6f93 Mon Sep 17 00:00:00 2001 From: wenyann Date: Tue, 29 Jun 2021 18:35:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=85=A8=E9=80=89=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/components/table/MsTable.vue | 3 ++- .../track/case/components/ShowMoreBtn.vue | 20 +++++++++++++++++-- frontend/src/common/js/tableUtils.js | 14 +++++++++++-- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/frontend/src/business/components/common/components/table/MsTable.vue b/frontend/src/business/components/common/components/table/MsTable.vue index 977fc2fdc4..a691c1672e 100644 --- a/frontend/src/business/components/common/components/table/MsTable.vue +++ b/frontend/src/business/components/common/components/table/MsTable.vue @@ -29,7 +29,8 @@ :resizable="false" align="center"> diff --git a/frontend/src/business/components/track/case/components/ShowMoreBtn.vue b/frontend/src/business/components/track/case/components/ShowMoreBtn.vue index 901585e250..f93e2f8bb0 100644 --- a/frontend/src/business/components/track/case/components/ShowMoreBtn.vue +++ b/frontend/src/business/components/track/case/components/ShowMoreBtn.vue @@ -2,7 +2,8 @@
- + @@ -24,7 +25,8 @@ name: "ShowMoreBtn", data() { return { - disabled: false + disabled: false, + showTool: false }; }, props: { @@ -32,10 +34,24 @@ type: Boolean, default: false }, + isShowTool: { + type: Boolean, + default: false + }, buttons: Array, row: Object, size: Number }, + watch: { + isShowTool(val) { + if (val) { + this.showTool = val; + setTimeout(() => { + this.showTool = false; + }, 1000); + } + } + }, created() { if (this.trashEnable) { this.buttons.splice(1, 1); diff --git a/frontend/src/common/js/tableUtils.js b/frontend/src/common/js/tableUtils.js index 8ee943d787..c3f2ed2d8d 100644 --- a/frontend/src/common/js/tableUtils.js +++ b/frontend/src/common/js/tableUtils.js @@ -7,13 +7,19 @@ export function _handleSelectAll(component, selection, tableData, selectRows, co if (selection.length > 0) { if (selection.length === 1) { selection.hashTree = []; - tableData.forEach(item => { + tableData.forEach((item, index) => { + if (index === 0) { + component.$set(item, "showTool", true); + } component.$set(item, "showMore", true); selectRows.add(item); }); } else { - tableData.forEach(item => { + tableData.forEach((item, index) => { item.hashTree = []; + if (index === 0) { + component.$set(item, "showTool", true); + } component.$set(item, "showMore", true); selectRows.add(item); }); @@ -21,6 +27,7 @@ export function _handleSelectAll(component, selection, tableData, selectRows, co } else { selectRows.clear(); tableData.forEach(item => { + component.$set(item, "showTool", false); component.$set(item, "showMore", false); }); if (condition) { @@ -32,14 +39,17 @@ export function _handleSelectAll(component, selection, tableData, selectRows, co export function _handleSelect(component, selection, row, selectRows) { row.hashTree = []; if (selectRows.has(row)) { + component.$set(row, "showTool", false); component.$set(row, "showMore", false); selectRows.delete(row); } else { + component.$set(row, "showTool", true); component.$set(row, "showMore", true); selectRows.add(row); } let arr = Array.from(selectRows); arr.forEach(row => { + component.$set(row, "showTool", true); component.$set(row, "showMore", true); }); }