123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- <!-- eslint-disable vue/multi-word-component-names -->
- <template>
- <div class="company-home">
- <div v-if="!route.query.embed" class="top-bg">
- <div class="main-title">{{ mainTitle }}</div>
- </div>
- <!-- <a-dropdown class="module-dropdown" :class="{ 'module-dropdown-original': isOriginal }" :trigger="['click']" placement="bottomRight">
- <a class="ant-dropdown-link" @click.prevent>
- 全矿井通风检测
- <CaretDownOutlined />
- </a>
- <template #overlay>
- <MonitorCenter />
- </template>
- </a-dropdown> -->
- <!-- 采用定位方式以避免出现各个模块隐藏时其他模块下移的问题 -->
- <template v-if="isOriginal">
- <ModuleOriginal
- v-for="cfg in configs"
- :key="cfg.deviceType"
- :show-style="cfg.showStyle"
- :module-data="cfg.moduleData"
- :module-name="cfg.moduleName"
- :device-type="cfg.deviceType"
- :data="data"
- :visible="true"
- />
- </template>
- <template v-else-if="isCommon">
- <ModuleCommon
- v-for="cfg in configs"
- :key="cfg.deviceType"
- :show-style="cfg.showStyle"
- :module-data="cfg.moduleData"
- :module-name="cfg.moduleName"
- :device-type="cfg.deviceType"
- :data="data"
- :visible="true"
- />
- </template>
- <template v-else>
- <!-- 下面是正常展示的各新版模块 -->
- <ModuleEnhanced
- v-for="cfg in enhancedConfigs"
- :key="cfg.deviceType"
- :visible="cfg.visible"
- :show-style="cfg.showStyle"
- :module-data="cfg.moduleData"
- :module-name="cfg.moduleName"
- :device-type="cfg.deviceType"
- :data="data"
- @close="cfg.visible = false"
- />
- <!-- 下面是用于呼出已隐藏的模块的按钮 -->
- <div class="pos-absolute top-70px left-460px z-3">
- <div v-for="(item, i) in hiddenList" :key="`vvhchg${i}`">
- <AButton class="module-trigger-button" @click="item.visible = true">{{ item.moduleName }}</AButton>
- </div>
- </div>
- </template>
- <div style="width: 1000px; height: 570px; position: absolute; left: calc(50% - 500px); top: 60px">
- <VentModal />
- <div :class="{ 'realtime-mode': isDataRealTime }" alt="切换数据模式" class="switch-button report-mode right-50px" @click="switchDataMode"></div>
- <div
- class="switch-button icon-goto right-5px"
- @click="redirectTo('/micro-vent-3dModal/dashboard/analysis?type=model3D&deviceType=model3D')"
- ></div>
- </div>
- </div>
- </template>
- <script lang="ts" setup>
- import { onMounted, onUnmounted, ref } from 'vue';
- // import { CaretDownOutlined } from '@ant-design/icons-vue';
- // import MonitorCenter from './components/MonitorCenter.vue';
- import { useInitConfigs, useInitPage } from './hooks/useInit';
- import ModuleEnhanced from './components/ModuleEnhanced.vue';
- import ModuleOriginal from './components/ModuleOriginal.vue';
- import ModuleCommon from './components/ModuleCommon.vue';
- // import { useRoute } from 'vue-router';
- import VentModal from '/@/components/vent/micro/ventModal.vue';
- import { list } from './configurable.api';
- import { useRoute } from 'vue-router';
- // import { testConfigVent, testConfigVentRealtime } from './configurable.data';
- const { configs, isOriginal, isCommon, fetchConfigs } = useInitConfigs();
- const { mainTitle, enhancedConfigs, hiddenList, data, updateData, updateEnhancedConfigs } = useInitPage('智能通风管控系统');
- const route = useRoute();
- const isDataRealTime = ref(false);
- let interval: number | undefined;
- function switchDataMode() {
- isDataRealTime.value = !isDataRealTime.value;
- fetchConfigs(isDataRealTime.value ? 'vent_realtime' : 'vent').then(() => {
- // configs.value = isDataRealTime.value ? testConfigVentRealtime : testConfigVent;
- updateEnhancedConfigs(configs.value);
- list({}).then(updateData);
- });
- }
- function redirectTo(url) {
- window.open(url);
- }
- onMounted(() => {
- fetchConfigs(isDataRealTime.value ? 'vent_realtime' : 'vent').then(() => {
- // configs.value = isDataRealTime.value ? testConfigVentRealtime : testConfigVent;
- updateEnhancedConfigs(configs.value);
- list({}).then(updateData);
- });
- setInterval(() => {
- list({}).then(updateData);
- }, 60000);
- });
- onUnmounted(() => {
- clearInterval(interval);
- });
- </script>
- <style lang="less" scoped>
- @import '/@/design/theme.less';
- @font-face {
- font-family: 'douyuFont';
- src: url('../../../../assets/font/douyuFont.otf');
- }
- @{theme-deepblue} {
- .company-home {
- --image-modal-top: url('/@/assets/images/themify/deepblue/vent/home/modal-top.png');
- }
- }
- .company-home {
- --image-modal-top: url('/@/assets/images/vent/home/modal-top.png');
- --image-monitor-realtime: url('/@/assets/images/company/monitor-realtime.png');
- --image-monitor-doc: url('/@/assets/images/company/monitor-doc.png');
- --image-monitor-goto: url('/@/assets/images/company/monitor-goto.png');
- width: 100%;
- height: 100%;
- color: @white;
- position: relative;
- // background: url('@/assets/images/home-container/configurable/firehome/bg.png') no-repeat center;
- .top-bg {
- width: 100%;
- height: 56px;
- background: var(--image-modal-top) no-repeat center;
- position: absolute;
- z-index: 1;
- .main-title {
- height: 56px;
- font-family: 'douyuFont';
- font-size: 20px;
- letter-spacing: 2px;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- }
- // .module-left {
- // position: absolute;
- // width: 450px;
- // height: 280px;
- // left: 0;
- // }
- // .module-right {
- // position: absolute;
- // width: 450px;
- // height: 280px;
- // right: 0;
- // }
- // .module-bottom {
- // position: absolute;
- // width: 1000px;
- // height: 280px;
- // }
- .module-dropdown {
- padding: 10px;
- background-image: @vent-configurable-dropdown;
- border-bottom: 2px solid @vent-configurable-home-light-border;
- color: @vent-font-color;
- position: absolute;
- top: 70px;
- right: 460px;
- }
- .module-dropdown-original {
- padding: 10px;
- background-image: @vent-configurable-dropdown;
- border-bottom: 2px solid @vent-configurable-home-light-border;
- color: @vent-font-color;
- position: absolute;
- top: 70px;
- right: 460px;
- }
- .module-trigger-button {
- color: @vent-font-color;
- background-image: @vent-configurable-dropdown;
- border: none;
- border-bottom: 2px solid @vent-configurable-home-light-border;
- }
- .switch-button {
- width: 34px;
- height: 34px;
- position: absolute;
- // right: 5px;
- bottom: 5px;
- z-index: 5;
- background-repeat: no-repeat;
- background-size: 100% 100%;
- }
- .report-mode {
- background-image: var(--image-monitor-doc);
- }
- .realtime-mode {
- background-image: var(--image-monitor-realtime);
- }
- .icon-goto {
- background-image: var(--image-monitor-goto);
- }
- }
- :deep(.loading-box) {
- position: unset;
- }
- </style>
|