From 44e7598b686104ea7a7b4fdc8c746485c8f58955 Mon Sep 17 00:00:00 2001 From: sjl <1716605279@qq.com> Date: Tue, 12 Nov 2024 18:56:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/device/device.ts | 2 +- frontend/src/api/monitor/interface/index.ts | 35 ++ frontend/src/api/monitor/monitor.ts | 29 ++ frontend/src/api/role/interface/index.ts | 9 +- frontend/src/api/role/role.ts | 69 +-- .../api/system/dictionary/dictData/index.ts | 2 +- .../src/api/system/dictionary/dictPq/index.ts | 2 +- .../api/system/dictionary/dictTree/index.ts | 2 +- .../api/system/dictionary/dictType/index.ts | 2 +- frontend/src/api/user/interface/index.ts | 13 +- frontend/src/api/user/user.ts | 44 +- frontend/src/components/TimeControl/index.vue | 45 +- .../authority/role/components/rolePopup.vue | 186 ++++---- frontend/src/views/authority/role/index.vue | 138 +----- .../user/components/passWordPopup.vue | 142 ++++++ .../authority/user/components/userPopup.vue | 54 ++- frontend/src/views/authority/user/index.vue | 107 ++++- frontend/src/views/home/components/tree.vue | 4 +- .../machine/device/components/devicePopup.vue | 451 +++++++++++------- frontend/src/views/machine/device/index.vue | 12 +- .../dictionary/dictPq/components/pqPopup.vue | 2 +- .../views/system/dictionary/dictPq/index.vue | 6 +- 22 files changed, 808 insertions(+), 548 deletions(-) create mode 100644 frontend/src/api/monitor/interface/index.ts create mode 100644 frontend/src/api/monitor/monitor.ts create mode 100644 frontend/src/views/authority/user/components/passWordPopup.vue diff --git a/frontend/src/api/device/device.ts b/frontend/src/api/device/device.ts index 8bd8d20..b94b559 100644 --- a/frontend/src/api/device/device.ts +++ b/frontend/src/api/device/device.ts @@ -23,7 +23,7 @@ export const updatePqDev = (params: Device.ResPqDev) => { //删除被检设备 export const deletePqDev = (params: string[]) => { - return http.delete(`/pqDev/delete`, params) + return http.post(`/pqDev/delete`, params) } //导出被检设备 diff --git a/frontend/src/api/monitor/interface/index.ts b/frontend/src/api/monitor/interface/index.ts new file mode 100644 index 0000000..dbd6275 --- /dev/null +++ b/frontend/src/api/monitor/interface/index.ts @@ -0,0 +1,35 @@ +import type { ReqPage,ResPage } from '@/api/interface' + +// 被检设备模块 +export namespace Monitor { + + /** + * 电能质量指标字典数据表格分页查询参数 + */ + export interface ReqPqMonParams extends ReqPage{ + id: string; // 装置序号id 必填 + devType?: string; // 设备名称 + createTime?:string; //创建时间 + } + + /** + * 被检设备新增、修改、根据id查询返回的对象 + */ + export interface ResPqMon { + id: string; //监测点ID + code: string; //默认与谐波系统监测点ID相同 + devId: string; //所属设备ID + name: string; //所属母线 + num: number; //监测点序号 + pt: number; //PT变比 + ct: number; //CT变比 + ptType:string; //接线方式,字典表 + } + + /** + * 被检设备表格查询分页返回的对象; + */ + export interface ResPqMonPage extends ResPage { + + } + } \ No newline at end of file diff --git a/frontend/src/api/monitor/monitor.ts b/frontend/src/api/monitor/monitor.ts new file mode 100644 index 0000000..e00e787 --- /dev/null +++ b/frontend/src/api/monitor/monitor.ts @@ -0,0 +1,29 @@ +import type { Monitor } from './interface' +import { ADMIN as rePrefix } from '@/api/config/serviceName' +import http from '@/api' + +/** + * @name 被检设备管理模块 + */ + +//获取被检设备 +export const getPqMonList = (params: Monitor.ReqPqMonParams) => { + return http.post(`/pqMon/list`, params) +} + +//添加被检设备 +export const addPqMon = (params: Monitor.ResPqMon) => { + return http.post(`/pqMon/add`, params) +} + +//编辑被检设备 +export const updatePqMon = (params: Monitor.ResPqMon) => { + return http.put(`/pqMon/update`, params) +} + +//删除被检设备 +export const deletePqMon = (params: string[]) => { + return http.post(`/pqMon/delete`, params) +} + + diff --git a/frontend/src/api/role/interface/index.ts b/frontend/src/api/role/interface/index.ts index 90e2e2f..1fbb63c 100644 --- a/frontend/src/api/role/interface/index.ts +++ b/frontend/src/api/role/interface/index.ts @@ -12,11 +12,16 @@ export namespace Role { //角色接口 export interface RoleBO { - id?: string; //角色类型ID + id: string; //角色类型ID name: string; //角色类型名称 code: string; //角色代码 type: number; //角色类型 - remark:string; //角色描述 + remark?:string; //角色描述 + state:number; + createBy?:string; // + createTime?: string; // 创建时间 + updateBy?: string; // + updateTime?: string; // 更新时间 } //角色+资源 diff --git a/frontend/src/api/role/role.ts b/frontend/src/api/role/role.ts index 0dff602..7ffee36 100644 --- a/frontend/src/api/role/role.ts +++ b/frontend/src/api/role/role.ts @@ -1,5 +1,5 @@ -import { ResPage } from '@/api/interface' -import { Role } from './interface' +import type { ResPage } from '@/api/interface' +import type { Role } from './interface' import { ADMIN as rePrefix } from '@/api/config/serviceName' import http from '@/api' @@ -8,7 +8,7 @@ import http from '@/api' */ // 获取角色列表 export const getRoleList = (params: Role.ReqRoleParams) => { - return http.post>(`/role/list`, params) + return http.get(`/sysRole/list`, params) // return http.post>(`/RoleList_Post`, params) // return http.post>(`${rePrefix}/role/list`, params) @@ -16,17 +16,17 @@ export const getRoleList = (params: Role.ReqRoleParams) => { // 新增角色 export const addRole = (params: Role.RoleBO) => { - return http.post(`/role/add`, params) + return http.post(`/sysRole/add`, params) } // 编辑角色 export const editRole = (params: Role.RoleBO) => { - return http.post(`/role/edit`, params) + return http.put(`/sysRole/edit`, params) } // 删除角色 export const deleteRole = (params: { id: string[] }) => { - return http.post(`/role/del`, params) + return http.post(`/sysRole/del`, params) } @@ -35,60 +35,3 @@ export const editRoleAndPermission = (params: Role.ReqRoleAndPermission) => { return http.post(`/role/edit_RoleAndPermission`, params) } - - - - - - - - - -// // 获取树形用户列表 -// export const getRoleTreeList = (params: Role.ReqRoleParams) => { -// return http.post>(`${rePrefix}/role/tree/list`, params) -// } - -// export const addRole = (params: { id: string ; rolename: string;status: number; describe:string; }) => { -// return http.post(`/RoleList_Add`, params) -// } - -// 批量添加角色 -// export const BatchAddRole = (params: FormData) => { -// return http.post(`${rePrefix}/role/import`, params) -// } - -// // 切换角色状态 -// export const changeRoleStatus = (params: { id: string; status: number }) => { -// return http.post(`${rePrefix}/role/change`, params) -// } - -// 重置用户密码 -// export const resetUserPassWord = (params: { id: string }) => { -// return http.post(`${rePrefix}/role/rest_password`, params) -// } - -// 导出角色数据 -// export const exportRoleInfo = (params: Role.ReqRoleParams) => { -// return http.download(`${rePrefix}/role/export`, params) -// } - -// 获取角色状态字典 -// export const getRoleStatus = () => { -// return http.get(`${rePrefix}/role/status`) -// } - -// 获取用户性别字典 -// export const getUserGender = () => { -// return http.get(`${rePrefix}/user/gender`) -// } - -// 获取角色权限列表 -// export const getRoleDepartment = () => { -// return http.get(`${rePrefix}/role/permission`) -// } - -// 获取用户角色字典 -// export const getUserRole = () => { -// return http.get(`${rePrefix}/user/role`) -// } diff --git a/frontend/src/api/system/dictionary/dictData/index.ts b/frontend/src/api/system/dictionary/dictData/index.ts index 5571143..14d647f 100644 --- a/frontend/src/api/system/dictionary/dictData/index.ts +++ b/frontend/src/api/system/dictionary/dictData/index.ts @@ -19,7 +19,7 @@ export const updateDictData = (params: Dict.ResDictData) => { //删除字典数据 export const deleteDictData = (params: string[]) => { - return http.delete(`/dictData/delete`, params) + return http.post(`/dictData/delete`, params) } export const getDicDataById = (params: string) => { diff --git a/frontend/src/api/system/dictionary/dictPq/index.ts b/frontend/src/api/system/dictionary/dictPq/index.ts index 788fe9e..87d8e45 100644 --- a/frontend/src/api/system/dictionary/dictPq/index.ts +++ b/frontend/src/api/system/dictionary/dictPq/index.ts @@ -18,6 +18,6 @@ export const updateDictPq = (params: Dict.ResDictPq) => { //删除字典类型 export const deleteDictPq = (params: string[]) => { - return http.delete(`/dictPq/delete`, params) + return http.post(`/dictPq/delete`, params) } diff --git a/frontend/src/api/system/dictionary/dictTree/index.ts b/frontend/src/api/system/dictionary/dictTree/index.ts index efc5d00..d629930 100644 --- a/frontend/src/api/system/dictionary/dictTree/index.ts +++ b/frontend/src/api/system/dictionary/dictTree/index.ts @@ -13,7 +13,7 @@ export const addDictTree = (params: Dict.ResDictTree) => { //编辑字典类型 export const updateDictTree = (params: Dict.ResDictTree) => { - return http.post(`/dictTree/update`, params) + return http.put(`/dictTree/update`, params) } //删除字典类型 diff --git a/frontend/src/api/system/dictionary/dictType/index.ts b/frontend/src/api/system/dictionary/dictType/index.ts index aaa1ee2..11f0768 100644 --- a/frontend/src/api/system/dictionary/dictType/index.ts +++ b/frontend/src/api/system/dictionary/dictType/index.ts @@ -18,7 +18,7 @@ export const updateDictType = (params: Dict.ResDictType) => { //删除字典类型 export const deleteDictType = (params: string[]) => { - return http.delete(`/dictType/delete`, params) + return http.post(`/dictType/delete`, params) } //导出字典类型 diff --git a/frontend/src/api/user/interface/index.ts b/frontend/src/api/user/interface/index.ts index 248f334..19e900a 100644 --- a/frontend/src/api/user/interface/index.ts +++ b/frontend/src/api/user/interface/index.ts @@ -23,7 +23,7 @@ export namespace User { */ export interface ReqUserParams extends ReqPage{ id: string; // 装置序号用户ID 必填 - name: string; //用户名(别名) + name?: string; //用户名(别名) loginTime?: string;//最后一次登录时间 } @@ -44,8 +44,19 @@ export namespace User { createTime?: string;//创建时间 updateBy?: string;//更新用户 updateTime?: string;//更新时间 + roleIds?: string[]; // + roleNames?:string[]; // } + // 用户接口 + export interface ResPassWordUser { + id: string; //用户ID,作为唯一标识 + oldPassword: string; //密码 + newPassword: string; //新密码 + surePassword:string; + } + + /** * 用户表格查询分页返回的对象; */ diff --git a/frontend/src/api/user/user.ts b/frontend/src/api/user/user.ts index d57b90c..74279e9 100644 --- a/frontend/src/api/user/user.ts +++ b/frontend/src/api/user/user.ts @@ -1,5 +1,6 @@ +import type { Role } from './../role/interface/index'; import type { ResPage } from '@/api/interface' -import type { User } from './interface' +import type { User} from './interface' import { ADMIN as rePrefix } from '@/api/config/serviceName' import http from '@/api' @@ -8,50 +9,33 @@ import http from '@/api' */ // 获取用户列表 export const getUserList = (params: User.ReqUserParams) => { - return http.post(`/user/list`, params) + return http.post(`/sysUser/list`, params) } -// 获取树形用户列表 -// export const getUserTreeList = (params: User.ReqUserParams) => { -// return http.post>(`${rePrefix}/user/tree/list`, params) -// } // 新增用户 export const addUser = (params: User.ResUser) => { - return http.post(`/user/add`, params) -} - -// 批量添加用户 -export const BatchAddUser = (params: User.ReqUserParams) => { - return http.post(`$/user/import`, params) + return http.post(`/sysUser/add`, params) } // 编辑用户 export const updateUser = (params: User.ResUser) => { - return http.post(`/user/update`, params) + return http.put(`/sysUser/update`, params) } // 删除用户 export const deleteUser = (params: string[] ) => { - return http.post(`/user/delete`, params) + return http.post(`/sysUser/delete`, params) } -// 切换用户状态 -// export const changeUserStatus = (params: { id: string; status: number }) => { -// return http.post(`${rePrefix}/user/change`, params) -// } -// 重置用户密码 -// export const resetUserPassWord = (params: { id: string }) => { -// return http.post(`${rePrefix}/user/rest_password`, params) -// } - -// 导出用户数据 -export const exportUserInfo = (params: User.ReqUserParams) => { - return http.download(`${rePrefix}/user/export`, params) +// 获取角色列表 +export const getRoleList = () => { + return http.get(`/sysRole/simpleList`) +} + +//修改密码 +export const updatePassWord = (params: User.ResPassWordUser) => { + return http.put(`/sysUser/updatePassword`,params) } -// 获取用户状态字典 -// export const getUserStatus = () => { -// return http.get(`${rePrefix}/user/status`) -// } diff --git a/frontend/src/components/TimeControl/index.vue b/frontend/src/components/TimeControl/index.vue index eda6a32..8ef90e9 100644 --- a/frontend/src/components/TimeControl/index.vue +++ b/frontend/src/components/TimeControl/index.vue @@ -138,40 +138,42 @@ const updateDateRange = () => { } else if (timeUnit.value === '周') { startDate.value = getStartOfWeek(today.value) endDate.value = getEndOfWeek(today.value) - console.log(endDate.value.toLocaleDateString()) + //console.log(endDate.value.toLocaleDateString()) } else if (timeUnit.value === '月') { // 获取本月的开始和结束日期 startDate.value = new Date(today.value.getFullYear(), today.value.getMonth(), 1); endDate.value = new Date(today.value.getFullYear(), today.value.getMonth() + 1, 0); - // 确保结束日期不超过今天 - if (endDate.value > today.value) { - endDate.value = new Date(today.value); - endDate.value.setHours(23, 59, 59, 999); // 设置结束时间为今天的23:59:59.999 -} +// // 确保结束日期不超过今天 +// if (endDate.value > today.value) { +// endDate.value = new Date(today.value); +// endDate.value.setHours(23, 59, 59, 999); // 设置结束时间为今天的23:59:59.999 +// } } else if (timeUnit.value === '季度') { const quarter = Math.floor(today.value.getMonth() / 3); startDate.value = new Date(today.value.getFullYear(), quarter * 3, 1); endDate.value = new Date(today.value.getFullYear(), quarter * 3 + 3, 0); - // 确保结束日期不超过今天 - if (endDate.value > today.value) { - endDate.value = new Date(today.value); - endDate.value.setHours(23, 59, 59, 999); // 设置结束时间为今天的23:59:59.999 - } + // // 确保结束日期不超过今天 + // if (endDate.value > today.value) { + // endDate.value = new Date(today.value); + // endDate.value.setHours(23, 59, 59, 999); // 设置结束时间为今天的23:59:59.999 + // } } else if (timeUnit.value === '年') { startDate.value = new Date(today.value.getFullYear(), 0, 1); endDate.value = new Date(today.value.getFullYear(), 11, 31); - // 确保结束日期不超过今天 - if (endDate.value > today.value) { - endDate.value = new Date(today.value); - endDate.value.setHours(23, 59, 59, 999); // 设置结束时间为今天的23:59:59.999 - } + // // 确保结束日期不超过今天 + // if (endDate.value > today.value) { + // console.log("1111") + // endDate.value = new Date(today.value); + // endDate.value.setHours(23, 59, 59, 999); // 设置结束时间为今天的23:59:59.999 + // } } + updateNextButtonStatus() } const getStartOfWeek = (date: Date) => { @@ -192,8 +194,8 @@ const getEndOfWeek = (date: Date) => { today.setHours(23, 59, 59, 999); // 设置今天的结束时间(23:59:59.999) // 返回不超过今天的结束时间 - return endOfWeek > today ? today : endOfWeek; - //return endOfWeek + //return endOfWeek > today ? today : endOfWeek; + return endOfWeek } const prevPeriod = () => { const prevStartDate = new Date(startDate.value) @@ -206,8 +208,13 @@ const prevPeriod = () => { prevStartDate.setDate(prevStartDate.getDate() - 7) prevEndDate.setDate(prevEndDate.getDate() - 7) } else if (timeUnit.value === '月') { + + prevStartDate.setMonth(prevStartDate.getMonth() - 1) prevEndDate.setMonth(prevEndDate.getMonth() - 1) + + + } else if (timeUnit.value === '季度') { prevStartDate.setMonth(prevStartDate.getMonth() - 3) prevEndDate.setMonth(prevEndDate.getMonth() - 3) @@ -251,6 +258,7 @@ const nextPeriod = () => { updateNextButtonStatus() } const updateNextButtonStatus = () => { + //console.log(endDate.value) // 更新下一个按钮的禁用状态 const maxDate = new Date() // 假设最新日期为今天 // 将 maxDate 设置为当天的开始时间 @@ -263,6 +271,7 @@ const updateNextButtonStatus = () => { emitDateChange() // 变化时也发出更新事件 } + // 限制开始日期不能选择超过当前日期 const disableStartDate = (date: Date) => { return date > today.value diff --git a/frontend/src/views/authority/role/components/rolePopup.vue b/frontend/src/views/authority/role/components/rolePopup.vue index 34dab98..8d79891 100644 --- a/frontend/src/views/authority/role/components/rolePopup.vue +++ b/frontend/src/views/authority/role/components/rolePopup.vue @@ -1,40 +1,28 @@