jiazx0107@163.com
2023-05-17 620eab6cca2bc9ef9ea6d3067a0a5ba1deadbd1c
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
<?xml version="1.0" encoding="UTF-8"?>
<ViewConfig>
  <Arguments/>
  <Context/>
  <Model>
    <DataType name="dtMain" parent="dtDrug"/>
  </Model>
  <View layout="padding:5;regionPadding:5">
    <Property name="packages">font-awesome,css-common</Property>
    <DataSet id="dsMain">
      <Property name="dataType">[dtMain]</Property>
      <Property name="dataProvider">drugPR#pageDrug</Property>
      <Property name="pageSize">20</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">view.get(&quot;#dsMain&quot;).insert({});&#xD;
view.get(&quot;#dialogMain&quot;).show();</ClientEvent>
        <Property name="caption">新增</Property>
        <Property name="exClassName">btn-default</Property>
        <Property name="iconClass">fa fa-plus</Property>
      </Button>
      <Button layoutConstraint="left">
        <ClientEvent name="onClick">var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
if(data){&#xD;
    view.get(&quot;#dialogMain&quot;).show();&#xD;
}</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;
&#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;
});&#xD;
</ClientEvent>
        <Property name="caption">删除</Property>
        <Property name="exClassName">btn-warn</Property>
        <Property name="iconClass">fa fa-minus</Property>
      </Button>
      <TextEditor id="paramName" layoutConstraint="right">
        <Property name="width">200</Property>
        <Property name="blankText">--药品名称--</Property>
        <Property name="trigger">triggerQuery</Property>
      </TextEditor>
      <Trigger id="triggerQuery">
        <ClientEvent name="onExecute">var name = view.get(&quot;#paramName.text&quot;);&#xD;
if(null != name &amp;&amp; &quot;&quot;!= name){&#xD;
    view.get(&quot;#dsMain&quot;).set(&quot;parameter&quot;,{name:name}).flushAsync();&#xD;
}</ClientEvent>
        <Property name="iconClass">fa fa-search</Property>
      </Trigger>
    </Container>
    <Container layoutConstraint="center">
      <Property name="exClassName">bg-color</Property>
      <DataGrid>
        <ClientEvent name="onDataRowDoubleClick">var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
if(data){&#xD;
    view.get(&quot;#dialogMain&quot;).show();&#xD;
}</ClientEvent>
        <Property name="dataSet">dsMain</Property>
        <Property name="readOnly">true</Property>
        <Property name="highlightCurrentRow">false</Property>
        <RowNumColumn/>
        <DataColumn name="name">
          <Property name="property">name</Property>
        </DataColumn>
        <DataColumn name="count">
          <Property name="property">count</Property>
        </DataColumn>
        <DataColumn name="dosage">
          <Property name="property">dosage</Property>
        </DataColumn>
        <DataColumn name="spec">
          <Property name="property">spec</Property>
        </DataColumn>
        <DataColumn name="updateUser">
          <Property name="property">updateUser</Property>
        </DataColumn>
        <DataColumn name="updateTime">
          <Property name="property">updateTime</Property>
        </DataColumn>
        <DataColumn name="remarks">
          <Property name="property">remarks</Property>
        </DataColumn>
      </DataGrid>
    </Container>
    <Container layoutConstraint="bottom">
      <Property name="exClassName">bg-color</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>
      <Buttons>
        <Button>
          <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;#ajaxSave&quot;).set(&quot;parameter&quot;,data).execute(function(result){&#xD;
    if(result){&#xD;
        $alert(result);&#xD;
        return;&#xD;
    }&#xD;
    $notify(&quot;数据执行完成!!&quot;);&#xD;
    self.get(&quot;parent&quot;).hide();&#xD;
});</ClientEvent>
          <Property name="caption">确定</Property>
          <Property name="iconClass">fa fa-check</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>
        </Button>
      </Buttons>
      <Children>
        <AutoForm>
          <Property name="dataSet">dsMain</Property>
          <Property name="cols">*,*,*</Property>
          <AutoFormElement>
            <Property name="name">name</Property>
            <Property name="property">name</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">count</Property>
            <Property name="property">count</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">dosage</Property>
            <Property name="property">dosage</Property>
            <Property name="trigger">listDosage</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement layoutConstraint="colSpan:2">
            <Property name="name">spec</Property>
            <Property name="property">spec</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement layoutConstraint="colSpan:3">
            <Property name="name">remarks</Property>
            <Property name="property">remarks</Property>
            <Property name="editorType">TextArea</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">updateUser</Property>
            <Property name="property">updateUser</Property>
            <Property name="readOnly">true</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">updateTime</Property>
            <Property name="property">updateTime</Property>
            <Property name="readOnly">true</Property>
            <Editor/>
          </AutoFormElement>
        </AutoForm>
      </Children>
      <Tools/>
    </Dialog>
    <ListDropDown id="listDosage">
      <Property name="items">片剂,注射剂,乳剂,丸剂,颗粒剂,其他</Property>
      <Property name="autoOpen">true</Property>
    </ListDropDown>
    <AjaxAction id="ajaxSave">
      <Property name="service">drugPR#updateDrug</Property>
    </AjaxAction>
    <AjaxAction id="ajaxDel">
      <Property name="service">drugPR#delDrug</Property>
      <Property name="confirmMessage">确定要执行删除么?</Property>
    </AjaxAction>
  </View>
</ViewConfig>