You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
129 lines
2.6 KiB
129 lines
2.6 KiB
2 months ago
|
import moment from 'moment'
|
||
|
import type { BasicColumn, FormSchema } from '@/components/Table'
|
||
|
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
|
||
|
|
||
|
export const columns: BasicColumn[] = [
|
||
|
{
|
||
|
title: '编号',
|
||
|
dataIndex: 'serialNumber',
|
||
|
width: 80,
|
||
|
},
|
||
|
{
|
||
|
title: '测点编码',
|
||
|
dataIndex: 'itemName',
|
||
|
width: 150,
|
||
|
},
|
||
|
{
|
||
|
title: '测点名称',
|
||
|
dataIndex: 'descriptor',
|
||
|
width: 200,
|
||
|
},
|
||
|
{
|
||
|
title: '实时值',
|
||
|
dataIndex: 'value',
|
||
|
width: 90,
|
||
|
className: 'value',
|
||
|
slots: { customRender: 'value' },
|
||
|
|
||
|
},
|
||
|
{
|
||
|
title: '单位',
|
||
|
dataIndex: 'engUnits',
|
||
|
width: 30,
|
||
|
},
|
||
|
{
|
||
|
title: '组别',
|
||
|
dataIndex: 'groupName',
|
||
|
width: 50,
|
||
|
},
|
||
|
|
||
|
]
|
||
|
|
||
|
export const searchFormSchema: FormSchema[] = [
|
||
|
{
|
||
|
label: '测点名称或测点描述',
|
||
|
field: 'condition',
|
||
|
component: 'Input',
|
||
|
defaultValue: '',
|
||
|
required: true,
|
||
|
colProps: { span: 8 },
|
||
|
},
|
||
|
]
|
||
|
|
||
|
export const formSchema: FormSchema[] = [
|
||
|
|
||
|
{
|
||
|
label: '测点编码',
|
||
|
field: 'ItemName',
|
||
|
required: true,
|
||
|
component: 'Input',
|
||
|
},
|
||
|
{
|
||
|
label: '测点描述',
|
||
|
field: 'Descriptor',
|
||
|
required: true,
|
||
|
component: 'Input',
|
||
|
},
|
||
|
{
|
||
|
label: '单位',
|
||
|
field: 'EngUnits',
|
||
|
required: true,
|
||
|
component: 'Input',
|
||
|
},
|
||
|
{
|
||
|
label: '组名',
|
||
|
field: 'GroupName',
|
||
|
component: 'Select',
|
||
|
componentProps: {
|
||
|
options: getDictOptions(DICT_TYPE.COMMON_STATUS),
|
||
|
},
|
||
|
required: true,
|
||
|
|
||
|
},
|
||
|
{
|
||
|
label: '类型',
|
||
|
field: 'ItemType',
|
||
|
component: 'Select',
|
||
|
componentProps: {
|
||
|
options: [{ value: 1, label: 1 }, { value: 2, label: 2 }, { value: 3, label: 3 }, { value: 4, label: 4 }, { value: 5, label: 5 }],
|
||
|
},
|
||
|
required: true,
|
||
|
|
||
|
},
|
||
|
{
|
||
|
label: '自动保存',
|
||
|
field: 'AutoSave',
|
||
|
component: 'Select',
|
||
|
componentProps: {
|
||
|
options: [{ value: 1, label: '是' }, { value: 2, label: '否' }],
|
||
|
},
|
||
|
required: true,
|
||
|
|
||
|
},
|
||
|
{
|
||
|
label: '数据来源',
|
||
|
field: 'Source',
|
||
|
component: 'Input',
|
||
|
},
|
||
|
]
|
||
|
|
||
|
export const formHistory: FormSchema[] = [
|
||
|
{
|
||
|
label: '时间',
|
||
|
field: 'time',
|
||
|
show: true,
|
||
|
component: 'RangePicker',
|
||
|
componentProps: {
|
||
|
placeholder: ['开始时间', '结束时间'],
|
||
|
defaultValue: [moment().subtract(1, 'day').format('YYYY-MM-DD HH:mm:ss'), moment().format('YYYY-MM-DD HH:mm:ss')],
|
||
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||
|
showTime: {
|
||
|
defaultValue: [moment().subtract(1, 'day').format('YYYY-MM-DD HH:mm:ss'), moment().format('YYYY-MM-DD HH:mm:ss')],
|
||
|
},
|
||
|
onChange: (e: any) => {
|
||
|
console.log(e)
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
]
|