Selaa lähdekoodia

新增角色需要选择岗位

gangyj 3 vuotta sitten
vanhempi
commit
c2c2d15d21
1 muutettua tiedostoa jossa 22 lisäystä ja 0 poistoa
  1. 22 0
      src/views/authority/role.vue

+ 22 - 0
src/views/authority/role.vue

@@ -79,6 +79,7 @@
 
 <script>
   import {add, getList, getRole, getRoleTreeById, grant, grantTree, remove, update} from "@/api/system/role";
+  import {getPostList} from "@/api/system/post";
   import {mapGetters} from "vuex";
   import website from '@/config/website';
 
@@ -166,6 +167,22 @@
                 }
               ]
             },
+            {
+              label: "所属岗位",
+              prop: "pId",
+              type: "tree",
+              hide: true,
+              dicData: [],
+              props: {
+                label: "postName",
+                value: "id"
+              },
+              rules: [{
+                required: true,
+                message: "请选择所属岗位",
+                trigger: "click"
+              }],
+            },
             {
               label: "上级角色",
               prop: "parentId",
@@ -234,6 +251,11 @@
           const column = this.findObject(this.option.column, "parentId");
           column.dicData = res.data.data;
         });
+        let tenantId = website.tenantId;
+        getPostList(tenantId).then(res => {
+          const column = this.findObject(this.option.column, "pId");
+          column.dicData = res.data.data;
+        });
       },
       submit() {
         const menuList = this.$refs.treeMenu.getCheckedKeys();