| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- <!-- eslint-disable vue/multi-word-component-names -->
- <template>
- <!-- 把 dedust3D 放到这里则模型可以正常旋转 -->
- <div id="dedust3D" v-show="activeKey == 'monitor'" style="width: 100%; height: 100%; position: absolute; overflow: hidden"> </div>
- <div class="scene-box">
- <customHeader
- :fieldNames="{ label: 'systemname', value: 'id', options: 'children' }"
- :options="options"
- :optionValue="optionValue"
- @change="getSelectRow"
- >
- 除尘风机智能管控
- </customHeader>
- <div class="center-container">
- <template v-if="activeKey == 'monitor'">
- <component :is="DedustHomeComponent" :deviceId="optionValue" />
- </template>
- <div v-else class="history-group">
- <div class="device-button-group" v-if="deviceList.length > 0 && activeKey !== 'faultRecord'">
- <div
- class="device-button"
- :class="{ 'device-active': deviceActive == device.deviceType }"
- v-for="(device, index) in deviceList"
- :key="index"
- @click="deviceChange(index)"
- >{{ device.deviceName }}</div
- >
- </div>
- <div class="history-container">
- <DedustHistory
- v-if="activeKey == 'monitor_history'"
- ref="historyTable"
- class="vent-margin-t-20"
- :deviceId="optionValue"
- device-type="sys_surface_juejin"
- />
- <HandleHistory
- v-if="activeKey == 'handler_history'"
- ref="alarmHistoryTable"
- class="vent-margin-t-20"
- :deviceId="optionValue"
- :device-type="deviceType"
- />
- <AlarmHistory
- v-if="activeKey == 'faultRecord'"
- ref="handlerHistoryTable"
- class="vent-margin-t-20"
- :deviceId="optionValue"
- :device-type="deviceType"
- />
- </div>
- </div>
- </div>
- <BottomMenu @change="changeActive" />
- </div>
- </template>
- <script setup lang="ts">
- import { onBeforeMount, ref, onMounted, computed, defineAsyncComponent } from 'vue';
- import customHeader from '/@/components/vent/customHeader.vue';
- import BottomMenu from '/@/views/vent/comment/components/bottomMenu.vue';
- import DedustHistory from './components/DedustHistory.vue';
- import HandleHistory from './components/HandleHistory.vue';
- import AlarmHistory from './components/AlarmHistory.vue';
- import { useRouter } from 'vue-router';
- import { useSystemSelect } from '/@/hooks/vent/useSystemSelect';
- import { useGlobSetting } from '/@/hooks/setting';
- const DedustHomeComponent = computed(() => {
- const { sysOrgCode } = useGlobSetting();
- // const sysOrgCode = 'sdmtjtbltmk';
- switch (sysOrgCode) {
- // 布尔台
- case 'sdmtjtbetmk':
- return defineAsyncComponent(() => import('./components/DedustHomeBet.vue'));
- default:
- return defineAsyncComponent(() => import('./components/DedustHome.vue'));
- }
- });
- const { currentRoute } = useRouter();
- const activeKey = ref('monitor');
- const historyTable = ref();
- const alarmHistoryTable = ref();
- const handlerHistoryTable = ref();
- function changeActive(activeValue) {
- activeKey.value = activeValue;
- }
- const {
- options,
- optionValue,
- deviceType,
- // isRefresh,
- deviceActive,
- deviceList,
- // deviceValue,
- getSelectRow,
- getSysDataSource,
- deviceChange,
- getDeviceList,
- } = useSystemSelect('sys_surface_juejin');
- onBeforeMount(() => {});
- onMounted(async () => {
- if (currentRoute.value && currentRoute.value['query'] && currentRoute.value['query']['id']) {
- optionValue.value = currentRoute.value['query']['id'] as string;
- }
- await getSysDataSource();
- await getDeviceList();
- });
- </script>
- <style lang="less" scoped>
- @import '/@/design/theme.less';
- @import '/@/design/vent/modal.less';
- .history-group {
- padding: 0 20px;
- margin-top: 90px;
- .history-container {
- position: relative;
- background: #6195af1a;
- width: calc(100% + 10px);
- top: 0px;
- left: -10px;
- border: 1px solid #00fffd22;
- padding: 10px 0;
- box-shadow: 0 0 20px #44b4ff33 inset;
- }
- }
- .device-button-group {
- // margin: 0 20px;
- display: flex;
- pointer-events: auto;
- position: relative;
- &::after {
- position: absolute;
- content: '';
- width: calc(100% + 10px);
- height: 2px;
- top: 30px;
- left: -10px;
- border-bottom: 1px solid var(--vent-base-border);
- }
- .device-button {
- padding: 4px 15px;
- position: relative;
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 14px;
- color: var(--vent-font-color);
- cursor: pointer;
- margin: 0 3px;
- &::before {
- content: '';
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- border: 1px solid #6176af;
- transform: skewX(-38deg);
- background-color: rgba(0, 77, 103, 85%);
- z-index: -1;
- }
- }
- .device-active {
- // color: #0efcff;
- &::before {
- border-color: #0efcff;
- box-shadow: 1px 1px 3px 1px #0efcff inset;
- }
- }
- }
- </style>
|