From 0515a025654ac7db2b1ad998c8e4fe20b6fc651a Mon Sep 17 00:00:00 2001 From: "[li_she]" <[li.she@xujiesoft.com]> Date: Sat, 28 May 2022 15:50:45 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=B9=E6=AE=8A=E6=9D=83=E9=99=90=202022-05-?= =?UTF-8?q?28=20sxm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/sys/user.vue | 108 +++++++++++++++++++++++++++------ 1 file changed, 91 insertions(+), 17 deletions(-) diff --git a/src/views/modules/sys/user.vue b/src/views/modules/sys/user.vue index 6d450fb..e857547 100644 --- a/src/views/modules/sys/user.vue +++ b/src/views/modules/sys/user.vue @@ -20,6 +20,7 @@ - - - 确定 + 确定 取消 @@ -191,6 +188,8 @@ export default { data() { return { showButton: true, + height: 200, + securityHeight: 200, specialVisible: false, siteVisible: false, currentData: {}, @@ -206,24 +205,62 @@ export default { dataForm: { userName: '' }, - columnList: [{ + columnList: [ + { userId: this.$store.state.user.name, - serialNumber: 'security'+this.$route.meta.menuId+'securitydesc', + serialNumber: 'security' + this.$route.meta.menuId + 'securitydesc', tableId: this.$route.meta.menuId + 'security', - tableName: "locationTable", + tableName: "securityTable", columnProp: "securitydesc", headerAlign: "center", - align: "center", - columnLabel: "", + align: "left", + columnLabel: "参数描述", columnHidden: false, columnImage: false, + columnWidth: 70, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + }, + { + userId: this.$store.state.user.name, + serialNumber: 'security' + this.$route.meta.menuId + 'securitydesc', + tableId: this.$route.meta.menuId + 'security', + tableName: "securityTable", + columnProp: "module", + headerAlign: "center", + align: "left", + columnLabel: "模块", + columnHidden: false, + columnImage: false, + columnSortable: false, + columnWidth: 20, + sortLv: 0, + status: true, + fixed: false, + }, + { + userId: this.$store.state.user.name, + serialNumber: 'security' + this.$route.meta.menuId + 'securitydesc', + tableId: this.$route.meta.menuId + 'security', + tableName: "securityTable", + columnProp: "itemvalue", + headerAlign: "center", + align: "center", + columnLabel: "参数值", + columnHidden: true, + columnImage: false, columnSortable: false, + columnWidth: 10, sortLv: 0, status: true, fixed: false, - },], + }, + ], dataList: [], securityList: [], + selectSpecialList: [], siteList: [], selectSitList: [], selectUser: {}, @@ -241,11 +278,48 @@ export default { activated() { this.getDataList() }, + mounted() { + this.$nextTick(() => { + this.securityHeight = window.innerHeight - 400; + this.height = window.innerHeight - 200; + }) + }, methods: { // 特殊权限 specialAuthorize() { this.specialVisible = true + this.searchUserSpecialSecurity() + }, + // 获取特殊权限 + searchUserSpecialSecurity() { + saveUserSpecialSecurity({userid: this.selectUser.username}).then(({data}) => { + if (data.code === 0) { + getUserSpecialSecurity(this.selectUser.username).then(({data}) => { + if (data.code === 0) { + this.securityList = data.dataList.map(item => { + item.itemvalue = item.itemvalue == 'Y' ? true : false; + return item; + }) + } + }) + } + }) + }, + // 保存用户权限 + saveUserSecurity() { + let securityList = JSON.parse(JSON.stringify(this.securityList)).map(item => { + item.itemvalue = item.itemvalue === true ? 'Y' : 'N'; + return item; + }) + updateUserSpecialSecurity(securityList).then(({data}) => { + if (data.code === 0) { + this.$message.success(data.msg) + this.specialVisible = false + }else { + this.$message.success(data.msg) + } + }) }, // 授权工厂 siteAuthorize() {