YYC
2023-09-07 7243e0b4bd9a267a633d2e481e17646509b6868d
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
<?xml version="1.0" encoding="UTF-8"?>
<ViewConfig>
  <Arguments/>
  <Context/>
  <Model>
    <DataType name="dataTypeC">
      <PropertyDef name="depotId">
        <Property></Property>
        <Property name="label">目标仓库</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;depotPR#getAllCache&quot;).getResult()}</Property>
          <Property name="keyProperty">id</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="type">
        <Property></Property>
        <Property name="label">设备类型</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;dicTriggerPR#dicTrigger&quot;).getResult(&quot;DEVICE_TYPE&quot;)}</Property>
          <Property name="keyProperty">code</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="serId">
        <Property></Property>
        <Property name="label">所属分机</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;deviceSerPR#getAllSerCache&quot;).getResult()}</Property>
          <Property name="keyProperty">id</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
    </DataType>
  </Model>
  <View layout="padding:5;regionPadding:5">
    <ClientEvent name="onReady">view.get(&quot;#dataSetC&quot;).insert();&#xD;
&#xD;
openModbusDevice = function(){&#xD;
    view.get(&quot;#dialogModbus&quot;).show();&#xD;
}</ClientEvent>
    <Property name="packages">font-awesome,css-common</Property>
    <DataSet id="dsDevice">
      <Property name="dataProvider">devicePR#loadDeviceByContion</Property>
      <Property name="pageSize">20</Property>
      <Property name="loadMode">lazy</Property>
      <Property name="dataType">[dtDevice]</Property>
    </DataSet>
    <DataSet id="dataSetC">
      <Property name="dataType">dataTypeC</Property>
    </DataSet>
    <AutoForm>
      <Property name="cols">*,*,*,*,*</Property>
      <Property name="labelWidth">100</Property>
      <Property name="exClassName">bg-color</Property>
      <Property name="dataSet">dataSetC</Property>
      <AutoFormElement>
        <Property name="name">depotId</Property>
        <Property name="property">depotId</Property>
        <Property name="trigger">autoOpenMappingDropDown2</Property>
        <Editor/>
      </AutoFormElement>
      <AutoFormElement>
        <Property name="name">serId</Property>
        <Property name="property">serId</Property>
        <Property name="trigger">autoOpenMappingDropDown2</Property>
        <Editor/>
      </AutoFormElement>
      <AutoFormElement>
        <Property name="name">type</Property>
        <Property name="property">type</Property>
        <Property name="trigger">autoOpenMappingDropDown2</Property>
        <Editor/>
      </AutoFormElement>
      <Container layout="hbox regionPadding:10" layoutConstraint="colSpan:2">
        <Button>
          <Property name="caption">查询</Property>
          <Property name="action">actionDeviceQuery</Property>
          <Property name="iconClass">fa fa-search</Property>
          <Property name="exClassName">btn-default</Property>
        </Button>
        <Button>
          <Property name="caption">新增</Property>
          <Property name="action">actionDeviceAdd</Property>
          <Property name="iconClass">fa fa-plus</Property>
          <Property name="tags">F_CrtFBTBankIDMap</Property>
          <Property name="exClassName">btn-normal</Property>
        </Button>
        <Button>
          <Property name="caption">修改</Property>
          <Property name="action">actionDeviceUpdate</Property>
          <Property name="iconClass">fa fa-pencil</Property>
          <Property name="exClassName">btn-warm</Property>
        </Button>
        <Button>
          <Property name="action">actionDeviceDelete</Property>
          <Property name="iconClass">fa fa-minus</Property>
          <Property name="caption">删除</Property>
          <Property name="exClassName">btn-warn</Property>
        </Button>
        <Button>
          <Property name="caption">刷新缓存</Property>
          <Property name="iconClass">fa fa-refresh</Property>
          <Property name="exClassName">btn-flush</Property>
          <Property name="action">ajaxRefreshCache</Property>
        </Button>
      </Container>
    </AutoForm>
    <DataGrid id="gridDevice" layoutConstraint="center ">
      <ClientEvent name="onDataRowDoubleClick">view.get(&quot;#actionDeviceUpdate&quot;).execute();</ClientEvent>
      <Property name="dataSet">dsDevice</Property>
      <Property name="readOnly">true</Property>
      <IndicatorColumn/>
      <DataColumn name="passCode">
        <Property name="property">passCode</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="name">
        <Property name="property">name</Property>
      </DataColumn>
      <DataColumn>
        <Property name="property">typeName</Property>
        <Property name="align">center</Property>
        <Property name="name">typeName</Property>
      </DataColumn>
      <DataColumn name="depotId">
        <Property name="property">depotId</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn>
        <Property name="property">location</Property>
        <Property name="align">center</Property>
        <Property name="name">location</Property>
      </DataColumn>
      <DataColumn name="link">
        <Property name="property">link</Property>
        <Property name="caption">风机编码</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="serId">
        <Property name="property">serId</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="remark">
        <Property name="property">remark</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn>
        <ClientEvent name="onRenderCell">arg.dom.innerHTML =&quot;&lt;a href='javascripe:;' onclick='openModbusDevice()'>Modbus配置&lt;/a>&quot;;&#xD;
arg.progressDefault = false;</ClientEvent>
        <Property name="name">id</Property>
        <Property name="property">id</Property>
        <Property name="width">100</Property>
        <Property name="caption">操作</Property>
        <Editor/>
      </DataColumn>
    </DataGrid>
    <ToolBar layoutConstraint="bottom">
      <Fill/>
      <DataPilot layoutConstraint="right">
        <Property name="dataSet">dsDevice</Property>
        <Property name="itemCodes">pageSize,pages</Property>
      </DataPilot>
    </ToolBar>
    <Dialog id="dialogDevice">
      <ClientEvent name="onHide">view.id(&quot;dsDevice&quot;).getData().cancel();</ClientEvent>
      <Property name="caption">编辑页面</Property>
      <Property name="width">800</Property>
      <Buttons>
        <Button>
          <Property name="caption">确定</Property>
          <Property name="width">90</Property>
          <Property name="iconClass">fa fa-check-circle-o</Property>
          <Property name="action">actionDeviceSave</Property>
        </Button>
        <Button>
          <ClientEvent name="onClick">view.get(&quot;#dialogDevice&quot;).hide();</ClientEvent>
          <Property name="caption">取消</Property>
          <Property name="action">actionCancel</Property>
          <Property name="width">90</Property>
          <Property name="iconClass">fa fa-times-circle-o</Property>
        </Button>
      </Buttons>
      <Children>
        <AutoForm>
          <Property name="dataSet">dsDevice</Property>
          <Property name="cols">*,*</Property>
          <Property name="labelWidth">100</Property>
          <AutoFormElement>
            <Property name="name">depotId</Property>
            <Property name="property">depotId</Property>
            <Property name="trigger">autoOpenMappingDropDown1</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">serId</Property>
            <Property name="property">serId</Property>
            <Property name="trigger">autoOpenMappingDropDown1</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">name</Property>
            <Property name="property">name</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">type</Property>
            <Property name="property">type</Property>
            <Property name="trigger">autoOpenMappingDropDown1</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">passCode</Property>
            <Property name="property">passCode</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">location</Property>
            <Property name="property">location</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">link</Property>
            <Property name="property">link</Property>
            <Property name="label">关联风机</Property>
            <Editor/>
          </AutoFormElement>
          <Label>
            <Property name="text">如:针对双通道配置类设备,如混流风口、轴流风口</Property>
          </Label>
          <AutoFormElement>
            <Property name="name">status</Property>
            <Property name="property">status</Property>
            <Property name="trigger">autoOpenMappingDropDown1</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">power</Property>
            <Property name="property">power</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement layoutConstraint="colSpan:2">
            <Property name="name">remark</Property>
            <Property name="property">remark</Property>
            <Property name="editorType">TextArea</Property>
            <Editor/>
          </AutoFormElement>
        </AutoForm>
      </Children>
      <Tools/>
    </Dialog>
    <Action id="actionDeviceQuery">
      <ClientEvent name="onExecute">var entity = view.get(&quot;#dataSetC.data&quot;);&#xD;
view.get(&quot;#dsDevice&quot;).set(&quot;parameter&quot;,entity).flushAsync();</ClientEvent>
      <ClientEvent name="onFailure">dorado.MessageBox.alert(arg.error,{&#xD;
    title: '系统提示信息'&#xD;
});&#xD;
arg.processDefault = false;</ClientEvent>
      <Property name="hotkey">alt+q</Property>
    </Action>
    <Action id="actionDeviceAdd">
      <ClientEvent name="onExecute">var dialog=view.get(&quot;#dialogDevice&quot;);&#xD;
var visible=dialog.get(&quot;actualVisible&quot;);&#xD;
if(!visible){&#xD;
    view.get(&quot;#dsDevice&quot;).insert();&#xD;
    dialog.set(&quot;caption&quot;,&quot;新增设备&quot;);&#xD;
    dialog.show();&#xD;
}</ClientEvent>
    </Action>
    <Action id="actionDeviceUpdate">
      <ClientEvent name="onExecute">var entity = view.id(&quot;dsDevice&quot;).getData(&quot;#&quot;);&#xD;
var dialog=view.get(&quot;#dialogDevice&quot;);&#xD;
var visible = dialog.get(&quot;actualVisible&quot;);&#xD;
if(!visible){&#xD;
    dialog.set(&quot;caption&quot;,&quot;修改设备&quot;);&#xD;
    if(entity){&#xD;
        dialog.show();&#xD;
    }else{&#xD;
        dorado.MessageBox.alert(&quot;当前无可编辑数据!&quot;);&#xD;
    }&#xD;
}&#xD;
view.get(&quot;^isKey&quot;).each(function(item){&#xD;
    item.set(&quot;readOnly&quot;,true);&#xD;
});</ClientEvent>
    </Action>
    <Action id="actionDeviceDelete">
      <ClientEvent name="onExecute">var dialog=view.get(&quot;#dialogDevice&quot;);&#xD;
var visible = dialog.get(&quot;actualVisible&quot;);&#xD;
var dsDevice=view.get(&quot;#dsDevice&quot;);&#xD;
var actionDeviceSave=view.get(&quot;#actionDeviceSave&quot;);&#xD;
if(!visible){&#xD;
    if(!dsDevice.getData(&quot;#&quot;)){&#xD;
        dorado.MessageBox.alert(&quot;请先选择要操作的数据!&quot;);&#xD;
        return;&#xD;
    }else{&#xD;
        dorado.MessageBox.confirm(&quot;确定要删除这条记录吗?&quot;,{&#xD;
        detailCallback: function(button,text){&#xD;
            if(&quot;yes&quot;==button){&#xD;
                dsDevice.getData(&quot;#&quot;).remove();&#xD;
                actionDeviceSave.execute();&#xD;
            }&#xD;
        }});&#xD;
    }&#xD;
}&#xD;
&#xD;
&#xD;
</ClientEvent>
    </Action>
    <UpdateAction id="actionDeviceSave">
      <ClientEvent name="onFailure">if(arg.error){&#xD;
    dorado.MessageBox.alert(arg.error,{&#xD;
        title: '系统提示信息'&#xD;
    });&#xD;
    arg.processDefault = false;&#xD;
}</ClientEvent>
      <ClientEvent name="onSuccess">view.get(&quot;#dialogDevice&quot;).close();</ClientEvent>
      <Property name="dataResolver">devicePR#saveAll</Property>
      <UpdateItem>
        <Property name="dataSet">dsDevice</Property>
      </UpdateItem>
    </UpdateAction>
    <AjaxAction id="saveAjaxAction">
      <Property name="service">devicePR#saveDevice</Property>
    </AjaxAction>
    <AjaxAction id="ajaxRefreshCache">
      <Property name="service">devicePR#refreshCache</Property>
      <Property name="successMessage">刷新成功!</Property>
      <Property name="confirmMessage">确定要刷新缓存么?</Property>
    </AjaxAction>
    <Dialog id="dialogModbus">
      <Property name="width">100%</Property>
      <Property name="height">95%</Property>
      <Property name="caption">设备MOBUS-TCP相关配置</Property>
      <Buttons/>
      <Children>
        <IFrame id="iframeModbusDevice">
          <Property name="path">com.ld.igds.modbus.DeviceModbus.d</Property>
        </IFrame>
      </Children>
      <Tools/>
    </Dialog>
  </View>
</ViewConfig>