screenJxdxqk.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <div class="common-warp">
  3. <div class="left">
  4. <div class="c-w">
  5. <Jxdxqk/>
  6. </div>
  7. </div>
  8. <div class="right">
  9. <div class="r-c-w">
  10. <Zydbsx v-if="dataReady" :fetch-data="false" :data="rightData"/>
  11. </div>
  12. </div>
  13. </div>
  14. </template>
  15. <script>
  16. import Jxdxqk from '@/views/dashboard-screen/jxdxqk/index.vue'
  17. import Zydbsx from '@/views/dashboard-screen/zydbsx/index.vue'
  18. import {chartJxdxqkbyDetail} from '@/api/dashboard-json'
  19. export default {
  20. name: 'ScreenJxdxqk',
  21. components: { Zydbsx, Jxdxqk },
  22. data() {
  23. return {
  24. rightData: [
  25. { value: 4, name: '本月已完成站数' },
  26. { value: 3, name: '本月未完成站数' },
  27. {
  28. value: '', name: '未完成站名', children: [
  29. { name: '长春西牵引变电所' },
  30. { name: '英安河AT所' },
  31. { name: '珲春分区所' }
  32. ]
  33. },
  34. { value: 0, name: '下月计划完成站数' },
  35. { value: 0, name: '年度剩余站数' }
  36. ],
  37. dataReady: false
  38. }
  39. },
  40. created() {
  41. this.getData()
  42. },
  43. methods: {
  44. getData() {
  45. chartJxdxqkbyDetail().then(res => {
  46. res = res.info
  47. const arrMap = [
  48. 'byywc', 'bywwc', 'wwcmx', 'ndsys', 'xyjhwc'
  49. ]
  50. this.rightData.forEach((dIitem, dIndex) => {
  51. const mapKey = arrMap[dIndex]
  52. dIitem.value = res?.[mapKey]
  53. if (mapKey === 'wwcmx') {
  54. dIitem.children = res?.[mapKey].map(nameValue => {
  55. return { name: nameValue }
  56. }) || []
  57. dIitem.value = ''
  58. }
  59. })
  60. this.rightData = _.cloneDeep(this.rightData)
  61. this.dataReady = true
  62. })
  63. }
  64. }
  65. }
  66. </script>
  67. <style scoped lang="scss">
  68. .common-warp {
  69. width: 100%;
  70. height: 100%;
  71. display: flex;
  72. .left, .right {
  73. flex: 1;
  74. flex-shrink: 0;
  75. height: 100%;
  76. display: flex;
  77. align-items: center;
  78. justify-content: center;
  79. }
  80. .left {
  81. .c-w {
  82. width: 30vw;
  83. height: 30vw;
  84. }
  85. }
  86. .right {
  87. .r-c-w {
  88. width: 30vw;
  89. height: 50vh;
  90. ::v-deep * {
  91. font-size: 1.6vw !important;
  92. }
  93. }
  94. }
  95. ::v-deep {
  96. .jxdxqk {
  97. .chart {
  98. width: 120%;
  99. }
  100. .bg {
  101. background-size: 92% 80% !important;
  102. background-position: center 0%;
  103. }
  104. }
  105. }
  106. }
  107. </style>