From 6ed59b1275006784a81b2e2abdf79ca53a234043 Mon Sep 17 00:00:00 2001 From: teukkk Date: Wed, 18 Sep 2024 19:01:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=9B=9E=E6=98=BE=E9=97=AE=E9=A2=98&?= =?UTF-8?q?=E6=88=90=E5=91=98=E5=88=97=E8=A1=A8=E4=B8=8D=E5=8F=AF=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=9C=80=E5=90=8E=E4=B8=80=E4=B8=AA=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1046504 --user=吕梦园 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001046504 --bug=1046478 --user=吕梦园 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001046478 --- frontend/src/components/business/ms-select/index.tsx | 4 +++- frontend/src/hooks/useSelect.ts | 2 +- .../organization/project/components/userDrawer.vue | 8 +++++--- .../organizationAndProject/components/userDrawer.vue | 8 +++++--- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/business/ms-select/index.tsx b/frontend/src/components/business/ms-select/index.tsx index d961f8af4d..ec6aeb6de6 100644 --- a/frontend/src/components/business/ms-select/index.tsx +++ b/frontend/src/components/business/ms-select/index.tsx @@ -450,7 +450,9 @@ export default defineComponent( if (typeof props.optionLabelRender === 'function') { return label; } - const option = remoteOriginOptions.value.find((e) => e[props.labelKey || 'label'] === label); + const option = remoteOriginOptions.value.find( + (e) => e[props.labelKey || 'label'].toLowerCase() === label?.toLowerCase() + ); return option ? option[props.labelKey || 'label'] : props.optionNotExitsText || t('ms.select.optionsNotExits'); } diff --git a/frontend/src/hooks/useSelect.ts b/frontend/src/hooks/useSelect.ts index c9a46c28b5..364dab045d 100644 --- a/frontend/src/hooks/useSelect.ts +++ b/frontend/src/hooks/useSelect.ts @@ -36,7 +36,7 @@ export default function useSelect(config: UseSelectOption) { const innerViewWidth = selectViewInner.value?.getBoundingClientRect().width; let lastWidth = innerViewWidth - 60; // 60px 是“+N”的标签宽度+聚焦输入框的宽度 const childrenNodes = selectViewInner.value.children; - if (maxTagCount.value >= 1 && maxTagCount.value < config.selectVal.value.length) { + if (maxTagCount.value >= 1 && maxTagCount.value < config.selectVal.value?.length) { return; } for (let i = 0; i < childrenNodes.length; i++) { diff --git a/frontend/src/views/setting/organization/project/components/userDrawer.vue b/frontend/src/views/setting/organization/project/components/userDrawer.vue index 723fe654c9..17b16b414b 100644 --- a/frontend/src/views/setting/organization/project/components/userDrawer.vue +++ b/frontend/src/views/setting/organization/project/components/userDrawer.vue @@ -48,7 +48,6 @@ v-else v-model:model-value="record.userRoleList" :placeholder="t('system.user.createUserUserGroupPlaceholder')" - :options="userGroupOptions" :search-keys="['name']" :loading="record.selectUserGroupLoading" :disabled="record.selectUserGroupLoading" @@ -60,8 +59,11 @@ label-key="name" class="w-full max-w-[300px]" allow-clear - multiple - at-least-one + v-bind="{ + options: userGroupOptions, + multiple: true, + }" + :at-least-one="true" :object-value="true" @popup-visible-change="(value) => handleUserGroupChange(value, record)" > diff --git a/frontend/src/views/setting/system/organizationAndProject/components/userDrawer.vue b/frontend/src/views/setting/system/organizationAndProject/components/userDrawer.vue index 8268aced59..3ecd508579 100644 --- a/frontend/src/views/setting/system/organizationAndProject/components/userDrawer.vue +++ b/frontend/src/views/setting/system/organizationAndProject/components/userDrawer.vue @@ -49,7 +49,6 @@ v-else v-model:model-value="record.userRoleList" :placeholder="t('system.user.createUserUserGroupPlaceholder')" - :options="userGroupOptions" :search-keys="['name']" :loading="record.selectUserGroupLoading" :disabled="record.selectUserGroupLoading" @@ -61,8 +60,11 @@ label-key="name" class="w-full max-w-[300px]" allow-clear - multiple - at-least-one + v-bind="{ + options: userGroupOptions, + multiple: true, + }" + :at-least-one="true" :object-value="true" @popup-visible-change="(value) => handleUserGroupChange(value, record)" >