-
+
@@ -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);
});
}