fix: 设备映射传值网关id->插件id

* fix: bug#28724 【菜单管理】【/2.1/2.2】菜单管理新增菜单时,排序需优化(默认为10000开始)

* fix: 设备映射传值网关id->插件id
This commit is contained in:
qiaochuLei 2024-11-14 15:43:48 +08:00 committed by GitHub
parent 2e2ec80979
commit 57096169c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 5 deletions

View File

@ -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 || ''
}

View File

@ -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 || ''