Răsfoiți Sursa

Merge branch 'dev' of http://10.87.10.227:4000/jzyd_yyds/soc_web into dev

luojun 2 ani în urmă
părinte
comite
ed88dce950

+ 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);

+ 11 - 2
src/components/orgTree/index.vue

@@ -20,6 +20,7 @@
         :filter-node-method="filterNode"
         ref="tree"
         node-key="id"
+        class="el-tree-ex"
         :default-expanded-keys="defaultKeys"
         :default-checked-keys="defaultKeys"
         @node-click="handleNodeClick"
@@ -85,6 +86,9 @@ export default {
         this.defaultKeys.push(response.data[0].id);
         this.$emit('defaultKey',response.data[0].id);
         this.defaultKey = response.data[0].id;
+        setTimeout(() => {
+          this.$refs.tree.setCurrentKey(response.data[0].id)
+        }, 100);        
       });
     },
     // 筛选节点
@@ -100,6 +104,11 @@ export default {
 }
 </script>
 
-<style scoped>
-
+<style lang='scss' scoped>
+  .el-tree-ex {
+    overflow: auto;
+    ::v-deep .is-current > .el-tree-node__content {
+      background-color: #d1e0f1 !important;
+    }   
+  }
 </style>

+ 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">