From 0cd1631ceaa93e6483908fd692d2cb693b85324b Mon Sep 17 00:00:00 2001 From: 石广澎 <shiguangpeng@163.com> Date: 星期二, 02 一月 2024 14:26:01 +0800 Subject: [PATCH] 增加图片验证码和登录日志 权限管理优化 --- admin-web/src/views/systemManger/server/user/index.vue | 76 +++++++++++++++++++++++++++++-------- 1 files changed, 59 insertions(+), 17 deletions(-) diff --git a/admin-web/src/views/systemManger/server/user/index.vue b/admin-web/src/views/systemManger/server/user/index.vue index 2d13d56..ff44999 100644 --- a/admin-web/src/views/systemManger/server/user/index.vue +++ b/admin-web/src/views/systemManger/server/user/index.vue @@ -18,14 +18,14 @@ <el-row style="margin-top: 15px"> <el-col> <!--鍒楄〃--> - <my-table-v2 ref="myTable" :filter="filterFrom" :table="table" /> + <my-table-v2 ref="myTable" :filter="filterFrom" :table="table"/> </el-col> </el-row> </el-card> </el-col> </el-row> <!--娣诲姞/缂栬緫寮圭獥--> - <edit v-if="editSetting.show" :setting="editSetting" @close="editSetting.show = false" @search="search" /> + <edit v-if="editSetting.show" :setting="editSetting" @close="editSetting.show = false" @search="search"/> <editRole v-if="editRoleSetting.show" :setting="editRoleSetting" @@ -45,6 +45,7 @@ import editRole from './editRole'; import * as finsystenant from '@/api/baseSetting/finsystenant'; import * as user from '@/api/user'; +import {LongToDateTime} from "@/utils/DateFormatter"; export default { name: 'index', @@ -57,7 +58,7 @@ treeDataList: [], // 鎼滅储鏉′欢 filterFrom: { - tenantCode: 0, + tenantCode: null, userName: null, userCode: null, }, @@ -66,6 +67,7 @@ tenantId: null, //鍖哄垝id tenantCode: null, //鍖哄垝code tenantName: null, //鍖哄垝鍚嶇О + data_scope: 0, //瑙掕壊鑼冨洿 editSetting: { title: '', id: '', @@ -75,6 +77,7 @@ // 缂栬緫瑙掕壊閰嶇疆 editRoleSetting: { title: '', + data_scope: 0, id: '', show: false, }, @@ -105,10 +108,10 @@ }, // 鍒椾俊鎭� columns: [ - { title: '缂栧彿', field: 'userCode', align: 'left' }, - { title: '鐢ㄦ埛濮撳悕', field: 'userName', align: 'left' }, - { title: '鐧诲綍鍚�', field: 'userPhone', align: 'center' }, - { title: '鎵�灞炴満鏋�', field: 'tenantName', align: 'center', width: 150 }, + {title: '浜哄憳濮撳悕', field: 'userName', align: 'left', minWidth: 140}, + {title: '鐧诲綍鍚�', field: 'userCode', align: 'left', minWidth: 140}, + {title: '鎵嬫満鍙�', field: 'userPhone', align: 'center', width: 110}, + { title: '鎵�灞炴満鏋�', field: 'tenantName', align: 'center', minWidth: 150 }, { title: '閮ㄩ棬', field: 'sysDeptName', align: 'center' }, { field: 'status', @@ -145,15 +148,15 @@ width: '250', // 鍒楀 attr: [ { - title: '缂栬緫', - events: (row) => { - this.showAdd(row.id); - }, - }, - { title: '瑙掕壊', events: (row) => { this.showEditRole(row.id); + }, + }, + { + title: '缂栬緫', + events: (row) => { + this.showAdd(row.id); }, }, { @@ -180,8 +183,27 @@ created() { // 鑾峰彇鏈烘瀯鏍� this.initTreeData(); + this.data_scope = this.$store.getters.userInfo ? this.$store.getters.userInfo.lv : '' + if(this.data_scope===0){ + this.data_scope=1 + } + this.editSetting.data_scope = this.data_scope; + this.editRoleSetting.data_scope = this.data_scope; }, methods: { + //瀵煎叆 + importUser() { + this.importSetting.dialogShow = true + this.importSetting.onSuccess = (response, callBack) => { + if (response.code === 1) { + this.$message.success(response.msg) + this.search(1) + } else { + this.$message.warning(response.msg) + } + callBack() + } + }, // 宸︿晶鏍戝垵濮嬪寲 initTreeData() { finsystenant.getTree().then((res) => { @@ -198,11 +220,11 @@ updState(row) { let vm = this let text = row.status === 0 ? "鍚敤" : "绂佺敤"; - vm.$modal.confirm('纭瑕�' + text + '"' + row.userName + '"鍚楋紵').then(function() { - let params = Object.assign({},row) + vm.$modal.confirm('纭瑕�' + text + '"' + row.userName + '"鍚楋紵').then(function () { + let params = Object.assign({}, row) params.status = row.status === 1 ? 0 : 1 - user.updateStatus(params).then(res=>{ - if(res){ + user.updateStatus(params).then(res => { + if (res) { row.status = row.status === 1 ? 0 : 1 vm.$modal.msgSuccess(text + "鎴愬姛"); } @@ -217,13 +239,17 @@ id: param.id, name: param.name, code: param.code, + lv: param.lv, }, ); + let data_scope = Number(this.data_scope) + (param.lv-1) if (this.p.code != undefined && this.p.code != null) { this.filterFrom.tenantCode = this.p.code; this.tenantId = this.p.id; this.tenantName = this.p.name; this.editSetting.tenantCode = this.p.code; + this.editSetting.data_scope = data_scope; + this.editRoleSetting.data_scope = data_scope; } else { this.filterFrom.tenantCode = 0; } @@ -278,6 +304,22 @@ this.editSetting.title = title; this.editSetting.show = true; }, + // 鍒犻櫎鐢ㄦ埛璐﹀彿 + del(row) { + row.isDelete = 0; + this.$modal + .confirm('鏄惁瑕佸垹闄�"' + row.userName + '"鐨勮处鍙凤紵') + .then(function () { + user.updateStatus(row).then((res) => { + }); + }) + .then((res) => { + this.$message.success('鍒犻櫎鎴愬姛锛�'); + this.search(); + }) + .catch(() => { + }); + }, showEditRole(id) { let title = '娣诲姞'; if (id != null) { -- Gitblit v1.9.1