| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417 |
- <template>
- <div
- v-show="activeKey == 'monitor' && !loading"
- class="bg"
- style="width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden"
- >
- <a-spin :spinning="loading" />
- <div id="workFace3D" style="width: 100%; height: 100%; position: absolute; overflow: hidden; z-index: 1; top: 0"> </div>
- <div
- id="workFace3DCSS"
- class="threejs-Object-CSS"
- v-show="monitorActive == 4"
- style="width: 100%; height: 100%; position: absolute; pointer-events: none; overflow: hidden; z-index: 1; top: 0"
- >
- </div>
- </div>
- <div class="scene-box">
- <customHeader
- :fieldNames="{ label: 'systemname', value: 'id', options: 'children' }"
- :options="options"
- @change="getSelectRow"
- :optionValue="optionValue"
- >回采工作面智能管控</customHeader
- >
- <div class="center-container">
- <template v-if="activeKey == 'monitor'">
- <div class="monitor-nav">
- <template v-for="(nav, index) in monitorNavData" :key="index">
- <div class="nav-item" :class="{ 'nav-item-active': nav.isShow }" @click="changeMonitor(nav)">{{ nav.title }} </div>
- <a-divider v-if="index !== monitorNav.length - 1" type="vertical" style="height: 10px; background-color: #00e1ff" />
- </template>
- </div>
- <workFaceHome v-if="monitorActive == 0" :deviceId="optionValue" />
- <workFaceVentHome v-if="monitorActive == 1" :deviceId="optionValue" />
- <workFaceFireHome v-if="monitorActive == 2" :deviceId="optionValue" />
- <workFaceDustHome v-if="monitorActive == 3" :deviceId="optionValue" />
- <workFaceGasHome v-if="monitorActive == 4" :deviceId="optionValue" :gas-unit-num="gasUnitNum" />
- </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">
- <workFaceHistory
- v-if="activeKey == 'monitor_history' && isRefresh"
- ref="historyTable"
- class="vent-margin-t-20"
- :deviceId="optionValue"
- :device-type="deviceType"
- />
- <workFaceHandleHistory
- v-if="activeKey == 'handler_history' && isRefresh"
- ref="alarmHistoryTable"
- class="vent-margin-t-20"
- :deviceId="optionValue"
- :device-type="deviceType"
- />
- <workFaceAlarmHistory
- v-if="activeKey == 'faultRecord' && isRefresh"
- 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, onUnmounted, nextTick } from 'vue';
- import { mountedThree, destroy, setModelType, showOrHideGasPlane } from './wokeFace.threejs';
- import { getTableList, systemList } from './workFace.api';
- import { monitorNav } from './workFace.data';
- import customHeader from '/@/components/vent/customHeader.vue';
- import BottomMenu from '/@/views/vent/comment/components/bottomMenu.vue';
- import workFaceVentHome from './components/workFaceVentHome.vue';
- import workFaceHome from './components/workFaceHome.vue';
- import workFaceFireHome from './components/workFaceFireHome.vue';
- import workFaceDustHome from './components/workFaceDustHome.vue';
- import workFaceGasHome from './components/workFaceGasHome.vue';
- import workFaceHistory from './components/workFaceHistory.vue';
- import workFaceHandleHistory from './components/workFaceHandleHistory.vue';
- import workFaceAlarmHistory from './components/workFaceAlarmHistory.vue';
- import { useRouter } from 'vue-router';
- type DeviceType = { deviceType: string; deviceName: string; datalist: any[] };
- const { currentRoute } = useRouter();
- const activeKey = ref('monitor');
- const loading = ref(false);
- const monitorNavData = ref(monitorNav);
- const monitorActive = ref(0);
- let modalType = ''; //模型类型
- const historyTable = ref();
- const alarmHistoryTable = ref();
- const handlerHistoryTable = ref();
- //关联设备
- const deviceList = ref<DeviceType[]>([]);
- const deviceActive = ref('');
- const deviceType = ref('');
- const options = ref();
- const optionValue = ref('');
- const gasUnitNum = ref(0);
- const isRefresh = ref(true);
- function changeActive(activeValue) {
- activeKey.value = activeValue;
- loading.value = true;
- if (activeKey.value === 'monitor') {
- // gasUnitNum.value = Math.ceil(Math.random() * 10)
- gasUnitNum.value = 4;
- setTimeout(() => {
- loading.value = false;
- }, 600);
- } else {
- loading.value = false;
- }
- nextTick(() => {
- setModelType(modalType, gasUnitNum.value, monitorActive.value == 4 ? true : false);
- });
- }
- function deviceChange(index) {
- deviceActive.value = deviceType.value = deviceList.value[index].deviceType;
- isRefresh.value = false;
- nextTick(() => {
- isRefresh.value = true;
- });
- }
- async function getDeviceList() {
- const res = await systemList({ devicetype: 'sys', systemID: optionValue.value });
- const result = res.msgTxt;
- const deviceArr = <DeviceType[]>[];
- result.forEach((item) => {
- const data = item['datalist'].filter((data: any) => {
- const readData = data.readData;
- return Object.assign(data, readData);
- });
- if (item.type != 'sys') {
- deviceArr.unshift({
- deviceType: item.type,
- deviceName: item['typeName'] ? item['typeName'] : item['datalist'][0]['typeName'],
- datalist: data,
- });
- }
- });
- deviceList.value = deviceArr;
- deviceActive.value = deviceArr[0].deviceType;
- deviceChange(0);
- }
- async function getSysDataSource() {
- const res = await getTableList({ strtype: 'sys_surface_caimei', pagetype: 'normal' });
- if (!options.value) {
- // 初始时选择第一条数据
- options.value = res.records || [];
- if (!optionValue.value) {
- optionValue.value = options.value[0]['id'];
- getDeviceList();
- changeModalType(options.value[0]);
- }
- }
- }
- // 切换检测数据
- async function getSelectRow(deviceID) {
- const currentData = options.value.find((item: any) => {
- return item.id == deviceID;
- });
- optionValue.value = deviceID;
- changeModalType(currentData);
- getDeviceList();
- }
- // 获取模型类型
- function changeModalType(currentData) {
- if (currentData['strsystype'] === 'sys_surface_caimei_modal_1') {
- // 单进单回
- modalType = 'workFace1';
- } else if (currentData['strsystype'] === 'sys_surface_caimei_modal_3') {
- // 双进单回
- modalType = 'workFace3';
- } else if (currentData['strsystype'] === 'sys_surface_caimei_modal_4') {
- // 双进双回
- modalType = 'workFace4';
- }
- // gasUnitNum.value = Math.ceil(Math.random() * 4)
- gasUnitNum.value = 4;
- setModelType(modalType, gasUnitNum.value, monitorActive.value == 4 ? true : false);
- }
- function changeMonitor(nav) {
- nav.isShow = true;
- monitorNav.forEach((item, index) => {
- if (item.title !== nav.title) {
- item.isShow = false;
- } else {
- monitorActive.value = index;
- if (monitorActive.value != 4) {
- }
- }
- });
- showOrHideGasPlane(monitorActive.value == 4 ? true : false);
- }
- onBeforeMount(() => {});
- onMounted(async () => {
- if (currentRoute.value && currentRoute.value['query'] && currentRoute.value['query']['id']) optionValue.value = currentRoute.value['query']['id'];
- await getSysDataSource();
- loading.value = true;
- mountedThree().then(async () => {
- // gasUnitNum.value = Math.ceil(Math.random() * 10)
- gasUnitNum.value = 4;
- loading.value = false;
- nextTick(() => {
- setModelType(modalType, gasUnitNum.value, monitorActive.value == 4 ? true : false);
- });
- });
- });
- onUnmounted(() => {
- destroy();
- });
- </script>
- <style lang="less" scoped>
- @import '/@/design/vent/modal.less';
- @import '/@/design/theme.less';
- @ventSpace: zxm;
- :deep(.@{ventSpace}-tabs-tabpane-active) {
- overflow: auto;
- }
- .scene-box {
- --image-wokeFaca-nav: url('/@/assets/images/vent/wokeFaca-nav.png');
- --gradient-0: linear-gradient(45deg, #96c5ca38, #156c7d4a);
- --color-0: #73e8fe;
- --color-2: #96c5ca38;
- --color-3: #156c7d4a;
- --color-5: #6195af1a;
- --color-6: #00fffd22;
- --color-7: #44b4ff33;
- --color-10: #6176af;
- --color-15: #ffffff88;
- --color-16: #f73b2440;
- --color-18: #ff9b1740;
- --color-22: #ffa500;
- width: 100%;
- height: 100%;
- }
- .monitor-nav {
- width: 860px;
- height: 42px;
- display: flex;
- justify-content: center;
- align-items: center;
- // border: 1px solid var(--color-0);
- color: var(--vent-font-color);
- position: absolute;
- top: 88px;
- left: 50% !important;
- transform: translateX(-50%) !important;
- pointer-events: auto;
- background: var(--gradient-0);
- clip-path: polygon(
- 14px 0,
- calc(100% - 14px) 0,
- 100% 14px,
- 100% calc(100% - 14px),
- calc(100% - 14px) 100%,
- 14px 100%,
- 0 calc(100% - 14px),
- 0 14px
- );
- // background: var(--image-wokeFaca-nav) no-repeat !important;
- .nav-item {
- padding: 1px 10px;
- cursor: pointer;
- }
- .nav-item-active {
- color: var(--vent-font-action-link);
- }
- }
- .history-group {
- padding: 0 20px;
- margin-top: 90px;
- .history-container {
- position: relative;
- background: var(--color-5);
- width: calc(100% + 10px);
- left: -10px;
- border: 1px solid var(--color-6);
- padding: 10px 0;
- box-shadow: 0 0 20px var(--color-7) 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-font-action-link);
- }
- .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 var(--color-10);
- transform: skewX(-38deg);
- background-color: rgba(0, 77, 103, 85%);
- z-index: -1;
- }
- }
- .device-active {
- // color: var(--color-11);
- &::before {
- border-color: var(--color-12);
- box-shadow: 1px 1px 3px 1px var(--color-13) inset;
- }
- }
- }
- .input-box {
- display: flex;
- align-items: center;
- padding-left: 10px;
- .input-title {
- color: var(--color-14);
- width: auto;
- }
- .@{ventSpace}-input-number {
- border-color: var(--color-15) !important;
- }
- margin-right: 10px;
- }
- .monitor-msg-box {
- width: 170px;
- margin-top: 100px;
- .monitor-msg-container {
- width: 170px;
- height: 150px;
- box-shadow: rgba(128, 128, 128, 0.3) 0px 0px 40px inset;
- border: 1px solid rgba(128, 128, 128, 0.3);
- background-color: transparent;
- }
- .errorColor {
- box-shadow: var(--color-16) 0px 0px 40px inset;
- border: 1px solid var(--color-17);
- }
- .warningColor {
- box-shadow: var(--color-18) 0px 0px 40px inset;
- border: 1px solid var(--color-19);
- }
- .monitor-item {
- padding: 10px 10px 0px 10px;
- color: var(--color-20);
- letter-spacing: 2px;
- .item-title {
- color: var(--color-21);
- }
- .num {
- color: var(--color-22);
- }
- }
- }
- </style>
|