riku
2024-11-07 5036880fc037e5d112206b93a729f60be12bf8ab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
import {
  baseInputItem,
  hideInputItem,
  setDefaultValue,
} from '../../../../components/form/form-util.js';
import { monitorDevices } from '../../../../common/dataMonitorDeviceType';
import { treatmentDevices } from '../../../../common/dataTreatmentDeviceType';
import { productionDevices } from '../../../../common/dataProductionDeviceType';
import { freq } from '../../../../common/dataMaintainFrequency';
import { status } from '../../../../common/dataRunningStatus';
import { ownership } from '../../../../common/dataOwnership';
 
/**
 * 监测设备表单
 * @param {Number} sceneType 场景类型(飞羽监管系统)
 * @param {Object} defaultValue 表单默认值
 */
export function monitorDeviceForm(sceneType, defaultValue) {
  const items = [
    hideInputItem('id', 'diId'),
    hideInputItem('创建时间', 'diCreateTime'),
    hideInputItem('更新时间', 'diUpdateTime'),
    hideInputItem('场景id', 'diSceneGuid'),
    hideInputItem('场景类型', 'diSceneTypeId'),
 
    baseInputItem('站点名称', 'diName', true),
    baseInputItem('设备编号', 'diDeviceCode'),
    // 设备类型和设备子类合并用级联选择器展示
    baseInputItem(
      '设备类型',
      '_type',
      true,
      'cascader',
      monitorDevices(sceneType),
      ['选择设备类型', '选择设备子类'],
      ['diTypeId', 'diSubtypeId'],
    ),
    // baseInputItem('设备类型', 'diTypeId', true, 'picker'),
    // baseInputItem('设备子类', 'diSubtypeId', true, 'picker'),
    baseInputItem('供应商', 'diSupplier'),
    baseInputItem('运维商', 'diMaintainer'),
    baseInputItem('运维频次', 'diMaintainFrequency', true, 'picker', freq),
    baseInputItem('运维人员', 'diMaintainStaff'),
    baseInputItem('运维电话', 'diMaintainTel'),
    baseInputItem('运行状态', 'diRunningStatus', true, 'picker', status),
    baseInputItem('品牌型号', 'diBrandModel'),
    baseInputItem('设备参数', 'diDeviceParam'),
    baseInputItem('所有权', 'diOwnership', true, 'picker', ownership),
 
    // todo 2024/8/12: 后续要添加二维码的信息扫描录入
    // baseInputItem('标识二维码', 'diQRCode'),
    // baseInputItem('其他第三方或设备自带二维码', 'diOtherQRCode'),
  ];
 
  // 填充默认数据
  setDefaultValue(items, defaultValue);
 
  return items;
}
 
/**
 * 治理设备表单
 */
export function treatmentDeviceForm(sceneType, defaultValue) {
  const items = [
    hideInputItem('id', 'piId'),
    hideInputItem('创建时间', 'piCreateTime'),
    hideInputItem('更新时间', 'piUpdateTime'),
    hideInputItem('场景id', 'piSceneGuid'),
    hideInputItem('场景类型', 'piSceneTypeId'),
 
    baseInputItem('设备名称', 'piName', true),
    baseInputItem('设备编号', 'piDeviceCode'),
    // 设备类型和设备子类合并用级联选择器展示
    baseInputItem(
      '设备类型',
      '_type',
      true,
      'cascader',
      treatmentDevices(sceneType),
      ['选择设备类型', '选择设备子类'],
      ['piTypeId', 'piSubtypeId'],
    ),
    // baseInputItem('设备类型', 'piTypeId', true, 'picker'),
    // baseInputItem('设备子类', 'piSubtypeId', true, 'picker'),
    baseInputItem('供应商', 'piSupplier'),
    baseInputItem('运维商', 'piMaintainer'),
    baseInputItem('运维频次', 'piMaintainFrequency', true, 'picker', freq),
    baseInputItem('运维人员', 'piMaintainStaff'),
    baseInputItem('运维电话', 'piMaintainTel'),
    baseInputItem('运行状态', 'piRunningStatus', true, 'picker', status),
    baseInputItem('品牌型号', 'piBrandModel'),
    baseInputItem('设备参数', 'piDeviceParam'),
    baseInputItem('所有权', 'piOwnership', true, 'picker', ownership),
 
    // todo 2024/8/12: 后续要添加二维码的信息扫描录入
    // baseInputItem('标识二维码', 'piQRCode'),
    // baseInputItem('其他第三方或设备自带二维码', 'piOtherQRCode'),
  ];
  setDefaultValue(items, defaultValue);
  return items;
}
 
/**
 * 生产设备表单
 */
export function productionDeviceForm(sceneType, defaultValue) {
  const items = [
    hideInputItem('id', 'wiId'),
    hideInputItem('创建时间', 'wiCreateTime'),
    hideInputItem('更新时间', 'wiUpdateTime'),
    hideInputItem('场景id', 'wiSceneGuid'),
    hideInputItem('场景类型', 'wiSceneTypeId'),
 
    baseInputItem('设备名称', 'wiName', true),
    baseInputItem('设备编号', 'wiDeviceCode'),
    // 设备类型和设备子类合并用级联选择器展示
    baseInputItem(
      '设备类型',
      '_type',
      true,
      'cascader',
      productionDevices(sceneType),
      ['选择设备类型', '选择设备子类'],
      ['wiTypeId', 'wiSubtypeId'],
    ),
    // baseInputItem('设备类型', 'piTypeId', true, 'picker'),
    // baseInputItem('设备子类', 'piSubtypeId', true, 'picker'),
    baseInputItem('供应商', 'wiSupplier'),
    baseInputItem('服务商', 'wiServicer'),
    baseInputItem('服务人员', 'wiMaintainStaff'),
    baseInputItem('服务电话', 'wiMaintainTel'),
    baseInputItem('运行状态', 'wiRunningStatus', true, 'picker', status),
    baseInputItem('品牌型号', 'wiBrandModel'),
    baseInputItem('设备参数', 'wiDeviceParam'),
    baseInputItem('所有权', 'wiOwnership', true, 'picker', ownership),
 
    // todo 2024/8/12: 后续要添加二维码的信息扫描录入
    // baseInputItem('标识二维码', 'wiQRCode'),
    // baseInputItem('其他第三方或设备自带二维码', 'wiOtherQRCode'),
  ];
  setDefaultValue(items, defaultValue);
  return items;
}
 
/**
 * 设备状态表单
 */
export function deviceStatusForm(defaultValue) {
  const items = [
    hideInputItem('id', 'dlId'),
    hideInputItem('设备id', 'dlDeviceId'),
    hideInputItem('设备类型', 'dlDeviceType'),
    hideInputItem('场景id', 'dlSceneGuid'),
    hideInputItem('场景类型', 'dlSceneTypeId'),
    hideInputItem('现场图片', 'dlPicUrl'),
    hideInputItem('现场视频', 'dlVideoUrl'),
    hideInputItem('创建时间', 'dlCreateTime'),
    hideInputItem('更新时间', 'dlUpdateTime'),
    hideInputItem('设备位置', 'dlLocation', true),
    hideInputItem('经度', 'dlLongitude'),
    hideInputItem('维度', 'dlLatitude', true),
 
    baseInputItem('是否规范', 'dlStandard', true, 'switch'),
    baseInputItem('不规范原因', 'dlUnStandardReason'),
    baseInputItem('运行状态', 'dlRealTimeStatus', true, 'picker', status),
  ];
 
  setDefaultValue(items, defaultValue);
  return items;
}