CZT
2023-11-27 c206acfaedc69c390fb67daa81bc686f58a212ef
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
<?xml version="1.0" encoding="UTF-8"?>
<ViewConfig>
  <Arguments/>
  <Context/>
  <Model>
    <DataType name="dataTypeMain">
      <Property name="creationType">com.ld.igds.models.ThreeConf</Property>
      <PropertyDef name="id">
        <Property></Property>
        <Property name="label">ID</Property>
      </PropertyDef>
      <PropertyDef name="companyId">
        <Property></Property>
        <Property name="label">组织编码</Property>
      </PropertyDef>
      <PropertyDef name="uid">
        <Property></Property>
        <Property name="label">三维唯一Id</Property>
      </PropertyDef>
      <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="deviceId">
        <Property></Property>
        <Property name="label">设备id</Property>
 
      </PropertyDef>
      <PropertyDef name="cameraId">
        <Property></Property>
        <Property name="label">摄像头id</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;securityPR#listCamera&quot;).getResult()}</Property>
          <Property name="keyProperty">id</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="cameraName">
        <Property></Property>
        <Property name="label">摄像头名称</Property>
      </PropertyDef>
      <PropertyDef name="deviceName">
        <Property name="label">设备名称</Property>
      </PropertyDef>
    </DataType>
  </Model>
  <View layout="padding:5;regionPadding:5">
    <ClientEvent name="onReady">addData = function(){&#xD;
    view.get(&quot;#dsMain&quot;).insert();&#xD;
    view.get(&quot;#dialogMain&quot;).show();&#xD;
};</ClientEvent>
    <Property name="packages">font-awesome,css-common</Property>
    <Property name="cache">
      <Property name="mode">clientSide</Property>
    </Property>
    <DataSet id="dsMain">
      <Property name="parameter"></Property>
      <Property name="dataType">[dataTypeMain]</Property>
      <Property name="dataProvider">threeConfPR#getAllThreeConf</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">view.get(&quot;#dialogMain&quot;).set(&quot;caption&quot;,&quot;调整分机&quot;);&#xD;
                    view.get(&quot;#dialogMain&quot;).show();</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 data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
                    if(!data){&#xD;
                    return;&#xD;
                    }&#xD;
                    view.get(&quot;#ajaxDel&quot;).set(&quot;parameter&quot;,data).execute(function(result){&#xD;
                    if(result){&#xD;
                    $alert(result);&#xD;
                    return;&#xD;
                    }else{&#xD;
                    data.remove();&#xD;
                    }&#xD;
                    });</ClientEvent>
        <Property name="caption">删除</Property>
        <Property name="exClassName">btn-warn</Property>
        <Property name="iconClass">fa fa-trash-o</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>
    </Container>
    <DataGrid layoutConstraint="center">
      <ClientEvent name="onDataRowDoubleClick">//showData();</ClientEvent>
      <Property name="dataSet">dsMain</Property>
      <Property name="readOnly">true</Property>
      <RowNumColumn/>
      <DataColumn>
        <Property name="property">uid</Property>
        <Property name="name">uid</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn>
        <Property name="property">depotId</Property>
        <Property name="name">depotId</Property>
      </DataColumn>
      <DataColumn>
        <Property name="property">deviceId</Property>
        <Property name="align">center</Property>
        <Property name="name">deviceId</Property>
      </DataColumn>
      <DataColumn>
        <Property name="property">cameraId</Property>
        <Property name="align">center</Property>
        <Property name="name">cameraId</Property>
      </DataColumn>
    </DataGrid>
    <Dialog id="dialogMain">
      <ClientEvent name="onHide">//onDialogHide();</ClientEvent>
      <Property name="width">950</Property>
      <Property name="caption">添加配置</Property>
      <Property name="closeable">false</Property>
      <Buttons>
        <Button>
          <ClientEvent name="onClick">var cur = view.get(&quot;#dsMain.data:#&quot;);&#xD;
                        if(cur.validate() == 'ok'){&#xD;
                        view.get(&quot;#updateMain&quot;).execute(function(){&#xD;
                        view.get(&quot;#dialogMain&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">view.get(&quot;#dsMain.data:#&quot;).cancel();&#xD;
                        self.get(&quot;parent&quot;).hide();</ClientEvent>
          <Property name="caption">取消</Property>
          <Property name="iconClass">fa fa-times</Property>
          <Property name="exClassName">btn-warn</Property>
        </Button>
      </Buttons>
      <Children>
        <AutoForm>
          <Property name="dataSet">dsMain</Property>
          <Property name="labelWidth">120</Property>
          <Property name="labelSeparator">:</Property>
          <Property name="labelAlign">right</Property>
          <Property name="cols">*,*</Property>
          <AutoFormElement>
            <Property name="name">uid</Property>
            <Property name="property">uid</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">depotId</Property>
            <Property name="property">depotId</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">deviceId</Property>
            <Property name="property">deviceId</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">cameraId</Property>
            <Property name="property">cameraId</Property>
            <Property name="trigger">autoMappingDropDown1</Property>
            <Editor/>
          </AutoFormElement>
        </AutoForm>
      </Children>
      <Tools/>
    </Dialog>
    <AjaxAction id="ajaxDel">
      <Property name="service">threeConfPR#delThreeConf</Property>
      <Property name="confirmMessage">确定要删除吗?</Property>
      <Property name="successMessage">删除成功!</Property>
    </AjaxAction>
    <AjaxAction id="ajaxRefreshCache">
      <Property name="successMessage">刷新成功!</Property>
      <Property name="confirmMessage">确定要刷新缓存么?</Property>
      <Property name="service">threeConfPR#refreshCache</Property>
    </AjaxAction>
    <UpdateAction id="updateMain">
      <Property name="dataResolver">threeConfPR#updateThreeConf</Property>
      <UpdateItem>
        <Property name="dataPath">[#current]</Property>
        <Property name="dataSet">dsMain</Property>
      </UpdateItem>
    </UpdateAction>
  </View>
</ViewConfig>