|
@@ -25,10 +25,11 @@
|
|
|
<div class="button-box" @click="playAnimation('后窗1面积设置', 'frontSetValue3')">后窗1面积</div>
|
|
|
<div class="button-box" @click="playAnimation('后窗2面积设置', 'frontSetValue4')">后窗2面积</div>
|
|
|
</div>
|
|
|
-
|
|
|
+ <div v-if="hasPermission('window:ldkz')" class="button-box" @click="playAnimation('风窗自主调控', 'ldkz')">风窗自主调控</div>
|
|
|
+ <div v-if="hasPermission('window:sameSet')" class="button-box" @click="playAnimation('风窗面积设置', 'sameSetValue')">设定风窗面积</div>
|
|
|
<div class="row" v-if="Number(selectData.nwindownum) == 1">
|
|
|
- <div v-if="hasPermission('window:AreaControl')" class="button-box" @click="setArea(1)">设定风窗面积</div>
|
|
|
- <div v-if="hasPermission('window:showAngle')" class="button-box" @click="setAngle(1)">设定风窗角度</div>
|
|
|
+ <div v-if="hasPermission('window:AreaControl')" class="button-box" @click="playAnimation('设定风窗面积', 'frontSetValue')">设定风窗面积</div>
|
|
|
+ <div v-if="hasPermission('window:showAngle')" class="button-box" @click="playAnimation('设定风窗角度', 'frontSetValue')">设定风窗角度</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</div>
|
|
@@ -215,11 +216,18 @@
|
|
|
@handle-ok="handleOK"
|
|
|
@handle-cancel="handleCancel"
|
|
|
/>
|
|
|
+ <SupplyAir
|
|
|
+ :data="currentData"
|
|
|
+ :targetVolume="targetVolume"
|
|
|
+ :modal-is-show="showTargetModal"
|
|
|
+ :modalType="modalType"
|
|
|
+ @handle-cancel="() => (showTargetModal = false)"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { ref, onMounted, onUnmounted, ComponentOptions, shallowRef, reactive, defineProps, watch, nextTick,unref } from 'vue';
|
|
|
+import { ref, onMounted, onUnmounted, ComponentOptions, shallowRef, reactive, defineProps, watch, toRaw, nextTick,unref, inject } from 'vue';
|
|
|
import { list, getDeviceList, getDepartmentInfo } from './device.api';
|
|
|
import AlarmHistoryTable from '../comment/AlarmHistoryTable.vue';
|
|
|
import HistoryTable from '../comment/HistoryTable.vue';
|
|
@@ -240,12 +248,12 @@ import {
|
|
|
} from './device.data';
|
|
|
import { getDictItemsByCode } from '/@/utils/dict';
|
|
|
import BarAndLine from '/@/components/chart/BarAndLine.vue';
|
|
|
-import { useMethods } from '/@/hooks/system/useMethods';
|
|
|
-import { useGo } from '/@/hooks/web/usePage';
|
|
|
import { useGlobSetting } from '/@/hooks/setting';
|
|
|
import { useCamera } from '/@/hooks/system/useCamera';
|
|
|
import { usePermission } from '/@/hooks/web/usePermission';
|
|
|
import { deviceControlApi } from '/@/api/vent/index';
|
|
|
+import SupplyAir from '../windowMonitor/components/supplyAir.vue';
|
|
|
+import { updateWindowAutoAdjustStatus } from '../windowMonitor/window.api';
|
|
|
|
|
|
type DeviceType = { deviceType: string; deviceName: string; datalist: any[] };
|
|
|
const glob = useGlobSetting();
|
|
@@ -268,6 +276,23 @@ const echatsOption = {
|
|
|
feature: {},
|
|
|
},
|
|
|
};
|
|
|
+const initData = {
|
|
|
+ deviceID: '',
|
|
|
+ deviceType: '',
|
|
|
+ strname: '',
|
|
|
+ dataDh: '-', //压差
|
|
|
+ dataDtestq: '-', //测试风量
|
|
|
+ sourcePressure: '-', //气源压力
|
|
|
+ dataDequivalarea: '-',
|
|
|
+ netStatus: '0', //通信状态
|
|
|
+ fault: '气源压力超限',
|
|
|
+ forntArea: '0',
|
|
|
+ rearArea: '0',
|
|
|
+ frontRearDifference: '-',
|
|
|
+ rearPresentValue: '-',
|
|
|
+ maxarea: 0,
|
|
|
+ nwindownum: 0,
|
|
|
+};
|
|
|
const { hasPermission } = usePermission();
|
|
|
const { getCamera, removeCamera, getPlayer } = useCamera();
|
|
|
const playerRef = ref()
|
|
@@ -289,16 +314,20 @@ const deviceActive = ref('');
|
|
|
const activeKey = ref('1'); // tab key
|
|
|
const dataSource = shallowRef([]); // 实时监测数据
|
|
|
const selectData = ref({})
|
|
|
+const currentData = ref(initData);
|
|
|
const majorPathEchartsData = ref({}); // 关键路线echarts数据
|
|
|
const surfaceEchartsData = ref<any[]>(); // 工作面历史记录,echarts数据
|
|
|
const activeID = ref(''); // 打开详情modal时监测的设备id
|
|
|
const deviceType = ref(''); // 监测设备类型
|
|
|
const selectRowIndex = ref(-1)
|
|
|
const systemID = ref(''); // 系统监测时,系统id
|
|
|
-const cameraAddrs = ref([])
|
|
|
+const cameraAddrs = ref([]);
|
|
|
+const targetVolume = ref(0);
|
|
|
+const showTargetModal = ref(false);
|
|
|
const scroll = reactive({
|
|
|
y: 180,
|
|
|
});
|
|
|
+const globalConfig = inject('globalConfig');
|
|
|
let departmentInfo: Null | Object = null;
|
|
|
function tabChange(activeKeyVal) {
|
|
|
activeKey.value = activeKeyVal;
|
|
@@ -313,7 +342,8 @@ function getMonitor(flag?) {
|
|
|
if (Object.prototype.toString.call(timer) === '[object Null]') {
|
|
|
timer = setTimeout(
|
|
|
async () => {
|
|
|
- await getDataSource();
|
|
|
+ const data = await getDataSource();
|
|
|
+ currentData.value = data
|
|
|
if (timer) {
|
|
|
getMonitor();
|
|
|
}
|
|
@@ -334,6 +364,7 @@ async function getDataSource() {
|
|
|
const readData = data.readData;
|
|
|
return Object.assign(data, readData);
|
|
|
});
|
|
|
+
|
|
|
if (item.type != 'sys') {
|
|
|
if (item.type === 'majorpath') {
|
|
|
deviceArr.unshift({ deviceType: item.type, deviceName: item['typeName'], datalist: item['datalist'][0]['paths'] });
|
|
@@ -482,6 +513,8 @@ async function getDataSource() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ const data: any = toRaw(dataSource.value[selectRowIndex.value]); //maxarea
|
|
|
+ return data;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -521,6 +554,7 @@ async function getSelectRow(selectRow, index) {
|
|
|
if (!selectRow) return;
|
|
|
selectRowIndex.value = index;
|
|
|
selectData.value = selectRow;
|
|
|
+
|
|
|
cameraAddrs.value = await getCamera(selectRow.deviceID, playerRef.value, null, true);
|
|
|
if(cameraAddrs.value && cameraAddrs.value.length > 0){
|
|
|
nextTick(async() => {
|
|
@@ -553,29 +587,77 @@ const playAnimation = (title, flag) => {
|
|
|
modalTitle.value = title;
|
|
|
modalIsShow.value = true;
|
|
|
};
|
|
|
-const handleOK = (passWord, handlerState, value) => {
|
|
|
+const handleOK = async(passWord, handlerState, value) => {
|
|
|
if (!passWord && !globalConfig?.simulatedPassword) {
|
|
|
message.warning('请输入密码!');
|
|
|
return;
|
|
|
}
|
|
|
- let data = {
|
|
|
- deviceid: selectData.value.deviceID,
|
|
|
- devicetype: selectData.value.deviceType,
|
|
|
- paramcode: handlerState,
|
|
|
- password: passWord || globalConfig?.simulatedPassword,
|
|
|
- value: value ? value : null,
|
|
|
- };
|
|
|
- deviceControlApi(data)
|
|
|
- .then((res) => {
|
|
|
+
|
|
|
+ if (handlerState == 'sameSetValue') {
|
|
|
+ const data1 = {
|
|
|
+ deviceid: selectData.value.deviceID,
|
|
|
+ devicetype: selectData.value.deviceType,
|
|
|
+ paramcode: 'frontSetValue',
|
|
|
+ password: passWord || globalConfig?.simulatedPassword,
|
|
|
+ value: value ? value : null,
|
|
|
+ };
|
|
|
+ const data2 = {
|
|
|
+ deviceid: selectData.value.deviceID,
|
|
|
+ devicetype: selectData.value.deviceType,
|
|
|
+ paramcode: 'rearSetValue',
|
|
|
+ password: passWord || globalConfig?.simulatedPassword,
|
|
|
+ value: value ? value : null,
|
|
|
+ };
|
|
|
+ const res1 = await deviceControlApi(data1);
|
|
|
+ const res2 = await deviceControlApi(data2);
|
|
|
+ if (res1.success && res2.success) {
|
|
|
+ message.success('指令已下发成功!');
|
|
|
+ } else {
|
|
|
+ message.error(res1.message);
|
|
|
+ }
|
|
|
+ handleCancel();
|
|
|
+ }else if(handlerState == 'ldkz') {
|
|
|
+ const params = {
|
|
|
+ windowId: selectData.value.deviceID,
|
|
|
+ auto: 1,
|
|
|
+ fengliangF: value,
|
|
|
+ };
|
|
|
+ updateWindowAutoAdjustStatus(params).then((res) => {
|
|
|
if (res.success) {
|
|
|
- message.success('指令已下发成功!');
|
|
|
+ if (globalConfig.History_Type == 'remote') {
|
|
|
+ message.success('指令已下发至生产管控平台成功!');
|
|
|
+ } else {
|
|
|
+ message.success('指令已下发成功!');
|
|
|
+ }
|
|
|
+ handleCancel();
|
|
|
+ targetVolume.value = value;
|
|
|
+ showTargetModal.value = true;
|
|
|
} else {
|
|
|
message.error(res.message);
|
|
|
}
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- handleCancel();
|
|
|
});
|
|
|
+ return;
|
|
|
+ } else{
|
|
|
+ let data = {
|
|
|
+ deviceid: selectData.value.deviceID,
|
|
|
+ devicetype: selectData.value.deviceType,
|
|
|
+ paramcode: handlerState,
|
|
|
+ password: passWord || globalConfig?.simulatedPassword,
|
|
|
+ value: value ? value : null,
|
|
|
+ };
|
|
|
+ deviceControlApi(data)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ message.success('指令已下发成功!');
|
|
|
+ } else {
|
|
|
+ message.error(res.message);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ handleCancel();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
};
|
|
|
|
|
|
const handleCancel = () => {
|