From 8c6cf205affbbc8ada74f00a7ca25ebca867e9ed Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Mon, 27 Sep 2021 11:44:44 +0800
Subject: [PATCH] 图表颜色

---
 src/views/dispatch/dispatch.vue |   38 ++++++++++++++++++++++++++++++--------
 1 files changed, 30 insertions(+), 8 deletions(-)

diff --git a/src/views/dispatch/dispatch.vue b/src/views/dispatch/dispatch.vue
index 806c805..e3800af 100644
--- a/src/views/dispatch/dispatch.vue
+++ b/src/views/dispatch/dispatch.vue
@@ -225,8 +225,7 @@
             prop: "deptId",
             type: "tree",
             overHidden: true,
-            dicUrl:
-              "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
+            dicUrl: "",
             props: {
               label: "title",
               value: "id",
@@ -377,9 +376,12 @@
           },
         ],
       },
+
+      useifid: 266,
     };
   },
   created() {
+    var that = this;
     if (this.userInfo.role_name == "保安公司管理员") {
       const deptColumn = this.findObject(this.option.column, "deptId");
       deptColumn.search = false;
@@ -387,6 +389,16 @@
       deptColumn.editDisplay = false;
       deptColumn.viewDisplay = false;
       deptColumn.hide = true;
+      this.useifid = this.userInfo.dept_id;
+    }
+    //公安局进入
+    if (this.userInfo.role_name == "公安管理员") {
+      that.option.column[1].dicUrl =
+        "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697&jurisdiction=" +
+        that.userInfo.jurisdiction;
+    } else {
+      that.option.column[1].dicUrl =
+        "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697";
     }
   },
   computed: {
@@ -405,9 +417,9 @@
       });
       return ids1.join(",");
     },
-        ...mapState({
+    ...mapState({
       userInfo: (state) => state.user.userInfo,
-        })
+    }),
   },
   methods: {
     handleChangeTABS(column) {
@@ -436,7 +448,10 @@
       //   this.$message.success("页码" + val);
     },
     rowSave(form, done, loading) {
-      form["deptId"] = this.userInfo.dept_id;
+      // form["deptId"] = this.userInfo.dept_id;
+      if (this.useifid != 266) {
+        form["deptId"] = this.useifid;
+      }
       adddata(form).then(
         (res) => {
           this.onLoad(this.page);
@@ -464,6 +479,9 @@
       this.onLoad(this.page);
     },
     rowUpdate(row, index, done, loading) {
+      if (this.useifid != 266) {
+        row["deptId"] = this.useifid;
+      }
       update(row).then(
         () => {
           this.onLoad(this.page);
@@ -575,9 +593,13 @@
           ...this.query,
         };
       }
-
-      console.log(values);
-
+      if (this.useifid != 266) {
+        values["deptId"] = this.useifid;
+      }
+      // console.log(values);
+      if (this.userInfo.role_name == "公安管理员") {
+        params["jurisdiction"] = that.userInfo.jurisdiction;
+      }
       getdata(
         page.currentPage,
         page.pageSize,

--
Gitblit v1.9.3