czt
2025-11-28 dec93e6c6923238869a5accf278028cdd6a18bec
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
<?xml version="1.0" encoding="UTF-8"?>
<ViewConfig>
  <Arguments/>
  <Context/>
  <View layout="padding:10">
    <ClientEvent name="onReady">//查询&#xD;
query = function(){&#xD;
    view.get(&quot;#dsMain&quot;).flushAsync();&#xD;
};&#xD;
      &#xD;
query();</ClientEvent>
    <Property name="packages">font-awesome,css-common</Property>
    <DataSet id="dsMain">
      <Property name="dataType">[dtArea]</Property>
      <Property name="dataProvider">dicAreaPR#pageList</Property>
      <Property name="loadMode">manual</Property>
      <Property name="pageSize">20</Property>
    </DataSet>
    <Container>
      <Property name="className">c-param</Property>
      <ToolBar>
        <ToolBarButton>
          <ClientEvent name="onClick">view.get(&quot;#dsMain&quot;).insert();&#xD;
            view.get(&quot;#dialogMain&quot;).show();&#xD;
          </ClientEvent>
          <Property name="caption">新增</Property>
          <Property name="exClassName">btn1</Property>
          <Property name="width">100</Property>
          <Property name="iconClass">fa fa-plus</Property>
        </ToolBarButton>
        <ToolBarButton>
          <ClientEvent name="onClick">&#xD;
            &#xD;
            var select = view.get(&quot;#dataGridMain&quot;).get(&quot;selection&quot;);&#xD;
            if(select){&#xD;
            view.get(&quot;#dialogMain&quot;).show();;&#xD;
            }else{&#xD;
            $notify(&quot;请选择需要修改的数据……&quot;);&#xD;
            }    </ClientEvent>
          <Property name="caption">修改</Property>
          <Property name="exClassName">btn2</Property>
          <Property name="width">100</Property>
          <Property name="iconClass">fa fa-pencil-square-o</Property>
        </ToolBarButton>
        <ToolBarButton>
          <ClientEvent name="onClick">   &#xD;
            var select = view.get(&quot;#dataGridMain&quot;).get(&quot;selection&quot;);&#xD;
            if(select){&#xD;
            view.get(&quot;#ajaxDel&quot;).set(&quot;parameter&quot;,select).execute(function(){&#xD;
            select.remove();&#xD;
            });&#xD;
            }else{&#xD;
            $notify(&quot;请选择需要删除的数据……&quot;);&#xD;
            }</ClientEvent>
          <Property name="caption">删除</Property>
          <Property name="exClassName">btn3</Property>
          <Property name="width">100</Property>
          <Property name="iconClass">fa fa-times</Property>
        </ToolBarButton>
        <ToolBarButton>
          <ClientEvent name="onClick">view.get(&quot;#dsMain&quot;).flushAsync();&#xD;
          </ClientEvent>
          <Property name="caption">刷新</Property>
          <Property name="exClassName">btn-q2</Property>
          <Property name="width">100</Property>
          <Property name="iconClass">fa fa-refresh</Property>
        </ToolBarButton>
      </ToolBar>
      <DataGrid id="dataGridMain" layoutConstraint="padding:8" selectionMode="singleRow">
        <ClientEvent name="onDataRowClick">self.set(&quot;selection&quot;, arg.data)</ClientEvent>
        <Property name="dataSet">dsMain</Property>
        <Property name="readOnly">true</Property>
        <RowSelectorColumn/>
        <RowNumColumn/>
        <DataColumn>
          <Property name="property">code</Property>
          <Property name="align">center</Property>
          <Property name="name">code</Property>
        </DataColumn>
        <DataColumn>
          <Property name="property">name</Property>
          <Property name="align">center</Property>
          <Property name="name">name</Property>
        </DataColumn>
        <DataColumn>
          <Property name="property">simple</Property>
          <Property name="align">center</Property>
          <Property name="name">simple</Property>
        </DataColumn>
        <DataColumn>
          <Property name="property">parentCode</Property>
          <Property name="align">center</Property>
          <Property name="name">parentCode</Property>
        </DataColumn>
        <DataColumn>
          <Property name="property">type</Property>
          <Property name="align">center</Property>
          <Property name="name">type</Property>
        </DataColumn>
        <DataColumn>
          <Property name="property">disabledTag</Property>
          <Property name="align">center</Property>
          <Property name="name">disabledTag</Property>
        </DataColumn>
        <DataColumn>
          <Property name="property">remark</Property>
          <Property name="align">center</Property>
          <Property name="name">remark</Property>
        </DataColumn>
      </DataGrid>
    </Container>
    <Container layoutConstraint="bottom">
      <Property name="className">c-bottom</Property>
      <DataPilot layoutConstraint="right">
        <Property name="dataSet">dsMain</Property>
        <Property name="itemCodes">pageSize,pages</Property>
      </DataPilot>
    </Container>
    <Dialog id="dialogMain">
      <Property name="closeable">false</Property>
      <Property name="caption">配置信息</Property>
      <Property name="width">60%</Property>
      <Property name="iconClass">fa fa-tasks</Property>
      <Buttons>
        <Button id="btnOk">
          <ClientEvent name="onClick">var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
            &#xD;
            if(data.validate() != 'ok'){&#xD;
            $notify(&quot;数据校验失败!!&quot;);&#xD;
            return;&#xD;
            }&#xD;
            &#xD;
            view.get(&quot;#uaAction&quot;).set(&quot;parameter&quot;,data).execute(function(){&#xD;
            &#xD;
            $notify(&quot;数据执行完成!!&quot;);&#xD;
            self.get(&quot;parent&quot;).hide();&#xD;
            });</ClientEvent>
          <Property name="caption">保存</Property>
          <Property name="iconClass">fa fa-check-circle</Property>
          <Property name="exClassName">btn1</Property>
          <Property name="width">120</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="exClassName">btn3</Property>
          <Property name="iconClass">fa fa-times-circle</Property>
          <Property name="width">120</Property>
        </Button>
      </Buttons>
      <Children>
        <AutoForm>
          <Property name="dataSet">dsMain</Property>
          <Property name="cols">*,*</Property>
          <Property name="labelAlign">right</Property>
          <Property name="labelSeparator">:</Property>
          <Property name="labelWidth">120</Property>
          <AutoFormElement>
            <Property name="name">code</Property>
            <Property name="property">code</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">name</Property>
            <Property name="property">name</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">simple</Property>
            <Property name="property">simple</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">type</Property>
            <Property name="property">type</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">disabledTag</Property>
            <Property name="property">disabledTag</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement layoutConstraint="colSpan:2">
            <Property name="name">remark</Property>
            <Property name="property">remark</Property>
            <Editor/>
          </AutoFormElement>
        </AutoForm>
      </Children>
      <Tools/>
    </Dialog>
    <UpdateAction id="uaAction">
      <Property name="dataResolver">dicAreaPR#saveDicArea</Property>
      <UpdateItem>
        <Property name="dataSet">dsMain</Property>
        <Property name="dataPath">[#current]</Property>
      </UpdateItem>
    </UpdateAction>
    <AjaxAction id="ajaxDel">
      <Property name="service">dicAreaPR#delDicArea</Property>
      <Property name="confirmMessage">确定要执行删除么?</Property>
    </AjaxAction>
  </View>
</ViewConfig>