Blame view

src/components/fee/communityFloorTree.vue 1.51 KB
b25b036d   wuxw   v1.9 优化日期
1
  <template>
10d3499d   wuxw   开发完成 admin 台账功能
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
55
56
57
58
59
60
61
62
63
    <el-card class="tree-card">
      <el-tree ref="tree" :data="treeData" node-key="id" :props="defaultProps" :highlight-current="true"
        :expand-on-click-node="false" @node-click="handleNodeClick" />
    </el-card>
  </template>
  
  <script>
  import { queryCommunityFloorTree } from '@/api/fee/adminOweFeeDetailApi'
  
  export default {
    name: 'CommunityFloorTree',
    data() {
      return {
        treeData: [],
        defaultProps: {
          children: 'children',
          label: 'text'
        },
        callName: ''
      }
    },
    mounted() {
      this.initCommunityFloorTree()
    },
    methods: {
      async initCommunityFloorTree() {
        await this.loadCommunityFloorTree()
      },
      async loadCommunityFloorTree() {
        try {
          // 这里应该是从API获取树形数据
         const {data} = await queryCommunityFloorTree()
         console.log(data)
          // 模拟数据
          this.treeData = data
        } catch (error) {
          console.error(error)
        }
      },
      handleNodeClick(data) {
        if (data.id.startsWith('c_')) {
          this.$emit('chooseFloor', {
            communityName: data.communityName,
            communityId: data.communityId,
            floorNum: '',
            floorId: ''
          })
        } else if (data.id.startsWith('f_')) {
          this.$emit('chooseFloor', {
            communityName:'',
            communityId: '',
            floorNum: data.floorNum,
            floorId: data.floorId
          })
        }
      }
    }
  }
  </script>
  
  <style scoped>
  .tree-card {
07e12785   wuxw   v1.9 admin账户中部分页面...
64
65
    max-height: 80vh;
    overflow-y: auto;
10d3499d   wuxw   开发完成 admin 台账功能
66
67
  }
  </style>