Browse Source

优化角色管理

木星 1 month ago
parent
commit
13fc140c6f
1 changed files with 8 additions and 25 deletions
  1. 8 25
      src/views/Authority/Role.vue

+ 8 - 25
src/views/Authority/Role.vue

@@ -145,28 +145,9 @@ const editRole = async (data) => {
145
   console.log('kankna===', res)
145
   console.log('kankna===', res)
146
   query2.authorityList = res.data.authorityList
146
   query2.authorityList = res.data.authorityList
147
   res.data.authorityList.map((item) => {
147
   res.data.authorityList.map((item) => {
148
-    if (item == 1) {
149
-      morenxz.push(1)
150
-    }
151
-    if (item == 3) {
152
-      morenxz.push(2)
153
-    }
154
-    if (item == 5) {
155
-      morenxz.push(3)
156
-    }
157
-    if (item == 10) {
158
-      morenxz.push(7)
159
-    }
160
-    if (item == 10) {
161
-      morenxz.push(7)
162
-    }
163
-    if (item == 8) {
164
-      morenxz.push(5)
165
-    }
166
-    if (item == 9) {
167
-      morenxz.push(6)
168
-    }
148
+    morenxz.push(item)
169
   })
149
   })
150
+  console.log('sssssa', morenxz)
170
 
151
 
171
   tianjia().then(async () => {
152
   tianjia().then(async () => {
172
     const formData = await getFormData()
153
     const formData = await getFormData()
@@ -225,8 +206,8 @@ const tianjia = async () => {
225
     if (item.children.length == 1) {
206
     if (item.children.length == 1) {
226
       let a1 = {
207
       let a1 = {
227
         label: item.name,
208
         label: item.name,
228
-        id: index,
229
-        value: [item.id, item.children.id]
209
+        id: item.id,
210
+        value: item.id
230
       }
211
       }
231
       transformedData.push(a1)
212
       transformedData.push(a1)
232
     } else {
213
     } else {
@@ -237,8 +218,8 @@ const tianjia = async () => {
237
         children: item.children.map((item2, index) => {
218
         children: item.children.map((item2, index) => {
238
           let a2 = {
219
           let a2 = {
239
             label: item2.name,
220
             label: item2.name,
240
-            id: index,
241
-            value: [item2.id]
221
+            id: item2.id,
222
+            value: item2.id
242
           }
223
           }
243
           return a2
224
           return a2
244
         })
225
         })
@@ -247,6 +228,8 @@ const tianjia = async () => {
247
     }
228
     }
248
   })
229
   })
249
   data = transformedData
230
   data = transformedData
231
+  console.log('sadas22d', data)
232
+
250
   isshow.value = false
233
   isshow.value = false
251
 }
234
 }
252
 
235