jiazx0107@163.com
2023-11-06 786b5b76fee42107cef33892cbf7e3e8fab4f0e4
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
344
345
346
<?xml version="1.0" encoding="UTF-8"?>
<ViewConfig>
  <Arguments/>
  <Context/>
  <Model/>
  <View layout="padding:5;regionPadding:5">
    <ClientEvent name="onReady">&#xD;
addData = function(){&#xD;
    view.get(&quot;#dsDeviceSer&quot;).insert();&#xD;
    view.get(&quot;#dialog1&quot;).set(&quot;caption&quot;,&quot;添加分机&quot;);&#xD;
&#xD;
    view.get(&quot;#dialog1&quot;).show();&#xD;
};&#xD;
&#xD;
delData = function(){&#xD;
    var cur = view.get(&quot;#dsDeviceSer.data:#&quot;);&#xD;
    if(!cur) return;&#xD;
    cur.setState(dorado.Entity.STATE_DELETED);&#xD;
    $confirm(&quot;确定要删除该数据么?&quot;,function(){&#xD;
        view.get(&quot;#uaSave&quot;).execute(function(){&#xD;
            cur.remove();&#xD;
        });&#xD;
    });&#xD;
};&#xD;
&#xD;
showData = function(){&#xD;
    view.get(&quot;#dialog1&quot;).set(&quot;caption&quot;,&quot;调整分机&quot;);&#xD;
    view.get(&quot;#dialog1&quot;).show();&#xD;
};&#xD;
&#xD;
btnCancel = function(){&#xD;
    view.get(&quot;#dialog1&quot;).hide();&#xD;
};&#xD;
&#xD;
onDialogHide = function(){&#xD;
    var cur = view.get(&quot;#dsDeviceSer.data:#&quot;);&#xD;
    cur.cancel();&#xD;
};</ClientEvent>
    <Property name="packages">font-awesome,css-common</Property>
    <Property name="cache">
      <Property name="mode">clientSide</Property>
    </Property>
    <DataSet id="dsDeviceSer">
      <Property name="parameter"></Property>
      <Property name="dataProvider">deviceSerPR#getAllSer</Property>
      <Property name="dataType">[dtDeviceSer]</Property>
    </DataSet>
    <Container layout="regionPadding:10" layoutConstraint="top">
      <Property name="exClassName">bg-color</Property>
      <Property name="height">55</Property>
      <Property name="contentOverflow">hidden</Property>
      <Label layoutConstraint="left">
        <Property name="text">菜单栏:</Property>
      </Label>
      <Button layoutConstraint="left">
        <ClientEvent name="onClick">addData();</ClientEvent>
        <Property name="caption">新增</Property>
        <Property name="exClassName">btn-normal</Property>
        <Property name="iconClass">fa fa-plus</Property>
      </Button>
      <Button layoutConstraint="left">
        <ClientEvent name="onClick">showData();</ClientEvent>
        <Property name="caption">修改</Property>
        <Property name="exClassName">btn-warm</Property>
        <Property name="iconClass">fa fa-pencil</Property>
      </Button>
      <Button layoutConstraint="left">
        <ClientEvent name="onClick">var currentEntity = view.get(&quot;#dsDeviceSer&quot;).get(&quot;data:#&quot;);&#xD;
dorado.MessageBox.confirm(&quot;确认需要删除记录吗?&quot;,function(){&#xD;
        view.get(&quot;#ajaxActionDel&quot;).set(&quot;parameter&quot;,{&#xD;
        id:currentEntity.get(&quot;id&quot;)&#xD;
    }).execute(function(){&#xD;
        currentEntity.remove();&#xD;
    });&#xD;
});        &#xD;
</ClientEvent>
        <Property name="caption">删除</Property>
        <Property name="action">ajaxActionDel</Property>
        <Property name="exClassName">btn-warn</Property>
        <Property name="iconClass">fa fa-trash-o</Property>
      </Button>
      <Button layoutConstraint="left">
        <ClientEvent name="onClick">view.get(&quot;#dsDeviceSer&quot;).flushAsync();&#xD;
</ClientEvent>
        <Property name="caption">刷新数据</Property>
        <Property name="exClassName">btn-default</Property>
        <Property name="iconClass">fa fa-refresh</Property>
      </Button>
      <Button layoutConstraint="left">
        <Property name="caption">刷新缓存</Property>
        <Property name="exClassName">btn-flush</Property>
        <Property name="iconClass">fa fa-refresh</Property>
        <Property name="action">ajaxRefreshCache</Property>
      </Button>
      <Button layoutConstraint="left">
        <Property name="caption">远程操作</Property>
        <Property name="exClassName">btn-normal</Property>
        <Property name="iconClass">fa fa-flag-checkered</Property>
        <Property name="menu">menuPull</Property>
      </Button>
    </Container>
    <DataGrid layoutConstraint="center">
      <ClientEvent name="onDataRowDoubleClick">showData();</ClientEvent>
      <Property name="dataSet">dsDeviceSer</Property>
      <Property name="readOnly">true</Property>
      <DataColumn name="id">
        <Property name="property">id</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="name">
        <Property name="property">name</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="ip">
        <Property name="property">ip</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="port">
        <Property name="property">port</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="status">
        <ClientEvent name="onRenderCell">arg.dom.style.background = arg.data.get(&quot;status&quot;)== 'Y' ?&quot;&quot;:&quot;#FF5722&quot;;&#xD;
arg.processDefault = true;</ClientEvent>
        <Property name="property">status</Property>
        <Property name="align">center</Property>
        <Property name="width">120</Property>
      </DataColumn>
      <DataColumn name="controlModel">
        <Property name="property">controlModel</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="protocol">
        <Property name="property">protocol</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="networkType">
        <Property name="property">networkType</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="updateTime">
        <Property name="property">updateTime</Property>
        <Property name="align">center</Property>
      </DataColumn>
    </DataGrid>
    <Dialog id="dialog1">
      <ClientEvent name="onHide">onDialogHide();</ClientEvent>
      <Property name="width">800</Property>
      <Property name="caption">新增分机</Property>
      <Property name="closeable">false</Property>
      <Buttons>
        <Button>
          <ClientEvent name="onClick">var cur = view.get(&quot;#dsDeviceSer.data:#&quot;);&#xD;
if(cur.validate() == 'ok'){&#xD;
    view.get(&quot;#updateAction&quot;).execute(function(){&#xD;
        view.get(&quot;#dialog1&quot;).close();&#xD;
    });&#xD;
}else{&#xD;
    $alert(&quot;数据校验失败!&quot;);&#xD;
}</ClientEvent>
          <Property name="caption">确定</Property>
          <Property name="iconClass">fa fa-check</Property>
          <Property name="exClassName">btn-normal</Property>
        </Button>
        <Button>
          <ClientEvent name="onClick">btnCancel();</ClientEvent>
          <Property name="caption">取消</Property>
          <Property name="iconClass">fa fa-times</Property>
          <Property name="exClassName">btn-warn</Property>
        </Button>
      </Buttons>
      <Children>
        <FieldSet layout="padding:5" layoutConstraint="padding:5">
          <Property name="caption">基本信息</Property>
          <Buttons/>
          <Children>
            <AutoForm>
              <Property name="dataSet">dsDeviceSer</Property>
              <Property name="cols">*,*</Property>
              <Property name="labelSeparator">:</Property>
              <Property name="labelAlign">right</Property>
              <Property name="labelWidth">100</Property>
              <AutoFormElement>
                <Property name="name">id</Property>
                <Property name="property">id</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">name</Property>
                <Property name="property">name</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">ip</Property>
                <Property name="property">ip</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">port</Property>
                <Property name="property">port</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">type</Property>
                <Property name="property">type</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">sn</Property>
                <Property name="property">sn</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">controlModel</Property>
                <Property name="property">controlModel</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">networkType</Property>
                <Property name="property">networkType</Property>
                <Property name="label">终端联网</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">protocol</Property>
                <Property name="property">protocol</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">status</Property>
                <Property name="property">status</Property>
                <Editor/>
              </AutoFormElement>
            </AutoForm>
          </Children>
        </FieldSet>
        <FieldSet layout="padding:5" layoutConstraint="padding:5">
          <Property name="caption">其他说明</Property>
          <Buttons/>
          <Children>
            <AutoForm>
              <Property name="dataSet">dsDeviceSer</Property>
              <Property name="cols">*,*</Property>
              <Property name="labelSeparator">:</Property>
              <Property name="labelAlign">right</Property>
              <Property name="labelWidth">100</Property>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">producer</Property>
                <Property name="property">producer</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">updateTime</Property>
                <Property name="property">updateTime</Property>
                <Property name="readOnly">true</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">updateUser</Property>
                <Property name="property">updateUser</Property>
                <Property name="readOnly">true</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>
        </FieldSet>
      </Children>
      <Tools/>
    </Dialog>
    <UpdateAction id="updateAction">
      <Property name="dataResolver">deviceSerPR#updateSer</Property>
      <UpdateItem>
        <Property name="dataSet">dsDeviceSer</Property>
        <Property name="dataPath">[#current]</Property>
      </UpdateItem>
    </UpdateAction>
    <AjaxAction id="ajaxActionDel">
      <Property name="service">deviceSerPR#delSerById</Property>
    </AjaxAction>
    <AjaxAction id="ajaxRefreshCache">
      <Property name="service">deviceSerPR#refreshCache</Property>
      <Property name="successMessage">刷新成功!</Property>
      <Property name="confirmMessage">确定要刷新缓存么?</Property>
    </AjaxAction>
    <Menu id="menuPull">
      <MenuItem>
        <ClientEvent name="onClick">var cur = view.get(&quot;#dsDeviceSer.data:#&quot;);&#xD;
view.get(&quot;#ajaxUpdateDepot&quot;).set(&quot;parameter&quot;,cur.get(&quot;id&quot;)).execute(function(result){&#xD;
    if(result){&#xD;
        $alert(result);&#xD;
    }else{&#xD;
        $alert(&quot;命令发送成功,请等待终端返回!!&quot;);&#xD;
    }&#xD;
});</ClientEvent>
        <Property name="caption">远程同步仓库</Property>
        <Property name="iconClass">fa fa-thumbs-o-up</Property>
      </MenuItem>
      <MenuItem>
        <ClientEvent name="onClick">var cur = view.get(&quot;#dsDeviceSer.data:#&quot;);&#xD;
view.get(&quot;#ajaxUpdateDevice&quot;).set(&quot;parameter&quot;,cur.get(&quot;id&quot;)).execute(function(result){&#xD;
    if(result){&#xD;
        $alert(result);&#xD;
    }else{&#xD;
        $alert(&quot;命令发送成功,请等待终端返回!!&quot;);&#xD;
    }&#xD;
});</ClientEvent>
        <Property name="caption">远程同步设备</Property>
        <Property name="iconClass">fa fa-thumbs-o-up</Property>
      </MenuItem>
      <MenuItem>
        <ClientEvent name="onClick">var cur = view.get(&quot;#dsDeviceSer.data:#&quot;);&#xD;
dorado.MessageBox.prompt(&quot;请输入授权码?&quot;,function(txt){&#xD;
    view.get(&quot;#ajaxAccess&quot;).set(&quot;parameter&quot;,{serId:cur.get(&quot;id&quot;),accessCode:txt}).execute(function(result){&#xD;
        if(result){&#xD;
            $alert(result);&#xD;
        }else{&#xD;
            $alert(&quot;命令发送成功,请等待终端返回!!&quot;);&#xD;
        }&#xD;
    });&#xD;
});</ClientEvent>
        <Property name="caption">远程授权</Property>
        <Property name="iconClass">fa fa-thumbs-o-up</Property>
      </MenuItem>
    </Menu>
    <AjaxAction id="ajaxUpdateDevice">
      <Property name="service">basicSystemService#pullDeviceBySer</Property>
      <Property name="confirmMessage">确定要同步远程控制柜中的设备配置到平台么?</Property>
      <Property name="executingMessage">指令发送中……</Property>
    </AjaxAction>
    <AjaxAction id="ajaxUpdateDepot">
      <Property name="service">basicSystemService#pullDepotBySer</Property>
      <Property name="confirmMessage">确定要同步远程控制柜中的仓库配置到平台么?</Property>
      <Property name="executingMessage">指令发送中……</Property>
    </AjaxAction>
    <AjaxAction id="ajaxAccess">
      <Property name="service">basicSystemService#pullAccess</Property>
      <Property name="executingMessage">指令发送中……</Property>
    </AjaxAction>
  </View>
</ViewConfig>