12 changed files with 479 additions and 454 deletions
@ -1,216 +1,212 @@ |
|||||||
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 { h } from 'vue'; |
||||||
import {Tag} from 'ant-design-vue'; |
import { Tag } from 'ant-design-vue'; |
||||||
|
import { listRegionCascade } from '/@/api/platform/system/controller/region'; |
||||||
|
|
||||||
export const columns: BasicColumn[] = [ |
export const columns: BasicColumn[] = [ |
||||||
{ |
{ |
||||||
title: 'ID', |
title: 'ID', |
||||||
dataIndex: 'id', |
dataIndex: 'id', |
||||||
width: 120, |
width: 120, |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
title: '机构名称', |
title: '机构名称', |
||||||
dataIndex: 'name', |
dataIndex: 'name', |
||||||
width: 120, |
width: 120, |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
title: '机构类型', |
title: '机构类型', |
||||||
dataIndex: 'type', |
dataIndex: 'type', |
||||||
width: 120, |
width: 120, |
||||||
customRender: ({ record }) =>{ |
customRender: ({ record }) =>{ |
||||||
console.log(record); |
const type = record.type; |
||||||
const type = record.type; |
let text = '', color = ''; |
||||||
let text = ''; |
switch (type) { |
||||||
let color = ''; |
case '1': |
||||||
switch (type) { |
text = '医检机构'; |
||||||
case '1': |
color = 'green'; |
||||||
text = '医检机构'; |
break; |
||||||
color = 'green'; |
case '2': |
||||||
break; |
text = '三甲机构'; |
||||||
case '2': |
color = 'blue'; |
||||||
text = '三甲机构'; |
break; |
||||||
color = 'blue'; |
case '0': |
||||||
break; |
text = '其他机构'; |
||||||
case '0': |
color = 'gray'; |
||||||
text = '其他机构'; |
break; |
||||||
color = 'gray'; |
} |
||||||
break; |
return h(Tag, { color: color }, () => text); |
||||||
default: |
|
||||||
text = '其他医院'; |
|
||||||
color = 'gray'; |
|
||||||
break; |
|
||||||
} |
|
||||||
|
|
||||||
return h(Tag, { color: color }, () => text); |
|
||||||
} |
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '联系人', |
|
||||||
dataIndex: 'contactsName', |
|
||||||
width: 120, |
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '联系人电话', |
|
||||||
dataIndex: 'contactsTel', |
|
||||||
width: 120, |
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '联系人职称', |
|
||||||
dataIndex: 'contactsTitle', |
|
||||||
width: 120, |
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '详细地址', |
|
||||||
dataIndex: 'detailAddress', |
|
||||||
width: 180, |
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '状态', |
|
||||||
dataIndex: 'status', |
|
||||||
width: 100, |
|
||||||
customRender: ({ record }) => { |
|
||||||
const status = record.status; |
|
||||||
const enable = status === '0'; |
|
||||||
const color = enable ? 'green' : 'red'; |
|
||||||
const text = enable ? '启用' : '禁用'; |
|
||||||
return h(Tag, { color: color }, () => text); |
|
||||||
}, |
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '创建人', |
|
||||||
dataIndex: 'createByName', |
|
||||||
width: 180, |
|
||||||
}, |
|
||||||
{ |
|
||||||
title: '创建时间', |
|
||||||
dataIndex: 'createTime', |
|
||||||
width: 180, |
|
||||||
} |
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '联系人', |
||||||
|
dataIndex: 'contactName', |
||||||
|
width: 120, |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '联系人电话', |
||||||
|
dataIndex: 'contactPhone', |
||||||
|
width: 120, |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '联系人职称', |
||||||
|
dataIndex: 'contactTitle', |
||||||
|
width: 120, |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '详细地址', |
||||||
|
dataIndex: 'detailAddress', |
||||||
|
width: 180, |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '状态', |
||||||
|
dataIndex: 'status', |
||||||
|
width: 100, |
||||||
|
customRender: ({ record }) => { |
||||||
|
const status = record.status; |
||||||
|
const enable = ~~status === 0; |
||||||
|
const color = enable ? 'green' : 'red'; |
||||||
|
const text = enable ? '启用' : '禁用'; |
||||||
|
return h(Tag, { color: color }, () => text); |
||||||
|
}, |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '创建人', |
||||||
|
dataIndex: 'createByName', |
||||||
|
width: 180, |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '创建时间', |
||||||
|
dataIndex: 'createTime', |
||||||
|
width: 180, |
||||||
|
} |
||||||
]; |
]; |
||||||
|
|
||||||
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: 5 }, |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
field: 'type', |
field: 'type', |
||||||
label: '机构类型', |
label: '机构类型', |
||||||
component: 'Select', |
component: 'Select', |
||||||
|
defaultValue: '1', |
||||||
componentProps: { |
componentProps: { |
||||||
options: [ |
options: [ |
||||||
{label: '医检机构',value: '1'}, |
{label: '医检机构',value: '1'}, |
||||||
{label: '三甲机构',value: '2'}, |
{label: '三甲机构',value: '2'}, |
||||||
{label: '其他机构',value: '0'}, |
{label: '其他机构',value: '0'} |
||||||
] |
] |
||||||
}, |
}, |
||||||
colProps: {span: 5} |
colProps: {span: 5} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
field: 'dateRange', |
field: 'dateRange', |
||||||
label: '创建时间', |
label: '创建时间', |
||||||
component: 'RangePicker', |
component: 'RangePicker', |
||||||
componentProps: { |
componentProps: { |
||||||
style: { width:'100%' }, |
style: { width:'100%' }, |
||||||
valueFormat: 'YYYY-MM-DD', |
valueFormat: 'YYYY-MM-DD', |
||||||
placeholder: ['开始日期','结束日期'] |
placeholder: ['开始日期','结束日期'] |
||||||
}, |
}, |
||||||
colProps: { span: 8 } |
colProps: { span: 8 } |
||||||
} |
} |
||||||
]; |
]; |
||||||
|
|
||||||
export const institutionFormSchema: FormSchema[] = [ |
export const institutionFormSchema: FormSchema[] = [ |
||||||
{ |
{ |
||||||
field: 'id', |
field: 'id', |
||||||
label: 'ID', |
label: 'ID', |
||||||
component: 'Input', |
component: 'Input', |
||||||
show: false, |
show: false, |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
field: 'name', |
field: 'name', |
||||||
label: '机构名称', |
label: '机构名称', |
||||||
component: 'Input', |
component: 'Input', |
||||||
required: true |
required: true |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
field: 'type', |
field: 'type', |
||||||
label: '机构类型', |
label: '机构类型', |
||||||
component: 'Select', |
component: 'Select', |
||||||
defaultValue: '0', |
defaultValue: '0', |
||||||
componentProps: { |
componentProps: { |
||||||
options: [ |
options: [ |
||||||
{label: '医检机构',value: '1'}, |
{ label: '医检机构', value: '1' }, |
||||||
{label: '三甲机构',value: '2'}, |
{ label: '三甲机构', value: '2' }, |
||||||
{label: '其他机构',value: '0'}, |
{ label: '其他机构', value: '0' }, |
||||||
] |
] |
||||||
}, |
}, |
||||||
required: true, |
required: true |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
field: 'contactsName', |
field: 'contactName', |
||||||
label: '联系人名称', |
label: '联系人名称', |
||||||
component: 'Input', |
component: 'Input', |
||||||
required: true |
required: true |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
field: 'contactsTel', |
field: 'contactPhone', |
||||||
label: '联系人电话', |
label: '联系人电话', |
||||||
component: 'Input', |
component: 'Input', |
||||||
|
rules: [ |
||||||
rules: [ |
{ |
||||||
{ |
pattern: new RegExp('^1[3|4|5|6|7|8|9][0-9]\\d{8}$'), |
||||||
pattern: new RegExp('^1[3|4|5|6|7|8|9][0-9]\\d{8}$'), |
message: '请输入正确的手机号', |
||||||
message: '请输入正确的手机号', |
validateTrigger: 'change', |
||||||
validateTrigger: 'change', |
|
||||||
required: true |
|
||||||
} |
|
||||||
], |
|
||||||
|
|
||||||
|
|
||||||
}, |
|
||||||
{ |
|
||||||
field: 'contactsTitle', |
|
||||||
label: '联系人职称', |
|
||||||
component: 'Input', |
|
||||||
required: true |
required: true |
||||||
}, |
} |
||||||
/* { |
], |
||||||
field: 'addressIds', |
}, |
||||||
label: '地址', |
{ |
||||||
component: 'ApiAddressCascader', |
field: 'contactTitle', |
||||||
componentProps: { |
label: '联系人职称', |
||||||
api: addressList |
component: 'Input', |
||||||
} |
required: true |
||||||
},*/ |
}, |
||||||
{ |
{ |
||||||
field: 'detailAddress', |
field: 'addressIds', |
||||||
label: '详细地址', |
label: '城市地址', |
||||||
component: 'Input', |
component: 'ApiCascader', |
||||||
required: true |
componentProps: { |
||||||
}, |
api: listRegionCascade, |
||||||
{ |
asyncFetchParamKey: 'parentId', |
||||||
field: 'status', |
labelField: 'name', |
||||||
label: '状态', |
valueField: 'id', |
||||||
component: 'RadioButtonGroup', |
initFetchParams: { |
||||||
defaultValue: '0', |
parentId: '0' |
||||||
componentProps: { |
} |
||||||
options: [ |
|
||||||
{ label: '启用', value: '0' }, |
|
||||||
{ label: '禁用', value: '1' }, |
|
||||||
], |
|
||||||
}, |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '备注', |
|
||||||
field: 'remarks', |
|
||||||
component: 'InputTextArea', |
|
||||||
} |
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
field: 'detailAddress', |
||||||
|
label: '详细地址', |
||||||
|
component: 'Input', |
||||||
|
required: true |
||||||
|
}, |
||||||
|
{ |
||||||
|
field: 'status', |
||||||
|
label: '状态', |
||||||
|
component: 'RadioButtonGroup', |
||||||
|
defaultValue: '0', |
||||||
|
componentProps: { |
||||||
|
options: [ |
||||||
|
{ label: '启用', value: '0' }, |
||||||
|
{ label: '禁用', value: '1' }, |
||||||
|
], |
||||||
|
}, |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: '备注', |
||||||
|
field: 'remarks', |
||||||
|
component: 'InputTextArea', |
||||||
|
} |
||||||
]; |
]; |
Loading…
Reference in new issue