diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..1a29f14 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "cSpell.words": [ + "daterange", + "resourcedata", + "resourcename", + "rmark" + ] +} \ No newline at end of file diff --git a/frontend/src/api/resource/interface/index.ts b/frontend/src/api/resource/interface/index.ts new file mode 100644 index 0000000..2adcf93 --- /dev/null +++ b/frontend/src/api/resource/interface/index.ts @@ -0,0 +1,24 @@ +import type { DefineComponent } from "vue"; +import type { DatetimeFormatProps } from "vue-i18n"; + +// 菜单管理模块 +export namespace Resource { + // 菜单列表 + export interface ResResourceList { + id: string;//资源表Id + name: string;//名称 + path:string;//路径 + sort:number;//排序 + type:string;//资源类型 + remark:string;//资源描述 + route_Name:string;//路由名称 + create_Time:string;//创建时间 + update_Time:string;//更新时间 + children?: ResResourceList[]; + } + + export interface ResType { + userLabel: string; + userValue: number; + } +} \ No newline at end of file diff --git a/frontend/src/api/resource/resourceData.ts b/frontend/src/api/resource/resourceData.ts new file mode 100644 index 0000000..c8dfaca --- /dev/null +++ b/frontend/src/api/resource/resourceData.ts @@ -0,0 +1,249 @@ +import { HomeFilled, Operation } from "@element-plus/icons-vue" +import type { Resource } from "./interface" + +const resourcedata = ref([ + { + 'id': '1', + 'name': '检测计划', + 'path':'/plan/planList/index', + 'sort':1, + 'type':'菜单', + 'remark':'检测计划描述', + 'route_Name':'route', + 'create_Time': '2024-10-16 12:13:14', + 'update_Time':'2024-10-16 12:13:14', + }, + { + 'id': '2', + 'name': '台账管理', + 'path':'/plan/planList/index', + 'sort':2, + 'type':'菜单', + 'remark':'检测计划描述', + 'route_Name':'route', + 'create_Time': '2024-10-16 12:13:14', + 'update_Time':'2024-10-16 12:13:14', + children:[{ + 'id': '21', + 'name': '检测脚本', + + 'path':'/plan/planList/index', + 'sort':21, + 'type':'菜单', + 'remark':'检测计划描述', + 'route_Name':'route', + 'create_Time': '2024-10-16 12:13:14', + 'update_Time':'2024-10-16 12:13:14', + }, + { + 'id': '22', + 'name': '被检设备', + + 'path':'/plan/planList/index', + 'sort':22, + 'type':'菜单', + 'remark':'检测计划描述', + 'route_Name':'route', + 'create_Time': '2024-10-16 12:13:14', + 'update_Time':'2024-10-16 12:13:14', + }, + { + 'id': '23', + 'name': '误差体系', + + 'path':'/plan/planList/index', + 'sort':23, + 'type':'菜单', + 'remark':'检测计划描述', + 'route_Name':'route', + 'create_Time': '2024-10-16 12:13:14', + 'update_Time':'2024-10-16 12:13:14', + },{ + 'id': '24', + 'name': '检测源', + + 'path':'/plan/planList/index', + 'sort':24, + 'type':'菜单', + 'remark':'检测计划描述', + 'route_Name':'route', + 'create_Time': '2024-10-16 12:13:14', + 'update_Time':'2024-10-16 12:13:14', + } + + ] + }, + { + 'id': '3', + 'name': '权限管理', + + 'path':'/plan/planList/index', + 'sort':3, + 'type':'菜单', + 'remark':'检测计划描述', + 'route_Name':'route', + 'create_Time': '2024-10-16 12:13:14', + 'update_Time':'2024-10-16 12:13:14', + children:[{ + 'id': '31', + 'name': '用户管理', + + 'path':'/plan/planList/index', + 'sort':31, + 'type':'菜单', + 'remark':'检测计划描述', + 'route_Name':'route', + 'create_Time': '2024-10-16 12:13:14', + 'update_Time':'2024-10-16 12:13:14', + }, + { + 'id': '32', + 'name': '角色管理', + + 'path':'/plan/planList/index', + 'sort':32, + 'type':'菜单', + 'remark':'检测计划描述', + 'route_Name':'route', + 'create_Time': '2024-10-16 12:13:14', + 'update_Time':'2024-10-16 12:13:14', + }, + { + 'id': '33', + 'name': '菜单管理', + + 'path':'/plan/planList/index', + 'sort':33, + 'type':'菜单', + 'remark':'检测计划描述', + 'route_Name':'route', + 'create_Time': '2024-10-16 12:13:14', + 'update_Time':'2024-10-16 12:13:14', + } + ] + }, + { + 'id': '4', + 'name': '系统配置', + + 'path':'/plan/planList/index', + 'sort':4, + 'type':'菜单', + 'remark':'检测计划描述', + 'route_Name':'route', + 'create_Time': '2024-10-16 12:13:14', + 'update_Time':'2024-10-16 12:13:14', + children:[{ + 'id': '41', + 'name': '通用配置', + + 'path':'/plan/planList/index', + 'sort':41, + 'type':'菜单', + 'remark':'检测计划描述', + 'route_Name':'route', + 'create_Time': '2024-10-16 12:13:14', + 'update_Time':'2024-10-16 12:13:14', + }, + { + 'id': '42', + 'name': '数据字典', + + 'path':'/plan/planList/index', + 'sort':42, + 'type':'菜单', + 'remark':'检测计划描述', + 'route_Name':'route', + 'create_Time': '2024-10-16 12:13:14', + 'update_Time':'2024-10-16 12:13:14', + }, + { + 'id': '43', + 'name': '报告模版', + + 'path':'/plan/planList/index', + 'sort':43, + 'type':'菜单', + 'remark':'检测计划描述', + 'route_Name':'route', + 'create_Time': '2024-10-16 12:13:14', + 'update_Time':'2024-10-16 12:13:14', + },{ + 'id': '44', + 'name': '版本注册', + + 'path':'/plan/planList/index', + 'sort':44, + 'type':'菜单', + 'remark':'检测计划描述', + 'route_Name':'route', + 'create_Time': '2024-10-16 12:13:14', + 'update_Time':'2024-10-16 12:13:14', + } + +] + }, + { + 'id': '5', + 'name': '日志管理', + + 'path':'/plan/planList/index', + 'sort':5, + 'type':'菜单', + 'remark':'检测计划描述', + 'route_Name':'route', + 'create_Time': '2024-10-16 12:13:14', + 'update_Time':'2024-10-16 12:13:14', + }, + { + 'id': '6', + 'name': '统计分析', + + 'path':'/plan/planList/index', + 'sort':6, + 'type':'菜单', + 'remark':'检测计划描述', + 'route_Name':'route', + 'create_Time': '2024-10-16 12:13:14', + 'update_Time':'2024-10-16 12:13:14', + }, + { + 'id': '7', + 'name': '示例', + + 'path':'/plan/planList/index', + 'sort':7, + 'type':'菜单', + 'remark':'检测计划描述', + 'route_Name':'route', + 'create_Time': '2024-10-16 12:13:14', + 'update_Time':'2024-10-16 12:13:14', + children:[{ + 'id': '71', + 'name': '普通表格', + + 'path':'/plan/planList/index', + 'sort':71, + 'type':'菜单', + 'remark':'检测计划描述', + 'route_Name':'route', + 'create_Time': '2024-10-16 12:13:14', + 'update_Time':'2024-10-16 12:13:14', + }, + { + 'id': '72', + 'name': '表格树', + + 'path':'/plan/planList/index', + 'sort':72, + 'type':'菜单', + 'remark':'检测计划描述', + 'route_Name':'route', + 'create_Time': '2024-10-16 12:13:14', + 'update_Time':'2024-10-16 12:13:14', + } + ] + }, +]) + +export default resourcedata \ No newline at end of file diff --git a/frontend/src/api/system/dictData.ts b/frontend/src/api/system/dictData.ts index 5cdc655..fa2ca1d 100644 --- a/frontend/src/api/system/dictData.ts +++ b/frontend/src/api/system/dictData.ts @@ -43,6 +43,28 @@ const dictData: Dict[] = [ }, ], }, + { + id: "3", + code: 'type', + label: '资源类型', + children: [ + { + id: "1", + label: '菜单', + code: 1, + }, + { + id: "2", + label: '按钮', + code: 2, + }, + { + id: "3", + label: '公共资源', + code: 3, + }, + ], + }, ] export default dictData \ No newline at end of file diff --git a/frontend/src/api/user/interface/index.ts b/frontend/src/api/user/interface/index.ts index 80f863d..149b886 100644 --- a/frontend/src/api/user/interface/index.ts +++ b/frontend/src/api/user/interface/index.ts @@ -65,4 +65,5 @@ export namespace User { name: string; children?: ResDepartment[]; } -} \ No newline at end of file +} + diff --git a/frontend/src/api/user/user.ts b/frontend/src/api/user/user.ts index 504aa81..1a845e7 100644 --- a/frontend/src/api/user/user.ts +++ b/frontend/src/api/user/user.ts @@ -2,6 +2,7 @@ import { ResPage } from '@/api/interface' import { User } from './interface' import { ADMIN as rePrefix } from '@/api/config/serviceName' import http from '@/api' +import type { Resource } from '../resource/interface' /** * @name 用户管理模块 @@ -56,6 +57,11 @@ export const getUserStatus = () => { return http.get(`${rePrefix}/user/status`) } +// 获取用户状态字典 +export const getResourceType = () => { + return http.get(`${rePrefix}/user/status`) +} + // 获取用户性别字典 export const getUserGender = () => { return http.get(`${rePrefix}/user/gender`) diff --git a/frontend/src/components/ResourceDialog/index.vue b/frontend/src/components/ResourceDialog/index.vue new file mode 100644 index 0000000..0cdeb38 --- /dev/null +++ b/frontend/src/components/ResourceDialog/index.vue @@ -0,0 +1,82 @@ + + + + \ No newline at end of file diff --git a/frontend/src/utils/dict.ts b/frontend/src/utils/dict.ts index 7eb30a5..6b86683 100644 --- a/frontend/src/utils/dict.ts +++ b/frontend/src/utils/dict.ts @@ -15,3 +15,9 @@ export const userStatus = [ { label: "启用", value: 1, tagType: "success" }, { label: "禁用", value: 0, tagType: "danger" } ]; + +export const resourceType = [ + { label: "菜单", value: 1 }, + { label: "按钮", value: 2 }, + { label: "公共资源", value: 3 } +]; diff --git a/frontend/src/views/authority/resource/index.vue b/frontend/src/views/authority/resource/index.vue new file mode 100644 index 0000000..2f77cf8 --- /dev/null +++ b/frontend/src/views/authority/resource/index.vue @@ -0,0 +1,216 @@ + + \ No newline at end of file diff --git a/frontend/src/views/demo/proTable/index.vue b/frontend/src/views/demo/proTable/index.vue index 70c1f19..98aa56f 100644 --- a/frontend/src/views/demo/proTable/index.vue +++ b/frontend/src/views/demo/proTable/index.vue @@ -24,12 +24,11 @@ 重置密码 删除 - - + \ No newline at end of file