|
@@ -3,29 +3,319 @@
|
|
|
xmlns:s="library://ns.adobe.com/flex/spark"
|
|
|
xmlns:mx="library://ns.adobe.com/flex/mx"
|
|
|
xmlns:ui="com.jtgh.yjpt.common.component.ui.*"
|
|
|
- width="100%" height="100%" creationComplete="init(event)" xmlns:tj="com.jtgh.yjpt.view.Check.tj.*">
|
|
|
+ xmlns:cus="com.jtgh.yjpt.common.cus.*"
|
|
|
+ xmlns:button="com.jtgh.yjpt.common.component.ui.button.*"
|
|
|
+ width="100%" height="100%"
|
|
|
+ creationComplete="group1_creationCompleteHandler(event)" xmlns:tj="com.jtgh.yjpt.view.Check.tj.*">
|
|
|
|
|
|
<fx:Script>
|
|
|
<![CDATA[
|
|
|
+ import com.jtgh.yjpt.common.BusinessContext;
|
|
|
import com.jtgh.yjpt.common.Global;
|
|
|
import com.jtgh.yjpt.common.util.Constants;
|
|
|
-
|
|
|
+ import com.jtgh.yjpt.common.util.Utils;
|
|
|
+ import com.jtgh.yjpt.model.SystemModel;
|
|
|
+ import com.jtgh.yjpt.vo.sys.MenuVo;
|
|
|
+
|
|
|
+ import mx.charts.events.ChartItemEvent;
|
|
|
+ import mx.collections.ArrayCollection;
|
|
|
+ import mx.controls.dataGridClasses.DataGridColumn;
|
|
|
import mx.events.FlexEvent;
|
|
|
-
|
|
|
- protected function init(event:FlexEvent):void
|
|
|
+ import mx.formatters.DateFormatter;
|
|
|
+ import mx.rpc.events.ResultEvent;
|
|
|
+ import spark.events.IndexChangeEvent;
|
|
|
+ import com.jtgh.yjpt.common.PrintParam;
|
|
|
+ import com.jtgh.yjpt.common.PrintTypes;
|
|
|
+ import com.jtgh.yjpt.common.util.PrintUtil;
|
|
|
+ import mx.events.FlexEvent;
|
|
|
+ import mx.controls.Alert;
|
|
|
+
|
|
|
+ [Bindable]
|
|
|
+ private var list:ArrayCollection;
|
|
|
+ private var max:Number=0;
|
|
|
+ private var type:String ="YYYY";
|
|
|
+
|
|
|
+ [Bindable]
|
|
|
+ private var list2:ArrayCollection;
|
|
|
+ [Bindable]
|
|
|
+ private var szd:String=null;
|
|
|
+
|
|
|
+ /* ----------------------columnChart begin---------------- */
|
|
|
+ //init
|
|
|
+ protected function group1_creationCompleteHandler(event:FlexEvent):void
|
|
|
{
|
|
|
+ this.zc.labelContainer.y-=12;
|
|
|
+ this.dc.labelContainer.y-=12;
|
|
|
+ if(Constants.DEPLOY_MODE_1==Global.deployMode){
|
|
|
+ szd=Global.szd.id.toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ Utils.callRemote("zysqbpController","getDateRange",function(r:ResultEvent):void{
|
|
|
+ var bc:BusinessContext = r.result as BusinessContext;
|
|
|
+ start.dateTime = bc.getAttribute("ks") as Date;
|
|
|
+ end.dateTime = bc.getAttribute("js") as Date;
|
|
|
+ doQuery(start.dateTime,end.dateTime);
|
|
|
+ doQuery2(start.dateTime,end.dateTime);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ private function doQuery(startDate:Date,endDate:Date):void
|
|
|
+ {
|
|
|
+ Utils.callRemote("zcController","countZcDc",function(r:ResultEvent):void
|
|
|
+ {
|
|
|
+ var bc:BusinessContext=new BusinessContext();
|
|
|
+ bc=r.result as BusinessContext;
|
|
|
+ list=bc.getAttribute("records") as ArrayCollection;
|
|
|
+ for each(var o:Object in list)
|
|
|
+ {
|
|
|
+ setMax(o.ZC);
|
|
|
+ setMax(o.DC);
|
|
|
+ if(null==szd)
|
|
|
+ {
|
|
|
+ o.NAME=resourceManager.getString("select",o.NAME);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(max<20){yz.maximum=max+1;}
|
|
|
+ else{yz.maximum=Math.ceil(max*1.05);}
|
|
|
+ },szd,startDate,endDate)
|
|
|
+ }
|
|
|
+ private function getTime():String
|
|
|
+ {
|
|
|
+ var fr:DateFormatter=new DateFormatter();
|
|
|
+ fr.formatString="YYYY.MM.DD";
|
|
|
+ return fr.format(new Date())
|
|
|
+ }
|
|
|
+
|
|
|
+ private function setMax(m:Number):void
|
|
|
+ {
|
|
|
+ max=m>max?m:max;
|
|
|
+ }
|
|
|
+
|
|
|
+ protected function zcOrDc(event:ChartItemEvent):void
|
|
|
+ {
|
|
|
+ var menu:String;
|
|
|
+ if("ZC"==(event.hitData.element as ColumnSeries).yField)
|
|
|
+ {
|
|
|
+ menu="006001";
|
|
|
+ }
|
|
|
+ else if("DC"==(event.hitData.element as ColumnSeries).yField)
|
|
|
+ {
|
|
|
+ menu="006002";
|
|
|
+ }
|
|
|
+
|
|
|
+ var node:MenuVo = getMenuVo(Global.menuList, menu);
|
|
|
+ SystemModel.menuClick(node, event.hitData.item.NAME);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private function getMenuVo(list:ArrayCollection, code:String):MenuVo{
|
|
|
+ for(var i:int=0; i<list.length; i++){
|
|
|
+ var node:MenuVo = list.getItemAt(i) as MenuVo;
|
|
|
+ //trace(node.code);
|
|
|
+ if(code == node.code){
|
|
|
+ return node;
|
|
|
+ }else{
|
|
|
+ if(node.children && node.children.length > 0){
|
|
|
+ var vo:MenuVo = getMenuVo(node.children, code);
|
|
|
+ if(vo){
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+// protected function tj(event:IndexChangeEvent):void
|
|
|
+// {
|
|
|
+// if(0==event.newIndex)
|
|
|
+// {
|
|
|
+// type="YYYY";
|
|
|
+// }else if(1==event.newIndex)
|
|
|
+// {
|
|
|
+// type="YYYYMM";
|
|
|
+// }
|
|
|
+// doQuery();
|
|
|
+// }
|
|
|
+ /* ----------------------columnChart end---------------- */
|
|
|
+
|
|
|
+ /* ----------------------data grid begin------------------ */
|
|
|
+
|
|
|
+// protected function init(event:FlexEvent):void
|
|
|
+// {
|
|
|
+// if(Constants.DEPLOY_MODE_1==Global.deployMode){
|
|
|
+// szd=Global.szd.id.toString();
|
|
|
+// }
|
|
|
+// else
|
|
|
+// doQuery2();
|
|
|
+// }
|
|
|
+
|
|
|
+ private function doQuery2(startDate:Date,endDate:Date):void
|
|
|
+ {
|
|
|
+ Utils.callRemote("zcController","countZdyh",function(r:ResultEvent):void{
|
|
|
+ var bc:BusinessContext=r.result as BusinessContext;
|
|
|
+ list2=bc.getAttribute("records") as ArrayCollection;
|
|
|
+ var hj:Object=new Object;
|
|
|
+ hj.type="hj";
|
|
|
+ hj.NAME="合计";
|
|
|
+ hj.ZCNUM=0;
|
|
|
+ hj.DCNUM=0;
|
|
|
+ hj.DCZGNUM=0;
|
|
|
+ hj.ZCZGNUM=0;
|
|
|
+ for each(var o:Object in list2)
|
|
|
+ {
|
|
|
+ if(null==szd){
|
|
|
+ o.NAME=resourceManager.getString("select",o.NAME);
|
|
|
+ }
|
|
|
+ hj.ZCNUM+=Number(o.ZCNUM);
|
|
|
+ hj.DCNUM+=Number(o.DCNUM);
|
|
|
+ hj.DCZGNUM+=Number(o.DCZGNUM);
|
|
|
+ hj.ZCZGNUM+=Number(o.ZCZGNUM);
|
|
|
+ }
|
|
|
+ list2.addItem(hj);
|
|
|
+ },szd,startDate,endDate);
|
|
|
+ }
|
|
|
+
|
|
|
+ /* private function getTime():String
|
|
|
+ {
|
|
|
+ var fr:DateFormatter=new DateFormatter();
|
|
|
+ fr.formatString="YYYY.MM.DD";
|
|
|
+ return fr.format(new Date())
|
|
|
+ } */
|
|
|
+
|
|
|
+// protected function tj2(event:IndexChangeEvent):void
|
|
|
+// {
|
|
|
+// if(0==event.newIndex)
|
|
|
+// {
|
|
|
+// type="YYYY";
|
|
|
+// }else if(1==event.newIndex)
|
|
|
+// {
|
|
|
+// type="YYYYMM";
|
|
|
+// }
|
|
|
+// doQuery2();
|
|
|
+// }
|
|
|
+
|
|
|
+ protected function doPrint(event:MouseEvent):void
|
|
|
+ {
|
|
|
+ var param:PrintParam=new PrintParam("dcTj");
|
|
|
+ param.setParameter("szd", null);
|
|
|
+ param.setParameter("type",type);
|
|
|
+ PrintUtil.doPrint1(param);
|
|
|
+ }
|
|
|
+ protected function doPrint1(event:MouseEvent):void
|
|
|
+ {
|
|
|
+ var param:PrintParam=new PrintParam(PrintTypes.ZCDCTJ);
|
|
|
+ param.setParameter("type", type);
|
|
|
+ param.format="xls";
|
|
|
+ PrintUtil.doPrint(param);
|
|
|
+ }
|
|
|
+ /* ----------------------data grid end------------------ */
|
|
|
+ //统计查询
|
|
|
+ public function search():void
|
|
|
+ {
|
|
|
+ var tjsjq:Date=start.dateTime;
|
|
|
+ var tjsjz:Date=end.dateTime;
|
|
|
+ if(tjsjq==null||tjsjz==null){
|
|
|
+ Alert.show("请选择统计的时间区间","提示");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //柱状图
|
|
|
+ doQuery(start.dateTime,end.dateTime);
|
|
|
+ //加载左下侧统计列表数据
|
|
|
+ doQuery2(start.dateTime,end.dateTime);
|
|
|
}
|
|
|
-
|
|
|
|
|
|
]]>
|
|
|
</fx:Script>
|
|
|
|
|
|
<s:VGroup width="100%" height="100%">
|
|
|
- <tj:Zcdcfb width="100%" height="230"/>
|
|
|
+ <!-- 柱状图 -->
|
|
|
+ <!--<tj:Zcdcfb width="100%" height="230"/>-->
|
|
|
+ <s:VGroup width="100%" height="100%">
|
|
|
+ <s:BorderContainer borderVisible="false" height="32" backgroundColor="#23A5B8" width="100%">
|
|
|
+ <s:layout>
|
|
|
+ <s:HorizontalLayout horizontalAlign="center" verticalAlign="middle"/>
|
|
|
+ </s:layout>
|
|
|
+ <s:Label text="自查隐患/督查隐患数量分布" width="100%" fontFamily="宋体" fontSize="14" color="#ffffff" fontWeight="bold" paddingLeft="10"/>
|
|
|
+ <!--<cus:QComboBox width="100" comboxClass="TjTimeSelect" change="tj(event)" selectedIndex="0" text="{resourceManager.getString('select','tj.year')}"/>-->
|
|
|
+ </s:BorderContainer>
|
|
|
+ <s:HGroup width="100%" height="100%">
|
|
|
+ <s:VGroup height="100%">
|
|
|
+ <s:Label text="单位:个"/>
|
|
|
+ <mx:Legend right="4" top="4" dataProvider="{colChart}"/>
|
|
|
+ <s:Spacer height="100%"/>
|
|
|
+ <!--<s:Label text="截止{getTime()}"/>-->
|
|
|
+ <s:Spacer height="15"/>
|
|
|
+ </s:VGroup>
|
|
|
+ <mx:ColumnChart id="colChart" width="95%"
|
|
|
+ showDataTips="true" height="200" dataProvider="{list}" itemClick="zcOrDc(event)" >
|
|
|
+ <mx:horizontalAxis>
|
|
|
+ <mx:CategoryAxis id="xx" categoryField="NAME" />
|
|
|
+ </mx:horizontalAxis>
|
|
|
+ <mx:verticalAxis>
|
|
|
+ <mx:LinearAxis id="yz"/>
|
|
|
+ </mx:verticalAxis>
|
|
|
+ <!--<mx:horizontalAxisRenderers>
|
|
|
+ <mx:AxisRenderer axis="{xx}" buttonMode="true" />
|
|
|
+ </mx:horizontalAxisRenderers>-->
|
|
|
+ <mx:series>
|
|
|
+ <mx:ColumnSeries displayName="自查隐患数量" yField="ZC" id="zc" maxColumnWidth="20" labelPosition="inside" labelAlign="top" >
|
|
|
+ <mx:fill>
|
|
|
+ <s:SolidColor color="#30BAAA"/>
|
|
|
+ </mx:fill>
|
|
|
+ </mx:ColumnSeries>
|
|
|
+ <mx:ColumnSeries displayName="督查隐患数量" yField="DC" id="dc" maxColumnWidth="20" chromeColor="#F9837F" labelPosition="inside" labelAlign="top" >
|
|
|
+ <mx:fill>
|
|
|
+ <s:SolidColor color="#F9847F"/>
|
|
|
+ </mx:fill>
|
|
|
+ </mx:ColumnSeries>
|
|
|
+ </mx:series>
|
|
|
+ </mx:ColumnChart>
|
|
|
+ </s:HGroup>
|
|
|
+ </s:VGroup>
|
|
|
+
|
|
|
+
|
|
|
<s:Spacer height="10"/>
|
|
|
<s:HGroup width="100%" height="316">
|
|
|
- <tj:Zcdctj width="50%" height="100%" visible="{Constants.DEPLOY_MODE_0==Global.deployMode}" includeInLayout="{Constants.DEPLOY_MODE_0==Global.deployMode}"/>
|
|
|
+
|
|
|
+ <!-- 左下统计列表 province -->
|
|
|
+ <!--<tj:Zcdctj width="50%" height="100%" visible="{Constants.DEPLOY_MODE_0==Global.deployMode}" includeInLayout="{Constants.DEPLOY_MODE_0==Global.deployMode}"/>-->
|
|
|
+ <s:VGroup width="100%">
|
|
|
+ <s:BorderContainer borderVisible="false" height="55" backgroundColor="#23A5B8" width="100%">
|
|
|
+ <s:layout>
|
|
|
+ <s:HorizontalLayout horizontalAlign="center" verticalAlign="middle"/>
|
|
|
+ </s:layout>
|
|
|
+ <s:Label text="{null==szd?'全省':'本地'}自查/督查统计" width="100%" fontFamily="宋体" fontSize="14" color="#ffffff" fontWeight="bold" paddingLeft="10"/>
|
|
|
+ <!--<cus:QComboBox width="100" comboxClass="TjTimeSelect" change="tj2(event)" selectedIndex="0" text="{resourceManager.getString('select','tj.year')}"/>-->
|
|
|
+ <s:HGroup width="190" verticalAlign="middle" horizontalAlign="center">
|
|
|
+ <ui:DateTime id="start" width="180"/>
|
|
|
+ </s:HGroup>
|
|
|
+ <s:HGroup width="13" verticalAlign="middle" horizontalAlign="center">
|
|
|
+ <s:Label text="~" fontFamily="宋体" fontSize="14" color="#ffffff" fontWeight="bold" paddingLeft="10" paddingRight="10"/>
|
|
|
+ </s:HGroup>
|
|
|
+ <s:HGroup width="190" verticalAlign="middle" horizontalAlign="center">
|
|
|
+ <ui:DateTime id="end" width="180"/>
|
|
|
+ </s:HGroup>
|
|
|
+ <button:IconButton type="query" id="query" click="search()" toolTip="{resourceManager.getString('common','btn.query')}"/>
|
|
|
+ <s:Spacer width="5"/>
|
|
|
+ <!--<s:Image id="icon" buttonMode="true" width="30" height="30" click="doPrint(event)" source="resource/yjpt/list/print.png"/>-->
|
|
|
+ </s:BorderContainer>
|
|
|
+ <mx:DataGrid id="grid" width="100%" dataProvider="{list2}" rowCount="10" textAlign="center" verticalAlign="middle" sortableColumns="false">
|
|
|
+ <mx:columns>
|
|
|
+ <mx:DataGridColumn headerText="所在地" dataField="NAME" itemRenderer="com.jtgh.yjpt.common.component.renderer.TjDataGridItemRenderer" />
|
|
|
+ <mx:DataGridColumn headerText="自查隐患数" dataField="ZCNUM" itemRenderer="com.jtgh.yjpt.common.component.renderer.TjDataGridItemRenderer"/>
|
|
|
+ <mx:DataGridColumn headerText="整改数" dataField="ZCZGNUM" itemRenderer="com.jtgh.yjpt.common.component.renderer.TjDataGridItemRenderer"/>
|
|
|
+ <mx:DataGridColumn headerText="督查隐患数" dataField="DCNUM" itemRenderer="com.jtgh.yjpt.common.component.renderer.TjDataGridItemRenderer"/>
|
|
|
+ <mx:DataGridColumn headerText="整改数" dataField="DCZGNUM" itemRenderer="com.jtgh.yjpt.common.component.renderer.TjDataGridItemRenderer"/>
|
|
|
+ </mx:columns>
|
|
|
+ </mx:DataGrid>
|
|
|
+ </s:VGroup>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 左下统计列表 city -->
|
|
|
<tj:Sjzcdctj width="50%" height="100%" visible="{Constants.DEPLOY_MODE_1==Global.deployMode}" includeInLayout="{Constants.DEPLOY_MODE_1==Global.deployMode}"/>
|
|
|
+ <!-- 右下角折线图 -->
|
|
|
<tj:Zcdcqs width="50%" height="100%"/>
|
|
|
</s:HGroup>
|
|
|
<s:Spacer height="10"/>
|