diff --git a/frontend/src/api/device/interface/index.ts b/frontend/src/api/device/interface/index.ts index d3e4d32..60ee9e4 100644 --- a/frontend/src/api/device/interface/index.ts +++ b/frontend/src/api/device/interface/index.ts @@ -31,7 +31,7 @@ export namespace Device { protocol:string; //通讯协议 ip: string; //IP地址 port: number; //端口号 - encryption: number; //装置是否为加密版本 + encryptionFlag: number; //装置是否为加密版本 series?: string| null; //装置识别码(3ds加密) devKey?: string| null; //装置秘钥(3ds加密) sampleID?: string| null; //样品编号 diff --git a/frontend/src/api/function/functionExample.ts b/frontend/src/api/function/functionExample.ts index f872cfe..83ff875 100644 --- a/frontend/src/api/function/functionExample.ts +++ b/frontend/src/api/function/functionExample.ts @@ -8,6 +8,7 @@ export const functionList : Function.ResFunction[] = [ 'name': '检测计划', 'code':'route', 'path':'/plan/planList/index', + 'component':'planList', 'icon':'', 'sort':100, 'type':0, @@ -21,6 +22,7 @@ export const functionList : Function.ResFunction[] = [ name: '台账管理', code:'route', path:'/machine', + 'component':'planList', icon:'', sort:100, type:0, @@ -33,6 +35,7 @@ export const functionList : Function.ResFunction[] = [ name: '检测脚本', code:'route', path:'/machine/testScript/index', + 'component':'planList', icon:'', sort:100, type:1, @@ -46,6 +49,7 @@ export const functionList : Function.ResFunction[] = [ name: '被检设备', code:'route', path:'/plan/planList/index', + 'component':'planList', icon:'', sort:100, type:1, @@ -59,6 +63,7 @@ export const functionList : Function.ResFunction[] = [ name: '误差体系', code:'route', path:'/plan/planList/index', + 'component':'planList', icon:'', sort:100, type:1, @@ -72,6 +77,7 @@ export const functionList : Function.ResFunction[] = [ name: '检测源', code:'route', path:'/plan/planList/index', + 'component':'planList', icon:'', sort:100, type:1, @@ -86,6 +92,7 @@ export const functionList : Function.ResFunction[] = [ name: '权限管理', code:'route', path:'/plan/planList/index', + 'component':'planList', icon:'', sort:100, type:0, @@ -98,6 +105,7 @@ export const functionList : Function.ResFunction[] = [ name: '用户管理', code:'route', path:'/plan/planList/index', + 'component':'planList', icon:'', sort:100, type:0, @@ -111,6 +119,7 @@ export const functionList : Function.ResFunction[] = [ name: '角色管理', code:'route', path:'/plan/planList/index', + 'component':'planList', icon:'', sort:100, type:0, @@ -124,6 +133,7 @@ export const functionList : Function.ResFunction[] = [ name: '菜单管理', code:'route', path:'/plan/planList/index', + 'component':'planList', icon:'', sort:100, type:0, @@ -138,6 +148,7 @@ export const functionList : Function.ResFunction[] = [ name: '系统配置', code:'route', path:'/plan/planList/index', + 'component':'planList', icon:'', sort:100, type:0, @@ -150,6 +161,7 @@ export const functionList : Function.ResFunction[] = [ name: '通用配置', code:'route', path:'/plan/planList/index', + 'component':'planList', icon:'', sort:100, type:0, @@ -163,6 +175,7 @@ export const functionList : Function.ResFunction[] = [ name: '数据字典', code:'route', path:'/plan/planList/index', + 'component':'planList', icon:'', sort:100, type:0, @@ -176,6 +189,7 @@ export const functionList : Function.ResFunction[] = [ name: '报告模版', code:'route', path:'/plan/planList/index', + 'component':'planList', icon:'', sort:100, type:0, @@ -189,6 +203,7 @@ export const functionList : Function.ResFunction[] = [ name: '版本注册', code:'route', path:'/plan/planList/index', + 'component':'planList', icon:'', sort:100, type:0, @@ -203,6 +218,7 @@ export const functionList : Function.ResFunction[] = [ name: '日志管理', code:'route', path:'/plan/planList/index', + 'component':'planList', icon:'', sort:100, type:0, @@ -216,6 +232,7 @@ export const functionList : Function.ResFunction[] = [ name: '统计分析', code:'route', path:'/plan/planList/index', + 'component':'planList', icon:'', sort:100, type:0, @@ -229,6 +246,7 @@ export const functionList : Function.ResFunction[] = [ name: '示例', code:'route', path:'/plan/planList/index', + 'component':'planList', icon:'', sort:100, type:0, @@ -241,6 +259,7 @@ export const functionList : Function.ResFunction[] = [ name: '普通表格', code:'route', path:'/plan/planList/index', + 'component':'planList', icon:'', sort:100, type:0, @@ -254,6 +273,7 @@ export const functionList : Function.ResFunction[] = [ name: '表格树', code:'route', path:'/plan/planList/index', + 'component':'planList', icon:'', sort:100, type:0, diff --git a/frontend/src/api/function/index.ts b/frontend/src/api/function/index.ts index bfb12eb..4cd5244 100644 --- a/frontend/src/api/function/index.ts +++ b/frontend/src/api/function/index.ts @@ -2,24 +2,25 @@ import http from "@/api"; import { ADMIN as rePrefix } from "@/api/config/serviceName"; import type { Function } from "@/api/function/interface"; + //获取菜单列表 export const getFunctionList = (params: Function.ReqFunctionParams) => { - return http.post(`${rePrefix}/function/list`, params); + return http.post(`/function/list`, params); }; //添加菜单列表 - export const addFunction = (params: Function.ReqFunctionParams) => { - return http.post(`${rePrefix}/function/add`,params); + export const addFunction = (params: Function.ResFunction) => { + return http.post(`/function/add`,params); }; //删除菜单列表 export const deleteFunction = (params: { id: string[] }) => { - return http.post(`${rePrefix}/function/delete`, { data: params }); + return http.post(`/function/delete`, { data: params }); }; //编辑菜单列表 - export const updateFunction = (params: Function.ReqFunctionParams) => { - return http.post(`${rePrefix}/function/update`, params); + export const updateFunction = (params: Function.ResFunction) => { + return http.put(`/function/update`, params); }; diff --git a/frontend/src/api/function/interface/index.ts b/frontend/src/api/function/interface/index.ts index 11374cb..eee77fc 100644 --- a/frontend/src/api/function/interface/index.ts +++ b/frontend/src/api/function/interface/index.ts @@ -21,10 +21,11 @@ export namespace Function { pids?:string | null;//节点上层所有节点 name: string;//名称 code:string;//资源标识 - path:string;//路径 - icon?:string | null;//图标 + path:string;//路由路径 + component:string ;//组件地址 + icon?:string;//图标 sort:number;//排序 - type:number | null;//资源类型0-菜单、1-按钮、2-公共资源、3-服务间调用资源 + type:number;//资源类型0-菜单、1-按钮、2-公共资源、3-服务间调用资源 remark?: string | null;//权限资源描述 state:number;//权限资源状态 create_By?:string | null;//创建人 diff --git a/frontend/src/api/index.ts b/frontend/src/api/index.ts index e459224..99f931c 100644 --- a/frontend/src/api/index.ts +++ b/frontend/src/api/index.ts @@ -21,6 +21,7 @@ const config = { withCredentials: true, // post请求指定数据类型以及编码 headers: { 'Content-Type': 'application/json;charset=utf-8' } + //headers : {'Content-Type': 'multipart/form-data'} }; class RequestHttp { @@ -107,6 +108,16 @@ class RequestHttp { download(url: string, params?: object, _object = {}): Promise { return this.service.post(url, params, { ..._object, responseType: "blob" }); } + /** + * @description 批量导入专用请求方法 + */ + batchImport(url: string, formData: FormData, _object = {}): Promise> { + return this.service.post(url, formData, { + ..._object, + headers: { 'Content-Type': 'multipart/form-data' } + }); + } + } export default new RequestHttp(config); diff --git a/frontend/src/api/role/interface/index.ts b/frontend/src/api/role/interface/index.ts index 1fbb63c..14c02e1 100644 --- a/frontend/src/api/role/interface/index.ts +++ b/frontend/src/api/role/interface/index.ts @@ -1,15 +1,17 @@ -import type { ReqPage } from '@/api/interface' +import type { ReqPage, ResPage } from '@/api/interface' // 角色管理模块 export namespace Role { - //资源接口 - export interface Permission{ - id: string; //资源ID - name: string; //资源名称 - code: string; //资源代码 - } + /** + * 用户数据表格分页查询参数 + */ + export interface ReqRoleParams extends ReqPage{ + id: string; // 装置序号用户ID 必填 + name?: string; //用户名(别名) + code?: string; //角色代码 + } //角色接口 export interface RoleBO { id: string; //角色类型ID @@ -24,15 +26,19 @@ export namespace Role { updateTime?: string; // 更新时间 } - //角色+资源 - export interface ReqRoleAndPermission extends RoleBO{ - permissionList?:Permission[]; //角色权限列表 - } + //角色接口 + export interface RoleFunctionId { + id: string[]; //菜单id + } + + /** + * 用户表格查询分页返回的对象; + */ + export interface ResRolePage extends ResPage { + + } - // 角色+分页 - export interface ReqRoleParams extends ReqPage,RoleBO { - } diff --git a/frontend/src/api/role/role.ts b/frontend/src/api/role/role.ts index 7ffee36..ff96cfe 100644 --- a/frontend/src/api/role/role.ts +++ b/frontend/src/api/role/role.ts @@ -1,5 +1,6 @@ import type { ResPage } from '@/api/interface' import type { Role } from './interface' +import type { Function } from './../function/interface/index'; import { ADMIN as rePrefix } from '@/api/config/serviceName' import http from '@/api' @@ -8,7 +9,7 @@ import http from '@/api' */ // 获取角色列表 export const getRoleList = (params: Role.ReqRoleParams) => { - return http.get(`/sysRole/list`, params) + return http.post(`/sysRole/list`, params) // return http.post>(`/RoleList_Post`, params) // return http.post>(`${rePrefix}/role/list`, params) @@ -21,17 +22,27 @@ export const addRole = (params: Role.RoleBO) => { // 编辑角色 export const editRole = (params: Role.RoleBO) => { - return http.put(`/sysRole/edit`, params) + return http.put(`/sysRole/update`, params) } // 删除角色 export const deleteRole = (params: { id: string[] }) => { - return http.post(`/sysRole/del`, params) + return http.post(`/sysRole/delete`, params) } -// 编辑角色资源 -export const editRoleAndPermission = (params: Role.ReqRoleAndPermission) => { - return http.post(`/role/edit_RoleAndPermission`, params) +// 获取资源 +export const getFunctionList = () => { + return http.get(`/sysFunction/functionTree`) } + +//获取角色id绑定的菜单 +export const getRoleFunction = (params:Role.RoleBO) => { + return http.post(`/sysRole/getFunctionsByRoleId?id=${params.id}`) +} + +//角色分配菜单 +export const assignFunction = (params:Role.RoleBO,param:Role.RoleFunctionId) => { + return http.put(`/sysFunction/assignFunctionByRoleId`,{ roleId: params.id,functionIds:param.id }) +} \ No newline at end of file diff --git a/frontend/src/components/SelectIcon/index.vue b/frontend/src/components/SelectIcon/index.vue index 169f5b1..6b67dfd 100644 --- a/frontend/src/components/SelectIcon/index.vue +++ b/frontend/src/components/SelectIcon/index.vue @@ -30,9 +30,10 @@