index1.vue 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162
  1. <template>
  2. <div class="app-container">
  3. <el-row>
  4. <el-col :span="12">
  5. <div class="generalTitle"> 现代牧业设备管理系统 </div>
  6. </el-col>
  7. <el-col :span="12">
  8. <div class="date"> {{ row1.date }} </div>
  9. </el-col>
  10. </el-row>
  11. <el-row :gutter="5" class="row2">
  12. <el-col :span="10">
  13. <dv-border-box-8 :dur="-1" style="height:500px;">
  14. <!-- <div class="Title">费用统计</div> -->
  15. <div id="row2Chart1" style="width: 100%;height:450px;" />
  16. <el-row :gutter="5" class="groupNews">
  17. <el-col :span="8">
  18. <dv-border-box-8 :dur="-1" class="news">
  19. <b>设备指标预算</b><br>
  20. <span>{{ row2.chart1.list.monthBudgets }}万元</span>
  21. </dv-border-box-8>
  22. </el-col>
  23. <el-col :span="8">
  24. <dv-border-box-8 :dur="-1" class="news">
  25. <b>设备指标实际</b><br>
  26. <span>{{ row2.chart1.list.sumPrice }}万元</span>
  27. </dv-border-box-8>
  28. </el-col>
  29. <el-col :span="8">
  30. <dv-border-box-8 :dur="-1" class="news">
  31. <b>迄今达成率</b><br>
  32. <span>{{ row2.chart1.list.donerate }}</span>
  33. </dv-border-box-8>
  34. </el-col>
  35. </el-row>
  36. <div v-if="row2.chart1.isPastureList" class="pastureNews">
  37. <dv-border-box-8 :dur="-1" class="newsTitle"><b>{{ row2.chart1.pasture.pastureName }}</b></dv-border-box-8>
  38. <dv-border-box-8 :dur="-1" class="news2">
  39. <div>
  40. <b>设备指标预算:</b><span>{{ row2.chart1.pasture.list.monthBudgets }}万元</span><br>
  41. <b>设备指标实际:</b><span>{{ row2.chart1.pasture.list.sumPrice }}万元</span><br>
  42. <b>迄今达成率:</b><span>{{ row2.chart1.pasture.list.donerate }}</span>
  43. </div>
  44. </dv-border-box-8>
  45. </div>
  46. </dv-border-box-8>
  47. </el-col>
  48. <el-col :span="14">
  49. <el-row>
  50. <el-col :span="12">
  51. <dv-border-box-8 :dur="-1" style="height:500px;">
  52. <div class="Title">设备状态统计</div>
  53. <div id="row2Chart2" style="width: 100%;height:480px;" />
  54. <div class="Indexbutton">
  55. <a @click="form_seeDetails('row2Chart2')">查看详情</a>
  56. </div>
  57. </dv-border-box-8>
  58. </el-col>
  59. <el-col :span="12">
  60. <dv-border-box-8 :dur="-1" style="height:500px;">
  61. <div class="Title">保养完成率</div>
  62. <div class="IndexTable">
  63. <el-table
  64. :key="row2.chart3.tableKey"
  65. v-loading="row2.chart3.listLoading"
  66. element-loading-text="给我一点时间"
  67. :data="row2.chart3.list"
  68. fit
  69. style="width: 100%;"
  70. :cell-style="cellStyle"
  71. :row-style="rowStyle"
  72. class="table-fixed Indextable"
  73. :height="480"
  74. :header-cell-style="{background:'#003366',color:'#fff',fontSize:'8px',lineHeight:'12px'}"
  75. >
  76. <el-table-column v-if="row2.chart3.isPasture" label="牧场" min-width="80px" align="center" prop="name" />
  77. <el-table-column v-if="row2.chart3.isType" label="设备类型" min-width="80px" align="center" prop="typeName" />
  78. <el-table-column label="保养计划" min-width="70px" align="center" prop="totaluk" />
  79. <el-table-column label="完成数" min-width="60px" align="center" prop="doneuk" />
  80. <el-table-column label="保养完成率" min-width="80px" align="center" prop="donerate" />
  81. </el-table>
  82. </div>
  83. <div class="Indexbutton">
  84. <a @click="form_seeDetails('row2Chart3')">查看详情</a>
  85. </div>
  86. </dv-border-box-8>
  87. </el-col>
  88. <el-col :span="24" style="display:none">
  89. <dv-border-box-8 :dur="-1" style="height:250px;">
  90. <div class="Title">资产运转率</div>
  91. <div id="row2Chart4" style="width: 100%;height:190px;" />
  92. <div class="Indexbutton">
  93. <a @click="form_seeDetails('row2Chart4')">查看详情</a>
  94. </div>
  95. </dv-border-box-8>
  96. </el-col>
  97. </el-row>
  98. </el-col>
  99. </el-row>
  100. <el-row :gutter="5" style="height:300px;color: #fff;">
  101. <el-col :span="24">
  102. <dv-border-box-8 :dur="-1" style="height:300px;">
  103. <div class="Title">费用统计</div>
  104. <div class="costStatistics">
  105. <div class="content">
  106. <dv-border-box-8 :dur="-1" style="height:260px;">
  107. <div class="title">
  108. <svg-icon icon-class="维修成本分析" />
  109. 维修费
  110. </div>
  111. <el-row :gutter="5" style="height:260px;color: #fff;">
  112. <el-col :span="8" style="padding:0 0 0 10px;">
  113. <div class="contentLeft">
  114. <div>
  115. <b>预算</b><span>{{ row3.chart1.list.data1 }}元</span>
  116. <b>实际</b><span>{{ row3.chart1.list.data2 }}元</span>
  117. <b>单头牛实际</b><span>{{ row3.chart1.list.data3 }}元</span>
  118. </div>
  119. </div>
  120. <div class="Indexbutton">
  121. <a @click="form_seeDetails('row3Chart1')">查看详情</a>
  122. </div>
  123. </el-col>
  124. <el-col :span="16" style="padding:0 10px 0 0 ;">
  125. <dv-border-box-8 :dur="-1" style="height:200px;">
  126. <div id="row3Chart1" style="width: 100%;height:200px;" />
  127. </dv-border-box-8>
  128. </el-col>
  129. </el-row>
  130. </dv-border-box-8>
  131. </div>
  132. <div class="content">
  133. <dv-border-box-8 :dur="-1" style="height:260px;">
  134. <div class="title">
  135. <svg-icon icon-class="水量分析" />
  136. 水费
  137. </div>
  138. <el-row :gutter="5" style="height:260px;color: #fff;">
  139. <el-col :span="8" style="padding:0 0 0 10px;">
  140. <div class="contentLeft">
  141. <div>
  142. <b>预算</b><span>{{ row3.chart2.list.data1 }}元</span>
  143. <b>实际</b><span>{{ row3.chart2.list.data2 }}元</span>
  144. <b>单头牛实际</b><span>{{ row3.chart2.list.data3 }}元</span>
  145. </div>
  146. </div>
  147. <div class="Indexbutton">
  148. <a @click="form_seeDetails('row3Chart2')">查看详情</a>
  149. </div>
  150. </el-col>
  151. <el-col :span="16" style="padding:0 10px 0 0 ;">
  152. <dv-border-box-8 :dur="-1" style="height:200px;">
  153. <div id="row3Chart2" style="width: 100%;height:200px;" />
  154. </dv-border-box-8>
  155. </el-col>
  156. </el-row>
  157. </dv-border-box-8>
  158. </div>
  159. <div class="content">
  160. <dv-border-box-8 :dur="-1" style="height:260px;">
  161. <div class="title">
  162. <svg-icon icon-class="电量分析" />
  163. 电费
  164. </div>
  165. <el-row :gutter="5" style="height:260px;color: #fff;">
  166. <el-col :span="8" style="padding:0 0 0 10px;">
  167. <div class="contentLeft">
  168. <div>
  169. <b>预算</b><span>{{ row3.chart3.list.data1 }}元</span>
  170. <b>实际</b><span>{{ row3.chart3.list.data2 }}元</span>
  171. <b>单头牛实际</b><span>{{ row3.chart3.list.data3 }}元</span>
  172. </div>
  173. </div>
  174. <div class="Indexbutton">
  175. <a @click="form_seeDetails('row3Chart3')">查看详情</a>
  176. </div>
  177. </el-col>
  178. <el-col :span="16" style="padding:0 10px 0 0 ;">
  179. <dv-border-box-8 :dur="-1" style="height:200px;">
  180. <div id="row3Chart3" style="width: 100%;height:200px;" />
  181. </dv-border-box-8>
  182. </el-col>
  183. </el-row>
  184. </dv-border-box-8>
  185. </div>
  186. <div class="content">
  187. <dv-border-box-8 :dur="-1" style="height:260px;">
  188. <div class="title">
  189. <svg-icon icon-class="燃动分析" />
  190. 燃动费
  191. </div>
  192. <el-row :gutter="5" style="height:260px;color: #fff;">
  193. <el-col :span="8" style="padding:0 0 0 10px;">
  194. <div class="contentLeft">
  195. <div>
  196. <b>预算</b><span>{{ row3.chart4.list.data1 }}元</span>
  197. <b>实际</b><span>{{ row3.chart4.list.data2 }}元</span>
  198. <b>单头牛实际</b><span>{{ row3.chart4.list.data3 }}元</span>
  199. </div>
  200. </div>
  201. <div class="Indexbutton">
  202. <a @click="form_seeDetails('row3Chart4')">查看详情</a>
  203. </div>
  204. </el-col>
  205. <el-col :span="16" style="padding:0 10px 0 0 ;">
  206. <dv-border-box-8 :dur="-1" style="height:200px;">
  207. <div id="row3Chart4" style="width: 100%;height:200px;" />
  208. </dv-border-box-8>
  209. </el-col>
  210. </el-row>
  211. </dv-border-box-8>
  212. </div>
  213. </div>
  214. </dv-border-box-8>
  215. </el-col>
  216. </el-row>
  217. </div>
  218. </template>
  219. <script>
  220. import { GetReportform, GetDataByName } from '@/api/common'
  221. import Cookies from 'js-cookie'
  222. import { parseTime } from '@/utils/index.js'
  223. import echarts from 'echarts'
  224. import 'echarts/map/js/china'
  225. import $ from 'jquery'
  226. require('echarts/theme/macarons')
  227. export default {
  228. name: 'DashboardEditor',
  229. data() {
  230. return {
  231. row1: {
  232. date: parseTime(new Date(), '{y}-{m}-{d}')
  233. },
  234. row2: {
  235. chart1: {
  236. // 地图
  237. getdataListParm: {
  238. name: 'homepagePastureInfor',
  239. parammaps: {}
  240. },
  241. data: [],
  242. Chart: null,
  243. // 预算、实际、达成率
  244. get_table_dataParm: {
  245. name: 'homepageRate',
  246. parammaps: {
  247. pastureName: '现代牧业'
  248. }
  249. },
  250. list: {},
  251. isPastureList: false,
  252. pasture: {
  253. getdataListParm: {
  254. name: 'homepageRate',
  255. page: 1,
  256. offset: 1,
  257. pagecount: 10,
  258. returntype: 'Map',
  259. parammaps: {
  260. pastureName: ''
  261. }
  262. },
  263. pastureName: '',
  264. listLoading: true,
  265. total: 0,
  266. list: []
  267. }
  268. },
  269. chart2: {
  270. getdataListParm: {
  271. name: 'homepageEqstatus',
  272. parammaps: {
  273. pastureName: '现代牧业'
  274. }
  275. },
  276. data: [],
  277. Chart: null
  278. },
  279. chart3: {
  280. getdataListParm: {
  281. name: 'homepageUkdoneRatePasture',
  282. page: 1,
  283. offset: 1,
  284. pagecount: 0,
  285. returntype: 'Map',
  286. parammaps: {}
  287. },
  288. tableKey: 0,
  289. listLoading: true,
  290. total: 0,
  291. list: [],
  292. isType: false,
  293. isPasture: true
  294. },
  295. chart4: {
  296. getdataListParm: {
  297. name: 'homepageEqRunstatueListPasture',
  298. parammaps: {
  299. type: '牧场'
  300. }
  301. },
  302. data: [],
  303. Chart: null
  304. }
  305. },
  306. row3: {
  307. chart1: {
  308. getdataListParm: {
  309. name: 'homepageFeeWX',
  310. parammaps: {
  311. type: '至今',
  312. pastureName: '现代牧业'
  313. }
  314. },
  315. data: [],
  316. Chart: null,
  317. list: {}
  318. },
  319. chart2: {
  320. getdataListParm: {
  321. name: 'homepageFeeWater',
  322. parammaps: {
  323. type: '至今',
  324. pastureName: '现代牧业'
  325. }
  326. },
  327. data: [],
  328. Chart: null,
  329. list: {}
  330. },
  331. chart3: {
  332. getdataListParm: {
  333. name: 'homepageFeeElec',
  334. parammaps: {
  335. type: '至今',
  336. pastureName: '现代牧业'
  337. }
  338. },
  339. data: [],
  340. Chart: null,
  341. list: {}
  342. },
  343. chart4: {
  344. getdataListParm: {
  345. name: 'homepageFeeDiesel',
  346. parammaps: {
  347. type: '至今',
  348. pastureName: '现代牧业'
  349. }
  350. },
  351. data: [],
  352. Chart: null,
  353. list: {}
  354. }
  355. },
  356. rowStyle: { maxHeight: 20 + 'px', height: 20 + 'px', background: '#003366', color: '#fff', fontSize: '8px' },
  357. cellStyle: { padding: 0 + 'px', background: '#003366', color: '#fff', fontSize: '8px' }
  358. }
  359. },
  360. created() {
  361. this.getRow2List1()
  362. this.getRow2Chart1()
  363. },
  364. methods: {
  365. form_seeDetails(item) {
  366. if (item == 'row2Chart2') {
  367. console.log('设备状态统计')
  368. this.$router.push('/report/EquipmentOverview')
  369. } else if (item == 'row2Chart3') {
  370. console.log('保养完成率')
  371. this.$router.push('/report/CompletionRateMaintenance')
  372. } else if (item == 'row2Chart4') {
  373. console.log('资产运转率')
  374. this.$router.push('/report/EquipmentOperation')
  375. } else if (item == 'row3Chart1') {
  376. console.log('维修费')
  377. this.$router.push('/report/QueryRepair')
  378. } else if (item == 'row3Chart2') {
  379. console.log('水费')
  380. this.$router.push('/report/QueryWater')
  381. } else if (item == 'row3Chart3') {
  382. console.log('电费')
  383. this.$router.push('/report/QueryElec')
  384. } else if (item == 'row3Chart4') {
  385. console.log('燃动费')
  386. this.$router.push('/report/QueryCombustion')
  387. }
  388. },
  389. getRow2List1() {
  390. GetDataByName(this.row2.chart1.get_table_dataParm).then(response => {
  391. if (response.data.list !== null) {
  392. this.row2.chart1.list = response.data.list[0]
  393. } else {
  394. this.row2.chart1.list.donerate = ''
  395. this.row2.chart1.list.monthBudgets = ''
  396. this.row2.chart1.list.sumPrice = ''
  397. }
  398. })
  399. },
  400. getRow2Chart1() {
  401. GetReportform(this.row2.chart1.getdataListParm).then(response => {
  402. console.log('row2图2', response)
  403. if (response.data !== null) {
  404. this.row2.chart1.data = response.data
  405. } else {
  406. this.row2.chart1.data = []
  407. }
  408. this.getRow2Chart2()
  409. this.roadRow2Chart1(this.row2.chart1.data)
  410. })
  411. },
  412. roadRow2Chart1(chart_data1) {
  413. if (this.row2.chart1.Chart != null) {
  414. this.row2.chart1.Chart.dispose()
  415. }
  416. this.row2.chart1.Chart = echarts.init(document.getElementById('row2Chart1'))
  417. var uploadedDataURL = '/datas/myMap.json'
  418. var that = this
  419. $.getJSON(uploadedDataURL, function(geoJson) {
  420. echarts.registerMap('china', geoJson)
  421. var geoCoordMap = chart_data1.data1[0]
  422. var data = chart_data1.data2
  423. console.log('geoCoordMap', JSON.stringify(geoCoordMap) )
  424. console.log('data', JSON.stringify(data))
  425. var max = 480; var min = 9
  426. var maxSize4Pin = 100; var minSize4Pin = 20
  427. var convertData = function(data) {
  428. var res = []
  429. for (var i = 0; i < data.length; i++) {
  430. var geoCoord = geoCoordMap[data[i].name]
  431. if (geoCoord) {
  432. res.push({ name: data[i].name, value: geoCoord.concat(data[i].value) })
  433. }
  434. }
  435. return res
  436. }
  437. console.log('convertData', JSON.stringify(convertData))
  438. var conDatatest1 = convertData(data)
  439. console.log('convertData Data', JSON.stringify(conDatatest1))
  440. var symbolImg = 'image://' + require('@/assets/images/1.png') // 或者import引入在拼接也行
  441. var option = {
  442. title: '',
  443. legend: {
  444. orient: 'vertical',
  445. y: 'bottom',
  446. x: 'right',
  447. data: ['pm2.5'],
  448. textStyle: {
  449. color: '#fff'
  450. }
  451. },
  452. visualMap: {
  453. show: false,
  454. min: 0,
  455. max: 600,
  456. left: 'left',
  457. top: 'bottom',
  458. text: ['高', '低'], // 文本,默认为数值文本
  459. calculable: true,
  460. seriesIndex: [1],
  461. inRange: {}
  462. },
  463. geo: {
  464. map: 'china',
  465. show: true,
  466. roam: true, // 鼠标滚动放大缩小
  467. label: {
  468. normal: {
  469. show: false
  470. },
  471. emphasis: {
  472. show: false
  473. }
  474. },
  475. itemStyle: {
  476. normal: {
  477. areaColor: '#3a7fd5',
  478. borderColor: '#0a53e9', // 线
  479. shadowColor: '#092f8f', // 外发光
  480. shadowBlur: 20
  481. },
  482. emphasis: {
  483. areaColor: '#0a2dae' // 悬浮区背景
  484. }
  485. }
  486. },
  487. series: [{
  488. symbolSize: 5,
  489. label: {
  490. normal: {
  491. formatter: '{b}',
  492. position: 'bottom',
  493. lineHeight: 30,
  494. show: true
  495. },
  496. emphasis: {
  497. show: true
  498. }
  499. },
  500. itemStyle: {
  501. normal: {
  502. color: '#fff'
  503. }
  504. },
  505. name: 'light',
  506. type: 'scatter',
  507. coordinateSystem: 'geo',
  508. data: convertData(data)
  509. }, {
  510. type: 'map',
  511. map: 'china',
  512. geoIndex: 0,
  513. aspectScale: 0.75, // 长宽比
  514. showLegendSymbol: false, // 存在legend时显示
  515. label: {
  516. normal: {
  517. show: false
  518. },
  519. emphasis: {
  520. show: false,
  521. textStyle: {
  522. color: '#fff'
  523. }
  524. }
  525. },
  526. roam: true,
  527. itemStyle: {
  528. normal: {
  529. areaColor: '#031525',
  530. borderColor: '#FFFFFF'
  531. },
  532. emphasis: {
  533. areaColor: '#2B91B7'
  534. }
  535. },
  536. animation: false,
  537. data: data
  538. }, {
  539. name: 'Top 5',
  540. type: 'scatter',
  541. coordinateSystem: 'geo',
  542. // symbol: 'pin',
  543. symbol: symbolImg,
  544. symbolSize: [20, 20],
  545. right: 100,
  546. label: {
  547. normal: {
  548. show: false,
  549. textStyle: { color: '#fff', fontSize: 9 },
  550. formatter(value) {
  551. return value.data.value[2]
  552. }
  553. }
  554. },
  555. itemStyle: {
  556. normal: {
  557. color: '#D8BC37',
  558. marginRight: 100
  559. }
  560. },
  561. data: convertData(data),
  562. showEffectOn: 'render',
  563. rippleEffect: {
  564. brushType: 'stroke'
  565. },
  566. hoverAnimation: true,
  567. zlevel: 1
  568. }]
  569. }
  570. that.row2.chart1.Chart.setOption(option)
  571. that.row2.chart1.Chart.on('click', function(param, i) {
  572. if (param.value.length !== undefined) {
  573. console.log(param)
  574. that.row2.chart2.getdataListParm.parammaps.pastureName = param.name
  575. that.row2.chart3.getdataListParm.name = 'homepageUkdoneRateEqclass'
  576. that.row2.chart3.getdataListParm.parammaps.pastureName = param.name
  577. that.row2.chart3.isType = true
  578. that.row2.chart3.isPasture = false
  579. that.row2.chart4.getdataListParm.name = 'homepageEqRunstatueListEqclass'
  580. that.row2.chart4.getdataListParm.parammaps.pastureName = param.name
  581. that.row2.chart4.getdataListParm.parammaps.type = '设备类别'
  582. that.row2.chart1.pasture.getdataListParm.parammaps.pastureName = param.name
  583. that.row3.chart1.getdataListParm.parammaps.pastureName = param.name
  584. that.row3.chart2.getdataListParm.parammaps.pastureName = param.name
  585. that.row3.chart3.getdataListParm.parammaps.pastureName = param.name
  586. that.row3.chart4.getdataListParm.parammaps.pastureName = param.name
  587. that.row2.chart1.pasture.pastureName = param.name
  588. that.getRow2PastureList()
  589. that.getRow2Chart2()
  590. } else {
  591. that.row2.chart2.getdataListParm.parammaps.pastureName = '现代牧业'
  592. that.row2.chart3.isType = false
  593. that.row2.chart3.isPasture = true
  594. that.row2.chart3.getdataListParm.name = 'homepageUkdoneRatePasture'
  595. that.row2.chart3.getdataListParm.parammaps.pastureName = '现代牧业'
  596. that.row2.chart4.getdataListParm.name = 'homepageEqRunstatueListPasture'
  597. that.row2.chart4.getdataListParm.parammaps.type = '牧场'
  598. that.row2.chart4.getdataListParm.parammaps.pastureName = '现代牧业'
  599. that.row3.chart1.getdataListParm.parammaps.pastureName = '现代牧业'
  600. that.row3.chart2.getdataListParm.parammaps.pastureName = '现代牧业'
  601. that.row3.chart3.getdataListParm.parammaps.pastureName = '现代牧业'
  602. that.row3.chart4.getdataListParm.parammaps.pastureName = '现代牧业'
  603. that.getRow2Chart1()
  604. that.row2.chart1.isPastureList = false
  605. }
  606. })
  607. window.onresize = function() {
  608. that.row2.chart1.Chart.resize()
  609. }
  610. })
  611. },
  612. // 牧场
  613. getRow2PastureList() {
  614. this.row2.chart1.pasture.listLoading = true
  615. GetDataByName(this.row2.chart1.pasture.getdataListParm).then(response => {
  616. if (response.data.list !== null) {
  617. this.row2.chart1.pasture.list = response.data.list[0]
  618. console.log('牧场数据', this.row2.chart1.pasture.list)
  619. this.row2.chart1.isPastureList = true
  620. } else {
  621. this.row2.chart1.pasture.list.donerate = ''
  622. this.row2.chart1.pasture.list.monthBudgets = ''
  623. this.row2.chart1.pasture.list.sumPrice = ''
  624. }
  625. setTimeout(() => {
  626. this.row2.chart1.pasture.listLoading = false
  627. }, 100)
  628. })
  629. },
  630. // 设备状态统计
  631. getRow2Chart2() {
  632. GetReportform(this.row2.chart2.getdataListParm).then(response => {
  633. console.log('row2图2', response)
  634. if (response.data !== null) {
  635. this.row2.chart2.data = response.data
  636. } else {
  637. this.row2.chart2.data = []
  638. }
  639. this.getRow2Chart3()
  640. this.roadRow2Chart2(this.row2.chart2.data)
  641. })
  642. },
  643. roadRow2Chart2(chart_data1) {
  644. if (this.row2.chart2.Chart != null) {
  645. this.row2.chart2.Chart.dispose()
  646. }
  647. this.row2.chart2.Chart = echarts.init(document.getElementById('row2Chart2'))
  648. var option = {
  649. title: { text: '', textStyle: { color: '#769cfc' }},
  650. tooltip: { trigger: 'axis' },
  651. color: ['#769cfc'],
  652. grid: { left: '3%', right: '13%', top: '15%', bottom: '4%', containLabel: true },
  653. xAxis: [{ type: 'category', name: '状态', data: chart_data1.data1, axisLabel: { interval: 0 }, axisLine: { lineStyle: { color: '#fff' }}}],
  654. yAxis: [{ type: 'value', name: '台数', axisLabel: { formatter: '{value}' }, axisLine: { lineStyle: { color: '#fff' }}}],
  655. series: [
  656. {
  657. type: 'bar',
  658. barWidth: 30,
  659. data: chart_data1.data2,
  660. emphasis: { label: { show: true, position: 'inside' }}
  661. }
  662. ]
  663. }
  664. this.row2.chart2.Chart.setOption(option)
  665. window.onresize = function() {
  666. this.row2.chart2.Chart.resize()
  667. }
  668. },
  669. // 保养完成率
  670. getRow2Chart3() {
  671. this.row2.chart3.listLoading = true
  672. GetDataByName(this.row2.chart3.getdataListParm).then(response => {
  673. if (response.data.list !== null) {
  674. this.row2.chart3.list = response.data.list
  675. } else {
  676. this.row2.chart3.list = []
  677. }
  678. this.getRow2Chart4()
  679. setTimeout(() => {
  680. this.row2.chart3.listLoading = false
  681. }, 100)
  682. })
  683. },
  684. // 资产运转率
  685. getRow2Chart4() {
  686. GetReportform(this.row2.chart4.getdataListParm).then(response => {
  687. console.log('row2图4', response)
  688. if (response.data !== null) {
  689. this.row2.chart4.data = response.data
  690. } else {
  691. this.row2.chart4.data = []
  692. }
  693. this.getRow3Chart1()
  694. this.roadRow2Chart4(this.row2.chart4.data)
  695. })
  696. },
  697. roadRow2Chart4(chart_data1) {
  698. if (this.row2.chart4.Chart != null) {
  699. this.row2.chart4.Chart.dispose()
  700. }
  701. this.row2.chart4.Chart = echarts.init(document.getElementById('row2Chart4'))
  702. var option = {
  703. title: { text: '', textStyle: { color: '#769cfc' }},
  704. tooltip: { trigger: 'axis' },
  705. color: ['#769cfc'],
  706. grid: { left: '3%', right: '8%', top: '15%', bottom: '4%', containLabel: true },
  707. xAxis: [{ type: 'category', name: chart_data1.data3[0],
  708. axisLabel: {
  709. interval: 0,
  710. rotate: 40
  711. },
  712. data: chart_data1.data1, axisLine: { lineStyle: { color: '#fff' }}}],
  713. yAxis: [{ type: 'value', name: '%', axisLabel: { formatter: '{value}' }, axisLine: { lineStyle: { color: '#fff' }}}],
  714. series: [
  715. {
  716. type: 'bar',
  717. data: chart_data1.data2,
  718. emphasis: { label: { show: true, position: 'inside' }}
  719. }
  720. ]
  721. }
  722. this.row2.chart4.Chart.setOption(option)
  723. window.onresize = function() {
  724. this.row2.chart4.Chart.resize()
  725. }
  726. },
  727. getRow3Chart1() {
  728. GetReportform(this.row3.chart1.getdataListParm).then(response => {
  729. console.log('row3图1', response)
  730. if (response.data !== null) {
  731. this.row3.chart1.data.data1 = response.data.data1
  732. this.row3.chart1.data.data2 = response.data.data2
  733. this.row3.chart1.data.data3 = response.data.data3
  734. this.row3.chart1.data.data4 = response.data.data4
  735. this.row3.chart1.data.data5 = response.data.data5
  736. this.row3.chart1.list.data1 = response.data.data6[0]
  737. this.row3.chart1.list.data2 = response.data.data7[0]
  738. this.row3.chart1.list.data3 = response.data.data8[0]
  739. this.$forceUpdate()
  740. } else {
  741. this.row3.chart1.data = {}
  742. this.row3.chart1.list = {}
  743. }
  744. this.getRow3Chart2()
  745. this.roadRow3Chart1(this.row3.chart1.data)
  746. })
  747. },
  748. roadRow3Chart1(chart_data1) {
  749. if (this.row3.chart1.Chart != null) {
  750. this.row3.chart1.Chart.dispose()
  751. }
  752. this.row3.chart1.Chart = echarts.init(document.getElementById('row3Chart1'))
  753. var option = {
  754. title: { text: '', textStyle: { color: '#769cfc' }},
  755. tooltip: { trigger: 'axis' },
  756. legend: {
  757. data: [
  758. { name: '今年预算', icon: 'circle' },
  759. { name: '今年实际', icon: 'circle' },
  760. { name: '今年内控', icon: 'circle' },
  761. { name: '去年同期实际', icon: 'circle' }
  762. ],
  763. itemWidth: 5,
  764. itemHeight: 5,
  765. itemGap: 5,
  766. y: 10,
  767. textStyle: { color: '#fff', fontSize: '10' }
  768. },
  769. color: ['#2dc0e8', '#769cfc', '#e69cfc', '#FFB800'],
  770. grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
  771. xAxis: [{ type: 'category', name: '时间', nameTextStyle: { padding: [0, 0, -20, -30] }, data: chart_data1.data1, axisLabel: { interval: 0 }, axisLine: { lineStyle: { color: '#fff' }}}],
  772. yAxis: [{ type: 'value', name: '', axisLabel: { formatter: '{value}' }, axisLine: { lineStyle: { color: '#fff', width: 1 }}}],
  773. series: [
  774. {
  775. name: '今年预算',
  776. textStyle: {
  777. fontSize: 12,
  778. fontWeight: 'bolder',
  779. color: '#fff'
  780. },
  781. type: 'bar',
  782. barWidth: 10,
  783. data: chart_data1.data2,
  784. emphasis: { label: { show: true, position: 'inside' }}
  785. }, {
  786. name: '今年实际',
  787. type: 'bar',
  788. barWidth: 10,
  789. data: chart_data1.data3,
  790. emphasis: { label: { show: true, position: 'inside' }}
  791. }, {
  792. name: '今年内控',
  793. type: 'bar',
  794. barWidth: 10,
  795. data: chart_data1.data4,
  796. emphasis: { label: { show: true, position: 'inside' }}
  797. }, {
  798. name: '去年同期实际',
  799. type: 'bar',
  800. barWidth: 10,
  801. data: chart_data1.data5,
  802. emphasis: { label: { show: true, position: 'inside' }}
  803. }
  804. ]
  805. }
  806. this.row3.chart1.Chart.setOption(option)
  807. window.onresize = function() {
  808. this.row3.chart1.Chart.resize()
  809. }
  810. },
  811. getRow3Chart2() {
  812. GetReportform(this.row3.chart2.getdataListParm).then(response => {
  813. console.log('row3图2', response)
  814. if (response.data !== null) {
  815. this.row3.chart2.data.data1 = response.data.data1
  816. this.row3.chart2.data.data2 = response.data.data2
  817. this.row3.chart2.data.data3 = response.data.data3
  818. this.row3.chart2.data.data4 = response.data.data4
  819. this.row3.chart2.data.data5 = response.data.data5
  820. this.row3.chart2.list.data1 = response.data.data6[0]
  821. this.row3.chart2.list.data2 = response.data.data7[0]
  822. this.row3.chart2.list.data3 = response.data.data8[0]
  823. this.$forceUpdate()
  824. } else {
  825. this.row3.chart2.data = {}
  826. this.row3.chart2.list = {}
  827. }
  828. this.getRow3Chart3()
  829. this.roadRow3Chart2(this.row3.chart2.data)
  830. })
  831. },
  832. roadRow3Chart2(chart_data1) {
  833. if (this.row3.chart2.Chart != null) {
  834. this.row3.chart2.Chart.dispose()
  835. }
  836. this.row3.chart2.Chart = echarts.init(document.getElementById('row3Chart2'))
  837. var option = {
  838. title: { text: '', textStyle: { color: '#769cfc' }},
  839. tooltip: { trigger: 'axis' },
  840. legend: {
  841. data: [
  842. { name: '今年预算', icon: 'circle' },
  843. { name: '今年实际', icon: 'circle' },
  844. { name: '今年内控', icon: 'circle' },
  845. { name: '去年同期实际', icon: 'circle' }
  846. ],
  847. itemWidth: 5,
  848. itemHeight: 5,
  849. itemGap: 5,
  850. y: 10,
  851. textStyle: { color: '#fff', fontSize: '10' }
  852. },
  853. color: ['#2dc0e8', '#769cfc', '#e69cfc', '#FFB800'],
  854. grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
  855. xAxis: [{ type: 'category', name: '时间', nameTextStyle: { padding: [0, 0, -20, -30] }, data: chart_data1.data1, axisLabel: { interval: 0 }, axisLine: { lineStyle: { color: '#fff' }}}],
  856. yAxis: [{ type: 'value', name: '', axisLabel: { formatter: '{value}' }, axisLine: { lineStyle: { color: '#fff', width: 1 }}}],
  857. series: [
  858. {
  859. name: '今年预算',
  860. textStyle: {
  861. fontSize: 12,
  862. fontWeight: 'bolder',
  863. color: '#fff'
  864. },
  865. type: 'bar',
  866. barWidth: 10,
  867. data: chart_data1.data2,
  868. emphasis: { label: { show: true, position: 'inside' }}
  869. }, {
  870. name: '今年实际',
  871. type: 'bar',
  872. barWidth: 10,
  873. data: chart_data1.data3,
  874. emphasis: { label: { show: true, position: 'inside' }}
  875. }, {
  876. name: '今年内控',
  877. type: 'bar',
  878. barWidth: 10,
  879. data: chart_data1.data4,
  880. emphasis: { label: { show: true, position: 'inside' }}
  881. }, {
  882. name: '去年同期实际',
  883. type: 'bar',
  884. barWidth: 10,
  885. data: chart_data1.data5,
  886. emphasis: { label: { show: true, position: 'inside' }}
  887. }
  888. ]
  889. }
  890. this.row3.chart2.Chart.setOption(option)
  891. window.onresize = function() {
  892. this.row3.chart2.Chart.resize()
  893. }
  894. },
  895. getRow3Chart3() {
  896. GetReportform(this.row3.chart3.getdataListParm).then(response => {
  897. console.log('row3图3', response)
  898. if (response.data !== null) {
  899. this.row3.chart3.data.data1 = response.data.data1
  900. this.row3.chart3.data.data2 = response.data.data2
  901. this.row3.chart3.data.data3 = response.data.data3
  902. this.row3.chart3.data.data4 = response.data.data4
  903. this.row3.chart3.data.data5 = response.data.data5
  904. this.row3.chart3.list.data1 = response.data.data6[0]
  905. this.row3.chart3.list.data2 = response.data.data7[0]
  906. this.row3.chart3.list.data3 = response.data.data8[0]
  907. this.$forceUpdate()
  908. } else {
  909. this.row3.chart3.data = {}
  910. this.row3.chart3.list = {}
  911. }
  912. this.getRow3Chart4()
  913. this.roadRow3Chart3(this.row3.chart3.data)
  914. })
  915. },
  916. roadRow3Chart3(chart_data1) {
  917. if (this.row3.chart3.Chart != null) {
  918. this.row3.chart3.Chart.dispose()
  919. }
  920. this.row3.chart3.Chart = echarts.init(document.getElementById('row3Chart3'))
  921. var option = {
  922. title: { text: '', textStyle: { color: '#769cfc' }},
  923. tooltip: { trigger: 'axis' },
  924. legend: {
  925. data: [
  926. { name: '今年预算', icon: 'circle' },
  927. { name: '今年实际', icon: 'circle' },
  928. { name: '今年内控', icon: 'circle' },
  929. { name: '去年同期实际', icon: 'circle' }
  930. ],
  931. itemWidth: 5,
  932. itemHeight: 5,
  933. itemGap: 5,
  934. y: 10,
  935. textStyle: { color: '#fff', fontSize: '10' }
  936. },
  937. color: ['#2dc0e8', '#769cfc', '#e69cfc', '#FFB800'],
  938. grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
  939. xAxis: [{ type: 'category', name: '时间', nameTextStyle: { padding: [0, 0, -20, -30] }, data: chart_data1.data1, axisLabel: { interval: 0 }, axisLine: { lineStyle: { color: '#fff' }}}],
  940. yAxis: [{ type: 'value', name: '', axisLabel: { formatter: '{value}' }, axisLine: { lineStyle: { color: '#fff', width: 1 }}}],
  941. series: [
  942. {
  943. name: '今年预算',
  944. textStyle: {
  945. fontSize: 12,
  946. fontWeight: 'bolder',
  947. color: '#fff'
  948. },
  949. type: 'bar',
  950. barWidth: 10,
  951. data: chart_data1.data2,
  952. emphasis: { label: { show: true, position: 'inside' }}
  953. }, {
  954. name: '今年实际',
  955. type: 'bar',
  956. barWidth: 10,
  957. data: chart_data1.data3,
  958. emphasis: { label: { show: true, position: 'inside' }}
  959. }, {
  960. name: '今年内控',
  961. type: 'bar',
  962. barWidth: 10,
  963. data: chart_data1.data4,
  964. emphasis: { label: { show: true, position: 'inside' }}
  965. }, {
  966. name: '去年同期实际',
  967. type: 'bar',
  968. barWidth: 10,
  969. data: chart_data1.data5,
  970. emphasis: { label: { show: true, position: 'inside' }}
  971. }
  972. ]
  973. }
  974. this.row3.chart3.Chart.setOption(option)
  975. window.onresize = function() {
  976. this.row3.chart3.Chart.resize()
  977. }
  978. },
  979. getRow3Chart4() {
  980. GetReportform(this.row3.chart4.getdataListParm).then(response => {
  981. console.log('row3图4', response)
  982. if (response.data !== null) {
  983. this.row3.chart4.data.data1 = response.data.data1
  984. this.row3.chart4.data.data2 = response.data.data2
  985. this.row3.chart4.data.data3 = response.data.data3
  986. this.row3.chart4.data.data4 = response.data.data4
  987. this.row3.chart4.data.data5 = response.data.data5
  988. this.row3.chart4.list.data1 = response.data.data6[0]
  989. this.row3.chart4.list.data2 = response.data.data7[0]
  990. this.row3.chart4.list.data3 = response.data.data8[0]
  991. this.$forceUpdate()
  992. } else {
  993. this.row3.chart4.data = {}
  994. this.row3.chart4.list = {}
  995. }
  996. this.roadRow3Chart4(this.row3.chart4.data)
  997. })
  998. },
  999. roadRow3Chart4(chart_data1) {
  1000. if (this.row3.chart4.Chart != null) {
  1001. this.row3.chart4.Chart.dispose()
  1002. }
  1003. this.row3.chart4.Chart = echarts.init(document.getElementById('row3Chart4'))
  1004. var option = {
  1005. title: { text: '', textStyle: { color: '#769cfc' }},
  1006. tooltip: { trigger: 'axis' },
  1007. legend: {
  1008. data: [
  1009. { name: '今年预算', icon: 'circle' },
  1010. { name: '今年实际', icon: 'circle' },
  1011. { name: '今年内控', icon: 'circle' },
  1012. { name: '去年同期实际', icon: 'circle' }
  1013. ],
  1014. itemWidth: 5,
  1015. itemHeight: 5,
  1016. itemGap: 5,
  1017. y: 10,
  1018. textStyle: { color: '#fff', fontSize: '10' }
  1019. },
  1020. color: ['#2dc0e8', '#769cfc', '#e69cfc', '#FFB800'],
  1021. grid: { left: '3%', right: '10%', bottom: '4%', containLabel: true },
  1022. xAxis: [{ type: 'category', name: '时间', nameTextStyle: { padding: [0, 0, -20, -30] }, data: chart_data1.data1, axisLabel: { interval: 0 }, axisLine: { lineStyle: { color: '#fff' }}}],
  1023. yAxis: [{ type: 'value', name: '', axisLabel: { formatter: '{value}' }, axisLine: { lineStyle: { color: '#fff', width: 1 }}}],
  1024. series: [
  1025. {
  1026. name: '今年预算',
  1027. textStyle: {
  1028. fontSize: 12,
  1029. fontWeight: 'bolder',
  1030. color: '#fff'
  1031. },
  1032. type: 'bar',
  1033. barWidth: 10,
  1034. data: chart_data1.data2,
  1035. emphasis: { label: { show: true, position: 'inside' }}
  1036. }, {
  1037. name: '今年实际',
  1038. type: 'bar',
  1039. barWidth: 10,
  1040. data: chart_data1.data3,
  1041. emphasis: { label: { show: true, position: 'inside' }}
  1042. }, {
  1043. name: '今年内控',
  1044. type: 'bar',
  1045. barWidth: 10,
  1046. data: chart_data1.data4,
  1047. emphasis: { label: { show: true, position: 'inside' }}
  1048. }, {
  1049. name: '去年同期实际',
  1050. type: 'bar',
  1051. barWidth: 10,
  1052. data: chart_data1.data5,
  1053. emphasis: { label: { show: true, position: 'inside' }}
  1054. }
  1055. ]
  1056. }
  1057. this.row3.chart4.Chart.setOption(option)
  1058. window.onresize = function() {
  1059. this.row3.chart4.Chart.resize()
  1060. }
  1061. }
  1062. }
  1063. }
  1064. </script>
  1065. <style lang="scss" scoped>
  1066. .app-container {
  1067. background-color: #003366; color: #fff;min-height: 100vh;
  1068. .Title{height: 30px;line-height: 30px;text-align: left;padding-left: 10px;}
  1069. .title{height: 30px;line-height: 30px;text-align: center;}
  1070. .generalTitle{width: 100%;margin-left:150px;text-align: right;font-size: 30px;line-height: 60px;font-weight: 600;}
  1071. .date{width: 100%;text-align: right;font-size: 14px;line-height: 60px;padding-right: 20px;}
  1072. .Indexbutton{
  1073. height: 20px;position: relative;width: 100%;
  1074. a{display: inline-block;height: 20px;line-height: 20px;font-size:10px;text-align: center;background: #769cfc;color: #fff;border-radius: 2px;width: 55px;position: absolute;left: 0;right: 0;top: 5px;bottom: 0;margin: 0 auto;}
  1075. }
  1076. .IndexTable{
  1077. padding: 0 10px;
  1078. .Indextable{background: #003366;}
  1079. }
  1080. .row2{
  1081. height:500px;position: relative;
  1082. .groupNews{
  1083. height:60px;width:70%;z-index: 1;position:absolute;top: 5px;left: 10px;
  1084. .news{
  1085. height:60px;text-align: center;
  1086. b{line-height: 30px;font-size: 14px;}
  1087. span{line-height: 20px;font-size: 12px;}
  1088. }
  1089. }
  1090. .pastureNews{
  1091. height:150px;width:40%;z-index: 1;position:absolute;bottom: 20px;left: 10px;background: #055597;
  1092. .newsTitle{height: 30px;line-height: 30px;padding-left: 10px;}
  1093. .news2{
  1094. height: 120px;padding-left: 10px;font-size: 12px;
  1095. div{
  1096. padding-top: 10px;line-height: 30px;
  1097. b{font-weight: 400;}
  1098. }
  1099. }
  1100. }
  1101. }
  1102. // row3
  1103. .costStatistics{
  1104. display: flex;justify-content: space-between;margin: 0 5px;
  1105. .content{
  1106. flex: 1 1 1 1 auto;
  1107. width: 100%;
  1108. .contentLeft{
  1109. height: 200px;position:relative;
  1110. div{
  1111. font-size: 10px;width: 100%;text-align: center;height: 130px;
  1112. position: absolute; top: 0; bottom:0; left: 0; right: 0; margin: auto;
  1113. b{display: block;line-height: 22px;height: 22px;margin-top: 10px;}
  1114. span{display: block;line-height: 22px;height: 22px;}
  1115. }
  1116. b:nth-child(1){
  1117. margin-top: -10px;
  1118. }
  1119. }
  1120. }
  1121. }
  1122. }
  1123. /deep/ .el-table__body-wrapper::-webkit-scrollbar {
  1124. display:block;
  1125. width: 8px;
  1126. height: 8px;
  1127. background-color: rgba(245, 245, 245, 0.47);
  1128. }
  1129. /*定义滚动条的轨道,内阴影及圆角*/
  1130. /deep/ .el-table__body-wrapper::-webkit-scrollbar-track {
  1131. -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
  1132. border-radius: 10px;
  1133. background-color: #f5f5f5;
  1134. }
  1135. /*定义滑块,内阴影及圆角*/
  1136. /deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb {
  1137. /*width: 10px;*/
  1138. height: 20px;
  1139. border-radius: 10px;
  1140. -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
  1141. background-color: rgba(85, 85, 85, 0.25);
  1142. }
  1143. </style>