czt
4 小时以前 b291d46184e69b11cd9fa045e6d06be084d4203b
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
<?xml version="1.0" encoding="UTF-8"?>
<ViewConfig>
  <Arguments/>
  <Context/>
  <Model/>
  <View layout="padding:10">
    <ClientEvent name="onReady">&#xD;
          /**&#xD;
          * 查询&#xD;
          */&#xD;
          query = function(){&#xD;
          view.get(&quot;#dsMain&quot;).flushAsync();&#xD;
          }&#xD;</ClientEvent>
    <Property name="packages">font-awesome,css-common</Property>
    <DataSet id="dsMain">
      <Property name="dataProvider">sloganPR#loadData</Property>
      <Property name="dataType">[dtSlogan]</Property>
    </DataSet>
    <Container>
      <Property name="className">c-param</Property>
      <ToolBar>
        <ToolBarButton>
          <ClientEvent name="onClick">view.get(&quot;#dsMain&quot;).insert();&#xD;
              view.get(&quot;#dialog1&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">var select = view.get(&quot;#dataGridMain&quot;).get(&quot;selection&quot;);&#xD;
              if(select){&#xD;
              view.get(&quot;#dialog1&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(result){&#xD;
              select.remove();&#xD;
              });&#xD;
              }else{&#xD;
              $notify(&quot;请选择需要删除的仓库……&quot;);&#xD;
              }&#xD;
              &#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">var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
              if(data){&#xD;
              $confirm(&quot;确认将&quot; + data.get(&quot;name&quot;) + &quot;推送至大屏?&quot;,function(){&#xD;
              view.get(&quot;#ajaxAction1&quot;).set(&quot;parameter&quot;,data).execute(function(){&#xD;
              $notify(&quot;推送成功!&quot;);&#xD;
              view.get(&quot;#dsMain&quot;).flushAsync ();&#xD;
              });&#xD;
              });&#xD;
              }else{&#xD;
              $notify(&quot;请选择一条标语&quot;);&#xD;
              }&#xD;
              &#xD;
          </ClientEvent>
          <Property name="caption">推送大屏</Property>
          <Property name="exClassName">btn4</Property>
          <Property name="width">120</Property>
          <Property name="iconClass">fa fa-upload</Property>
        </ToolBarButton>
      </ToolBar>
      <DataGrid id="dataGridMain" layoutConstraint="padding:8">
        <ClientEvent name="onDataRowClick">view.get(&quot;#dataGridMain&quot;).set(&quot;selection&quot;,arg.data);</ClientEvent>
        <Property name="dataSet">dsMain</Property>
        <Property name="readOnly">true</Property>
        <Property name="selectionMode">singleRow</Property>
        <Property name="readOnly">true</Property>
        <RowSelectorColumn/>
        <RowNumColumn/>
        <DataColumn name="name">
          <Property name="property">name</Property>
          <Property name="align">center</Property>
          <Property name="width">120</Property>
        </DataColumn>
        <DataColumn name="content">
          <Property name="property">content</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="color">
          <Property name="property">color</Property>
          <Property name="align">center</Property>
          <Property name="width">100</Property>
        </DataColumn>
        <DataColumn name="status">
          <Property name="property">status</Property>
          <Property name="align">center</Property>
          <Property name="width">100</Property>
        </DataColumn>
        <DataColumn name="pushUser">
          <Property name="property">pushUser</Property>
          <Property name="align">center</Property>
          <Property name="width">120</Property>
        </DataColumn>
        <DataColumn name="pushTime">
          <Property name="property">pushTime</Property>
          <Property name="align">center</Property>
          <Property name="width">160</Property>
        </DataColumn>
        <DataColumn name="updateTime">
          <Property name="property">updateTime</Property>
          <Property name="align">center</Property>
          <Property name="width">160</Property>
        </DataColumn>
      </DataGrid>
    </Container>
    <Dialog id="dialog1" layout="regionPadding:8">
      <Property name="iconClass">fa fa-tasks</Property>
      <Property name="width">500</Property>
      <Property name="height">300</Property>
      <Property name="caption">标语详细</Property>
      <Buttons>
        <Button>
          <ClientEvent name="onClick">view.get(&quot;#uaMain&quot;).execute(function(result){&#xD;
    if(result){&#xD;
        $alert(result);&#xD;
    }else{&#xD;
        $notify(&quot;保存成功!!&quot;);&#xD;
        view.get(&quot;#dialog1&quot;).hide();&#xD;
        query();&#xD;
    }&#xD;
});&#xD;
&#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;
view.get(&quot;#dialog1&quot;).hide();&#xD;
</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">name</Property>
            <Property name="property">name</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="property">color</Property>
            <Property name="name">color</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement layoutConstraint="rowSpan:3">
            <Property name="name">content</Property>
            <Property name="property">content</Property>
            <Property name="editorType">TextArea</Property>
            <Editor/>
          </AutoFormElement>
        </AutoForm>
      </Children>
      <Tools/>
    </Dialog>
    <UpdateAction id="uaMain">
      <Property name="dataResolver">sloganPR#saveAll</Property>
      <UpdateItem>
        <Property name="dataSet">dsMain</Property>
      </UpdateItem>
    </UpdateAction>
    <AjaxAction id="ajaxAction1">
      <Property name="service">sloganPR#push</Property>
    </AjaxAction>
    <AjaxAction id="ajaxDel">
      <Property name="service">sloganPR#delData</Property>
      <Property name="confirmMessage">确定要执行删除么?</Property>
    </AjaxAction>
  </View>
</ViewConfig>