<?xml version="1.0" encoding="UTF-8"?>
|
<ViewConfig>
|
<Arguments/>
|
<Context/>
|
<Model/>
|
<View layout="padding:10">
|
<ClientEvent name="onReady">
|
/**
|
* 查询
|
*/
|
query = function(){
|
view.get("#dsMain").flushAsync();
|
}
</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("#dsMain").insert();
|
view.get("#dialog1").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 select = view.get("#dataGridMain").get("selection");
|
if(select){
|
view.get("#dialog1").show();
|
}else{
|
$notify("请选择需要修改的数据……");
|
}</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">
|
var select = view.get("#dataGridMain").get("selection");
|
if(select){
|
view.get("#ajaxDel").set("parameter",select).execute(function(result){
|
select.remove();
|
});
|
}else{
|
$notify("请选择需要删除的仓库……");
|
}
|

|
</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("#dsMain.data:#");
|
if(data){
|
$confirm("确认将" + data.get("name") + "推送至大屏?",function(){
|
view.get("#ajaxAction1").set("parameter",data).execute(function(){
|
$notify("推送成功!");
|
view.get("#dsMain").flushAsync ();
|
});
|
});
|
}else{
|
$notify("请选择一条标语");
|
}
|

|
</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("#dataGridMain").set("selection",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("#uaMain").execute(function(result){
|
if(result){
|
$alert(result);
|
}else{
|
$notify("保存成功!!");
|
view.get("#dialog1").hide();
|
query();
|
}
|
});
|

|
</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();
|
view.get("#dialog1").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">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>
|