Просмотр исходного кода

fix:部门tree接口参数新增

刘恒 2 лет назад
Родитель
Сommit
9fdf3cc56a
2 измененных файлов с 14 добавлено и 7 удалено
  1. 12 5
      src/components/tree/tree.vue
  2. 2 2
      src/services/mechanism.js

+ 12 - 5
src/components/tree/tree.vue

@@ -16,6 +16,7 @@
   
   <script>
 // import mixin from "../../minins/mixin";
+import { mapState } from "vuex";
 export default {
   name: "FormRow",
   //   mixins: [mixin],
@@ -30,16 +31,22 @@ export default {
       },
     };
   },
+  computed: {
+    ...mapState("setting", ["userInfo"]),
+  },
   mounted() {
     this.getMechanismTree();
   },
   methods: {
     getMechanismTree() {
-      this.$API.mechanism.getMechanismTree({ type: 0, id: 9 }).then((res) => {
-        if (res.data.code === 200) {
-          this.treeData = res.data.data;
-        }
-      });
+      // console.log(this.userInfo);
+      this.$API.mechanism
+        .getMechanismTree({ deptId: this.userInfo.deptId })
+        .then((res) => {
+          if (res.data.code === 200) {
+            this.treeData = res.data.data;
+          }
+        });
     },
 
     onSelect(keys) {

+ 2 - 2
src/services/mechanism.js

@@ -8,8 +8,8 @@ export async function getMechanism(data) {
 }
 
 //获取树形
-export async function getMechanismTree() {
-    return request(`/dept/findAllTree`, METHOD.GET)
+export async function getMechanismTree(data) {
+    return request(`/dept/findAllTree`, METHOD.GET, data)
 }
 
 //获取保险公司列表