修改
This commit is contained in:
@@ -27,6 +27,8 @@
|
||||
import { Icon } from '@jeesite/core/components/Icon';
|
||||
import { BasicForm, FormSchema, useForm } from '@jeesite/core/components/Form';
|
||||
import { BasicDrawer, useDrawerInner } from '@jeesite/core/components/Drawer';
|
||||
import { bizCitiesListAll } from '@jeesite/biz/api/biz/cities';
|
||||
import { bizProvinceListAll } from '@jeesite/biz/api/biz/province';
|
||||
import { BizMunicipalities, bizMunicipalitiesSave, bizMunicipalitiesForm } from '@jeesite/biz/api/biz/municipalities';
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
@@ -35,6 +37,8 @@
|
||||
const { showMessage } = useMessage();
|
||||
const { meta } = unref(router.currentRoute);
|
||||
const record = ref<BizMunicipalities>({} as BizMunicipalities);
|
||||
|
||||
const provListParams = ref<Recordable>({ provinceCode: '' });
|
||||
|
||||
const getTitle = computed(() => ({
|
||||
icon: meta.icon || 'i-ant-design:book-outlined',
|
||||
@@ -42,35 +46,54 @@
|
||||
}));
|
||||
|
||||
const inputFormSchemas: FormSchema<BizMunicipalities>[] = [
|
||||
{
|
||||
label: t('省份名称'),
|
||||
field: 'provinceCode',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
api: bizProvinceListAll,
|
||||
params: {},
|
||||
fieldNames: { label: 'provinceName', value: 'provinceCode' },
|
||||
immediate: true,
|
||||
allowClear: true,
|
||||
onChange: (value: string) => {
|
||||
provListParams.value.provinceCode = value;
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
{
|
||||
label: t('县区名称'),
|
||||
field: 'countyName',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 65,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('省份编码'),
|
||||
field: 'provinceCode',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('市区编码'),
|
||||
field: 'cityCode',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
label: t('市区名称'),
|
||||
field: 'cityCode',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
api: bizCitiesListAll,
|
||||
params: provListParams.value,
|
||||
fieldNames: { label: 'cityName', value: 'cityCode' },
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('数据状态'),
|
||||
field: 'dataStatus',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'ustatus',
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('县区名称'),
|
||||
field: 'countyName',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 65,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('县区编码'),
|
||||
field: 'countyCode',
|
||||
@@ -116,16 +139,6 @@
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('数据状态'),
|
||||
field: 'dataStatus',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
];
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm<BizMunicipalities>({
|
||||
|
||||
@@ -14,16 +14,13 @@
|
||||
<a-button type="default" :loading="loading" @click="handleExport()">
|
||||
<Icon icon="i-ant-design:download-outlined" /> {{ t('导出') }}
|
||||
</a-button>
|
||||
<a-button type="default" @click="handleImport()">
|
||||
<Icon icon="i-ant-design:import-outlined" /> {{ t('导入') }}
|
||||
</a-button>
|
||||
<a-button type="primary" @click="handleForm({})" v-auth="'biz:municipalities:edit'">
|
||||
<Icon icon="i-fluent:add-12-filled" /> {{ t('新增') }}
|
||||
</a-button>
|
||||
</template>
|
||||
<template #firstColumn="{ record }">
|
||||
<a @click="handleForm({ id: record.id })" :title="record.createTime">
|
||||
{{ record.createTime }}
|
||||
<template #slotBizKey="{ record }">
|
||||
<a @click="handleForm({ id: record.id })" :title="record.villageName">
|
||||
{{ record.villageName }}
|
||||
</a>
|
||||
</template>
|
||||
</BasicTable>
|
||||
@@ -42,6 +39,8 @@
|
||||
import { BasicTable, BasicColumn, useTable } from '@jeesite/core/components/Table';
|
||||
import { BizMunicipalities, bizMunicipalitiesList } from '@jeesite/biz/api/biz/municipalities';
|
||||
import { bizMunicipalitiesDelete, bizMunicipalitiesListData } from '@jeesite/biz/api/biz/municipalities';
|
||||
import { bizCitiesListAll } from '@jeesite/biz/api/biz/cities';
|
||||
import { bizProvinceListAll } from '@jeesite/biz/api/biz/province';
|
||||
import { useDrawer } from '@jeesite/core/components/Drawer';
|
||||
import { useModal } from '@jeesite/core/components/Modal';
|
||||
import { FormProps } from '@jeesite/core/components/Form';
|
||||
@@ -52,6 +51,8 @@
|
||||
const { showMessage } = useMessage();
|
||||
const { meta } = unref(router.currentRoute);
|
||||
const record = ref<BizMunicipalities>({} as BizMunicipalities);
|
||||
|
||||
const provListParams = ref<Recordable>({ provinceCode: '' });
|
||||
|
||||
const getTitle = {
|
||||
icon: meta.icon || 'i-ant-design:book-outlined',
|
||||
@@ -81,18 +82,19 @@
|
||||
showTime: { format: 'HH:mm' },
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('县区名称'),
|
||||
field: 'countyName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('省份编码'),
|
||||
field: 'provinceCode',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
allowClear: true,
|
||||
api: bizProvinceListAll,
|
||||
params: {},
|
||||
fieldNames: { label: 'provinceName', value: 'provinceCode' },
|
||||
immediate: true,
|
||||
allowClear: true,
|
||||
onChange: (value: string) => {
|
||||
provListParams.value.provinceCode = value;
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -100,10 +102,17 @@
|
||||
field: 'cityCode',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
api: bizCitiesListAll,
|
||||
params: provListParams.value,
|
||||
fieldNames: { label: 'cityName', value: 'cityCode' },
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('县区名称'),
|
||||
field: 'countyName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('县区编码'),
|
||||
field: 'countyCode',
|
||||
@@ -134,7 +143,7 @@
|
||||
field: 'dataStatus',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
dictType: 'ustatus',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
@@ -147,27 +156,33 @@
|
||||
dataIndex: 'createTime',
|
||||
key: 'a.create_time',
|
||||
sorter: true,
|
||||
width: 230,
|
||||
align: 'left',
|
||||
slot: 'firstColumn',
|
||||
},
|
||||
{
|
||||
title: t('县区名称'),
|
||||
dataIndex: 'countyName',
|
||||
key: 'a.county_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
width: 180,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('省份编码'),
|
||||
dataIndex: 'provinceCode',
|
||||
key: 'a.province_code',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: '',
|
||||
},
|
||||
{
|
||||
title: t('省份名称'),
|
||||
dataIndex: 'provinceName',
|
||||
key: 'b.province_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('省份编码'),
|
||||
dataIndex: 'provinceCode',
|
||||
key: 'a.province_code',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('市区名称'),
|
||||
dataIndex: 'cityName',
|
||||
key: 'c.city_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('市区编码'),
|
||||
dataIndex: 'cityCode',
|
||||
@@ -175,8 +190,15 @@
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: '',
|
||||
},
|
||||
{
|
||||
title: t('县区名称'),
|
||||
dataIndex: 'countyName',
|
||||
key: 'a.county_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('县区编码'),
|
||||
dataIndex: 'countyCode',
|
||||
@@ -208,6 +230,7 @@
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
slot: 'slotBizKey',
|
||||
},
|
||||
{
|
||||
title: t('社区编号'),
|
||||
@@ -222,7 +245,7 @@
|
||||
dataIndex: 'updateTime',
|
||||
key: 'a.update_time',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
width: 180,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
@@ -232,28 +255,30 @@
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: '',
|
||||
dictType: 'ustatus',
|
||||
},
|
||||
];
|
||||
|
||||
const actionColumn: BasicColumn<BizMunicipalities> = {
|
||||
width: 160,
|
||||
align: 'center',
|
||||
actions: (record: BizMunicipalities) => [
|
||||
{
|
||||
icon: 'i-clarity:note-edit-line',
|
||||
title: t('编辑地市信息'),
|
||||
title: t('编辑'),
|
||||
onClick: handleForm.bind(this, { id: record.id }),
|
||||
auth: 'biz:municipalities:edit',
|
||||
},
|
||||
{
|
||||
icon: 'i-ant-design:delete-outlined',
|
||||
color: 'error',
|
||||
title: t('删除地市信息'),
|
||||
title: t('删除'),
|
||||
popConfirm: {
|
||||
title: t('是否确认删除地市信息'),
|
||||
title: t('是否确认删除地市?'),
|
||||
confirm: handleDelete.bind(this, record),
|
||||
},
|
||||
auth: 'biz:municipalities:edit',
|
||||
ifShow: record.dataStatus == '0'
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -1,205 +0,0 @@
|
||||
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
|
||||
import { BasicColumn, BasicTableProps, FormProps } from '@jeesite/core/components/Table';
|
||||
import { BizMunicipalities, bizMunicipalitiesListData } from '@jeesite/biz/api/biz/municipalities';
|
||||
|
||||
const { t } = useI18n('biz.municipalities');
|
||||
|
||||
const modalProps = {
|
||||
title: t('地市信息选择'),
|
||||
};
|
||||
|
||||
const searchForm: FormProps<BizMunicipalities> = {
|
||||
baseColProps: { md: 8, lg: 6 },
|
||||
labelWidth: 90,
|
||||
schemas: [
|
||||
{
|
||||
label: t('记录时间起'),
|
||||
field: 'createTime_gte',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD HH:mm',
|
||||
showTime: { format: 'HH:mm' },
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('记录时间止'),
|
||||
field: 'createTime_lte',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD HH:mm',
|
||||
showTime: { format: 'HH:mm' },
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('县区名称'),
|
||||
field: 'countyName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('省份编码'),
|
||||
field: 'provinceCode',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('市区编码'),
|
||||
field: 'cityCode',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('县区编码'),
|
||||
field: 'countyCode',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('街道名称'),
|
||||
field: 'townName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('街道编号'),
|
||||
field: 'townCode',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('社区名称'),
|
||||
field: 'villageName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('社区编号'),
|
||||
field: 'villageCode',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('数据状态'),
|
||||
field: 'dataStatus',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const tableColumns: BasicColumn<BizMunicipalities>[] = [
|
||||
{
|
||||
title: t('记录时间'),
|
||||
dataIndex: 'createTime',
|
||||
key: 'a.create_time',
|
||||
sorter: true,
|
||||
width: 230,
|
||||
align: 'left',
|
||||
slot: 'firstColumn',
|
||||
},
|
||||
{
|
||||
title: t('县区名称'),
|
||||
dataIndex: 'countyName',
|
||||
key: 'a.county_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('省份编码'),
|
||||
dataIndex: 'provinceCode',
|
||||
key: 'a.province_code',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: '',
|
||||
},
|
||||
{
|
||||
title: t('市区编码'),
|
||||
dataIndex: 'cityCode',
|
||||
key: 'a.city_code',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: '',
|
||||
},
|
||||
{
|
||||
title: t('县区编码'),
|
||||
dataIndex: 'countyCode',
|
||||
key: 'a.county_code',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('街道名称'),
|
||||
dataIndex: 'townName',
|
||||
key: 'a.town_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('街道编号'),
|
||||
dataIndex: 'townCode',
|
||||
key: 'a.town_code',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('社区名称'),
|
||||
dataIndex: 'villageName',
|
||||
key: 'a.village_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('社区编号'),
|
||||
dataIndex: 'villageCode',
|
||||
key: 'a.village_code',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('更新时间'),
|
||||
dataIndex: 'updateTime',
|
||||
key: 'a.update_time',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('数据状态'),
|
||||
dataIndex: 'dataStatus',
|
||||
key: 'a.data_status',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: '',
|
||||
},
|
||||
];
|
||||
|
||||
const tableProps: BasicTableProps = {
|
||||
api: bizMunicipalitiesListData,
|
||||
beforeFetch: (params) => {
|
||||
params['isAll'] = true;
|
||||
return params;
|
||||
},
|
||||
columns: tableColumns,
|
||||
formConfig: searchForm,
|
||||
rowKey: 'id',
|
||||
};
|
||||
|
||||
export default {
|
||||
modalProps,
|
||||
tableProps,
|
||||
itemCode: 'id',
|
||||
itemName: 'id',
|
||||
isShowCode: false,
|
||||
};
|
||||
Reference in New Issue
Block a user