This commit is contained in:
2025-06-18 16:50:58 +08:00
parent 1262d4c745
commit 06a0e3649d
46 changed files with 3048 additions and 545 deletions

View File

@@ -1,6 +1,8 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render';
export const querySchema: FormSchemaGetter = () => [
{
@@ -14,7 +16,11 @@ export const querySchema: FormSchemaGetter = () => [
label: '城市名称',
},
{
component: 'Input',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_QYJB 便于维护
options: getDictOptions('wy_qyjb'),
},
fieldName: 'areaLevel',
label: '101 省级 202 市州 303 区县',
},
@@ -38,21 +44,12 @@ export const querySchema: FormSchemaGetter = () => [
fieldName: 'lat',
label: '维度',
},
{
component: 'Input',
fieldName: 'dataState',
label: '数据状态1有效0无效',
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '主键ID',
field: 'id',
},
{
title: '城市编码',
field: 'areaCode',
@@ -64,6 +61,12 @@ export const columns: VxeGridProps['columns'] = [
{
title: '101 省级 202 市州 303 区县',
field: 'areaLevel',
slots: {
default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.WY_QYJB 便于维护
return renderDict(row.areaLevel, 'wy_qyjb');
},
},
},
{
title: '父级城市编码',
@@ -81,10 +84,6 @@ export const columns: VxeGridProps['columns'] = [
title: '维度',
field: 'lat',
},
{
title: '数据状态1有效0无效',
field: 'dataState',
},
{
field: 'action',
fixed: 'right',
@@ -99,7 +98,6 @@ export const modalSchema: FormSchemaGetter = () => [
label: '主键ID',
fieldName: 'id',
component: 'Input',
rules: 'required',
},
{
label: '城市编码',
@@ -119,8 +117,12 @@ export const modalSchema: FormSchemaGetter = () => [
{
label: '101 省级 202 市州 303 区县',
fieldName: 'areaLevel',
component: 'Input',
rules: 'required',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_QYJB 便于维护
options: getDictOptions('wy_qyjb'),
},
rules: 'selectRequired',
},
{
label: '父级城市编码',
@@ -146,10 +148,4 @@ export const modalSchema: FormSchemaGetter = () => [
component: 'Input',
rules: 'required',
},
{
label: '数据状态1有效0无效',
fieldName: 'dataState',
component: 'Input',
rules: 'required',
},
];