indexStat.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. <!-- include 'header' -->
  2. <script src="http://s1.bdstatic.com/r/www/cache/ecom/esl/1-6-10/esl.js"></script>
  3. <script type="text/javascript">
  4. // 路径配置
  5. require.config({
  6. paths:{
  7. 'echarts' : 'http://echarts.baidu.com/build/echarts'
  8. }
  9. });
  10. // 使用
  11. require(
  12. [
  13. 'echarts',
  14. 'echarts/chart/pie', // 使用柱状图就加载bar模块,按需加载
  15. 'echarts/chart/bar'
  16. ],
  17. function(ec) {
  18. //1 最近30天客户数量与记录趋势//
  19. // 基于准备好的dom,初始化echarts图表
  20. var myChart = ec.init(document.getElementById('chartContainer1'));
  21. var option = {
  22. color:['#e9af68','#57b7b6','#e4575a','#959eac','#ffa500',
  23. '#d38b70','#8fb7cf','#cd5c5c','#5c616b','#40e0d0',
  24. '#1e90ff','#ff6347','#7b68ee','#00fa9a','#ffd700',
  25. '#6699FF','#ff6666','#3cb371','#b8860b','#30e0e0'],
  26. tooltip : {
  27. trigger: 'axis',
  28. formatter: "{b} <br/>{a}:{c} 位<br/>{a1}:{c1} 条"
  29. },
  30. legend: {
  31. data:['添加客户数','添加客户记录数']
  32. },
  33. toolbox: {
  34. show : true,
  35. feature : {
  36. magicType : {show: true, type: ['line', 'bar']}
  37. }
  38. },
  39. calculable : true,
  40. xAxis : [
  41. {
  42. type : 'category',
  43. boundaryGap : false,
  44. data : {{statisticsDay}}
  45. }
  46. ],
  47. yAxis : [
  48. { color:'#000',
  49. type : 'value',
  50. axisLabel : {
  51. formatter: '{value}'
  52. },
  53. itemStyle: {
  54. normal: {
  55. lineStyle: {
  56. color:'#000000'
  57. }
  58. }
  59. },
  60. splitArea : {show : true}
  61. }
  62. ],
  63. series : [
  64. {
  65. name:'添加客户数',
  66. type:'line',
  67. data:{{statisticsClient}},
  68. markPoint : {
  69. data : [
  70. {type : 'max', name: '最大值'},
  71. {type : 'min', name: '最小值'}
  72. ]
  73. },
  74. },
  75. {
  76. name:'添加客户记录数',
  77. type:'line',
  78. data:{{statisticsLongle}},
  79. markPoint : {
  80. data : [
  81. {type : 'max', name: '最大值'},
  82. {type : 'min', name: '最小值'}
  83. ]
  84. },
  85. },
  86. ]
  87. };
  88. // 为echarts对象加载数据
  89. myChart.setOption(option);
  90. //1 最近30天客户数量与记录趋势//
  91. //2 最近30天客户数量地域//
  92. // 基于准备好的dom,初始化echarts图表
  93. var myChart = ec.init(document.getElementById('chartContainer2'));
  94. var option = {
  95. color:['#e9af68','#57b7b6','#e4575a','#959eac','#ffa500',
  96. '#d38b70','#8fb7cf','#cd5c5c','#5c616b','#40e0d0',
  97. '#1e90ff','#ff6347','#7b68ee','#00fa9a','#ffd700',
  98. '#6699FF','#ff6666','#3cb371','#b8860b','#30e0e0'],
  99. title : {
  100. text: '最近30天客户分布',
  101. textAlign:"left",
  102. textStyle:{
  103. fontSize: 12,
  104. color:"#666",
  105. fontWeight:"normal"
  106. }
  107. },
  108. tooltip : {
  109. trigger: 'item',
  110. formatter: "{a} <br/>{b} : {c} ({d}%)"
  111. },
  112. toolbox: {
  113. show : true,
  114. feature : {
  115. dataView : {show: true, readOnly:true},
  116. }
  117. },
  118. series : [
  119. {
  120. name:'客户所在地区',
  121. type:'pie',
  122. radius : '80%',
  123. center: ['50%', '50%'],
  124. data:{{statisticsCategory}}
  125. }
  126. ]
  127. };
  128. // 为echarts对象加载数据
  129. myChart.setOption(option);
  130. //2 客户地区分布//
  131. //3 最近30天客户数量地域//
  132. // 基于准备好的dom,初始化echarts图表
  133. var myChart = ec.init(document.getElementById('chartContainer3'));
  134. var option = {
  135. title : {
  136. text: '最近30天单位分布',
  137. textAlign:"left",
  138. textStyle:{
  139. fontSize: 12,
  140. color:"#666",
  141. fontWeight:"normal"
  142. }
  143. },
  144. tooltip : {
  145. trigger: 'item',
  146. formatter: "{a} <br/>{b} : {c} ({d}%)"
  147. },
  148. toolbox: {
  149. show : true,
  150. feature : {
  151. dataView : {show: true, readOnly:true},
  152. }
  153. },
  154. calculable : false,
  155. series : [
  156. {
  157. name:'单位性质',
  158. type:'pie',
  159. selectedMode: 'single',
  160. radius :"40%",
  161. itemStyle : {
  162. normal : {
  163. label : {
  164. position : 'inner'
  165. },
  166. labelLine : {
  167. show : false
  168. }
  169. }
  170. },
  171. data:{{statisticsNature}}
  172. },
  173. {
  174. name:'单位所在地区',
  175. type:'pie',
  176. radius : [90, 120],
  177. data:{{statisticsCompany}}
  178. }
  179. ]
  180. };
  181. var ecConfig = require('echarts/config');
  182. myChart.on(ecConfig.EVENT.PIE_SELECTED, function (param){
  183. var selected = param.selected;
  184. var serie;
  185. var str = '当前选择: ';
  186. for (var idx in selected) {
  187. serie = option.series[idx];
  188. for (var i = 0, l = serie.data.length; i < l; i++) {
  189. if (selected[idx][i]) {
  190. str += '【系列' + idx + '】' + serie.name + ' : ' +
  191. '【数据' + i + '】' + serie.data[i].name + ' ';
  192. }
  193. }
  194. }
  195. document.getElementById('wrong-message').innerHTML = str;
  196. })
  197. // 为echarts对象加载数据
  198. myChart.setOption(option);
  199. //3 单位地区分布//
  200. }
  201. );
  202. </script>
  203. <body>
  204. <div class="mainLayout">
  205. <div class="mainMenu">
  206. <div class="menuItem">
  207. <a href="#" class="mLogo">CLD</a>
  208. <ul>
  209. <!-- include 'menu' -->
  210. </ul>
  211. </div>
  212. </div>
  213. <div class="warpContent">
  214. <div class="infoCenter">
  215. <div class="centerPanel">
  216. <div class="bigAddup" data-placement="bottom" data-toggle="ctooltip" data-original-title="客户总数">客户:{{sum}}</div>
  217. <ul class="sortAddup" data-placement="right" data-toggle="ctooltip" data-original-title="创建客户数">
  218. <!-- if !empty({{max}}) -->
  219. <li>
  220. <!-- if isset({{max.0}}) -->
  221. <span>{{max.0.1}}:</span>{{max.0.0}}
  222. <!-- endif -->
  223. </li>
  224. <li>
  225. <!-- if isset({{max.1}}) -->
  226. <span>{{max.1.1}}:</span>{{max.1.0}}
  227. <!-- endif -->
  228. </li>
  229. <li>
  230. <!-- if isset({{max.2}}) -->
  231. <span>{{max.2.1}}:</span>{{max.2.0}}
  232. <!-- endif -->
  233. </li>
  234. <!-- endif -->
  235. <dl class="hide sec use">
  236. <!-- loop max2 -->
  237. <dd><span>{{max2' value.1}}:</span>{{max2' value.0}}</dd>
  238. <!-- endloop -->
  239. </dl>
  240. </ul>
  241. <div class="bigAddup" data-placement="bottom" data-toggle="ctooltip" data-original-title="锁总数(使用率)">锁:{{Rsum}}({{Ssum}})</div>
  242. <ul class="sortAddup" data-placement="right" data-toggle="ctooltip" data-original-title="锁使用率">
  243. <li>
  244. <!-- if isset({{useL.0}}) -->
  245. <span>{{useL.0.1}}:</span>{{useL.0.0}}
  246. <!-- endif -->
  247. </li>
  248. <li>
  249. <!-- if isset({{useL.1}}) -->
  250. <span>{{useL.1.1}}:</span>{{useL.1.0}}
  251. <!-- endif -->
  252. </li>
  253. <li>
  254. <!-- if isset({{useL.2}}) -->
  255. <span>{{useL.2.1}}:</span>{{useL.2.0}}
  256. <!-- endif -->
  257. </li>
  258. <dl class="hide sec">
  259. <!-- loop useL2 -->
  260. <dd><span>{{useL2' value.1}}:</span>{{useL2' value.0}}</dd>
  261. <!-- endloop -->
  262. </dl>
  263. </ul>
  264. </div>
  265. <div class="centerRecord">
  266. <div class="sideBar">
  267. <div class="mostTab"></div>
  268. <div class="mostList autoHeightI1" data-placement="top" data-toggle="ctooltip" data-original-title="滚动条隐藏了,用鼠标滚轮下拉吧">
  269. <ul class="item">
  270. <li class="select <!-- if empty({{sid}}) -->now<!-- endif -->">
  271. <select id="cateselect">
  272. <!-- loop categorylist2 -->
  273. <!-- if isset({{categorylist2' value.did}}) -->
  274. <option value="{{categorylist2' value.cid}}-{{categorylist2' value.did}}" <!-- if {{categorylist2' value.cid}} == {{cid}} &&{{categorylist2' value.did}} == {{did}} -->selected<!-- endif -->>{{categorylist2' value.title}}-{{categorylist2' value.departmentName}}</option>
  275. <!-- else -->
  276. <option value="{{categorylist2' value.cid}}" <!-- if {{categorylist2' value.cid}} == {{cid}} -->selected<!-- endif -->>{{categorylist2' value.title}}</option>
  277. <!-- endif -->
  278. <!-- endloop -->
  279. </select>
  280. </li>
  281. <!-- loop staffList -->
  282. <li <!-- if {{staffList' value.sid}}=={{sid}} -->class="now" <!-- endif -->>
  283. <!-- if !empty({{staffList' value.departmentID}}) -->
  284. <a href="/logStatistics?cid={{staffList' value.cid}}-{{staffList' value.departmentID}}&sid={{staffList' value.sid}}"><div class="avtra"><img src="{{staffList' value.avatar}}_2.jpg"></div>
  285. <h2>{{staffList' value.username}}<p>{{staffList' value.category}}</p></h2>
  286. </a>
  287. <!-- else -->
  288. <a href="/logStatistics?cid={{staffList' value.cid}}&sid={{staffList' value.sid}}"><div class="avtra"><img src="{{staffList' value.avatar}}_2.jpg"></div>
  289. <h2>{{staffList' value.username}}<p>{{staffList' value.category}}</p></h2>
  290. </a>
  291. <!-- endif -->
  292. </li>
  293. <!-- endloop -->
  294. </ul>
  295. </div>
  296. </div>
  297. <div class="dateRecord">
  298. <div class="dateTab"><a href="/logStatistics" class="now">统计</a><a href="/index?cid={{cid}}&sid={{sid}}">记录</a></div>
  299. <div class="dateList autoHeightI1">
  300. <div class="chartTab"><ul class="tButton"><li class="now">通信录</li><li>
  301. <!-- if empty({{did}}) -->
  302. <a href="/longleStatistics?cid={{cid}}">锁</a>
  303. <!-- else -->
  304. <a href="/longleStatistics?cid={{cid}}-{{did}}">锁</a>
  305. <!-- endif -->
  306. </li></ul></div>
  307. <div class="warpCharts">
  308. <!--图表1-->
  309. <div id="chartContainer1" style="height: 300px; width: 100%;">
  310. </div>
  311. <!--图表1-->
  312. <div class="clearfix">
  313. <!--图表2-->
  314. <div class="fL" id="chartContainer2" style="height: 300px; width: 50%;">
  315. </div>
  316. <!--图表2-->
  317. <!--图表3-->
  318. <div class="fR" id="chartContainer3" style="height: 300px; width: 50%;">
  319. </div>
  320. <!--图表3-->
  321. </div>
  322. </div>
  323. </div>
  324. </div>
  325. </div>
  326. </div>
  327. </div>
  328. </div>
  329. <script type="text/javascript">autoFlashHeight();</script>
  330. <script>
  331. $('#cateselect').change(function(){
  332. window.location.href = "/logStatistics?cid="+$(this).val();
  333. })
  334. </script>
  335. </body>