├── .gitignore ├── readmeImages ├── ak.png ├── data.png ├── nodata.png ├── page.png ├── fis3install.png ├── fis3release.png ├── npminstall.png └── serverstart.png ├── static ├── images │ ├── earth.png │ ├── logo.png │ ├── pause.png │ ├── place.png │ ├── play.png │ ├── quick.png │ ├── slow.png │ ├── track.png │ ├── zoom.png │ ├── addicon.png │ ├── backto.png │ ├── caroff.png │ ├── carrun.png │ ├── cluster.png │ ├── editbtn.png │ ├── exitpop.png │ ├── gift_2x.png │ ├── infobox.png │ ├── loading.gif │ ├── logo_2x.png │ ├── monitor.png │ ├── normal.png │ ├── play_2x.png │ ├── pointer.png │ ├── slow_2x.png │ ├── warning.png │ ├── analysison.png │ ├── caroff_2x.png │ ├── caroffeast.png │ ├── caroffwest.png │ ├── carrun_2x.png │ ├── carruneast.png │ ├── carrunwest.png │ ├── carstatic.png │ ├── earth_2x.png │ ├── endpoint.png │ ├── ensurebtn.png │ ├── entitydesc.png │ ├── entityname.png │ ├── gotrack_2x.png │ ├── lastpageon.png │ ├── monitor_2x.png │ ├── nextpageon.png │ ├── normal_2x.png │ ├── nowpoint.png │ ├── othertype.png │ ├── pause_2x.png │ ├── progress.png │ ├── quick_2x.png │ ├── searchicon.png │ ├── startpoint.png │ ├── tableleft.png │ ├── tableright.png │ ├── togglein.png │ ├── toggleout.png │ ├── track_2x.png │ ├── trackpoint.png │ ├── trafficoff.png │ ├── trafficon.png │ ├── zoominicon.png │ ├── analysisoff.png │ ├── batchloading.gif │ ├── caroffnorth.png │ ├── caroffsouth.png │ ├── carrunnorth.png │ ├── carrunsouth.png │ ├── carstatic_2x.png │ ├── clearsearch.png │ ├── consoleback.png │ ├── databack_2x.png │ ├── lastpageoff.png │ ├── loginiconup.png │ ├── loginmanage.png │ ├── nextpageoff.png │ ├── playhover_2x.png │ ├── runnigpoint.png │ ├── slowhover_2x.png │ ├── speedcontrol.png │ ├── tablebottom.png │ ├── togglein_2x.png │ ├── toggleout_2x.png │ ├── trackblue_2x.png │ ├── trackpointon.png │ ├── trafficon_2x.png │ ├── analysisheader.png │ ├── analysisiconoff.png │ ├── analysisiconon.png │ ├── analysisoff_2x.png │ ├── analysisoffdown.png │ ├── analysisoffup.png │ ├── analysison_2x.png │ ├── carstaticeast.png │ ├── carstaticnorth.png │ ├── carstaticsouth.png │ ├── carstaticwest.png │ ├── clearsearch_2x.png │ ├── closeinfowindow.png │ ├── loginicondown.png │ ├── monitorblue_2x.png │ ├── othertypestatic.png │ ├── pausehover_2x.png │ ├── processiconoff.png │ ├── processiconon.png │ ├── qrcode_android.png │ ├── quickhover_2x.png │ ├── searchicon_2x.png │ ├── speedcontrol_2x.png │ ├── trafficoff_2x.png │ ├── analysisiconon_2x.png │ ├── othertypeoffline.png │ ├── processiconoff_2x.png │ ├── processiconon_2x.png │ ├── analysisiconoff_2x.png │ ├── analysisprocesscontent.png │ └── analysisbehaviorcontent.png ├── icheck-1.x │ ├── square │ │ ├── aero.png │ │ ├── blue.png │ │ ├── grey.png │ │ ├── pink.png │ │ ├── red.png │ │ ├── bluen.png │ │ ├── green.png │ │ ├── orange.png │ │ ├── purple.png │ │ ├── red@2x.png │ │ ├── square.png │ │ ├── yellow.png │ │ ├── aero@2x.png │ │ ├── blue@2x.png │ │ ├── bluen@2x.png │ │ ├── green@2x.png │ │ ├── grey@2x.png │ │ ├── orange@2x.png │ │ ├── pink@2x.png │ │ ├── purple@2x.png │ │ ├── square@2x.png │ │ ├── yellow@2x.png │ │ ├── square.css │ │ ├── red.css │ │ ├── aero.css │ │ ├── grey.css │ │ ├── pink.css │ │ ├── blue.css │ │ ├── green.css │ │ ├── orange.css │ │ ├── purple.css │ │ └── yellow.css │ └── icheck.min.js ├── bootstrap │ ├── img │ │ ├── glyphicons-halflings.png │ │ └── glyphicons-halflings-white.png │ └── js │ │ └── bootstrap-datetimepicker.zh-CN.js └── javascript │ ├── CanvasLayer.js │ ├── jquery.cookie.js │ ├── Polyfill.js │ └── mod.js ├── script ├── modules │ ├── trackcontrol.zip │ ├── entitycontrol │ │ ├── views │ │ │ ├── page.js │ │ │ ├── control.js │ │ │ ├── bottomcontrol.js │ │ │ ├── remove.js │ │ │ ├── entitycontrol.js │ │ │ ├── selectall.js │ │ │ └── search.js │ │ └── actions │ │ │ └── entityAction.js │ ├── common │ │ ├── actions │ │ │ └── commonAction.js │ │ ├── views │ │ │ ├── header.js │ │ │ ├── title.js │ │ │ ├── manager_content.js │ │ │ └── tabs.js │ │ └── stores │ │ │ └── commonStore.js │ └── trackcontrol │ │ ├── views │ │ ├── manage.js │ │ ├── managetoggle.js │ │ ├── map.js │ │ ├── trackcontrol.js │ │ ├── managetitle.js │ │ ├── monitor.js │ │ ├── managetab.js │ │ ├── track.js │ │ ├── trackdatetime.js │ │ ├── monitortab.js │ │ ├── boundcontrol.js │ │ ├── tracksearch.js │ │ ├── monitorpage.js │ │ ├── monitorsearch.js │ │ ├── monitorofflinecontent.js │ │ ├── monitoronlinecontent.js │ │ ├── trackpages.js │ │ ├── monitoronlinepage.js │ │ ├── monitorofflinepage.js │ │ └── monitorallpage.js │ │ └── actions │ │ └── trackAction.js └── common │ ├── urls.js │ └── commonfun.js ├── component.json ├── components ├── react │ ├── component.json │ ├── .hook.js │ └── README.md └── react-dom │ ├── component.json │ ├── react-dom.js │ ├── react-dom-server.js │ └── README.md ├── package.json ├── fis-conf.js ├── LICENSE └── manager.html /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /readmeImages/ak.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/readmeImages/ak.png -------------------------------------------------------------------------------- /readmeImages/data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/readmeImages/data.png -------------------------------------------------------------------------------- /readmeImages/nodata.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/readmeImages/nodata.png -------------------------------------------------------------------------------- /readmeImages/page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/readmeImages/page.png -------------------------------------------------------------------------------- /static/images/earth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/earth.png -------------------------------------------------------------------------------- /static/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/logo.png -------------------------------------------------------------------------------- /static/images/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/pause.png -------------------------------------------------------------------------------- /static/images/place.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/place.png -------------------------------------------------------------------------------- /static/images/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/play.png -------------------------------------------------------------------------------- /static/images/quick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/quick.png -------------------------------------------------------------------------------- /static/images/slow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/slow.png -------------------------------------------------------------------------------- /static/images/track.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/track.png -------------------------------------------------------------------------------- /static/images/zoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/zoom.png -------------------------------------------------------------------------------- /static/images/addicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/addicon.png -------------------------------------------------------------------------------- /static/images/backto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/backto.png -------------------------------------------------------------------------------- /static/images/caroff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/caroff.png -------------------------------------------------------------------------------- /static/images/carrun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/carrun.png -------------------------------------------------------------------------------- /static/images/cluster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/cluster.png -------------------------------------------------------------------------------- /static/images/editbtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/editbtn.png -------------------------------------------------------------------------------- /static/images/exitpop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/exitpop.png -------------------------------------------------------------------------------- /static/images/gift_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/gift_2x.png -------------------------------------------------------------------------------- /static/images/infobox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/infobox.png -------------------------------------------------------------------------------- /static/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/loading.gif -------------------------------------------------------------------------------- /static/images/logo_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/logo_2x.png -------------------------------------------------------------------------------- /static/images/monitor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/monitor.png -------------------------------------------------------------------------------- /static/images/normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/normal.png -------------------------------------------------------------------------------- /static/images/play_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/play_2x.png -------------------------------------------------------------------------------- /static/images/pointer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/pointer.png -------------------------------------------------------------------------------- /static/images/slow_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/slow_2x.png -------------------------------------------------------------------------------- /static/images/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/warning.png -------------------------------------------------------------------------------- /readmeImages/fis3install.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/readmeImages/fis3install.png -------------------------------------------------------------------------------- /readmeImages/fis3release.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/readmeImages/fis3release.png -------------------------------------------------------------------------------- /readmeImages/npminstall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/readmeImages/npminstall.png -------------------------------------------------------------------------------- /readmeImages/serverstart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/readmeImages/serverstart.png -------------------------------------------------------------------------------- /static/images/analysison.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/analysison.png -------------------------------------------------------------------------------- /static/images/caroff_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/caroff_2x.png -------------------------------------------------------------------------------- /static/images/caroffeast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/caroffeast.png -------------------------------------------------------------------------------- /static/images/caroffwest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/caroffwest.png -------------------------------------------------------------------------------- /static/images/carrun_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/carrun_2x.png -------------------------------------------------------------------------------- /static/images/carruneast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/carruneast.png -------------------------------------------------------------------------------- /static/images/carrunwest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/carrunwest.png -------------------------------------------------------------------------------- /static/images/carstatic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/carstatic.png -------------------------------------------------------------------------------- /static/images/earth_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/earth_2x.png -------------------------------------------------------------------------------- /static/images/endpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/endpoint.png -------------------------------------------------------------------------------- /static/images/ensurebtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/ensurebtn.png -------------------------------------------------------------------------------- /static/images/entitydesc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/entitydesc.png -------------------------------------------------------------------------------- /static/images/entityname.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/entityname.png -------------------------------------------------------------------------------- /static/images/gotrack_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/gotrack_2x.png -------------------------------------------------------------------------------- /static/images/lastpageon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/lastpageon.png -------------------------------------------------------------------------------- /static/images/monitor_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/monitor_2x.png -------------------------------------------------------------------------------- /static/images/nextpageon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/nextpageon.png -------------------------------------------------------------------------------- /static/images/normal_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/normal_2x.png -------------------------------------------------------------------------------- /static/images/nowpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/nowpoint.png -------------------------------------------------------------------------------- /static/images/othertype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/othertype.png -------------------------------------------------------------------------------- /static/images/pause_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/pause_2x.png -------------------------------------------------------------------------------- /static/images/progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/progress.png -------------------------------------------------------------------------------- /static/images/quick_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/quick_2x.png -------------------------------------------------------------------------------- /static/images/searchicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/searchicon.png -------------------------------------------------------------------------------- /static/images/startpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/startpoint.png -------------------------------------------------------------------------------- /static/images/tableleft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/tableleft.png -------------------------------------------------------------------------------- /static/images/tableright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/tableright.png -------------------------------------------------------------------------------- /static/images/togglein.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/togglein.png -------------------------------------------------------------------------------- /static/images/toggleout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/toggleout.png -------------------------------------------------------------------------------- /static/images/track_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/track_2x.png -------------------------------------------------------------------------------- /static/images/trackpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/trackpoint.png -------------------------------------------------------------------------------- /static/images/trafficoff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/trafficoff.png -------------------------------------------------------------------------------- /static/images/trafficon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/trafficon.png -------------------------------------------------------------------------------- /static/images/zoominicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/zoominicon.png -------------------------------------------------------------------------------- /static/images/analysisoff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/analysisoff.png -------------------------------------------------------------------------------- /static/images/batchloading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/batchloading.gif -------------------------------------------------------------------------------- /static/images/caroffnorth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/caroffnorth.png -------------------------------------------------------------------------------- /static/images/caroffsouth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/caroffsouth.png -------------------------------------------------------------------------------- /static/images/carrunnorth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/carrunnorth.png -------------------------------------------------------------------------------- /static/images/carrunsouth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/carrunsouth.png -------------------------------------------------------------------------------- /static/images/carstatic_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/carstatic_2x.png -------------------------------------------------------------------------------- /static/images/clearsearch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/clearsearch.png -------------------------------------------------------------------------------- /static/images/consoleback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/consoleback.png -------------------------------------------------------------------------------- /static/images/databack_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/databack_2x.png -------------------------------------------------------------------------------- /static/images/lastpageoff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/lastpageoff.png -------------------------------------------------------------------------------- /static/images/loginiconup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/loginiconup.png -------------------------------------------------------------------------------- /static/images/loginmanage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/loginmanage.png -------------------------------------------------------------------------------- /static/images/nextpageoff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/nextpageoff.png -------------------------------------------------------------------------------- /static/images/playhover_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/playhover_2x.png -------------------------------------------------------------------------------- /static/images/runnigpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/runnigpoint.png -------------------------------------------------------------------------------- /static/images/slowhover_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/slowhover_2x.png -------------------------------------------------------------------------------- /static/images/speedcontrol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/speedcontrol.png -------------------------------------------------------------------------------- /static/images/tablebottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/tablebottom.png -------------------------------------------------------------------------------- /static/images/togglein_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/togglein_2x.png -------------------------------------------------------------------------------- /static/images/toggleout_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/toggleout_2x.png -------------------------------------------------------------------------------- /static/images/trackblue_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/trackblue_2x.png -------------------------------------------------------------------------------- /static/images/trackpointon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/trackpointon.png -------------------------------------------------------------------------------- /static/images/trafficon_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/trafficon_2x.png -------------------------------------------------------------------------------- /script/modules/trackcontrol.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/script/modules/trackcontrol.zip -------------------------------------------------------------------------------- /static/icheck-1.x/square/aero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/icheck-1.x/square/aero.png -------------------------------------------------------------------------------- /static/icheck-1.x/square/blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/icheck-1.x/square/blue.png -------------------------------------------------------------------------------- /static/icheck-1.x/square/grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/icheck-1.x/square/grey.png -------------------------------------------------------------------------------- /static/icheck-1.x/square/pink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/icheck-1.x/square/pink.png -------------------------------------------------------------------------------- /static/icheck-1.x/square/red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/icheck-1.x/square/red.png -------------------------------------------------------------------------------- /static/images/analysisheader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/analysisheader.png -------------------------------------------------------------------------------- /static/images/analysisiconoff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/analysisiconoff.png -------------------------------------------------------------------------------- /static/images/analysisiconon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/analysisiconon.png -------------------------------------------------------------------------------- /static/images/analysisoff_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/analysisoff_2x.png -------------------------------------------------------------------------------- /static/images/analysisoffdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/analysisoffdown.png -------------------------------------------------------------------------------- /static/images/analysisoffup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/analysisoffup.png -------------------------------------------------------------------------------- /static/images/analysison_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/analysison_2x.png -------------------------------------------------------------------------------- /static/images/carstaticeast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/carstaticeast.png -------------------------------------------------------------------------------- /static/images/carstaticnorth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/carstaticnorth.png -------------------------------------------------------------------------------- /static/images/carstaticsouth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/carstaticsouth.png -------------------------------------------------------------------------------- /static/images/carstaticwest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/carstaticwest.png -------------------------------------------------------------------------------- /static/images/clearsearch_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/clearsearch_2x.png -------------------------------------------------------------------------------- /static/images/closeinfowindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/closeinfowindow.png -------------------------------------------------------------------------------- /static/images/loginicondown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/loginicondown.png -------------------------------------------------------------------------------- /static/images/monitorblue_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/monitorblue_2x.png -------------------------------------------------------------------------------- /static/images/othertypestatic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/othertypestatic.png -------------------------------------------------------------------------------- /static/images/pausehover_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/pausehover_2x.png -------------------------------------------------------------------------------- /static/images/processiconoff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/processiconoff.png -------------------------------------------------------------------------------- /static/images/processiconon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/processiconon.png -------------------------------------------------------------------------------- /static/images/qrcode_android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/qrcode_android.png -------------------------------------------------------------------------------- /static/images/quickhover_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/quickhover_2x.png -------------------------------------------------------------------------------- /static/images/searchicon_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/searchicon_2x.png -------------------------------------------------------------------------------- /static/images/speedcontrol_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/speedcontrol_2x.png -------------------------------------------------------------------------------- /static/images/trafficoff_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/trafficoff_2x.png -------------------------------------------------------------------------------- /static/icheck-1.x/square/bluen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/icheck-1.x/square/bluen.png -------------------------------------------------------------------------------- /static/icheck-1.x/square/green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/icheck-1.x/square/green.png -------------------------------------------------------------------------------- /static/icheck-1.x/square/orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/icheck-1.x/square/orange.png -------------------------------------------------------------------------------- /static/icheck-1.x/square/purple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/icheck-1.x/square/purple.png -------------------------------------------------------------------------------- /static/icheck-1.x/square/red@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/icheck-1.x/square/red@2x.png -------------------------------------------------------------------------------- /static/icheck-1.x/square/square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/icheck-1.x/square/square.png -------------------------------------------------------------------------------- /static/icheck-1.x/square/yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/icheck-1.x/square/yellow.png -------------------------------------------------------------------------------- /static/images/analysisiconon_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/analysisiconon_2x.png -------------------------------------------------------------------------------- /static/images/othertypeoffline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/othertypeoffline.png -------------------------------------------------------------------------------- /static/images/processiconoff_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/processiconoff_2x.png -------------------------------------------------------------------------------- /static/images/processiconon_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/processiconon_2x.png -------------------------------------------------------------------------------- /static/icheck-1.x/square/aero@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/icheck-1.x/square/aero@2x.png -------------------------------------------------------------------------------- /static/icheck-1.x/square/blue@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/icheck-1.x/square/blue@2x.png -------------------------------------------------------------------------------- /static/icheck-1.x/square/bluen@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/icheck-1.x/square/bluen@2x.png -------------------------------------------------------------------------------- /static/icheck-1.x/square/green@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/icheck-1.x/square/green@2x.png -------------------------------------------------------------------------------- /static/icheck-1.x/square/grey@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/icheck-1.x/square/grey@2x.png -------------------------------------------------------------------------------- /static/icheck-1.x/square/orange@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/icheck-1.x/square/orange@2x.png -------------------------------------------------------------------------------- /static/icheck-1.x/square/pink@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/icheck-1.x/square/pink@2x.png -------------------------------------------------------------------------------- /static/icheck-1.x/square/purple@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/icheck-1.x/square/purple@2x.png -------------------------------------------------------------------------------- /static/icheck-1.x/square/square@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/icheck-1.x/square/square@2x.png -------------------------------------------------------------------------------- /static/icheck-1.x/square/yellow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/icheck-1.x/square/yellow@2x.png -------------------------------------------------------------------------------- /static/images/analysisiconoff_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/analysisiconoff_2x.png -------------------------------------------------------------------------------- /static/images/analysisprocesscontent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/analysisprocesscontent.png -------------------------------------------------------------------------------- /script/modules/entitycontrol/views/page.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/script/modules/entitycontrol/views/page.js -------------------------------------------------------------------------------- /static/images/analysisbehaviorcontent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/images/analysisbehaviorcontent.png -------------------------------------------------------------------------------- /static/bootstrap/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/bootstrap/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /static/bootstrap/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu-openmap-trace/web-demo-v3/HEAD/static/bootstrap/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /component.json: -------------------------------------------------------------------------------- 1 | { 2 | "protocol": "github", 3 | "gihub": { 4 | "author": "fis-components" 5 | }, 6 | "dependencies": [ 7 | "react", 8 | "react-dom" 9 | ] 10 | } -------------------------------------------------------------------------------- /script/modules/common/actions/commonAction.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 公共Reflux Actoin 3 | * @author 崔健 cuijian03@baidu.com 2016.08.20 4 | */ 5 | 6 | 7 | var CommonAction = Reflux.createActions([ 8 | // 切换轨迹管理台和设备管理台 9 | 'switchtab' 10 | ]); 11 | 12 | export default CommonAction -------------------------------------------------------------------------------- /components/react/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react", 3 | "description": "React is a JavaScript library for building user interfaces.", 4 | "repos": "https://github.com/facebook/react.git", 5 | "main": "react", 6 | "tag": "master", 7 | "reposType": "npm", 8 | "dependencies": {}, 9 | "hook": ".hook.js", 10 | "paths": { 11 | "dist": "." 12 | }, 13 | "version": "15.1.0" 14 | } -------------------------------------------------------------------------------- /components/react-dom/component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-dom", 3 | "description": "React package for working with the DOM.", 4 | "repos": "https://github.com/facebook/react.git", 5 | "main": "react-dom", 6 | "tag": "master", 7 | "reposType": "npm", 8 | "dependencies": { 9 | "react": "^15.1.0-alpha.1" 10 | }, 11 | "paths": { 12 | "dist": "." 13 | }, 14 | "version": "15.1.0" 15 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "trace-web-v3", 3 | "version": "1.0.0", 4 | "description": "baidu openmap trace web", 5 | "main": "fis-conf.js", 6 | "dependencies": { 7 | "fis-parser-babel-5.x": "^1.4.0", 8 | "fis3-postpackager-loader": "^2.1.3", 9 | "fis3-hook-commonjs": "^0.1.25", 10 | "fis3-hook-node_modules": "^2.2.8" 11 | }, 12 | "devDependencies": {}, 13 | "scripts": { 14 | "test": "echo \"Error: no test specified\" && exit 1" 15 | }, 16 | "author": "cuijian", 17 | "license": "ISC" 18 | } 19 | -------------------------------------------------------------------------------- /script/modules/entitycontrol/views/control.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 页面检索添加栏 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.20 4 | */ 5 | import React, { Component } from 'react' 6 | import { render } from 'react-dom' 7 | import Search from 'search' 8 | 9 | var Control = React.createClass({ 10 | render: function () { 11 | return ( 12 |
13 | 14 |
15 | ) 16 | } 17 | }); 18 | 19 | export default Control; 20 | -------------------------------------------------------------------------------- /script/modules/common/views/header.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 设备管理台头部 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.20 4 | */ 5 | 6 | import React, { Component } from 'react' 7 | import { render } from 'react-dom' 8 | import Title from 'title' 9 | import Tabs from 'tabs' 10 | 11 | var Header = React.createClass({ 12 | render: function () { 13 | return ( 14 |
15 | 16 | <Tabs /> 17 | </div> 18 | ) 19 | } 20 | }); 21 | 22 | export default Header; 23 | -------------------------------------------------------------------------------- /script/modules/common/views/title.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 页标题 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.20 4 | */ 5 | 6 | import React, { Component } from 'react' 7 | import { render } from 'react-dom' 8 | 9 | var Title = React.createClass({ 10 | render: function () { 11 | var logo = __uri('/static/images/logo_2x.png'); 12 | return ( 13 | <div className="title"> 14 | <img src={logo} className="logo" /> 15 | <span className="headName">百度鹰眼</span> 16 | </div> 17 | ) 18 | } 19 | }); 20 | 21 | export default Title; 22 | -------------------------------------------------------------------------------- /components/react/.hook.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | 3 | module.exports = function(json, files) { 4 | var hasAddons = false; 5 | 6 | Object.keys(files).every(function(subpath) { 7 | var cName = path.basename(path.dirname(subpath)); 8 | 9 | // some thing like `react-addons-create-fragment` 10 | if (cName.substring(0, 13) === 'react-addons-') { 11 | hasAddons = true; 12 | return false; 13 | } 14 | 15 | return true; 16 | }); 17 | 18 | // 自动切换到 react-with-addons 如果依赖列表中有 react-addons 的话。 19 | // 实在不想再把 react 给拆了。 20 | if (hasAddons) { 21 | json.main = 'react-with-addons.js'; 22 | } 23 | }; -------------------------------------------------------------------------------- /fis-conf.js: -------------------------------------------------------------------------------- 1 | fis.match('/{script,components}/**.{js,jsx}', { 2 | isMod: true 3 | }); 4 | 5 | fis.match('script/modules/common/views/manager_content.js', { 6 | isMod: false 7 | }); 8 | 9 | fis.hook('commonjs'); 10 | 11 | fis.match('::package', { 12 | postpackager: fis.plugin('loader') 13 | }); 14 | 15 | fis.match('{/{script,components}/**.js,*.jsx}', { 16 | parser: fis.plugin('babel-5.x', { 17 | sourceMaps: true 18 | }), 19 | rExt: '.js' 20 | }); 21 | 22 | //此行以上内容随意改动会引发错误 23 | 24 | fis.media('demo').match('*', { 25 | 26 | }).match('*.{js,css,png}', { 27 | useHash: true 28 | }); 29 | 30 | -------------------------------------------------------------------------------- /script/modules/common/stores/commonStore.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 公共Reflux Store 3 | * @author 崔健 cuijian03@baidu.com 2016.08.20 4 | */ 5 | 6 | import CommonAction from '../actions/commonAction' 7 | import Urls from '../../../common/urls' 8 | 9 | var CommonStore = Reflux.createStore({ 10 | listenables: [CommonAction], 11 | data: { 12 | // 当前标签页 0为轨迹监控,1为终端管理 13 | currentIndex: 0 14 | }, 15 | /** 16 | * 响应Action switchtab,变更页签 17 | * 18 | * @param {number} index 要变更到的tab 19 | */ 20 | onSwitchtab: function(index) { 21 | this.trigger('switchtab', index); 22 | } 23 | }); 24 | 25 | export default CommonStore -------------------------------------------------------------------------------- /script/modules/entitycontrol/views/bottomcontrol.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 页面底部 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.20 4 | */ 5 | import React, { Component } from 'react' 6 | import { render } from 'react-dom' 7 | import SelectAll from 'selectall' 8 | import Remove from 'remove' 9 | import Page from 'page' 10 | 11 | var Bottomcontrol = React.createClass({ 12 | render: function () { 13 | return ( 14 | <div className="bottomControl"> 15 | <SelectAll /> 16 | <Remove /> 17 | <Page /> 18 | </div> 19 | ) 20 | } 21 | }); 22 | 23 | export default Bottomcontrol; 24 | -------------------------------------------------------------------------------- /script/modules/entitycontrol/actions/entityAction.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 设备管理台Reflux Actoin 3 | * @author 崔健 cuijian03@baidu.com 2016.08.20 4 | */ 5 | 6 | var EntityAction = Reflux.createActions([ 7 | // 列出所有entity数据 8 | 'list', 9 | // 列出所有列名,包括固定列和自定义列 10 | 'listcolumn', 11 | // 检索entity 12 | 'search', 13 | // 移除entity 14 | 'remove', 15 | // 选中当前页所有entity 16 | 'checkall', 17 | // 取消选中当前页所有entity 18 | 'uncheckall', 19 | // 更新选中的entity的数据 20 | 'updatecheck', 21 | // 设置检索关键字 22 | 'setsearchentity', 23 | // 初始化页码 24 | 'initpageset', 25 | // 修改自定义字段 26 | 'update' 27 | ]); 28 | 29 | export default EntityAction -------------------------------------------------------------------------------- /static/bootstrap/js/bootstrap-datetimepicker.zh-CN.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Simplified Chinese translation for bootstrap-datetimepicker 3 | * Yuan Cheung <advanimal@gmail.com> 4 | */ 5 | ;(function($){ 6 | $.fn.datetimepicker.dates['zh-CN'] = { 7 | days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"], 8 | daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"], 9 | daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"], 10 | months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], 11 | monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], 12 | today: "今天", 13 | suffix: [], 14 | meridiem: ["上午", "下午"] 15 | }; 16 | }(jQuery)); 17 | -------------------------------------------------------------------------------- /script/modules/trackcontrol/views/manage.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 轨迹管理台 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.22 4 | */ 5 | import React, { Component } from 'react' 6 | import { render } from 'react-dom' 7 | import CommonStore from '../../common/stores/commonStore' 8 | import Managetitle from 'managetitle' 9 | import Managetoggle from 'managetoggle' 10 | 11 | var Manage = React.createClass({ 12 | render: function() { 13 | return ( 14 | <div className="manage"> 15 | <div className="manageControl"> 16 | <Managetitle /> 17 | <Managetoggle /> 18 | </div> 19 | </div> 20 | ) 21 | } 22 | }); 23 | 24 | export default Manage; 25 | -------------------------------------------------------------------------------- /components/react-dom/react-dom.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ReactDOM v15.1.0 3 | * 4 | * Copyright 2013-present, Facebook, Inc. 5 | * All rights reserved. 6 | * 7 | * This source code is licensed under the BSD-style license found in the 8 | * LICENSE file in the root directory of this source tree. An additional grant 9 | * of patent rights can be found in the PATENTS file in the same directory. 10 | * 11 | */ 12 | !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e(require("react"));else if("function"==typeof define&&define.amd)define(["react"],e);else{var f;f="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,f.ReactDOM=e(f.React)}}(function(e){return e.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED}); -------------------------------------------------------------------------------- /script/modules/trackcontrol/views/managetoggle.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 轨迹管理台收缩部分 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.22 4 | */ 5 | import React, { Component } from 'react' 6 | import { render } from 'react-dom' 7 | import TrackStore from '..//stores/trackStore' 8 | import ManageTab from 'managetab' 9 | import Monitor from 'monitor' 10 | import Track from 'track' 11 | 12 | var Managetoggle = React.createClass({ 13 | getInitialState: function() { 14 | return { 15 | 16 | } 17 | }, 18 | render: function() { 19 | return ( 20 | <div className="collapse in" id="manageBottom"> 21 | <div className="manageBottom"> 22 | <ManageTab /> 23 | <Monitor /> 24 | <Track /> 25 | </div> 26 | </div> 27 | 28 | ) 29 | } 30 | }); 31 | 32 | export default Managetoggle; 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Baidu Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /script/modules/common/views/manager_content.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 页面主 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.20 4 | */ 5 | import React, {Component} from 'react'; 6 | import {render} from 'react-dom'; 7 | import Header from 'header'; 8 | import EntityControl from '../../entitycontrol/views/entitycontrol'; 9 | import TrackControl from '../../trackcontrol/views/trackcontrol'; 10 | import CommonStore from '../stores/commonStore'; 11 | import Mapcontrol from '../../../common/mapControl.js'; 12 | 13 | 14 | 15 | let ManagerContent = React.createClass({ 16 | render() { 17 | return ( 18 | <div className="main"> 19 | <div className="trunk" id="trunk"> 20 | <Header /> 21 | <TrackControl /> 22 | <EntityControl /> 23 | </div> 24 | <div className="branch" id="branch"> 25 | </div> 26 | </div> 27 | ); 28 | } 29 | }); 30 | 31 | if (location.href.indexOf('/manager') > -1) { 32 | render( 33 | <ManagerContent />, 34 | $('#Manager_content')[0] 35 | ); 36 | } 37 | 38 | -------------------------------------------------------------------------------- /script/modules/entitycontrol/views/remove.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 删除entity Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.20 4 | */ 5 | 6 | import React, { Component } from 'react' 7 | import { render } from 'react-dom' 8 | import EntityAction from '../actions/entityAction' 9 | import EntityStore from '../stores/entityStore' 10 | 11 | var Remove = React.createClass({ 12 | getInitialState: function() { 13 | return { 14 | } 15 | }, 16 | componentDidMount: function () { 17 | EntityStore.listen(this.onStatusChange); 18 | }, 19 | onStatusChange: function (type,data) { 20 | switch (type){ 21 | 22 | } 23 | }, 24 | /** 25 | * DOM操作回调,点击删除按钮 26 | * 27 | * @param {object} event 事件对象 28 | */ 29 | handleClick: function (event) { 30 | if(window.confirm("确定要删除选定的设备么?")) { 31 | EntityAction.remove(); 32 | } 33 | }, 34 | render: function () { 35 | return ( 36 | <div className="remove" onClick={this.handleClick}> 37 | 删除 38 | </div> 39 | ) 40 | } 41 | }); 42 | 43 | export default Remove; 44 | -------------------------------------------------------------------------------- /script/modules/trackcontrol/views/map.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 轨迹管理台背景地图 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.22 4 | */ 5 | import React, { Component } from 'react' 6 | import { render } from 'react-dom' 7 | import CommonStore from '../../common/stores/commonStore' 8 | 9 | var Map = React.createClass({ 10 | getInitialState: function() { 11 | return { 12 | 13 | } 14 | }, 15 | componentDidMount: function () { 16 | CommonStore.listen(this.onStatusChange); 17 | this.initMapContainer(); 18 | }, 19 | onStatusChange: function (type,data) { 20 | switch (type){ 21 | case '': 22 | 23 | break; 24 | } 25 | }, 26 | /** 27 | * 响应Store list事件,设置标签页 28 | * 29 | * @param {data} 标签页标识 30 | */ 31 | listenSwitchTab: function(data) { 32 | 33 | }, 34 | /** 35 | * view内部,设置map容器尺寸 36 | * 37 | */ 38 | initMapContainer: function() { 39 | 40 | }, 41 | render: function() { 42 | return ( 43 | <div className="map" id="mapContainer"> 44 | 45 | </div> 46 | ) 47 | } 48 | }); 49 | 50 | export default Map; 51 | -------------------------------------------------------------------------------- /script/modules/common/views/tabs.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 切换功能页签 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.20 4 | */ 5 | 6 | import React, { Component } from 'react' 7 | import { render } from 'react-dom' 8 | import CommonAction from '../actions/commonAction' 9 | import CommonStore from '../stores/commonStore' 10 | 11 | var Tabs = React.createClass({ 12 | getInitialState: function() { 13 | return { 14 | // 当前tab页签 15 | currentIndex: 0 16 | }; 17 | }, 18 | render: function () { 19 | var that = this; 20 | var tabsArray = ['轨迹监控', '终端管理']; 21 | return ( 22 | <div className="tab"> 23 | { 24 | tabsArray.map(function (tabsName, index) { 25 | return ( 26 | <div className="tabItem" key={index}> 27 | <span key={index} onClick={ () => { that.setState({currentIndex : index}); CommonAction.switchtab(index)} } className={index === that.state.currentIndex?'active':''}>{tabsName}</span> 28 | </div> 29 | ) 30 | }) 31 | } 32 | </div> 33 | ) 34 | } 35 | }); 36 | 37 | export default Tabs; 38 | -------------------------------------------------------------------------------- /components/react-dom/react-dom-server.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ReactDOMServer v15.1.0 3 | * 4 | * Copyright 2013-present, Facebook, Inc. 5 | * All rights reserved. 6 | * 7 | * This source code is licensed under the BSD-style license found in the 8 | * LICENSE file in the root directory of this source tree. An additional grant 9 | * of patent rights can be found in the PATENTS file in the same directory. 10 | * 11 | */ 12 | // Based off https://github.com/ForbesLindesay/umd/blob/master/template.js 13 | ;(function(f) { 14 | // CommonJS 15 | if (typeof exports === "object" && typeof module !== "undefined") { 16 | module.exports = f(require('react')); 17 | 18 | // RequireJS 19 | } else if (typeof define === "function" && define.amd) { 20 | define(['react'], f); 21 | 22 | // <script> 23 | } else { 24 | var g; 25 | if (typeof window !== "undefined") { 26 | g = window; 27 | } else if (typeof global !== "undefined") { 28 | g = global; 29 | } else if (typeof self !== "undefined") { 30 | g = self; 31 | } else { 32 | // works providing we're not in "use strict"; 33 | // needed for Java 8 Nashorn 34 | // see https://github.com/facebook/react/issues/3037 35 | g = this; 36 | } 37 | g.ReactDOMServer = f(g.React); 38 | } 39 | 40 | })(function(React) { 41 | return React.__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; 42 | }); 43 | -------------------------------------------------------------------------------- /script/modules/entitycontrol/views/entitycontrol.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 设备管理台 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.22 4 | */ 5 | import React, { Component } from 'react' 6 | import { render } from 'react-dom' 7 | import Control from 'control' 8 | import Entitylist from 'entitylist' 9 | import BottomControl from 'bottomcontrol' 10 | import CommonStore from '../../common/stores/commonStore' 11 | 12 | var Entitycontrol = React.createClass({ 13 | getInitialState: function() { 14 | return { 15 | // 当前页签,0为轨迹监控,1为终端管理 16 | tabIndex: 0 17 | } 18 | }, 19 | componentDidMount: function () { 20 | CommonStore.listen(this.onStatusChange); 21 | }, 22 | onStatusChange: function (type,data) { 23 | switch (type){ 24 | case 'switchtab': 25 | this.listenSwitchTab(data); 26 | break; 27 | } 28 | }, 29 | /** 30 | * 响应Store list事件,设置标签页 31 | * 32 | * @param {data} 标签页标识 33 | */ 34 | listenSwitchTab: function(data) { 35 | this.setState({tabIndex: data}); 36 | }, 37 | render: function() { 38 | var tabIndex = this.state.tabIndex; 39 | return ( 40 | <div className={tabIndex === 0 ? 'entityControl hidden' : 'entityControl visible'} > 41 | <Control /> 42 | <Entitylist /> 43 | <BottomControl /> 44 | </div> 45 | ) 46 | } 47 | }); 48 | 49 | export default Entitycontrol; 50 | -------------------------------------------------------------------------------- /script/modules/trackcontrol/views/trackcontrol.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 轨迹管理台 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.22 4 | */ 5 | import React, { Component } from 'react' 6 | import { render } from 'react-dom' 7 | import CommonStore from '../../common/stores/commonStore' 8 | import Manage from 'manage' 9 | import Map from 'map' 10 | import Timeline from 'timeline' 11 | import Trackanalysis from 'trackanalysis' 12 | import Boundcontrol from 'boundcontrol'; 13 | 14 | var Trackcontrol = React.createClass({ 15 | getInitialState: function() { 16 | return { 17 | // 当前页签,0为轨迹监控,1为终端管理 18 | tabIndex: 0 19 | } 20 | }, 21 | componentDidMount: function () { 22 | CommonStore.listen(this.onStatusChange); 23 | }, 24 | onStatusChange: function (type,data) { 25 | switch (type){ 26 | case 'switchtab': 27 | this.listenSwitchTab(data); 28 | break; 29 | } 30 | }, 31 | /** 32 | * 响应Store list事件,设置标签页 33 | * 34 | * @param {data} 标签页标识 35 | */ 36 | listenSwitchTab: function(data) { 37 | this.setState({tabIndex: data}); 38 | }, 39 | render: function() { 40 | var tabIndex = this.state.tabIndex; 41 | return ( 42 | <div className={tabIndex === 1 ? 'trackControl hidden' : 'trackControl visible'} > 43 | <Map /> 44 | <Manage /> 45 | <Timeline /> 46 | <Trackanalysis /> 47 | <Boundcontrol /> 48 | </div> 49 | ) 50 | } 51 | }); 52 | 53 | export default Trackcontrol; 54 | -------------------------------------------------------------------------------- /static/icheck-1.x/square/square.css: -------------------------------------------------------------------------------- 1 | /* iCheck plugin Square skin, black 2 | ----------------------------------- */ 3 | .icheckbox_square, 4 | .iradio_square { 5 | display: inline-block; 6 | *display: inline; 7 | vertical-align: middle; 8 | margin: 0; 9 | padding: 0; 10 | width: 22px; 11 | height: 22px; 12 | background: url(square.png) no-repeat; 13 | border: none; 14 | cursor: pointer; 15 | } 16 | 17 | .icheckbox_square { 18 | background-position: 0 0; 19 | } 20 | .icheckbox_square.hover { 21 | background-position: -24px 0; 22 | } 23 | .icheckbox_square.checked { 24 | background-position: -48px 0; 25 | } 26 | .icheckbox_square.disabled { 27 | background-position: -72px 0; 28 | cursor: default; 29 | } 30 | .icheckbox_square.checked.disabled { 31 | background-position: -96px 0; 32 | } 33 | 34 | .iradio_square { 35 | background-position: -120px 0; 36 | } 37 | .iradio_square.hover { 38 | background-position: -144px 0; 39 | } 40 | .iradio_square.checked { 41 | background-position: -168px 0; 42 | } 43 | .iradio_square.disabled { 44 | background-position: -192px 0; 45 | cursor: default; 46 | } 47 | .iradio_square.checked.disabled { 48 | background-position: -216px 0; 49 | } 50 | 51 | /* HiDPI support */ 52 | @media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) { 53 | .icheckbox_square, 54 | .iradio_square { 55 | background-image: url(square@2x.png); 56 | -webkit-background-size: 240px 24px; 57 | background-size: 240px 24px; 58 | } 59 | } -------------------------------------------------------------------------------- /static/icheck-1.x/square/red.css: -------------------------------------------------------------------------------- 1 | /* iCheck plugin Square skin, red 2 | ----------------------------------- */ 3 | .icheckbox_square-red, 4 | .iradio_square-red { 5 | display: inline-block; 6 | *display: inline; 7 | vertical-align: middle; 8 | margin: 0; 9 | padding: 0; 10 | width: 22px; 11 | height: 22px; 12 | background: url(red.png) no-repeat; 13 | border: none; 14 | cursor: pointer; 15 | } 16 | 17 | .icheckbox_square-red { 18 | background-position: 0 0; 19 | } 20 | .icheckbox_square-red.hover { 21 | background-position: -24px 0; 22 | } 23 | .icheckbox_square-red.checked { 24 | background-position: -48px 0; 25 | } 26 | .icheckbox_square-red.disabled { 27 | background-position: -72px 0; 28 | cursor: default; 29 | } 30 | .icheckbox_square-red.checked.disabled { 31 | background-position: -96px 0; 32 | } 33 | 34 | .iradio_square-red { 35 | background-position: -120px 0; 36 | } 37 | .iradio_square-red.hover { 38 | background-position: -144px 0; 39 | } 40 | .iradio_square-red.checked { 41 | background-position: -168px 0; 42 | } 43 | .iradio_square-red.disabled { 44 | background-position: -192px 0; 45 | cursor: default; 46 | } 47 | .iradio_square-red.checked.disabled { 48 | background-position: -216px 0; 49 | } 50 | 51 | /* HiDPI support */ 52 | @media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) { 53 | .icheckbox_square-red, 54 | .iradio_square-red { 55 | background-image: url(red@2x.png); 56 | -webkit-background-size: 240px 24px; 57 | background-size: 240px 24px; 58 | } 59 | } -------------------------------------------------------------------------------- /static/icheck-1.x/square/aero.css: -------------------------------------------------------------------------------- 1 | /* iCheck plugin Square skin, aero 2 | ----------------------------------- */ 3 | .icheckbox_square-aero, 4 | .iradio_square-aero { 5 | display: inline-block; 6 | *display: inline; 7 | vertical-align: middle; 8 | margin: 0; 9 | padding: 0; 10 | width: 22px; 11 | height: 22px; 12 | background: url(aero.png) no-repeat; 13 | border: none; 14 | cursor: pointer; 15 | } 16 | 17 | .icheckbox_square-aero { 18 | background-position: 0 0; 19 | } 20 | .icheckbox_square-aero.hover { 21 | background-position: -24px 0; 22 | } 23 | .icheckbox_square-aero.checked { 24 | background-position: -48px 0; 25 | } 26 | .icheckbox_square-aero.disabled { 27 | background-position: -72px 0; 28 | cursor: default; 29 | } 30 | .icheckbox_square-aero.checked.disabled { 31 | background-position: -96px 0; 32 | } 33 | 34 | .iradio_square-aero { 35 | background-position: -120px 0; 36 | } 37 | .iradio_square-aero.hover { 38 | background-position: -144px 0; 39 | } 40 | .iradio_square-aero.checked { 41 | background-position: -168px 0; 42 | } 43 | .iradio_square-aero.disabled { 44 | background-position: -192px 0; 45 | cursor: default; 46 | } 47 | .iradio_square-aero.checked.disabled { 48 | background-position: -216px 0; 49 | } 50 | 51 | /* HiDPI support */ 52 | @media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) { 53 | .icheckbox_square-aero, 54 | .iradio_square-aero { 55 | background-image: url(aero@2x.png); 56 | -webkit-background-size: 240px 24px; 57 | background-size: 240px 24px; 58 | } 59 | } -------------------------------------------------------------------------------- /static/icheck-1.x/square/grey.css: -------------------------------------------------------------------------------- 1 | /* iCheck plugin Square skin, grey 2 | ----------------------------------- */ 3 | .icheckbox_square-grey, 4 | .iradio_square-grey { 5 | display: inline-block; 6 | *display: inline; 7 | vertical-align: middle; 8 | margin: 0; 9 | padding: 0; 10 | width: 22px; 11 | height: 22px; 12 | background: url(grey.png) no-repeat; 13 | border: none; 14 | cursor: pointer; 15 | } 16 | 17 | .icheckbox_square-grey { 18 | background-position: 0 0; 19 | } 20 | .icheckbox_square-grey.hover { 21 | background-position: -24px 0; 22 | } 23 | .icheckbox_square-grey.checked { 24 | background-position: -48px 0; 25 | } 26 | .icheckbox_square-grey.disabled { 27 | background-position: -72px 0; 28 | cursor: default; 29 | } 30 | .icheckbox_square-grey.checked.disabled { 31 | background-position: -96px 0; 32 | } 33 | 34 | .iradio_square-grey { 35 | background-position: -120px 0; 36 | } 37 | .iradio_square-grey.hover { 38 | background-position: -144px 0; 39 | } 40 | .iradio_square-grey.checked { 41 | background-position: -168px 0; 42 | } 43 | .iradio_square-grey.disabled { 44 | background-position: -192px 0; 45 | cursor: default; 46 | } 47 | .iradio_square-grey.checked.disabled { 48 | background-position: -216px 0; 49 | } 50 | 51 | /* HiDPI support */ 52 | @media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) { 53 | .icheckbox_square-grey, 54 | .iradio_square-grey { 55 | background-image: url(grey@2x.png); 56 | -webkit-background-size: 240px 24px; 57 | background-size: 240px 24px; 58 | } 59 | } -------------------------------------------------------------------------------- /static/icheck-1.x/square/pink.css: -------------------------------------------------------------------------------- 1 | /* iCheck plugin Square skin, pink 2 | ----------------------------------- */ 3 | .icheckbox_square-pink, 4 | .iradio_square-pink { 5 | display: inline-block; 6 | *display: inline; 7 | vertical-align: middle; 8 | margin: 0; 9 | padding: 0; 10 | width: 22px; 11 | height: 22px; 12 | background: url(pink.png) no-repeat; 13 | border: none; 14 | cursor: pointer; 15 | } 16 | 17 | .icheckbox_square-pink { 18 | background-position: 0 0; 19 | } 20 | .icheckbox_square-pink.hover { 21 | background-position: -24px 0; 22 | } 23 | .icheckbox_square-pink.checked { 24 | background-position: -48px 0; 25 | } 26 | .icheckbox_square-pink.disabled { 27 | background-position: -72px 0; 28 | cursor: default; 29 | } 30 | .icheckbox_square-pink.checked.disabled { 31 | background-position: -96px 0; 32 | } 33 | 34 | .iradio_square-pink { 35 | background-position: -120px 0; 36 | } 37 | .iradio_square-pink.hover { 38 | background-position: -144px 0; 39 | } 40 | .iradio_square-pink.checked { 41 | background-position: -168px 0; 42 | } 43 | .iradio_square-pink.disabled { 44 | background-position: -192px 0; 45 | cursor: default; 46 | } 47 | .iradio_square-pink.checked.disabled { 48 | background-position: -216px 0; 49 | } 50 | 51 | /* HiDPI support */ 52 | @media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) { 53 | .icheckbox_square-pink, 54 | .iradio_square-pink { 55 | background-image: url(pink@2x.png); 56 | -webkit-background-size: 240px 24px; 57 | background-size: 240px 24px; 58 | } 59 | } -------------------------------------------------------------------------------- /static/icheck-1.x/square/blue.css: -------------------------------------------------------------------------------- 1 | /* iCheck plugin Square skin, blue 2 | ----------------------------------- */ 3 | .icheckbox_square-blue, 4 | .iradio_square-blue { 5 | display: inline-block; 6 | *display: inline; 7 | vertical-align: middle; 8 | margin: 0; 9 | padding: 0; 10 | width: 15px; 11 | height: 16px; 12 | background: url(bluen.png) no-repeat; 13 | border: none; 14 | cursor: pointer; 15 | } 16 | 17 | .icheckbox_square-blue { 18 | background-position: 0 0; 19 | } 20 | .icheckbox_square-blue.hover { 21 | background-position: -24px 0; 22 | } 23 | .icheckbox_square-blue.checked { 24 | background-position: -48px 0; 25 | } 26 | .icheckbox_square-blue.disabled { 27 | background-position: -72px 0; 28 | cursor: default; 29 | } 30 | .icheckbox_square-blue.checked.disabled { 31 | background-position: -96px 0; 32 | } 33 | 34 | .iradio_square-blue { 35 | background-position: -120px 0; 36 | } 37 | .iradio_square-blue.hover { 38 | background-position: -144px 0; 39 | } 40 | .iradio_square-blue.checked { 41 | background-position: -168px 0; 42 | } 43 | .iradio_square-blue.disabled { 44 | background-position: -192px 0; 45 | cursor: default; 46 | } 47 | .iradio_square-blue.checked.disabled { 48 | background-position: -216px 0; 49 | } 50 | 51 | /* HiDPI support */ 52 | @media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) { 53 | .icheckbox_square-blue, 54 | .iradio_square-blue { 55 | background-image: url(bluen@2x.png); 56 | -webkit-background-size: 240px 24px; 57 | background-size: 240px 24px; 58 | } 59 | } -------------------------------------------------------------------------------- /script/modules/trackcontrol/actions/trackAction.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 轨迹管理台Reflux Actoin 3 | * @author 崔健 cuijian03@baidu.com 2016.08.23 4 | */ 5 | 6 | 7 | var TrackAction = Reflux.createActions([ 8 | // 获取service名 9 | 'getservicename', 10 | // 调整管理面板标签页,分为实时监控和轨迹查询 11 | 'switchmanagetab', 12 | // 调整实时监控面板标签页,分为全部、在线和离线 13 | 'switchmonitortab', 14 | // 查询全部entity 15 | 'searchallentity', 16 | // 查询在线entity 17 | 'searchonlineentity', 18 | // 查询离线entity 19 | 'searchofflineentity', 20 | // 列出当前service的自定义字段 21 | 'listcolumn', 22 | // 选中列表中某个车 23 | 'selectcar', 24 | // 隐藏选中车 25 | 'hideselectcar', 26 | // 加载track列表 27 | 'tracklist', 28 | // 修改选中时间 29 | 'changedatetime', 30 | // 设定当前检索关键字 31 | 'setsearchentity', 32 | // 选中某个轨迹 33 | 'selecttrack', 34 | // 初始化页码 35 | 'initpageset', 36 | // 检索轨迹查询列表关键字 37 | 'setsearchentitytrack', 38 | // 初始化轨迹查询页码 39 | 'initpagesettrack', 40 | // 获取停留点 41 | 'getstaypoint', 42 | // 获取驾驶分析 43 | 'behavioranalysis', 44 | // 更新轨迹纠偏选项 45 | 'updateprocess', 46 | // 隐藏canvas 47 | 'hidetrackcanvas', 48 | // 显示canvas 49 | 'showtrackcanvas', 50 | // 调整轨迹显示的时间段 51 | 'changeTimeline', 52 | // 根据矩形区域检索entity 53 | 'boundsearchentity', 54 | // 进行逆地址解析 55 | 'getaddress', 56 | // 切换是否进行boundsearch检索 57 | 'switchboundsearch', 58 | // 关闭infobox 59 | 'closemonitorinfobox', 60 | // 模拟点击触发点击轨迹查询 61 | 'triggerswitchmanagetab', 62 | // 模拟检索某个entity 63 | 'triggersearchentitytrack', 64 | // 模拟点击列表第一项 65 | 'triggerselecttrack', 66 | // 模拟更改轨迹查询的时间 67 | 'triggersetdate' 68 | ]); 69 | 70 | export default TrackAction -------------------------------------------------------------------------------- /static/icheck-1.x/square/green.css: -------------------------------------------------------------------------------- 1 | /* iCheck plugin Square skin, green 2 | ----------------------------------- */ 3 | .icheckbox_square-green, 4 | .iradio_square-green { 5 | display: inline-block; 6 | *display: inline; 7 | vertical-align: middle; 8 | margin: 0; 9 | padding: 0; 10 | width: 22px; 11 | height: 22px; 12 | background: url(green.png) no-repeat; 13 | border: none; 14 | cursor: pointer; 15 | } 16 | 17 | .icheckbox_square-green { 18 | background-position: 0 0; 19 | } 20 | .icheckbox_square-green.hover { 21 | background-position: -24px 0; 22 | } 23 | .icheckbox_square-green.checked { 24 | background-position: -48px 0; 25 | } 26 | .icheckbox_square-green.disabled { 27 | background-position: -72px 0; 28 | cursor: default; 29 | } 30 | .icheckbox_square-green.checked.disabled { 31 | background-position: -96px 0; 32 | } 33 | 34 | .iradio_square-green { 35 | background-position: -120px 0; 36 | } 37 | .iradio_square-green.hover { 38 | background-position: -144px 0; 39 | } 40 | .iradio_square-green.checked { 41 | background-position: -168px 0; 42 | } 43 | .iradio_square-green.disabled { 44 | background-position: -192px 0; 45 | cursor: default; 46 | } 47 | .iradio_square-green.checked.disabled { 48 | background-position: -216px 0; 49 | } 50 | 51 | /* HiDPI support */ 52 | @media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) { 53 | .icheckbox_square-green, 54 | .iradio_square-green { 55 | background-image: url(green@2x.png); 56 | -webkit-background-size: 240px 24px; 57 | background-size: 240px 24px; 58 | } 59 | } -------------------------------------------------------------------------------- /static/icheck-1.x/square/orange.css: -------------------------------------------------------------------------------- 1 | /* iCheck plugin Square skin, orange 2 | ----------------------------------- */ 3 | .icheckbox_square-orange, 4 | .iradio_square-orange { 5 | display: inline-block; 6 | *display: inline; 7 | vertical-align: middle; 8 | margin: 0; 9 | padding: 0; 10 | width: 22px; 11 | height: 22px; 12 | background: url(orange.png) no-repeat; 13 | border: none; 14 | cursor: pointer; 15 | } 16 | 17 | .icheckbox_square-orange { 18 | background-position: 0 0; 19 | } 20 | .icheckbox_square-orange.hover { 21 | background-position: -24px 0; 22 | } 23 | .icheckbox_square-orange.checked { 24 | background-position: -48px 0; 25 | } 26 | .icheckbox_square-orange.disabled { 27 | background-position: -72px 0; 28 | cursor: default; 29 | } 30 | .icheckbox_square-orange.checked.disabled { 31 | background-position: -96px 0; 32 | } 33 | 34 | .iradio_square-orange { 35 | background-position: -120px 0; 36 | } 37 | .iradio_square-orange.hover { 38 | background-position: -144px 0; 39 | } 40 | .iradio_square-orange.checked { 41 | background-position: -168px 0; 42 | } 43 | .iradio_square-orange.disabled { 44 | background-position: -192px 0; 45 | cursor: default; 46 | } 47 | .iradio_square-orange.checked.disabled { 48 | background-position: -216px 0; 49 | } 50 | 51 | /* HiDPI support */ 52 | @media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) { 53 | .icheckbox_square-orange, 54 | .iradio_square-orange { 55 | background-image: url(orange@2x.png); 56 | -webkit-background-size: 240px 24px; 57 | background-size: 240px 24px; 58 | } 59 | } -------------------------------------------------------------------------------- /static/icheck-1.x/square/purple.css: -------------------------------------------------------------------------------- 1 | /* iCheck plugin Square skin, purple 2 | ----------------------------------- */ 3 | .icheckbox_square-purple, 4 | .iradio_square-purple { 5 | display: inline-block; 6 | *display: inline; 7 | vertical-align: middle; 8 | margin: 0; 9 | padding: 0; 10 | width: 22px; 11 | height: 22px; 12 | background: url(purple.png) no-repeat; 13 | border: none; 14 | cursor: pointer; 15 | } 16 | 17 | .icheckbox_square-purple { 18 | background-position: 0 0; 19 | } 20 | .icheckbox_square-purple.hover { 21 | background-position: -24px 0; 22 | } 23 | .icheckbox_square-purple.checked { 24 | background-position: -48px 0; 25 | } 26 | .icheckbox_square-purple.disabled { 27 | background-position: -72px 0; 28 | cursor: default; 29 | } 30 | .icheckbox_square-purple.checked.disabled { 31 | background-position: -96px 0; 32 | } 33 | 34 | .iradio_square-purple { 35 | background-position: -120px 0; 36 | } 37 | .iradio_square-purple.hover { 38 | background-position: -144px 0; 39 | } 40 | .iradio_square-purple.checked { 41 | background-position: -168px 0; 42 | } 43 | .iradio_square-purple.disabled { 44 | background-position: -192px 0; 45 | cursor: default; 46 | } 47 | .iradio_square-purple.checked.disabled { 48 | background-position: -216px 0; 49 | } 50 | 51 | /* HiDPI support */ 52 | @media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) { 53 | .icheckbox_square-purple, 54 | .iradio_square-purple { 55 | background-image: url(purple@2x.png); 56 | -webkit-background-size: 240px 24px; 57 | background-size: 240px 24px; 58 | } 59 | } -------------------------------------------------------------------------------- /static/icheck-1.x/square/yellow.css: -------------------------------------------------------------------------------- 1 | /* iCheck plugin Square skin, yellow 2 | ----------------------------------- */ 3 | .icheckbox_square-yellow, 4 | .iradio_square-yellow { 5 | display: inline-block; 6 | *display: inline; 7 | vertical-align: middle; 8 | margin: 0; 9 | padding: 0; 10 | width: 22px; 11 | height: 22px; 12 | background: url(yellow.png) no-repeat; 13 | border: none; 14 | cursor: pointer; 15 | } 16 | 17 | .icheckbox_square-yellow { 18 | background-position: 0 0; 19 | } 20 | .icheckbox_square-yellow.hover { 21 | background-position: -24px 0; 22 | } 23 | .icheckbox_square-yellow.checked { 24 | background-position: -48px 0; 25 | } 26 | .icheckbox_square-yellow.disabled { 27 | background-position: -72px 0; 28 | cursor: default; 29 | } 30 | .icheckbox_square-yellow.checked.disabled { 31 | background-position: -96px 0; 32 | } 33 | 34 | .iradio_square-yellow { 35 | background-position: -120px 0; 36 | } 37 | .iradio_square-yellow.hover { 38 | background-position: -144px 0; 39 | } 40 | .iradio_square-yellow.checked { 41 | background-position: -168px 0; 42 | } 43 | .iradio_square-yellow.disabled { 44 | background-position: -192px 0; 45 | cursor: default; 46 | } 47 | .iradio_square-yellow.checked.disabled { 48 | background-position: -216px 0; 49 | } 50 | 51 | /* HiDPI support */ 52 | @media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) { 53 | .icheckbox_square-yellow, 54 | .iradio_square-yellow { 55 | background-image: url(yellow@2x.png); 56 | -webkit-background-size: 240px 24px; 57 | background-size: 240px 24px; 58 | } 59 | } -------------------------------------------------------------------------------- /manager.html: -------------------------------------------------------------------------------- 1 | <!DOCTYPE html> 2 | <html lang="en"> 3 | <head> 4 | <meta charset="UTF-8"> 5 | <title>百度鹰眼 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 | -------------------------------------------------------------------------------- /script/modules/entitycontrol/views/selectall.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 全选当前页entity Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.20 4 | */ 5 | 6 | import React, { Component } from 'react' 7 | import { render } from 'react-dom' 8 | import EntityAction from '../actions/entityAction' 9 | import EntityStore from '../stores/entityStore' 10 | 11 | 12 | var Selectall = React.createClass({ 13 | getInitialState: function() { 14 | return { 15 | } 16 | }, 17 | componentDidMount: function () { 18 | var self = this; 19 | EntityStore.listen(self.onStatusChange); 20 | this.setCheckboxStyle(); 21 | }, 22 | onStatusChange: function (type,data) { 23 | switch (type){ 24 | case 'listcomplete': 25 | this.listenListcomplete(); 26 | break; 27 | } 28 | }, 29 | /** 30 | * 响应Store listcomplete事件,取消所有checkbox选中状态 31 | * 32 | */ 33 | listenListcomplete: function() { 34 | $('#checkAll').iCheck('uncheck'); 35 | }, 36 | /** 37 | * view内部,初始化checkbox样式,添加监听 38 | * 39 | */ 40 | setCheckboxStyle: function () { 41 | $('#checkAll').iCheck({ 42 | checkboxClass: 'icheckbox_square-blue', 43 | radioClass: 'iradio_square', 44 | increaseArea: '20%' // optional 45 | }); 46 | $('#checkAll').on('ifChecked', function(event){ 47 | EntityAction.checkall(); 48 | }); 49 | $('#checkAll').on('ifUnchecked', function(event){ 50 | EntityAction.uncheckall(); 51 | }); 52 | }, 53 | render: function () { 54 | return ( 55 |
56 | 60 |
61 | ) 62 | } 63 | }); 64 | 65 | export default Selectall; 66 | -------------------------------------------------------------------------------- /script/modules/trackcontrol/views/managetitle.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 轨迹管理台头部标题 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.23 4 | */ 5 | import React, { Component } from 'react' 6 | import { render } from 'react-dom' 7 | import TrackStore from '..//stores/trackStore' 8 | import TrackAction from '../actions/trackAction' 9 | 10 | var Managetitle = React.createClass({ 11 | getInitialState: function() { 12 | return { 13 | // 当前service名 14 | serviceName: '', 15 | // 当前toggle状态class名 16 | toggleClass: 'toggleInManage' 17 | } 18 | }, 19 | componentDidMount: function () { 20 | TrackAction.getservicename(); 21 | TrackStore.listen(this.onStatusChange); 22 | }, 23 | onStatusChange: function (type,data) { 24 | switch (type){ 25 | case 'servicename': 26 | this.lisenUpdateServiceName(data); 27 | break; 28 | } 29 | }, 30 | /** 31 | * 响应Store servicename事件,更新service名称 32 | * 33 | * @param {data} 标签页标识 34 | */ 35 | lisenUpdateServiceName: function(data) { 36 | this.setState({serviceName: data + '管理'}); 37 | }, 38 | /** 39 | * DOM操作回调,点击收起放开按钮 40 | * 41 | * @param {object} event 事件对象 42 | */ 43 | handleToggle: function(event) { 44 | if (this.state.toggleClass === 'toggleInManage') { 45 | this.setState({toggleClass: 'toggleOutManage'}); 46 | } else { 47 | this.setState({toggleClass: 'toggleInManage'}) 48 | } 49 | }, 50 | render: function() { 51 | var serviceName = this.state.serviceName; 52 | var toggleClass = this.state.toggleClass; 53 | return ( 54 |
55 |
{serviceName}
56 |
57 |
58 | ) 59 | } 60 | }); 61 | 62 | export default Managetitle; 63 | -------------------------------------------------------------------------------- /script/modules/trackcontrol/views/monitor.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 实时监控 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.23 4 | */ 5 | import React, { Component } from 'react' 6 | import { render } from 'react-dom' 7 | import TrackStore from '..//stores/trackStore' 8 | import CommonStore from '../../common/stores/commonStore' 9 | import Monitorsearch from 'monitorsearch' 10 | import Monitortab from 'monitortab' 11 | import MonitorAllContent from 'monitorallcontent' 12 | import MonitorOnlineContent from 'monitoronlinecontent' 13 | import MonitorOfflineContent from 'monitorofflinecontent' 14 | import TrackAction from '../actions/trackAction' 15 | 16 | var Monitor = React.createClass({ 17 | getInitialState: function() { 18 | return { 19 | // 页签编码 0为实时监控 1为轨迹查询 20 | tabIndex: 0, 21 | // 父容器可见性 22 | parentVisible: {} 23 | } 24 | }, 25 | componentDidMount: function () { 26 | TrackStore.listen(this.onStatusChange); 27 | CommonStore.listen(this.onStatusChange); 28 | }, 29 | onStatusChange: function (type,data) { 30 | switch (type){ 31 | case 'switchmanagetab': 32 | this.listenSwitchmanageTab(data); 33 | break; 34 | case 'switchtab': 35 | this.listenSwitchTab(data); 36 | break; 37 | } 38 | }, 39 | /** 40 | * 响应Store list事件,设置标签页 41 | * 42 | * @param {data} 标签页标识 43 | */ 44 | listenSwitchmanageTab: function(data) { 45 | this.setState({tabIndex: data}); 46 | if(data === 0){ 47 | 48 | } else { 49 | 50 | } 51 | }, 52 | /** 53 | * 响应Store switchtab事件,隐藏manage 54 | * 55 | * @param {data} 标签页标识 56 | */ 57 | listenSwitchTab: function(data) { 58 | if (data === 0){ 59 | this.setState({parentVisible: {}}); 60 | } else { 61 | this.setState({parentVisible: {visibility: 'inherit'}}); 62 | } 63 | 64 | }, 65 | render: function() { 66 | var tabIndex = this.state.tabIndex; 67 | var parentVisible = this.state.parentVisible; 68 | return ( 69 |
70 | 71 | 72 | 73 | 74 | 75 |
76 | 77 | ) 78 | } 79 | }); 80 | 81 | export default Monitor; 82 | -------------------------------------------------------------------------------- /script/modules/trackcontrol/views/managetab.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 轨迹管理台Tab切换 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.22 4 | */ 5 | import React, { Component } from 'react' 6 | import { render } from 'react-dom' 7 | import TrackAction from '../actions/trackAction' 8 | import TrackStore from '../stores/trackStore' 9 | 10 | var Managetab = React.createClass({ 11 | getInitialState: function() { 12 | return { 13 | pointerTab: 'pointerTabLeft', 14 | pointerTabIndex: 0 15 | } 16 | }, 17 | 18 | 19 | componentDidMount() { 20 | TrackStore.listen(this.onStatusChange); 21 | }, 22 | 23 | onStatusChange(type, data) { 24 | switch (type) { 25 | case 'triggerswitchmanagetab': 26 | this.listenTriggerSwitchManageTab(data); 27 | break; 28 | } 29 | }, 30 | 31 | /** 32 | * 响应Store triggerswitchmanagetab事件,触发tab切换 33 | * 34 | * @param {number} index 序号 35 | */ 36 | listenTriggerSwitchManageTab(index) { 37 | const event = (function () { 38 | const tabClassName = ['monitorTab', 'trackTab']; 39 | const eve = { 40 | target: { 41 | className: tabClassName[index] 42 | } 43 | }; 44 | return eve; 45 | }(index)); 46 | this.handleToggle(event); 47 | }, 48 | 49 | /** 50 | * DOM操作回调,切换标签页 51 | * 52 | * @param {object} event 事件对象 53 | */ 54 | handleToggle: function(event) { 55 | if (event.target.className === 'trackTab') { 56 | this.setState({pointerTab: 'pointerTabRight'}); 57 | this.setState({pointerTabIndex: 1}); 58 | TrackAction.switchmanagetab(1); 59 | } else { 60 | this.setState({pointerTab: 'pointerTabLeft'}); 61 | this.setState({pointerTabIndex: 0}); 62 | TrackAction.switchmanagetab(0); 63 | } 64 | }, 65 | render: function() { 66 | var pointerTab = this.state.pointerTab; 67 | return ( 68 |
69 |
70 | 实时监控 71 |
72 |
73 |
74 | 轨迹查询 75 |
76 |
77 |
78 |
79 | 80 | ) 81 | } 82 | }); 83 | 84 | export default Managetab; 85 | -------------------------------------------------------------------------------- /script/modules/trackcontrol/views/track.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 实时监控 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.22 4 | */ 5 | import React, { Component } from 'react' 6 | import { render } from 'react-dom' 7 | import TrackStore from '../stores/trackStore' 8 | import ManageTab from 'managetab' 9 | import CommonStore from '../../common/stores/commonStore' 10 | import Tracksearch from 'tracksearch' 11 | import Trackdatetime from 'trackdatetime' 12 | import Trackcontent from 'trackcontent' 13 | import TrackAction from '../actions/trackAction' 14 | 15 | 16 | var Track = React.createClass({ 17 | getInitialState: function() { 18 | return { 19 | // 页签编码 0为实时监控 1为轨迹查询 20 | tabIndex: 0, 21 | // 父容器可见性 22 | parentVisible: {} 23 | } 24 | }, 25 | componentDidMount: function () { 26 | TrackStore.listen(this.onStatusChange); 27 | CommonStore.listen(this.onStatusChange); 28 | }, 29 | onStatusChange: function (type,data) { 30 | switch (type){ 31 | case 'switchmanagetab': 32 | this.listenSwitchmanageTab(data); 33 | break; 34 | case 'switchtab': 35 | this.listenSwitchTab(data); 36 | break; 37 | } 38 | }, 39 | /** 40 | * 响应Store switchmanagetab事件,设置标签页 41 | * 42 | * @param {data} 标签页标识 43 | */ 44 | listenSwitchmanageTab: function(data) { 45 | this.setState({tabIndex: data}); 46 | if(data === 1){ 47 | TrackAction.hideselectcar(); 48 | mapControl.showSpeedControl(); 49 | mapControl.removeTrafficControl(); 50 | } else { 51 | TrackAction.selectcar(); 52 | mapControl.showTrafficControl(); 53 | mapControl.removeSpeedControl(); 54 | // var overlays = map.getOverlays(); 55 | map.clearOverlays(); 56 | } 57 | }, 58 | /** 59 | * 响应Store switchtab事件,隐藏manage 60 | * 61 | * @param {data} 标签页标识 62 | */ 63 | listenSwitchTab: function(data) { 64 | if (data === 0){ 65 | this.setState({parentVisible: {}}); 66 | } else { 67 | this.setState({parentVisible: {visibility: 'inherit'}}); 68 | } 69 | }, 70 | render: function() { 71 | var tabIndex = this.state.tabIndex; 72 | var parentVisible = this.state.parentVisible; 73 | return ( 74 |
75 | 76 | 77 | 78 |
79 | 80 | ) 81 | } 82 | }); 83 | 84 | export default Track; 85 | -------------------------------------------------------------------------------- /script/modules/trackcontrol/views/trackdatetime.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 轨迹查询时间选择entity部分 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.29 4 | */ 5 | import React, { Component } from 'react' 6 | import { render } from 'react-dom' 7 | import TrackStore from '../stores/trackStore' 8 | import TrackAction from '../actions/trackAction' 9 | import Commonfun from '../../../common/commonfun' 10 | 11 | var Trackdatetime = React.createClass({ 12 | getInitialState: function() { 13 | return { 14 | defaultDatetime: '', 15 | triggersetdate: new Date() 16 | }; 17 | }, 18 | componentDidMount: function () { 19 | this.initTrackDatetime(); 20 | TrackStore.listen(this.onStatusChange); 21 | }, 22 | 23 | componentDidUpdate() { 24 | $('#datetimepicker').datetimepicker('setDate', this.state.triggersetdate); 25 | TrackAction.changedatetime(Commonfun.getCurrentDate(this.state.triggersetdate)); 26 | TrackAction.tracklist(); 27 | }, 28 | 29 | onStatusChange(type, data) { 30 | switch (type) { 31 | case 'triggersetdate': 32 | this.listenTriggerSetDate(data); 33 | break; 34 | } 35 | }, 36 | 37 | /** 38 | * 响应Store triggersetdate事件,触发更改时间 39 | * 40 | * @param {Object} date 时间对象 41 | */ 42 | listenTriggerSetDate(date) { 43 | this.setState({ 44 | triggersetdate: date 45 | }); 46 | }, 47 | 48 | /** 49 | * view内部 初始化时间选择插件 50 | * 51 | */ 52 | initTrackDatetime: function() { 53 | var that = this; 54 | $('#datetimepicker').datetimepicker({ 55 | language: 'zh-CN', 56 | weekStart: 1, 57 | todayBtn: 1, 58 | autoclose: 1, 59 | todayHighlight: 1, 60 | startView: 2, 61 | forceParse: 0, 62 | minView: 2, 63 | pickerPosition: 'bottom-left' 64 | }); 65 | $('#datetimepicker').on('changeDate', function(e) { 66 | that.setState({ 67 | defaultDatetime: Commonfun.getCurrentDate(e.date), 68 | triggersetdate: e.date 69 | }); 70 | }); 71 | $('#datetimepicker').datetimepicker('setEndDate', Commonfun.getCurrentDate()); 72 | that.setState({defaultDatetime: Commonfun.getCurrentDate()}); 73 | }, 74 | /** 75 | * DOM操作回调,这里没有实际作用,主要为了防止react报错 76 | * 77 | * @param {object} event 事件对象 78 | */ 79 | handleChangeDate: function(e) { 80 | TrackAction.changedatetime(this.state.defaultDatetime); 81 | }, 82 | render: function() { 83 | var defaultDatetime = this.state.defaultDatetime; 84 | return ( 85 |
86 |
87 | 88 | 89 | 90 | 91 |
92 |
93 | 94 | ) 95 | } 96 | }); 97 | 98 | export default Trackdatetime; -------------------------------------------------------------------------------- /script/common/urls.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 存放php proxy的url和Jquery AJAX方法 3 | * @author 崔健 cuijian03@baidu.com 2016.08.20 4 | */ 5 | import Commonfun from 'commonfun' 6 | var urls = { 7 | // 矩形区域检索entity 8 | boundsearchEntity: '//yingyan.baidu.com/api/v3/entity/boundsearch', 9 | // 获取track的distance 10 | getDistance: '//yingyan.baidu.com/api/v3/track/getdistance', 11 | // 获取track信息 12 | getTrack: '//yingyan.baidu.com/api/v3/track/gettrack', 13 | 14 | // 获取自定义字段列表 15 | columnsList: '//yingyan.baidu.com/api/v3/entity/listcolumn', 16 | // 经纬度解析 17 | getAddress: '//api.map.baidu.com/geocoder/v2/', 18 | // 通过新的search接口获取数据,包括所有entity、模糊搜索entity、在线entity、离线entity 19 | searchEntity: '//yingyan.baidu.com/api/v3/entity/search', 20 | // 获取track列表 21 | trackList: '//yingyan.baidu.com/api/v2/track/gethistory', 22 | // 获取停留点 23 | getstaypoint: '//yingyan.baidu.com/api/v2/analysis/staypoint', 24 | // 获取驾驶行为分析信息 25 | getBehaviorAnalysis: '//yingyan.baidu.com/api/v2/analysis/drivingbehavior', 26 | 27 | /** 28 | * Jquery AJAX GET 29 | * 30 | * @param {string} url 请求url 31 | * @param {object} params 请求参数 32 | * @param {function} success 请求成功回调函数 33 | * @param {function} before 请求前函数 34 | * @param {function} fail 请求失败回调函数 35 | * @param {function} after 请求完成回调函数 36 | */ 37 | post: function (url, params, success, before, fail, after) { 38 | if (before) { 39 | before(); 40 | } 41 | params.timeStamp = new Date().getTime(); 42 | fail = fail || function () { }; 43 | after = after || function () { }; 44 | // 严重推荐自己编写代理服务,将service_id和ak隐藏!!通过service_id和ak可以 45 | // 拿到该服务的所有数据,一旦泄露,后果严重!!! 46 | params.ak = Commonfun.getQueryString('ak'); 47 | params.service_id = Commonfun.getQueryString('service_id'); 48 | $.ajax({ 49 | type: 'POST', 50 | url: url, 51 | data: params, 52 | dataType: 'json', 53 | success: success, 54 | error: fail, 55 | complete: after 56 | }); 57 | }, 58 | 59 | /** 60 | * JSONP 61 | * 62 | * @param {string} url 请求url 63 | * @param {object} params 请求参数 64 | * @param {function} callbakc 请求成功回调函数 65 | * @param {function} before 请求前函数 66 | */ 67 | jsonp: function (url, params, callback, before) { 68 | var that = this; 69 | if (before) { 70 | before(); 71 | } 72 | params.timeStamp = new Date().getTime(); 73 | params.ak = Commonfun.getQueryString('ak'); 74 | params.service_id = Commonfun.getQueryString('service_id'); 75 | url = url + '?'; 76 | for (let i in params) { 77 | url = url + i + '=' + params[i] + '&'; 78 | } 79 | var timeStamp = (Math.random() * 100000).toFixed(0); 80 | window['ck' + timeStamp] = callback || function () {}; 81 | var completeUrl = url + '&callback=ck' + timeStamp; 82 | var script = document.createElement('script'); 83 | script.src = completeUrl; 84 | script.id = 'jsonp'; 85 | document.getElementsByTagName('head')[0].appendChild(script); 86 | script.onload = function (e) { 87 | $('#jsonp').remove(); 88 | }; 89 | script.onerror = function (e) { 90 | that.jsonp(url, params, callback, before) 91 | }; 92 | } 93 | } 94 | 95 | export default urls; -------------------------------------------------------------------------------- /static/javascript/CanvasLayer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 一直覆盖在当前地图视野的Canvas对象 3 | * 4 | * @author nikai (@胖嘟嘟的骨头, nikai@baidu.com) 5 | * 6 | * @param 7 | * { 8 | * map 地图实例对象 9 | * } 10 | */ 11 | 12 | function CanvasLayer(options) { 13 | this.options = options || {}; 14 | this.paneName = this.options.paneName || 'labelPane'; 15 | this.zIndex = this.options.zIndex || 0; 16 | this._map = options.map; 17 | this._lastDrawTime = null; 18 | this.show(); 19 | } 20 | 21 | CanvasLayer.prototype = new BMap.Overlay(); 22 | 23 | CanvasLayer.prototype.initialize = function (map) { 24 | this._map = map; 25 | var canvas = this.canvas = document.createElement("canvas"); 26 | var ctx = this.ctx = this.canvas.getContext('2d'); 27 | canvas.style.cssText = "position:absolute;" + 28 | "left:0;" + 29 | "top:0;" + 30 | "z-index:" + this.zIndex + ";"; 31 | this.adjustSize(); 32 | this.adjustRatio(ctx); 33 | map.getPanes()[this.paneName].appendChild(canvas); 34 | var that = this; 35 | map.addEventListener('resize', function () { 36 | that.adjustSize(); 37 | that._draw(); 38 | }); 39 | return this.canvas; 40 | } 41 | 42 | CanvasLayer.prototype.adjustSize = function () { 43 | var size = this._map.getSize(); 44 | var canvas = this.canvas; 45 | canvas.width = size.width; 46 | canvas.height = size.height; 47 | canvas.style.width = canvas.width + "px"; 48 | canvas.style.height = canvas.height + "px"; 49 | } 50 | 51 | CanvasLayer.prototype.adjustRatio = function (ctx) { 52 | var backingStore = ctx.backingStorePixelRatio || 53 | ctx.webkitBackingStorePixelRatio || 54 | ctx.mozBackingStorePixelRatio || 55 | ctx.msBackingStorePixelRatio || 56 | ctx.oBackingStorePixelRatio || 57 | ctx.backingStorePixelRatio || 1; 58 | var pixelRatio = (window.devicePixelRatio || 1) / backingStore; 59 | var canvasWidth = ctx.canvas.width; 60 | var canvasHeight = ctx.canvas.height; 61 | ctx.canvas.width = canvasWidth * pixelRatio; 62 | ctx.canvas.height = canvasHeight * pixelRatio; 63 | ctx.canvas.style.width = canvasWidth + 'px'; 64 | ctx.canvas.style.height = canvasHeight + 'px'; 65 | ctx.scale(pixelRatio, pixelRatio); 66 | }; 67 | 68 | CanvasLayer.prototype.draw = function () { 69 | var self = this; 70 | var args = arguments; 71 | 72 | clearTimeout(self.timeoutID); 73 | self.timeoutID = setTimeout(function () { 74 | self._draw.apply(self, args); 75 | }, 15); 76 | } 77 | 78 | CanvasLayer.prototype._draw = function () { 79 | var map = this._map; 80 | this.canvas.style.left = -map.offsetX + 'px'; 81 | this.canvas.style.top = -map.offsetY + 'px'; 82 | this.dispatchEvent('draw'); 83 | this.options.update && this.options.update.apply(this, arguments); 84 | 85 | } 86 | 87 | CanvasLayer.prototype.getContainer = function () { 88 | return this.canvas; 89 | } 90 | 91 | CanvasLayer.prototype.show = function () { 92 | if (!this.canvas) { 93 | this._map.addOverlay(this); 94 | } 95 | this.canvas.style.display = "block"; 96 | } 97 | 98 | CanvasLayer.prototype.hide = function () { 99 | this.canvas.style.display = "none"; 100 | //this._map.removeOverlay(this); 101 | } 102 | 103 | CanvasLayer.prototype.setZIndex = function (zIndex) { 104 | this.canvas.style.zIndex = zIndex; 105 | } 106 | 107 | CanvasLayer.prototype.getZIndex = function () { 108 | return this.zIndex; 109 | } -------------------------------------------------------------------------------- /static/javascript/jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Cookie Plugin v1.4.1 3 | * https://github.com/carhartl/jquery-cookie 4 | * 5 | * Copyright 2013 Klaus Hartl 6 | * Released under the MIT license 7 | */ 8 | (function (factory) { 9 | if (typeof define === 'function' && define.amd) { 10 | // AMD 11 | define(['jquery'], factory); 12 | } else if (typeof exports === 'object') { 13 | // CommonJS 14 | factory(require('jquery')); 15 | } else { 16 | // Browser globals 17 | factory(jQuery); 18 | } 19 | }(function ($) { 20 | 21 | var pluses = /\+/g; 22 | 23 | function encode(s) { 24 | return config.raw ? s : encodeURIComponent(s); 25 | } 26 | 27 | function decode(s) { 28 | return config.raw ? s : decodeURIComponent(s); 29 | } 30 | 31 | function stringifyCookieValue(value) { 32 | return encode(config.json ? JSON.stringify(value) : String(value)); 33 | } 34 | 35 | function parseCookieValue(s) { 36 | if (s.indexOf('"') === 0) { 37 | // This is a quoted cookie as according to RFC2068, unescape... 38 | s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); 39 | } 40 | 41 | try { 42 | // Replace server-side written pluses with spaces. 43 | // If we can't decode the cookie, ignore it, it's unusable. 44 | // If we can't parse the cookie, ignore it, it's unusable. 45 | s = decodeURIComponent(s.replace(pluses, ' ')); 46 | return config.json ? JSON.parse(s) : s; 47 | } catch(e) {} 48 | } 49 | 50 | function read(s, converter) { 51 | var value = config.raw ? s : parseCookieValue(s); 52 | return $.isFunction(converter) ? converter(value) : value; 53 | } 54 | 55 | var config = $.cookie = function (key, value, options) { 56 | 57 | // Write 58 | 59 | if (value !== undefined && !$.isFunction(value)) { 60 | options = $.extend({}, config.defaults, options); 61 | 62 | if (typeof options.expires === 'number') { 63 | var days = options.expires, t = options.expires = new Date(); 64 | t.setTime(+t + days * 864e+5); 65 | } 66 | 67 | return (document.cookie = [ 68 | encode(key), '=', stringifyCookieValue(value), 69 | options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 70 | options.path ? '; path=' + options.path : '', 71 | options.domain ? '; domain=' + options.domain : '', 72 | options.secure ? '; secure' : '' 73 | ].join('')); 74 | } 75 | 76 | // Read 77 | 78 | var result = key ? undefined : {}; 79 | 80 | // To prevent the for loop in the first place assign an empty array 81 | // in case there are no cookies at all. Also prevents odd result when 82 | // calling $.cookie(). 83 | var cookies = document.cookie ? document.cookie.split('; ') : []; 84 | 85 | for (var i = 0, l = cookies.length; i < l; i++) { 86 | var parts = cookies[i].split('='); 87 | var name = decode(parts.shift()); 88 | var cookie = parts.join('='); 89 | 90 | if (key && key === name) { 91 | // If second argument (value) is a function it's a converter... 92 | result = read(cookie, value); 93 | break; 94 | } 95 | 96 | // Prevent storing a cookie that we couldn't decode. 97 | if (!key && (cookie = read(cookie)) !== undefined) { 98 | result[name] = cookie; 99 | } 100 | } 101 | 102 | return result; 103 | }; 104 | 105 | config.defaults = {}; 106 | 107 | $.removeCookie = function (key, options) { 108 | if ($.cookie(key) === undefined) { 109 | return false; 110 | } 111 | 112 | // Must not alter options, thus extending a fresh object... 113 | $.cookie(key, '', $.extend({}, options, { expires: -1 })); 114 | return !$.cookie(key); 115 | }; 116 | 117 | })); 118 | -------------------------------------------------------------------------------- /script/modules/trackcontrol/views/monitortab.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 实时监控页签头部分 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.23 4 | */ 5 | import React, { Component } from 'react' 6 | import { render } from 'react-dom' 7 | import TrackStore from '../stores/trackStore' 8 | import TrackAction from '../actions/trackAction' 9 | 10 | 11 | var Monitortab = React.createClass({ 12 | getInitialState: function() { 13 | return { 14 | // 所有entity数量 15 | all: 0, 16 | // 在线entity数量 17 | online: 0, 18 | // 离线entity数量 19 | offline: 0, 20 | // 当前选中的实时监控列表 21 | monitorListTab: 'monitorBottomLineLeft' 22 | } 23 | }, 24 | componentDidMount: function () { 25 | TrackStore.listen(this.onStatusChange); 26 | }, 27 | onStatusChange: function (type,data) { 28 | switch (type){ 29 | case 'totalall': 30 | this.listenTotalAll(data); 31 | break; 32 | case 'totaloffline': 33 | this.listenTotalOffline(data); 34 | break; 35 | case 'totalonline': 36 | this.listenTotalOnline(data); 37 | break; 38 | } 39 | }, 40 | /** 41 | * 响应Store totalall事件,设置全部entity总数 42 | * 43 | * @param {data} 总页数 44 | */ 45 | listenTotalAll: function(data) { 46 | this.setState({all:data}); 47 | }, 48 | /** 49 | * 响应Store totaloffline事件,设置全部entity总数 50 | * 51 | * @param {data} 总页数 52 | */ 53 | listenTotalOffline: function(data) { 54 | this.setState({offline:data}); 55 | }, 56 | /** 57 | * 响应Store totalonline事件,设置全部entity总数 58 | * 59 | * @param {data} 总页数 60 | */ 61 | listenTotalOnline: function(data) { 62 | this.setState({online:data}); 63 | }, 64 | /** 65 | * DOM操作回调,切换实时监控三种列表 66 | * 67 | * @param {object} event 事件对象 68 | */ 69 | handleChangeMonitorList: function(event) { 70 | if (event.target.className === 'monitorAll') { 71 | this.setState({monitorListTab: 'monitorBottomLineLeft'}); 72 | TrackAction.switchmonitortab(0); 73 | } else if (event.target.className === 'monitorOnline') { 74 | this.setState({monitorListTab: 'monitorBottomLineMid'}); 75 | TrackAction.switchmonitortab(1); 76 | } else if (event.target.className === 'monitorOffline') { 77 | this.setState({monitorListTab: 'monitorBottomLineRight'}); 78 | TrackAction.switchmonitortab(2); 79 | } 80 | }, 81 | render: function() { 82 | var all = this.state.all; 83 | var online = this.state.online; 84 | var offline = this.state.offline; 85 | var monitorListTab = this.state.monitorListTab; 86 | return ( 87 |
88 |
89 | 全部({all}) 90 |
91 |
92 | 在线({online}) 93 |
94 |
95 | 离线({offline}) 96 |
97 |
98 |
99 | 100 | ) 101 | } 102 | }); 103 | 104 | export default Monitortab; 105 | -------------------------------------------------------------------------------- /script/modules/trackcontrol/views/boundcontrol.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 控制是否按范围显示entity的控件 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2017.03.18 4 | */ 5 | import React, {Component} from 'react'; 6 | import {render} from 'react-dom'; 7 | import TrackStore from '../stores/trackStore'; 8 | import TrackAction from '../actions/trackAction'; 9 | import CommonStore from '../../common/stores/commonStore'; 10 | 11 | let Boundcontrol = React.createClass({ 12 | getInitialState() { 13 | return { 14 | // 页签编码 0为实时监控 1为轨迹查询 15 | tabIndex: 0, 16 | // 父容器可见性 17 | parentVisible: {}, 18 | // 是否开启 19 | boundSwitch: 'boundOff', 20 | // 当前视野设备的数量 21 | boundTotal: 0, 22 | // 文字描述 23 | describe: '当前视野设备数' 24 | }; 25 | }, 26 | componentDidMount() { 27 | TrackStore.listen(this.onStatusChange); 28 | CommonStore.listen(this.onStatusChange); 29 | }, 30 | onStatusChange(type, data) { 31 | switch (type) { 32 | case 'switchmanagetab': 33 | this.listenSwitchmanageTab(data); 34 | break; 35 | case 'switchtab': 36 | this.listenSwitchTab(data); 37 | break; 38 | case 'boundsearchentitytotal': 39 | this.listenBoundSearchEntityTotal(data); 40 | break; 41 | case 'boundsearchDec': 42 | this.listenBoundsearchDec(data); 43 | break; 44 | } 45 | }, 46 | 47 | 48 | /** 49 | * 响应Store boundsearchDec事件,设置蚊子描述 50 | * 51 | * @param {string} data 文字描述 52 | */ 53 | listenBoundsearchDec(data) { 54 | this.setState({describe: data}); 55 | }, 56 | 57 | /** 58 | * 响应Store boundsearchentitytotal事件,设置当前视野entity数量 59 | * 60 | * @param {number} data entity total数量 61 | */ 62 | listenBoundSearchEntityTotal(data) { 63 | this.setState({boundTotal: data}); 64 | }, 65 | 66 | /** 67 | * 响应Store switchmanagetab事件,设置标签页 68 | * 69 | * @param {number} data 标签页标识 70 | */ 71 | listenSwitchmanageTab(data) { 72 | this.setState({tabIndex: data}); 73 | }, 74 | 75 | /** 76 | * 响应Store list事件,设置标签页 77 | * 78 | * @param {nubmer} data 标签页标识 79 | */ 80 | listenSwitchTab(data) { 81 | if (data === 0) { 82 | this.setState({parentVisible: {}}); 83 | } else { 84 | this.setState({parentVisible: {visibility: 'inherit'}}); 85 | } 86 | }, 87 | 88 | /** 89 | * DOM操作回调,切换设备bound展示的开关 90 | * 91 | * @param {Object} event 事件对象 92 | */ 93 | handleBoundSwitch(event) { 94 | let that = this; 95 | if (that.state.boundSwitch === 'boundOn') { 96 | that.setState({boundSwitch: 'boundOff'}); 97 | TrackAction.switchboundsearch(false); 98 | } else { 99 | that.setState({boundSwitch: 'boundOn'}); 100 | TrackAction.switchboundsearch(true); 101 | } 102 | }, 103 | 104 | render() { 105 | let tabIndex = this.state.tabIndex; 106 | let parentVisible = this.state.parentVisible; 107 | let boundSwitch = this.state.boundSwitch; 108 | let handleBoundSwitch = this.handleBoundSwitch; 109 | let boundTotal = this.state.boundTotal; 110 | let describe = this.state.describe; 111 | return ( 112 |
113 |
全部显示
114 |
115 |
{describe}:{boundTotal}
116 |
117 | ) 118 | } 119 | }); 120 | 121 | export default Boundcontrol; 122 | -------------------------------------------------------------------------------- /script/modules/entitycontrol/views/search.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 检索entity Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.20 4 | */ 5 | 6 | import React, { Component } from 'react' 7 | import { render } from 'react-dom' 8 | import EntityStore from '../stores/entityStore' 9 | import EntityAction from '../actions/entityAction' 10 | 11 | var Search = React.createClass({ 12 | getInitialState: function() { 13 | return { 14 | value: '', 15 | visible:0, 16 | cliking: 0, 17 | placeholder: '' 18 | }; 19 | }, 20 | componentDidMount: function () { 21 | var self = this; 22 | this.state.placeholder = '请输入关键字'; 23 | EntityStore.listen(self.onStatusChange); 24 | }, 25 | onStatusChange: function (type,data) { 26 | switch (type){ 27 | case 'listcomplete': 28 | this.listenListcomplete(type); 29 | break; 30 | 31 | } 32 | }, 33 | listenListcomplete: function() { 34 | this.setState({cliking: 0}); 35 | }, 36 | /** 37 | * DOM操作回调,检索框value改变 38 | * 39 | * @param {object} event 事件对象 40 | */ 41 | handleChange: function(event) { 42 | this.setState({value: event.target.value}); 43 | if(event.target.value != '') { 44 | this.state.visible = 1; 45 | } else { 46 | this.state.visible = 0; 47 | EntityAction.initpageset(); 48 | EntityAction.setsearchentity(''); 49 | EntityAction.list(1); 50 | this.setState({cliking: 1}); 51 | } 52 | }, 53 | /** 54 | * DOM操作回调,检索框value清空 55 | * 56 | * @param {object} event 事件对象 57 | */ 58 | handleClearClick: function(event) { 59 | if (this.state.cliking === 1) { 60 | return; 61 | } 62 | EntityAction.initpageset(); 63 | this.setState({value: '',visible:0}); 64 | EntityAction.setsearchentity(''); 65 | EntityAction.list(1); 66 | this.setState({cliking: 1}); 67 | }, 68 | /** 69 | * DOM操作回调,检索 70 | * 71 | * @param {object} event 事件对象 s 72 | */ 73 | handleClickSearch: function(event) { 74 | if (this.state.cliking === 1) { 75 | return; 76 | } 77 | EntityAction.initpageset(); 78 | EntityAction.setsearchentity(this.state.value); 79 | EntityAction.list(1); 80 | this.setState({cliking: 1}); 81 | }, 82 | /** 83 | * DOM操作回调,点击回车检索 84 | * 85 | * @param {object} event 事件对象 s 86 | */ 87 | handleKeyBoard: function(event) { 88 | if (this.state.cliking === 1) { 89 | return; 90 | } 91 | if (event.key === 'Enter') { 92 | EntityAction.initpageset(); 93 | EntityAction.setsearchentity(this.state.value); 94 | EntityAction.list(1); 95 | this.setState({cliking: 1}); 96 | } 97 | }, 98 | render: function () { 99 | var searchicon = __uri('/static/images/searchicon_2x.png'); 100 | var clearsearch = __uri('/static/images/clearsearch_2x.png'); 101 | var placeholder = this.state.placeholder; 102 | return ( 103 |
104 | 105 | 106 |
107 | 108 |
109 | ) 110 | } 111 | }); 112 | 113 | export default Search; 114 | -------------------------------------------------------------------------------- /script/modules/trackcontrol/views/tracksearch.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 轨迹查询检索entity部分 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.29 4 | */ 5 | import React, { Component } from 'react' 6 | import { render } from 'react-dom' 7 | import TrackStore from '../stores/trackStore' 8 | import TrackAction from '../actions/trackAction' 9 | 10 | var Tracksearch = React.createClass({ 11 | getInitialState: function() { 12 | return { 13 | value: '', 14 | visible:0, 15 | cliking: 0 16 | }; 17 | }, 18 | componentDidMount: function () { 19 | var self = this; 20 | TrackStore.listen(self.onStatusChange); 21 | }, 22 | onStatusChange: function (type,data) { 23 | switch (type){ 24 | case 'tracklistloaded': 25 | this.listenListcomplete(type); 26 | break; 27 | case 'triggersearchentitytrack': 28 | this.listenTriggerSearchEntityTrack(data); 29 | break; 30 | } 31 | }, 32 | 33 | 34 | /** 35 | * 响应Store triggersearchentitytrack事件,触发检索 36 | * 37 | * @param {Object} data 检索对象 38 | */ 39 | listenTriggerSearchEntityTrack(data) { 40 | const eve = { 41 | target: { 42 | value: data.entity_name 43 | } 44 | }; 45 | this.handleChange(eve); 46 | this.handleClickSearch(); 47 | }, 48 | 49 | listenListcomplete: function() { 50 | this.setState({cliking: 0}); 51 | }, 52 | /** 53 | * DOM操作回调,检索框value改变 54 | * 55 | * @param {object} event 事件对象 56 | */ 57 | handleChange: function(event) { 58 | this.setState({value: event.target.value}); 59 | if(event.target.value != '') { 60 | this.state.visible = 1; 61 | } else { 62 | this.state.visible = 0; 63 | TrackAction.initpagesettrack(); 64 | TrackAction.setsearchentitytrack(''); 65 | TrackAction.tracklist(1); 66 | this.setState({cliking: 1}); 67 | } 68 | }, 69 | /** 70 | * DOM操作回调,检索框value清空 71 | * 72 | * @param {object} event 事件对象 73 | */ 74 | handleClearClick: function(event) { 75 | if (this.state.cliking === 1) { 76 | return; 77 | } 78 | TrackAction.initpagesettrack(); 79 | this.setState({value: '',visible:0}); 80 | TrackAction.setsearchentitytrack(''); 81 | TrackAction.tracklist(1); 82 | this.setState({cliking: 1}); 83 | }, 84 | /** 85 | * DOM操作回调,检索 86 | * 87 | * @param {object} event 事件对象 88 | */ 89 | handleClickSearch: function(event) { 90 | if (this.state.cliking === 1) { 91 | return; 92 | } 93 | TrackAction.initpagesettrack(); 94 | TrackAction.setsearchentitytrack(this.state.value); 95 | TrackAction.tracklist(1); 96 | this.setState({cliking: 1}); 97 | }, 98 | /** 99 | * DOM操作回调,点击回车检索 100 | * 101 | * @param {object} event 事件对象 s 102 | */ 103 | handleKeyBoard: function(event) { 104 | if (this.state.cliking === 1) { 105 | return; 106 | } 107 | if (event.key === 'Enter') { 108 | TrackAction.initpagesettrack(); 109 | TrackAction.setsearchentitytrack(this.state.value); 110 | TrackAction.tracklist(1); 111 | this.setState({cliking: 1}); 112 | } 113 | }, 114 | render: function() { 115 | var searchicon = __uri('/static/images/searchicon_2x.png'); 116 | var clearsearch = __uri('/static/images/clearsearch_2x.png'); 117 | return ( 118 |
119 | 120 | 121 |
122 | 123 |
124 | 125 | ) 126 | } 127 | }); 128 | 129 | export default Tracksearch; -------------------------------------------------------------------------------- /static/icheck-1.x/icheck.min.js: -------------------------------------------------------------------------------- 1 | /*! iCheck v1.0.2 by Damir Sultanov, http://git.io/arlzeA, MIT Licensed */ 2 | (function(f){function A(a,b,d){var c=a[0],g=/er/.test(d)?_indeterminate:/bl/.test(d)?n:k,e=d==_update?{checked:c[k],disabled:c[n],indeterminate:"true"==a.attr(_indeterminate)||"false"==a.attr(_determinate)}:c[g];if(/^(ch|di|in)/.test(d)&&!e)x(a,g);else if(/^(un|en|de)/.test(d)&&e)q(a,g);else if(d==_update)for(var f in e)e[f]?x(a,f,!0):q(a,f,!0);else if(!b||"toggle"==d){if(!b)a[_callback]("ifClicked");e?c[_type]!==r&&q(a,g):x(a,g)}}function x(a,b,d){var c=a[0],g=a.parent(),e=b==k,u=b==_indeterminate, 3 | v=b==n,s=u?_determinate:e?y:"enabled",F=l(a,s+t(c[_type])),B=l(a,b+t(c[_type]));if(!0!==c[b]){if(!d&&b==k&&c[_type]==r&&c.name){var w=a.closest("form"),p='input[name="'+c.name+'"]',p=w.length?w.find(p):f(p);p.each(function(){this!==c&&f(this).data(m)&&q(f(this),b)})}u?(c[b]=!0,c[k]&&q(a,k,"force")):(d||(c[b]=!0),e&&c[_indeterminate]&&q(a,_indeterminate,!1));D(a,e,b,d)}c[n]&&l(a,_cursor,!0)&&g.find("."+C).css(_cursor,"default");g[_add](B||l(a,b)||"");g.attr("role")&&!u&&g.attr("aria-"+(v?n:k),"true"); 4 | g[_remove](F||l(a,s)||"")}function q(a,b,d){var c=a[0],g=a.parent(),e=b==k,f=b==_indeterminate,m=b==n,s=f?_determinate:e?y:"enabled",q=l(a,s+t(c[_type])),r=l(a,b+t(c[_type]));if(!1!==c[b]){if(f||!d||"force"==d)c[b]=!1;D(a,e,s,d)}!c[n]&&l(a,_cursor,!0)&&g.find("."+C).css(_cursor,"pointer");g[_remove](r||l(a,b)||"");g.attr("role")&&!f&&g.attr("aria-"+(m?n:k),"false");g[_add](q||l(a,s)||"")}function E(a,b){if(a.data(m)){a.parent().html(a.attr("style",a.data(m).s||""));if(b)a[_callback](b);a.off(".i").unwrap(); 5 | f(_label+'[for="'+a[0].id+'"]').add(a.closest(_label)).off(".i")}}function l(a,b,f){if(a.data(m))return a.data(m).o[b+(f?"":"Class")]}function t(a){return a.charAt(0).toUpperCase()+a.slice(1)}function D(a,b,f,c){if(!c){if(b)a[_callback]("ifToggled");a[_callback]("ifChanged")[_callback]("if"+t(f))}}var m="iCheck",C=m+"-helper",r="radio",k="checked",y="un"+k,n="disabled";_determinate="determinate";_indeterminate="in"+_determinate;_update="update";_type="type";_click="click";_touch="touchbegin.i touchend.i"; 6 | _add="addClass";_remove="removeClass";_callback="trigger";_label="label";_cursor="cursor";_mobile=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);f.fn[m]=function(a,b){var d='input[type="checkbox"], input[type="'+r+'"]',c=f(),g=function(a){a.each(function(){var a=f(this);c=a.is(d)?c.add(a):c.add(a.find(d))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(a))return a=a.toLowerCase(),g(this),c.each(function(){var c= 7 | f(this);"destroy"==a?E(c,"ifDestroyed"):A(c,!0,a);f.isFunction(b)&&b()});if("object"!=typeof a&&a)return this;var e=f.extend({checkedClass:k,disabledClass:n,indeterminateClass:_indeterminate,labelHover:!0},a),l=e.handle,v=e.hoverClass||"hover",s=e.focusClass||"focus",t=e.activeClass||"active",B=!!e.labelHover,w=e.labelHoverClass||"hover",p=(""+e.increaseArea).replace("%","")|0;if("checkbox"==l||l==r)d='input[type="'+l+'"]';-50>p&&(p=-50);g(this);return c.each(function(){var a=f(this);E(a);var c=this, 8 | b=c.id,g=-p+"%",d=100+2*p+"%",d={position:"absolute",top:g,left:g,display:"block",width:d,height:d,margin:0,padding:0,background:"#fff",border:0,opacity:0},g=_mobile?{position:"absolute",visibility:"hidden"}:p?d:{position:"absolute",opacity:0},l="checkbox"==c[_type]?e.checkboxClass||"icheckbox":e.radioClass||"i"+r,z=f(_label+'[for="'+b+'"]').add(a.closest(_label)),u=!!e.aria,y=m+"-"+Math.random().toString(36).substr(2,6),h='
")[_callback]("ifCreated").parent().append(e.insert);d=f('').css(d).appendTo(h);a.data(m,{o:e,s:a.attr("style")}).css(g);e.inheritClass&&h[_add](c.className||"");e.inheritID&&b&&h.attr("id",m+"-"+b);"static"==h.css("position")&&h.css("position","relative");A(a,!0,_update);if(z.length)z.on(_click+".i mouseover.i mouseout.i "+_touch,function(b){var d=b[_type],e=f(this);if(!c[n]){if(d==_click){if(f(b.target).is("a"))return; 10 | A(a,!1,!0)}else B&&(/ut|nd/.test(d)?(h[_remove](v),e[_remove](w)):(h[_add](v),e[_add](w)));if(_mobile)b.stopPropagation();else return!1}});a.on(_click+".i focus.i blur.i keyup.i keydown.i keypress.i",function(b){var d=b[_type];b=b.keyCode;if(d==_click)return!1;if("keydown"==d&&32==b)return c[_type]==r&&c[k]||(c[k]?q(a,k):x(a,k)),!1;if("keyup"==d&&c[_type]==r)!c[k]&&x(a,k);else if(/us|ur/.test(d))h["blur"==d?_remove:_add](s)});d.on(_click+" mousedown mouseup mouseover mouseout "+_touch,function(b){var d= 11 | b[_type],e=/wn|up/.test(d)?t:v;if(!c[n]){if(d==_click)A(a,!1,!0);else{if(/wn|er|in/.test(d))h[_add](e);else h[_remove](e+" "+t);if(z.length&&B&&e==v)z[/ut|nd/.test(d)?_remove:_add](w)}if(_mobile)b.stopPropagation();else return!1}})})}})(window.jQuery||window.Zepto); 12 | -------------------------------------------------------------------------------- /script/modules/trackcontrol/views/monitorpage.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 轨迹监控页码翻页部分 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.24 4 | */ 5 | 6 | import React, { Component } from 'react' 7 | import { render } from 'react-dom' 8 | import TrackAction from '../actions/trackAction' 9 | import TrackStore from '../stores/trackStore' 10 | 11 | var Monitorpage = React.createClass({ 12 | getInitialState: function() { 13 | return { 14 | // 当前页码 15 | currentPage: 1, 16 | // 输入框中的页码 17 | inputPage: 1, 18 | // 总页码 19 | totalPage: 0, 20 | // 上一页按钮的样式,分为lasepageon&lastPageOff两种 21 | lastPage: 'lastPageOff', 22 | // 下一页按钮的样式,分为nextPageOn&nextPageOff两种 23 | nextPage: 'nextPageOff', 24 | // 翻页状态,当正在翻页过程中,翻页按钮不可点 25 | cliking: 0 26 | } 27 | }, 28 | componentDidMount: function () { 29 | TrackStore.listen(this.onStatusChange); 30 | }, 31 | onStatusChange: function (type,data) { 32 | switch (type){ 33 | case 'totalpage': 34 | this.listenTotalpage(data); 35 | break; 36 | case 'listcomplete': 37 | this.listenListcomplete(); 38 | break; 39 | } 40 | }, 41 | /** 42 | * 响应Store totalpage事件,设置总数量量 43 | * 44 | * @param {data} 总页数 45 | */ 46 | listenTotalpage: function(data) { 47 | this.setState({totalPage:data}); 48 | this.setSwichPageStyle(this.state.currentPage); 49 | }, 50 | /** 51 | * 响应Store listcomplete事件,开启翻页按钮可点 52 | * 53 | */ 54 | listenListcomplete: function() { 55 | this.setState({cliking: 0}); 56 | }, 57 | /** 58 | * DOM操作回调,页码输入value变化 59 | * 60 | * @param {object} event 事件对象 61 | */ 62 | handleChange: function (event) { 63 | this.setState({inputPage:parseInt(event.target.value)}); 64 | }, 65 | /** 66 | * DOM操作回调,点击跳转页面按钮 67 | * 68 | * @param {object} event 事件对象 69 | */ 70 | handleJumppage: function (event) { 71 | var jumpPage = this.state.inputPage; 72 | this.setState({currentPage: jumpPage}); 73 | TrackAction.list(jumpPage); 74 | }, 75 | /** 76 | * DOM操作回调,点击上一页 77 | * 78 | * @param {object} event 事件对象 79 | */ 80 | handleLastpage: function (event) { 81 | if(this.state.currentPage === 1 || this.state.cliking === 1) { 82 | return; 83 | } else { 84 | var lastPage = this.state.currentPage - 1; 85 | this.setState({currentPage: lastPage}); 86 | this.setState({inputPage: lastPage}); 87 | TrackAction.list(lastPage); 88 | this.setState({cliking: 1}); 89 | } 90 | }, 91 | /** 92 | * DOM操作回调,点击下一页 93 | * 94 | * @param {object} event 事件对象 95 | */ 96 | handleNextpage: function (event) { 97 | if(this.state.currentPage === this.state.totalPage || this.state.cliking === 1) { 98 | return; 99 | } else { 100 | var nextPage = this.state.currentPage + 1; 101 | this.setState({currentPage: nextPage}); 102 | this.setState({inputPage: nextPage}); 103 | TrackAction.list(nextPage); 104 | this.setState({cliking: 1}); 105 | } 106 | }, 107 | /** 108 | * view内部,设置翻页按钮样式 109 | * 110 | * @param {number} jumpPage 要跳转到的页 111 | */ 112 | setSwichPageStyle: function (jumpPage) { 113 | if(jumpPage === 1) { 114 | this.setState({lastPage: 'lastPageOff'}); 115 | } else { 116 | this.setState({lastPage: 'lastPageOn'}); 117 | } 118 | if(jumpPage === this.state.totalPage) { 119 | this.setState({nextPage: 'nextPageOff'}); 120 | } else { 121 | this.setState({nextPage: 'nextPageOn'}); 122 | } 123 | this.setState({currentPage: jumpPage}); 124 | }, 125 | render: function () { 126 | var currentPage = this.state.currentPage; 127 | var totalPage = this.state.totalPage; 128 | var lastPage = this.state.lastPage; 129 | var nextPage = this.state.nextPage; 130 | var inputPage = this.state.inputPage; 131 | return ( 132 |
133 |
134 | 135 | /{' ' + totalPage}页 136 | GO 137 |
138 |
139 | 140 | 141 |
142 |
143 | ) 144 | } 145 | }); 146 | 147 | export default Monitorpage; 148 | -------------------------------------------------------------------------------- /script/modules/trackcontrol/views/monitorsearch.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 实时监控检索entity部分 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.23 4 | */ 5 | import React, { Component } from 'react' 6 | import { render } from 'react-dom' 7 | import TrackStore from '../stores/trackStore' 8 | import TrackAction from '../actions/trackAction' 9 | 10 | 11 | var Monitorsearch = React.createClass({ 12 | getInitialState: function() { 13 | return { 14 | value: '', 15 | visible:0, 16 | clikingAll: 0, 17 | clikingOnline: 0, 18 | clikingOffline: 0 19 | }; 20 | }, 21 | componentDidMount: function () { 22 | var self = this; 23 | TrackStore.listen(self.onStatusChange); 24 | }, 25 | onStatusChange: function (type,data) { 26 | switch (type){ 27 | case 'alllist': 28 | this.listenAlllist(); 29 | break; 30 | case 'onlinelist': 31 | this.listenOnlinelist(); 32 | break; 33 | case 'offlinelist': 34 | this.listenOfflinelist(); 35 | break; 36 | 37 | } 38 | }, 39 | listenAlllist: function() { 40 | this.setState({clikingAll: 0}); 41 | }, 42 | listenOnlinelist: function() { 43 | this.setState({clikingOnline: 0}); 44 | }, 45 | listenOfflinelist: function() { 46 | this.setState({clikingOffline: 0}); 47 | }, 48 | /** 49 | * DOM操作回调,检索框value改变 50 | * 51 | * @param {object} event 事件对象 52 | */ 53 | handleChange: function(event) { 54 | this.setState({value: event.target.value}); 55 | if(event.target.value != '') { 56 | this.state.visible = 1; 57 | } else { 58 | this.state.visible = 0; 59 | TrackAction.initpageset(); 60 | TrackAction.setsearchentity(''); 61 | TrackAction.searchallentity(1); 62 | TrackAction.searchonlineentity(1); 63 | TrackAction.searchofflineentity(1); 64 | this.setState({cliking: 3}); 65 | } 66 | }, 67 | /** 68 | * DOM操作回调,检索框value清空 69 | * 70 | * @param {object} event 事件对象 71 | */ 72 | handleClearClick: function(event) { 73 | if (this.state.clikingAll !== 0 || this.state.clikingOnline !== 0 || this.state.clikingOffline !== 0) { 74 | return; 75 | } 76 | TrackAction.initpageset(); 77 | this.setState({value: '',visible:0}); 78 | TrackAction.setsearchentity(''); 79 | TrackAction.searchallentity(1); 80 | TrackAction.searchonlineentity(1); 81 | TrackAction.searchofflineentity(1); 82 | 83 | this.setState({clikingAll: 1}); 84 | this.setState({clikingOnline: 1}); 85 | this.setState({clikingOffline: 1}); 86 | }, 87 | /** 88 | * DOM操作回调,检索 89 | * 90 | * @param {object} event 事件对象 91 | */ 92 | handleClickSearch: function(event) { 93 | if (this.state.clikingAll !== 0 || this.state.clikingOnline !== 0 || this.state.clikingOffline !== 0) { 94 | return; 95 | } 96 | TrackAction.initpageset(); 97 | TrackAction.setsearchentity(this.state.value); 98 | TrackAction.searchallentity(1); 99 | TrackAction.searchonlineentity(1); 100 | TrackAction.searchofflineentity(1); 101 | this.setState({clikingAll: 1}); 102 | this.setState({clikingOnline: 1}); 103 | this.setState({clikingOffline: 1}); 104 | }, 105 | /** 106 | * DOM操作回调,点击回车检索 107 | * 108 | * @param {object} event 事件对象 s 109 | */ 110 | handleKeyBoard: function(event) { 111 | if (this.state.clikingAll !== 0 || this.state.clikingOnline !== 0 || this.state.clikingOffline !== 0) { 112 | return; 113 | } 114 | if (event.key === 'Enter') { 115 | TrackAction.initpageset(); 116 | TrackAction.setsearchentity(this.state.value); 117 | TrackAction.searchallentity(1); 118 | TrackAction.searchonlineentity(1); 119 | TrackAction.searchofflineentity(1); 120 | this.setState({clikingAll: 1}); 121 | this.setState({clikingOnline: 1}); 122 | this.setState({clikingOffline: 1}); 123 | } 124 | }, 125 | render: function() { 126 | var searchicon = __uri('/static/images/searchicon_2x.png'); 127 | var clearsearch = __uri('/static/images/clearsearch_2x.png'); 128 | return ( 129 |
130 | 131 | 132 |
133 | 134 |
135 | 136 | ) 137 | } 138 | }); 139 | 140 | export default Monitorsearch; 141 | -------------------------------------------------------------------------------- /components/react-dom/README.md: -------------------------------------------------------------------------------- 1 | # [React](https://facebook.github.io/react/) [![Build Status](https://img.shields.io/travis/facebook/react/master.svg?style=flat)](https://travis-ci.org/facebook/react) [![Coverage Status](https://img.shields.io/coveralls/facebook/react/master.svg?style=flat)](https://coveralls.io/github/facebook/react?branch=master) [![npm version](https://img.shields.io/npm/v/react.svg?style=flat)](https://www.npmjs.com/package/react) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md#pull-requests) 2 | 3 | React is a JavaScript library for building user interfaces. 4 | 5 | * **Just the UI:** Lots of people use React as the V in MVC. Since React makes no assumptions about the rest of your technology stack, it's easy to try it out on a small feature in an existing project. 6 | * **Virtual DOM:** React abstracts away the DOM from you, giving a simpler programming model and better performance. React can also render on the server using Node, and it can power native apps using [React Native](https://facebook.github.io/react-native/). 7 | * **Data flow:** React implements one-way reactive data flow which reduces boilerplate and is easier to reason about than traditional data binding. 8 | 9 | **NEW**! Check out our newest project [React Native](https://github.com/facebook/react-native), which uses React and JavaScript to create native mobile apps. 10 | 11 | [Learn how to use React in your own project](https://facebook.github.io/react/docs/getting-started.html). 12 | 13 | ## Examples 14 | 15 | We have several examples [on the website](https://facebook.github.io/react/). Here is the first one to get you started: 16 | 17 | ```js 18 | var HelloMessage = React.createClass({ 19 | render: function() { 20 | return
Hello {this.props.name}
; 21 | } 22 | }); 23 | 24 | ReactDOM.render( 25 | , 26 | document.getElementById('container') 27 | ); 28 | ``` 29 | 30 | This example will render "Hello John" into a container on the page. 31 | 32 | You'll notice that we used an HTML-like syntax; [we call it JSX](https://facebook.github.io/react/docs/jsx-in-depth.html). JSX is not required to use React, but it makes code more readable, and writing it feels like writing HTML. A simple transform is included with React that allows converting JSX into native JavaScript for browsers to digest. 33 | 34 | ## Installation 35 | 36 | The fastest way to get started is to serve JavaScript from the CDN (also available on [cdnjs](https://cdnjs.com/libraries/react) and [jsdelivr](https://www.jsdelivr.com/projects/react)): 37 | 38 | ```html 39 | 40 | 41 | 42 | 43 | ``` 44 | 45 | We've also built a [starter kit](https://facebook.github.io/react/downloads/react-15.1.0.zip) which might be useful if this is your first time using React. It includes a webpage with an example of using React with live code. 46 | 47 | If you'd like to use [bower](http://bower.io), it's as easy as: 48 | 49 | ```sh 50 | bower install --save react 51 | ``` 52 | 53 | And it's just as easy with [npm](http://npmjs.com): 54 | 55 | ```sh 56 | npm i --save react 57 | ``` 58 | 59 | ## Contribute 60 | 61 | The main purpose of this repository is to continue to evolve React core, making it faster and easier to use. If you're interested in helping with that, then keep reading. If you're not interested in helping right now that's ok too. :) Any feedback you have about using React would be greatly appreciated. 62 | 63 | ### Building Your Copy of React 64 | 65 | The process to build `react.js` is built entirely on top of node.js, using many libraries you may already be familiar with. 66 | 67 | #### Prerequisites 68 | 69 | * You have `node` installed at v4.0.0+ and `npm` at v2.0.0+. 70 | * You are familiar with `npm` and know whether or not you need to use `sudo` when installing packages globally. 71 | * You are familiar with `git`. 72 | 73 | #### Build 74 | 75 | Once you have the repository cloned, building a copy of `react.js` is really easy. 76 | 77 | ```sh 78 | # grunt-cli is needed by grunt; you might have this installed already 79 | npm install -g grunt-cli 80 | npm install 81 | grunt build 82 | ``` 83 | 84 | At this point, you should now have a `build/` directory populated with everything you need to use React. The examples should all work. 85 | 86 | ### Grunt 87 | 88 | We use grunt to automate many tasks. Run `grunt -h` to see a mostly complete listing. The important ones to know: 89 | 90 | ```sh 91 | # Build and run tests with PhantomJS 92 | grunt test 93 | # Lint the code with ESLint 94 | grunt lint 95 | # Wipe out build directory 96 | grunt clean 97 | ``` 98 | 99 | ### Good First Bug 100 | To help you get your feet wet and get you familiar with our contribution process, we have a list of [good first bugs](https://github.com/facebook/react/labels/good%20first%20bug) that contain bugs which are fairly easy to fix. This is a great place to get started. 101 | 102 | 103 | ### License 104 | 105 | React is [BSD licensed](./LICENSE). We also provide an additional [patent grant](./PATENTS). 106 | 107 | React documentation is [Creative Commons licensed](./LICENSE-docs). 108 | 109 | Examples provided in this repository and in the documentation are [separately licensed](./LICENSE-examples). 110 | 111 | ### More… 112 | 113 | There's only so much we can cram in here. To read more about the community and guidelines for submitting pull requests, please read the [Contributing document](CONTRIBUTING.md). 114 | 115 | ## Troubleshooting 116 | See the [Troubleshooting Guide](https://github.com/facebook/react/wiki/Troubleshooting) 117 | -------------------------------------------------------------------------------- /components/react/README.md: -------------------------------------------------------------------------------- 1 | # [React](https://facebook.github.io/react/) [![Build Status](https://img.shields.io/travis/facebook/react/master.svg?style=flat)](https://travis-ci.org/facebook/react) [![Coverage Status](https://img.shields.io/coveralls/facebook/react/master.svg?style=flat)](https://coveralls.io/github/facebook/react?branch=master) [![npm version](https://img.shields.io/npm/v/react.svg?style=flat)](https://www.npmjs.com/package/react) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md#pull-requests) 2 | 3 | React is a JavaScript library for building user interfaces. 4 | 5 | * **Just the UI:** Lots of people use React as the V in MVC. Since React makes no assumptions about the rest of your technology stack, it's easy to try it out on a small feature in an existing project. 6 | * **Virtual DOM:** React abstracts away the DOM from you, giving a simpler programming model and better performance. React can also render on the server using Node, and it can power native apps using [React Native](https://facebook.github.io/react-native/). 7 | * **Data flow:** React implements one-way reactive data flow which reduces boilerplate and is easier to reason about than traditional data binding. 8 | 9 | **NEW**! Check out our newest project [React Native](https://github.com/facebook/react-native), which uses React and JavaScript to create native mobile apps. 10 | 11 | [Learn how to use React in your own project](https://facebook.github.io/react/docs/getting-started.html). 12 | 13 | ## Examples 14 | 15 | We have several examples [on the website](https://facebook.github.io/react/). Here is the first one to get you started: 16 | 17 | ```js 18 | var HelloMessage = React.createClass({ 19 | render: function() { 20 | return
Hello {this.props.name}
; 21 | } 22 | }); 23 | 24 | ReactDOM.render( 25 | , 26 | document.getElementById('container') 27 | ); 28 | ``` 29 | 30 | This example will render "Hello John" into a container on the page. 31 | 32 | You'll notice that we used an HTML-like syntax; [we call it JSX](https://facebook.github.io/react/docs/jsx-in-depth.html). JSX is not required to use React, but it makes code more readable, and writing it feels like writing HTML. A simple transform is included with React that allows converting JSX into native JavaScript for browsers to digest. 33 | 34 | ## Installation 35 | 36 | The fastest way to get started is to serve JavaScript from the CDN (also available on [cdnjs](https://cdnjs.com/libraries/react) and [jsdelivr](https://www.jsdelivr.com/projects/react)): 37 | 38 | ```html 39 | 40 | 41 | 42 | 43 | ``` 44 | 45 | We've also built a [starter kit](https://facebook.github.io/react/downloads/react-15.1.0.zip) which might be useful if this is your first time using React. It includes a webpage with an example of using React with live code. 46 | 47 | If you'd like to use [bower](http://bower.io), it's as easy as: 48 | 49 | ```sh 50 | bower install --save react 51 | ``` 52 | 53 | And it's just as easy with [npm](http://npmjs.com): 54 | 55 | ```sh 56 | npm i --save react 57 | ``` 58 | 59 | ## Contribute 60 | 61 | The main purpose of this repository is to continue to evolve React core, making it faster and easier to use. If you're interested in helping with that, then keep reading. If you're not interested in helping right now that's ok too. :) Any feedback you have about using React would be greatly appreciated. 62 | 63 | ### Building Your Copy of React 64 | 65 | The process to build `react.js` is built entirely on top of node.js, using many libraries you may already be familiar with. 66 | 67 | #### Prerequisites 68 | 69 | * You have `node` installed at v4.0.0+ and `npm` at v2.0.0+. 70 | * You are familiar with `npm` and know whether or not you need to use `sudo` when installing packages globally. 71 | * You are familiar with `git`. 72 | 73 | #### Build 74 | 75 | Once you have the repository cloned, building a copy of `react.js` is really easy. 76 | 77 | ```sh 78 | # grunt-cli is needed by grunt; you might have this installed already 79 | npm install -g grunt-cli 80 | npm install 81 | grunt build 82 | ``` 83 | 84 | At this point, you should now have a `build/` directory populated with everything you need to use React. The examples should all work. 85 | 86 | ### Grunt 87 | 88 | We use grunt to automate many tasks. Run `grunt -h` to see a mostly complete listing. The important ones to know: 89 | 90 | ```sh 91 | # Build and run tests with PhantomJS 92 | grunt test 93 | # Lint the code with ESLint 94 | grunt lint 95 | # Wipe out build directory 96 | grunt clean 97 | ``` 98 | 99 | ### Good First Bug 100 | To help you get your feet wet and get you familiar with our contribution process, we have a list of [good first bugs](https://github.com/facebook/react/labels/good%20first%20bug) that contain bugs which are fairly easy to fix. This is a great place to get started. 101 | 102 | 103 | ### License 104 | 105 | React is [BSD licensed](./LICENSE). We also provide an additional [patent grant](./PATENTS). 106 | 107 | React documentation is [Creative Commons licensed](./LICENSE-docs). 108 | 109 | Examples provided in this repository and in the documentation are [separately licensed](./LICENSE-examples). 110 | 111 | ### More… 112 | 113 | There's only so much we can cram in here. To read more about the community and guidelines for submitting pull requests, please read the [Contributing document](CONTRIBUTING.md). 114 | 115 | ## Troubleshooting 116 | See the [Troubleshooting Guide](https://github.com/facebook/react/wiki/Troubleshooting) 117 | -------------------------------------------------------------------------------- /script/modules/trackcontrol/views/monitorofflinecontent.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 实时监控离线 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.23 4 | */ 5 | import React, { Component } from 'react' 6 | import { render } from 'react-dom' 7 | import TrackStore from '../stores/trackStore' 8 | import CommonStore from '../../common/stores/commonStore' 9 | import MonitorOfflinePage from 'monitorofflinepage' 10 | import TrackAction from '../actions/trackAction' 11 | 12 | var Monitorofflinecontent = React.createClass({ 13 | getInitialState: function() { 14 | return { 15 | // 页签编码 0为实时监控 1为轨迹查询 16 | tabIndex: 0, 17 | // monitor三种列表类型编码 0全部 1在线 2离线 18 | monitorTabIndex: 0, 19 | // 父容器可见性 20 | parentVisible: {}, 21 | // 当前列表内容 22 | allEntity: [], 23 | // 当前选中的entityname 24 | currentEntityName: '' 25 | } 26 | }, 27 | componentDidMount: function () { 28 | TrackStore.listen(this.onStatusChange); 29 | CommonStore.listen(this.onStatusChange); 30 | // TrackAction.listcolumn(); 31 | }, 32 | onStatusChange: function (type,data) { 33 | switch (type){ 34 | case 'switchmanagetab': 35 | this.listenSwitchmanageTab(data); 36 | break; 37 | case 'switchtab': 38 | this.listenSwitchTab(data); 39 | break; 40 | case 'switchmonitortab': 41 | this.listenSwitchMonitorTab(data); 42 | break; 43 | case 'listcolumn': 44 | this.listenListColumn(); 45 | break; 46 | case 'offlinelist': 47 | this.listenOfflineList(data); 48 | break; 49 | } 50 | }, 51 | /** 52 | * 响应Store list事件,设置标签页 53 | * 54 | * @param {data} 标签页标识 55 | */ 56 | listenSwitchmanageTab: function(data) { 57 | var that = this; 58 | if (data === 0){ 59 | this.setState({parentVisible: {}}); 60 | } else { 61 | this.setState({parentVisible: {visibility: 'inherit'}}); 62 | } 63 | }, 64 | /** 65 | * 响应Store switchtab事件,隐藏manage 66 | * 67 | * @param {data} 标签页标识 68 | */ 69 | listenSwitchTab: function(data) { 70 | var that = this; 71 | if (data === 0){ 72 | switch (that.state.monitorTabIndex) { 73 | case 0: 74 | this.setState({parentVisible: {}}); 75 | break; 76 | case 1: 77 | this.setState({parentVisible: {}}); 78 | break; 79 | case 2: 80 | this.setState({parentVisible: {visibility: 'inherit'}}); 81 | break; 82 | } 83 | this.setState({tabIndex: 0}); 84 | } else { 85 | this.setState({parentVisible: {visibility: 'inherit'}}); 86 | this.setState({tabIndex: 1}); 87 | } 88 | }, 89 | /** 90 | * 响应Store switchmonitortab事件,设置标签页 91 | * 92 | * @param {data} 标签页标识 93 | */ 94 | listenSwitchMonitorTab: function(data) { 95 | this.setState({parentVisible: {}}); 96 | this.setState({monitorTabIndex: data}); 97 | }, 98 | /** 99 | * 响应Store listcolumn事件,设置标签页 100 | * 101 | */ 102 | listenListColumn: function() { 103 | TrackAction.searchofflineentity(1); 104 | }, 105 | /** 106 | * 响应Store offlinelist事件,设置列表 107 | * 108 | * @param {data} entity数据 109 | */ 110 | listenOfflineList: function(data) { 111 | this.setState({allEntity:data}); 112 | }, 113 | /** 114 | * DOM操作回调,点击选中一辆车 115 | * 116 | * @param {object} event 事件对象 117 | */ 118 | handleSelectCar: function(event) { 119 | var realTarget = event.target; 120 | if (event.target.parentElement.className.indexOf('monitorListItem') > -1) { 121 | realTarget = event.target.parentElement; 122 | } 123 | if (event.target.parentElement.parentElement.className.indexOf('monitorListItem') > -1) { 124 | realTarget = event.target.parentElement.parentElement; 125 | } 126 | var entity_name = realTarget.getAttribute('data-entity_name'); 127 | var entity_status =realTarget.getAttribute('data-entity_status'); 128 | // $('.monitorListItem0, .monitorListItem1, .monitorListItem2').removeClass('monitorSelect'); 129 | // $(realTarget).addClass('monitorSelect'); 130 | var entity_id = realTarget.getAttribute('data-entity_id'); 131 | this.setState({currentEntityName: entity_name}); 132 | TrackAction.selectcar(entity_name, entity_status, entity_id, 'offlineCompleteEntities'); 133 | }, 134 | render: function() { 135 | var monitorTabIndex = this.state.monitorTabIndex; 136 | var parentVisible = this.state.parentVisible; 137 | var allEntity = this.state.allEntity; 138 | var handleSelectCar = this.handleSelectCar; 139 | var currentEntityName = this.state.currentEntityName; 140 | return ( 141 |
142 |
143 | { 144 | allEntity.map(function(item, key) { 145 | return ( 146 |
147 |
{item[5]}
148 |
149 | ) 150 | }) 151 | } 152 |
153 | 154 |
155 | 156 | ) 157 | } 158 | }); 159 | 160 | export default Monitorofflinecontent; 161 | -------------------------------------------------------------------------------- /static/javascript/Polyfill.js: -------------------------------------------------------------------------------- 1 | // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ 2 | // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating 3 | // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel 4 | // MIT license 5 | (function() { 6 | var lastTime = 0; 7 | var vendors = ['ms', 'moz', 'webkit', 'o']; 8 | for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { 9 | window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']; 10 | window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame']; 11 | } 12 | if (!window.requestAnimationFrame) window.requestAnimationFrame = function(callback, element) { 13 | var currTime = new Date().getTime(); 14 | var timeToCall = Math.max(0, 16 - (currTime - lastTime)); 15 | var id = window.setTimeout(function() { 16 | callback(currTime + timeToCall); 17 | }, timeToCall); 18 | lastTime = currTime + timeToCall; 19 | return id; 20 | }; 21 | if (!window.cancelAnimationFrame) window.cancelAnimationFrame = function(id) { 22 | clearTimeout(id); 23 | }; 24 | if (!Array.prototype.findIndex) { 25 | Array.prototype.findIndex = function(predicate) { 26 | 'use strict'; 27 | if (this == null) { 28 | throw new TypeError('Array.prototype.findIndex called on null or undefined'); 29 | } 30 | if (typeof predicate !== 'function') { 31 | throw new TypeError('predicate must be a function'); 32 | } 33 | var list = Object(this); 34 | var length = list.length >>> 0; 35 | var thisArg = arguments[1]; 36 | var value; 37 | 38 | for (var i = 0; i < length; i++) { 39 | value = list[i]; 40 | if (predicate.call(thisArg, value, i, list)) { 41 | return i; 42 | } 43 | } 44 | return -1; 45 | }; 46 | } 47 | if (typeof Object.assign != 'function') { 48 | Object.assign = function(target) { 49 | 'use strict'; 50 | if (target == null) { 51 | throw new TypeError('Cannot convert undefined or null to object'); 52 | } 53 | 54 | target = Object(target); 55 | for (var index = 1; index < arguments.length; index++) { 56 | var source = arguments[index]; 57 | if (source != null) { 58 | for (var key in source) { 59 | if (Object.prototype.hasOwnProperty.call(source, key)) { 60 | target[key] = source[key]; 61 | } 62 | } 63 | } 64 | } 65 | return target; 66 | }; 67 | } 68 | if (!Array.prototype.fill) { 69 | Array.prototype.fill = function(value) { 70 | 71 | // Steps 1-2. 72 | if (this == null) { 73 | throw new TypeError('this is null or not defined'); 74 | } 75 | 76 | var O = Object(this); 77 | 78 | // Steps 3-5. 79 | var len = O.length >>> 0; 80 | 81 | // Steps 6-7. 82 | var start = arguments[1]; 83 | var relativeStart = start >> 0; 84 | 85 | // Step 8. 86 | var k = relativeStart < 0 ? 87 | Math.max(len + relativeStart, 0) : 88 | Math.min(relativeStart, len); 89 | 90 | // Steps 9-10. 91 | var end = arguments[2]; 92 | var relativeEnd = end === undefined ? 93 | len : end >> 0; 94 | 95 | // Step 11. 96 | var final = relativeEnd < 0 ? 97 | Math.max(len + relativeEnd, 0) : 98 | Math.min(relativeEnd, len); 99 | 100 | // Step 12. 101 | while (k < final) { 102 | O[k] = value; 103 | k++; 104 | } 105 | 106 | // Step 13. 107 | return O; 108 | }; 109 | } 110 | if (!Array.prototype.find) { 111 | Array.prototype.find = function(predicate) { 112 | 'use strict'; 113 | if (this == null) { 114 | throw new TypeError('Array.prototype.find called on null or undefined'); 115 | } 116 | if (typeof predicate !== 'function') { 117 | throw new TypeError('predicate must be a function'); 118 | } 119 | var list = Object(this); 120 | var length = list.length >>> 0; 121 | var thisArg = arguments[1]; 122 | var value; 123 | 124 | for (var i = 0; i < length; i++) { 125 | value = list[i]; 126 | if (predicate.call(thisArg, value, i, list)) { 127 | return value; 128 | } 129 | } 130 | return undefined; 131 | }; 132 | } 133 | // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys 134 | if (!Object.keys) { 135 | Object.keys = (function() { 136 | 'use strict'; 137 | var hasOwnProperty = Object.prototype.hasOwnProperty, 138 | hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'), 139 | dontEnums = [ 140 | 'toString', 141 | 'toLocaleString', 142 | 'valueOf', 143 | 'hasOwnProperty', 144 | 'isPrototypeOf', 145 | 'propertyIsEnumerable', 146 | 'constructor' 147 | ], 148 | dontEnumsLength = dontEnums.length; 149 | 150 | return function(obj) { 151 | if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) { 152 | throw new TypeError('Object.keys called on non-object'); 153 | } 154 | 155 | var result = [], prop, i; 156 | 157 | for (prop in obj) { 158 | if (hasOwnProperty.call(obj, prop)) { 159 | result.push(prop); 160 | } 161 | } 162 | 163 | if (hasDontEnumBug) { 164 | for (i = 0; i < dontEnumsLength; i++) { 165 | if (hasOwnProperty.call(obj, dontEnums[i])) { 166 | result.push(dontEnums[i]); 167 | } 168 | } 169 | } 170 | return result; 171 | }; 172 | }()); 173 | } 174 | }()); -------------------------------------------------------------------------------- /script/modules/trackcontrol/views/monitoronlinecontent.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 实时监控离线 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.23 4 | */ 5 | import React, { Component } from 'react' 6 | import { render } from 'react-dom' 7 | import TrackStore from '../stores/trackStore' 8 | import CommonStore from '../../common/stores/commonStore' 9 | import MonitorOnlinePage from 'monitoronlinepage' 10 | import TrackAction from '../actions/trackAction' 11 | 12 | var Monitoronlinecontent = React.createClass({ 13 | getInitialState: function() { 14 | return { 15 | // 页签编码 0为实时监控 1为轨迹查询 16 | tabIndex: 0, 17 | // monitor三种列表类型编码 0全部 1在线 2离线 18 | monitorTabIndex: 0, 19 | // 父容器可见性 20 | parentVisible: {}, 21 | // 当前列表内容 22 | allEntity: [], 23 | // 当前选中的entityname 24 | currentEntityName: '' 25 | } 26 | }, 27 | componentDidMount: function () { 28 | TrackStore.listen(this.onStatusChange); 29 | CommonStore.listen(this.onStatusChange); 30 | // TrackAction.listcolumn(); 31 | }, 32 | onStatusChange: function (type,data) { 33 | switch (type){ 34 | case 'switchmanagetab': 35 | this.listenSwitchmanageTab(data); 36 | break; 37 | case 'switchtab': 38 | this.listenSwitchTab(data); 39 | break; 40 | case 'switchmonitortab': 41 | this.listenSwitchMonitorTab(data); 42 | break; 43 | case 'listcolumn': 44 | this.listenListColumn(); 45 | break; 46 | case 'onlinelist': 47 | this.listenOnlineList(data); 48 | break; 49 | } 50 | }, 51 | /** 52 | * 响应Store list事件,设置标签页 53 | * 54 | * @param {data} 标签页标识 55 | */ 56 | listenSwitchmanageTab: function(data) { 57 | var that = this; 58 | if (data === 0){ 59 | this.setState({parentVisible: {}}); 60 | } else { 61 | this.setState({parentVisible: {visibility: 'inherit'}}); 62 | } 63 | }, 64 | /** 65 | * 响应Store switchtab事件,隐藏manage 66 | * 67 | * @param {data} 标签页标识 68 | */ 69 | listenSwitchTab: function(data) { 70 | var that = this; 71 | if (data === 0){ 72 | switch (that.state.monitorTabIndex) { 73 | case 0: 74 | this.setState({parentVisible: {}}); 75 | break; 76 | case 1: 77 | this.setState({parentVisible: {visibility: 'inherit'}}); 78 | break; 79 | case 2: 80 | this.setState({parentVisible: {}}); 81 | break; 82 | } 83 | this.setState({tabIndex: 0}); 84 | } else { 85 | this.setState({parentVisible: {visibility: 'inherit'}}); 86 | this.setState({tabIndex: 1}); 87 | } 88 | }, 89 | /** 90 | * 响应Store switchmonitortab事件,设置标签页 91 | * 92 | * @param {data} 标签页标识 93 | */ 94 | listenSwitchMonitorTab: function(data) { 95 | this.setState({parentVisible: {}}); 96 | this.setState({monitorTabIndex: data}); 97 | }, 98 | /** 99 | * 响应Store listcolumn事件,设置标签页 100 | * 101 | */ 102 | listenListColumn: function() { 103 | TrackAction.searchonlineentity(1); 104 | }, 105 | /** 106 | * 响应Store onlinelist事件,设置列表 107 | * 108 | * @param {data} entity数据 109 | */ 110 | listenOnlineList: function(data) { 111 | this.setState({allEntity:data}); 112 | }, 113 | /** 114 | * DOM操作回调,点击选中一辆车 115 | * 116 | * @param {object} event 事件对象 117 | */ 118 | handleSelectCar: function(event) { 119 | var realTarget = event.target; 120 | if (event.target.parentElement.className.indexOf('monitorListItem') > -1) { 121 | realTarget = event.target.parentElement; 122 | } 123 | if (event.target.parentElement.parentElement.className.indexOf('monitorListItem') > -1) { 124 | realTarget = event.target.parentElement.parentElement; 125 | } 126 | var entity_name = realTarget.getAttribute('data-entity_name'); 127 | var entity_status = realTarget.getAttribute('data-entity_status'); 128 | // $('.monitorListItem0, .monitorListItem1, .monitorListItem2').removeClass('monitorSelect'); 129 | // $(realTarget).addClass('monitorSelect'); 130 | var entity_id = realTarget.getAttribute('data-entity_id'); 131 | this.setState({currentEntityName: entity_name}); 132 | TrackAction.selectcar(entity_name, entity_status, entity_id, 'onlineCompleteEntities'); 133 | }, 134 | render: function() { 135 | var monitorTabIndex = this.state.monitorTabIndex; 136 | var parentVisible = this.state.parentVisible; 137 | var allEntity = this.state.allEntity; 138 | var handleSelectCar = this.handleSelectCar; 139 | var currentEntityName = this.state.currentEntityName; 140 | return ( 141 |
142 |
143 | { 144 | allEntity.map(function(item, key) { 145 | return ( 146 |
147 |
{item[5]}
148 |
{item[1]}
149 |
150 | ) 151 | }) 152 | } 153 |
154 | 155 |
156 | 157 | ) 158 | } 159 | }); 160 | 161 | export default Monitoronlinecontent; 162 | -------------------------------------------------------------------------------- /script/modules/trackcontrol/views/trackpages.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 轨迹监控页码翻页部分 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.24 4 | */ 5 | 6 | import React, { Component } from 'react' 7 | import { render } from 'react-dom' 8 | import TrackAction from '../actions/trackAction' 9 | import TrackStore from '../stores/trackStore' 10 | 11 | var Trackpages = React.createClass({ 12 | getInitialState: function() { 13 | return { 14 | // 当前页码 15 | currentPage: 1, 16 | // 输入框中的页码 17 | inputPage: 1, 18 | // 总页码 19 | totalPage: 0, 20 | // 上一页按钮的样式,分为lasepageon&lastPageOff两种 21 | lastPage: 'lastPageOff', 22 | // 下一页按钮的样式,分为nextPageOn&nextPageOff两种 23 | nextPage: 'nextPageOff', 24 | // 翻页状态,当正在翻页过程中,翻页按钮不可点 25 | cliking: 0 26 | } 27 | }, 28 | componentDidMount: function () { 29 | TrackStore.listen(this.onStatusChange); 30 | }, 31 | onStatusChange: function (type,data) { 32 | switch (type){ 33 | case 'tracklistpage': 34 | this.listenTotalpage(data); 35 | break; 36 | case 'tracklistloaded': 37 | this.listenListLoaded(); 38 | break; 39 | case 'initpagetrack': 40 | this.listenInitpagetrack(); 41 | break; 42 | } 43 | }, 44 | /** 45 | * 响应Store totalpage事件,设置总数量量 46 | * 47 | * @param {data} 总页数 48 | */ 49 | listenTotalpage: function(data) { 50 | this.setState({totalPage:data}); 51 | this.setSwichPageStyle(this.state.currentPage); 52 | }, 53 | /** 54 | * 响应Store alllist事件,开启翻页按钮可点 55 | * 56 | */ 57 | listenListLoaded: function() { 58 | this.setState({cliking: 0}); 59 | }, 60 | /** 61 | * 响应Store initpage事件,初始化页码和按钮状态 62 | * 63 | */ 64 | listenInitpagetrack: function() { 65 | this.setState({ 66 | // 当前页码 67 | currentPage: 1, 68 | // 输入框中的页码 69 | inputPage: 1, 70 | // 总页码 71 | totalPage: 0, 72 | // 上一页按钮的样式,分为lasepageon&lastPageOff两种 73 | lastPage: 'lastPageOff', 74 | // 下一页按钮的样式,分为nextPageOn&nextPageOff两种 75 | nextPage: 'nextPageOff', 76 | // 翻页状态,当正在翻页过程中,翻页按钮不可点 77 | cliking: 0 78 | }); 79 | }, 80 | /** 81 | * DOM操作回调,页码输入value变化 82 | * 83 | * @param {object} event 事件对象 84 | */ 85 | handleChange: function (event) { 86 | this.setState({inputPage:event.target.value}); 87 | }, 88 | /** 89 | * DOM操作回调,页码输入value确定 90 | * 91 | * @param {object} event 事件对象 92 | */ 93 | handleBlur: function (event) { 94 | if(parseInt(event.target.value) > 0 && parseInt(event.target.value) <= this.state.totalPage) { 95 | this.setState({inputPage: parseInt(event.target.value)}); 96 | } else { 97 | this.setState({inputPage: 1}); 98 | } 99 | }, 100 | /** 101 | * DOM操作回调,点击跳转页面按钮 102 | * 103 | * @param {object} event 事件对象 104 | */ 105 | handleJumppage: function (event) { 106 | if(this.state.currentPage == this.state.inputPage || this.state.cliking === 1) { 107 | return; 108 | } 109 | var jumpPage = this.state.inputPage; 110 | this.setState({currentPage: jumpPage}); 111 | TrackAction.tracklist(jumpPage); 112 | this.setState({cliking: 1}); 113 | }, 114 | /** 115 | * DOM操作回调,点击上一页 116 | * 117 | * @param {object} event 事件对象 118 | */ 119 | handleLastpage: function (event) { 120 | if(this.state.currentPage === 1 || this.state.cliking === 1) { 121 | return; 122 | } else { 123 | var lastPage = this.state.currentPage - 1; 124 | this.setState({currentPage: lastPage}); 125 | this.setState({inputPage: lastPage}); 126 | TrackAction.tracklist(lastPage); 127 | this.setState({cliking: 1}); 128 | } 129 | }, 130 | /** 131 | * DOM操作回调,点击下一页 132 | * 133 | * @param {object} event 事件对象 134 | */ 135 | handleNextpage: function (event) { 136 | if(this.state.currentPage === this.state.totalPage || this.state.cliking === 1) { 137 | return; 138 | } else { 139 | var nextPage = this.state.currentPage + 1; 140 | this.setState({currentPage: nextPage}); 141 | this.setState({inputPage: nextPage}); 142 | TrackAction.tracklist(nextPage); 143 | this.setState({cliking: 1}); 144 | } 145 | }, 146 | /** 147 | * DOM操作回调,点击回车检索 148 | * 149 | * @param {object} event 事件对象 150 | */ 151 | handleKeyBoard: function(event) { 152 | if(this.state.currentPage == this.state.inputPage || this.state.cliking === 1) { 153 | return; 154 | } 155 | if(event.key === 'Enter') { 156 | if(parseInt(event.target.value) > 0 && parseInt(event.target.value) <= this.state.totalPage) { 157 | this.setState({inputPage: parseInt(event.target.value)}); 158 | var jumpPage = parseInt(event.target.value); 159 | this.setState({currentPage: jumpPage}); 160 | TrackAction.tracklist(jumpPage); 161 | this.setState({cliking: 1}); 162 | } else { 163 | this.setState({inputPage: 1}); 164 | var jumpPage = parseInt(1); 165 | this.setState({currentPage: jumpPage}); 166 | TrackAction.tracklist(jumpPage); 167 | } 168 | } 169 | }, 170 | /** 171 | * view内部,设置翻页按钮样式 172 | * 173 | * @param {number} jumpPage 要跳转到的页 174 | */ 175 | setSwichPageStyle: function (jumpPage) { 176 | if(jumpPage === 1) { 177 | this.setState({lastPage: 'lastPageOff'}); 178 | } else { 179 | this.setState({lastPage: 'lastPageOn'}); 180 | } 181 | if(jumpPage === this.state.totalPage) { 182 | this.setState({nextPage: 'nextPageOff'}); 183 | } else { 184 | this.setState({nextPage: 'nextPageOn'}); 185 | } 186 | this.setState({currentPage: jumpPage}); 187 | }, 188 | render: function () { 189 | var currentPage = this.state.currentPage; 190 | var totalPage = this.state.totalPage; 191 | var lastPage = this.state.lastPage; 192 | var nextPage = this.state.nextPage; 193 | var inputPage = this.state.inputPage; 194 | return ( 195 |
196 |
197 | 198 | /{' ' + totalPage}页 199 | GO 200 |
201 |
202 | 203 | 204 |
205 |
206 | ) 207 | } 208 | }); 209 | 210 | export default Trackpages; 211 | -------------------------------------------------------------------------------- /script/modules/trackcontrol/views/monitoronlinepage.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 轨迹监控页码翻页部分 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.25 4 | */ 5 | 6 | import React, { Component } from 'react' 7 | import { render } from 'react-dom' 8 | import TrackAction from '../actions/trackAction' 9 | import TrackStore from '../stores/trackStore' 10 | 11 | var Monitoronlinepage = React.createClass({ 12 | getInitialState: function() { 13 | return { 14 | // 当前页码 15 | currentPage: 1, 16 | // 输入框中的页码 17 | inputPage: 1, 18 | // 总页码 19 | totalPage: 0, 20 | // 上一页按钮的样式,分为lasepageon&lastPageOff两种 21 | lastPage: 'lastPageOff', 22 | // 下一页按钮的样式,分为nextPageOn&nextPageOff两种 23 | nextPage: 'nextPageOff', 24 | // 翻页状态,当正在翻页过程中,翻页按钮不可点 25 | cliking: 0 26 | } 27 | }, 28 | componentDidMount: function () { 29 | TrackStore.listen(this.onStatusChange); 30 | // todo 循环加载 暂时先关闭 31 | setInterval(() => {TrackAction.searchonlineentity();},10000); 32 | }, 33 | onStatusChange: function (type,data) { 34 | switch (type){ 35 | case 'totalonlinepage': 36 | this.listenTotalpage(data); 37 | break; 38 | case 'onlinelist': 39 | this.listenonlinelList(); 40 | break; 41 | case 'initonlinepage': 42 | this.listenInitpage(); 43 | break; 44 | } 45 | }, 46 | /** 47 | * 响应Store initpage事件,初始化页码和按钮状态 48 | * 49 | */ 50 | listenInitpage: function() { 51 | this.setState({ 52 | // 当前页码 53 | currentPage: 1, 54 | // 输入框中的页码 55 | inputPage: 1, 56 | // 总页码 57 | totalPage: 0, 58 | // 上一页按钮的样式,分为lasepageon&lastPageOff两种 59 | lastPage: 'lastPageOff', 60 | // 下一页按钮的样式,分为nextPageOn&nextPageOff两种 61 | nextPage: 'nextPageOff', 62 | // 翻页状态,当正在翻页过程中,翻页按钮不可点 63 | cliking: 0 64 | }); 65 | }, 66 | /** 67 | * 响应Store totalpage事件,设置总数量量 68 | * 69 | * @param {data} 总页数 70 | */ 71 | listenTotalpage: function(data) { 72 | this.setState({totalPage:data}); 73 | this.setSwichPageStyle(this.state.currentPage); 74 | }, 75 | /** 76 | * 响应Store onlinelist事件,开启翻页按钮可点 77 | * 78 | */ 79 | listenonlinelList: function() { 80 | this.setState({cliking: 0}); 81 | }, 82 | /** 83 | * DOM操作回调,页码输入value变化 84 | * 85 | * @param {object} event 事件对象 86 | */ 87 | handleChange: function (event) { 88 | this.setState({inputPage: event.target.value}); 89 | }, 90 | /** 91 | * DOM操作回调,页码输入value确定 92 | * 93 | * @param {object} event 事件对象 94 | */ 95 | handleBlur: function (event) { 96 | if(parseInt(event.target.value) > 0 && parseInt(event.target.value) <= this.state.totalPage) { 97 | this.setState({inputPage: parseInt(event.target.value)}); 98 | } else { 99 | this.setState({inputPage: 1}); 100 | } 101 | }, 102 | /** 103 | * DOM操作回调,点击跳转页面按钮 104 | * 105 | * @param {object} event 事件对象 106 | */ 107 | handleJumppage: function (event) { 108 | if(this.state.currentPage == this.state.inputPage || this.state.cliking === 1) { 109 | return; 110 | } 111 | var jumpPage = this.state.inputPage; 112 | this.setState({currentPage: jumpPage}); 113 | TrackAction.searchonlineentity(jumpPage); 114 | this.setState({cliking: 1}); 115 | }, 116 | /** 117 | * DOM操作回调,点击上一页 118 | * 119 | * @param {object} event 事件对象 120 | */ 121 | handleLastpage: function (event) { 122 | if(this.state.currentPage === 1 || this.state.cliking === 1) { 123 | return; 124 | } else { 125 | var lastPage = this.state.currentPage - 1; 126 | this.setState({currentPage: lastPage}); 127 | this.setState({inputPage: lastPage}); 128 | TrackAction.searchonlineentity(lastPage); 129 | this.setState({cliking: 1}); 130 | } 131 | }, 132 | /** 133 | * DOM操作回调,点击下一页 134 | * 135 | * @param {object} event 事件对象 136 | */ 137 | handleNextpage: function (event) { 138 | if(this.state.currentPage === this.state.totalPage || this.state.cliking === 1) { 139 | return; 140 | } else { 141 | var nextPage = this.state.currentPage + 1; 142 | this.setState({currentPage: nextPage}); 143 | this.setState({inputPage: nextPage}); 144 | TrackAction.searchonlineentity(nextPage); 145 | this.setState({cliking: 1}); 146 | } 147 | }, 148 | /** 149 | * DOM操作回调,点击回车检索 150 | * 151 | * @param {object} event 事件对象 152 | */ 153 | handleKeyBoard: function(event) { 154 | if(this.state.currentPage == this.state.inputPage || this.state.cliking === 1) { 155 | return; 156 | } 157 | if(event.key === 'Enter') { 158 | if(parseInt(event.target.value) > 0 && parseInt(event.target.value) <= this.state.totalPage) { 159 | this.setState({inputPage: parseInt(event.target.value)}); 160 | var jumpPage = parseInt(event.target.value); 161 | this.setState({currentPage: jumpPage}); 162 | TrackAction.searchonlineentity(jumpPage); 163 | this.setState({cliking: 1}); 164 | } else { 165 | this.setState({inputPage: 1}); 166 | var jumpPage = parseInt(1); 167 | this.setState({currentPage: jumpPage}); 168 | TrackAction.searchonlineentity(jumpPage); 169 | } 170 | } 171 | }, 172 | /** 173 | * view内部,设置翻页按钮样式 174 | * 175 | * @param {number} jumpPage 要跳转到的页 176 | */ 177 | setSwichPageStyle: function (jumpPage) { 178 | if(jumpPage === 1) { 179 | this.setState({lastPage: 'lastPageOff'}); 180 | } else { 181 | this.setState({lastPage: 'lastPageOn'}); 182 | } 183 | if(jumpPage === this.state.totalPage) { 184 | this.setState({nextPage: 'nextPageOff'}); 185 | } else { 186 | this.setState({nextPage: 'nextPageOn'}); 187 | } 188 | this.setState({currentPage: jumpPage}); 189 | }, 190 | render: function () { 191 | var currentPage = this.state.currentPage; 192 | var totalPage = this.state.totalPage; 193 | var lastPage = this.state.lastPage; 194 | var nextPage = this.state.nextPage; 195 | var inputPage = this.state.inputPage; 196 | return ( 197 |
198 |
199 | 200 | /{' ' + totalPage}页 201 | GO 202 |
203 |
204 | 205 | 206 |
207 |
208 | ) 209 | } 210 | }); 211 | 212 | export default Monitoronlinepage; 213 | -------------------------------------------------------------------------------- /script/modules/trackcontrol/views/monitorofflinepage.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 轨迹监控页码翻页部分 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.25 4 | */ 5 | 6 | import React, { Component } from 'react' 7 | import { render } from 'react-dom' 8 | import TrackAction from '../actions/trackAction' 9 | import TrackStore from '../stores/trackStore' 10 | 11 | var Monitorofflinepage = React.createClass({ 12 | getInitialState: function() { 13 | return { 14 | // 当前页码 15 | currentPage: 1, 16 | // 输入框中的页码 17 | inputPage: 1, 18 | // 总页码 19 | totalPage: 0, 20 | // 上一页按钮的样式,分为lasepageon&lastPageOff两种 21 | lastPage: 'lastPageOff', 22 | // 下一页按钮的样式,分为nextPageOn&nextPageOff两种 23 | nextPage: 'nextPageOff', 24 | // 翻页状态,当正在翻页过程中,翻页按钮不可点 25 | cliking: 0 26 | } 27 | }, 28 | componentDidMount: function () { 29 | TrackStore.listen(this.onStatusChange); 30 | // todo 循环加载 暂时先关闭 31 | setInterval(() => {TrackAction.searchofflineentity();},10000); 32 | }, 33 | onStatusChange: function (type,data) { 34 | switch (type){ 35 | case 'totalofflinepage': 36 | this.listenTotalpage(data); 37 | break; 38 | case 'offlinelist': 39 | this.listenofflinelList(); 40 | break; 41 | case 'initofflinepage': 42 | this.listenInitpage(); 43 | break; 44 | } 45 | }, 46 | /** 47 | * 响应Store totalpage事件,设置总数量量 48 | * 49 | * @param {data} 总页数 50 | */ 51 | listenTotalpage: function(data) { 52 | this.setState({totalPage:data}); 53 | this.setSwichPageStyle(this.state.currentPage); 54 | }, 55 | /** 56 | * 响应Store offlinelist事件,开启翻页按钮可点 57 | * 58 | */ 59 | listenofflinelList: function() { 60 | this.setState({cliking: 0}); 61 | }, 62 | /** 63 | * 响应Store initpage事件,初始化页码和按钮状态 64 | * 65 | */ 66 | listenInitpage: function() { 67 | this.setState({ 68 | // 当前页码 69 | currentPage: 1, 70 | // 输入框中的页码 71 | inputPage: 1, 72 | // 总页码 73 | totalPage: 0, 74 | // 上一页按钮的样式,分为lasepageon&lastPageOff两种 75 | lastPage: 'lastPageOff', 76 | // 下一页按钮的样式,分为nextPageOn&nextPageOff两种 77 | nextPage: 'nextPageOff', 78 | // 翻页状态,当正在翻页过程中,翻页按钮不可点 79 | cliking: 0 80 | }); 81 | }, 82 | 83 | /** 84 | * DOM操作回调,页码输入value变化 85 | * 86 | * @param {object} event 事件对象 87 | */ 88 | handleChange: function (event) { 89 | this.setState({inputPage: event.target.value}); 90 | }, 91 | /** 92 | * DOM操作回调,页码输入value确定 93 | * 94 | * @param {object} event 事件对象 95 | */ 96 | handleBlur: function (event) { 97 | if(parseInt(event.target.value) > 0 && parseInt(event.target.value) <= this.state.totalPage) { 98 | this.setState({inputPage: parseInt(event.target.value)}); 99 | } else { 100 | this.setState({inputPage: 1}); 101 | } 102 | }, 103 | /** 104 | * DOM操作回调,点击跳转页面按钮 105 | * 106 | * @param {object} event 事件对象 107 | */ 108 | handleJumppage: function (event) { 109 | if(this.state.currentPage == this.state.inputPage || this.state.cliking === 1) { 110 | return; 111 | } 112 | var jumpPage = this.state.inputPage; 113 | this.setState({currentPage: jumpPage}); 114 | TrackAction.searchofflineentity(jumpPage); 115 | this.setState({cliking: 1}); 116 | }, 117 | /** 118 | * DOM操作回调,点击上一页 119 | * 120 | * @param {object} event 事件对象 121 | */ 122 | handleLastpage: function (event) { 123 | if(this.state.currentPage === 1 || this.state.cliking === 1) { 124 | return; 125 | } else { 126 | var lastPage = this.state.currentPage - 1; 127 | this.setState({currentPage: lastPage}); 128 | this.setState({inputPage: lastPage}); 129 | TrackAction.searchofflineentity(lastPage); 130 | this.setState({cliking: 1}); 131 | } 132 | }, 133 | /** 134 | * DOM操作回调,点击下一页 135 | * 136 | * @param {object} event 事件对象 137 | */ 138 | handleNextpage: function (event) { 139 | if(this.state.currentPage === this.state.totalPage || this.state.cliking === 1) { 140 | return; 141 | } else { 142 | var nextPage = this.state.currentPage + 1; 143 | this.setState({currentPage: nextPage}); 144 | this.setState({inputPage: nextPage}); 145 | TrackAction.searchofflineentity(nextPage); 146 | this.setState({cliking: 1}); 147 | } 148 | }, 149 | /** 150 | * DOM操作回调,点击回车检索 151 | * 152 | * @param {object} event 事件对象 153 | */ 154 | handleKeyBoard: function(event) { 155 | if(this.state.currentPage == this.state.inputPage || this.state.cliking === 1) { 156 | return; 157 | } 158 | if(event.key === 'Enter') { 159 | if(parseInt(event.target.value) > 0 && parseInt(event.target.value) <= this.state.totalPage) { 160 | this.setState({inputPage: parseInt(event.target.value)}); 161 | var jumpPage = parseInt(event.target.value); 162 | this.setState({currentPage: jumpPage}); 163 | TrackAction.searchofflineentity(jumpPage); 164 | this.setState({cliking: 1}); 165 | } else { 166 | this.setState({inputPage: 1}); 167 | var jumpPage = parseInt(1); 168 | this.setState({currentPage: jumpPage}); 169 | TrackAction.searchofflineentity(jumpPage); 170 | } 171 | } 172 | }, 173 | /** 174 | * view内部,设置翻页按钮样式 175 | * 176 | * @param {number} jumpPage 要跳转到的页 177 | */ 178 | setSwichPageStyle: function (jumpPage) { 179 | if(jumpPage === 1) { 180 | this.setState({lastPage: 'lastPageOff'}); 181 | } else { 182 | this.setState({lastPage: 'lastPageOn'}); 183 | } 184 | if(jumpPage === this.state.totalPage) { 185 | this.setState({nextPage: 'nextPageOff'}); 186 | } else { 187 | this.setState({nextPage: 'nextPageOn'}); 188 | } 189 | this.setState({currentPage: jumpPage}); 190 | }, 191 | render: function () { 192 | var currentPage = this.state.currentPage; 193 | var totalPage = this.state.totalPage; 194 | var lastPage = this.state.lastPage; 195 | var nextPage = this.state.nextPage; 196 | var inputPage = this.state.inputPage; 197 | return ( 198 |
199 |
200 | 201 | /{' ' + totalPage}页 202 | GO 203 |
204 |
205 | 206 | 207 |
208 |
209 | ) 210 | } 211 | }); 212 | 213 | export default Monitorofflinepage; 214 | -------------------------------------------------------------------------------- /script/modules/trackcontrol/views/monitorallpage.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 轨迹监控页码翻页部分 Reflux View 3 | * @author 崔健 cuijian03@baidu.com 2016.08.24 4 | */ 5 | 6 | import React, { Component } from 'react' 7 | import { render } from 'react-dom' 8 | import TrackAction from '../actions/trackAction' 9 | import TrackStore from '../stores/trackStore' 10 | 11 | var Monitorallpage = React.createClass({ 12 | componentWillUpdate: function() { 13 | // console.log(this.state.totalPage); 14 | }, 15 | getInitialState: function() { 16 | return { 17 | // 当前页码 18 | currentPage: 1, 19 | // 输入框中的页码 20 | inputPage: 1, 21 | // // 总页码 22 | totalPage: 0, 23 | // 上一页按钮的样式,分为lasepageon&lastPageOff两种 24 | lastPage: 'lastPageOff', 25 | // 下一页按钮的样式,分为nextPageOn&nextPageOff两种 26 | nextPage: 'nextPageOff', 27 | // 翻页状态,当正在翻页过程中,翻页按钮不可点 28 | cliking: 0 29 | } 30 | }, 31 | componentDidMount: function () { 32 | TrackStore.listen(this.onStatusChange); 33 | // todo 循环加载 暂时先关闭 34 | setInterval(() => {TrackAction.searchallentity();},10000); 35 | setInterval(() => { 36 | if (map.getZoom() >= 14) { 37 | TrackAction.boundsearchentity(); 38 | } 39 | }, 10000); 40 | }, 41 | onStatusChange: function (type,data) { 42 | switch (type){ 43 | case 'totalallpage': 44 | this.listenTotalpage(data); 45 | break; 46 | case 'alllist': 47 | this.listenAllList(); 48 | break; 49 | case 'initallpage': 50 | this.listenInitpage(); 51 | break; 52 | } 53 | }, 54 | /** 55 | * 响应Store totalpage事件,设置总数量量 56 | * 57 | * @param {data} 总页数 58 | */ 59 | listenTotalpage: function(data) { 60 | this.setState({totalPage:data}); 61 | this.setSwichPageStyle(this.state.currentPage); 62 | }, 63 | /** 64 | * 响应Store alllist事件,开启翻页按钮可点 65 | * 66 | */ 67 | listenAllList: function() { 68 | this.setState({cliking: 0}); 69 | }, 70 | /** 71 | * 响应Store initpage事件,初始化页码和按钮状态 72 | * 73 | */ 74 | listenInitpage: function() { 75 | this.setState({ 76 | // 当前页码 77 | currentPage: 1, 78 | // 输入框中的页码 79 | inputPage: 1, 80 | // 总页码 81 | totalPage: 0, 82 | // 上一页按钮的样式,分为lasepageon&lastPageOff两种 83 | lastPage: 'lastPageOff', 84 | // 下一页按钮的样式,分为nextPageOn&nextPageOff两种 85 | nextPage: 'nextPageOff', 86 | // 翻页状态,当正在翻页过程中,翻页按钮不可点 87 | cliking: 0 88 | }); 89 | }, 90 | /** 91 | * DOM操作回调,页码输入value变化 92 | * 93 | * @param {object} event 事件对象 94 | */ 95 | handleChange: function (event) { 96 | this.setState({inputPage:event.target.value}); 97 | }, 98 | /** 99 | * DOM操作回调,页码输入value确定 100 | * 101 | * @param {object} event 事件对象 102 | */ 103 | handleBlur: function (event) { 104 | if(parseInt(event.target.value) > 0 && parseInt(event.target.value) <= this.state.totalPage) { 105 | this.setState({inputPage: parseInt(event.target.value)}); 106 | } else { 107 | this.setState({inputPage: 1}); 108 | } 109 | }, 110 | /** 111 | * DOM操作回调,点击跳转页面按钮 112 | * 113 | * @param {object} event 事件对象 114 | */ 115 | handleJumppage: function (event) { 116 | if(this.state.currentPage == this.state.inputPage || this.state.cliking === 1) { 117 | return; 118 | } 119 | var jumpPage = this.state.inputPage; 120 | this.setState({currentPage: jumpPage}); 121 | TrackAction.searchallentity(jumpPage); 122 | this.setState({cliking: 1}); 123 | }, 124 | /** 125 | * DOM操作回调,点击上一页 126 | * 127 | * @param {object} event 事件对象 128 | */ 129 | handleLastpage: function (event) { 130 | if(this.state.currentPage === 1 || this.state.cliking === 1) { 131 | return; 132 | } else { 133 | var lastPage = this.state.currentPage - 1; 134 | this.setState({currentPage: lastPage}); 135 | this.setState({inputPage: lastPage}); 136 | TrackAction.searchallentity(lastPage); 137 | this.setState({cliking: 1}); 138 | } 139 | }, 140 | /** 141 | * DOM操作回调,点击下一页 142 | * 143 | * @param {object} event 事件对象 144 | */ 145 | handleNextpage: function (event) { 146 | if(this.state.currentPage === this.state.totalPage || this.state.cliking === 1) { 147 | return; 148 | } else { 149 | var nextPage = this.state.currentPage + 1; 150 | this.setState({currentPage: nextPage}); 151 | this.setState({inputPage: nextPage}); 152 | TrackAction.searchallentity(nextPage); 153 | this.setState({cliking: 1}); 154 | } 155 | }, 156 | /** 157 | * DOM操作回调,点击回车检索 158 | * 159 | * @param {object} event 事件对象 160 | */ 161 | handleKeyBoard: function(event) { 162 | if(this.state.currentPage == this.state.inputPage || this.state.cliking === 1) { 163 | return; 164 | } 165 | if(event.key === 'Enter') { 166 | if(parseInt(event.target.value) > 0 && parseInt(event.target.value) <= this.state.totalPage) { 167 | this.setState({inputPage: parseInt(event.target.value)}); 168 | var jumpPage = parseInt(event.target.value); 169 | this.setState({currentPage: jumpPage}); 170 | TrackAction.searchallentity(jumpPage); 171 | this.setState({cliking: 1}); 172 | } else { 173 | this.setState({inputPage: 1}); 174 | var jumpPage = parseInt(1); 175 | this.setState({currentPage: jumpPage}); 176 | TrackAction.searchallentity(jumpPage); 177 | } 178 | } 179 | }, 180 | /** 181 | * view内部,设置翻页按钮样式 182 | * 183 | * @param {number} jumpPage 要跳转到的页 184 | */ 185 | setSwichPageStyle: function (jumpPage) { 186 | if(jumpPage === 1) { 187 | this.setState({lastPage: 'lastPageOff'}); 188 | } else { 189 | this.setState({lastPage: 'lastPageOn'}); 190 | } 191 | if(jumpPage === this.state.totalPage) { 192 | this.setState({nextPage: 'nextPageOff'}); 193 | } else { 194 | this.setState({nextPage: 'nextPageOn'}); 195 | } 196 | this.setState({currentPage: jumpPage}); 197 | }, 198 | render: function () { 199 | var currentPage = this.state.currentPage; 200 | var totalPage = this.state.totalPage; 201 | var lastPage = this.state.lastPage; 202 | var nextPage = this.state.nextPage; 203 | var inputPage = this.state.inputPage; 204 | return ( 205 |
206 |
207 | 208 | /{' ' + totalPage}页 209 | GO 210 |
211 |
212 | 213 | 214 |
215 |
216 | ) 217 | } 218 | }); 219 | 220 | export default Monitorallpage; 221 | -------------------------------------------------------------------------------- /script/common/commonfun.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 存放公共方法 3 | * @author 崔健 cuijian03@baidu.com 2016.08.20 4 | */ 5 | 6 | var commonfun = { 7 | /** 8 | * 根据系统要求变更时间格式 9 | * 10 | * @param {string} time UNIX时间戳 11 | * @return {string} 时间 格式:2016-08-19 19:18:15 12 | */ 13 | getLocalTime: function (time) { 14 | var d = new Date(parseInt(time) * 1000); 15 | var month = d.getMonth() + 1; 16 | var day = d.getDate(); 17 | var hour = d.getHours(); 18 | var minute = d.getMinutes(); 19 | var second = d.getSeconds(); 20 | month = month < 10 ? '0' + month : month; 21 | day = day < 10 ? '0' + day : day; 22 | hour = hour < 10 ? '0' + hour : hour; 23 | minute = minute < 10 ? '0' + minute : minute; 24 | second = second < 10 ? '0' + second : second; 25 | return d.getFullYear() + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second; 26 | }, 27 | 28 | /** 29 | * 获取传入时间当天的0点0分0秒时间 30 | * 31 | * @param {Object} time js Date对象 32 | * @return {string} 时间 格式:2016-08-19 19:18:15 33 | */ 34 | getStartTime(time) { 35 | let date = new Date(time); 36 | date.setHours(0); 37 | date.setMinutes(0); 38 | date.setSeconds(0); 39 | date.setMilliseconds(0); 40 | return date; 41 | }, 42 | 43 | /** 44 | * 获取当前日期 45 | * 46 | * @param {string} time UNIX时间戳 可选 47 | * @param {string} type 获取日期格式 48 | * @return {string} 时间 格式:2016-08-19 49 | */ 50 | getCurrentDate(e, type) { 51 | e = e || new Date(); 52 | let d = e; 53 | let result = ''; 54 | if (!type) { 55 | let month = d.getMonth() + 1; 56 | let day = d.getDate(); 57 | month = month < 10 ? '0' + month : month; 58 | day = day < 10 ? '0' + day : day; 59 | result = d.getFullYear() + '-' + month + '-' + day; 60 | } else if (type = 'hh:00') { 61 | let minute = e.getMinutes(); 62 | if (minute <= 30) { 63 | e = new Date(e.valueOf() - 60 * 60 * 1000 * 2); 64 | } else { 65 | e = new Date(e.valueOf() - 60 * 60 * 1000); 66 | } 67 | let hour = e.getHours(); 68 | let month = d.getMonth() + 1; 69 | let day = d.getDate(); 70 | let year = e.getFullYear(); 71 | hour = hour < 10 ? '0' + hour : hour + ''; 72 | month = month < 10 ? '0' + month : month; 73 | day = day < 10 ? '0' + day : day; 74 | result = e.getFullYear() + '-' + month + '-' + day + ' ' + hour + ':00'; 75 | } 76 | return result; 77 | }, 78 | 79 | /** 80 | * 从数组中移除指定项 81 | * 82 | * @param {array} 源数组 83 | * @param {string} 要移除的值 84 | * @return {array} 处理后的数组 85 | */ 86 | removeFromArray: function (arr, val) { 87 | var index = $.inArray(val, arr); 88 | if (index >= 0) { 89 | arr.splice(index, 1); 90 | } 91 | return arr; 92 | }, 93 | // 系统中常量 94 | constVar: { 95 | 96 | }, 97 | /** 98 | * 从当前url取参数 99 | * 100 | * @param {string} 参数名 101 | * @return {string} 参数值 102 | */ 103 | getQueryString: function(name) { 104 | var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); 105 | var r = window.location.search.substr(1).match(reg); 106 | if (r != null) { 107 | return unescape(r[2]); 108 | } 109 | return null; 110 | }, 111 | /** 112 | * 判断当前设备是否在线,规则是最后上传的轨迹点 113 | * 时间在当前系统时间十分钟内判断为在线,否则为离线 114 | * 115 | * @param {number} time UNIX时间戳 116 | * @return {number} 在线状态 0在线 1离线 117 | */ 118 | getOnlineStatus: function(time) { 119 | var status = 0; 120 | var timestamp = new Date().getTime() / 1000; 121 | var timeDiff = (timestamp - time) / 60; 122 | status = timeDiff >= 10 ? 1 : 0; 123 | return status; 124 | }, 125 | /** 126 | * 判断当前设备是否为静止,规则是速度小于1km/h返回静止, 127 | * 否则返回速度 128 | * 129 | * @param {number} speed 速度 单位为 km/h 130 | * @return {string} 速度 131 | */ 132 | getSpeed: function(speed) { 133 | var speedDesc 134 | if (speed >= 150) { 135 | speedDesc = ' - - '; 136 | } else if (speed >= 1 && speed < 150) { 137 | speedDesc = speed.toFixed(1) + 'km/h'; 138 | } else { 139 | speedDesc = '静止'; 140 | } 141 | return speedDesc; 142 | }, 143 | /** 144 | * 返回当前弹窗中的状态字段数组, 145 | * 分别为状态、速度、方向 146 | * 147 | * @param {number} speed 速度 148 | * @param {number} time UNIX时间戳 149 | * @param {number} direction 方向 150 | * 151 | * @return {array} 状态 152 | */ 153 | getInfoWindowStatus: function(speed, time, direction) { 154 | var statusArr = []; 155 | speed = speed || 0; 156 | if (this.getOnlineStatus(time) === 0) { 157 | if (this.getSpeed(speed) === '静止') { 158 | statusArr[0] = '静止(时速不大于1km/h)'; 159 | statusArr[1] = ''; 160 | statusArr[2] = ''; 161 | } else { 162 | statusArr[0] = '行驶(时速不小于1km/h)'; 163 | statusArr[1] = this.getSpeed(speed); 164 | statusArr[2] = this.getDirection(direction); 165 | } 166 | } else { 167 | statusArr[0] = '离线(10分钟内无定位点)'; 168 | statusArr[1] = ''; 169 | statusArr[2] = ''; 170 | } 171 | 172 | return statusArr.join(' '); 173 | }, 174 | /** 175 | * 返回当前设备运动方向描述,一共分为8种,45度一个 176 | * 177 | * @param {number} direction 方向数据 178 | * @return {string} 方向描述 179 | */ 180 | getDirection: function(direction) { 181 | var directionDesc = ''; 182 | direction = direction || 0; 183 | switch (Math.floor((direction) / 22.5)) { 184 | case 0: 185 | case 15: 186 | directionDesc = '(北)'; 187 | break; 188 | case 1: 189 | case 2: 190 | directionDesc = '(东北)'; 191 | break; 192 | case 3: 193 | case 4: 194 | directionDesc = '(东)'; 195 | break; 196 | case 5: 197 | case 6: 198 | directionDesc = '(东南)'; 199 | break; 200 | case 7: 201 | case 8: 202 | directionDesc = '(南)'; 203 | break; 204 | case 9: 205 | case 10: 206 | directionDesc = '(西南)'; 207 | break; 208 | case 11: 209 | case 12: 210 | directionDesc = '(西)'; 211 | break; 212 | case 13: 213 | case 14: 214 | directionDesc = '(西北)'; 215 | break; 216 | } 217 | return directionDesc; 218 | }, 219 | /** 220 | * 返回当前车辆图标方向,一个四种,90度一个 221 | * 222 | * @param {number} direction 方向数据 223 | * @return {number} 方向标识 0上 1右 2下 3左 224 | */ 225 | getDirectionIcon: function(direction) { 226 | var directionIcon = 0; 227 | direction = direction || 0; 228 | switch (Math.floor((direction) / 45)) { 229 | case 0: 230 | case 7: 231 | directionIcon = 0; 232 | break; 233 | case 1: 234 | case 2: 235 | directionIcon = 1; 236 | break; 237 | case 3: 238 | case 4: 239 | directionIcon = 2; 240 | break; 241 | case 5: 242 | case 6: 243 | directionIcon = 3; 244 | break; 245 | } 246 | return directionIcon; 247 | }, 248 | }; 249 | 250 | 251 | export default commonfun; -------------------------------------------------------------------------------- /static/javascript/mod.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file: mod.js 3 | * @author fis 4 | * ver: 1.0.13 5 | * update: 2016/01/27 6 | * https://github.com/fex-team/mod 7 | */ 8 | var require; 9 | 10 | /* eslint-disable no-unused-vars */ 11 | var define; 12 | 13 | (function (global) { 14 | 15 | // 避免重复加载而导致已定义模块丢失 16 | if (require) { 17 | return; 18 | } 19 | 20 | var head = document.getElementsByTagName('head')[0]; 21 | var loadingMap = {}; 22 | var factoryMap = {}; 23 | var modulesMap = {}; 24 | var scriptsMap = {}; 25 | var resMap = {}; 26 | var pkgMap = {}; 27 | 28 | var createScripts = function(queues, onerror){ 29 | 30 | var docFrag = document.createDocumentFragment(); 31 | 32 | for(var i = 0, len = queues.length; i < len; i++){ 33 | var id = queues[i].id; 34 | var url = queues[i].url; 35 | 36 | if (url in scriptsMap) { 37 | continue; 38 | } 39 | 40 | scriptsMap[url] = true; 41 | 42 | var script = document.createElement('script'); 43 | if (onerror) { 44 | (function(script, id){ 45 | var tid = setTimeout(function(){ 46 | onerror(id); 47 | }, require.timeout); 48 | 49 | script.onerror = function () { 50 | clearTimeout(tid); 51 | onerror(id); 52 | }; 53 | 54 | var onload = function () { 55 | clearTimeout(tid); 56 | }; 57 | 58 | if ('onload' in script) { 59 | script.onload = onload; 60 | } 61 | else { 62 | script.onreadystatechange = function () { 63 | if (this.readyState === 'loaded' || this.readyState === 'complete') { 64 | onload(); 65 | } 66 | }; 67 | } 68 | })(script, id); 69 | } 70 | script.type = 'text/javascript'; 71 | script.src = url; 72 | 73 | docFrag.appendChild(script); 74 | } 75 | 76 | head.appendChild(docFrag); 77 | }; 78 | 79 | var loadScripts = function(ids, callback, onerror){ 80 | var queues = []; 81 | for(var i = 0, len = ids.length; i < len; i++){ 82 | var id = ids[i]; 83 | var queue = loadingMap[id] || (loadingMap[id] = []); 84 | queue.push(callback); 85 | 86 | // 87 | // resource map query 88 | // 89 | var res = resMap[id] || resMap[id + '.js'] || {}; 90 | var pkg = res.pkg; 91 | var url; 92 | 93 | if (pkg) { 94 | url = pkgMap[pkg].url || pkgMap[pkg].uri; 95 | } 96 | else { 97 | url = res.url || res.uri || id; 98 | } 99 | 100 | queues.push({ 101 | id: id, 102 | url: url 103 | }); 104 | } 105 | 106 | createScripts(queues, onerror); 107 | }; 108 | 109 | define = function (id, factory) { 110 | id = id.replace(/\.js$/i, ''); 111 | factoryMap[id] = factory; 112 | 113 | var queue = loadingMap[id]; 114 | if (queue) { 115 | for (var i = 0, n = queue.length; i < n; i++) { 116 | queue[i](); 117 | } 118 | delete loadingMap[id]; 119 | } 120 | }; 121 | 122 | require = function (id) { 123 | 124 | // compatible with require([dep, dep2...]) syntax. 125 | if (id && id.splice) { 126 | return require.async.apply(this, arguments); 127 | } 128 | 129 | id = require.alias(id); 130 | 131 | var mod = modulesMap[id]; 132 | if (mod) { 133 | return mod.exports; 134 | } 135 | 136 | // 137 | // init module 138 | // 139 | var factory = factoryMap[id]; 140 | if (!factory) { 141 | throw '[ModJS] Cannot find module `' + id + '`'; 142 | } 143 | 144 | mod = modulesMap[id] = { 145 | exports: {} 146 | }; 147 | 148 | // 149 | // factory: function OR value 150 | // 151 | var ret = (typeof factory === 'function') ? factory.apply(mod, [require, mod.exports, mod]) : factory; 152 | 153 | if (ret) { 154 | mod.exports = ret; 155 | } 156 | 157 | return mod.exports; 158 | }; 159 | 160 | require.async = function (names, onload, onerror) { 161 | if (typeof names === 'string') { 162 | names = [names]; 163 | } 164 | 165 | var needMap = {}; 166 | var needNum = 0; 167 | var needLoad = []; 168 | 169 | function findNeed(depArr) { 170 | var child; 171 | 172 | for (var i = 0, n = depArr.length; i < n; i++) { 173 | // 174 | // skip loading or loaded 175 | // 176 | var dep = require.alias(depArr[i]); 177 | 178 | if (dep in needMap) { 179 | continue; 180 | } 181 | 182 | needMap[dep] = true; 183 | 184 | if (dep in factoryMap) { 185 | // check whether loaded resource's deps is loaded or not 186 | child = resMap[dep] || resMap[dep + '.js']; 187 | if (child && 'deps' in child) { 188 | findNeed(child.deps); 189 | } 190 | continue; 191 | } 192 | 193 | needLoad.push(dep); 194 | needNum++; 195 | 196 | child = resMap[dep] || resMap[dep + '.js']; 197 | if (child && 'deps' in child) { 198 | findNeed(child.deps); 199 | } 200 | } 201 | } 202 | 203 | function updateNeed() { 204 | if (0 === needNum--) { 205 | var args = []; 206 | for (var i = 0, n = names.length; i < n; i++) { 207 | args[i] = require(names[i]); 208 | } 209 | 210 | onload && onload.apply(global, args); 211 | } 212 | } 213 | 214 | findNeed(names); 215 | loadScripts(needLoad, updateNeed, onerror); 216 | updateNeed(); 217 | }; 218 | 219 | require.ensure = function(names, callback) { 220 | require.async(names, function() { 221 | callback && callback.call(this, require); 222 | }); 223 | }; 224 | 225 | require.resourceMap = function (obj) { 226 | var k; 227 | var col; 228 | 229 | // merge `res` & `pkg` fields 230 | col = obj.res; 231 | for (k in col) { 232 | if (col.hasOwnProperty(k)) { 233 | resMap[k] = col[k]; 234 | } 235 | } 236 | 237 | col = obj.pkg; 238 | for (k in col) { 239 | if (col.hasOwnProperty(k)) { 240 | pkgMap[k] = col[k]; 241 | } 242 | } 243 | }; 244 | 245 | require.loadJs = function (url) { 246 | if (url in scriptsMap) { 247 | return; 248 | } 249 | 250 | scriptsMap[url] = true; 251 | 252 | var script = document.createElement('script'); 253 | script.type = 'text/javascript'; 254 | script.src = url; 255 | head.appendChild(script); 256 | }; 257 | 258 | require.loadCss = function (cfg) { 259 | if (cfg.content) { 260 | var sty = document.createElement('style'); 261 | sty.type = 'text/css'; 262 | 263 | if (sty.styleSheet) { // IE 264 | sty.styleSheet.cssText = cfg.content; 265 | } 266 | else { 267 | sty.innerHTML = cfg.content; 268 | } 269 | head.appendChild(sty); 270 | } 271 | else if (cfg.url) { 272 | var link = document.createElement('link'); 273 | link.href = cfg.url; 274 | link.rel = 'stylesheet'; 275 | link.type = 'text/css'; 276 | head.appendChild(link); 277 | } 278 | }; 279 | 280 | 281 | require.alias = function (id) { 282 | return id.replace(/\.js$/i, ''); 283 | }; 284 | 285 | require.timeout = 5000; 286 | 287 | })(this); 288 | --------------------------------------------------------------------------------