feat(property): 新增抄表记录功能并优化仪表信息管理
This commit is contained in:
@@ -4,8 +4,17 @@ import type { VxeGridProps } from '#/adapter/vxe-table'
|
||||
import { getDictOptions } from '#/utils/dict'
|
||||
import { renderDict } from '#/utils/render'
|
||||
|
||||
export function initMoalForm(type: number) {
|
||||
const modalSchema: FormSchemaGetter = () => [
|
||||
export function initDrawerForm(type: number) {
|
||||
const drawerSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '主键id',
|
||||
fieldName: 'id',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
show: () => false,
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '仪表名称',
|
||||
fieldName: 'meterName',
|
||||
@@ -13,14 +22,28 @@ export function initMoalForm(type: number) {
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '仪表编码',
|
||||
fieldName: 'meterCode',
|
||||
label: '楼层',
|
||||
fieldName: 'floorId',
|
||||
component: 'TreeSelect',
|
||||
defaultValue: undefined,
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '安装位置',
|
||||
fieldName: 'installLocation',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '设备厂商',
|
||||
fieldName: 'factoryNo',
|
||||
label: '仪表编码',
|
||||
fieldName: 'meterCode',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '采集器IP',
|
||||
fieldName: 'hostIp',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: type === 1 ? '设备类型(电表)' : type === 2 ? '设备类型(水表)' : '设备类型(气表)',
|
||||
@@ -46,11 +69,6 @@ export function initMoalForm(type: number) {
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '安装位置',
|
||||
fieldName: 'installLocation',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '初始读数',
|
||||
fieldName: 'initReading',
|
||||
@@ -70,15 +88,15 @@ export function initMoalForm(type: number) {
|
||||
options: getDictOptions('sis_device_status'),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '运行状态',
|
||||
fieldName: 'runningState',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
// 可选从DictEnum中获取 DictEnum.SIS_DEVICE_STATUS 便于维护
|
||||
options: getDictOptions('sis_device_status'),
|
||||
},
|
||||
},
|
||||
// {
|
||||
// label: '运行状态',
|
||||
// fieldName: 'runningState',
|
||||
// component: 'Select',
|
||||
// componentProps: {
|
||||
// // 可选从DictEnum中获取 DictEnum.SIS_DEVICE_STATUS 便于维护
|
||||
// options: getDictOptions('sis_device_status'),
|
||||
// },
|
||||
// },
|
||||
{
|
||||
label: '备注',
|
||||
fieldName: 'remark',
|
||||
@@ -86,7 +104,7 @@ export function initMoalForm(type: number) {
|
||||
},
|
||||
]
|
||||
|
||||
return modalSchema
|
||||
return drawerSchema
|
||||
}
|
||||
|
||||
export function initQuerySchema(type: number) {
|
||||
@@ -131,10 +149,10 @@ export function initColumns(type: number) {
|
||||
title: '仪表编码',
|
||||
field: 'meterCode',
|
||||
},
|
||||
{
|
||||
title: '设备厂商',
|
||||
field: 'factoryNo',
|
||||
},
|
||||
// {
|
||||
// title: '设备厂商',
|
||||
// field: 'factoryNo',
|
||||
// },
|
||||
{
|
||||
title: type === 1 ? '设备类型(电表)' : type === 2 ? '设备类型(水表)' : '设备类型(气表)',
|
||||
field: 'meterType',
|
||||
@@ -155,6 +173,10 @@ export function initColumns(type: number) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '楼层',
|
||||
field: 'floorName',
|
||||
},
|
||||
{
|
||||
title: '安装位置',
|
||||
field: 'installLocation',
|
||||
@@ -177,16 +199,16 @@ export function initColumns(type: number) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '运行状态',
|
||||
field: 'runningState',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
// 可选从DictEnum中获取 DictEnum.SIS_DEVICE_STATUS 便于维护
|
||||
return renderDict(row.runningState, 'sis_device_status')
|
||||
},
|
||||
},
|
||||
},
|
||||
// {
|
||||
// title: '运行状态',
|
||||
// field: 'runningState',
|
||||
// slots: {
|
||||
// default: ({ row }) => {
|
||||
// // 可选从DictEnum中获取 DictEnum.SIS_DEVICE_STATUS 便于维护
|
||||
// return renderDict(row.runningState, 'sis_device_status')
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
{
|
||||
title: '备注',
|
||||
field: 'remark',
|
||||
|
Reference in New Issue
Block a user