ny
22 小时以前 282fbc6488f4e8ceb5fda759f963ee88fbf7b999
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
<script lang="ts" setup>
import type { BasicColumn } from '@jnpf/ui/vxeTable';
 
import { nextTick, onMounted, reactive } from 'vue';
 
import { BasicVxeTable, useVxeTable } from '@jnpf/ui/vxeTable';
 
import { useBaseStore } from '#/store';
 
defineOptions({ name: 'ExtendTableDemoTableTree' });
 
interface State {
  industryTypeList: any[];
}
 
const state = reactive<State>({
  industryTypeList: [],
});
const baseStore = useBaseStore();
const columns: BasicColumn[] = [
  { title: '名称', dataIndex: 'fullName', minWidth: 200 },
  { title: '编码', dataIndex: 'id', width: 300 },
];
const [registerTable, { expandAll }] = useVxeTable({
  columns,
  useSearchForm: false,
  isTreeTable: true,
  immediate: false,
  showTableSetting: false,
  pagination: false,
});
 
async function init() {
  state.industryTypeList = (await baseStore.getDictionaryData('IndustryType')) as any[];
  nextTick(() => expandAll());
}
 
onMounted(() => init());
</script>
<template>
  <div class="jnpf-content-wrapper">
    <div class="jnpf-content-wrapper-center">
      <div class="jnpf-content-wrapper-content">
        <BasicVxeTable :data-source="state.industryTypeList" @register="registerTable" />
      </div>
    </div>
  </div>
</template>