Skip to content

Commit

Permalink
Merge branch 'master' into resource-panel-dock
Browse files Browse the repository at this point in the history
  • Loading branch information
kanyxmo committed Dec 29, 2024
2 parents f33fa70 + c48f9fc commit f782438
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
6 changes: 3 additions & 3 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
"@mineadmin/echarts": "^1.0.5",
"@mineadmin/form": "^1.0.21",
"@mineadmin/pro-table": "^1.0.55",
"@mineadmin/search": "^1.0.27",
"@mineadmin/table": "^1.0.29",
"@mineadmin/search": "^1.0.29",
"@mineadmin/table": "^1.0.33",
"@vueuse/core": "^11.1.0",
"@vueuse/integrations": "^11.1.0",
"animate.css": "^4.1.1",
"axios": "^1.7.8",
"dayjs": "^1.11.12",
"echarts": "^5.5.1",
"element-plus": "^2.8.8",
"element-plus": "^2.9.1",
"floating-vue": "5.2.2",
"lodash-es": "^4.17.21",
"md-editor-v3": "^5.0.2",
Expand Down
9 changes: 8 additions & 1 deletion web/src/layouts/components/bars/tabbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,14 @@ export default defineComponent({
}
}

const { current } = useMagicKeys()
const { current } = useMagicKeys({
passive: false,
onEventFired(e: KeyboardEvent) {
if (e.key === 'Alt') {
e.preventDefault()
}
},
})
const keys = computed(() => Array.from(current))
const pressKeys = reactive<{
oneKey: string | null
Expand Down
16 changes: 9 additions & 7 deletions web/src/modules/base/views/permission/menu/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,18 @@ const msg = useMessage()
async function getMenu() {
const { data } = await page()
menuList.value = data
await nextTick(() => {
menuList.value.map((item: MenuVo) => setNodeExpand(item.id as number))
})
menuList.value.map((item: MenuVo) => setNodeExpand(item.id as number))
}

// 设置某个节点展开
function setNodeExpand(id: number, state: boolean = true) {
const elTree = menuTreeRef.value.treeRef.elTree
const treeNode = elTree.store!._getAllNodes()?.find((node: any) => id === node.data.id) ?? {}
treeNode.expanded = state
if (elTree) {
const treeNode = elTree.store!._getAllNodes()?.find((node: any) => id === node.data.id)
if (treeNode) {
treeNode.expanded = state
}
}
}

onMounted(async () => {
Expand Down Expand Up @@ -100,14 +102,14 @@ function createOrSaveMenu() {
await getMenu()
resetForm()
setNodeExpand(model.parent_id as number)
}).catch((err: any) => msg.alertError(err))
})
}
else if (currentMenu.value !== null && model.dataType === 'edit' && model.id) {
save(model.id as number, model).then(async (res: any) => {
res.code === ResultCode.SUCCESS ? msg.success(t('crud.updateSuccess')) : msg.error(res.message)
await getMenu()
setNodeExpand(model.id as number)
}).catch((err: any) => msg.alertError(err))
})
}
else {
msg.alertError(t('baseMenuManage.addError'))
Expand Down

0 comments on commit f782438

Please sign in to comment.