index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <!--
  2. * @Descripttion: 支持决策入口
  3. * @Author: sujunling
  4. * @Date: 2025-05-19 09:10:25
  5. -->
  6. <template>
  7. <div class="widget-decisionSupport">
  8. <div class="modelListDiv">
  9. <template v-for="item in modelList">
  10. <div
  11. class="modelItem"
  12. :class="{ active: item.component === currentModelComponent }"
  13. @click="setCurrentModelComponent(item.component)"
  14. :key="item.title"
  15. >
  16. <span>{{ item.title }}</span>
  17. </div>
  18. </template>
  19. </div>
  20. <div class="componentDiv">
  21. <component :is="currentModelComponent"></component>
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. import constructionProgressSimulation from './constructionProgressSimulation/index.vue'
  27. import coordinatedEvaluation from './coordinatedEvaluation/index.vue'
  28. export default {
  29. name: 'SectorToolbar',
  30. components: { constructionProgressSimulation, coordinatedEvaluation },
  31. data() {
  32. return {
  33. currentModelComponent: constructionProgressSimulation,
  34. modelList: [
  35. {
  36. title: '施工进度模拟',
  37. component: constructionProgressSimulation
  38. },
  39. {
  40. title: '协同评价',
  41. component: coordinatedEvaluation
  42. }
  43. ]
  44. }
  45. },
  46. mounted() {
  47. this.changeDom()
  48. },
  49. methods: {
  50. setCurrentModelComponent(model) {
  51. this.currentModelComponent = model
  52. },
  53. changeDom() {
  54. var dom = document.querySelector('.widget-SectorToolbar')
  55. if (dom) {
  56. dom.style.bottom = '278px'
  57. }
  58. var dom2 = document.querySelector('.widget-Legend')
  59. if (dom2) {
  60. dom2.style.bottom = '278px'
  61. }
  62. }
  63. }
  64. }
  65. </script>
  66. <style scoped>
  67. .modelListDiv {
  68. position: fixed;
  69. top: 100px;
  70. left: 42%;
  71. z-index: 9;
  72. }
  73. .modelListDiv .modelItem {
  74. width: 118px;
  75. height: 42px;
  76. line-height: 42px;
  77. text-align: center;
  78. background: url('~@/assets/images/jczc/tab.png') no-repeat center;
  79. background-size: 100% 100%;
  80. font-weight: 500;
  81. font-size: 18px;
  82. color: #feffff;
  83. padding: 0 5px;
  84. float: left;
  85. cursor: pointer;
  86. }
  87. .modelListDiv .modelItem:first-child {
  88. margin-right: 10px;
  89. }
  90. .modelListDiv .modelItem.active {
  91. background: url('~@/assets/images/jczc/tab2.png') no-repeat center;
  92. background-size: 100% 100%;
  93. }
  94. </style>