<template>
    <div class="default-main" :style="{ height: pageHeight.height }">
        <vxe-table
            v-loading="tableStore.table.loading"
            height="auto"
            auto-resize
            ref="tableRef"
            v-bind="defaultAttribute"
            :data="tableStore.table.data"
            :column-config="{ resizable: true }"
            :tree-config="{}"
        >
            <vxe-column field="name" align="left" title="名称" tree-node></vxe-column>
            <vxe-column field="area" title="区域">
                <template #default="{ row }">
                    {{ row.area || '/' }}
                </template>
            </vxe-column>
            <vxe-column field="remark" title="备注">
                <template #default="{ row }">
                    {{ row.remark || '/' }}
                </template>
            </vxe-column>
        </vxe-table>
    </div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import { defaultAttribute } from '@/components/table/defaultAttribute'
import { mainHeight } from '@/utils/layout'
defineOptions({
    name: 'govern/manage/engineering'
})
const tableRef = ref()

const pageHeight = mainHeight(20)
const tableStore = new TableStore({
    url: '/cs-device-boot/csLedger/getProjectTree',
    method: 'POST',
    column: [],

    loadCallback: () => {}
})

provide('tableStore', tableStore)

onMounted(() => {
    tableStore.index()
    setTimeout(() => {
        tableRef.value.setAllTreeExpand(true)
    }, 100)
})

const addMenu = () => {}
</script>
