Skip to content

Commit e980215

Browse files
royalpioneeriSecloud
authored andcommitted
feat(frontend): 支持故障池、待回收池 #7881 #7973
# Reviewed, transaction id: 24393
1 parent 071818d commit e980215

File tree

9 files changed

+19
-31
lines changed

9 files changed

+19
-31
lines changed

dbm-ui/frontend/src/locales/zh-cn.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3723,5 +3723,7 @@
37233723
"新建标签": "新建标签",
37243724
"所有 IP": "所有 IP",
37253725
"已选 IP": "已选 IP",
3726+
"业务资源池": "业务资源池",
3727+
"冷/热节点": "冷/热节点",
37263728
"这行勿动!新增翻译请在上一行添加!": ""
37273729
}

dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/Index.vue

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,10 @@
3030
<ImportHostBtn
3131
class="w-88"
3232
@export-host="handleImportHost" />
33-
<BkDropdown
34-
:is-show="isBatchOperationShow"
35-
trigger="manual">
33+
<BkDropdown>
3634
<BkButton
3735
class="ml-8"
38-
:disabled="selectionHostIdList.length < 1"
39-
@click="() => handleBatchOperationShow(true)">
36+
:disabled="selectionHostIdList.length < 1">
4037
{{ t('批量操作') }}
4138
<DbIcon type="down-big" />
4239
</BkButton>
@@ -202,9 +199,8 @@
202199
const isShowBatchConvertToBusiness = ref(false);
203200
const isShowBatchAssign = ref(false);
204201
const isShowUpdateAssign = ref(false);
205-
const curEditData = ref<DbResourceModel>();
202+
const curEditData = ref<DbResourceModel>({} as DbResourceModel);
206203
const isSelectedSameBiz = ref(false);
207-
const isBatchOperationShow = ref(false);
208204
209205
const curBizId = computed(() => {
210206
let bizId = undefined;
@@ -410,7 +406,6 @@
410406
// 批量设置
411407
const handleShowBatchSetting = () => {
412408
isShowBatchSetting.value = true;
413-
handleBatchOperationShow(false);
414409
};
415410
416411
// 复制所有主机
@@ -474,34 +469,28 @@
474469
475470
const handleShowBatchCovertToPublic = () => {
476471
isShowBatchCovertToPublic.value = true;
477-
handleBatchOperationShow(false);
478472
}
479473
480474
const handleShowBatchMoveToRecyclePool = () => {
481475
isShowBatchMoveToRecyclePool.value = true;
482-
handleBatchOperationShow(false);
483476
};
484477
485478
const handleShowBatchMoveToFaultPool = () => {
486479
isShowBatchMoveToFaultPool.value = true;
487-
handleBatchOperationShow(false);
488480
}
489481
490482
const handleShowBatchUndoImport = () => {
491483
isShowBatchUndoImport.value = true;
492-
handleBatchOperationShow(false);
493484
};
494485
495486
const handleShowBatchConvertToBusiness = () => {
496487
isShowBatchConvertToBusiness.value = true;
497-
handleBatchOperationShow(false);
498488
}
499489
500490
const handleShowBatchAssign = () => {
501491
if (isSelectedSameBiz.value) {
502492
isShowBatchAssign.value = true;
503493
}
504-
handleBatchOperationShow(false);
505494
}
506495
507496
const handleEdit = (data: DbResourceModel) => {
@@ -514,13 +503,10 @@
514503
Object.values(selectionHostIdList.value).forEach((hostId) => {
515504
tableRef.value.removeSelectByKey(hostId);
516505
});
506+
selectionListWholeDataMemo = [];
517507
selectionHostIdList.value = [];
518508
}
519509
520-
const handleBatchOperationShow = (val: boolean) => {
521-
isBatchOperationShow.value = val;
522-
}
523-
524510
onMounted(() => {
525511
fetchData();
526512
});

dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-assign/Index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@
9696
const { loading: isUpdating, run: runUpdate } = useRequest(updateResource, {
9797
manual: true,
9898
onSuccess() {
99-
handleCancel();
99+
emits('refresh');
100+
isShow.value = false;
100101
messageSuccess('设置成功');
101102
},
102103
});
@@ -125,7 +126,6 @@
125126
};
126127
127128
const handleCancel = () => {
128-
emits('refresh');
129129
isShow.value = false;
130130
};
131131
</script>

dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-convert-to-business/Index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@
5454
const { loading: isUpdating, run: runUpdate } = useRequest(updateResource, {
5555
manual: true,
5656
onSuccess() {
57-
handleCancel();
57+
emits('refresh');
58+
isShow.value = false;
5859
messageSuccess(t('设置成功'));
5960
},
6061
});
@@ -70,7 +71,6 @@
7071
};
7172
7273
const handleCancel = () => {
73-
emits('refresh');
7474
isShow.value = false;
7575
};
7676
</script>

dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-covert-to-public/Index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
const { loading: isUpdating, run: runUpdate } = useRequest(updateResource, {
5656
manual: true,
5757
onSuccess() {
58-
handleCancel();
58+
isShow.value = false;
59+
emits('refresh');
5960
messageSuccess(t('设置成功'));
6061
},
6162
});
@@ -72,6 +73,5 @@
7273
7374
const handleCancel = () => {
7475
isShow.value = false;
75-
emits('refresh');
7676
};
7777
</script>

dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-move-to-fault-pool/Index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
const { loading: isRemoving, run: runDelete } = useRequest(removeResource, {
4444
manual: true,
4545
onSuccess() {
46-
handleCancel();
46+
emits('refresh');
47+
isShow.value = false;
4748
messageSuccess(t('设置成功'));
4849
},
4950
});
@@ -56,7 +57,6 @@
5657
};
5758
5859
const handleCancel = () => {
59-
emits('refresh');
6060
isShow.value = false;
6161
};
6262
</script>

dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-move-to-recycle-pool/Index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
const { loading: isRemoving, run: runDelete } = useRequest(removeResource, {
4444
manual: true,
4545
onSuccess() {
46-
handleCancel();
46+
emits('refresh');
47+
isShow.value = false;
4748
messageSuccess(t('设置成功'));
4849
},
4950
});
@@ -56,7 +57,6 @@
5657
};
5758
5859
const handleCancel = () => {
59-
emits('refresh');
6060
isShow.value = false;
6161
};
6262
</script>

dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-undo-import/Index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
const { loading: isRemoving, run: runDelete } = useRequest(removeResource, {
4444
manual: true,
4545
onSuccess() {
46-
handleCancel();
46+
emits('refresh');
47+
isShow.value = false;
4748
messageSuccess(t('设置成功'));
4849
},
4950
});
@@ -56,7 +57,6 @@
5657
};
5758
5859
const handleCancel = () => {
59-
emits('refresh');
6060
isShow.value = false;
6161
};
6262
</script>

dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/update-assign/Index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
watch(
105105
() => props.editData,
106106
() => {
107-
if (!props.editData) {
107+
if (!Object.keys(props.editData).length) {
108108
return;
109109
}
110110
formData.for_biz = props.editData.for_biz.bk_biz_id;

0 commit comments

Comments
 (0)