You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.2 KiB
47 lines
1.2 KiB
<template> |
|
<div> |
|
<BasicTable @register="registerTable"> |
|
<template #toolbar> |
|
<a-button type="primary" :preIcon="IconEnum.ADD" @click="handleCreate"> IP 查询 </a-button> |
|
</template> |
|
</BasicTable> |
|
<AreaModal @register="registerModal" @success="reload()" /> |
|
</div> |
|
</template> |
|
<script lang="ts" setup> |
|
import { useModal } from '@/components/Modal' |
|
import AreaModal from './AreaModal.vue' |
|
import { IconEnum } from '@/enums/appEnum' |
|
import { BasicTable, useTable } from '@/components/Table' |
|
import { getAreaTree } from '@/api/system/area' |
|
import { columns } from './area.data' |
|
import { handleTree } from '@/utils/tree' |
|
|
|
defineOptions({ name: 'SystemArea' }) |
|
|
|
const [registerModal, { openModal }] = useModal() |
|
|
|
const [registerTable, { reload }] = useTable({ |
|
title: '岗位列表', |
|
api: getList, |
|
columns, |
|
rowKey: 'id', |
|
isTreeTable: true, |
|
pagination: false, |
|
striped: false, |
|
useSearchForm: false, |
|
showTableSetting: true, |
|
bordered: true, |
|
showIndexColumn: false, |
|
canResize: false |
|
}) |
|
|
|
async function getList() { |
|
const res = await getAreaTree() |
|
return handleTree(res, 'id') |
|
} |
|
|
|
function handleCreate() { |
|
openModal(true, { isUpdate: false }) |
|
} |
|
</script>
|
|
|