index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <!-- eslint-disable vue/multi-word-component-names -->
  2. <template>
  3. <!-- 把 dedust3D 放到这里则模型可以正常旋转 -->
  4. <div id="dedust3D" v-show="activeKey == 'monitor'" style="width: 100%; height: 100%; position: absolute; overflow: hidden"> </div>
  5. <div class="scene-box">
  6. <customHeader
  7. :fieldNames="{ label: 'systemname', value: 'id', options: 'children' }"
  8. :options="options"
  9. :optionValue="optionValue"
  10. @change="getSelectRow"
  11. >
  12. 除尘风机智能管控
  13. </customHeader>
  14. <div class="center-container">
  15. <template v-if="activeKey == 'monitor'">
  16. <component :is="DedustHomeComponent" :deviceId="optionValue" />
  17. </template>
  18. <div v-else class="history-group">
  19. <div class="device-button-group" v-if="deviceList.length > 0 && activeKey !== 'faultRecord'">
  20. <div
  21. class="device-button"
  22. :class="{ 'device-active': deviceActive == device.deviceType }"
  23. v-for="(device, index) in deviceList"
  24. :key="index"
  25. @click="deviceChange(index)"
  26. >{{ device.deviceName }}</div
  27. >
  28. </div>
  29. <div class="history-container">
  30. <DedustHistory
  31. v-if="activeKey == 'monitor_history'"
  32. ref="historyTable"
  33. class="vent-margin-t-20"
  34. :deviceId="optionValue"
  35. device-type="sys_surface_juejin"
  36. />
  37. <HandleHistory
  38. v-if="activeKey == 'handler_history'"
  39. ref="alarmHistoryTable"
  40. class="vent-margin-t-20"
  41. :deviceId="optionValue"
  42. :device-type="deviceType"
  43. />
  44. <AlarmHistory
  45. v-if="activeKey == 'faultRecord'"
  46. ref="handlerHistoryTable"
  47. class="vent-margin-t-20"
  48. :deviceId="optionValue"
  49. :device-type="deviceType"
  50. />
  51. </div>
  52. </div>
  53. </div>
  54. <BottomMenu @change="changeActive" />
  55. </div>
  56. </template>
  57. <script setup lang="ts">
  58. import { onBeforeMount, ref, onMounted, computed, defineAsyncComponent } from 'vue';
  59. import customHeader from '/@/components/vent/customHeader.vue';
  60. import BottomMenu from '/@/views/vent/comment/components/bottomMenu.vue';
  61. import DedustHistory from './components/DedustHistory.vue';
  62. import HandleHistory from './components/HandleHistory.vue';
  63. import AlarmHistory from './components/AlarmHistory.vue';
  64. import { useRouter } from 'vue-router';
  65. import { useSystemSelect } from '/@/hooks/vent/useSystemSelect';
  66. import { useGlobSetting } from '/@/hooks/setting';
  67. const DedustHomeComponent = computed(() => {
  68. const { sysOrgCode } = useGlobSetting();
  69. // const sysOrgCode = 'sdmtjtbltmk';
  70. switch (sysOrgCode) {
  71. // 布尔台
  72. case 'sdmtjtbetmk':
  73. return defineAsyncComponent(() => import('./components/DedustHomeBet.vue'));
  74. default:
  75. return defineAsyncComponent(() => import('./components/DedustHome.vue'));
  76. }
  77. });
  78. const { currentRoute } = useRouter();
  79. const activeKey = ref('monitor');
  80. const historyTable = ref();
  81. const alarmHistoryTable = ref();
  82. const handlerHistoryTable = ref();
  83. function changeActive(activeValue) {
  84. activeKey.value = activeValue;
  85. }
  86. const {
  87. options,
  88. optionValue,
  89. deviceType,
  90. // isRefresh,
  91. deviceActive,
  92. deviceList,
  93. // deviceValue,
  94. getSelectRow,
  95. getSysDataSource,
  96. deviceChange,
  97. getDeviceList,
  98. } = useSystemSelect('sys_surface_juejin');
  99. onBeforeMount(() => {});
  100. onMounted(async () => {
  101. if (currentRoute.value && currentRoute.value['query'] && currentRoute.value['query']['id']) {
  102. optionValue.value = currentRoute.value['query']['id'] as string;
  103. }
  104. await getSysDataSource();
  105. await getDeviceList();
  106. });
  107. </script>
  108. <style lang="less" scoped>
  109. @import '/@/design/theme.less';
  110. @import '/@/design/vent/modal.less';
  111. .history-group {
  112. padding: 0 20px;
  113. margin-top: 90px;
  114. .history-container {
  115. position: relative;
  116. background: #6195af1a;
  117. width: calc(100% + 10px);
  118. top: 0px;
  119. left: -10px;
  120. border: 1px solid #00fffd22;
  121. padding: 10px 0;
  122. box-shadow: 0 0 20px #44b4ff33 inset;
  123. }
  124. }
  125. .device-button-group {
  126. // margin: 0 20px;
  127. display: flex;
  128. pointer-events: auto;
  129. position: relative;
  130. &::after {
  131. position: absolute;
  132. content: '';
  133. width: calc(100% + 10px);
  134. height: 2px;
  135. top: 30px;
  136. left: -10px;
  137. border-bottom: 1px solid var(--vent-base-border);
  138. }
  139. .device-button {
  140. padding: 4px 15px;
  141. position: relative;
  142. display: flex;
  143. justify-content: center;
  144. align-items: center;
  145. font-size: 14px;
  146. color: var(--vent-font-color);
  147. cursor: pointer;
  148. margin: 0 3px;
  149. &::before {
  150. content: '';
  151. position: absolute;
  152. top: 0;
  153. right: 0;
  154. bottom: 0;
  155. left: 0;
  156. border: 1px solid #6176af;
  157. transform: skewX(-38deg);
  158. background-color: rgba(0, 77, 103, 85%);
  159. z-index: -1;
  160. }
  161. }
  162. .device-active {
  163. // color: #0efcff;
  164. &::before {
  165. border-color: #0efcff;
  166. box-shadow: 1px 1px 3px 1px #0efcff inset;
  167. }
  168. }
  169. }
  170. </style>