浏览代码

学习资料页面机构树调整

jingyuanchao 2 年之前
父节点
当前提交
fe0b8da360
共有 2 个文件被更改,包括 14 次插入4 次删除
  1. 12 2
      src/components/k-orgTree/index.vue
  2. 2 2
      src/views/core/materials/index.vue

+ 12 - 2
src/components/k-orgTree/index.vue

@@ -30,7 +30,7 @@
 
 <script>
 import tableListMixins from "@/mixins/tableList";
-import {deptTreeSelect} from "@/api/system/public";
+import {deptTreeSelect,handsheDeptTreeSelect} from "@/api/system/public";
 
 export default {
   name: "k-orgTree",
@@ -54,6 +54,12 @@ export default {
       defaultKey:null,
     }
   },
+  props:{
+    hangsheTree:{
+      type:Boolean,
+      default: false,
+    }
+  },
   watch: {
     // 根据名称筛选机构树
     deptName(val) {
@@ -70,7 +76,11 @@ export default {
     },
     /** 查询机构下拉树结构 */
     getDeptTree() {
-      deptTreeSelect().then(response => {
+      let method=deptTreeSelect;
+      if(this.hangsheTree){
+        method=handsheDeptTreeSelect
+      }
+      method().then(response => {
         this.treeList = response.data;
         this.defaultKeys.push(response.data[0].id);
         this.$emit('defaultKey',response.data[0].id);

+ 2 - 2
src/views/core/materials/index.vue

@@ -3,8 +3,8 @@
     <el-row :gutter="20">
       <!--机构数据-->
       <el-col :span="4" :xs="24">
-        <k-org-tree v-model="queryParams.orgId" @defaultKey="getDefaultKey" @checkChange="checkChange"
-                    @click="clickTreeNode"></k-org-tree>
+        <org-tree v-model="queryParams.orgId" @defaultKey="getDefaultKey" @checkChange="checkChange"
+                    @click="clickTreeNode" hangsheTree></org-tree>
       </el-col>
       <!--用户数据-->
       <el-col :span="20" :xs="24">