Administrator
2021-11-12 6fef81e2e783f2628900a819c99976640d8ad1eb
src/views/system/user.vue
@@ -262,7 +262,8 @@
      treeData: [],
      treeOption: {
        nodeKey: "id",
        defaultExpandAll:true,
        defaultExpandedKeys: [],
        // defaultExpandAll:true,
        // lazy: false,
        // treeLoad: "", //处理权限  在created中
        //  function (node, resolve) {
@@ -364,13 +365,13 @@
                label: "所属组织机构",
                prop: "deptId",
                type: "tree",
                defaultExpandAll:true,
                defaultExpandAll: true,
                // dicUrl: "/api/blade-system/dept/lazy-tree",
                props: {
                  label: "title",
                  value: "id",
                },
                dicData:[],
                dicData: [],
                // hide: !website.tenantMode,
                // addDisplay: website.tenantMode,
                // editDisplay: website.tenantMode,
@@ -514,7 +515,6 @@
                  },
                ],
              },
            ],
          },
        ],
@@ -706,10 +706,14 @@
    var that = this;
    //公安局进入
    if (this.userInfo.role_name == "公安管理员") {
      var  parentId = this.userInfo.dept_id;
      var  userId = this.userInfo.Id;
      var parentId = this.userInfo.dept_id;
      var userId = this.userInfo.Id;
      getDeptLazyTree(parentId, userId).then((res) => {
        that.treeData = res.data.data;
        that.treeOption.defaultExpandedKeys = [];
        res.data.data.forEach((item) => {
          that.treeOption.defaultExpandedKeys.push(item.id);
        });
      });
    } else {
      // this.treeOption.treeLoad = function (node, resolve) {
@@ -728,7 +732,6 @@
      getDeptLazyTree(0).then((res) => {
        that.treeData = res.data.data;
      });
      this.treeOption.defaultExpandAll = false;
    }
  },
  mounted() {
@@ -760,32 +763,35 @@
            }
          }
          column.dicData = b;
        } else if(d == "公安管理员"){
        } else if (d == "公安管理员") {
          for (var i in k) {
            if (k[i].title == "公安管理员") {
              b.push(k[i]);
            }
          }
          column.dicData = b;
        }else {
        } else {
          column.dicData = k;
        }
      });
      //公安局进入
    if (this.userInfo.role_name == "公安管理员" || this.userInfo.role_name == "保安公司管理员") {
      var  parentId = this.userInfo.dept_id;
      var  userId = this.userInfo.Id;
      getDeptLazyTree(parentId, userId).then((res) => {
        const column = this.findObject(this.option.group, "deptId");
        column.dicData = res.data.data;
      });
    } else {
      getDeptLazyTree(0).then((res) => {
        const column = this.findObject(this.option.group, "deptId");
        column.dicData = res.data.data;
      });
    }
      if (
        this.userInfo.role_name == "公安管理员" ||
        this.userInfo.role_name == "保安公司管理员"
      ) {
        var parentId = this.userInfo.dept_id;
        var userId = this.userInfo.Id;
        getDeptLazyTree(parentId, userId).then((res) => {
          const column = this.findObject(this.option.group, "deptId");
          column.dicData = res.data.data;
        });
      } else {
        getDeptLazyTree(0).then((res) => {
          const column = this.findObject(this.option.group, "deptId");
          column.dicData = res.data.data;
        });
      }
      // getDeptTree(tenantId).then((res) => {
      //   const column = this.findObject(this.option.group, "deptId");
      //   column.dicData = res.data.data;
@@ -985,11 +991,11 @@
    },
    beforeOpen(done, type) {
      if (["edit", "view"].includes(type)) {
        if(this.userInfo.role_name!="公安管理员"){
        if (this.userInfo.role_name != "公安管理员") {
          const column = this.findObject(this.option.group, "code");
          column.display = false;
        }
        getUser(this.form.id).then((res) => {
          this.form = res.data.data;
          if (this.form.hasOwnProperty("deptId")) {
@@ -1004,7 +1010,7 @@
        });
      }
      if (["add"].includes(type)) {
        if(this.userInfo.role_name!="公安管理员"){
        if (this.userInfo.role_name != "公安管理员") {
          const column = this.findObject(this.option.group, "code");
          column.display = false;
        }