From eb635360fde01f6a3c34d485e979e4724aa22b16 Mon Sep 17 00:00:00 2001
From: yuxc <yuxc@vci-tech.com>
Date: 星期二, 07 一月 2025 15:57:37 +0800
Subject: [PATCH] 菜单配置文件调整
---
Source/plt-web/plt-web-ui/src/views/system/role/index.vue | 108 +++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 91 insertions(+), 17 deletions(-)
diff --git a/Source/plt-web/plt-web-ui/src/views/system/role/index.vue b/Source/plt-web/plt-web-ui/src/views/system/role/index.vue
index 64d260f..cc5ca1e 100644
--- a/Source/plt-web/plt-web-ui/src/views/system/role/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/system/role/index.vue
@@ -14,15 +14,58 @@
@row-click="rowClickHandler"
@row-save="rowSaveHandler"
@row-update="rowUpdateHandler"
- @row-del="rowDeleteHandler"
>
<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-school" plain size="small" type="primary" @click="assignMembersHandler">鍒嗛厤鎴愬憳
+ <el-button v-if="permissionList.addBtn" class="button-custom-icon" size="small" type="primary"
+ @click="$refs.roleCrud.rowAdd()">
+ <icon-show :name="permissionList.addBtn.source"></icon-show>
+ 鏂� 澧�
</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="upLoadRole">瀵煎叆瑙掕壊</el-button>
- <el-button icon="el-icon-download" plain size="small" type="primary">瀵煎嚭</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.assignMembersBtn" class="button-custom-icon" plain size="small" type="primary"
+ @click="assignMembersHandler">
+ <icon-show :name="permissionList.assignMembersBtn.source"></icon-show>
+ 鍒嗛厤鎴愬憳
+ </el-button>
+ <el-button v-if="permissionList.statisticsBtn" class="button-custom-icon" plain size="small" type="primary"
+ @click="statisticsHandler">
+ <icon-show :name="permissionList.statisticsBtn.source"></icon-show>
+ 缁熻
+ </el-button>
+ <el-button v-if="permissionList.importRoleBtn" class="button-custom-icon" plain size="small" type="primary"
+ @click="upLoadRole">
+ <icon-show :name="permissionList.importRoleBtn.source"></icon-show>
+ 瀵煎叆瑙掕壊
+ </el-button>
+ <el-button v-if="permissionList.exportBtn" class="button-custom-icon" plain size="small" type="primary">
+ <icon-show :name="permissionList.exportBtn.source"></icon-show>
+ 瀵煎嚭
+ </el-button>
+ </template>
+
+ <template slot="menu" slot-scope="{ row, index }">
+ <el-button
+ v-if="permissionList.editBtn"
+ size="small"
+ type="text"
+ @click="handleEdit(row, index)"
+ >
+ <icon-show :name="permissionList.editBtn.source"></icon-show>
+ 缂栬緫
+ </el-button>
+ <el-button
+ v-if="permissionList.delBtn"
+ size="small"
+ type="text"
+ @click="handleDel(row, index)"
+ >
+ <icon-show :name="permissionList.delBtn.source"></icon-show>
+ 鍒犻櫎
+ </el-button>
</template>
<template slot="roleClassifyText" slot-scope="{row}">
@@ -79,19 +122,13 @@
import basicOption from "@/util/basic-option";
import {column} from "@/views/system/role/option";
import func from "@/util/func";
+import {mapGetters} from "vuex";
export default {
name: "index",
data() {
return {
tableData: [],
- option: {
- ...basicOption,
- dialogTop: 0,
- dialogWidth: '30%',
- column: column,
- calcHeight: -60,
- },
page: {
currentPage: 1,
pageSize: 10,
@@ -113,7 +150,7 @@
refreshBtn: false,
addBtn: false,
menu: false,
- header:false,
+ header: false,
column: [
{
label: '閮ㄩ棬',
@@ -143,6 +180,32 @@
tipList: ["瑙掕壊瀵煎叆鍙湁 鍚嶇О 鍜� 鎻忚堪 涓ゅ垪锛屼笖鍚嶇О涓哄繀杈撻」涓嶈兘涓虹┖"]
}
},
+ 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),
+ exportBtn: this.vaildData(this.permission[this.$route.query.id].EXPORT, false),
+ assignMembersBtn: this.vaildData(this.permission[this.$route.query.id].FREEZE, false),
+ importRoleBtn: this.vaildData(this.permission[this.$route.query.id].IMPORT, false),
+ statisticsBtn: this.vaildData(this.permission[this.$route.query.id].DISCARD, false),
+ };
+ },
+ option() {
+ return {
+ ...basicOption,
+ addBtn: false,
+ delBtn: false,
+ editBtn: false,
+ dialogTop: 0,
+ dialogWidth: '30%',
+ column: column,
+ calcHeight: -60,
+ }
+ }
+ },
methods: {
// 琛ㄦ牸鍒濆鍖栬姹�
getTableList() {
@@ -153,6 +216,11 @@
this.page.total = res.data.total;
this.tableLoading = false;
})
+ },
+
+ // 缂栬緫鎸夐挳
+ handleEdit(row, index) {
+ this.$refs.roleCrud.rowEdit(row, index);
},
// 鍒楀ご鍒锋柊
@@ -181,8 +249,12 @@
row,
this.$refs.roleCrud,
this.lastIndex,
- (newIndex) => { this.lastIndex = newIndex; },
- () => { this.selectList = []; }
+ (newIndex) => {
+ this.lastIndex = newIndex;
+ },
+ () => {
+ this.selectList = [row];
+ }
);
},
@@ -216,7 +288,7 @@
},
// 鍒犻櫎
- rowDeleteHandler(row) {
+ handleDel(row, index) {
let params = {
ids: row.oid
}
@@ -283,6 +355,8 @@
listUserUnInRoleOid({pkRole: this.selectList[0].oid}),
listUserByRoleOid({pkRole: this.selectList[0].oid})
]).then(([unInRoleRes, byRoleRes]) => {
+ this.leftRoleData = [];
+ this.rightRoleData = [];
if (unInRoleRes.data.code === 200 && byRoleRes.data.code === 200) {
const leftData = [...unInRoleRes.data.data, ...byRoleRes.data.data];
// 缁勮濂界┛姊鍙敤鏁版嵁
--
Gitblit v1.9.3