From c2493dd526da1b1223cbcf7ed6a3cf9c97a0f14f Mon Sep 17 00:00:00 2001 From: suguangxu <274928232@qq.com> Date: Mon, 21 Jul 2025 15:09:03 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=85=AC=E5=85=B1=E7=BB=84=E4=BB=B6DropDown?= =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E4=B8=80=E4=B8=AA=E9=99=90=E5=88=B6=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E5=AE=BD=E5=BA=A6=E7=9A=84=E9=85=8D=E7=BD=AE=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=202.=E5=9C=A8=E5=88=87=E6=8D=A2=E7=A7=9F=E6=88=B7?= =?UTF-8?q?=E7=9A=84=E4=B8=8B=E6=8B=89=E5=88=97=E8=A1=A8=E4=B8=AD=E5=BC=95?= =?UTF-8?q?=E5=85=A5DropDown=E6=97=B6=E4=BC=A0=E5=85=A5=E9=99=90=E5=AE=9A?= =?UTF-8?q?=E5=AE=BD=E5=BA=A6=E7=9A=84=E9=85=8D=E7=BD=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Application/src/UserTenantChange.vue | 4 ++++ src/components/Dropdown/src/Dropdown.vue | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/components/Application/src/UserTenantChange.vue b/src/components/Application/src/UserTenantChange.vue index c6f9748..d8bf533 100644 --- a/src/components/Application/src/UserTenantChange.vue +++ b/src/components/Application/src/UserTenantChange.vue @@ -7,6 +7,7 @@ :selectedKeys="selectedKeys" @menu-event="handleMenuEvent" overlayClassName="app-locale-picker-overlay" + maxTextWidth=200 > @@ -59,6 +60,9 @@ formInfo.value.tenants.forEach((o) => { o.text = o.name; o.event = o.code; + if(formInfo.value.tenantCode==o.code){ + o.icon="ant-design:check-outlined"; + } }); } } diff --git a/src/components/Dropdown/src/Dropdown.vue b/src/components/Dropdown/src/Dropdown.vue index c70a99e..67d206e 100644 --- a/src/components/Dropdown/src/Dropdown.vue +++ b/src/components/Dropdown/src/Dropdown.vue @@ -25,7 +25,7 @@ @@ -70,6 +70,9 @@ type: Array as PropType, default: () => [], }, + maxTextWidth:{ + type: [Number, String] + } }); const emit = defineEmits(['menuEvent']); @@ -93,4 +96,12 @@ }); const getAttr = (key: string | number) => ({ key }); + + const getStyle = computed(() => { + if(props.maxTextWidth){ + return { maxWidth: `${props.maxTextWidth}`.replace(/px/, '') + 'px',display:'inline-block',overflow: 'hidden', textOverflow:'ellipsis', whiteSpace: 'nowrap',lineHeight:'100%'}; + }else{ + return {}; + } + });