From 8301963a8b766bd35731d2f3012ca1ea528b7af7 Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Wed, 31 Jul 2024 13:36:38 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=8E=AF=E5=A2=83=E6=94=BE=E5=BC=80=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=BC=96=E8=BE=91=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/UserList.vue | 123 +++++++++++++++++++++------------- 1 file changed, 78 insertions(+), 45 deletions(-) diff --git a/src/views/system/UserList.vue b/src/views/system/UserList.vue index d3ead49..f05abb4 100644 --- a/src/views/system/UserList.vue +++ b/src/views/system/UserList.vue @@ -86,7 +86,7 @@
- {{ $t('user.addUser') }} + {{ $t('user.addUser') }} {{ $t('export') }} @@ -126,6 +126,8 @@ :pagination="ipagination" :loading="loading" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + :operationList="operationList" + @operationClick="operationClick" @change="handleTableChange"> - -
@@ -212,6 +171,7 @@ import UserRecycleBinModal from './modules/UserRecycleBinModal' import JTable from '@/components/jero/JTable' import JSearchSelectTag from '@/components/dict/JSearchSelectTag' import UploadHandStampModal from './modules/UploadHandStampModal' +import { isHasPermission } from '../../utils/hasPermission' export default { name: 'UserList', @@ -336,7 +296,66 @@ export default { exportXlsUrl: '/sys/user/exportXls', importExcelUrl: 'sys/user/importExcel', getSysCategoryTree: '/sys/sysDepart/queryTreeList' // 获取组织机构树 - } + }, + operationList: [ + // 编辑 + { + text: this.$t('edit'), + clickEvent: 'handleEdit', + has: 'user:edit' + }, + // 详情 + { + text: this.$t('details'), + clickEvent: 'handleDetail', + has: '', + show: (record) => { + return this.isDev + } + }, + // 密码 + { + text: this.$t('user.password'), + clickEvent: 'handleChangePassword', + has: '', + show: (record) => { + return this.isDev + } + }, + // 删除 + { + text: this.$t('delete'), + clickEvent: 'handleDelete', + has: 'sys:user:sel' + }, + // 冻结 + { + text: this.$t('user.frozen'), + clickEvent: 'handleFrozen', + has: 'user:edit', + show: (record) => { + return this.isDev && (record.status + '') === '1' + } + }, + // 解冻 + { + text: this.$t('user.thaw'), + clickEvent: 'handleFrozen', + has: 'user:edit', + show: (record) => { + return this.isDev && (record.status + '') === '2' + } + }, + // 上传手写章 + { + text: this.$t('user.uploadHandStamp'), + clickEvent: 'handleUploadHandStamp', + has: 'user:uploadHandStamp', + show: (record) => { + return false + } + } + ] } }, computed: { @@ -349,6 +368,7 @@ export default { this.initRoleList() }, methods: { + isHasPermission, getAvatarView: function (avatar) { return getFileAccessHttpUrl(avatar) }, @@ -399,6 +419,19 @@ export default { this.batchFrozen('1') } }, + operationClick (operation, record) { + if (operation.clickEvent === 'handleDelete') { + this.handleDelete(record.id) + } else if (operation.clickEvent === 'handleChangePassword') { + this.handleChangePassword(record.username) + } else if (operation.text === this.$t('user.frozen')) { + this.handleFrozen(record.id, 2, record.username) + } else if (operation.text === this.$t('user.thaw')) { + this.handleFrozen(record.id, 1, record.username) + } else { + this[operation.clickEvent](record) + } + }, handleFrozen: function (id, status, username) { const that = this if (username === 'admin') {