diff --git a/dbm-ui/frontend/src/services/model/db-resource/DbResource.ts b/dbm-ui/frontend/src/services/model/db-resource/DbResource.ts index 4a92f1c4eb..61422ca573 100644 --- a/dbm-ui/frontend/src/services/model/db-resource/DbResource.ts +++ b/dbm-ui/frontend/src/services/model/db-resource/DbResource.ts @@ -106,14 +106,14 @@ export default class DbResource { return this.agent_status === 0; } - get for_biz_display() { + get forBizDisplay() { if (this.for_biz.bk_biz_id === 0 || !this.for_biz.bk_biz_name) { return t('公共资源池'); } return this.for_biz.bk_biz_name; } - get resource_type_display() { + get resourceTypeDisplay() { if (!this.resource_type || this.resource_type === 'PUBLIC') { return t('通用'); } diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/host-list/Index.vue b/dbm-ui/frontend/src/views/resource-manage/pool/host-list/Index.vue index 586e5b1cef..716697dc82 100644 --- a/dbm-ui/frontend/src/views/resource-manage/pool/host-list/Index.vue +++ b/dbm-ui/frontend/src/views/resource-manage/pool/host-list/Index.vue @@ -148,15 +148,15 @@ }, { label: t('所属业务'), - field: 'for_biz_display', + field: 'forBizDisplay', width: 170, - render: ({ data }: {data: DbResourceModel}) => data.for_biz_display || '--', + render: ({ data }: {data: DbResourceModel}) => data.forBizDisplay || '--', }, { label: t('所属DB类型'), - field: 'resource_type_display', + field: 'resourceTypeDisplay', width: 150, - render: ({ data }: {data: DbResourceModel}) => data.resource_type_display || '--', + render: ({ data }: {data: DbResourceModel}) => data.resourceTypeDisplay || '--', }, { label: t('机架'), diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/host-list/components/search-box/components/com-factory/components/ForBiz.vue b/dbm-ui/frontend/src/views/resource-manage/pool/host-list/components/search-box/components/com-factory/components/ForBiz.vue index 7389d5be15..9e82148487 100644 --- a/dbm-ui/frontend/src/views/resource-manage/pool/host-list/components/search-box/components/com-factory/components/ForBiz.vue +++ b/dbm-ui/frontend/src/views/resource-manage/pool/host-list/components/search-box/components/com-factory/components/ForBiz.vue @@ -80,15 +80,10 @@ useRequest(getBizs, { onSuccess(data) { - const cloneData = data.map((item) => ({ - bk_biz_id: item.bk_biz_id, - display_name: item.display_name, - })); - cloneData.unshift({ - bk_biz_id: 0, - display_name: t('公共资源池'), - }); - bizList.value = cloneData; + bizList.value = [ + { bk_biz_id: 0, display_name: t('公共资源池') }, + ...data.map(({ bk_biz_id, display_name }) => ({ bk_biz_id, display_name })), + ]; }, }); diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/host-list/components/search-box/components/com-factory/components/ResourceType.vue b/dbm-ui/frontend/src/views/resource-manage/pool/host-list/components/search-box/components/com-factory/components/ResourceType.vue index 5615f5c2f1..fd66fd37aa 100644 --- a/dbm-ui/frontend/src/views/resource-manage/pool/host-list/components/search-box/components/com-factory/components/ResourceType.vue +++ b/dbm-ui/frontend/src/views/resource-manage/pool/host-list/components/search-box/components/com-factory/components/ResourceType.vue @@ -80,12 +80,7 @@ useRequest(fetchDbTypeList, { onSuccess(data) { - const cloneData = data; - cloneData.unshift({ - id: 'PUBLIC', - name: t('通用'), - }); - dbTypeList.value = cloneData; + dbTypeList.value = [{ id: 'PUBLIC', name: t('通用') }, ...data]; }, }); diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/summary-view/components/search-box/components/Biz.vue b/dbm-ui/frontend/src/views/resource-manage/pool/summary-view/components/search-box/components/Biz.vue index 38b6dcc9b3..43e17ffff9 100644 --- a/dbm-ui/frontend/src/views/resource-manage/pool/summary-view/components/search-box/components/Biz.vue +++ b/dbm-ui/frontend/src/views/resource-manage/pool/summary-view/components/search-box/components/Biz.vue @@ -47,15 +47,10 @@ useRequest(getBizs, { onSuccess(data) { - const cloneData = data.map((item) => ({ - bk_biz_id: item.bk_biz_id, - display_name: item.display_name, - })); - cloneData.unshift({ - bk_biz_id: 0, - display_name: t('公共资源池'), - }); - bizList.value = cloneData; + bizList.value = [ + { bk_biz_id: 0, display_name: t('公共资源池') }, + ...data.map(({ bk_biz_id, display_name }) => ({ bk_biz_id, display_name })), + ]; }, }); diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/summary-view/components/search-box/components/Db.vue b/dbm-ui/frontend/src/views/resource-manage/pool/summary-view/components/search-box/components/Db.vue index 3b118aaac5..86163cea36 100644 --- a/dbm-ui/frontend/src/views/resource-manage/pool/summary-view/components/search-box/components/Db.vue +++ b/dbm-ui/frontend/src/views/resource-manage/pool/summary-view/components/search-box/components/Db.vue @@ -49,12 +49,7 @@ useRequest(fetchDbTypeList, { onSuccess(data) { - const cloneData = data; - cloneData.unshift({ - id: 'PUBLIC', - name: t('通用'), - }); - dbTypeList.value = cloneData; + dbTypeList.value = [{ id: 'PUBLIC', name: t('通用') }, ...data]; }, }); diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/summary-view/components/search-box/components/Region.vue b/dbm-ui/frontend/src/views/resource-manage/pool/summary-view/components/search-box/components/Region.vue index 5a1a45e5f7..820d376f12 100644 --- a/dbm-ui/frontend/src/views/resource-manage/pool/summary-view/components/search-box/components/Region.vue +++ b/dbm-ui/frontend/src/views/resource-manage/pool/summary-view/components/search-box/components/Region.vue @@ -58,6 +58,7 @@ const citiyList = ref([]); const cityCode = ref(''); const subzoneIds = ref([]); + const renderSubzoneList = computed(() => (subzoneList.value || []).filter((item) => item.bk_city_code === cityCode.value), ); diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/summary-view/components/search-box/components/Spec.vue b/dbm-ui/frontend/src/views/resource-manage/pool/summary-view/components/search-box/components/Spec.vue index e9654334e7..6eab620338 100644 --- a/dbm-ui/frontend/src/views/resource-manage/pool/summary-view/components/search-box/components/Spec.vue +++ b/dbm-ui/frontend/src/views/resource-manage/pool/summary-view/components/search-box/components/Spec.vue @@ -44,9 +44,9 @@