| | |
| | | <Context/> |
| | | <Model/> |
| | | <View layout="padding:10"> |
| | | <ClientEvent name="onClick">
 |
| | | /**
 |
| | | * 查询
 |
| | | */
 |
| | | query = function(){
 |
| | | view.get("#dsMain").flushAsync();
 |
| | | }
</ClientEvent> |
| | | <Property name="packages">font-awesome,css-common</Property> |
| | | <DataSet id="dsMain"> |
| | | <DataSet id="dsConf"> |
| | | <Property name="loadMode">lazy</Property> |
| | | <Property name="dataType">[dtSnapConf]</Property> |
| | | <Property name="dataProvider">snapConfPR#listAll</Property> |
| | | <Property name="dataProvider">snapConfPR#selectList</Property> |
| | | </DataSet> |
| | | <DataSet id="dsParam"> |
| | | <ClientEvent name="onReady">self.insert({});</ClientEvent> |
| | | <Property name="dataType">dtBaseParam</Property> |
| | | <Property name="loadMode">lazy</Property> |
| | | <Property name="dataType">dtSnapConf</Property> |
| | | <Property name="dataProvider">snapConfPR#getConfActHour</Property> |
| | | </DataSet> |
| | | <Container> |
| | | <Property name="className">c-param</Property> |
| | | <AutoForm> |
| | | <Property name="cols">*,90,90,*,*</Property> |
| | | <Property name="dataSet">dsParam</Property> |
| | | <Property name="labelAlign">right</Property> |
| | | <Property name="labelWidth">100</Property> |
| | | <AutoFormElement> |
| | | <Property name="name">deptId</Property> |
| | | <Property name="property">deptId</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <Button> |
| | | <ClientEvent name="onClick">var param = view.get("#dsParam.data");
 |
| | | console.log("param",param);
 |
| | | view.get("#dsMain").set("parameter",param).flushAsync();
 |
| | | </ClientEvent> |
| | | <Property name="caption">搜索</Property> |
| | | <Property name="iconClass">fa fa-search</Property> |
| | | <Property name="exClassName">btn-q1</Property> |
| | | </Button> |
| | | <Button> |
| | | <ClientEvent name="onClick">view.get("#dsParam").set("data",{});</ClientEvent> |
| | | <Property name="caption">重置</Property> |
| | | <Property name="exClassName">btn-q2</Property> |
| | | <Property name="iconClass">fa fa-refresh</Property> |
| | | </Button> |
| | | </AutoForm> |
| | | </Container> |
| | | <Container> |
| | | <Property name="className">c-data</Property> |
| | | <ToolBar> |
| | | <ToolBarButton> |
| | | <ClientEvent name="onClick">view.get("#dsMain").insert({});
 |
| | | view.get("#dialogMain").show();
 |
| | | </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 data = view.get("#dgMain").get("selection"); |
| | | view.get("#dialogMain").show(); |
| | | </ClientEvent> |
| | | <Property name="id">btnUpdate</Property> |
| | | <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">var data = view.get("#dgMain").get("selection") |
| | | if(!data){ |
| | | $alert("请选择数据"); |
| | | }else{ |
| | | view.get("#ajaxDelData").set("parameter", data).execute(function(result){ |
| | | if("200"!=result.code){ |
| | | $alert("异常信息:"+result.message); |
| | | }else{ |
| | | $notify("执行成功"); |
| | | query();
 |
| | | } |
| | | }) |
| | | }</ClientEvent> |
| | | <Property name="caption">删除</Property> |
| | | <Property name="exClassName">btn3</Property> |
| | | <Property name="width">100</Property> |
| | | <Property name="iconClass">fa fa-times</Property> |
| | | </ToolBarButton> |
| | | </ToolBar> |
| | | <DataGrid id="dgMain" layoutConstraint="padding:8" selectionMode="singleRow"> |
| | | <ClientEvent name="onDataRowClick">self.set("selection", arg.data)</ClientEvent> |
| | | <Property name="dataSet">dsMain</Property> |
| | | <Property name="readOnly">true</Property> |
| | | <RowSelectorColumn/> |
| | | <RowNumColumn/> |
| | | <DataColumn name="deptId"> |
| | | <Property name="property">deptId</Property> |
| | | </DataColumn> |
| | | <DataColumn name="cameraId"> |
| | | <Property name="property">cameraId</Property> |
| | | </DataColumn> |
| | | <DataColumn name="actHour1"> |
| | | <Property name="property">actHour1</Property> |
| | | </DataColumn> |
| | | <DataColumn name="actHour2"> |
| | | <Property name="property">actHour2</Property> |
| | | </DataColumn> |
| | | <DataColumn name="actHour3"> |
| | | <Property name="property">actHour3</Property> |
| | | </DataColumn> |
| | | </DataGrid> |
| | | </Container> |
| | | <Dialog id="dialogMain" layout="regionPadding:8"> |
| | | <Property name="closeable">false</Property> |
| | | <Property name="caption">抓拍配置</Property> |
| | | <Property name="width">1200</Property> |
| | | <Property name="iconClass">fa fa-tasks</Property> |
| | | <Buttons> |
| | | <Button id="btnOk"> |
| | | <ClientEvent name="onClick">view.get("#saveAction").execute(function(){
 |
| | | self.get("parent").hide();
 |
| | | });</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("#dsMain.data:#").cancel();
 |
| | | self.get("parent").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> |
| | | <Container> |
| | | <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">deptId</Property> |
| | | <FieldSet> |
| | | <Property name="caption">抓拍摄像头配置</Property> |
| | | <Buttons> |
| | | <Button> |
| | | <ClientEvent name="onClick">view.get("#dsConf").insert();</ClientEvent> |
| | | <Property name="caption">新增配置</Property> |
| | | <Property name="exClassName">bt1</Property> |
| | | </Button> |
| | | <Button> |
| | | <Property name="caption">保存配置</Property> |
| | | <Property name="action">updateConf</Property> |
| | | <Property name="exClassName">bt2</Property> |
| | | </Button> |
| | | </Buttons> |
| | | <Children> |
| | | <DataGrid id="dgMain"> |
| | | <Property name="dataSet">dsConf</Property> |
| | | <Property name="height">400</Property> |
| | | <RowNumColumn/> |
| | | <DataColumn name="deptId"> |
| | | <Property name="property">deptId</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">cameraId</Property> |
| | | </DataColumn> |
| | | <DataColumn name="cameraId"> |
| | | <Property name="property">cameraId</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | </DataColumn> |
| | | </DataGrid> |
| | | </Children> |
| | | </FieldSet> |
| | | <FieldSet> |
| | | <Property name="caption">抓拍时间配置</Property> |
| | | <Buttons> |
| | | <Button> |
| | | <ClientEvent name="onClick">var data = view.get("#dsParam.data");
 |
| | | view.get("#ajaxSnapTime").set("parameter",data).execute();</ClientEvent> |
| | | <Property name="caption">保存抓时间</Property> |
| | | <Property name="exClassName">bt4</Property> |
| | | </Button> |
| | | </Buttons> |
| | | <Children> |
| | | <AutoForm> |
| | | <Property name="dataSet">dsParam</Property> |
| | | <Property name="cols">*,*,*</Property> |
| | | <AutoFormElement> |
| | | <Property name="name">actHour1</Property> |
| | | <Property name="property">actHour1</Property> |
| | | <Property name="trigger">listHour</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">actHour2</Property> |
| | | <Property name="property">actHour2</Property> |
| | | <Property name="trigger">listHour</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">actHour3</Property> |
| | | <Property name="property">actHour3</Property> |
| | | <Property name="trigger">listHour</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | </AutoForm> |
| | | </Container> |
| | | </Children> |
| | | <Tools/> |
| | | </Dialog> |
| | | <UpdateAction id="saveAction"> |
| | | <Property name="dataResolver">snapConfPR#saveUpdate</Property> |
| | | </Children> |
| | | </FieldSet> |
| | | </Container> |
| | | <UpdateAction id="updateConf"> |
| | | <Property name="dataResolver">snapConfPR#updateConf</Property> |
| | | <UpdateItem> |
| | | <Property name="dataSet">dsMain</Property> |
| | | <Property name="dataPath">[#current]</Property> |
| | | <Property name="dataSet">dsConf</Property> |
| | | </UpdateItem> |
| | | </UpdateAction> |
| | | <AjaxAction id="ajaxDelData"> |
| | | <Property name="confirmMessage">确定要删除数据么?</Property> |
| | | <Property name="service">snapConfPR#delete</Property> |
| | | <AjaxAction id="ajaxSnapTime"> |
| | | <Property name="service">snapConfPR#updateActHour</Property> |
| | | </AjaxAction> |
| | | <ListDropDown id="listHour"> |
| | | <Property name="items">0,7,8,9,10,11,12,13,14,15,16,17,18</Property> |
| | | </ListDropDown> |
| | | </View> |
| | | </ViewConfig> |