|
141 | 141 | </a-affix> |
142 | 142 |
|
143 | 143 | <div v-show="showAction"> |
144 | | - <keep-alive v-if="currentAction.component && (!currentAction.groupAction || selectedRowKeys.length === 0 || (this.selectedRowKeys.length > 0 && currentAction.api === 'destroyVirtualMachine'))"> |
| 144 | + <keep-alive v-if="currentAction.component && (!currentAction.invokedAsGroupAction || (this.selectedRowKeys.length > 0 && currentAction.api === 'destroyVirtualMachine'))"> |
145 | 145 | <a-modal |
146 | 146 | :visible="showAction" |
147 | 147 | :closable="true" |
|
418 | 418 | :maskClosable="false" |
419 | 419 | :footer="null" |
420 | 420 | style="top: 20px;" |
421 | | - :width="currentAction.groupAction ? modalWidth : '30vw'" |
| 421 | + :width="currentAction.invokedAsGroupAction ? modalWidth : '30vw'" |
422 | 422 | :ok-button-props="getOkProps()" |
423 | 423 | ok-text="111" |
424 | 424 | :cancel-button-props="getCancelProps()" |
|
438 | 438 | </template> |
439 | 439 | <a-spin :spinning="actionLoading" v-ctrl-enter="handleSubmit"> |
440 | 440 | <span v-if="currentAction.message"> |
441 | | - <div v-if="selectedRowKeys.length > 0 && currentAction.groupAction"> |
| 441 | + <div v-if="selectedRowKeys.length > 0 && currentAction.invokedAsGroupAction"> |
442 | 442 | <a-alert |
443 | 443 | v-if="['delete-outlined', 'DeleteOutlined', 'poweroff-outlined', 'PoweroffOutlined'].includes(currentAction.icon)" |
444 | 444 | type="error"> |
|
462 | 462 | </template> |
463 | 463 | </a-alert> |
464 | 464 | </div> |
465 | | - <div v-if="selectedRowKeys.length > 0 && currentAction.groupAction"> |
| 465 | + <div v-if="selectedRowKeys.length > 0 && currentAction.invokedAsGroupAction"> |
466 | 466 | <a-divider /> |
467 | 467 | <a-table |
468 | 468 | v-if="selectedRowKeys.length > 0" |
@@ -990,6 +990,13 @@ export default { |
990 | 990 | }, |
991 | 991 | '$store.getters.listAllProjects' (oldVal, newVal) { |
992 | 992 | this.fetchData() |
| 993 | + }, |
| 994 | + showAction (visible) { |
| 995 | + if (visible) { |
| 996 | + this.clearAutoRefresh() |
| 997 | + } else if (!this.dataView) { |
| 998 | + this.scheduleAutoRefresh() |
| 999 | + } |
993 | 1000 | } |
994 | 1001 | }, |
995 | 1002 | computed: { |
@@ -1091,7 +1098,7 @@ export default { |
1091 | 1098 | return 'inline-flex' |
1092 | 1099 | }, |
1093 | 1100 | getOkProps () { |
1094 | | - if (this.selectedRowKeys.length > 0 && this.currentAction?.groupAction) { |
| 1101 | + if (this.selectedRowKeys.length > 0 && this.currentAction?.invokedAsGroupAction) { |
1095 | 1102 | } else { |
1096 | 1103 | return { props: { type: 'primary' } } |
1097 | 1104 | } |
@@ -1137,7 +1144,7 @@ export default { |
1137 | 1144 | downloadLink.click() |
1138 | 1145 | }, |
1139 | 1146 | getCancelProps () { |
1140 | | - if (this.selectedRowKeys.length > 0 && this.currentAction?.groupAction) { |
| 1147 | + if (this.selectedRowKeys.length > 0 && this.currentAction?.invokedAsGroupAction) { |
1141 | 1148 | return { props: { type: 'primary' } } |
1142 | 1149 | } else { |
1143 | 1150 | return { props: { type: 'default' } } |
@@ -1589,7 +1596,10 @@ export default { |
1589 | 1596 | this.$router.push({ name: action.api, query }) |
1590 | 1597 | return |
1591 | 1598 | } |
1592 | | - this.currentAction = action |
| 1599 | + this.currentAction = { |
| 1600 | + ...action, |
| 1601 | + invokedAsGroupAction: !!isGroupAction |
| 1602 | + } |
1593 | 1603 | this.currentAction.params = store.getters.apis[this.currentAction.api].params |
1594 | 1604 | this.resource = action.resource |
1595 | 1605 | this.$emit('change-resource', this.resource) |
@@ -1855,7 +1865,7 @@ export default { |
1855 | 1865 | handleSubmit (e) { |
1856 | 1866 | if (this.actionLoading) return |
1857 | 1867 | this.promises = [] |
1858 | | - if (!this.dataView && this.currentAction.groupAction && this.selectedRowKeys.length > 0) { |
| 1868 | + if (!this.dataView && this.currentAction.invokedAsGroupAction && this.selectedRowKeys.length > 0) { |
1859 | 1869 | if (this.selectedRowKeys.length > 0) { |
1860 | 1870 | this.bulkColumns = this.chosenColumns |
1861 | 1871 | this.selectedItems = this.selectedItems.map(v => ({ ...v, status: 'InProgress' })) |
|
0 commit comments