|
|
@@ -6,6 +6,7 @@ const { sys_normal_disable, sys_show_hide } = useDict("sys_normal_disable", "sys
|
|
|
|
|
|
const tableRef = ref()
|
|
|
const modalRef = ref()
|
|
|
+const iconShow = ref(false)
|
|
|
const opts = reactive({
|
|
|
columns: [
|
|
|
{ field: "menuId", name: "菜单ID", width: 100, isSort: true, visible: false },
|
|
|
@@ -21,7 +22,7 @@ const opts = reactive({
|
|
|
{ field: "status", name: "菜单状态", visible: true, width: 80 },
|
|
|
{ field: "perms", name: "权限标识", visible: true },
|
|
|
{ field: "actions", name: `操作`, width: 150 }
|
|
|
- ],
|
|
|
+ ] as any,
|
|
|
queryParams: {
|
|
|
menuName: undefined,
|
|
|
visible: undefined,
|
|
|
@@ -222,8 +223,8 @@ function defaultBtnChange(v: any) {
|
|
|
|
|
|
function getTableData(q: any) {
|
|
|
return new Promise((resolve) => {
|
|
|
- apis.system.menuApi.listMenu(q).then((res) => {
|
|
|
- res.data = handleTree(res.data, "menuId")
|
|
|
+ apis.system.menuApi.listMenuByParentId(q).then((res) => {
|
|
|
+ //res.data = handleTree(res.data, "menuId")
|
|
|
resolve(res)
|
|
|
})
|
|
|
})
|
|
|
@@ -242,16 +243,25 @@ function selected(name: string) {
|
|
|
form.value.icon = name
|
|
|
showChooseIcon.value = false
|
|
|
}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ iconShow.value = true
|
|
|
+ }, 500)
|
|
|
+})
|
|
|
</script>
|
|
|
<template>
|
|
|
<div>
|
|
|
<VbDataTable
|
|
|
ref="tableRef"
|
|
|
:is-tree="true"
|
|
|
+ :is-lazy="true"
|
|
|
keyField="menuId"
|
|
|
iconField="menuName"
|
|
|
parentField="parentId"
|
|
|
+ root-id="0"
|
|
|
childrenField="children"
|
|
|
+ leaf-field="leaf"
|
|
|
:check-multiple="false"
|
|
|
:has-checkbox="false"
|
|
|
:no-page="true"
|
|
|
@@ -408,8 +418,8 @@ function selected(name: string) {
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="菜单图标" prop="icon">
|
|
|
+ <el-col :span="24" v-if="iconShow">
|
|
|
+ <!-- <el-form-item label="菜单图标" prop="icon">
|
|
|
<el-popover
|
|
|
placement="bottom-start"
|
|
|
:width="600"
|
|
|
@@ -431,6 +441,9 @@ function selected(name: string) {
|
|
|
</template>
|
|
|
<icon-select ref="iconSelectRef" @selected="selected" :active-icon="form.icon" />
|
|
|
</el-popover>
|
|
|
+ </el-form-item> -->
|
|
|
+ <el-form-item label="菜单图标" prop="icon">
|
|
|
+ <el-input v-model="form.icon" placeholder="请输入菜单图标" class="w-100" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|