|
@@ -2,102 +2,96 @@
|
|
|
<a-spin tip="Loading..." :spinning="loading">
|
|
|
<div class="monitor-container">
|
|
|
<div class="lr left-box">
|
|
|
- <ventBox1>
|
|
|
- <template #title>
|
|
|
- <div>均压与低氧参数监测与设置</div>
|
|
|
- </template>
|
|
|
- <template #container>
|
|
|
- <div class="vent-flex-row-between auto-control mt-10px mb-10px">
|
|
|
- <div class="title">自动调节:</div>
|
|
|
- <a-radio-group :value="avePressSetting.isAutoControl" name="radioGroup" @change="changeIsAutoControl">
|
|
|
- <a-radio value="1">关闭</a-radio>
|
|
|
- <a-radio value="2">开启</a-radio>
|
|
|
- </a-radio-group>
|
|
|
- </div>
|
|
|
- <div class="vent-flex-row-between auto-control mt-10px mb-10px">
|
|
|
- <div class="title">调节类型:</div>
|
|
|
- <a-radio-group :value="avePressSetting.controlType" name="radioGroup" @change="changeIsAutoControl">
|
|
|
- <a-radio value="o2">氧气</a-radio>
|
|
|
- <a-radio value="pressure">压差</a-radio>
|
|
|
- </a-radio-group>
|
|
|
- </div>
|
|
|
- <div class="input-box">
|
|
|
- <!-- <div class="divider-line">开始条件</div>
|
|
|
+ <Transition enter-active-class="animate__animated animate__fadeInLeft" leave-active-class="animate__animated animate__fadeOutLeft">
|
|
|
+ <ventBox1 v-if="showModules">
|
|
|
+ <template #title>
|
|
|
+ <div>均压与低氧参数监测与设置</div>
|
|
|
+ </template>
|
|
|
+ <template #container>
|
|
|
+ <div class="vent-flex-row-between auto-control mt-10px mb-10px">
|
|
|
+ <div class="title">自动调节:</div>
|
|
|
+ <a-radio-group :value="avePressSetting.isAuto" name="radioGroup" @change="changeAvePressState($event, 'isAuto')">
|
|
|
+ <a-radio :value="false">关闭</a-radio>
|
|
|
+ <a-radio :value="true">开启</a-radio>
|
|
|
+ </a-radio-group>
|
|
|
+ </div>
|
|
|
+ <div class="vent-flex-row-between auto-control mt-10px mb-10px">
|
|
|
+ <div class="title">调节类型:</div>
|
|
|
+ <a-radio-group :value="avePressSetting.controlType" name="radioGroup" @change="changeAvePressState($event, 'controlType')">
|
|
|
+ <a-radio value="o2">氧气</a-radio>
|
|
|
+ <a-radio value="pressure">压差</a-radio>
|
|
|
+ </a-radio-group>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <!-- <div class="divider-line">开始条件</div>
|
|
|
<div v-for="(item, index) in settingParam1" class="input-item" :key="index">
|
|
|
<div class="title">{{ item.title }}:</div>
|
|
|
<a-input-number class="input-value" v-model:value="formData[item.code]" placeholder="" />
|
|
|
<div class="unit">{{ item.unit }}</div>
|
|
|
</div> -->
|
|
|
- <div class="divider-line">调节参数</div>
|
|
|
- <div v-for="(item, index) in settingParam4" class="input-item" :key="index">
|
|
|
- <div class="title">{{ item.title }}:</div>
|
|
|
- <a-input-number class="input-value" v-model:value="avePressSetting[item.code]" placeholder="" :disabled="settingFormDisabled" />
|
|
|
- <div class="unit">{{ item.unit }}</div>
|
|
|
- </div>
|
|
|
- <!-- <div class="divider-line">结束时间</div>
|
|
|
+ <div class="divider-line"></div>
|
|
|
+ <div v-for="(item, index) in settingParam4" class="input-item" :key="index">
|
|
|
+ <div class="title">{{ item.title }}:</div>
|
|
|
+ <a-input-number class="input-value" v-model:value="avePressSetting[item.code]" placeholder="" :disabled="settingFormDisabled" />
|
|
|
+ <div class="unit"> {{ item.unit }}</div>
|
|
|
+ </div>
|
|
|
+ <!-- <div class="divider-line">结束时间</div>
|
|
|
<div v-for="(item, index) in settingParam3" class="input-item" :key="index">
|
|
|
<div class="title">{{ item.title }}:</div>
|
|
|
<a-input-number class="input-value" v-model:value="formData[item.code]" placeholder="" />
|
|
|
<div class="unit">{{ item.unit }}</div>
|
|
|
</div> -->
|
|
|
- </div>
|
|
|
- <div class="btn-box flex" style="text-align: center">
|
|
|
- <div class="btn btn1 flex-1" @click="editSettingForm">{{ settingFormDisabled ? '编辑' : '取消' }}</div>
|
|
|
- <div class="btn btn1 flex-1" @click="submitSettingForm">提交</div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </ventBox1>
|
|
|
- </div>
|
|
|
- <div style="pointer-events: auto" class="flex mt-10px h-100% w-770px">
|
|
|
- <ventBox1 class="mr-10px">
|
|
|
- <template #title>
|
|
|
- <div>均压工作面风门与风门联动</div>
|
|
|
- </template>
|
|
|
- <template #container>
|
|
|
- <div class="vent-flex-row-between auto-control mt-10px mb-10px">
|
|
|
- <div class="title">自动调节:</div>
|
|
|
- <a-radio-group :value="gateLinkage.isAuto" name="radioGroup" @change="changeIsAuto($event, gateLinkage.id)">
|
|
|
- <a-radio :value="false">关闭</a-radio>
|
|
|
- <a-radio :value="true">开启</a-radio>
|
|
|
- </a-radio-group>
|
|
|
- </div>
|
|
|
- <div class="btn-box" style="text-align: center">
|
|
|
- <div class="btn btn1" @click="() => openModal(false, { id: gateLinkage.id })">控制密码修改</div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </ventBox1>
|
|
|
- <ventBox1>
|
|
|
- <template #title>
|
|
|
- <div>均压工作面风机与风门联动</div>
|
|
|
- </template>
|
|
|
- <template #container>
|
|
|
- <div class="vent-flex-row-between auto-control mt-10px mb-10px">
|
|
|
- <div class="title">自动调节:</div>
|
|
|
- <a-radio-group :value="avePressLinkage.isAuto" name="radioGroup" @change="changeIsAuto($event, avePressLinkage.id)">
|
|
|
- <a-radio :value="false">关闭</a-radio>
|
|
|
- <a-radio :value="true">开启</a-radio>
|
|
|
- </a-radio-group>
|
|
|
- </div>
|
|
|
- <div class="btn-box" style="text-align: center">
|
|
|
- <div class="btn btn1" @click="() => openModal(false, { id: avePressLinkage.id })">控制密码修改</div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </ventBox1>
|
|
|
+ </div>
|
|
|
+ <div class="btn-box flex" style="text-align: center">
|
|
|
+ <div class="btn btn1 flex-1" @click="editSettingForm">{{ settingFormDisabled ? '编辑' : '取消' }}</div>
|
|
|
+ <div class="btn btn1 flex-1" @click="submitSettingForm">提交</div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </ventBox1>
|
|
|
+ </Transition>
|
|
|
+ <Transition enter-active-class="animate__animated animate__fadeInLeft" leave-active-class="animate__animated animate__fadeOutLeft">
|
|
|
+ <ventBox1 v-if="showModules" class="mt-10px">
|
|
|
+ <template #title>
|
|
|
+ <div>均压工作面联动控制</div>
|
|
|
+ </template>
|
|
|
+ <template #container>
|
|
|
+ <div class="vent-flex-row-between auto-control mt-10px mb-10px">
|
|
|
+ <div class="title">风门与风门自动调节:</div>
|
|
|
+ <a-radio-group :value="gateLinkage.isAuto" name="radioGroup" @change="changeIsAuto($event, gateLinkage.id)">
|
|
|
+ <a-radio :value="false">关闭</a-radio>
|
|
|
+ <a-radio :value="true">开启</a-radio>
|
|
|
+ </a-radio-group>
|
|
|
+ <div class="btn btn1" @click="() => openModal(false, { id: gateLinkage.id })">密码修改</div>
|
|
|
+ </div>
|
|
|
+ <div class="vent-flex-row-between auto-control mt-10px mb-10px">
|
|
|
+ <div class="title">风机与风门自动调节:</div>
|
|
|
+ <a-radio-group :value="avePressLinkage.isAuto" name="radioGroup" @change="changeIsAuto($event, avePressLinkage.id)">
|
|
|
+ <a-radio :value="false">关闭</a-radio>
|
|
|
+ <a-radio :value="true">开启</a-radio>
|
|
|
+ </a-radio-group>
|
|
|
+ <div class="btn btn1" @click="() => openModal(false, { id: avePressLinkage.id })">密码修改</div>
|
|
|
+ </div>
|
|
|
+ <!-- <div class="btn-box" style="text-align: center">
|
|
|
+ </div> -->
|
|
|
+ </template>
|
|
|
+ </ventBox1>
|
|
|
+ </Transition>
|
|
|
</div>
|
|
|
+
|
|
|
<ModuleCommon
|
|
|
- v-for="cfg in configs"
|
|
|
- :key="cfg.deviceType"
|
|
|
+ v-for="(cfg, index) in configs"
|
|
|
+ :key="`svvmbcb${index}`"
|
|
|
:show-style="cfg.showStyle"
|
|
|
:module-data="cfg.moduleData"
|
|
|
:module-name="cfg.moduleName"
|
|
|
:device-type="cfg.deviceType"
|
|
|
:data="selectData"
|
|
|
- :visible="true"
|
|
|
+ :visible="showModules"
|
|
|
/>
|
|
|
</div>
|
|
|
<PasswordModal :modal-is-show="modalVisible" modal-title="提交" @handle-ok="handleResolve" @handle-cancel="handleReject" />
|
|
|
<UpdatePassword @register="updatePwdRegister" @submit="handleChangePassword" />
|
|
|
- <BasicModal title="风门状态监测" :mask="false" :bodyStyle="{ height: '50px' }" style="top: 20px" :show-ok-btn="false" @register="warnRegister2">
|
|
|
+ <!-- <BasicModal title="风门状态监测" :mask="false" :bodyStyle="{ height: '50px' }" style="top: 20px" :show-ok-btn="false" @register="warnRegister2">
|
|
|
{{ warnModalText2 }}
|
|
|
</BasicModal>
|
|
|
<BasicModal
|
|
@@ -113,22 +107,25 @@
|
|
|
</BasicModal>
|
|
|
<BasicModal title="局扇状态监测" :mask="false" :bodyStyle="{ height: '50px' }" style="top: 420px" :show-ok-btn="false" @register="warnRegister3">
|
|
|
{{ warnModalText3 }}
|
|
|
- </BasicModal>
|
|
|
+ </BasicModal> -->
|
|
|
+
|
|
|
+ <div class="switch-button icon-goto right-10px top-70px" :class="{ 'right-390px': showModules }" @click="showModules = !showModules"></div>
|
|
|
+ <!-- <div v-else class="switch-button icon-goto right-10px top-70px" @click="showModules = true"></div> -->
|
|
|
</a-spin>
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
- import { ref, onMounted, onUnmounted, defineProps } from 'vue';
|
|
|
+ import { ref, onMounted, onUnmounted, defineProps, h } from 'vue';
|
|
|
import { mountedThree, destroy, setModelType, updateText, play } from '../balancePress.threejs';
|
|
|
import { list } from '../balancePress.api';
|
|
|
import ModuleCommon from '../../../home/configurable/components/ModuleCommon.vue';
|
|
|
import { useInitConfigs } from '../../../home/configurable/hooks/useInit';
|
|
|
import { useGlobSetting } from '/@/hooks/setting';
|
|
|
import { settingParam4 } from '../balancePress.data';
|
|
|
- import { notification } from 'ant-design-vue';
|
|
|
+ import { Modal } from 'ant-design-vue';
|
|
|
import ventBox1 from '/@/components/vent/ventBox1.vue';
|
|
|
import PasswordModal from '../../comment/components/PasswordModal.vue';
|
|
|
import UpdatePassword from '../../comment/components/UpdatePassword.vue';
|
|
|
- import { BasicModal, useModal } from '/@/components/Modal';
|
|
|
+ import { useModal } from '/@/components/Modal';
|
|
|
import { connectWebSocket, onWebSocket } from '/@/hooks/web/useWebSocket';
|
|
|
import { getToken } from '/@/utils/auth';
|
|
|
import { useUserStore } from '/@/store/modules/user';
|
|
@@ -145,6 +142,7 @@
|
|
|
const { sysOrgCode } = useGlobSetting();
|
|
|
|
|
|
const loading = ref(false);
|
|
|
+ const showModules = ref(true);
|
|
|
|
|
|
// 监测数据
|
|
|
const selectData = ref();
|
|
@@ -216,17 +214,24 @@
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- const { avePressSetting, avePressLinkage, gateLinkage, formData, getAvePress, changePassword, linkageControl, settingControl, autoControl } =
|
|
|
- usePressControl();
|
|
|
+ const {
|
|
|
+ avePressSetting,
|
|
|
+ avePressLinkage,
|
|
|
+ gateLinkage,
|
|
|
+ formData,
|
|
|
+ getAvePress,
|
|
|
+ changePassword,
|
|
|
+ linkageControl,
|
|
|
+ settingControl,
|
|
|
+ autoControl,
|
|
|
+ cancelControl,
|
|
|
+ } = usePressControl();
|
|
|
|
|
|
const modalVisible = ref(false);
|
|
|
|
|
|
const { configs, fetchConfigs } = useInitConfigs();
|
|
|
|
|
|
const [updatePwdRegister, { openModal, closeModal, setModalProps }] = useModal();
|
|
|
- const [warnRegister1, warnModal1] = useModal();
|
|
|
- const [warnRegister2, warnModal2] = useModal();
|
|
|
- const [warnRegister3, warnModal3] = useModal();
|
|
|
|
|
|
function handleChangePassword(values) {
|
|
|
setModalProps({ confirmLoading: true });
|
|
@@ -250,14 +255,14 @@
|
|
|
});
|
|
|
};
|
|
|
}
|
|
|
- function changeIsAutoControl({ target }) {
|
|
|
- formData.value.isAutoControl = target.value;
|
|
|
+ function changeAvePressState({ target }, key) {
|
|
|
+ formData.value.temp = target.value;
|
|
|
modalVisible.value = true;
|
|
|
resolver = (password) => {
|
|
|
settingControl(
|
|
|
{ password, id: avePressSetting.value.id },
|
|
|
{
|
|
|
- isAutoControl: formData.value.isAutoControl,
|
|
|
+ [key]: formData.value.temp,
|
|
|
}
|
|
|
).finally(() => {
|
|
|
modalVisible.value = false;
|
|
@@ -286,9 +291,15 @@
|
|
|
resolver = null;
|
|
|
}
|
|
|
|
|
|
- const warnModalText1 = ref('');
|
|
|
- const warnModalText2 = ref('');
|
|
|
- const warnModalText3 = ref('');
|
|
|
+ // const [warnRegister1, warnModal1] = useModal();
|
|
|
+ // const [warnRegister2, warnModal2] = useModal();
|
|
|
+ // const [warnRegister3, warnModal3] = useModal();
|
|
|
+ const warnModal1 = ref();
|
|
|
+ const warnModal2 = ref();
|
|
|
+ const warnModal3 = ref();
|
|
|
+ // const warnModalText1 = ref('');
|
|
|
+ // const warnModalText2 = ref('');
|
|
|
+ // const warnModalText3 = ref('');
|
|
|
|
|
|
// 初始化 WebSocket
|
|
|
function initWebSocket() {
|
|
@@ -299,73 +310,88 @@
|
|
|
const url = `${glob.wsUrl?.replace('https://', 'wss://').replace('http://', 'ws://')}/websocket/${userStore.getUserInfo.id}?token=${token}`;
|
|
|
connectWebSocket(url);
|
|
|
onWebSocket((data: any) => {
|
|
|
- if (data.cmd === 'topic') {
|
|
|
- if (data.msgTxt) {
|
|
|
- const { info = '' } = JSON.parse(data.msgTxt);
|
|
|
- if (info.includes('局扇')) {
|
|
|
- warnModalText3.value = info;
|
|
|
- warnModal3.openModal();
|
|
|
- }
|
|
|
- if (info.includes('风门')) {
|
|
|
- warnModalText2.value = info;
|
|
|
- warnModal2.openModal();
|
|
|
- }
|
|
|
- if (info.includes('压差')) {
|
|
|
- warnModalText1.value = info;
|
|
|
- warnModal1.openModal();
|
|
|
- }
|
|
|
- }
|
|
|
+ if (data.cmd !== 'topic' || data.topic !== 'warn') return;
|
|
|
+ if (!data.msgTxt) return;
|
|
|
+
|
|
|
+ const { info = '', type = '', avgPressLogId, date } = JSON.parse(data.msgTxt);
|
|
|
+ switch (type) {
|
|
|
+ case 'o2':
|
|
|
+ if (warnModal1.value) break;
|
|
|
+ warnModal1.value = Modal.confirm({
|
|
|
+ title: data.msgTitle,
|
|
|
+ content: h('div', { style: { color: '#fff' } }, [h('p', date), h('p', info)]),
|
|
|
+ centered: true,
|
|
|
+ okText: '下发调节指令',
|
|
|
+ mask: true,
|
|
|
+ class: 'balancePress',
|
|
|
+ async onOk() {
|
|
|
+ await autoControl(avgPressLogId);
|
|
|
+ warnModal1.value = null;
|
|
|
+ },
|
|
|
+ async onCancel() {
|
|
|
+ await cancelControl(avgPressLogId);
|
|
|
+ warnModal1.value = null;
|
|
|
+ },
|
|
|
+ });
|
|
|
+ // warnModalText1.value = info;
|
|
|
+ // warnModal1.openModal();
|
|
|
+
|
|
|
+ break;
|
|
|
+ case 'pressure':
|
|
|
+ // warnModalText1.value = info;
|
|
|
+ // warnModal1.openModal();
|
|
|
+ if (warnModal1.value) break;
|
|
|
+ warnModal1.value = Modal.confirm({
|
|
|
+ title: data.msgTitle,
|
|
|
+ content: h('div', { style: { color: '#fff' } }, [h('p', date), h('p', info)]),
|
|
|
+ centered: true,
|
|
|
+ okText: '下发调节指令',
|
|
|
+ mask: true,
|
|
|
+ class: 'balancePress',
|
|
|
+ async onOk() {
|
|
|
+ await autoControl(avgPressLogId);
|
|
|
+ warnModal1.value = null;
|
|
|
+ },
|
|
|
+ async onCancel() {
|
|
|
+ await cancelControl(avgPressLogId);
|
|
|
+ warnModal1.value = null;
|
|
|
+ },
|
|
|
+ });
|
|
|
+
|
|
|
+ break;
|
|
|
+ case 'gate':
|
|
|
+ if (warnModal2.value) break;
|
|
|
+ warnModal2.value = Modal.warn({
|
|
|
+ title: data.msgTitle,
|
|
|
+ content: info,
|
|
|
+ showOkBtn: false,
|
|
|
+ mask: true,
|
|
|
+ class: 'balancePress',
|
|
|
+ onOk: () => {
|
|
|
+ warnModal2.value = null;
|
|
|
+ },
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case 'fansys':
|
|
|
+ if (warnModal3.value) break;
|
|
|
+ warnModal3.value = Modal.warn({
|
|
|
+ title: data.msgTitle,
|
|
|
+ content: info,
|
|
|
+ showOkBtn: false,
|
|
|
+ mask: true,
|
|
|
+ class: 'balancePress',
|
|
|
+ style: 'top: 700px',
|
|
|
+ onOk: () => {
|
|
|
+ warnModal3.value = null;
|
|
|
+ },
|
|
|
+ });
|
|
|
+
|
|
|
+ break;
|
|
|
+
|
|
|
+ default:
|
|
|
+ break;
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
- // setInterval(() => {
|
|
|
- // const data = [
|
|
|
- // {
|
|
|
- // cmd: 'topic',
|
|
|
- // msgTxt: `{"info":"局扇-我是局扇啊!"}`,
|
|
|
- // },
|
|
|
- // {
|
|
|
- // cmd: 'topic',
|
|
|
- // msgTxt: `{"info":"压差-我是压差啊!"}`,
|
|
|
- // },
|
|
|
- // {
|
|
|
- // cmd: 'topic',
|
|
|
- // msgTxt: `{"info":"风门-我是风门啊!"}`,
|
|
|
- // },
|
|
|
- // ][(Math.random() * 3) | 0];
|
|
|
- // if (data.cmd === 'topic') {
|
|
|
- // if (data.msgTxt) {
|
|
|
- // const { info = '' } = JSON.parse(data.msgTxt);
|
|
|
- // if (info.includes('局扇')) {
|
|
|
- // warnModalText3.value = info;
|
|
|
- // warnModal3.openModal();
|
|
|
- // // notification.warn({
|
|
|
- // // description: info,
|
|
|
- // // message: '警报!',
|
|
|
- // // duration: 0,
|
|
|
- // // });
|
|
|
- // }
|
|
|
- // if (info.includes('风门')) {
|
|
|
- // warnModalText2.value = info;
|
|
|
- // warnModal2.openModal();
|
|
|
- // // notification.warn({
|
|
|
- // // description: info,
|
|
|
- // // message: '警报!',
|
|
|
- // // duration: 0,
|
|
|
- // // });
|
|
|
- // }
|
|
|
- // if (info.includes('压差')) {
|
|
|
- // warnModalText1.value = info;
|
|
|
- // warnModal1.openModal();
|
|
|
- // // notification.warn({
|
|
|
- // // description: info,
|
|
|
- // // message: '警报!',
|
|
|
- // // duration: 0,
|
|
|
- // // });
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }, 5000);
|
|
|
}
|
|
|
|
|
|
const settingFormDisabled = ref(true);
|
|
@@ -409,4 +435,33 @@
|
|
|
.monitor-container {
|
|
|
margin-top: 60px;
|
|
|
}
|
|
|
+
|
|
|
+ .switch-button {
|
|
|
+ width: 34px;
|
|
|
+ height: 34px;
|
|
|
+ position: fixed;
|
|
|
+ // right: 5px;
|
|
|
+ // bottom: 300px;
|
|
|
+ z-index: 1000;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ pointer-events: auto;
|
|
|
+ transition: right 1s;
|
|
|
+ }
|
|
|
+ .icon-goto {
|
|
|
+ --image-monitor-goto: url('/@/assets/images/company/monitor-goto.png');
|
|
|
+ background-image: var(--image-monitor-goto);
|
|
|
+ }
|
|
|
+
|
|
|
+ .divider-line {
|
|
|
+ border-bottom: 1px solid white;
|
|
|
+ }
|
|
|
+</style>
|
|
|
+<style>
|
|
|
+ /* .balancePress .zxm-modal-confirm-title {
|
|
|
+ font-size: 20px;
|
|
|
+ } */
|
|
|
+ .balancePress .zxm-modal-confirm-content {
|
|
|
+ font-size: 22px;
|
|
|
+ }
|
|
|
</style>
|