From fb214d756719da5c4b194f1b1de8e2d34b2b40d6 Mon Sep 17 00:00:00 2001 From: yuejiayang <146344614+YangLei105@users.noreply.github.com> Date: Tue, 2 Jan 2024 16:01:32 +0800 Subject: [PATCH] =?UTF-8?q?2024.1.2=201.=E7=94=A8=E6=88=B7=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=A2=9E=E5=8A=A0=20BU=20=E9=83=A8=E9=97=A8=20?= =?UTF-8?q?=E5=B2=97=E4=BD=8D=20;=20=E5=B7=A5=E5=8E=82=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=E4=B8=8B=E6=8B=89=E6=A1=86=20?= =?UTF-8?q?=E4=BB=8Esite=E8=8E=B7=E5=8F=96=E4=BF=A1=E6=81=AF,=20=E5=85=B6?= =?UTF-8?q?=E4=B8=AD=20BU=E8=A6=81=E4=BB=8EBU=E8=A1=A8=E9=87=8C=E9=9D=A2?= =?UTF-8?q?=20=E6=A0=B9=E6=8D=AE=E6=89=80=E9=80=89=E5=B7=A5=E5=8E=82?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=B8=8B=E6=8B=89=E6=95=B0=E6=8D=AE;=20?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=B7=A5=E5=8E=82=E9=80=89=E6=8B=A9=E5=8F=91?= =?UTF-8?q?=E7=94=9F=E6=94=B9=E5=8F=98=E6=97=B6=EF=BC=8CBU=E9=87=8D?= =?UTF-8?q?=E7=BD=AE=E4=B8=BA=20=E8=AF=B7=E9=80=89=E6=8B=A9;=20=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E5=92=8C=E5=B2=97=E4=BD=8D=E5=88=86=E5=88=AB=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E4=B8=80=E5=BC=A0=E8=A1=A8;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2.增加权限清单汇总 用户列表操作里面新增 权限清单按钮 点击弹出模态框 里面五个页签; 工厂权限 AccessSite和site关联查出 栏位:工厂编码 工厂名称 地址; BU权限 AccessBU 和 BU 关联 栏位: 工厂编码 部门编码 部门名称; 项目权限 AccessProject和plm_project_info 栏位: 工厂编码 部门名称 项目号 项目名称 项目状态 need_date:要求完成日期; 字段权限 AccessField plm_field_function_list plm_field_list 3表关联 栏位 功能名称 功能分组 字段名称; 特殊权限 和按钮出来的页面一样 只是不能编辑; 5.角色管理菜单 改成 权限集 功能页面里面所有的角色改成 权限集 6.增加系统角色表 增加角色表 表名 plm_user_job 字段主键为 userId 后面就是每个岗位 用char(1) 格式 页面里面提供修改操作 --- src/api/base/field.js | 1 + src/api/base/site.js | 15 + src/api/user.js | 4 + src/views/modules/sys/role-add-or-update.vue | 14 +- src/views/modules/sys/role.vue | 6 +- src/views/modules/sys/user-add-or-update.vue | 195 +++++++- src/views/modules/sys/user.vue | 335 ++++++++++++- src/views/modules/sys/userjob.vue | 490 +++++++++++++++++++ 8 files changed, 1029 insertions(+), 31 deletions(-) create mode 100644 src/views/modules/sys/userjob.vue diff --git a/src/api/base/field.js b/src/api/base/field.js index c59fe45..800984a 100644 --- a/src/api/base/field.js +++ b/src/api/base/field.js @@ -7,3 +7,4 @@ export const searchAccessFieldListForField= data => createAPI(`/base/searchAcces export const saveAccessFieldForField= data => createAPI(`/base/saveAccessFieldForField`,'post',data) export const searchAccessFieldListByUser= data => createAPI(`/base/searchAccessFieldListByUser`,'post',data) export const saveAccessFieldListByUser= data => createAPI(`/base/saveAccessFieldListByUser`,'post',data) +export const getUserAccessFieldFunctionInfoList= data => createAPI(`/base/getUserAccessFieldFunctionInfoList`,'post',data) diff --git a/src/api/base/site.js b/src/api/base/site.js index 309949d..90f15fe 100644 --- a/src/api/base/site.js +++ b/src/api/base/site.js @@ -50,3 +50,18 @@ export const saveAccessProject= data => createAPI(`/base/saveAccessProject`,'pos export const searchAccessSiteListBySite= data => createAPI(`/base/searchAccessSiteListBySite`,'post',data) export const saveAccessSiteForSite= data => createAPI(`/base/saveAccessSiteForSite`,'post',data) + +// 获取用户工厂权限信息 +export const getUserAccessSiteInfoList = data => createAPI(`/base/getUserAccessSiteInfoList`,'post',data) + +// 获取用户BU权限信息 +export const getUserAccessBUInfoList = data => createAPI(`/base/getUserAccessBUInfoList`,'post',data) + +// 获取用户项目权限信息 +export const getUserAccessProjectInfoList = data => createAPI(`/base/getUserAccessProjectInfoList`,'post',data) + +export const getSiteList = data => createAPI(`/base/getSiteList`,'post',data) + +export const getDepartmentList = data => createAPI(`/base/getDepartmentList`,'post',data) + +export const getPostList = data => createAPI(`/base/getPostList`,'post',data) diff --git a/src/api/user.js b/src/api/user.js index 3246cec..fbad7aa 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -7,3 +7,7 @@ export const updateUserLanguage = data => createAPI(`sys/user/updateUserLanguage // 获取用户列表 export const userList = data => createAPI(`sys/user/userList`,'Post',data) + +export const searchUserJobList = data => createAPI(`sys/userJob/searchUserJobList`,'Post',data) + +export const editUserJobInfo = data => createAPI(`sys/userJob/editUserJobInfo`,'Post',data) diff --git a/src/views/modules/sys/role-add-or-update.vue b/src/views/modules/sys/role-add-or-update.vue index 1d9a5b3..2926c46 100644 --- a/src/views/modules/sys/role-add-or-update.vue +++ b/src/views/modules/sys/role-add-or-update.vue @@ -6,12 +6,12 @@ :close-on-click-modal="false" :visible.sync="visible"> - - + label-width="81px"> + + - + @@ -64,7 +64,7 @@ export default { add: '添加', edit: '编辑', authorize: '授权', - roleName: '角色名称', + roleName: '权限集名称', remark: '备注', }, dataForm: { @@ -74,7 +74,7 @@ export default { }, dataRule: { roleName: [ - {required: true, message: '角色名称不能为空', trigger: 'blur'} + {required: true, message: '权限集名称不能为空', trigger: 'blur'} ] }, tempKey: -666666 // 临时key, 用于解决tree半选中状态项不能传给后台接口问题. # 待优化 @@ -124,7 +124,7 @@ export default { } }) }, - // 点击获取角色权限 , + // 点击获取权限集权限 , getMenuInfo(node, data, value) { this.menuInfo.menuId = data.data.menuId this.menuInfo.name = data.data.name diff --git a/src/views/modules/sys/role.vue b/src/views/modules/sys/role.vue index f05504c..1e57443 100644 --- a/src/views/modules/sys/role.vue +++ b/src/views/modules/sys/role.vue @@ -2,7 +2,7 @@
- + {{buttons.search ||'查询' }} @@ -19,7 +19,7 @@ prop="roleName" header-align="center" align="center" - :label="buttons.roleName||'角色名称'"> + :label="buttons.roleName||'权限集名称'"> + :visible.sync="visible" + @close="closeDataDialog"> - - {{buttons.site||'工厂'}} - + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ @@ -53,8 +94,6 @@ - - {{buttons.disable||'禁用'}} @@ -65,7 +104,7 @@ {{buttons.submit||'确定'}} - {{buttons.close||'取消'}} + {{buttons.close||'取消'}} @@ -81,6 +120,7 @@ import {searchSysLanguage} from "@/api/sysLanguage.js" import { searchFunctionButtonList, } from "@/api/sysLanguage.js" + import {getBUList, getDepartmentList, getPostList, getSiteList} from '../../../api/base/site' export default { components: { Chooselist @@ -92,6 +132,10 @@ export default { roleList: [], factorys: [], languageList: [], + siteList:[], + buList:[], + departmentList:[], + postList:[], dataForm: { id: 0, userName: '', @@ -101,9 +145,20 @@ export default { salt: '', email: '', mobile: '', + buNo: '', + buDesc: '', + department:'', + departmentNo:'', + departmentName:'', + post:'', + postNo:'', + postName:'', roleIdList: [], status: 1, site: '', + siteID: '', + bu:'', + siteName:'', userDisplay: '' }, buttons: { @@ -113,6 +168,9 @@ export default { userDisplay: '用户名', email: '邮箱', mobile: '手机号', + bu:'BU', + department:'部门', + post:'岗位', status: '状态', disable: '禁用', normal: '正常', @@ -120,12 +178,65 @@ export default { comfirmPassword:'确认密码', submit: '确定', close: '取消', - site: '工厂', + siteID: '工厂', + siteName:'工厂名称', language: '语言', }, } }, methods: { + getSiteList () { + getSiteList().then(({data}) => { + this.siteList = data.rows + // let list = data.rows.map(item=>{ + // return { + // site:item.siteID, + // siteName:item.siteName + // } + // }) + // console.log(list) + }) + }, + getBUDepartmentPostList () { + let tempData ={ + site:this.dataForm.siteID + } + this.dataForm.buNo = '' + this.dataForm.buDesc = '' + this.dataForm.departmentNo = '' + this.dataForm.departmentName = '' + this.dataForm.postNo = '' + this.dataForm.postName = '' + getBUList(tempData).then(({data}) => { + this.buList = data.rows + this.dataForm.buDesc = data.rows.buDesc + }) + getDepartmentList(tempData).then(({data}) => { + this.departmentList = data.rows + this.dataForm.departmentName = data.rows.departmentName + }) + getPostList(tempData).then(({data}) => { + this.postList = data.rows + this.dataForm.postName = data.rows.postName + }) + }, + getBDPList () { + let tempData ={ + site:this.dataForm.siteID + } + getBUList(tempData).then(({data}) => { + this.buList = data.rows + this.dataForm.buDesc = data.rows.buDesc + }) + getDepartmentList(tempData).then(({data}) => { + this.departmentList = data.rows + this.dataForm.departmentName = data.rows.departmentName + }) + getPostList(tempData).then(({data}) => { + this.postList = data.rows + this.dataForm.postName = data.rows.postName + }) + }, getFunctionButtonList() { let queryButton = { functionId: this.$route.meta.menuId, @@ -194,10 +305,43 @@ export default { this.dataForm.roleIdList = data.user.roleIdList this.dataForm.status = data.user.status this.dataForm.languageDefault = data.user.languageDefault - this.dataForm.site = data.user.site.toString() this.dataForm.userDisplay = data.user.userDisplay + this.dataForm.siteID = data.user.site + this.dataForm.buNo = data.user.buNo + this.dataForm.buDesc = data.user.buDesc + this.dataForm.department = data.user.department + this.dataForm.departmentNo = data.user.departmentNo + this.dataForm.departmentName = data.user.departmentName + this.dataForm.post = data.user.post + this.dataForm.postNo = data.user.postNo + this.getBDPList() } }) + } else { + this.dataForm = { + buNo: '', + buDesc: '', + userName: '', + password: '', + comfirmPassword: '', + languageDefault: '', + salt: '', + email: '', + mobile: '', + bu:'', + department:'', + departmentNo:'', + departmentName:'', + post:'', + postNo:'', + postName:'', + roleIdList: [], + status: 1, + site: '', + siteID: '', + siteName:'', + userDisplay: '' + } } }) }, @@ -218,8 +362,11 @@ export default { 'status': this.dataForm.status, 'roleIdList': this.dataForm.roleIdList, 'languageDefault': this.dataForm.languageDefault, - 'site': this.dataForm.site, + 'site': this.dataForm.siteID, 'userDisplay': this.dataForm.userDisplay, + 'buNo': this.dataForm.buNo, + 'departmentNo': this.dataForm.departmentNo, + 'postNo': this.dataForm.postNo, }) }).then(({data}) => { if (data && data.code === 0) { @@ -232,10 +379,38 @@ export default { }) } }) + }, + // 关闭弹窗 + closeDataDialog() { + this.dataForm = { + buNo: '', + buDesc: '', + userName: '', + password: '', + comfirmPassword: '', + languageDefault: '', + salt: '', + email: '', + mobile: '', + bu:'', + department:'', + departmentNo:'', + departmentName:'', + post:'', + postNo:'', + postName:'', + roleIdList: [], + status: 1, + site: '', + siteID: '', + siteName:'', + userDisplay: '' + } } }, created() { this.getFunctionButtonList() + this.getSiteList() } } diff --git a/src/views/modules/sys/user.vue b/src/views/modules/sys/user.vue index ca4c910..0ed00ee 100644 --- a/src/views/modules/sys/user.vue +++ b/src/views/modules/sys/user.vue @@ -55,6 +55,24 @@ align="center" :label="buttons.userDisplay||'用户名'"> + + + + + +