| | |
| | | path:'sessionManager', |
| | | name:"sessionManager", |
| | | meta:{ |
| | | locale: '会话管理', |
| | | requiresAuth: true, |
| | | hideInMenu:true, |
| | | roles: ['*'], |
| | | activeMenu:'session' |
| | | }, |
| | | component:()=>import('@/views/session/sessionManager/index.vue'), |
| | | }, |
| | | { |
| | | path:'sessionRecordsManager', |
| | | name:"sessionRecordsManager", |
| | | meta:{ |
| | | locale: '会话记录', |
| | | requiresAuth: true, |
| | | roles: ['*'], |
| | | }, |
| | | component:()=>import('@/views/session/sessionRecordsManager/index.vue'), |
| | | } |
| | | ] |
| | | }; |
| | |
| | | :bordered="false" |
| | | :style="{ 'width': '100%', 'height': '900px', 'overflow-y': 'auto' }" |
| | | > |
| | | <a-button @click="() => onIconClick(null)">新增父级菜单</a-button> |
| | | <a-tree |
| | | class="tree-demo" |
| | | draggable |
| | |
| | | </template> |
| | | |
| | | <script lang="ts" setup> |
| | | import { ref } from 'vue'; |
| | | import { IconPlus } from '@arco-design/web-vue/es/icon'; |
| | | import { |
| | | Resource, |
| | | ResourceAdd, |
| | | ResourceById, |
| | | ResourceDelete, |
| | | ResourceList, |
| | | ResourceUpdate, |
| | | } from '@/api/authority'; |
| | | import Authheader from '@/views/authority/components/authheader.vue'; |
| | | import { Modal } from '@arco-design/web-vue'; |
| | | import { ref } from "vue"; |
| | | import { IconPlus } from "@arco-design/web-vue/es/icon"; |
| | | import { Resource, ResourceAdd, ResourceById, ResourceDelete, ResourceList, ResourceUpdate } from "@/api/authority"; |
| | | import Authheader from "@/views/authority/components/authheader.vue"; |
| | | import { Modal } from "@arco-design/web-vue"; |
| | | |
| | | let visible = ref(false); |
| | | let treeData = ref([]); |
| | | let showLine = ref(true); |
| | | let menuTips = ref(['权限管理', '资源']); |
| | | const fieldNames = { value: 'key', label: 'value' }; |
| | | let menuTips = ref(["权限管理", "资源"]); |
| | | const fieldNames = { value: "key", label: "value" }; |
| | | // 0目录 1菜单 2按钮 |
| | | let options = ref([ |
| | | { |
| | | key: '3', |
| | | value: '目录', |
| | | key: "3", |
| | | value: "目录" |
| | | }, |
| | | { |
| | | key: '0', |
| | | value: '菜单', |
| | | key: "0", |
| | | value: "菜单" |
| | | }, |
| | | { |
| | | key: '1', |
| | | value: '按钮', |
| | | }, |
| | | key: "1", |
| | | value: "按钮" |
| | | } |
| | | ]); |
| | | let resourceform = ref<Resource>({ |
| | | component: '', |
| | | createTime: '', |
| | | description: '', |
| | | icon: '', |
| | | menuId: '', |
| | | menuName: '', |
| | | menuType: '', |
| | | orderNum: '', |
| | | parentId: '', |
| | | parentName: '', |
| | | component: "", |
| | | createTime: "", |
| | | description: "", |
| | | icon: "", |
| | | menuId: "", |
| | | menuName: "", |
| | | menuType: "", |
| | | orderNum: "", |
| | | parentId: "", |
| | | parentName: "", |
| | | children: [], |
| | | path: '', |
| | | perms: '', |
| | | status: '', |
| | | syesourcetype: '', |
| | | target: '', |
| | | updateTime: '', |
| | | path: "", |
| | | perms: "", |
| | | status: "", |
| | | syesourcetype: "", |
| | | target: "", |
| | | updateTime: "" |
| | | }); |
| | | |
| | | const onIconClick = (nodeData) => { |
| | | if (nodeData) { |
| | | resourceform.value.parentId = nodeData.menuId; |
| | | resourceform.value.component = ''; |
| | | resourceform.value.createTime = ''; |
| | | resourceform.value.description = ''; |
| | | resourceform.value.icon = ''; |
| | | resourceform.value.menuId = ''; |
| | | resourceform.value.menuName = ''; |
| | | resourceform.value.menuType = ''; |
| | | resourceform.value.orderNum = '0'; |
| | | resourceform.value.parentName = nodeData.menuName; |
| | | resourceform.value.path = ''; |
| | | resourceform.value.perms = ''; |
| | | resourceform.value.status = ''; |
| | | resourceform.value.syesourcetype = ''; |
| | | } |
| | | resourceform.value.component = ""; |
| | | resourceform.value.createTime = ""; |
| | | resourceform.value.description = ""; |
| | | resourceform.value.icon = ""; |
| | | resourceform.value.menuId = ""; |
| | | resourceform.value.menuName = ""; |
| | | resourceform.value.menuType = ""; |
| | | resourceform.value.orderNum = "0"; |
| | | resourceform.value.path = ""; |
| | | resourceform.value.perms = ""; |
| | | resourceform.value.status = ""; |
| | | resourceform.value.syesourcetype = ""; |
| | | |
| | | visible.value = true; |
| | | }; |
| | | |
| | | const addresource = async () => { |
| | | await ResourceAdd({ |
| | | ...resourceform.value, |
| | | ...resourceform.value |
| | | } as unknown as Resource).then((res) => { |
| | | ResourceData(''); |
| | | ResourceData(""); |
| | | }); |
| | | }; |
| | | |
| | | const onIconClickDelete = (nodeData) => { |
| | | ResourceDelete(nodeData.menuId).then(() => { |
| | | ResourceData(''); |
| | | ResourceData(""); |
| | | }); |
| | | }; |
| | | |
| | |
| | | }; |
| | | const editresource = () => { |
| | | ResourceUpdate({ |
| | | ...resourceform.value, |
| | | ...resourceform.value |
| | | } as unknown as Resource).then((res) => { |
| | | ResourceData(''); |
| | | ResourceData(""); |
| | | Modal.success({ |
| | | title: '保存成功', |
| | | content: '保存成功', |
| | | title: "保存成功", |
| | | content: "保存成功" |
| | | }); |
| | | }); |
| | | }; |
| | |
| | | const onDrop = ({ dragNode, dropNode, dropPosition }) => { |
| | | const data = treeData.value; |
| | | ResourceUpdate({ |
| | | orderNum: '0', |
| | | orderNum: "0", |
| | | parentId: dropNode.menuId, |
| | | menuId: dragNode.menuId, |
| | | menuId: dragNode.menuId |
| | | }); |
| | | const loop = (data, key, callback) => { |
| | | data.some((item, index, arr) => { |
| | |
| | | }); |
| | | }; |
| | | |
| | | ResourceData(''); |
| | | ResourceData(""); |
| | | </script> |
| | | |
| | | <style scoped> |