From 1f7704e6efb786a4a30a047f7ad40773e19597f3 Mon Sep 17 00:00:00 2001 From: royalpioneer Date: Wed, 20 Nov 2024 20:47:05 +0800 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20=E6=94=AF=E6=8C=81=E6=95=85?= =?UTF-8?q?=E9=9A=9C=E6=B1=A0=E3=80=81=E5=BE=85=E5=9B=9E=E6=94=B6=E6=B1=A0?= =?UTF-8?q?=20#7881=20#7973=20#=20Reviewed,=20transaction=20id:=2024393?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbm-ui/frontend/src/locales/zh-cn.json | 2 ++ .../pool/components/host-list/Index.vue | 22 ++++--------------- .../components/batch-assign/Index.vue | 4 ++-- .../batch-convert-to-business/Index.vue | 4 ++-- .../batch-covert-to-public/Index.vue | 4 ++-- .../batch-move-to-fault-pool/Index.vue | 4 ++-- .../batch-move-to-recycle-pool/Index.vue | 4 ++-- .../components/batch-undo-import/Index.vue | 4 ++-- .../components/update-assign/Index.vue | 2 +- 9 files changed, 19 insertions(+), 31 deletions(-) diff --git a/dbm-ui/frontend/src/locales/zh-cn.json b/dbm-ui/frontend/src/locales/zh-cn.json index e50ea20921..576eab8562 100644 --- a/dbm-ui/frontend/src/locales/zh-cn.json +++ b/dbm-ui/frontend/src/locales/zh-cn.json @@ -3737,5 +3737,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;