Blame view

antis-ncc-admin/src/views/extend/tableDemo/tableTree/index.vue 1.05 KB
38be6674   wwk   “zuxin”
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
  <template>
    <div class="app-container TableTree-container">
      <NCC-table v-loading="listLoading" :data="industryTypeList" row-key="id"
        :tree-props="{children: 'children', hasChildren: ''}" default-expand-all>
        <el-table-column prop="fullName" label="名称" />
        <el-table-column prop="id" label="编码" />
      </NCC-table>
    </div>
  </template>
  
  <script>
  export default {
    name: 'extend-tableDemo-tableTree',
    data() {
      return {
        keyword: '',
        list: [],
        listLoading: true,
        industryTypeList: []
      }
    },
    created() {
      this.getDictionaryData()
    },
    methods: {
      getDictionaryData() {
        this.$store.dispatch('base/getDictionaryData', { sort: 'IndustryType' }).then((res) => {
          this.industryTypeList = res
          this.initData()
        })
      },
      initData() {
        this.listLoading = true
        this.list = this.industryTypeList
        this.listLoading = false
      },
      search() {
        console.log(this.keyword);
      }
    }
  }
  </script>
  <style lang="scss" scoped>
  .TableTree-container {
    padding: 0;
  }
  </style>