ScreenBdDlYcxx.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <div class="screen-common-wrap">
  3. <el-card class="content-z" v-if="selectList">
  4. <a-tabs v-model="activeKey">
  5. <a-tab-pane
  6. v-for="item in tabs"
  7. :key="item.name"
  8. :tab="item.title"
  9. >
  10. <component
  11. :is="item.name"
  12. v-if="activeKey === item.name"
  13. :selectedGQ="selectedGQ"
  14. :gqPath="params.path"
  15. :gqStPath="params.stPath"
  16. />
  17. </a-tab-pane>
  18. </a-tabs>
  19. </el-card>
  20. </div>
  21. </template>
  22. <script>
  23. import Dl from "@/views/dashboard-screen/screen/screen_Bd_Dl_Ycxx/dl.vue";
  24. import Bd from "@/views/dashboard-screen/screen/screen_Bd_Dl_Ycxx/bd.vue";
  25. import ZzBd from "@/views/dashboard-screen/screen/screen_Bd_Dl_Ycxx/zzBd.vue";
  26. import ZzDl from "@/views/dashboard-screen/screen/screen_Bd_Dl_Ycxx/zzdl.vue";
  27. import GqImg from "@/views/dashboard-screen/screen/screen_Bd_Dl_Ycxx/gqImg.vue";
  28. import GqSTImg from "@/views/dashboard-screen/screen/screen_Bd_Dl_Ycxx/gqStImg.vue";
  29. import request from "@/utils/request";
  30. export default {
  31. name: 'ScreenBdDlYcxx',
  32. components: {
  33. Bd,
  34. Dl,
  35. ZzBd,
  36. ZzDl,
  37. GqImg,
  38. GqSTImg
  39. },
  40. props: {
  41. params: {
  42. type: Object,
  43. default: {}
  44. }
  45. },
  46. data() {
  47. return {
  48. activeKey: 'Bd',
  49. selectList: null,
  50. selectedGQ: null,
  51. tabs: [{
  52. title: '(推送)变电异常信息',
  53. name: 'Bd'
  54. }, {
  55. title: '(推送)电力异常信息',
  56. name: 'Dl'
  57. },
  58. {
  59. title: '(自主发现)变电异常信息',
  60. name: 'ZzBd'
  61. },
  62. {
  63. title: '(自主发现)电力异常信息',
  64. name: 'ZzDl'
  65. }]
  66. }
  67. },
  68. async created() {
  69. window['dlBD'] = this;
  70. await this.getSelectGQ()
  71. },
  72. computed: {},
  73. methods: {
  74. async getSelectGQ() {
  75. const res = await request('/system/dict/data/type/dlyc_sygq')
  76. const selectList = res.data || []
  77. this.selectedGQ = selectList.find(item => item.dictLabel.includes(this.params?.name))
  78. if (this.selectedGQ && this.params?.path) {
  79. const stCadName = this.params.name + '(所亭CAD)'
  80. this.tabs.unshift(
  81. {
  82. title: stCadName,
  83. name: 'GqSTImg'
  84. }
  85. )
  86. const cadName = this.params.name + '(CAD)'
  87. this.tabs.unshift(
  88. {
  89. title: cadName,
  90. name: 'GqImg'
  91. }
  92. )
  93. this.activeKey = 'GqImg'
  94. }
  95. this.selectList = selectList
  96. }
  97. }
  98. }
  99. </script>
  100. <style scoped>
  101. @import '~@/assets/less/common.less'
  102. </style>