From 5ec088f7b2c1281a1874ef6ba4e783a64acb8079 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期二, 12 十一月 2024 09:15:19 +0800
Subject: [PATCH] 优化
---
company/src/views/system/role.vue | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/company/src/views/system/role.vue b/company/src/views/system/role.vue
index fcaf19b..667cc71 100644
--- a/company/src/views/system/role.vue
+++ b/company/src/views/system/role.vue
@@ -47,7 +47,7 @@
>
<template slot-scope="{row}">
<el-button type="text" @click="$refs.operaRoleWindow.open('缂栬緫瑙掕壊', row)" icon="el-icon-edit" v-permissions="['system:role:update']">缂栬緫</el-button>
- <el-button type="text" @click="openRole(row.systemDataPermission)">鏁版嵁鏉冮檺</el-button>
+ <el-button type="text" @click="openRole(row.systemDataPermission, row.id)">鏁版嵁鏉冮檺</el-button>
<el-button type="text" @click="$refs.permissionConfigWindow.open(row)" v-permissions="['system:role:createRolePermission']">閰嶇疆鏉冮檺</el-button>
<el-button type="text" @click="$refs.menuConfigWindow.open(row)" icon="el-icon-menu" v-permissions="['system:role:createRoleMenu']">鎺堟潈鑿滃崟</el-button>
<el-button v-if="!row.fixed" type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['system:role:delete']">鍒犻櫎</el-button>
@@ -105,12 +105,16 @@
this.search()
},
methods: {
- openRole(row) {
- let customData = []
- row.customData.split(',').forEach(item => {
- customData.push([item])
- })
- this.$refs.permissions.open('鏁版嵁鏉冮檺', { ...row, customData })
+ openRole(row, id) {
+ if (row) {
+ let customData = []
+ row.customData.split(',').forEach(item => {
+ customData.push([item])
+ })
+ this.$refs.permissions.open('鏁版嵁鏉冮檺', { ...row, customData })
+ } else {
+ this.$refs.permissions.open('鏁版嵁鏉冮檺', { roleId: id, customData: [] })
+ }
}
}
}
--
Gitblit v1.9.3