From 57096169c6ea2e6b5b966552341df169425f30d0 Mon Sep 17 00:00:00 2001 From: qiaochuLei <124648559+qiaochuLei@users.noreply.github.com> Date: Thu, 14 Nov 2024 15:43:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AE=BE=E5=A4=87=E6=98=A0=E5=B0=84?= =?UTF-8?q?=E4=BC=A0=E5=80=BC=E7=BD=91=E5=85=B3id->=E6=8F=92=E4=BB=B6id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: bug#28724 【菜单管理】【/2.1/2.2】菜单管理新增菜单时,排序需优化(默认为10000开始) * fix: 设备映射传值网关id->插件id --- .../Detail/Info/components/InklingModal/index.vue | 4 ++-- src/views/system/Menu/index.vue | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/views/device/Instance/Detail/Info/components/InklingModal/index.vue b/src/views/device/Instance/Detail/Info/components/InklingModal/index.vue index ae243cd0..45862242 100644 --- a/src/views/device/Instance/Detail/Info/components/InklingModal/index.vue +++ b/src/views/device/Instance/Detail/Info/components/InklingModal/index.vue @@ -53,7 +53,7 @@ const handleOk = async () => { loading.value = true const res = await savePluginData( 'device', - props.accessId!, + props.pluginId!, route.params.id as string, checkKey.value ).catch(() => ({ success: false })) @@ -71,7 +71,7 @@ const handleCancel = () => { } const getCheckedKeys = () => { - getPluginData( 'device', props.accessId!, route.params.id as string,).then(res => { + getPluginData( 'device', props.pluginId!, route.params.id as string,).then(res => { if (res.success) { checkKey.value = res.result?.externalId || '' } diff --git a/src/views/system/Menu/index.vue b/src/views/system/Menu/index.vue index 7d4487f3..3f090588 100644 --- a/src/views/system/Menu/index.vue +++ b/src/views/system/Menu/index.vue @@ -229,10 +229,17 @@ const table = reactive({ paging: false, }; const resp: any = await getMenuTree_api(params); - const menuArr = resp.result.filter((i:any)=>i.code!=='account-center') + const menuArr = resp.result.filter( + (i: any) => i.code !== 'account-center', + ); const lastItem = menuArr[menuArr.length - 1]; + console.log(lastItem, 'lastItem'); //个人中心排序为9999需要做过滤特殊处理 - table.total = lastItem ? lastItem.sortIndex + 1 === 9999 ? 10000 : lastItem.sortIndex + 1 : 1; + table.total = lastItem + ? lastItem.sortIndex + 1 === 9999 + ? 10000 + : lastItem.sortIndex + 1 + : 1; return { code: resp.message, @@ -251,7 +258,9 @@ const table = reactive({ }; }, addChildren: (row: any) => { - const sortIndex = row?.children?.length || 0; + const sortIndex = row?.children.sort((a: any, b: any) => { + return b.sortIndex - a.sortIndex; + })[0].sortIndex; router.push( `/system/Menu/detail/:id?pid=${row.id}&basePath=${ row.url || ''