index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  1. <template>
  2. <div class="app-container">
  3. <div class="filter-container">
  4. <div class="block">
  5. <el-date-picker v-model="yearDate" :clearable="false" type="month" placeholder="选择年" />
  6. </div>
  7. </div>
  8. <el-row v-if="isChart1" style="position: relative;">
  9. <p style="position: absolute;top:-12px;left:40%;color:rgb(130, 165, 252);background:rgb(230, 243, 255);border:1px solid rgb(130, 165, 252);padding:10px;border-radius:10px">
  10. {{ year }}年集团用水量:{{ total }}万m³
  11. </p>
  12. <el-radio-group v-model="radio1" class="group" @change="changeGroup('1')">
  13. <el-radio :label="1">集团</el-radio>
  14. <el-radio :label="2">一中心</el-radio>
  15. <el-radio :label="3">二中心</el-radio>
  16. <el-radio :label="4">三中心</el-radio>
  17. </el-radio-group>
  18. <el-col :span="24">
  19. <div id="chart1" style="width: 100%;height:400px;" />
  20. </el-col>
  21. </el-row>
  22. <el-row style="position: relative;">
  23. <el-radio-group v-model="radio2" class="group" @change="changeGroup('2')">
  24. <el-radio :label="1">集团</el-radio>
  25. <el-radio :label="2">一中心</el-radio>
  26. <el-radio :label="3">二中心</el-radio>
  27. <el-radio :label="4">三中心</el-radio>
  28. </el-radio-group>
  29. <el-col :span="24">
  30. <div id="chart2" style="width: 100%;height:400px;" />
  31. </el-col>
  32. </el-row>
  33. <el-row style="position: relative;">
  34. <!-- <el-radio-group v-model="radio3" class="group" @change="changeGroup('3')">
  35. <el-radio :label="1">集团</el-radio>
  36. <el-radio :label="2">一中心</el-radio>
  37. <el-radio :label="3">二中心</el-radio>
  38. <el-radio :label="4">三中心</el-radio>
  39. </el-radio-group> -->
  40. <el-col :span="24">
  41. <div id="chart3" style="width: 100%;height:400px;" />
  42. </el-col>
  43. </el-row>
  44. <el-row style="position: relative;">
  45. <el-col :span="12">
  46. <div style="height: 50px;">
  47. <el-select style="float: right;margin-right: 20px;" v-model="getChart4Parm.parammaps.pastureName" multiple :multiple-limit="5" collapse-tags placeholder="牧场" @change="changePasture('4')">
  48. <el-option v-for="item in pastureList" :key="item.id" :label="item.name" :value="item.name"> </el-option>
  49. </el-select>
  50. </div>
  51. <div id="chart4" style="width: 100%;height:400px;" />
  52. </el-col>
  53. <el-col :span="12">
  54. <div style="height: 50px;">
  55. <el-select style="float: right;margin-right: 20px;" v-model="getChart5Parm.parammaps.deptName" placeholder="部门" @change="changeDept('5')">
  56. <el-option v-for="item in deptList" :key="item.id" :label="item.name" :value="item.name"> </el-option>
  57. </el-select>
  58. </div>
  59. <div id="chart5" style="width: 100%;height:400px;" />
  60. </el-col>
  61. </el-row>
  62. <el-row style="position: relative;">
  63. <el-col :span="12">
  64. <div style="height: 50px;" />
  65. <div id="chart6" style="width: 100%;height:400px;" />
  66. </el-col>
  67. <el-col :span="12">
  68. <div style="height: 50px;">
  69. <el-select style="float: right;margin-right: 20px;" v-model="getChart7Parm.parammaps.pastureName" multiple :multiple-limit="5" collapse-tags placeholder="牧场" @change="changePasture('7')">
  70. <el-option v-for="item in pastureList" :key="item.id" :label="item.name" :value="item.name"> </el-option>
  71. </el-select>
  72. </div>
  73. <div id="chart7" style="width: 100%;height:400px;" />
  74. </el-col>
  75. </el-row>
  76. </div>
  77. </template>
  78. <script>
  79. import echarts from 'echarts'
  80. import { GetDataByName,GetDataByNames, GetReportform, checkButtons } from '@/api/common'
  81. import Cookies from 'js-cookie'
  82. import { parseTime } from '@/utils/index.js'
  83. export default {
  84. name: 'QueryWater',
  85. data() {
  86. return {
  87. yearDate: new Date(),
  88. year: new Date().getFullYear(),
  89. month: new Date().getMonth() < 9 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1,
  90. pastureList:[],
  91. deptList:[],
  92. total: '',
  93. radio1:1,
  94. isChart1: [],
  95. chart_data1: {},
  96. getChart1Parm: {
  97. name: 'getpSumNowWater',
  98. parammaps: {
  99. receiveTime: new Date().getFullYear(),
  100. pastureName: Cookies.get('pasturename')
  101. }
  102. },
  103. radio2:1,
  104. isChart2: [],
  105. chart_data2: {},
  106. getChart2Parm: {
  107. name: 'getpSumNowWater',
  108. parammaps: {
  109. receiveTime: new Date().getFullYear(),
  110. pastureName: Cookies.get('pasturename')
  111. }
  112. },
  113. radio3:1,
  114. isChart3: [],
  115. chart_data3: {},
  116. getChart3Parm: {
  117. name: 'getpSumNowWater',
  118. parammaps: {
  119. receiveTime: new Date().getFullYear(),
  120. pastureName: Cookies.get('pasturename')
  121. }
  122. },
  123. isChart4: [],
  124. chart_data4: {},
  125. getChart4Parm: {
  126. name: 'getpSumNowWater',
  127. parammaps: {
  128. receiveTime: new Date().getFullYear(),
  129. pastureName: Cookies.get('pasturename')
  130. }
  131. },
  132. isChart5: [],
  133. chart_data5: {},
  134. getChart5Parm: {
  135. name: 'getpSumNowWater',
  136. parammaps: {
  137. receiveTime: new Date().getFullYear(),
  138. pastureName: Cookies.get('pasturename'),
  139. deptName:''
  140. }
  141. },
  142. isChart6: [],
  143. chart_data6: {},
  144. getChart6Parm: {
  145. name: 'getpSumNowWater',
  146. parammaps: {
  147. receiveTime: new Date().getFullYear(),
  148. pastureName: Cookies.get('pasturename')
  149. }
  150. },
  151. isChart7: [],
  152. chart_data7: {},
  153. getChart7Parm: {
  154. name: 'getpSumNowWater',
  155. parammaps: {
  156. receiveTime: new Date().getFullYear(),
  157. pastureName: Cookies.get('pasturename')
  158. }
  159. },
  160. }
  161. },
  162. created() {
  163. this.get_select_list()
  164. this.getChart1()
  165. this.getChart2()
  166. this.getChart3()
  167. this.getChart4()
  168. this.getChart5()
  169. this.getChart6()
  170. this.getChart7()
  171. const that = this
  172. GetDataByName({ 'name': 'getUserPCButtons', 'parammaps': { 'jwt_username': Cookies.get('name') }}).then(response => {
  173. that.buttons = response.data.list
  174. that.get_auto_buttons()
  175. })
  176. },
  177. mounted() {
  178. },
  179. methods: {
  180. get_select_list() {
  181. var send_data = [
  182. { name: 'findAllPasture', offset: 0, pagecount: 0, returntype: 'Map', parammaps: { 'id': Cookies.get('pastureid') }},
  183. ]
  184. GetDataByNames(send_data).then(response => {
  185. this.pastureList = response.data.findAllPasture.list
  186. })
  187. },
  188. changeGroup(item){
  189. if(item == 1){
  190. this.getChart1()
  191. }else if(item == 2){
  192. this.getChart2()
  193. }else if(item == 3){
  194. this.getChart3()
  195. }
  196. },
  197. changePasture(item){
  198. if(item == 4){
  199. this.getChart4()
  200. }else if(item == 7){
  201. this.getChart7()
  202. }
  203. },
  204. changeDept(item){
  205. if(item == 5){
  206. this.getChart5()
  207. }
  208. },
  209. get_auto_buttons() {
  210. // 图1
  211. const chart1 = 'report:queryWater:pastures'
  212. const isChart1 = checkButtons(this.$store.state.user.buttons, chart1)
  213. this.isChart1 = isChart1
  214. },
  215. // 各牧场年度用水量对比
  216. getChart1() {
  217. GetReportform(this.getChart1Parm).then(response => {
  218. console.log('图1', response)
  219. // this.chart_data1 = response.data.chart_data
  220. this.chart_data1 = {
  221. data1:[10,20,30,40,50],
  222. data2:[20,30,40,50,60],
  223. xdata:["马鞍山牧场", "汶上牧场", "商河牧场", "合肥牧场", "蚌埠牧场"]
  224. }
  225. this.roadChart1(this.chart_data1)
  226. var nowYear = response.data.chart_data.nowYear
  227. var total = 0
  228. if (nowYear !== null || nowYear !== undefined) {
  229. nowYear.forEach(function(item, index) {
  230. total = total + parseFloat(item)
  231. })
  232. }
  233. this.total = total.toFixed(2)
  234. })
  235. },
  236. // 单头牛水量
  237. getChart2() {
  238. GetReportform(this.getChart2Parm).then(response => {
  239. console.log('图2', response)
  240. // this.chart_data2 = response.data.chart_data
  241. this.chart_data2 = {
  242. data1:[10,20,30,40,50],
  243. data2:[20,30,40,50,60],
  244. xdata:["马鞍山牧场", "汶上牧场", "商河牧场", "合肥牧场", "蚌埠牧场"]
  245. }
  246. this.roadChart2(this.chart_data2)
  247. })
  248. },
  249. // 单头牛水费
  250. getChart3() {
  251. GetReportform(this.getChart3Parm).then(response => {
  252. console.log('图3', response)
  253. // this.chart_data3 = response.data.chart_data
  254. this.chart_data3 = {
  255. data1:[10,20,30,40,50],
  256. data2:[20,30,40,50,60],
  257. data3:[30,40,50,60,70],
  258. xdata:["马鞍山牧场", "汶上牧场", "商河牧场", "合肥牧场", "蚌埠牧场"]
  259. }
  260. this.roadChart3(this.chart_data3)
  261. })
  262. },
  263. // XX牧场XX年每月单头牛用水量对比
  264. getChart4() {
  265. GetReportform(this.getChart4Parm).then(response => {
  266. console.log('图4', response)
  267. // this.chart_data4 = response.data.chart_data
  268. this.chart_data4 = {
  269. data1:[
  270. {data:[10,20,30,40,50]},
  271. {data:[20,30,40,50,60]},
  272. {data:[30,40,50,60,70]},
  273. ],
  274. data_name:["马鞍山牧场", "汶上牧场", "商河牧场"],
  275. xdata:["2023-01", "2023-02", "2023-03", "2023-04", "2023-05"]
  276. }
  277. this.roadChart4(this.chart_data4)
  278. })
  279. },
  280. // XX月部门统计
  281. getChart5() {
  282. GetReportform(this.getChart5Parm).then(response => {
  283. console.log('图5', response)
  284. // this.chart_data5 = response.data.chart_data
  285. this.chart_data5 = {
  286. data1:[10,20,30,40,50],
  287. data2:[20,30,40,50,60],
  288. xdata:["马鞍山牧场挤奶处", "和林牧场挤奶处", "蚌埠牧场挤奶处", "塞一牧场挤奶处", "塞二牧场挤奶处"]
  289. }
  290. this.roadChart5(this.chart_data5)
  291. })
  292. },
  293. // XX牧场XX年每月用水量对比
  294. getChart6() {
  295. GetReportform(this.getChart6Parm).then(response => {
  296. console.log('图6', response)
  297. // this.chart_data6 = response.data.chart_data
  298. this.chart_data6 = {
  299. data1:[10,20,30,40,50],
  300. data2:[20,30,40,50,60],
  301. data3:[30,40,50,60,70],
  302. xdata:["2023-01", "2023-02", "2023-03", "2023-04", "2023-05"]
  303. }
  304. this.roadChart6(this.chart_data6)
  305. })
  306. },
  307. // XX月每日用水量
  308. getChart7() {
  309. GetReportform(this.getChart7Parm).then(response => {
  310. console.log('图7', response)
  311. // this.chart_data7 = response.data.chart_data
  312. this.chart_data7 = {
  313. data1:[
  314. {data:[10,20,30,40,50]},
  315. {data:[20,30,40,50,60]},
  316. {data:[30,40,50,60,70]},
  317. ],
  318. data_name:["马鞍山牧场", "汶上牧场", "商河牧场"],
  319. xdata:["2023-01", "2023-02", "2023-03", "2023-04", "2023-05"]
  320. }
  321. this.roadChart7(this.chart_data7)
  322. })
  323. },
  324. // 各牧场年度用水量对比
  325. roadChart1(chart_data) {
  326. if (this.chart1 != null) {
  327. this.chart1.dispose()
  328. }
  329. this.chart1 = echarts.init(document.getElementById('chart1'))
  330. var option = {
  331. title: { text: '各牧场年度用水量对比', textStyle: { color: '#769cfc' }},
  332. tooltip: { trigger: 'axis' },
  333. legend: {
  334. data: ['今年用量', '去年同期'],
  335. right: 40
  336. },
  337. color: ['#61A5E8', '#9933FF'],
  338. grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
  339. xAxis: [{ type: 'category', name: '牧场',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
  340. yAxis: [{ type: 'value', name: '水量(m³)', axisLabel: { formatter: '{value}万' }}],
  341. series: [
  342. {
  343. name: '今年用量',
  344. type: 'bar',
  345. data: chart_data.data1,
  346. barMaxWidth:20,
  347. emphasis: { label: { show: true, position: 'inside' }}
  348. },
  349. {
  350. name: '去年同期',
  351. type: 'bar',
  352. barMaxWidth:20,
  353. data: chart_data.data2,
  354. emphasis: { label: { show: true, position: 'inside' }}
  355. }
  356. ]
  357. }
  358. this.chart1.setOption(option)
  359. window.onresize = function() {
  360. this.chart1.resize()
  361. }
  362. var that = this
  363. this.chart1.on('click', function(param, i) {
  364. console.log(param)
  365. })
  366. },
  367. // 单头牛水量
  368. roadChart2(chart_data) {
  369. if (this.chart2 != null) {
  370. this.chart2.dispose()
  371. }
  372. this.chart2 = echarts.init(document.getElementById('chart2'))
  373. var option = {
  374. title: { text: '单头牛水量', left:'center',textStyle: { color: '#769cfc' }},
  375. tooltip: { trigger: 'axis' },
  376. legend: {
  377. data: ['实际费用', '去年同期'],
  378. right: 40
  379. },
  380. color: ['#61A5E8', '#9933FF','#FFB800'],
  381. grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
  382. xAxis: [{ type: 'category', name: '牧场',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
  383. yAxis: [{ type: 'value', name: '价格(元)'}],
  384. series: [
  385. {
  386. name: '实际费用',
  387. type: 'bar',
  388. data: chart_data.data1,
  389. emphasis: { label: { show: true, position: 'inside' }},
  390. barMaxWidth:20,
  391. markLine:{
  392. data:[ {yAxis:20} ],
  393. lineStyle: {
  394. color: '#FFB800'
  395. }
  396. }
  397. },
  398. {
  399. name: '去年同期',
  400. type: 'bar',
  401. data: chart_data.data2,
  402. emphasis: { label: { show: true, position: 'inside' }},
  403. barMaxWidth:20
  404. }
  405. ]
  406. }
  407. this.chart2.setOption(option)
  408. window.onresize = function() {
  409. this.chart2.resize()
  410. }
  411. var that = this
  412. this.chart2.on('click', function(param, i) {
  413. console.log(param)
  414. })
  415. },
  416. // 单头牛水费
  417. roadChart3(chart_data) {
  418. if (this.chart3 != null) {
  419. this.chart3.dispose()
  420. }
  421. this.chart3 = echarts.init(document.getElementById('chart3'))
  422. var option = {
  423. title: { text: '单头牛水费', left:'center',textStyle: { color: '#769cfc' }},
  424. tooltip: { trigger: 'axis' },
  425. legend: {
  426. data: ['实际费用'],
  427. right: 40
  428. },
  429. color: ['#61A5E8'],
  430. grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
  431. xAxis: [{ type: 'category', name: '牧场',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
  432. yAxis: [{ type: 'value', name: '价格(元)'}],
  433. series: [
  434. {
  435. name: '实际费用',
  436. type: 'bar',
  437. data: chart_data.data1,
  438. emphasis: { label: { show: true, position: 'inside' }},
  439. barMaxWidth:20
  440. },
  441. ]
  442. }
  443. this.chart3.setOption(option)
  444. window.onresize = function() {
  445. this.chart3.resize()
  446. }
  447. var that = this
  448. this.chart3.on('click', function(param, i) {
  449. console.log(param)
  450. })
  451. },
  452. // 各牧场XX年每月单头牛用水量对比
  453. roadChart4(chart_data) {
  454. if (this.chart4 != null) {
  455. this.chart4.dispose()
  456. }
  457. this.chart4 = echarts.init(document.getElementById('chart4'))
  458. var text = '各牧场' + parseTime(this.yearDate, '{y}') + '年每月单头牛用水量对比'
  459. var option = {
  460. title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
  461. tooltip: { trigger: 'axis' },
  462. legend: {
  463. data: chart_data.data_name,
  464. left: 40,
  465. bottom:0
  466. },
  467. color: ['#2dc0e8', '#769cfc', '#FFB800'],
  468. grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
  469. xAxis: [{ type: 'category', name: '月份',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
  470. yAxis: [{ type: 'value', name: 'm³'}],
  471. series: (function() {
  472. var serie = []
  473. if(chart_data.data1 !== null){
  474. for (var i = 0; i < chart_data.data1.length; i++) {
  475. var item = {
  476. name: chart_data.data_name[i],
  477. type: 'line',
  478. data: chart_data.data1[i].data
  479. }
  480. serie.push(item)
  481. }
  482. }
  483. return serie
  484. }())
  485. }
  486. this.chart4.setOption(option)
  487. window.onresize = function() {
  488. this.chart4.resize()
  489. }
  490. var that = this
  491. that.chart4.on('click', function(param, i) {
  492. console.log(param)
  493. that.getChart5()
  494. })
  495. },
  496. // XX月部门统计
  497. roadChart5(chart_data) {
  498. if (this.chart5 != null) {
  499. this.chart5.dispose()
  500. }
  501. this.chart5 = echarts.init(document.getElementById('chart5'))
  502. var text = parseTime(new Date(), '{m}') + '月部门统计'
  503. var option = {
  504. title: { text: text, left:'center',textStyle: { color: '#769cfc' }},
  505. tooltip: { trigger: 'axis' },
  506. legend: {
  507. data: ['实际', '预算'],
  508. right: 40,
  509. bottom:0
  510. },
  511. color: ['#2dc0e8', '#769cfc'],
  512. grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
  513. xAxis: [{ type: 'category', name: '部门',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
  514. yAxis: [{ type: 'value',name: '吨', axisLabel: { formatter:'{value} 万'}}],
  515. series: [
  516. {
  517. name: '实际',
  518. type: 'bar',
  519. data: chart_data.data1,
  520. emphasis: { label: { show: true, position: 'inside' }},
  521. barMaxWidth:20
  522. },
  523. {
  524. name: '预算',
  525. type: 'bar',
  526. data: chart_data.data2,
  527. emphasis: { label: { show: true, position: 'inside' }},
  528. barMaxWidth:20
  529. }
  530. ]
  531. }
  532. this.chart5.setOption(option)
  533. window.onresize = function() {
  534. this.chart5.resize()
  535. }
  536. var that = this
  537. this.chart5.on('click', function(param, i) {
  538. console.log(param)
  539. })
  540. },
  541. // XX牧场XX年每月用水量对比
  542. roadChart6(chart_data) {
  543. if (this.chart6 != null) {
  544. this.chart6.dispose()
  545. }
  546. this.chart6 = echarts.init(document.getElementById('chart6'))
  547. var option = {
  548. title: { text: 'XX牧场XX年每月用水量对比', left:'center',textStyle: { color: '#769cfc' }},
  549. tooltip: { trigger: 'axis' },
  550. legend: {
  551. data: ['去年同期用量', '今年用量','预算'],
  552. right: 40,
  553. bottom:0
  554. },
  555. color: ['#2dc0e8', '#769cfc', '#FFB800'],
  556. grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
  557. xAxis: [{ type: 'category', name: '月份',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
  558. yAxis: [{ type: 'value',name: '水量(m³)'}],
  559. series: [
  560. {
  561. name: '去年同期用量',
  562. type: 'line',
  563. data: chart_data.data1,
  564. emphasis: { label: { show: true, position: 'inside' }},
  565. barMaxWidth:20
  566. },
  567. {
  568. name: '今年用量',
  569. type: 'line',
  570. data: chart_data.data2,
  571. emphasis: { label: { show: true, position: 'inside' }},
  572. barMaxWidth:20
  573. },
  574. {
  575. name: '预算',
  576. type: 'line',
  577. data: chart_data.data3,
  578. emphasis: { label: { show: true, position: 'inside' }},
  579. barMaxWidth:20
  580. }
  581. ]
  582. }
  583. this.chart6.setOption(option)
  584. window.onresize = function() {
  585. this.chart6.resize()
  586. }
  587. var that = this
  588. this.chart6.on('click', function(param, i) {
  589. console.log(param)
  590. })
  591. },
  592. // XX月每日用水量
  593. roadChart7(chart_data) {
  594. if (this.chart7 != null) {
  595. this.chart7.dispose()
  596. }
  597. this.chart7 = echarts.init(document.getElementById('chart7'))
  598. var text = parseTime(new Date(), '{m}') + '月每日用水量'
  599. var option = {
  600. title: { text: text, left:'left',textStyle: { color: '#769cfc' }},
  601. tooltip: { trigger: 'axis' },
  602. legend: {
  603. data: chart_data.data_name,
  604. left: 40,
  605. bottom:0
  606. },
  607. color: ['#2dc0e8', '#769cfc', '#FFB800'],
  608. grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
  609. xAxis: [{ type: 'category', name: '日',data: chart_data.xdata, axisLabel: { interval: 0, rotate: 30 }}],
  610. yAxis: [{ type: 'value', name: '水量(m³)'}],
  611. series: (function() {
  612. var serie = []
  613. if(chart_data.data1 !== null){
  614. for (var i = 0; i < chart_data.data1.length; i++) {
  615. var item = {
  616. name: chart_data.data_name[i],
  617. type: 'line',
  618. data: chart_data.data1[i].data
  619. }
  620. serie.push(item)
  621. }
  622. }
  623. return serie
  624. }())
  625. }
  626. this.chart7.setOption(option)
  627. window.onresize = function() {
  628. this.chart7.resize()
  629. }
  630. var that = this
  631. this.chart7.on('click', function(param, i) {
  632. console.log(param)
  633. })
  634. },
  635. }
  636. }
  637. </script>
  638. <style>
  639. .el-row {
  640. margin-bottom: 40px;
  641. &:last-child {
  642. margin-bottom: 0;
  643. }
  644. }
  645. </style>
  646. <style lang="scss" scoped>
  647. .group{
  648. float: right;margin-bottom: 20px;
  649. }
  650. </style>