83 lines
2.0 KiB
Vue
83 lines
2.0 KiB
Vue
|
<template>
|
||
|
<TableProMax
|
||
|
ref="tableRef"
|
||
|
:request-api="reqApi"
|
||
|
:columns="columns"
|
||
|
:searchFormOptions="searchFormOptions"
|
||
|
>
|
||
|
|
||
|
</TableProMax>
|
||
|
</template>
|
||
|
|
||
|
<script setup lang="ts">
|
||
|
import TableProMax from "@/components/table/TableProMax.vue";
|
||
|
import {ref} from "vue";
|
||
|
import {ComponentExposed} from "vue-component-type-helpers";
|
||
|
import {TableProMaxProps} from "@/types/components/table";
|
||
|
import {PoliceUnitPagerQueryParams, PoliceUnitPagerVo} from "@/types/views/unitManage/policeUnit.ts";
|
||
|
import api from "@/axios";
|
||
|
import {enumSelectNodes} from "@/config/dict.ts";
|
||
|
|
||
|
type TableProps = TableProMaxProps<PoliceUnitPagerVo, PoliceUnitPagerQueryParams>
|
||
|
|
||
|
const tableRef = ref<ComponentExposed<typeof TableProMax>>(null!)
|
||
|
const reqApi: TableProps['requestApi'] = (params) => api.post('/policeUnit/pager', params)
|
||
|
const columns: TableProps['columns'] = [
|
||
|
{
|
||
|
dataIndex: 'name',
|
||
|
title: '名称'
|
||
|
}, {
|
||
|
dataIndex: 'code',
|
||
|
title: '代码'
|
||
|
}, {
|
||
|
dataIndex: 'legalPersonInfo',
|
||
|
title: '联系人'
|
||
|
}, {
|
||
|
dataIndex: 'provinceName',
|
||
|
title: '行政区划',
|
||
|
customRender: ({record}) => [record.provinceName, record.cityName, record.districtsName, record.streetName].filter(Boolean).join('/')
|
||
|
}, {
|
||
|
dataIndex: 'isEnable',
|
||
|
title: '是否启用'
|
||
|
}, {
|
||
|
dataIndex: 'checkStatus',
|
||
|
title: '审核状态'
|
||
|
}, {
|
||
|
dataIndex: 'createTime',
|
||
|
title: '创建时间'
|
||
|
}
|
||
|
]
|
||
|
const searchFormOptions: TableProps["searchFormOptions"] = {
|
||
|
name: {
|
||
|
type: 'input',
|
||
|
label: '名称'
|
||
|
}, code: {
|
||
|
type: 'input',
|
||
|
label: '代码'
|
||
|
}, isEnable: {
|
||
|
type: 'select',
|
||
|
label: '是否启用',
|
||
|
options: [
|
||
|
{
|
||
|
value: null,
|
||
|
label: '全部'
|
||
|
}, ...enumSelectNodes('IsEnable')
|
||
|
]
|
||
|
}, checkStatus: {
|
||
|
type: 'select',
|
||
|
label: '审核状态',
|
||
|
options: [
|
||
|
{
|
||
|
value: null,
|
||
|
label: '全部'
|
||
|
}, ...enumSelectNodes('CheckStatus')
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
|
||
|
</script>
|
||
|
|
||
|
<style scoped lang="scss">
|
||
|
|
||
|
</style>
|