5 changed files with 214 additions and 290 deletions
@ -1,29 +1,20 @@ |
|||||||
// 引入基础包
|
/** |
||||||
import type { R } from '/#/axios'; |
* @program: kicc-ui |
||||||
import type { CommonEntity,Page } from '/@/api/common/data/entity'; |
* @description: 区域实体类 |
||||||
|
* 类型定义 |
||||||
|
* @author: entfrm开发团队-王翔 |
||||||
|
* @create: 2022/4/8 |
||||||
|
*/ |
||||||
|
|
||||||
export type AddressParams =AddressItem & Page; |
import type { R } from '/#/axios'; |
||||||
|
import type { TreeEntity, Page } from '/@/api/common/data/entity'; |
||||||
|
|
||||||
|
export type RegionParams = Region & Page; |
||||||
|
|
||||||
export interface AddressItem extends CommonEntity{ |
export interface Region extends TreeEntity { |
||||||
id: string; |
|
||||||
parentId: string; |
|
||||||
code: string; |
code: string; |
||||||
sort: number; |
level: number; |
||||||
name: string; |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// level: number;
|
|
||||||
// lastLevel: boolean;
|
|
||||||
//level?:string;
|
|
||||||
// beginTime?: string;
|
|
||||||
// endTime?: string;
|
|
||||||
|
|
||||||
|
|
||||||
[key: string]: any |
[key: string]: any |
||||||
|
|
||||||
|
|
||||||
} |
} |
||||||
|
|
||||||
export type AddressItemListResult = R<AddressItem[]>; |
export type RegionResult = R<Region[]>; |
||||||
|
@ -1,133 +1,117 @@ |
|||||||
import { BasicColumn } from '/@/components/Table'; |
import { BasicColumn } from '/@/components/Table'; |
||||||
import { FormSchema } from '/@/components/Table'; |
import { FormSchema } from '/@/components/Table'; |
||||||
import {h} from 'vue'; |
|
||||||
import {Tag} from 'ant-design-vue'; |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export const columns: BasicColumn[] = [ |
export const columns: BasicColumn[] = [ |
||||||
{ |
{ |
||||||
title: '区域ID', |
title: '区域名称', |
||||||
dataIndex: 'id', |
dataIndex: 'name', |
||||||
width: 50, |
align: 'left' |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
title: '区域名称', |
title: '区域编码', |
||||||
dataIndex: 'name', |
dataIndex: 'code' |
||||||
width: 120, |
}, |
||||||
}, |
{ |
||||||
{ |
title: '区域排序', |
||||||
title: '排序', |
dataIndex: 'sort' |
||||||
dataIndex: 'sort', |
}, |
||||||
width:50 |
{ |
||||||
}, |
title: '创建时间', |
||||||
{ |
dataIndex: 'createTime', |
||||||
title: '创建时间', |
width:200 |
||||||
dataIndex: 'createTime', |
}, |
||||||
width:200 |
{ |
||||||
}, |
title: '备注', |
||||||
|
dataIndex: 'remarks' |
||||||
|
}, |
||||||
]; |
]; |
||||||
|
|
||||||
export const searchFormSchema: FormSchema[] = [ |
export const searchFormSchema: FormSchema[] = [ |
||||||
{ |
{ |
||||||
field: 'name', |
field: 'name', |
||||||
label: '区域名称', |
label: '区域名称', |
||||||
component: 'Input', |
component: 'Input', |
||||||
componentProps: { |
componentProps: { |
||||||
placeholder: '请输入区域名称', |
placeholder: '请输入区域名称', |
||||||
}, |
|
||||||
colProps: { span: 5 }, |
|
||||||
}, |
}, |
||||||
{ |
colProps: { span: 8 } |
||||||
field:'id', |
}, |
||||||
label:'区域ID', |
{ |
||||||
component:'Input', |
field:'code', |
||||||
componentProps:{ |
label:'区域编码', |
||||||
placeholder:'请输入区域ID', |
component:'Input', |
||||||
}, |
componentProps:{ |
||||||
colProps:{span:5} |
placeholder:'请输入区域编码', |
||||||
}, |
}, |
||||||
{ |
colProps:{ span:7 } |
||||||
field: 'dateRange', |
}, |
||||||
label: '创建时间', |
{ |
||||||
component: 'RangePicker', |
field: 'dateRange', |
||||||
componentProps: { |
label: '创建时间', |
||||||
style: { width:'100%' }, |
component: 'RangePicker', |
||||||
valueFormat: 'YYYY-MM-DD', |
componentProps: { |
||||||
placeholder: ['开始日期','结束日期'] |
style: { width:'100%' }, |
||||||
}, |
valueFormat: 'YYYY-MM-DD', |
||||||
colProps: { span: 8 } |
placeholder: ['开始日期','结束日期'] |
||||||
}, |
}, |
||||||
|
colProps: { span: 8 } |
||||||
|
} |
||||||
]; |
]; |
||||||
/*表单配置*/ |
|
||||||
export const addressFormSchema: FormSchema[] = [ |
|
||||||
// {
|
|
||||||
// field: 'parentId',
|
|
||||||
// label: '地区',
|
|
||||||
// component: 'ApiTreeSelect',
|
|
||||||
// //component: 'TreeSelect',
|
|
||||||
// //defaultValue:'一级区域',
|
|
||||||
// componentProps: {
|
|
||||||
// api: treeList,
|
|
||||||
// resultField: 'list',
|
|
||||||
// labelField: 'name',
|
|
||||||
// valueField: 'code',
|
|
||||||
// // ReplaceFields:{
|
|
||||||
// // title: 'name',
|
|
||||||
// // key: 'code',
|
|
||||||
// // value: 'code'
|
|
||||||
// // }
|
|
||||||
// },
|
|
||||||
// required: true,
|
|
||||||
// },
|
|
||||||
//
|
|
||||||
{ |
|
||||||
field: 'parentId', |
|
||||||
label: '上级地区', |
|
||||||
component: 'TreeSelect', |
|
||||||
defaultValue: '0', |
|
||||||
required: true, |
|
||||||
componentProps:{ |
|
||||||
replaceFields: { |
|
||||||
title: 'name', |
|
||||||
key: 'id', |
|
||||||
value: 'id', |
|
||||||
}, |
|
||||||
|
|
||||||
getPopupContainer: () => document.body, |
export const regionFormSchema: FormSchema[] = [ |
||||||
|
{ |
||||||
|
field: 'id', |
||||||
|
label: 'ID', |
||||||
|
component: 'Input', |
||||||
|
show: false |
||||||
|
}, |
||||||
|
{ |
||||||
|
field: 'parentId', |
||||||
|
label: '上级区域', |
||||||
|
component: 'TreeSelect', |
||||||
|
defaultValue: '0', |
||||||
|
componentProps: { |
||||||
|
replaceFields: { |
||||||
|
title: 'name', |
||||||
|
key: 'id', |
||||||
|
value: 'id' |
||||||
|
}, |
||||||
|
getPopupContainer: () => document.body, |
||||||
} |
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
field: 'name', |
||||||
|
label: '区域名称', |
||||||
|
component: 'Input', |
||||||
|
required: true, |
||||||
|
colProps: { |
||||||
|
span: 12 |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
field: 'code', |
||||||
|
label: '区域编码', |
||||||
|
component: 'Input', |
||||||
|
colProps: { |
||||||
|
span: 12 |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
field: 'sort', |
||||||
|
label: '区域排序', |
||||||
|
component: 'InputNumber', |
||||||
|
componentProps: { |
||||||
|
style: { width:'100%' }, |
||||||
|
min: 0 |
||||||
}, |
}, |
||||||
{ |
required: true, |
||||||
field: 'id', |
colProps: { |
||||||
label: '区域ID', |
span: 12 |
||||||
component: 'Input', |
|
||||||
helpMessage: ['区域ID'], |
|
||||||
required: true |
|
||||||
}, |
|
||||||
// {
|
|
||||||
// field: 'code',
|
|
||||||
// label: '区域编码',
|
|
||||||
// component: 'Input',
|
|
||||||
// required: true,
|
|
||||||
//
|
|
||||||
// },
|
|
||||||
{ |
|
||||||
field:'sort', |
|
||||||
label:'排序', |
|
||||||
component:'Input', |
|
||||||
required:true |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '区域名称', |
|
||||||
field: 'name', |
|
||||||
component: 'Input', |
|
||||||
}, |
|
||||||
|
|
||||||
{ |
|
||||||
label: '备注', |
|
||||||
field: 'remarks', |
|
||||||
component: 'InputTextArea', |
|
||||||
} |
} |
||||||
]; |
}, |
||||||
|
{ |
||||||
|
label: '备注', |
||||||
|
field: 'remarks', |
||||||
|
component: 'InputTextArea', |
||||||
|
} |
||||||
|
]; |
||||||
|
Loading…
Reference in new issue