feat:增加 area 地区

This commit is contained in:
YunaiV
2025-04-06 09:28:18 +08:00
parent 2e5d924a4f
commit 67dafcc72a
4 changed files with 194 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
import type { VxeTableGridOptions } from '@vben/plugins/vxe-table';
import type { VbenFormSchema } from '#/adapter/form';
import type { OnActionClickFn } from '#/adapter/vxe-table';
import type { SystemAreaApi } from '#/api/system/area';
import { z } from '#/adapter/form';
import { useAccess } from '@vben/access';
/** 查询 IP 的表单 */
export function useFormSchema(): VbenFormSchema[] {
return [
{
fieldName: 'ip',
label: 'IP 地址',
component: 'Input',
componentProps: {
placeholder: '请输入 IP 地址',
},
rules: 'required',
},
{
fieldName: 'result',
label: '地址',
component: 'Input',
componentProps: {
placeholder: '展示查询 IP 结果',
readonly: true,
}
},
];
}
/** 列表的字段 */
export function useGridColumns(): VxeTableGridOptions<SystemAreaApi.SystemArea>['columns'] {
return [
{
field: 'id',
title: '地区编码',
minWidth: 120,
align: 'left',
fixed: 'left',
treeNode: true,
},
{
field: 'name',
title: '地区名称',
minWidth: 200,
},
];
}