Skip to content

Commit

Permalink
feat(frontend): 支持故障池、待回收池 #7881 #7973
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 24393
  • Loading branch information
royalpioneer authored and iSecloud committed Nov 27, 2024
1 parent f452854 commit b6e8b9d
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 31 deletions.
2 changes: 2 additions & 0 deletions dbm-ui/frontend/src/locales/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3723,5 +3723,7 @@
"新建标签": "新建标签",
"所有 IP": "所有 IP",
"已选 IP": "已选 IP",
"业务资源池": "业务资源池",
"冷/热节点": "冷/热节点",
"这行勿动!新增翻译请在上一行添加!": ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@
<ImportHostBtn
class="w-88"
@export-host="handleImportHost" />
<BkDropdown
:is-show="isBatchOperationShow"
trigger="manual">
<BkDropdown>
<BkButton
class="ml-8"
:disabled="selectionHostIdList.length < 1"
@click="() => handleBatchOperationShow(true)">
:disabled="selectionHostIdList.length < 1">
{{ t('批量操作') }}
<DbIcon type="down-big" />
</BkButton>
Expand Down Expand Up @@ -202,9 +199,8 @@
const isShowBatchConvertToBusiness = ref(false);
const isShowBatchAssign = ref(false);
const isShowUpdateAssign = ref(false);
const curEditData = ref<DbResourceModel>();
const curEditData = ref<DbResourceModel>({} as DbResourceModel);
const isSelectedSameBiz = ref(false);
const isBatchOperationShow = ref(false);

const curBizId = computed(() => {
let bizId = undefined;
Expand Down Expand Up @@ -410,7 +406,6 @@
// 批量设置
const handleShowBatchSetting = () => {
isShowBatchSetting.value = true;
handleBatchOperationShow(false);
};

// 复制所有主机
Expand Down Expand Up @@ -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) => {
Expand All @@ -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();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@
const { loading: isUpdating, run: runUpdate } = useRequest(updateResource, {
manual: true,
onSuccess() {
handleCancel();
emits('refresh');
isShow.value = false;
messageSuccess('设置成功');
},
});
Expand Down Expand Up @@ -125,7 +126,6 @@
};
const handleCancel = () => {
emits('refresh');
isShow.value = false;
};
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
const { loading: isUpdating, run: runUpdate } = useRequest(updateResource, {
manual: true,
onSuccess() {
handleCancel();
emits('refresh');
isShow.value = false;
messageSuccess(t('设置成功'));
},
});
Expand All @@ -70,7 +71,6 @@
};

const handleCancel = () => {
emits('refresh');
isShow.value = false;
};
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
const { loading: isUpdating, run: runUpdate } = useRequest(updateResource, {
manual: true,
onSuccess() {
handleCancel();
isShow.value = false;
emits('refresh');
messageSuccess(t('设置成功'));
},
});
Expand All @@ -72,6 +73,5 @@

const handleCancel = () => {
isShow.value = false;
emits('refresh');
};
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
const { loading: isRemoving, run: runDelete } = useRequest(removeResource, {
manual: true,
onSuccess() {
handleCancel();
emits('refresh');
isShow.value = false;
messageSuccess(t('设置成功'));
},
});
Expand All @@ -56,7 +57,6 @@
};
const handleCancel = () => {
emits('refresh');
isShow.value = false;
};
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
const { loading: isRemoving, run: runDelete } = useRequest(removeResource, {
manual: true,
onSuccess() {
handleCancel();
emits('refresh');
isShow.value = false;
messageSuccess(t('设置成功'));
},
});
Expand All @@ -56,7 +57,6 @@
};
const handleCancel = () => {
emits('refresh');
isShow.value = false;
};
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
const { loading: isRemoving, run: runDelete } = useRequest(removeResource, {
manual: true,
onSuccess() {
handleCancel();
emits('refresh');
isShow.value = false;
messageSuccess(t('设置成功'));
},
});
Expand All @@ -56,7 +57,6 @@
};
const handleCancel = () => {
emits('refresh');
isShow.value = false;
};
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b6e8b9d

Please sign in to comment.