From 6ae8b6d4d1252b7abb654b031bb753660c09bf9d Mon Sep 17 00:00:00 2001 From: Yuikill <105910874+Yuikill@users.noreply.github.com> Date: Wed, 11 Oct 2023 10:35:27 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E9=83=A8?= =?UTF-8?q?=E5=88=86=E7=A9=BA=E9=97=B4bug=20=E6=B7=BB=E5=8A=A0=E5=88=86?= =?UTF-8?q?=E7=BB=84=E8=A7=84=E5=88=99=E7=9A=84=E6=A8=A1=E7=B3=8A=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=20(#2674)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 修复服务管理手动添加配置项点击空白处没有弹出提示 * fix: 恢复配置模板空间删除,调整边框 * feat: 文本域框禁止拖拽 * feat: 添加分组管理分组规则的模糊匹配 * upd: 更新禁止文本域拖拽的方式 --- bcs-services/bcs-bscp/ui/src/css/style.css | 2 +- .../ui/src/views/space/groups/index.vue | 27 +++--- .../space/scripts/list/create-script.vue | 2 +- .../scripts/version-manage/version-edit.vue | 2 +- .../create-version/create-version-slider.vue | 2 +- .../publish-version/confirm-dialog.vue | 2 +- .../config-table-list/config-form.vue | 2 +- .../create-config/manual-create.vue | 2 + .../space/service/list/components/card.vue | 3 +- .../list/components/create-service.vue | 2 +- .../service/list/components/edit-service.vue | 1 + .../src/views/space/templates/list/index.vue | 2 +- .../list/package-menu/package-form.vue | 2 +- .../space/templates/list/space/create.vue | 2 +- .../views/space/templates/list/space/edit.vue | 2 +- .../space/templates/list/space/selector.vue | 88 ++++++++++--------- .../version-detail/version-editor.vue | 2 +- .../views/space/variables/editing-form.vue | 2 +- 18 files changed, 80 insertions(+), 67 deletions(-) diff --git a/bcs-services/bcs-bscp/ui/src/css/style.css b/bcs-services/bcs-bscp/ui/src/css/style.css index 07d17a6c8b..0d0202408c 100644 --- a/bcs-services/bcs-bscp/ui/src/css/style.css +++ b/bcs-services/bcs-bscp/ui/src/css/style.css @@ -69,4 +69,4 @@ a { .center-top-infobox { top: 35% !important; -} \ No newline at end of file +} diff --git a/bcs-services/bcs-bscp/ui/src/views/space/groups/index.vue b/bcs-services/bcs-bscp/ui/src/views/space/groups/index.vue index 0d9bd704b5..5e1a58e8b2 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/groups/index.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/groups/index.vue @@ -141,7 +141,6 @@ import { InfoBox } from 'bkui-vue/lib'; import useGlobalStore from '../../../store/global'; import { getSpaceGroupList, deleteGroup } from '../../../api/group'; import { IGroupItem, IGroupCategory, IGroupCategoryItem } from '../../../../types/group'; -import GROUP_RULE_OPS from '../../../constants/group'; import CreateGroup from './create-group.vue'; import EditGroup from './edit-group.vue'; import RuleTag from './components/rule-tag.vue'; @@ -297,18 +296,26 @@ const handleSearch = () => { const groupNameList = groupList.value.filter(item => item.name.includes(lowercaseSearchStr)); // 分组规则过滤出来的数据 const groupRuleList = groupList.value.filter((item) => { - const ruleList: string[] = []; + let groupRuleMatch = false; item.selector?.labels_and?.forEach((labels) => { - const op = GROUP_RULE_OPS.find(item => item.id === labels.op)?.name; - ruleList.push(`${labels.key}${op}${labels.value}`); + if (typeof labels.value === 'string') { + const valueStr = labels.value as string; + if (labels.key.includes(lowercaseSearchStr) || valueStr.includes(lowercaseSearchStr)) { + groupRuleMatch = true; + } + } }); - item.selector?.labels_or?.forEach((labels) => { - const op = GROUP_RULE_OPS.find(item => item.id === labels.op)?.name; - ruleList.push(`${labels.key}${op}${labels.value}`); - }); - return ruleList.includes(lowercaseSearchStr); + return groupRuleMatch; }); - searchGroupList.value = [...groupNameList, ...groupRuleList]; + const searchArr = [...groupNameList, ...groupRuleList]; + const uniqueIds = new Set(); // 用于记录已经出现过的id + searchGroupList.value = searchArr.filter((obj) => { + if (uniqueIds.has(obj.id)) { + return false; + } + uniqueIds.add(obj.id); + return true; + }); isSearchEmpty.value = true; } refreshTableData(); diff --git a/bcs-services/bcs-bscp/ui/src/views/space/scripts/list/create-script.vue b/bcs-services/bcs-bscp/ui/src/views/space/scripts/list/create-script.vue index dc3293f39d..7946b2bebb 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/scripts/list/create-script.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/scripts/list/create-script.vue @@ -24,7 +24,7 @@ - +
diff --git a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-edit.vue b/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-edit.vue index b6997ce62d..00e3ebddd1 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-edit.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/scripts/version-manage/version-edit.vue @@ -13,7 +13,7 @@
- +
diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/create-version/create-version-slider.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/create-version/create-version-slider.vue index 92ba27dbab..19dd0d453e 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/create-version/create-version-slider.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/create-version/create-version-slider.vue @@ -8,7 +8,7 @@ - + 同时上线版本 diff --git a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/confirm-dialog.vue b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/confirm-dialog.vue index 938fbcfa36..5fdd727d21 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/confirm-dialog.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/service/detail/components/publish-version/confirm-dialog.vue @@ -24,7 +24,7 @@
- + diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/index.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/index.vue index 53a7222291..3937179387 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/index.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/index.vue @@ -66,12 +66,12 @@ onMounted(() => { align-items: flex-start; justify-content: space-between; height: calc(100% - 38px); + border: none; } .side-menu-area { padding: 16px 0; height: 100%; background: #ffffff; - border-right: 1px solid #dcdee5; } .package-detail-area { height: 100%; diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-form.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-form.vue index 25205effe1..381be0c842 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-form.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/package-menu/package-form.vue @@ -4,7 +4,7 @@ - + diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/create.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/create.vue index d972624085..1dace1cda8 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/create.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/create.vue @@ -16,7 +16,7 @@ - + diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/edit.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/edit.vue index 4058e59c52..cbf3393ef9 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/edit.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/edit.vue @@ -18,7 +18,7 @@ - + diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/selector.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/selector.vue index 812506d3af..97db196d84 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/selector.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/list/space/selector.vue @@ -26,11 +26,11 @@ class="bk-bscp-icon icon-edit-small" @click.stop="handleEditOpen(item)" > - + /> @@ -49,12 +49,13 @@ import { ref, computed, onMounted, watch } from 'vue'; import { useRouter } from 'vue-router'; import { storeToRefs } from 'pinia'; -import { DownShape } from 'bkui-vue/lib/icon'; +import { DownShape, Del } from 'bkui-vue/lib/icon'; +import { InfoBox, Message } from 'bkui-vue'; import useGlobalStore from '../../../../../store/global'; import useTemplateStore from '../../../../../store/template'; import { ITemplateSpaceItem } from '../../../../../../types/template'; import { ICommonQuery } from '../../../../../../types/index'; -import { getTemplateSpaceList } from '../../../../../api/template'; +import { getTemplateSpaceList, getTemplatesBySpaceId, deleteTemplateSpace } from '../../../../../api/template'; import Create from './create.vue'; import Edit from './edit.vue'; @@ -69,6 +70,7 @@ const spaceList = ref([]); const selectorOpen = ref(false); const selectorRef = ref(); const isShowCreateDialog = ref(false); +const templatesLoading = ref(false); const editingData = ref({ open: false, data: { id: 0, name: '', memo: '' }, @@ -152,45 +154,45 @@ const handleCreated = (id: number) => { window.location.href = href; }; -// const handleDelete = async (space: ITemplateSpaceItem) => { -// templatesLoading.value = true; -// const params = { -// start: 0, -// limit: 1, -// // all: true -// }; -// const res = await getTemplatesBySpaceId(spaceId.value, space.id, params); -// if (res.count > 0) { -// InfoBox({ -// title: `未能删除【${space.spec.name}】`, -// subTitle: '请先确认删除此空间下所有配置项', -// dialogType: 'confirm', -// confirmText: '我知道了', -// } as any); -// } else { -// InfoBox({ -// title: `确认删除【${space.spec.name}】`, -// extCls: 'delete-space-infobox', -// onConfirm: async () => { -// await deleteTemplateSpace(spaceId.value, space.id); -// if (space.id === currentTemplateSpace.value) { -// templateStore.$patch((state) => { -// state.currentTemplateSpace = ''; -// }); -// initData(); -// } else { -// loadList(); -// } -// Message({ -// theme: 'success', -// message: '删除成功', -// }); -// }, -// } as any); -// } +const handleDelete = async (space: ITemplateSpaceItem) => { + templatesLoading.value = true; + const params = { + start: 0, + limit: 1, + // all: true + }; + const res = await getTemplatesBySpaceId(spaceId.value, space.id, params); + if (res.count > 0) { + InfoBox({ + title: `未能删除【${space.spec.name}】`, + subTitle: '请先确认删除此空间下所有配置项', + dialogType: 'confirm', + confirmText: '我知道了', + } as any); + } else { + InfoBox({ + title: `确认删除【${space.spec.name}】`, + extCls: 'delete-space-infobox', + onConfirm: async () => { + await deleteTemplateSpace(spaceId.value, space.id); + if (space.id === currentTemplateSpace.value) { + templateStore.$patch((state) => { + state.currentTemplateSpace = ''; + }); + initData(); + } else { + loadList(); + } + Message({ + theme: 'success', + message: '删除成功', + }); + }, + } as any); + } -// selectorRef.value.hidePopover(); -// }; + selectorRef.value.hidePopover(); +}; const handleSelect = (id: number) => { setTemplateSpace(id); diff --git a/bcs-services/bcs-bscp/ui/src/views/space/templates/version-manage/version-detail/version-editor.vue b/bcs-services/bcs-bscp/ui/src/views/space/templates/version-manage/version-detail/version-editor.vue index 7feb974461..19f6f3cce8 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/templates/version-manage/version-detail/version-editor.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/templates/version-manage/version-detail/version-editor.vue @@ -16,7 +16,7 @@ - + diff --git a/bcs-services/bcs-bscp/ui/src/views/space/variables/editing-form.vue b/bcs-services/bcs-bscp/ui/src/views/space/variables/editing-form.vue index 8d360ce4ba..234c7cbc7a 100644 --- a/bcs-services/bcs-bscp/ui/src/views/space/variables/editing-form.vue +++ b/bcs-services/bcs-bscp/ui/src/views/space/variables/editing-form.vue @@ -26,7 +26,7 @@ - + From 67f64d366d957715534491eade315b16192dfa79 Mon Sep 17 00:00:00 2001 From: AlkaidChen <362774405@qq.com> Date: Wed, 11 Oct 2023 11:33:12 +0800 Subject: [PATCH 2/2] feat: upgrade bcs-project-manager go.mod go version to 1.20 (#2675) --- bcs-services/bcs-project-manager/go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bcs-services/bcs-project-manager/go.mod b/bcs-services/bcs-project-manager/go.mod index 3038f3c4a4..de2dfe2c00 100644 --- a/bcs-services/bcs-project-manager/go.mod +++ b/bcs-services/bcs-project-manager/go.mod @@ -1,6 +1,6 @@ module github.com/Tencent/bk-bcs/bcs-services/bcs-project-manager -go 1.17 +go 1.20 replace ( github.com/coreos/bbolt v1.3.4 => go.etcd.io/bbolt v1.3.4