screenDlts.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <div class="dlts-wrap">
  3. <div class="o-item">远动调试</div>
  4. <div class="o-item">电力受电线路</div>
  5. <div class="o-item">电力变配电所</div>
  6. <div class="o-item">
  7. <v-chart autoresize :option="options[0]"/>
  8. </div>
  9. <div class="o-item">
  10. <v-chart autoresize :option="options[1]"/>
  11. </div>
  12. <div class="o-item">
  13. <v-chart autoresize :option="options[2]"/>
  14. </div>
  15. <div class="o-item a-scrool">
  16. <Zydbsx v-if="dataListReady" :fetchData="false" :data="dataList[0]"/>
  17. </div>
  18. <div class="o-item a-scrool">
  19. <Zydbsx v-if="dataListReady" :fetchData="false" :data="dataList[1]"/>
  20. </div>
  21. <div class="o-item a-scrool">
  22. <Zydbsx v-if="dataListReady" :fetchData="false" :data="dataList[2]"/>
  23. </div>
  24. </div>
  25. </template>
  26. <script>
  27. import Zydbsx from '@/views/dashboard-screen/zydbsx/index.vue'
  28. import {
  29. chartDlbpdsby,
  30. chartDlbpdsbyDetail,
  31. chartDlsdxlBy,
  32. chartDlsdxlbyDetail,
  33. chartDlydtsby,
  34. chartDlydtsbyDetail
  35. } from '@/api/dashboard-json'
  36. import _ from 'lodash'
  37. export default {
  38. name: 'ScreenDlts',
  39. components: {Zydbsx},
  40. data() {
  41. return {
  42. basicOption: {
  43. xAxis: {
  44. type: 'category',
  45. data: ['本月计划', '本月完成'],
  46. axisLabel: {
  47. show: true,
  48. fontSize: this.EchartfontSize(14)
  49. }
  50. },
  51. yAxis: {
  52. type: 'value'
  53. },
  54. series: [
  55. {
  56. data: [10, 20],
  57. type: 'bar',
  58. itemStyle: {
  59. normal: {
  60. color: (params) => {
  61. const color = ['rgb(96, 150, 230)', 'rgb(4,245,69)']
  62. return color[params.dataIndex]
  63. }
  64. }
  65. }
  66. }
  67. ]
  68. },
  69. options: {
  70. 0: {},
  71. 1: {},
  72. 2: {}
  73. },
  74. dataList: [
  75. [
  76. {name: '本月已完成数', value: 0},
  77. {name: '本月未完成数', value: 0},
  78. {
  79. name: '未完成明细',
  80. value: null,
  81. children: [{name: '-'}]
  82. },
  83. {name: '年度剩余数', value: 0},
  84. {name: '下月计划完成数', value: 0}
  85. ],
  86. [
  87. {name: '本月已完成数', value: 0},
  88. {name: '本月未完成数', value: 0},
  89. {
  90. name: '未完成明细',
  91. value: null,
  92. children: [{name: '-'}]
  93. },
  94. {name: '年度剩余数', value: 0},
  95. {name: '下月计划完成数', value: 0}
  96. ],
  97. [
  98. {name: '本月已完成数', value: 0},
  99. {name: '本月未完成数', value: 0},
  100. {
  101. name: '未完成明细',
  102. value: null,
  103. children: [{name: '-'}]
  104. },
  105. {name: '年度剩余数', value: 0},
  106. {name: '下月计划完成数', value: 0}
  107. ]
  108. ],
  109. dataListReady: false
  110. }
  111. },
  112. created() {
  113. this.getOption()
  114. this.getData()
  115. },
  116. methods: {
  117. getOption() {
  118. this.options[0] = _.cloneDeep(this.basicOption)
  119. this.options[1] = _.cloneDeep(this.basicOption)
  120. this.options[2] = _.cloneDeep(this.basicOption)
  121. const r1 = chartDlydtsby()
  122. const r2 = chartDlsdxlBy()
  123. const r3 = chartDlbpdsby()
  124. Promise.all([r1, r2, r3]).then(res => {
  125. const res1 = res[0]
  126. const res2 = res[1]
  127. const res3 = res[2]
  128. this.options[0].series[0].data = [res1.info.series[0].data[0], res1.info.series[1].data[0]]
  129. this.options[1].series[0].data = [res2.info.series[0].data[0], res2.info.series[1].data[0]]
  130. this.options[2].series[0].data = [res3.info.series[0].data[0], res3.info.series[1].data[0]]
  131. })
  132. window['tis'] = this
  133. },
  134. getData() {
  135. const arrMap = [
  136. 'byywc', 'bywwc', 'wwcmx', 'ndsys', 'xyjhwc'
  137. ]
  138. const r1 = chartDlydtsbyDetail()
  139. const r2 = chartDlsdxlbyDetail()
  140. const r3 = chartDlbpdsbyDetail()
  141. Promise.all([r1, r2, r3]).then(res => {
  142. const resArr = [res[0].info, res[1].info, res[2].info]
  143. resArr.forEach((item, index) => {
  144. this.dataList[index].forEach((dIitem, dIndex) => {
  145. const mapKey = arrMap[dIndex]
  146. dIitem.value = item?.[mapKey]
  147. if (mapKey === 'wwcmx') {
  148. dIitem.children = item?.[mapKey].map(nameValue => {
  149. return {name: nameValue}
  150. }) || []
  151. dIitem.value = ''
  152. }
  153. })
  154. })
  155. })
  156. this.dataList = _.cloneDeep(this.dataList)
  157. this.dataListReady = true
  158. }
  159. }
  160. }
  161. </script>
  162. <style scoped lang="scss">
  163. .dlts-wrap {
  164. width: 100%;
  165. height: 100%;
  166. display: grid;
  167. grid-auto-flow: row;
  168. grid-template-columns: 1fr 1fr 1fr;
  169. grid-template-rows: 1fr 8fr 5fr;
  170. grid-row-gap: 1fr;
  171. grid-column-gap: 200px;
  172. color: #ffffff;
  173. padding-bottom: 4vh;
  174. .o-item {
  175. position: relative;
  176. height: 100%;
  177. width: 100%;
  178. overflow: hidden;
  179. display: flex;
  180. align-items: center;
  181. justify-content: center;
  182. font-size: 1.1vw;
  183. &.a-scrool{
  184. overflow-y: auto;
  185. }
  186. ::v-deep {
  187. .row-item {
  188. font-size: 1.0vw;
  189. }
  190. }
  191. }
  192. * {
  193. color: #ffffff;
  194. }
  195. }
  196. </style>