5 changed files with 214 additions and 290 deletions
@ -1,29 +1,20 @@
@@ -1,29 +1,20 @@
|
||||
// 引入基础包
|
||||
import type { R } from '/#/axios'; |
||||
import type { CommonEntity,Page } from '/@/api/common/data/entity'; |
||||
/** |
||||
* @program: kicc-ui |
||||
* @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{ |
||||
id: string; |
||||
parentId: string; |
||||
export interface Region extends TreeEntity { |
||||
code: string; |
||||
sort: number; |
||||
name: string; |
||||
|
||||
|
||||
|
||||
// level: number;
|
||||
// lastLevel: boolean;
|
||||
//level?:string;
|
||||
// beginTime?: string;
|
||||
// endTime?: string;
|
||||
|
||||
|
||||
level: number; |
||||
[key: string]: any |
||||
|
||||
|
||||
} |
||||
|
||||
export type AddressItemListResult = R<AddressItem[]>; |
||||
export type RegionResult = R<Region[]>; |
||||
|
@ -1,133 +1,117 @@
@@ -1,133 +1,117 @@
|
||||
import { BasicColumn } from '/@/components/Table'; |
||||
import { FormSchema } from '/@/components/Table'; |
||||
import {h} from 'vue'; |
||||
import {Tag} from 'ant-design-vue'; |
||||
|
||||
|
||||
|
||||
export const columns: BasicColumn[] = [ |
||||
{ |
||||
title: '区域ID', |
||||
dataIndex: 'id', |
||||
width: 50, |
||||
}, |
||||
{ |
||||
title: '区域名称', |
||||
dataIndex: 'name', |
||||
width: 120, |
||||
}, |
||||
{ |
||||
title: '排序', |
||||
dataIndex: 'sort', |
||||
width:50 |
||||
}, |
||||
{ |
||||
title: '创建时间', |
||||
dataIndex: 'createTime', |
||||
width:200 |
||||
}, |
||||
|
||||
{ |
||||
title: '区域名称', |
||||
dataIndex: 'name', |
||||
align: 'left' |
||||
}, |
||||
{ |
||||
title: '区域编码', |
||||
dataIndex: 'code' |
||||
}, |
||||
{ |
||||
title: '区域排序', |
||||
dataIndex: 'sort' |
||||
}, |
||||
{ |
||||
title: '创建时间', |
||||
dataIndex: 'createTime', |
||||
width:200 |
||||
}, |
||||
{ |
||||
title: '备注', |
||||
dataIndex: 'remarks' |
||||
}, |
||||
]; |
||||
|
||||
export const searchFormSchema: FormSchema[] = [ |
||||
{ |
||||
field: 'name', |
||||
label: '区域名称', |
||||
component: 'Input', |
||||
componentProps: { |
||||
placeholder: '请输入区域名称', |
||||
}, |
||||
colProps: { span: 5 }, |
||||
{ |
||||
field: 'name', |
||||
label: '区域名称', |
||||
component: 'Input', |
||||
componentProps: { |
||||
placeholder: '请输入区域名称', |
||||
}, |
||||
{ |
||||
field:'id', |
||||
label:'区域ID', |
||||
component:'Input', |
||||
componentProps:{ |
||||
placeholder:'请输入区域ID', |
||||
}, |
||||
colProps:{span:5} |
||||
colProps: { span: 8 } |
||||
}, |
||||
{ |
||||
field:'code', |
||||
label:'区域编码', |
||||
component:'Input', |
||||
componentProps:{ |
||||
placeholder:'请输入区域编码', |
||||
}, |
||||
{ |
||||
field: 'dateRange', |
||||
label: '创建时间', |
||||
component: 'RangePicker', |
||||
componentProps: { |
||||
style: { width:'100%' }, |
||||
valueFormat: 'YYYY-MM-DD', |
||||
placeholder: ['开始日期','结束日期'] |
||||
}, |
||||
colProps: { span: 8 } |
||||
}, |
||||
|
||||
colProps:{ span:7 } |
||||
}, |
||||
{ |
||||
field: 'dateRange', |
||||
label: '创建时间', |
||||
component: 'RangePicker', |
||||
componentProps: { |
||||
style: { width:'100%' }, |
||||
valueFormat: 'YYYY-MM-DD', |
||||
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 |
||||
}, |
||||
{ |
||||
field: 'id', |
||||
label: '区域ID', |
||||
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', |
||||
required: true, |
||||
colProps: { |
||||
span: 12 |
||||
} |
||||
}, |
||||
{ |
||||
label: '备注', |
||||
field: 'remarks', |
||||
component: 'InputTextArea', |
||||
} |
||||
]; |
Loading…
Reference in new issue