room.js 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268
  1. //计划完成表的当前所选
  2. var indexnum = 0;
  3. var color=['#F35331','#2499F8','#3DF098','#33B734'];
  4. var fontColor='#FFF';
  5. //定义进度条组件和属性
  6. var y_gauge1 =null;
  7. var y_gauge2 =null;
  8. var y_gauge3 =null;
  9. var y_gauge4 =null;
  10. var m_gauge1 =null;
  11. var option_Progress =null;
  12. //订单情况螺旋图
  13. var orderStatus=null;
  14. var orderStatus_option =null;
  15. //定义仪表盘组件和属性
  16. var gauge1 =null;
  17. var gauge2 =null;
  18. var gauge3 =null;
  19. var gauge4 =null;
  20. var gauge5 =null;
  21. var option_gauge =null;
  22. //产品饼图组件和属性
  23. var productPie=null;
  24. var productPie_option=null;
  25. //业务进展图组件和属性
  26. var businessProgress=null;
  27. var businessProgress_placeHoledStyle = null;
  28. var businessProgress_dataStyle =null;
  29. var businessProgress_option=null;
  30. //生产质量堆积图组件和属性
  31. var quality_chart = null;
  32. var quality_option=null;
  33. //词云组件和属性
  34. var wordCloud= null;
  35. var wordCloud_option=null;
  36. //生产计划折线图组件和属性
  37. var plan_chart = null;
  38. var plan_option=null;
  39. //环形图的风格定义
  40. var dataStyle = {
  41. normal: {
  42. label: {show:false},
  43. labelLine: {show:false}
  44. }
  45. };
  46. var placeHolderStyle = {
  47. normal : {
  48. color: 'rgba(0,0,0,0.1)',
  49. label: {show:false},
  50. labelLine: {show:false}
  51. },
  52. emphasis : {
  53. color: 'rgba(0,0,0,0)'
  54. }
  55. };
  56. //最大订单号
  57. var lastOrderNumber=1;
  58. $(document).ready(function ()
  59. {
  60. //环形进度条设置对象
  61. option_Progress={
  62. title : {
  63. text: '目前进度',
  64. subtext: '50%',
  65. x: 'center',
  66. y: 90,
  67. itemGap: 10,
  68. textStyle : {
  69. color : '#B7E1FF',
  70. fontWeight: 'normal',
  71. fontFamily : '微软雅黑',
  72. fontSize : 24
  73. },
  74. subtextStyle:{
  75. color: '#B7E1FF',
  76. fontWeight: 'bolder',
  77. fontSize:24,
  78. fontFamily : '微软雅黑'
  79. }
  80. },
  81. series : [{
  82. type : 'pie',
  83. center : ['50%', '50%'],
  84. radius : [75,90],
  85. x: '0%',
  86. tooltip:{show:false},
  87. data : [{
  88. name:'达成率',
  89. value:79,
  90. itemStyle:{color :'rgba(0,153,255,0.8)'},
  91. hoverAnimation: false,
  92. label : {
  93. show : false,
  94. position : 'center',
  95. textStyle: {
  96. fontFamily:'微软雅黑',
  97. fontWeight: 'bolder',
  98. color:'#B7E1FF',
  99. fontSize:24
  100. }
  101. },
  102. labelLine : {
  103. show : false
  104. }
  105. },
  106. {
  107. name:'79%',
  108. value:21,
  109. itemStyle:{color: 'rgba(0,153,255,0.1)'},
  110. hoverAnimation: false,
  111. label : {
  112. show : false,
  113. position : 'center',
  114. padding:20,
  115. textStyle: {
  116. fontFamily:'微软雅黑',
  117. fontSize: 24,
  118. color:'#B7E1FF'
  119. }
  120. },
  121. labelLine : {
  122. show : false
  123. }
  124. }]
  125. },
  126. {
  127. type : 'pie',
  128. center : ['50%', '50%'],
  129. radius : [95,100],
  130. x: '0%',
  131. hoverAnimation: false,
  132. data : [{
  133. value:100,
  134. itemStyle:{color :'rgba(0,153,255,0.3)'},
  135. label : {show : false},
  136. labelLine : {show : false}
  137. }]
  138. },
  139. {
  140. type : 'pie',
  141. center : ['50%', '50%'],
  142. radius : [69,70],
  143. x: '0%',
  144. hoverAnimation: false,
  145. data : [{
  146. value:100,
  147. itemStyle:{color :'rgba(0,153,255,0.3)'},
  148. label : {show : false},
  149. labelLine : {show : false}
  150. }]
  151. }]
  152. };
  153. //年仪表盘
  154. y_gauge1 = echarts.init(document.getElementById('y_gauge1'));
  155. y_gauge2 = echarts.init(document.getElementById('y_gauge2'));
  156. y_gauge3 = echarts.init(document.getElementById('y_gauge3'));
  157. y_gauge4 = echarts.init(document.getElementById('y_gauge4'));
  158. //订单完成情况螺旋图
  159. var yearPlanData=[];
  160. var yearOrderData=[];
  161. var differenceData=[];
  162. var visibityData=[];
  163. var xAxisData=[];
  164. for(var i=0;i<12;i++)
  165. {
  166. yearPlanData.push(Math.round(Math.random()*900)+100);
  167. yearOrderData.push(Math.round(Math.random()*yearPlanData[i]));
  168. differenceData.push(yearPlanData[i]-yearOrderData[i]);
  169. visibityData.push(yearOrderData[i]);
  170. xAxisData.push((i+1).toString()+"月");
  171. }
  172. orderStatus= echarts.init(document.getElementById('orderStatus'));
  173. orderStatus_option={
  174. title :{show:false},
  175. tooltip : {
  176. trigger: 'axis',
  177. formatter: function (params){
  178. return params[0].name + '<br/>'
  179. + params[0].seriesName + ' : ' + params[0].value + '<br/>'
  180. + params[1].seriesName + ' : ' + params[1].value + '<br/>'
  181. +'完成率:'
  182. + (params[0].value > 0 ? (params[1].value/params[0].value*100).toFixed(2)+'%' : '-')
  183. + '<br/>'
  184. },
  185. textStyle: {
  186. color: '#FFF',
  187. fontSize:24
  188. }
  189. },
  190. toolbox: {show:false},
  191. legend:{
  192. top: 'top',
  193. textStyle: {
  194. color: '#B7E2FF',
  195. fontSize:24,
  196. fontFamily:'微软雅黑'
  197. },
  198. data:['计划生产','已接订单']
  199. },
  200. xAxis: {
  201. data: xAxisData,
  202. axisLabel: {
  203. textStyle: {
  204. color: '#B7E1FF',
  205. fontSize:24
  206. }
  207. },
  208. axisLine:{
  209. lineStyle:{
  210. color:'#09F'
  211. }
  212. },
  213. axisTick:{
  214. lineStyle:{
  215. color:'#09F'
  216. }
  217. }
  218. },
  219. yAxis: {
  220. inverse: false,
  221. splitArea: {show: false},
  222. axisLine: {show: false},
  223. axisTick: {show: false},
  224. axisLabel: {
  225. textStyle: {
  226. color: '#B7E1FF',
  227. fontSize:24,
  228. fontFamily:'Arial',
  229. }
  230. },
  231. splitLine :{
  232. lineStyle:{
  233. color:'#09F'
  234. }
  235. }
  236. },
  237. grid: {
  238. left: 100
  239. },
  240. series : [{
  241. name:'计划生产',
  242. type:'line',
  243. smooth :true,
  244. symbol: 'circle',
  245. symbolSize: 10,
  246. showAllSymbol : true,
  247. color:color[1],
  248. data:yearPlanData
  249. },
  250. {
  251. name:'已接订单',
  252. type:'line',
  253. smooth :true,
  254. symbol: 'circle',
  255. symbolSize: 10,
  256. showAllSymbol : true,
  257. color:'#F90',
  258. itemStyle:{
  259. normal:{
  260. lineStyle: {
  261. width:2
  262. }
  263. }
  264. },
  265. data:yearOrderData
  266. },
  267. {
  268. name:'不可见',
  269. type:'bar',
  270. stack: '1',
  271. barWidth: 1,
  272. itemStyle:{
  273. normal:{
  274. color:'rgba(0,0,0,0)'
  275. },
  276. emphasis:{
  277. color:'rgba(0,0,0,0)'
  278. }
  279. },
  280. data:visibityData
  281. },
  282. {
  283. name:'变化',
  284. type:'bar',
  285. stack: '1',
  286. barWidth: 1,
  287. color:'#B7E1FF',
  288. data:differenceData
  289. }
  290. ]
  291. }
  292. orderStatus.setOption(orderStatus_option);
  293. //产品销售的环形图
  294. var productLegend=[['轿车1','轿车2','轿车3','轿车4','轿车5','轿车6','轿车7','轿车8','轿车9'],['SUV1','SUV2','SUV3','SUV4'],['卡车1','卡车2','卡车3','卡车4','卡车5','卡车6']];
  295. var productClassLegend=['轿车','SUV','卡车'];
  296. var productClassColor=['rgba(255,153,0,','rgba(153,204,102,','rgba(0,102,255,'];
  297. var productClassData=[];
  298. var productData=[];
  299. var productColor=[];
  300. for(var i=0;i<productClassLegend.length;i++)
  301. {
  302. var total=0;
  303. for(var j=0;j<productLegend[i].length;j++)
  304. {
  305. var n=Math.round(Math.random()*100)+1;
  306. productData.push({name:productLegend[i][j],value:n});
  307. total+=n;
  308. }
  309. for(var j=0;j<productLegend[i].length;j++)
  310. {
  311. productColor.push(productClassColor[i]+(1.0-productData[j].value/total).toFixed(2)+")");
  312. }
  313. productClassData.push({name:productClassLegend[i],value:total});
  314. }
  315. productPie=echarts.init(document.getElementById('productPie'));
  316. productPie_option={
  317. title : {
  318. text: '销售额',
  319. x: 'center',
  320. y: 'center',
  321. itemGap: 10,
  322. textStyle : {
  323. color : '#09F',
  324. fontWeight: 'normal',
  325. fontFamily : '微软雅黑',
  326. fontSize : 32
  327. }
  328. },
  329. calculable : false,
  330. tooltip : {
  331. trigger: 'item',
  332. textStyle: {
  333. color:'#FFF',
  334. fontSize:24
  335. },
  336. formatter: "{a} <br/>{b} : {c} ({d}%)"
  337. },
  338. series : [
  339. {
  340. name:'类别',
  341. type:'pie',
  342. selectedMode: 'single',
  343. radius : ['20%','40%'],
  344. width: '40%',
  345. funnelAlign: 'right',
  346. itemStyle : {
  347. normal : {
  348. color:function(d)
  349. {
  350. return productClassColor[d.dataIndex]+'1)';
  351. },
  352. borderColor:'#032749',
  353. label : {
  354. position : 'inner',
  355. fontSize:28,
  356. },
  357. labelLine : {
  358. show : false
  359. }
  360. }
  361. },
  362. data:productClassData
  363. },
  364. {
  365. name:'车型',
  366. type:'pie',
  367. radius : ['40%','70%'],
  368. width: '35%',
  369. funnelAlign: 'left',
  370. itemStyle : {
  371. normal : {
  372. color:function(d)
  373. {
  374. return productColor[d.dataIndex];
  375. },
  376. borderColor:'#032749',
  377. label : {
  378. color:'#B7E1FF',
  379. fontSize:24
  380. }
  381. }
  382. },
  383. data:productData
  384. }
  385. ]
  386. };
  387. productPie.setOption(productPie_option);
  388. //业务进展图
  389. businessProgress=echarts.init(document.getElementById('businessProgress'));
  390. businessProgress_placeHoledStyle = {
  391. normal:{
  392. barBorderColor:'rgba(0,0,0,0)',
  393. color:'rgba(0,0,0,0)'
  394. },
  395. emphasis:{
  396. barBorderColor:'rgba(0,0,0,0)',
  397. color:'rgba(0,0,0,0)'
  398. }
  399. };
  400. businessProgress_dataStyle = {
  401. normal: {
  402. barBorderColor:'rgba(0,102,255,1)',
  403. color:function(d){
  404. return 'rgba(0,102,255,0.3)';
  405. },
  406. label : {
  407. show: true,
  408. position: 'insideLeft',
  409. formatter: '{c}%',
  410. textStyle: {
  411. fontFamily:'Arial',
  412. fontWeight: 'bolder',
  413. color:'#B7E1FF',
  414. fontSize:24
  415. }
  416. }
  417. }
  418. };
  419. businessProgress_option = {
  420. title: {show:false},
  421. tooltip : {
  422. trigger: 'axis',
  423. axisPointer : {
  424. type : 'shadow'
  425. },
  426. textStyle: {
  427. color:'#FFF',
  428. fontSize:24
  429. },
  430. formatter : '{b}<br/>{a0}:{c0}%<br/>{a2}:{c2}%<br/>{a4}:{c4}%<br/>{a6}:{c6}%'
  431. },
  432. legend: {
  433. itemGap : 60,
  434. top:'top',
  435. textStyle: {
  436. fontFamily:'微软雅黑',
  437. fontWeight: 'bolder',
  438. color:'#B7E1FF',
  439. fontSize:24
  440. },
  441. data:['项目投标', '投标进度','项目进行', '项目交付']
  442. },
  443. toolbox: {show : false},
  444. grid: {
  445. left: 150
  446. },
  447. xAxis : [
  448. {
  449. type : 'value',
  450. position: 'top',
  451. axisLine:{
  452. lineStyle:{color:'#09F'}
  453. },
  454. splitLine :{
  455. lineStyle:{color:'#09F' }
  456. },
  457. axisLabel: {show: false},
  458. }
  459. ],
  460. yAxis : [
  461. {
  462. type : 'category',
  463. data : ['重大业务1', '重大业务2', '重大业务3', '重大业务4'],
  464. axisLabel: {
  465. textStyle: {
  466. color: '#B7E1FF',
  467. fontSize:24
  468. }
  469. },
  470. axisLine:{
  471. lineStyle:{
  472. color:'#09F'
  473. }
  474. },
  475. splitLine :{
  476. lineStyle:{color:'#09F' }
  477. }
  478. }
  479. ],
  480. series : [
  481. {
  482. name:'项目投标',
  483. type:'bar',
  484. stack: '进度',
  485. itemStyle : businessProgress_dataStyle,
  486. data:[100, 100, 100, 70]
  487. },
  488. {
  489. name:'项目投标',
  490. type:'bar',
  491. stack: '进度',
  492. itemStyle: businessProgress_placeHoledStyle,
  493. data:[0, 0, 0, 30]
  494. },
  495. {
  496. name:'投标进度',
  497. type:'bar',
  498. stack: '进度',
  499. itemStyle : businessProgress_dataStyle,
  500. data:[100, 100, 42, 0]
  501. },
  502. {
  503. name:'投标进度',
  504. type:'bar',
  505. stack: '进度',
  506. itemStyle: businessProgress_placeHoledStyle,
  507. data:[0, 0, 58, 100]
  508. },
  509. {
  510. name:'项目进行',
  511. type:'bar',
  512. stack: '进度',
  513. itemStyle : businessProgress_dataStyle,
  514. data:[100, 100, 0, 0]
  515. },
  516. {
  517. name:'项目进行',
  518. type:'bar',
  519. stack: '进度',
  520. itemStyle: businessProgress_placeHoledStyle,
  521. data:[0, 0, 100, 100]
  522. },
  523. {
  524. name:'项目交付',
  525. type:'bar',
  526. stack: '进度',
  527. itemStyle : businessProgress_dataStyle,
  528. data:[71, 50, 0, 0]
  529. },
  530. {
  531. name:'项目交付',
  532. type:'bar',
  533. stack: '进度',
  534. itemStyle: businessProgress_placeHoledStyle,
  535. data:[29, 50, 100, 100]
  536. }
  537. ]
  538. };
  539. businessProgress.setOption(businessProgress_option);
  540. //监控仪表盘
  541. /*option_gauge = {
  542. title: {
  543. text: '', //标题文本内容
  544. },
  545. toolbox: { //可视化的工具箱
  546. show: false,
  547. },
  548. tooltip: { //弹窗组件
  549. formatter: "{a} <br/>{b} : {c}%"
  550. },
  551. series: [{
  552. type: 'gauge',
  553. axisLine: {// 坐标轴线
  554. lineStyle: { // 属性lineStyle控制线条样式
  555. color:[[0.2, color[0]],[0.8, color[1]],[1, color[0]]],
  556. width: 18
  557. }
  558. },
  559. splitLine: { // 分隔线
  560. show:true,
  561. length: 18,
  562. lineStyle: {
  563. color: '#28292D',
  564. width: 1
  565. }
  566. },
  567. axisTick : { //刻度线样式(及短线样式)
  568. show:false,
  569. lineStyle: {
  570. color: 'auto',
  571. width: 1
  572. },
  573. length : 20
  574. },
  575. axisLabel : {
  576. color:'#FFF',
  577. fontSize:14,
  578. fontFamily:'Verdana, Geneva, sans-serif'
  579. },
  580. title: {
  581. textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
  582. fontWeight: 'bolder',
  583. fontSize: 20,
  584. color: '#FFF'
  585. },
  586. offsetCenter: [0, '30%']
  587. },
  588. pointer: {
  589. width: 5,
  590. color: '#F00',
  591. shadowColor: '#FF0',
  592. shadowBlur: 10
  593. },
  594. detail: {
  595. show:false,
  596. formatter:'{value}%',
  597. textStyle:
  598. {
  599. fontFamily:'Arial',
  600. color: '#000',
  601. fontSize:'32px'
  602. },
  603. offsetCenter: [0, '90%']
  604. },
  605. data: [{value: 45, name: '水'}]
  606. }]
  607. };
  608. gauge1 = echarts.init(document.getElementById('gauge1'));
  609. gauge2 = echarts.init(document.getElementById('gauge2'));
  610. gauge3 = echarts.init(document.getElementById('gauge3'));
  611. gauge4 = echarts.init(document.getElementById('gauge4'));
  612. gauge5 = echarts.init(document.getElementById('gauge5'));
  613. option_gauge.series[0].axisLine.lineStyle.color=[[0.2, color[0]],[0.8, color[1]],[1, color[2]]];
  614. option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
  615. option_gauge.series[0].data[0].name ="水";
  616. $('#vg1').html(option_gauge.series[0].data[0].value);
  617. gauge1.setOption(option_gauge);
  618. option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
  619. option_gauge.series[0].data[0].name ="电";
  620. $('#vg2').html(option_gauge.series[0].data[0].value);
  621. gauge2.setOption(option_gauge);
  622. option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
  623. option_gauge.series[0].data[0].name ="天然气";
  624. $('#vg3').html(option_gauge.series[0].data[0].value);
  625. gauge3.setOption(option_gauge);
  626. option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
  627. option_gauge.series[0].data[0].name ="压缩空气";
  628. $('#vg4').html(option_gauge.series[0].data[0].value);
  629. gauge4.setOption(option_gauge);
  630. option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
  631. option_gauge.series[0].data[0].name ="蒸汽";
  632. $('#vg5').html(option_gauge.series[0].data[0].value);
  633. gauge5.setOption(option_gauge);*/
  634. //生产质量堆积图
  635. quality_chart = echarts.init(document.getElementById('quality'));
  636. quality_option={
  637. title: {
  638. show:false,
  639. text: 'AUDIT',
  640. left: 'center',
  641. textStyle: {
  642. color: '#F00',
  643. fontSize:32
  644. }
  645. },
  646. xAxis: {
  647. data: ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月'],
  648. axisLabel: {
  649. textStyle: {
  650. color: '#B7E1FF',
  651. fontSize:24
  652. }
  653. },
  654. axisLine:{
  655. lineStyle:{
  656. color:'#09F'
  657. }
  658. },
  659. axisTick:{
  660. lineStyle:{
  661. color:'#09F'
  662. }
  663. }
  664. },
  665. yAxis: {
  666. inverse: false,
  667. splitArea: {show: false},
  668. axisLine: {show: false},
  669. axisTick: {show: false},
  670. axisLabel: {
  671. textStyle: {
  672. color: '#B7E1FF',
  673. fontSize:24,
  674. fontFamily:'Arial',
  675. }
  676. },
  677. splitLine :{
  678. lineStyle:{
  679. color:'#09F'
  680. }
  681. }
  682. },
  683. grid: {
  684. left: 100
  685. },
  686. tooltip: {
  687. trigger: 'item',
  688. textStyle: {
  689. color: '#B7E1FF',
  690. fontSize:24
  691. }
  692. },
  693. legend:{
  694. show:false,
  695. top: 'bottom',
  696. textStyle: {
  697. color: '#F00',
  698. fontSize:24,
  699. fontFamily:'微软雅黑'
  700. },
  701. data:['AUDIT分数1','AUDIT分数']
  702. },
  703. series: [
  704. {
  705. name: 'AUDIT分数1',
  706. type: 'bar',
  707. stack: 'one',
  708. itemStyle:
  709. {
  710. normal: {color: color[1]}
  711. },
  712. barWidth : 60,
  713. data:[2200,2900,3680,2200,2900,3680,2200,2900,3680,2200,2900,3680]
  714. },
  715. {
  716. name: 'AUDIT分数',
  717. type: 'bar',
  718. stack: 'one',
  719. itemStyle: {
  720. normal: {
  721. color: '#F90',
  722. label: {
  723. show: true,
  724. position: 'insideTop',
  725. textStyle: {
  726. color: '#000',
  727. fontSize:24
  728. }
  729. }
  730. }
  731. },
  732. barWidth : 50,
  733. data: [1800,1100,320,1800,1100,320,1800,1100,320,1800,1100,320]
  734. }
  735. ]
  736. };
  737. quality_chart.setOption(quality_option);
  738. //生产计划折线图
  739. var plan_data1=[];
  740. var plan_data2=[];
  741. var plan_xAxis=[];
  742. for (var i = 1; i <= 12; i++) {
  743. plan_xAxis.push(i+"月");
  744. plan_data1.push(Math.round(Math.random() * 100));
  745. plan_data2.push(Math.round(Math.random() * 100));
  746. }
  747. plan_chart = echarts.init(document.getElementById('plan'));
  748. plan_option={
  749. xAxis: {
  750. data:plan_xAxis,
  751. axisLabel: {
  752. textStyle: {
  753. color: '#B7E1FF',
  754. fontSize:24
  755. }
  756. },
  757. axisLine:{
  758. lineStyle:{
  759. color:'#09F'
  760. }
  761. },
  762. axisTick:{
  763. lineStyle:{
  764. color:'#09F'
  765. }
  766. }
  767. },
  768. yAxis: {
  769. inverse: false,
  770. splitArea: {show: false},
  771. axisLine: {show: false},
  772. axisTick: {show: false},
  773. axisLabel: {
  774. textStyle: {
  775. color: '#B7E1FF',
  776. fontSize:24,
  777. fontFamily:'Arial',
  778. }
  779. },
  780. splitLine :{
  781. lineStyle:{
  782. color:'#09F'
  783. }
  784. }
  785. },
  786. tooltip: {
  787. trigger: 'axis',
  788. textStyle: {
  789. color: '#FFF',
  790. fontSize:24
  791. }
  792. },
  793. grid: {
  794. left: 100
  795. },
  796. legend:{
  797. show:false,
  798. top: 'bottom',
  799. textStyle: {
  800. color: '#F00',
  801. fontSize:24
  802. },
  803. data:['计划完成数','实际完成数']
  804. },
  805. series: [
  806. {
  807. name: '计划完成数',
  808. type: 'bar',
  809. itemStyle:
  810. {
  811. normal: {color: color[1]},
  812. emphasis: {color: color[2]}
  813. },
  814. barWidth : 40,
  815. data:plan_data1
  816. },
  817. {
  818. name: '实际完成数',
  819. type: 'line',
  820. itemStyle: {
  821. normal: {
  822. color: '#F90',
  823. label: {
  824. show: true,
  825. position: 'top',
  826. textStyle: {
  827. color: '#CCC',
  828. fontSize:24
  829. }
  830. },
  831. lineStyle:{
  832. color:'#F90',
  833. width:4
  834. }
  835. },
  836. emphasis: {
  837. color: '#FF0'
  838. }
  839. },
  840. symbolSize: 24,
  841. data: plan_data2
  842. }
  843. ]
  844. };
  845. plan_chart.setOption(plan_option);
  846. //轮番显示tips
  847. /*function clock(){
  848. showToolTip_highlight(plan_chart);
  849. }
  850. setInterval(clock, 5000);*/
  851. //词云
  852. var cloudData=[];
  853. for(var i=0;i<30;i++)
  854. {
  855. cloudData.push({name:'文字云字符'+i.toString(),value:Math.random()*1000});
  856. }
  857. wordCloud=echarts.init(document.getElementById('wordCloud'));
  858. wordCloud_option={
  859. left: 'center',
  860. top: 'center',
  861. tooltip: {
  862. textStyle: {
  863. color: '#FFF',
  864. fontSize:24
  865. }},
  866. series : [{
  867. type : 'wordCloud',
  868. shape:'smooth',
  869. drawOutOfBound: true,
  870. gridSize : 10,
  871. sizeRange : [ 10, 48 ],
  872. rotationRange: [0, 0],
  873. textStyle : {
  874. normal : {
  875. color :function (d) {
  876. // Random color
  877. return 'rgba(0,153,255,'+(d.value/1000)+ ')';
  878. }
  879. },
  880. emphasis : {
  881. shadowBlur : 10,
  882. shadowColor : '#333'
  883. }
  884. },
  885. data : cloudData
  886. }]
  887. };
  888. wordCloud.setOption(wordCloud_option);
  889. //地图开始
  890. var map_chart = echarts.init(document.getElementById('map'));
  891. /*map_option = {
  892. title : {show:false},
  893. tooltip: {
  894. show:function(d)
  895. {
  896. return (d.value!=null && d.value>=0);
  897. },
  898. trigger: 'item',
  899. formatter:function(d){
  900. return (d.value>=0)?d.name+'</br>战略力度:'+(d.value).toFixed(2):'';
  901. },
  902. textStyle: {
  903. color: '#FFF',
  904. fontSize:24
  905. }
  906. },
  907. legend: {
  908. show:false
  909. },
  910. dataRange: {
  911. show:false,
  912. min: 0,
  913. max: 100,
  914. text:['High','Low'],
  915. realtime: false,
  916. calculable : false,
  917. color: ['rgba(0,51,204,0.8)','rgba(0,102,255,0.8)','rgba(0,153,255,0.8)'],
  918. splitList: [
  919. {start: 0,end: 30},
  920. {start: 31, end: 70},
  921. {start: 71, end: 100},
  922. ]
  923. },
  924. series: [{
  925. name: '布局',
  926. type: 'map',
  927. mapType: 'china',
  928. roam: false,
  929. showLegendSymbol : false,
  930. label: {
  931. show: true,
  932. textStyle: {
  933. color: '#FFF',
  934. fontSize:18
  935. }
  936. },
  937. itemStyle :{
  938. areaColor :'rgba(0,0,0,0.2)',
  939. borderColor : '#09F'
  940. },
  941. emphasis:{
  942. areaColor :'rgba(255,0,0,0.8)',
  943. borderColor : 'rgba(255,0,0,0.8)'
  944. },
  945. data:[
  946. {name: '北京', value:Math.random()*100},
  947. {name: '天津', value:Math.random()*100},
  948. {name: '上海', value:Math.random()*100},
  949. {name: '重庆', value:Math.random()*100},
  950. {name: '河北', value:Math.random()*100},
  951. {name: '河南', value:Math.random()*100},
  952. {name: '辽宁', value:Math.random()*100},
  953. {name: '黑龙江', value:Math.random()*100},
  954. {name: '湖南', value:Math.random()*100},
  955. {name: '安徽', value:Math.random()*100},
  956. {name: '山东', value:Math.random()*100},
  957. {name: '江苏', value:Math.random()*100},
  958. {name: '浙江', value:Math.random()*100},
  959. {name: '江西', value:Math.random()*100},
  960. {name: '湖北', value:Math.random()*100},
  961. {name: '广西', value:Math.random()*100},
  962. {name: '甘肃', value:Math.random()*100},
  963. {name: '山西', value:Math.random()*100},
  964. {name: '内蒙古', value:Math.random()*100},
  965. {name: '陕西', value:Math.random()*100},
  966. {name: '吉林', value:Math.random()*100},
  967. {name: '福建', value:Math.random()*100},
  968. {name: '贵州', value:Math.random()*100},
  969. {name: '广东', value:Math.random()*100},
  970. {name: '青海', value:Math.random()*100},
  971. {name: '四川', value:Math.random()*100},
  972. {name: '宁夏', value:Math.random()*100},
  973. {name: '海南', value:Math.random()*100}
  974. ]
  975. }]
  976. };*/
  977. var mapData=[];
  978. for(key in geoCoordMap)
  979. {
  980. var geoCoord = geoCoordMap[key];
  981. mapData.push({name:key,value:geoCoord.concat((Math.random()*1000).toFixed(2))});
  982. }
  983. map_option = {
  984. title : {show:false},
  985. tooltip : {
  986. trigger: 'item',
  987. formatter: function(params) {
  988. if (typeof(params.value)[2] == "undefined") {
  989. return params.name + ' : ' + params.value;
  990. } else {
  991. return params.name + ' : ' + params.value[2];
  992. }
  993. },
  994. textStyle: {
  995. color: '#FFF',
  996. fontSize:24
  997. }
  998. },
  999. legend: {
  1000. show:false
  1001. },
  1002. geo: {
  1003. map: 'china',
  1004. label: {
  1005. normal: {show: false},
  1006. emphasis: {show: false}
  1007. },
  1008. roam: false,
  1009. itemStyle: {
  1010. normal: {
  1011. areaColor: 'rgba(0,153,255,0.6)',
  1012. borderColor: '#09F'
  1013. },
  1014. emphasis: {
  1015. areaColor: 'rgba(0,153,255,0.6)',
  1016. borderColor: '#09F'
  1017. }
  1018. }
  1019. },
  1020. series: [{
  1021. name: '战略布局点',
  1022. type: 'scatter',
  1023. coordinateSystem: 'geo',
  1024. zlevel: 1,
  1025. rippleEffect: {
  1026. brushType: 'stroke'
  1027. },
  1028. symbolSize: function (val) {
  1029. return val[2] / 30;
  1030. },
  1031. label: {
  1032. normal: {show: false},
  1033. emphasis: {show: false}
  1034. },
  1035. itemStyle: {
  1036. normal: {color: 'rgba(255,255,0,0.8)'},
  1037. emphasis: {color: 'rgba(246,33,87,1)'}
  1038. },
  1039. data: mapData
  1040. },
  1041. {
  1042. name: '战略布局TOP5',
  1043. type: 'effectScatter',
  1044. coordinateSystem: 'geo',
  1045. zlevel: 2,
  1046. hoverAnimation: true,
  1047. showEffectOn: 'render',
  1048. rippleEffect: {
  1049. brushType: 'stroke'
  1050. },
  1051. label: {
  1052. normal: {
  1053. show: true,
  1054. fontFamily:'微软雅黑',
  1055. fontSize: 24,
  1056. color:'#FFF',
  1057. formatter: '{b}',
  1058. position: 'right',
  1059. shadowBlur: 5,
  1060. shadowColor: '#000'
  1061. },
  1062. emphasis: {
  1063. show: true
  1064. }
  1065. },
  1066. symbolSize: function (val) {
  1067. return val[2] / 30;
  1068. },
  1069. itemStyle: {
  1070. normal: {
  1071. color: 'rgba(255,255,255,1)'
  1072. }
  1073. },
  1074. data: mapData.sort(function(a, b) {
  1075. return b.value[2] - a.value[2];
  1076. }).slice(0, 5)
  1077. },
  1078. {
  1079. name: '点',
  1080. type: 'scatter',
  1081. coordinateSystem: 'geo',
  1082. symbol: 'pin',
  1083. symbolSize: function(val) {
  1084. return val[2]/10;
  1085. },
  1086. label: {
  1087. normal: {
  1088. show: true,
  1089. fontFamily:'Arial, Helvetica, sans-serif',
  1090. formatter:'{@[2]}',
  1091. textStyle: {
  1092. color: '#FFF',
  1093. fontSize: 18,
  1094. }
  1095. }
  1096. },
  1097. itemStyle: {
  1098. normal: {
  1099. color: 'rgba(246,33,87,1)', //标志颜色
  1100. }
  1101. },
  1102. zlevel: 3,
  1103. data: mapData.sort(function(a, b) {
  1104. return b.value[2] - a.value[2];
  1105. }).slice(0, 5)
  1106. }]
  1107. };
  1108. map_chart.setOption(map_option, true);
  1109. resresh();
  1110. //开始定时刷新
  1111. setInterval(resresh, 5*1000);
  1112. });
  1113. var convertData = function (data) {
  1114. var res = [];
  1115. for (var i = 0; i < data.length; i++) {
  1116. var dataItem = data[i];
  1117. var fromCoord = geoCoordMap[dataItem[0].name];
  1118. var toCoord = geoCoordMap[dataItem[1].name];
  1119. if (fromCoord && toCoord) {
  1120. res.push({
  1121. fromName: dataItem[0].name,
  1122. toName: dataItem[1].name,
  1123. coords: [fromCoord, toCoord]
  1124. });
  1125. }
  1126. }
  1127. return res;
  1128. };
  1129. function showToolTip_highlight(mychart)
  1130. {
  1131. var echartObj = mychart;
  1132. // 高亮当前图形
  1133. var highlight =setInterval(function()
  1134. {
  1135. echartObj.dispatchAction({
  1136. type: 'highlight',
  1137. seriesIndex: 0,
  1138. dataIndex: indexnum
  1139. });
  1140. echartObj.dispatchAction({
  1141. type: 'showTip',
  1142. seriesIndex: 0,
  1143. dataIndex: indexnum
  1144. });
  1145. clearInterval(highlight);
  1146. indexnum = indexnum + 1;
  1147. if(indexnum>=7) indexnum=0;
  1148. },1000);
  1149. }
  1150. //定时刷新数据
  1151. function resresh()
  1152. {
  1153. var myDate = new Date();
  1154. // $('#refresh').html("<img src=\"images/wait.gif\" align=\"absmiddle\"><span>数据刷新中...</span>");
  1155. $('#currentDate').html(myDate.getFullYear()+"/"+insertZero(myDate.getMonth()+1)+"/"+insertZero(myDate.getDate()));
  1156. var maxg=Math.round(Math.random()*500)+400;
  1157. var n1=Math.round(Math.random()*(maxg-100))+100;
  1158. var n2=Math.round(Math.random()*(n1-50))+50;
  1159. var n3=(n2/maxg*100).toFixed(2);
  1160. //年进度条
  1161. option_Progress.title.text ="计划生产";
  1162. option_Progress.series[0].data[0].value = maxg;
  1163. option_Progress.title.subtext =maxg+"台";
  1164. option_Progress.series[0].data[1].value =0;
  1165. y_gauge1.setOption(option_Progress);
  1166. option_Progress.title.text ="已接订单";
  1167. option_Progress.series[0].data[0].value = n1;
  1168. option_Progress.title.subtext =n1+"台";
  1169. option_Progress.series[0].data[1].value =(maxg-n1);
  1170. y_gauge2.setOption(option_Progress);
  1171. option_Progress.title.text ="已经完成";
  1172. option_Progress.series[0].data[0].value = n2;
  1173. option_Progress.title.subtext =n2+"台";
  1174. option_Progress.series[0].data[1].value =(maxg-n2);
  1175. y_gauge3.setOption(option_Progress);
  1176. option_Progress.title.text ="计划完成率";
  1177. option_Progress.series[0].data[0].value = n3;
  1178. option_Progress.title.subtext =n3+"%";
  1179. option_Progress.series[0].data[1].value =(100-n3);
  1180. y_gauge4.setOption(option_Progress);
  1181. //仪表盘刷新
  1182. /*option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
  1183. option_gauge.series[0].data[0].name ="水";
  1184. $('#vg1').html(option_gauge.series[0].data[0].value);
  1185. gauge1.setOption(option_gauge);
  1186. option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
  1187. option_gauge.series[0].data[0].name ="电";
  1188. $('#vg2').html(option_gauge.series[0].data[0].value);
  1189. gauge2.setOption(option_gauge);
  1190. option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
  1191. option_gauge.series[0].data[0].name ="天然气";
  1192. $('#vg3').html(option_gauge.series[0].data[0].value);
  1193. gauge3.setOption(option_gauge);
  1194. option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
  1195. option_gauge.series[0].data[0].name ="压缩空气";
  1196. $('#vg4').html(option_gauge.series[0].data[0].value);
  1197. gauge4.setOption(option_gauge);
  1198. option_gauge.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
  1199. option_gauge.series[0].data[0].name ="蒸汽";
  1200. $('#vg5').html(option_gauge.series[0].data[0].value);
  1201. gauge5.setOption(option_gauge); */
  1202. //显示最后更新时间
  1203. $('#refresh').html("<span id=\"refreshTime\">最后刷新时间:"+myDate.toLocaleDateString()+" "+myDate.toLocaleTimeString()+"</span>");
  1204. }
  1205. //生成订单号
  1206. function getOrderNumber(n)
  1207. {
  1208. var no="000000"+n.toString();
  1209. return no.substring(no.length-6);
  1210. }
  1211. //前面补0
  1212. function insertZero(n)
  1213. {
  1214. var no="000000"+n.toString();
  1215. return no.substring(no.length-2);
  1216. }
  1217. //打开模态窗口
  1218. function openDialog(DlgName)
  1219. {
  1220. $('#'+DlgName).dialog('open');
  1221. }