61c23763aaf11558cb7eb8509f38b98c2e85f2e3.svn-base 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885
  1. <template>
  2. <div class="boxResult">
  3. <div class="headResult">
  4. <div class="headResult-item1">
  5. <span>时间</span>
  6. <el-select v-model="selectDate" placeholder="请选择" @change="changeDate">
  7. <el-option
  8. v-for="item in optionsDate"
  9. :key="item.value"
  10. :label="item.label"
  11. :value="item.value">
  12. </el-option>
  13. </el-select>
  14. <span>类型</span>
  15. <el-select v-model="selectType" placeholder="请选择" @change="changeType">
  16. <el-option
  17. v-for="item in typeOption"
  18. :key="item.inspType"
  19. :label="item.inspName"
  20. :value="item.inspType">
  21. </el-option>
  22. </el-select>
  23. </div>
  24. <div class="headResult-item2">督查成果统计</div>
  25. </div>
  26. <div class="resultContent">
  27. <div class="content-op">
  28. <div class="op-item" style="width: 55%;display: flex">
  29. <div class="op-item-title">督查对象分类问题数</div>
  30. <div class="title-right">问题等级统计</div>
  31. <div class="op-item-content" id="chartR1"></div>
  32. <div class="op-item-content" id="chartR3"></div>
  33. </div>
  34. <div class="op-item" style="width: 45%;">
  35. <div class="op-item-content" id="chartR4" style="height:100%;"></div>
  36. </div>
  37. </div>
  38. <div class="content-op">
  39. <div class="op-item" style="width: 55%;">
  40. <div class="op-item-title">督查对象区域及问题区域分布</div>
  41. <div class="op-item-content" id="chartR2"></div>
  42. </div>
  43. <div class="op-item" style="width: 45%;">
  44. <div class="op-item-content" id="chartR5" style="height:100%;"></div>
  45. </div>
  46. </div>
  47. </div>
  48. <pblmList v-if="isShowPblmList" :param="pblmParam" @closeDialogPblm="closeDialogPblm"></pblmList>
  49. <objList v-if="isShowObjList" :param="objParam" @closeDialogObj="closeDialogObj"></objList>
  50. </div>
  51. </template>
  52. <script>
  53. import echarts from "echarts";
  54. import axios from 'axios'
  55. import request from "@util/gw_ajax_request.js";
  56. import {formatDate} from "@util/gw_date.js"
  57. import pblmList from "./pblmList";
  58. import objList from "./objList";
  59. import { hostUrl } from "@util/global_variable.js";
  60. import {
  61. getDcPblmCount,
  62. getDcType,
  63. getPblmPro,
  64. getObjCount
  65. } from "../../api/homeMainView.js";
  66. export default {
  67. components: {
  68. pblmList,
  69. objList
  70. },
  71. props: [],
  72. data() {
  73. //这里存放数据
  74. return {
  75. isShowPblmList:false,
  76. isShowObjList:false,
  77. pblmParam:{},
  78. objParam:{},
  79. optionsDate:[
  80. {
  81. label:"近一个月",
  82. value:"1"
  83. },
  84. {
  85. label:"近三个月",
  86. value:"2"
  87. },
  88. {
  89. label:"近半年",
  90. value:"3"
  91. },
  92. {
  93. label:"近一年",
  94. value:"4"
  95. },
  96. {
  97. label:"有记录至今",
  98. value:"5"
  99. }
  100. ],
  101. selectDate:"5",
  102. selectType:"",
  103. selectTypeName:"全部",
  104. typeOption:[],
  105. chartR1:null,
  106. chartR2:null,
  107. chartR3:null,
  108. chartR4:null,
  109. chartR5:null,
  110. color:[
  111. '#e5cf0d','#97b552','#2ec7c9','#b6a2de',
  112. '#5ab1ef', '#ffb980', '#d87a80', '#8d98b3', '#40e0d0',
  113. '#4b3eff', '#0cffd5', '#afeea7', '#05d089', '#ffd700',
  114. '#6c8e37', '#4ea397', '#3cb371', '#6db8a9', '#7bd9a5',
  115. '#15a7ff', '#9de0ff', '#9da7ff', '#4cbbfe', '#7dc3fe',
  116. '#1658bb', '#433e7c', '#11ddf4', '#009db2', '#024b51',
  117. '#0d61cf', '#127619', '#40aae7', '#26ccd8', '#3685fe',
  118. '#4065ef', '#5160f5', '#f76ec0', '#f96711', '#50c48f'
  119. ],
  120. chartDcTypeData:{
  121. dataList:[],
  122. count:0
  123. },
  124. chartObjData:{
  125. xData:[],
  126. dataList:[]
  127. },
  128. chartPblmData:{
  129. xData:[],
  130. dataList:[],
  131. },
  132. max:0,
  133. chartPblmTypeData:[
  134. {name:"一般问题",value:"0",level:0},
  135. {name:"较严重问题",value:"0",level:1},
  136. {name:"严重问题",value:"0",level:2},
  137. {name:"特别严重问题",value:"0",level:3}
  138. ],
  139. groupPersonList:[
  140. {group:"第一组",type:"小水库",value:10},
  141. {group:"第一组",type:"水闸",value:20},
  142. {group:"第二组",type:"小水库",value:1},
  143. {group:"第二组",type:"水闸",value:23},
  144. {group:"第三组",type:"人饮",value:28}
  145. ]
  146. }
  147. },
  148. //监听属性 类似于data概念
  149. computed: {
  150. formatDateTime() {
  151. return formatDate
  152. },
  153. hostUrl(){
  154. return hostUrl
  155. },
  156. organNm() {
  157. return localStorage.getItem('currentOrgNm') ? localStorage.getItem('currentOrgNm') : ''
  158. },
  159. organCode() {
  160. return localStorage.getItem('currentRlcode') ? localStorage.getItem('currentRlcode') : ''
  161. },
  162. currentOrgId() {
  163. return localStorage.getItem('currentOrgId') ? localStorage.getItem('currentOrgId') : ''
  164. },
  165. },
  166. //监控data中的数据变化
  167. watch: {
  168. },
  169. //生命周期 - 创建完成(可以访问当前this实例)
  170. created() {
  171. this.initDcType();
  172. },
  173. //生命周期 - 挂载完成(可以访问DOM元素)
  174. mounted() {
  175. this.initData();
  176. this.initData1();
  177. this.initData2();
  178. window.addEventListener('resize', () => this.resizeCharts());
  179. },
  180. //方法集合
  181. methods: {
  182. closeDialogPblm(){
  183. this.isShowPblmList = false;
  184. this.pblmParam = {};
  185. },
  186. closeDialogObj(){
  187. this.isShowObjList = false;
  188. this.objParam = {};
  189. },
  190. changeDate(val){
  191. this.selectDate = val;
  192. this.initData();
  193. this.initData1();
  194. },
  195. changeType(val){
  196. this.selectType = val;
  197. for(var i = 0;i<this.typeOption.length;i++){
  198. if(val==this.typeOption[i].inspType){
  199. this.selectTypeName = this.typeOption[i].inspName;
  200. }
  201. }
  202. this.initData();
  203. this.initData1();
  204. },
  205. resizeCharts(){
  206. this.chartR1.resize();
  207. this.chartR2.resize();
  208. this.chartR3.resize();
  209. this.chartR4.resize();
  210. this.chartR5.resize();
  211. },
  212. initDcType(){
  213. var _self = this;
  214. _self.typeOption = [];
  215. getDcType(_self.currentOrgId).then((res) => {
  216. if(res!=null && res.data.length>0){
  217. _self.typeOption = res.data;
  218. _self.typeOption.push({inspName:"全部",inspType:""})
  219. }
  220. });
  221. },
  222. initData(){
  223. var _self = this;
  224. _self.chartDcTypeData.dataList = [];
  225. _self.chartDcTypeData.count = 0;
  226. getDcPblmCount(_self.selectDate,_self.organCode).then((res) => {
  227. if(res.data!=null && res.data.length>0){
  228. for(var i = 0;i<res.data.length;i++){
  229. var obj = {
  230. name: res.data[i].NAME+""+res.data[i].VALUE+"个",
  231. value: res.data[i].VALUE,
  232. objType:res.data[i].PTYPE,
  233. objTypeName:res.data[i].NAME
  234. }
  235. _self.chartDcTypeData.dataList.push(obj);
  236. _self.chartDcTypeData.count+=res.data[i].VALUE;
  237. }
  238. }
  239. _self.initChart1();
  240. });
  241. },
  242. initData1(){
  243. var _self = this;
  244. _self.chartPblmTypeData[0].value= 0;
  245. _self.chartPblmTypeData[1].value= 0;
  246. _self.chartPblmTypeData[2].value= 0;
  247. _self.chartPblmTypeData[3].value= 0;
  248. _self.chartObjData.xData = [];
  249. _self.chartObjData.dataList = [];
  250. _self.chartPblmData.xData = [];
  251. _self.chartPblmData.dataList = [];
  252. _self.max=0;
  253. getPblmPro({timeType:_self.selectDate,objType:_self.selectType}).then((res) => {
  254. if(res.data!=null && res.data.length>0){
  255. for(var i = 0;i<res.data.length;i++){
  256. if(res.data[i].adName!="合计"){
  257. _self.chartObjData.xData.push(res.data[i].adName);
  258. _self.chartObjData.dataList.push({value:res.data[i].objSize,adCode:res.data[i].adCode,itemStyle:{color:_self.color[i]}});
  259. _self.chartPblmData.xData.push(res.data[i].adName);
  260. _self.chartPblmData.dataList.push({value:res.data[i].pblmSize,adCode:res.data[i].adCode,itemStyle:{color:_self.color[i]}});
  261. if(res.data[i].objSize>_self.max){
  262. _self.max = res.data[i].objSize;
  263. }
  264. if(res.data[i].pblmSize>_self.max){
  265. _self.max = res.data[i].pblmSize;
  266. }
  267. }else{
  268. _self.chartPblmTypeData[0].value= res.data[i].infoPlbm;
  269. _self.chartPblmTypeData[1].value= res.data[i].warmPlbm;
  270. _self.chartPblmTypeData[2].value= res.data[i].errorPlbm;
  271. _self.chartPblmTypeData[3].value= res.data[i].errorsPlbm;
  272. }
  273. }
  274. }
  275. _self.initChart2();
  276. _self.initChart3();
  277. });
  278. },
  279. initData2(){
  280. var groupName = [];
  281. var typeName = [];
  282. var seriesArr = [];
  283. var _self = this;
  284. getObjCount().then((res) => {
  285. if(res.data!=null && res.data.length>0){
  286. for(var i = 0;i<res.data.length;i++){
  287. if(!this.isHave(res.data[i].pc,groupName)){
  288. groupName.push(res.data[i].pc);
  289. }
  290. if(!this.isHave(res.data[i].objNmae,typeName)){
  291. typeName.push(res.data[i].objNmae);
  292. }
  293. }
  294. for(var j = 0;j<typeName.length;j++){
  295. var obj = {
  296. name:typeName[j],
  297. data:[],
  298. type: 'line',
  299. stack: 'total',
  300. barWidth:10,
  301. label: {
  302. show: true
  303. },
  304. emphasis: {
  305. focus: 'series'
  306. }
  307. }
  308. for(var k = 0;k<groupName.length;k++){
  309. var isTrue = false;
  310. for(var l = 0;l<res.data.length;l++){
  311. if(typeName[j]==res.data[l].objNmae && groupName[k]==res.data[l].pc){
  312. obj.data.push(res.data[l].num==null?0:res.data[l].num);
  313. isTrue = true;
  314. }
  315. }
  316. if(!isTrue){
  317. obj.data.push(0);
  318. }
  319. }
  320. seriesArr.push(obj);
  321. }
  322. this.initChart5(typeName,groupName,seriesArr);
  323. }else{
  324. this.initChart5(typeName,groupName,seriesArr);
  325. }
  326. });
  327. },
  328. isHave(str,arr){
  329. for(var i = 0;i<arr.length;i++){
  330. if(str==arr[i]){
  331. return true;
  332. }
  333. }
  334. return false;
  335. },
  336. initChart1(){
  337. this.chartR1 = echarts.init(document.getElementById('chartR1'));
  338. var option = {
  339. tooltip: {
  340. trigger: 'axis',
  341. },
  342. title: {
  343. text: this.chartDcTypeData.count,
  344. textStyle: {
  345. color: '#333',
  346. fontSize: 25
  347. },
  348. subtext: '问题总数',
  349. subtextStyle: {
  350. color: '#333',
  351. fontSize: 12
  352. },
  353. itemGap: 10,
  354. left: '22.5%',
  355. top: '45%'
  356. },
  357. color:this.color,
  358. tooltip: {
  359. trigger: "item",
  360. formatter: "{b}"
  361. },
  362. legend: {
  363. type: 'scroll',
  364. orient:'vertical',
  365. icon: 'circle', //图例形状
  366. top:'15%',
  367. bottom:'15%',
  368. left:'60%',
  369. itemWidth: 10, // 图例标记的图形宽度。[ default: 25 ]
  370. itemHeight: 10, // 图例标记的图形高度。[ default: 14 ]
  371. itemGap: 10, // 图例每项之间的间隔。[ default: 10 ]横向布局时为水平间隔,纵向布局时为纵向间隔。
  372. textStyle: {
  373. fontSize: 14,
  374. color: '#333',
  375. },
  376. pageButtonPosition:'start',
  377. pageIconColor: '#333', //翻页下一页的三角按钮颜色
  378. pageIconInactiveColor: '#333', //翻页(即翻页到头时)
  379. pageIconSize: 10, //翻页按钮大小
  380. pageFormatter: '',//隐藏翻页的数字
  381. pageButtonItemGap: -6,//翻页按钮的两个之间的间距
  382. label: {
  383. normal: {
  384. show: true,
  385. position: 'inner'
  386. // formatter: function (name) {
  387. // return (name.length > 8 ? (name.slice(0, 8) + "...") : name);
  388. // },
  389. // fontSize: 12
  390. }
  391. }
  392. },
  393. series: [{
  394. type: "pie",
  395. data: this.chartDcTypeData.dataList,
  396. radius: ['50%', '60%'],
  397. center: ["30%", "50%"],
  398. labelLine: {
  399. show: false
  400. },
  401. label:{
  402. show: false
  403. }
  404. }]
  405. };
  406. this.chartR1.clear();
  407. this.chartR1.setOption(option);
  408. var _self = this;
  409. this.chartR1.on('click', function (param) {
  410. _self.isShowPblmList = true;
  411. _self.pblmParam["adCode"] =_self.organCode;
  412. _self.pblmParam["timeType"] = _self.selectDate;
  413. _self.pblmParam["objType"] = (param.data.objType.length==1?('00'+param.data.objType):(param.data.objType.length==2?'0'+param.data.objType:param.data.objType));
  414. _self.pblmParam["objTypeName"] = param.data.objTypeName;
  415. });
  416. },
  417. initChart2(){
  418. this.chartR2 = echarts.init(document.getElementById('chartR2'));
  419. var option= {
  420. tooltip: {
  421. trigger: 'axis',
  422. },
  423. legend: {
  424. data: ['蒸发量', '降水量', '平均温度']
  425. },
  426. grid: {
  427. top: '20%',
  428. left: '3%',
  429. right: '3%',
  430. bottom: '5%',
  431. containLabel: true
  432. },
  433. xAxis: [{
  434. data: this.chartObjData.xData,
  435. }],
  436. yAxis: [{
  437. name: '对象数/个',
  438. type: 'value',
  439. max:this.max
  440. },
  441. {
  442. name: '问题数/个',
  443. type: 'value',
  444. max:this.max
  445. }],
  446. series: [
  447. {
  448. name: "对象数",
  449. type: 'bar',
  450. yAxisIndex: 0,
  451. data: this.chartObjData.dataList,
  452. barWidth:15
  453. },
  454. {
  455. name: "问题数",
  456. type: 'bar',
  457. yAxisIndex: 1,
  458. data: this.chartPblmData.dataList,
  459. barWidth:15
  460. }
  461. ]
  462. }
  463. this.chartR2.clear();
  464. this.chartR2.setOption(option);
  465. var _self = this;
  466. this.chartR2.on('click', function (param) {
  467. if(param.seriesName=="对象数"){
  468. _self.isShowObjList = true;
  469. _self.objParam["adCode"] = param.data.adCode;
  470. _self.objParam["timeType"] = _self.selectDate;
  471. _self.objParam["objType"] = _self.selectType;
  472. _self.objParam["objTypeName"] = _self.selectTypeName;
  473. }else{
  474. _self.isShowPblmList = true;
  475. _self.pblmParam["adCode"] = param.data.adCode;
  476. _self.pblmParam["timeType"] = _self.selectDate;
  477. _self.pblmParam["objType"] = _self.selectType;
  478. _self.pblmParam["objTypeName"] = _self.selectTypeName;
  479. }
  480. })
  481. },
  482. initChart3(){
  483. var _self = this;
  484. _self.chartR3 = echarts.init(document.getElementById('chartR3'));
  485. let sum = 0;
  486. let color = ['#009DFF','#00e473','#ffc300','#FF8700'];
  487. let pieSeries = [],
  488. lineYAxis = [];
  489. _self.chartPblmTypeData.forEach((v, i) => {
  490. sum = sum + v.value;
  491. })
  492. _self.chartPblmTypeData.forEach((v, i) => {
  493. pieSeries.push({
  494. name: '问题级别',
  495. type: 'pie',
  496. clockWise: false,
  497. hoverAnimation: false,
  498. radius: [65 - i * 15 + '%', 57 - i * 15 + '%'],
  499. center: ["50%", "50%"],
  500. label: {
  501. show: false
  502. },
  503. data: [{
  504. value: v.value,
  505. name: v.name,
  506. level:v.level
  507. }, {
  508. value: sum - v.value,
  509. name: '',
  510. itemStyle: {
  511. color: "rgba(0,0,0,0)"
  512. }
  513. }]
  514. });
  515. pieSeries.push({
  516. name: '',
  517. type: 'pie',
  518. silent: true,
  519. z: 1,
  520. clockWise: false, //顺时加载
  521. hoverAnimation: false, //鼠标移入变大
  522. radius: [65 - i * 15 + '%',57 - i * 15 + '%'],
  523. center: ["50%", "50%"],
  524. label: {
  525. show: false
  526. },
  527. data: [{
  528. value: 7.5,
  529. itemStyle: {
  530. color: "#E3F0FF"
  531. }
  532. }, {
  533. value: 2.5,
  534. name: '',
  535. itemStyle: {
  536. color: "rgba(0,0,0,0)"
  537. }
  538. }]
  539. });
  540. v.percent = (v.value / sum * 100).toFixed(1) + "%";
  541. lineYAxis.push({
  542. value: i
  543. });
  544. })
  545. let option = {
  546. backgroundColor: '#fff',
  547. color: color,
  548. grid: {
  549. top: '15%',
  550. bottom: '54%',
  551. left: "50%",
  552. containLabel: false
  553. },
  554. yAxis: [{
  555. type: 'category',
  556. inverse: true,
  557. axisLine: {
  558. show: false
  559. },
  560. axisTick: {
  561. show: false
  562. },
  563. axisLabel: {
  564. formatter: function(params) {
  565. let item = _self.chartPblmTypeData[params];
  566. return item.name+":"+item.value
  567. },
  568. interval: 0,
  569. inside: true,
  570. show: true
  571. },
  572. data: lineYAxis
  573. }],
  574. xAxis: [{
  575. show: false
  576. }],
  577. series: pieSeries
  578. };
  579. this.chartR3.clear();
  580. this.chartR3.setOption(option);
  581. var _self = this;
  582. this.chartR3.on('click', function (param) {
  583. if(param.data.level==undefined){
  584. _self.$message.warning("当前数据没有值或点击区域不正确");
  585. }
  586. _self.isShowPblmList = true;
  587. _self.pblmParam["adCode"] = _self.organCode;
  588. _self.pblmParam["timeType"] = _self.selectDate;
  589. _self.pblmParam["objType"] = _self.selectType;
  590. _self.pblmParam["objTypeName"] = _self.selectTypeName;
  591. _self.pblmParam["inspPblmCate"] = param.data.level;
  592. });
  593. },
  594. // initChart4(){
  595. // this.chartR4 = echarts.init(document.getElementById('chartR4'));
  596. // var option= {
  597. // tooltip: {
  598. // trigger: 'axis',
  599. // },
  600. // grid: {
  601. // top: '20%',
  602. // left: '3%',
  603. // right: '3%',
  604. // bottom: '5%',
  605. // containLabel: true
  606. // },
  607. // xAxis: [{
  608. // data: this.chartPblmData.xData,
  609. // axisLabel: {
  610. // margin: 10,
  611. // color: '#333',
  612. // interval:0,
  613. // rotate:40,
  614. // textStyle: {
  615. // fontSize: 12
  616. // },
  617. // },
  618. // axisLine: {
  619. // lineStyle: {
  620. // color: '#333',
  621. // }
  622. // },
  623. // axisTick: {
  624. // show: false
  625. // },
  626. // }],
  627. // yAxis: [{
  628. // name:"问题数/个",
  629. // type:'value',
  630. // axisLabel: {
  631. // color: '#333',
  632. // textStyle: {
  633. // fontSize: 12
  634. // },
  635. // },
  636. // axisLine: {
  637. // show:true,
  638. // lineStyle:{
  639. // color:'#333' //更改坐标轴颜色
  640. // }
  641. // },
  642. // axisTick: {
  643. // show: false
  644. // },
  645. // splitLine: {
  646. // lineStyle: {
  647. // color: '#333',
  648. // }
  649. // }
  650. // }],
  651. // series: [
  652. // {
  653. // name: "问题数",
  654. // type: 'bar',
  655. // data: this.chartPblmData.dataList,
  656. // barWidth:25
  657. // }
  658. // ]
  659. // }
  660. // this.chartR4.clear();
  661. // this.chartR4.setOption(option);
  662. // },
  663. initPie(data,name){
  664. this.chartR4 = echarts.init(document.getElementById('chartR4'));
  665. var option = {
  666. tooltip: {
  667. trigger: 'item',
  668. formatter:'{b}: {c} ({d}%)'
  669. },
  670. color:this.color,
  671. title: {
  672. text: '督查对象占比趋势统计',
  673. subtext:name,
  674. left: 'left'
  675. },
  676. grid:{
  677. top:"30%"
  678. },
  679. legend: {
  680. type: 'scroll',
  681. orient: 'vertical',
  682. right: 10,
  683. top: 50,
  684. bottom: 20,
  685. },
  686. series: [
  687. {
  688. name: '',
  689. type: 'pie',
  690. radius: ['0%', '50%'],
  691. labelLine: {
  692. length: 30,
  693. },
  694. label: {
  695. formatter: '{b}:{c}个({d}%)',
  696. },
  697. data: data
  698. }
  699. ]
  700. };
  701. this.chartR4.clear();
  702. this.chartR4.setOption(option);
  703. },
  704. initChart5(arr1,arr2,arr3){
  705. this.chartR5 = echarts.init(document.getElementById('chartR5'));
  706. var _self = this;
  707. var option = {
  708. tooltip: {
  709. trigger: 'axis',
  710. formatter:function(params){
  711. var htmlStr = "";
  712. for(var i = 0;i<params.length;i++){
  713. var param = params[i];
  714. var xName = param.name;
  715. var seriesName = param.seriesName;
  716. var value = param.value;
  717. var color = param.color;
  718. if(i===0){
  719. htmlStr+=xName+"<br/>";
  720. }
  721. htmlStr+="<div>";
  722. htmlStr+='<span style="margin-right:5px;display:inline-block;width:10px;height:10px;border-radius:5px;background-color:'+color+';"></span>';
  723. htmlStr+=seriesName+":"+value;
  724. htmlStr+="</div>";
  725. params[i].name=param.seriesName;
  726. }
  727. _self.initPie(params,xName);
  728. return htmlStr;
  729. },
  730. axisPointer: { // Use axis to trigger tooltip
  731. type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow'
  732. }
  733. },
  734. color:this.color,
  735. legend: {
  736. data:arr1,
  737. type:'scroll',
  738. top:'10%',
  739. },
  740. grid: {
  741. top:'20%',
  742. left: '3%',
  743. right: '3%',
  744. bottom: '3%',
  745. containLabel: true
  746. },
  747. xAxis: {
  748. type: 'category',
  749. data:arr2
  750. },
  751. yAxis: {
  752. type: 'value',
  753. },
  754. series:arr3
  755. };
  756. this.chartR5.clear();
  757. this.chartR5.setOption(option);
  758. var arr = [];
  759. if(option.series.length>0){
  760. for(var i = 0;i<option.series.length;i++){
  761. var obj = {
  762. name:option.series[i].name,
  763. value:option.series[i].data[0]
  764. }
  765. arr.push(obj);
  766. }
  767. this.initPie(arr,arr2[0]);
  768. }else{
  769. this.initPie(arr,arr2[0]);
  770. }
  771. },
  772. },
  773. beforeCreate() {
  774. }, //生命周期 - 创建之前
  775. beforeMount() {
  776. }, //生命周期 - 挂载之前
  777. beforeUpdate() {
  778. }, //生命周期 - 更新之前
  779. updated() {
  780. }, //生命周期 - 更新之后
  781. beforeDestroy() {
  782. }, //生命周期 - 销毁之前
  783. destroyed() {
  784. }, //生命周期 - 销毁完成
  785. activated() {
  786. } //如果页面有keep-alive缓存功能,这个函数会触发
  787. };
  788. </script>
  789. <style scoped>
  790. .boxResult{
  791. width: 100%;
  792. height:100%;
  793. margin:0;
  794. padding: 0;
  795. }
  796. .headResult{
  797. width: 100%;
  798. height:50px;
  799. display: flex;
  800. box-shadow: 0 1px 6px 0 rgb(32 33 36 / 28%);
  801. }
  802. .headResult-item1{
  803. width: calc(50% - 150px);
  804. height:100%;
  805. display: flex;
  806. align-items: center;
  807. font-size: 14px;
  808. }
  809. .headResult-item1 span{
  810. margin: 0 10px 0 10px;
  811. }
  812. .headResult-item2{
  813. width: 300px;
  814. height:100%;
  815. font-size: 25px;
  816. text-align:center;
  817. line-height: 50px;
  818. color: #202020;
  819. }
  820. .resultContent{
  821. width: 100%;
  822. height:calc(100% - 55px);
  823. }
  824. .content-op{
  825. width: 100%;
  826. height:calc(50% - 5px);
  827. display: flex;
  828. margin-top: 5px;
  829. }
  830. .op-item{
  831. height:100%;
  832. box-shadow: 0 1px 6px 0 rgb(32 33 36 / 28%);
  833. margin-left: 2.5px;
  834. margin-right: 2.5px;
  835. position: relative;
  836. }
  837. .op-item-title{
  838. height:35px;
  839. position: absolute;
  840. z-index: 100;
  841. top:0;
  842. left: 0;
  843. line-height: 35px;
  844. text-indent: 10px;
  845. font-size: 14px;
  846. font-weight: bold;
  847. font-family: 黑体;
  848. padding: 0 10px 0 10px;
  849. border: 1px solid #4d494930;
  850. background: #f3f6f7;
  851. }
  852. .title-right{
  853. height:35px;
  854. position: absolute;
  855. z-index: 100;
  856. top:0;
  857. left: 50%;
  858. line-height: 35px;
  859. text-indent: 10px;
  860. font-size: 14px;
  861. font-weight: bold;
  862. font-family: 黑体;
  863. padding: 0 10px 0 10px;
  864. border: 1px solid #4d494930;
  865. background: #f3f6f7;
  866. }
  867. .op-item-content{
  868. width: 100%;
  869. height:100%;
  870. }
  871. #chartR1{
  872. width: 50% !important;
  873. }
  874. #chartR3{
  875. width: 50% !important;
  876. }
  877. #chartR5{
  878. width: 100%!important;
  879. }
  880. </style>