|
@@ -40,7 +40,8 @@
|
40
|
40
|
|
41
|
41
|
<script>
|
42
|
42
|
import {setRem} from "@/libs/functionRem";
|
43
|
|
- import {GetAllPurview,GetRoleInfo,EditRoleInfo,DeleteRoleInfo,EditPurview} from "@/api/admin_user";
|
|
43
|
+ import {GetAllPurview,GetRoleInfo,EditRoleInfo,DeleteRoleInfo,EditPurview,GetAllRole} from "@/api/admin_user";
|
|
44
|
+ import {Dialog} from "vant";
|
44
|
45
|
|
45
|
46
|
export default {
|
46
|
47
|
data() {
|
|
@@ -64,7 +65,7 @@
|
64
|
65
|
let purview_ids = ""
|
65
|
66
|
let type = 0
|
66
|
67
|
if (value.pid == 0){ //当前页面只存在pid为0的数据,而且会出现开关按钮的情况只会是拥有一个子节点
|
67
|
|
- console.log(value.sub_purview)
|
|
68
|
+
|
68
|
69
|
if(value.sub_purview.length > 0) {
|
69
|
70
|
|
70
|
71
|
purview_ids = value.id + "," + value.sub_purview[0].id
|
|
@@ -117,24 +118,27 @@
|
117
|
118
|
|
118
|
119
|
},
|
119
|
120
|
del(){
|
120
|
|
- let params = {
|
121
|
|
- role_id: this.$route.query.id,
|
122
|
|
- enable:false,
|
123
|
|
- }
|
124
|
|
- DeleteRoleInfo(params).then(response => {
|
125
|
|
- if (response.data.state === 1) {
|
126
|
|
- this.$toast({
|
127
|
|
- message: "删除成功"
|
128
|
|
- });
|
129
|
|
- this.$router.go(-1)
|
130
|
|
- } else {
|
131
|
|
- this.$toast({
|
132
|
|
- message: response.data.msg
|
133
|
|
- });
|
|
121
|
+ Dialog.confirm({
|
|
122
|
+ message: "是否删除该角色?"
|
|
123
|
+ }).then(() => {
|
|
124
|
+ let params = {
|
|
125
|
+ role_id: this.$route.query.id,
|
|
126
|
+ enable:false,
|
134
|
127
|
}
|
135
|
|
- });
|
136
|
|
-
|
|
128
|
+ DeleteRoleInfo(params).then(response => {
|
|
129
|
+ if (response.data.state === 1) {
|
|
130
|
+ this.$toast({
|
|
131
|
+ message: "删除成功"
|
|
132
|
+ });
|
|
133
|
+ this.$router.go(-1)
|
|
134
|
+ } else {
|
|
135
|
+ this.$toast({
|
|
136
|
+ message: response.data.msg
|
|
137
|
+ });
|
|
138
|
+ }
|
|
139
|
+ });
|
137
|
140
|
|
|
141
|
+ });
|
138
|
142
|
},
|
139
|
143
|
editRole(){
|
140
|
144
|
let params = {
|