From d186b4d37394e4816e0f271fcced4d06b3069454 Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期一, 16 十二月 2024 15:31:28 +0800 Subject: [PATCH] 路由query添加当前页面id&&人员组织管理模块下所有页面按钮权限控制 --- Source/plt-web/plt-web-ui/src/views/system/department/index.vue | 52 +++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 39 insertions(+), 13 deletions(-) diff --git a/Source/plt-web/plt-web-ui/src/views/system/department/index.vue b/Source/plt-web/plt-web-ui/src/views/system/department/index.vue index 5059528..6f712df 100644 --- a/Source/plt-web/plt-web-ui/src/views/system/department/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/system/department/index.vue @@ -15,21 +15,32 @@ @current-row-change="handleCurrentRowChange" > <template slot="menu" slot-scope="{row,size,type}"> - <el-button icon="el-icon-circle-plus-outline" size="small" type="text" @click="handleAdd()">鏂板瀛愮骇</el-button> - <el-button v-if="row.ALLDept !== 'ALLDept'" icon="el-icon-edit" size="small" type="text" + <el-button v-if="permissionList.departmentAddChildrenBtn" icon="el-icon-circle-plus-outline" size="small" + type="text" @click="handleAdd()">鏂板瀛愮骇 + </el-button> + <el-button v-if="row.ALLDept !== 'ALLDept' && permissionList.editBtn" icon="el-icon-edit" size="small" + type="text" @click="editBtnClick(row)">缂栬緫 </el-button> - <el-button v-if="row.ALLDept !== 'ALLDept'" icon="el-icon-delete" size="small" type="text" + <el-button v-if="row.ALLDept !== 'ALLDept' && permissionList.delBtn" icon="el-icon-delete" size="small" + type="text" @click="rowDeleteHandler(row)">鍒犻櫎 </el-button> </template> <template slot="menuLeft" slot-scope="scope"> - <el-button icon="el-icon-school" plain size="small" type="primary" @click="assignMembersHandler">鍒嗛厤鎴愬憳 + <el-button v-if="permissionList.assignMembersBtn" icon="el-icon-school" plain size="small" type="primary" + @click="assignMembersHandler">鍒嗛厤鎴愬憳 </el-button> - <el-button icon="el-icon-user" plain size="small" type="primary" @click="statisticsHandler">缁熻</el-button> - <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadHandler">瀵煎叆閮ㄩ棬</el-button> - <el-button icon="el-icon-download" plain size="small" type="primary" @click="downLoadHandler">涓嬭浇瀵煎叆妯℃澘</el-button> + <el-button v-if="permissionList.statisticsBtn" icon="el-icon-user" plain size="small" type="primary" + @click="statisticsHandler">缁熻 + </el-button> + <el-button v-if="permissionList.importDepartmentBtn" icon="el-icon-upload2" plain size="small" type="primary" + @click="upLoadHandler">瀵煎叆閮ㄩ棬 + </el-button> + <el-button v-if="permissionList.downloadImportTemplateBtn" icon="el-icon-download" plain size="small" + type="primary" @click="downLoadHandler">涓嬭浇瀵煎叆妯℃澘 + </el-button> </template> </avue-crud> @@ -85,6 +96,7 @@ import basicOption from '@/util/basic-option'; import {column} from './option' import func from "@/util/func"; +import {mapGetters} from "vuex"; export default { name: "departmentManage", @@ -95,13 +107,13 @@ ...basicOption, rowKey: 'oid', rowParentKey: 'parentId', - expandRowKeys:[], + expandRowKeys: [], selection: false, addBtn: false, editBtn: false, delBtn: false, gridBtn: false, - menuWidth:280, + menuWidth: 280, highlightCurrentRow: true, calcHeight: -50, column: column @@ -117,9 +129,9 @@ selection: false, refreshBtn: false, addBtn: false, - header :false, + header: false, menu: false, - calcHeight:80, + calcHeight: 80, column: [ { label: '閮ㄩ棬', @@ -152,12 +164,26 @@ fileUrl: 'api/departmentQueryController/importDept', } }, + computed: { + ...mapGetters(["permission"]), + permissionList() { + return { + delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false), + editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false), + assignMembersBtn: this.vaildData(this.permission[this.$route.query.id].assignMembers, false), + departmentAddChildrenBtn: this.vaildData(this.permission[this.$route.query.id].departmentAddChildren, false), + downloadImportTemplateBtn: this.vaildData(this.permission[this.$route.query.id].downloadImportTemplate, false), + importDepartmentBtn: this.vaildData(this.permission[this.$route.query.id].importDepartment, false), + statisticsBtn: this.vaildData(this.permission[this.$route.query.id].statistics, false), + }; + }, + }, methods: { // 琛ㄦ牸鍒濆鍖栬姹� getTableList() { refTree({queryAllLevel: true, 'extandParamsMap[showAllDepartmentNode]': true}).then(res => { this.tableData = this.departDtaFormAtter(res.data.treeData); - this.option.expandRowKeys=[res.data.treeData[0].oid]; + this.option.expandRowKeys = [res.data.treeData[0].oid]; }) }, @@ -166,7 +192,7 @@ return items.map(item => { // 杞崲褰撳墠鑺傜偣鐨勫睘鎬� const formList = { - expanded:item.expanded, + expanded: item.expanded, oid: item.oid, id: item.attributes.id, name: item.attributes.name, -- Gitblit v1.9.3