菜单调整
This commit is contained in:
parent
f0f4454a05
commit
e4e040eb23
|
|
@ -0,0 +1,9 @@
|
||||||
|
<template>
|
||||||
|
<div>部门管理edit</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
<template>
|
||||||
|
<div>部门管理</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
<template>
|
||||||
|
<div>岗位管理edit</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
<template>
|
||||||
|
<div>岗位管理</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
|
|
@ -52,24 +52,8 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<div v-if="(formData.menuType == menuDataType.BUTTON) == ''">
|
<div v-if="(formData.menuType == menuDataType.BUTTON) == ''">
|
||||||
<!-- <el-form-item label="请选择图标">
|
|
||||||
<el-input
|
|
||||||
v-model="formData.menuIcon"
|
|
||||||
show-word-limit
|
|
||||||
placeholder="请输入图标"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item> -->
|
|
||||||
|
|
||||||
<el-form-item label="请选择图标">
|
<el-form-item label="请选择图标">
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<!-- <el-input readonly>
|
|
||||||
<template #prefix>
|
|
||||||
<el-icon class="el-input__icon">
|
|
||||||
<search class="f-s-20" />
|
|
||||||
</el-icon>
|
|
||||||
</template>
|
|
||||||
</el-input> -->
|
|
||||||
|
|
||||||
<select-icon v-model:icon="formData.menuIcon"></select-icon>
|
<select-icon v-model:icon="formData.menuIcon"></select-icon>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -184,7 +168,7 @@ import { useAdmin } from '@/core/hooks/app'
|
||||||
import { onMounted, reactive, ref } from 'vue'
|
import { onMounted, reactive, ref } from 'vue'
|
||||||
import FooterBtns from '@/components/footer-btns/index.vue'
|
import FooterBtns from '@/components/footer-btns/index.vue'
|
||||||
import type { ElForm, ElMessage } from 'element-plus'
|
import type { ElForm, ElMessage } from 'element-plus'
|
||||||
import { apiConfigGetMenu, apiMenuDetail, apiMenuAdd, apiMenuEdit, apiMenuDelete } from '@/api/auth'
|
import { apiConfigGetMenu, apiMenuDetail, apiMenuAdd, apiMenuEdit } from '@/api/auth'
|
||||||
import SelectIcon from './select-icon/index.vue'
|
import SelectIcon from './select-icon/index.vue'
|
||||||
|
|
||||||
const menuDataType = {
|
const menuDataType = {
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,24 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="menu">
|
<div class="menu">
|
||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<router-link to="/permission/menu/edit">
|
<router-link to="/permission/menu/edit" class="m-r-15">
|
||||||
<el-button v-perm="['system:menu:add']" type="primary" size="small"
|
<el-button v-perm="['system:menu:add']" type="primary" size="small">
|
||||||
>添加菜单</el-button
|
添加菜单
|
||||||
>
|
</el-button>
|
||||||
</router-link>
|
</router-link>
|
||||||
|
|
||||||
|
<el-button size="small" @click="toggleRowExpansion(openFlag.openFlagValue)">
|
||||||
|
全部展开/折叠
|
||||||
|
</el-button>
|
||||||
|
|
||||||
<el-table
|
<el-table
|
||||||
:data="menuTableData"
|
:data="menuTableData"
|
||||||
class="m-t-24"
|
class="m-t-24"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
default-expand-all
|
:default-expand-all="openFlag.openFlagValue"
|
||||||
:tree-props="{ children: 'children' }"
|
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||||
size="mini"
|
size="mini"
|
||||||
|
ref="dataTreeList"
|
||||||
>
|
>
|
||||||
<el-table-column prop="menuName" label="名称" width="180"> </el-table-column>
|
<el-table-column prop="menuName" label="名称" width="180"> </el-table-column>
|
||||||
<el-table-column prop="menuType" label="菜单类型">
|
<el-table-column prop="menuType" label="菜单类型">
|
||||||
|
|
@ -71,7 +76,8 @@
|
||||||
import Popup from '@/components/popup/index.vue'
|
import Popup from '@/components/popup/index.vue'
|
||||||
import { usePages } from '@/core/hooks/pages'
|
import { usePages } from '@/core/hooks/pages'
|
||||||
import { onMounted, reactive, ref } from 'vue'
|
import { onMounted, reactive, ref } from 'vue'
|
||||||
import { apiConfigGetMenu, apiMenuDetail, apiMenuAdd, apiMenuEdit, apiMenuDelete } from '@/api/auth'
|
import { apiConfigGetMenu, apiMenuDelete } from '@/api/auth'
|
||||||
|
import type { ElForm } from 'element-plus'
|
||||||
|
|
||||||
const menuDataType = {
|
const menuDataType = {
|
||||||
CATALOG: 'M', // 目录
|
CATALOG: 'M', // 目录
|
||||||
|
|
@ -79,7 +85,7 @@ const menuDataType = {
|
||||||
BUTTON: 'A' // 按钮
|
BUTTON: 'A' // 按钮
|
||||||
}
|
}
|
||||||
|
|
||||||
const menuTableData = ref([])
|
const menuTableData = ref<any>([])
|
||||||
|
|
||||||
// 获取菜单列表
|
// 获取菜单列表
|
||||||
const getMenuTableData = () => {
|
const getMenuTableData = () => {
|
||||||
|
|
@ -94,6 +100,28 @@ const handleDelete = async (id: number) => {
|
||||||
getMenuTableData()
|
getMenuTableData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const dataTreeList = ref<any>()
|
||||||
|
|
||||||
|
// 树层级打开
|
||||||
|
const openFlag = {
|
||||||
|
openFlagValue: true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 展开收缩
|
||||||
|
const toggleRowExpansion = (isExpansion: any) => {
|
||||||
|
openFlag.openFlagValue = !isExpansion
|
||||||
|
toggleRowExpansion_forAll(menuTableData.value, openFlag.openFlagValue)
|
||||||
|
}
|
||||||
|
|
||||||
|
const toggleRowExpansion_forAll = (data: any, isExpansion: any) => {
|
||||||
|
data.forEach((item: any) => {
|
||||||
|
dataTreeList.value.toggleRowExpansion(item, isExpansion)
|
||||||
|
if (item.children != undefined && item.children != null) {
|
||||||
|
toggleRowExpansion_forAll(item.children, isExpansion)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getMenuTableData()
|
getMenuTableData()
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue