index.vue 41 KB

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