qushaowei
2023-08-19 ddfa6f728c57b5d072544c5d79a8c5fc47d1baf9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<template>
 <a-card :bordered="false" style="height: 100%;">
      <a-tree
        showLine
        checkStrictly
        :replace-fields="replaceFields"
        :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
        :treeData="treeDataSource"
        @select="handleTreeSelect"
      >
      <a-icon slot="switcherIcon" type="folder" /></a-tree>
 </a-card>
</template>
 
<script>
import { getAction } from '@/api/manage'
 
  export default {
    name: 'MomUnitListLeft',
    data() {
      return {
        treeDataSource:[],
        replaceFields: {
          title: 'codeName',
        },
        url:{
          getTree:'/base/getTree'
        }
      }
    },
    created() {
      this.queryTreeData()
    },
    methods: {
 
      queryTreeData() {
        getAction(this.url.getTree).then((res)=>{
          this.treeDataSource = res.result;
        })
      },
      //左侧树点击触发
      handleTreeSelect(selectedKeys, event) {
        let da = event.node.dataRef;
        this.$emit("treeSelect", da);
      }
      
 
    }
  }
</script>
 
<style scoped>
 
</style>