gasInjection.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <template>
  2. <div class="company-home">
  3. <div v-if="menuName !== 'syq'" :class="menuName == 'zjm' ? 'vent-modal' : 'vent-modal-1'">
  4. <!-- <VentModal /> -->
  5. </div>
  6. <div v-if="menuName === 'syq'" class="syq-modal">
  7. <!-- <VentModal /> -->
  8. </div>
  9. <div class="top-bg">
  10. <div class="main-title">{{ mainTitle }}</div>
  11. </div>
  12. <div class="main-container">
  13. <div class="nav-cards">
  14. <navMenu @toggleMenu="toggleMenu"></navMenu>
  15. </div>
  16. <template v-if="menuName == 'zjm'">
  17. <div class="main-status">
  18. 运行中
  19. </div>
  20. <ModuleGasInject v-for="cfg in configs" :key="cfg.deviceType" :show-style="cfg.showStyle"
  21. :module-data="cfg.moduleData" :module-name="cfg.moduleName" :device-type="cfg.deviceType" :data="data"
  22. :visible="true" :visible-detail="cfg.showDetail" />
  23. </template>
  24. <template v-else>
  25. <ModuleGasInject v-for="cfg in configs" :key="cfg.deviceType" :show-style="cfg.showStyle"
  26. :module-data="cfg.moduleData" :module-name="cfg.moduleName" :device-type="cfg.deviceType" :data="data"
  27. :visible="true" :visible-detail="cfg.showDetail" />
  28. </template>
  29. </div>
  30. </div>
  31. </template>
  32. <script lang="ts" setup>
  33. import { onMounted, onUnmounted, ref, computed } from 'vue';
  34. import { useInitConfigs, useInitPage } from './hooks/useInit';
  35. import ModuleGasInject from './components/ModuleGasInject.vue';
  36. import navMenu from './components/gasInject/navMenu.vue'
  37. // import { useRoute } from 'vue-router';
  38. import VentModal from '/@/components/vent/micro/ventModal.vue';
  39. import { getHomeData } from './configurable.api';
  40. // import { useRoute } from 'vue-router';
  41. import { testConfigGasInject, testConfigGasInjectZq, testConfigGasInjectCc, testConfigGasInjectSy } from './configurable.data';
  42. const { configs, fetchConfigs } = useInitConfigs();
  43. const { mainTitle, data, updateData } = useInitPage('注气驱替智能管控系统');
  44. // const route = useRoute();
  45. let interval: number | undefined;
  46. let menuName = ref('zjm')
  47. //选项切换
  48. function toggleMenu(param) {
  49. menuName.value = param
  50. switch (menuName.value) {
  51. case 'zjm':
  52. configs.value = testConfigGasInject;
  53. break;
  54. case 'syq':
  55. configs.value = testConfigGasInjectSy;
  56. break;
  57. case 'zqxt':
  58. configs.value = testConfigGasInjectZq;
  59. break;
  60. case 'ccxt':
  61. configs.value = testConfigGasInjectCc
  62. break;
  63. }
  64. }
  65. onMounted(() => {
  66. // fetchConfigs('vent_new').then(() => {
  67. configs.value = testConfigGasInject;
  68. // updateEnhancedConfigs(configs.value);
  69. getHomeData({}).then(updateData);
  70. // });
  71. setInterval(() => {
  72. getHomeData({}).then(updateData);
  73. }, 60000);
  74. });
  75. onUnmounted(() => {
  76. clearInterval(interval);
  77. });
  78. </script>
  79. <style lang="less" scoped>
  80. @import '/@/design/theme.less';
  81. @{theme-deepblue} {
  82. .company-home {
  83. --image-modal-top: url('@/assets/images/gasInjection/1-1.png');
  84. --image-modal-status: url('@/assets/images/gasInjection/3-1.png');
  85. --image-modal-center: url('@/assets/images/gasInjection/1-2.png');
  86. }
  87. }
  88. .company-home {
  89. --image-modal-top: url('@/assets/images/gasInjection/1-1.png');
  90. --image-modal-status: url('@/assets/images/gasInjection/3-1.png');
  91. --image-modal-center: url('@/assets/images/gasInjection/1-2.png');
  92. width: 100%;
  93. height: 100%;
  94. color: @white;
  95. position: relative;
  96. background: url('@/assets/images/vent/homeNew/bg.png') no-repeat center;
  97. .top-bg {
  98. width: 100%;
  99. height: 66px;
  100. background: var(--image-modal-top) no-repeat center;
  101. background-size: 100% 100%;
  102. position: absolute;
  103. z-index: 1;
  104. .main-title {
  105. height: 66px;
  106. font-family: 'douyuFont';
  107. font-size: 20px;
  108. letter-spacing: 2px;
  109. display: flex;
  110. justify-content: center;
  111. align-items: center;
  112. }
  113. .top-nav {
  114. position: absolute;
  115. top: 0;
  116. width: 880px;
  117. height: 100%;
  118. display: flex;
  119. justify-content: flex-start;
  120. }
  121. }
  122. .main-container {
  123. position: absolute;
  124. top: 66px;
  125. width: 100%;
  126. height: calc(100% - 66px);
  127. padding: 0px 10px;
  128. box-sizing: border-box;
  129. }
  130. .main-status {
  131. display: flex;
  132. justify-content: center;
  133. align-items: center;
  134. width: 440px;
  135. height: 80px;
  136. font-size: 18px;
  137. font-family: 'douyuFont';
  138. margin: 10px 0px;
  139. background: var(--image-modal-status);
  140. background-size: 100% 100%;
  141. }
  142. .module-dropdown {
  143. padding: 10px;
  144. background-image: @vent-configurable-dropdown;
  145. border-bottom: 2px solid @vent-configurable-home-light-border;
  146. color: @vent-font-color;
  147. position: absolute;
  148. top: 70px;
  149. right: 460px;
  150. }
  151. .module-dropdown-original {
  152. padding: 10px;
  153. background-image: @vent-configurable-dropdown;
  154. border-bottom: 2px solid @vent-configurable-home-light-border;
  155. color: @vent-font-color;
  156. position: absolute;
  157. top: 70px;
  158. right: 460px;
  159. }
  160. .module-trigger-button {
  161. color: @vent-font-color;
  162. background-image: @vent-configurable-dropdown;
  163. border: none;
  164. border-bottom: 2px solid @vent-configurable-home-light-border;
  165. }
  166. .nav-cards {
  167. position: absolute;
  168. left: 50%;
  169. top: 0px;
  170. transform: translate(-50%, 0);
  171. width: 691px;
  172. height: 58px;
  173. background: var(--image-modal-center) no-repeat;
  174. background-size: 100% 100%;
  175. }
  176. }
  177. :deep(.loading-box) {
  178. position: unset;
  179. }
  180. // 试验区模型区域样式
  181. .syq-modal {
  182. position: absolute;
  183. top: 135px;
  184. right: 20px;
  185. width: calc(100% - 510px);
  186. height: 515px;
  187. background: url('@/assets/images/gasInjection/syq/modal-bg.png') no-repeat;
  188. background-size: 100% 100%;
  189. }
  190. .vent-modal {
  191. position: absolute;
  192. top: 134px;
  193. left: 50%;
  194. transform: translate(-50%, 0px);
  195. width: calc(100% - 920px);
  196. height: 505px;
  197. background: url(/src/assets/images/gasInjection/syq/modal-bg.png) no-repeat;
  198. background-size: 100% 100%;
  199. }
  200. .vent-modal-1 {
  201. position: absolute;
  202. top: 134px;
  203. left: 460px;
  204. width: calc(100% - 470px);
  205. height: 505px;
  206. background: url(/src/assets/images/gasInjection/syq/modal-bg.png) no-repeat;
  207. background-size: 100% 100%;
  208. }
  209. </style>