From 404966637eda6881a0f17683c5aacc7c1c34aed8 Mon Sep 17 00:00:00 2001 From: 田源 <tianyuan@vci-tech.com> Date: 星期四, 16 一月 2025 16:18:34 +0800 Subject: [PATCH] 增加操作类型 --- Source/plt-web/plt-web-ui/src/views/system/user/index.vue | 127 ++++++++++++++++++++++++++++++----------- 1 files changed, 92 insertions(+), 35 deletions(-) diff --git a/Source/plt-web/plt-web-ui/src/views/system/user/index.vue b/Source/plt-web/plt-web-ui/src/views/system/user/index.vue index 971b60b..c1cf595 100644 --- a/Source/plt-web/plt-web-ui/src/views/system/user/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/system/user/index.vue @@ -28,21 +28,65 @@ </template> <template #menu="{row,index,size}"> - <el-button icon="el-icon-edit" size="small" type="text" @click.stop="rowEditHandler(row,index)">缂栬緫</el-button> - <el-button icon="el-icon-delete" size="small" type="text" @click.stop="rowDeleteHandler(row)">鍒犻櫎</el-button> + <el-button v-if="permissionList.editBtn" size="small" type="text" + @click.stop="rowEditHandler(row,index)"> + <icon-show :name="permissionList.editBtn.source"></icon-show> + 缂栬緫 + </el-button> + <el-button v-if="permissionList.delBtn" size="small" type="text" + @click.stop="rowDeleteHandler(row)"> + <icon-show :name="permissionList.delBtn.source"></icon-show> + 鍒犻櫎 + </el-button> <el-button size="small" type="text" @click.stop="stopUserHandler(row)"> - <span v-if="row.status === 0" style="color: #fa3434"><i class="el-icon-video-pause"></i> 鍋滅敤</span> - <span v-if="row.status === 1" style="color: #55b61d"><i class="el-icon-video-play"></i> 鍚敤</span> + <span v-if="row.status === 0 && permissionList.stopBtn" style="color: #fa3434;display: flex"> + <icon-show :name="permissionList.stopBtn.source"></icon-show> + 鍋滅敤 + </span> + <span v-if="row.status === 1 && permissionList.actionBtn" style="color: #55b61d;display: flex"> + <icon-show :name="permissionList.actionBtn.source"></icon-show> + 鍚敤 + </span> </el-button> </template> <template slot="menuLeft" slot-scope="scope"> - <el-button icon="el-icon-delete" plain size="small" type="danger" @click="allDelHandler">鍒犻櫎</el-button> - <el-button icon="el-icon-user" plain size="small" type="primary" @click="roleHandler">鍒嗛厤瑙掕壊</el-button> - <el-button icon="el-icon-school" plain size="small" type="primary" @click="departmentHandler">鍒嗛厤閮ㄩ棬</el-button> - <el-button icon="el-icon-key" plain size="small" type="success" @click="setPwsHandler">璁剧疆瀵嗙爜绛栫暐</el-button> - <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadUser">瀵煎叆浜哄憳</el-button> - <el-button icon="el-icon-download" plain size="small" type="primary" @click="downloadHandler">涓嬭浇瀵煎叆妯℃澘</el-button> + <el-button v-if="permissionList.addBtn" class="button-custom-icon" size="small" type="primary" + @click="$refs.userCrud.rowAdd()"> + <icon-show :name="permissionList.addBtn.source"></icon-show> + 鏂� 澧� + </el-button> + <el-button v-if="permissionList.delBtn" class="button-custom-icon" plain size="small" type="danger" + @click="allDelHandler"> + <icon-show :name="permissionList.delBtn.source"></icon-show> + 鍒犻櫎 + </el-button> + <el-button v-if="permissionList.assigningRolesBtn" class="button-custom-icon" plain size="small" type="primary" + @click="roleHandler"> + <icon-show :name="permissionList.assigningRolesBtn.source"></icon-show> + 鍒嗛厤瑙掕壊 + </el-button> + <el-button v-if="permissionList.distributionDepartmentBtn" class="button-custom-icon" plain size="small" + type="primary" @click="departmentHandler"> + <icon-show :name="permissionList.distributionDepartmentBtn.source"></icon-show> + 鍒嗛厤閮ㄩ棬 + </el-button> + <el-button v-if="permissionList.setPasswordPolicyBtn" class="button-custom-icon" plain size="small" + type="success" + @click="setPwsHandler"> + <icon-show :name="permissionList.setPasswordPolicyBtn.source"></icon-show> + 璁剧疆瀵嗙爜绛栫暐 + </el-button> + <el-button v-if="permissionList.importPersonnelBtn" class="button-custom-icon" plain size="small" type="primary" + @click="uploadUser"> + <icon-show :name="permissionList.importPersonnelBtn.source"></icon-show> + 瀵煎叆浜哄憳 + </el-button> + <el-button v-if="permissionList.downloadImportTemplateBtn" class="button-custom-icon" plain size="small" + type="primary" @click="downloadHandler"> + <icon-show :name="permissionList.downloadImportTemplateBtn.source"></icon-show> + 涓嬭浇瀵煎叆妯℃澘 + </el-button> </template> </avue-crud> @@ -124,6 +168,7 @@ } from '@/api/system/user/api' import {column} from "./option" import func from '@/util/func' +import {mapGetters} from "vuex"; export default { name: "userManage", @@ -173,14 +218,6 @@ pwdList: [], tableLoading: false, tableData: [], - option: { - ...basicOption, - editBtn: false, - delBtn: false, - dialogWidth: '50%', - calcHeight: -60, - column: column - }, page: { currentPage: 1, pageSize: 10, @@ -196,7 +233,33 @@ lastIndex: null, } }, - created() { + computed: { + ...mapGetters(["permission"]), + permissionList() { + return { + addBtn: this.vaildData(this.permission[this.$route.query.id].ADD, false), + delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false), + editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false), + distributionDepartmentBtn: this.vaildData(this.permission[this.$route.query.id].ASSIGN, false), + assigningRolesBtn: this.vaildData(this.permission[this.$route.query.id].ASSIGN1, false), + downloadImportTemplateBtn: this.vaildData(this.permission[this.$route.query.id].DOWNLOADFILE, false), + importPersonnelBtn: this.vaildData(this.permission[this.$route.query.id].IMPORT, false), + setPasswordPolicyBtn: this.vaildData(this.permission[this.$route.query.id].RIGHT, false), + stopBtn: this.vaildData(this.permission[this.$route.query.id].FREEZE, false), + actionBtn: this.vaildData(this.permission[this.$route.query.id].UNFREZE, false), + }; + }, + option() { + return { + ...basicOption, + addBtn: false, + editBtn: false, + delBtn: false, + dialogWidth: '50%', + calcHeight: -60, + column: column + } + } }, methods: { // 琛ㄦ牸璇锋眰 @@ -204,9 +267,13 @@ this.tableLoading = true; getDataUsers(this.page.currentPage, this.page.pageSize, this.searchParams).then(res => { const data = res.data.data; + data.map(item => { + item.secretGrade = item.secretGrade.toString() + }) this.tableData = data; this.page.total = res.data.total; this.tableLoading = false; + s }) this.departmentQueryOnLoad() }, @@ -263,9 +330,7 @@ stopUser(params).then(res => { this.$message.success(res.data.obj); this.getTableList(); - }).catch(err => { - this.$message.error(err) - }) + }); }, // 閫夋嫨妗� @@ -283,7 +348,7 @@ this.lastIndex = newIndex; }, () => { - this.selectList = []; + this.selectList = [row]; } ); }, @@ -307,9 +372,7 @@ listRoleByUserOid(userOid).then(res => { this.rightRoleData = res.data.data.map(item => item.oid); }) - }).catch(err => { - this.$message.error(err) - }) + }); this.$refs.transfer.visible = true; }, @@ -322,9 +385,7 @@ saveRights(params).then(res => { this.$message.success(res.data.obj); this.getTableList(); - }).catch(err => { - this.$message.error(err) - }) + }); }, // 璁剧疆瀵嗙爜绛栫暐 @@ -356,9 +417,7 @@ saveUserPasswordStrateg(params).then(res => { this.pwdVisible = false; this.$message.success(res.data.obj) - }).catch(err => { - this.$message.error(err) - }) + }); }, // 鏂板 @@ -489,9 +548,7 @@ children: this.departData }] this.option.column[7].defaultExpandedKeys = ['ALLDept']; - }).catch(err => { - this.$message.error(err); - }) + }); }, // 鍒嗛厤閮ㄩ棬鏁版嵁杞崲 -- Gitblit v1.9.3