From 3ee35e5ce857fb2afe28d2334264eea5cde42abe Mon Sep 17 00:00:00 2001 From: royalpioneer Date: Wed, 11 Dec 2024 16:44:35 +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#=20Reviewed,=20transaction=20id:=2026506?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbm-ui/frontend/src/locales/zh-cn.json | 1 + .../batch-add-tags/components/ListPanel.vue | 17 ------------ .../batch-assign/components/FormPanel.vue | 3 ++- .../batch-assign/components/ListPanel.vue | 27 ++++--------------- .../components/batch-setting/Index.vue | 2 +- .../components/select-host-panel/Index.vue | 8 +++--- .../com-factory/components/Label.vue | 6 ++--- .../components/field-input/Index.vue | 10 +++---- 8 files changed, 22 insertions(+), 52 deletions(-) diff --git a/dbm-ui/frontend/src/locales/zh-cn.json b/dbm-ui/frontend/src/locales/zh-cn.json index 546cbcbc9a..92882b0e32 100644 --- a/dbm-ui/frontend/src/locales/zh-cn.json +++ b/dbm-ui/frontend/src/locales/zh-cn.json @@ -3750,5 +3750,6 @@ "从n业务CMDB空闲机模块导入": "从「{0}」业务 CMDB 空闲机模块导入", "清空主机现有的所属 DB 和标签,重新进行设置": "清空主机现有的所属 DB 和标签,重新进行设置", "清空主机现有的所属业务、所属 DB 、标签,重新进行设置": "清空主机现有的所属业务、所属 DB 、标签,重新进行设置", + "添加属性": "添加属性", "这行勿动!新增翻译请在上一行添加!": "" } diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-add-tags/components/ListPanel.vue b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-add-tags/components/ListPanel.vue index 9c252363f7..ff0aa526fa 100644 --- a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-add-tags/components/ListPanel.vue +++ b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-add-tags/components/ListPanel.vue @@ -64,11 +64,6 @@ v-bk-tooltips="t('复制')" type="copy" @click="handleCopy(hostItem)" /> - { - const hostListResult = hostList.value.reduce((result, item) => { - if (item.bk_host_id !== hostItem.bk_host_id) { - result.push(item); - } - return result; - }, []); - - hostList.value = hostListResult; - }; - defineExpose({ getValue() { return formRef.value.validate().then(() => ({ diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-assign/components/FormPanel.vue b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-assign/components/FormPanel.vue index bf32b5183b..d8bcba16cd 100644 --- a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-assign/components/FormPanel.vue +++ b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-assign/components/FormPanel.vue @@ -37,7 +37,8 @@ required> + :allow-empty-values="[0]" + :disabled="isBusiness"> - { - const hostListResult = hostList.value.reduce((result, item) => { - if (item.bk_host_id !== hostItem.bk_host_id) { - result.push(item); - } - return result; - }, []); - - hostList.value = hostListResult; - }; - defineExpose({ getValue() { return formRef.value.validate().then(() => ({ @@ -163,14 +146,14 @@ flex-direction: column; .title { + display: flex; padding: 8px 12px 10px 24px; - font-weight: 700; font-size: 12px; + font-weight: 700; color: #313238; - background: #ffffff; + background: #fff; border: 1px solid #dcdee5; border-radius: 0 2px 2px 0; - display: flex; .host-action { display: flex; @@ -192,13 +175,13 @@ .host-header { display: flex; - align-items: center; padding: 0 24px; margin-top: 14px; margin-bottom: 4px; + font-size: 12px; line-height: 24px; color: #63656e; - font-size: 12px; + align-items: center; } .host-list { diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-setting/Index.vue b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-setting/Index.vue index 032f7cdeae..f44d483c74 100644 --- a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-setting/Index.vue +++ b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/batch-setting/Index.vue @@ -21,7 +21,7 @@ - 添加条件 + {{ t('添加属性') }} (); const route = useRoute(); const globalBizsStore = useGlobalBizs(); + const systemEnvironStore = useSystemEnviron(); + + const isBusiness = route.name === 'BizResourcePool'; const { t } = useI18n(); const tableRef = ref(); const searchContent = ref(''); - const bizId = ref(globalBizsStore.currentBizId); + const bizId = ref(isBusiness ? globalBizsStore.currentBizId : systemEnvironStore.urls.DBA_APP_BK_BIZ_ID); - const isBusiness = route.name === 'BizResourcePool'; const tableColumn = [ { label: 'IP', diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/search-box/components/com-factory/components/Label.vue b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/search-box/components/com-factory/components/Label.vue index f7f0ad9a4b..5c23a08572 100644 --- a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/search-box/components/com-factory/components/Label.vue +++ b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/search-box/components/com-factory/components/Label.vue @@ -66,7 +66,7 @@ const { results } = await runAsyncList({ ids: props.defaultValue, }); - tagList.value.push(...results); + tagList.value = uniqBy([...tagList.value, ...results], 'value'); } }, { @@ -86,10 +86,10 @@ }); const loadMore = () => { - if (tagList.value.length >= pagination.count || isLoading.value) { + if (pagination.offset >= pagination.count || isLoading.value) { return; } - pagination.offset += pagination.limit; + pagination.offset = Math.min(pagination.count, pagination.offset + pagination.limit); runList({ ...pagination, value: searchVal.value, diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/search-box/components/field-input/Index.vue b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/search-box/components/field-input/Index.vue index 4c33584b84..92d7a8ff81 100644 --- a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/search-box/components/field-input/Index.vue +++ b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/search-box/components/field-input/Index.vue @@ -26,9 +26,9 @@ name="resource_type" @change="handleChange" />
@@ -165,7 +165,7 @@ os_type: true, cpu: true, mem: true, - labels: true, + bk_cloud_ids: true, mount_point: true, disk: true, disk_type: true,