diff --git a/dbm-ui/frontend/src/locales/zh-cn.json b/dbm-ui/frontend/src/locales/zh-cn.json index 43559a4aff..4565e5c6cd 100644 --- a/dbm-ui/frontend/src/locales/zh-cn.json +++ b/dbm-ui/frontend/src/locales/zh-cn.json @@ -3723,5 +3723,7 @@ "新建标签": "新建标签", "所有 IP": "所有 IP", "已选 IP": "已选 IP", + "业务资源池": "业务资源池", + "冷/热节点": "冷/热节点", "这行勿动!新增翻译请在上一行添加!": "" } diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/Index.vue b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/Index.vue index 2baef51252..7bc58fbd30 100644 --- a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/Index.vue +++ b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/Index.vue @@ -30,13 +30,10 @@ - + + :disabled="selectionHostIdList.length < 1"> {{ t('批量操作') }} @@ -202,9 +199,8 @@ const isShowBatchConvertToBusiness = ref(false); const isShowBatchAssign = ref(false); const isShowUpdateAssign = ref(false); - const curEditData = ref(); + const curEditData = ref({} as DbResourceModel); const isSelectedSameBiz = ref(false); - const isBatchOperationShow = ref(false); const curBizId = computed(() => { let bizId = undefined; @@ -410,7 +406,6 @@ // 批量设置 const handleShowBatchSetting = () => { isShowBatchSetting.value = true; - handleBatchOperationShow(false); }; // 复制所有主机 @@ -474,34 +469,28 @@ const handleShowBatchCovertToPublic = () => { isShowBatchCovertToPublic.value = true; - handleBatchOperationShow(false); } const handleShowBatchMoveToRecyclePool = () => { isShowBatchMoveToRecyclePool.value = true; - handleBatchOperationShow(false); }; const handleShowBatchMoveToFaultPool = () => { isShowBatchMoveToFaultPool.value = true; - handleBatchOperationShow(false); } const handleShowBatchUndoImport = () => { isShowBatchUndoImport.value = true; - handleBatchOperationShow(false); }; const handleShowBatchConvertToBusiness = () => { isShowBatchConvertToBusiness.value = true; - handleBatchOperationShow(false); } const handleShowBatchAssign = () => { if (isSelectedSameBiz.value) { isShowBatchAssign.value = true; } - handleBatchOperationShow(false); } const handleEdit = (data: DbResourceModel) => { @@ -514,13 +503,10 @@ Object.values(selectionHostIdList.value).forEach((hostId) => { tableRef.value.removeSelectByKey(hostId); }); + selectionListWholeDataMemo = []; selectionHostIdList.value = []; } - const handleBatchOperationShow = (val: boolean) => { - isBatchOperationShow.value = val; - } - onMounted(() => { fetchData(); }); diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-assign/Index.vue b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-assign/Index.vue index bcc5d1fc10..5454c8e151 100644 --- a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-assign/Index.vue +++ b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-assign/Index.vue @@ -96,7 +96,8 @@ const { loading: isUpdating, run: runUpdate } = useRequest(updateResource, { manual: true, onSuccess() { - handleCancel(); + emits('refresh'); + isShow.value = false; messageSuccess('设置成功'); }, }); @@ -125,7 +126,6 @@ }; const handleCancel = () => { - emits('refresh'); isShow.value = false; }; diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-convert-to-business/Index.vue b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-convert-to-business/Index.vue index 9a20fd0f79..69284083cb 100644 --- a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-convert-to-business/Index.vue +++ b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-convert-to-business/Index.vue @@ -54,7 +54,8 @@ const { loading: isUpdating, run: runUpdate } = useRequest(updateResource, { manual: true, onSuccess() { - handleCancel(); + emits('refresh'); + isShow.value = false; messageSuccess(t('设置成功')); }, }); @@ -70,7 +71,6 @@ }; const handleCancel = () => { - emits('refresh'); isShow.value = false; }; diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-covert-to-public/Index.vue b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-covert-to-public/Index.vue index 091ffa1bdb..0fd8bf3eab 100644 --- a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-covert-to-public/Index.vue +++ b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-covert-to-public/Index.vue @@ -55,7 +55,8 @@ const { loading: isUpdating, run: runUpdate } = useRequest(updateResource, { manual: true, onSuccess() { - handleCancel(); + isShow.value = false; + emits('refresh'); messageSuccess(t('设置成功')); }, }); @@ -72,6 +73,5 @@ const handleCancel = () => { isShow.value = false; - emits('refresh'); }; diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-move-to-fault-pool/Index.vue b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-move-to-fault-pool/Index.vue index 6cefab2c9c..ccf82d7cc9 100644 --- a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-move-to-fault-pool/Index.vue +++ b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-move-to-fault-pool/Index.vue @@ -43,7 +43,8 @@ const { loading: isRemoving, run: runDelete } = useRequest(removeResource, { manual: true, onSuccess() { - handleCancel(); + emits('refresh'); + isShow.value = false; messageSuccess(t('设置成功')); }, }); @@ -56,7 +57,6 @@ }; const handleCancel = () => { - emits('refresh'); isShow.value = false; }; diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-move-to-recycle-pool/Index.vue b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-move-to-recycle-pool/Index.vue index 9a4d01ddb1..4d1fdfba30 100644 --- a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-move-to-recycle-pool/Index.vue +++ b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-move-to-recycle-pool/Index.vue @@ -43,7 +43,8 @@ const { loading: isRemoving, run: runDelete } = useRequest(removeResource, { manual: true, onSuccess() { - handleCancel(); + emits('refresh'); + isShow.value = false; messageSuccess(t('设置成功')); }, }); @@ -56,7 +57,6 @@ }; const handleCancel = () => { - emits('refresh'); isShow.value = false; }; diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-undo-import/Index.vue b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-undo-import/Index.vue index 12250d2e10..bbda7b64d7 100644 --- a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-undo-import/Index.vue +++ b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-undo-import/Index.vue @@ -43,7 +43,8 @@ const { loading: isRemoving, run: runDelete } = useRequest(removeResource, { manual: true, onSuccess() { - handleCancel(); + emits('refresh'); + isShow.value = false; messageSuccess(t('设置成功')); }, }); @@ -56,7 +57,6 @@ }; const handleCancel = () => { - emits('refresh'); isShow.value = false; }; diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/update-assign/Index.vue b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/update-assign/Index.vue index c5167edaf1..26365e0b31 100644 --- a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/update-assign/Index.vue +++ b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/update-assign/Index.vue @@ -104,7 +104,7 @@ watch( () => props.editData, () => { - if (!props.editData) { + if (!Object.keys(props.editData).length) { return; } formData.for_biz = props.editData.for_biz.bk_biz_id;