Commit 76026122 authored by 张伯涛's avatar 张伯涛

一键启停

parent 68dd4f5b
......@@ -41,7 +41,7 @@ AIapi.interceptors.response.use((res) => {
closeLoading();
let httpMessage = '';
if (error.response) {
// alert('1')
alert('1')
if (error.response.status == '401') {
if (error.response.data && error.response.data.status == 401) {
if (!localStorage.getItem('user')) {
......
import httpTwo from '../httpTwo'
// 查询一键启停状态
export const selectOneStartStop = params => {
return httpTwo.get(`/busVoiceCommands/selectOneStartStop?stationId=` + params.stationId + '&unitId=' + params.unitId)
}
......@@ -552,6 +552,14 @@ const routes = [
title: "语音指令部署位置",
},
},
{
path: "/Remote/OnekeyStartStop",
name: "OnekeyStartStop",
component: () => import("@/views/RemotePage/OnekeyStartStopPage.vue"),
meta: {
title: "一键启停",
},
},
],
},
{
......
<template>
<div v-if="isLoading" class="loading-overlay">
<div class="loading-spinner"></div>
<p> 命令执行中,请稍后......</p>
<p v-show="isStop">倒计时{{countDown}}</p>
</div>
<el-dialog v-model="dialogFormVisible" width="30%" title="请选择进行一键启动的循环泵:" center>
<div style="display: flex;justify-content: center;align-items: center; height: 150px;">
<el-button type="primary" :loading="isLoading" @click="OneKeyStart(1)" style="margin-right: 50px;">一号循环泵</el-button>
<el-button type="primary" :loading="isLoading" @click="OneKeyStart(2)">二号循环泵</el-button>
</div>
</el-dialog>
<el-card class="remoteTitle">
<div class="card-content">
<div style="">
换热站机组:
<el-cascader
:options="options"
v-model="transferId"
filterable
:props="props"
collapse-tags
clearable
:show-all-levels="false"
placeholder="请选择换热站机组"
style="min-width: 260px;"
@update:modelValue="onValueChange"/>
<!-- &nbsp;&nbsp;&nbsp;&nbsp;水箱液位最低量程:-->
<!-- <el-input v-model="limit" v-text="limit" style="width: 150px;" v-float-number></el-input>(米)-->
</div>
<!-- <div class="demo-button">-->
<!-- <el-button type="primary" :loading="isLoading" @click="TransferOpen" >一键启动</el-button>-->
<!-- <el-button type="primary" :loading="isLoading" @click="TransferClose" >一键停止</el-button>-->
<!-- </div>-->
</div>
</el-card>
<div style="display: flex; align-items: center;">
<div :style="{height: clientHeight}" style="margin: 20px 60px; width: 50%;">
<div style="font-size: 16pt; font-weight: 500;color: blue; height: 50px;">
一键启动:
</div>
<el-steps
direction="vertical"
:active="activeStep"
finish-status="success"
:align-center="true">
<el-step v-for="(step, index) in startPercent"
:key="step.index"
:title="step.title">
<template #description>
<div style="display: flex; justify-content: left; align-items: center; height: 70px; width: 100%;">
<div :style="{color: step.color}" style="font-size: 16pt; font-weight: 500; height: 50px;display: flex; align-items: center;">
<img :src="step.icon" width="40px" height="40px" style="margin-right: 20px;"/>
{{ step.description }}
</div>
<div class="checkmark">
<span :class="{ 'show-checkmark': step.isCompleted }" class="checkmark"></span>
</div>
</div>
</template>
</el-step>
</el-steps>
</div>
<div :style="{height: clientHeight}" style="margin: 20px 40px; width: 50%;">
<div style="font-size: 16pt; font-weight: 500;color: blue; height: 50px;">
一键停止:
</div>
<el-steps
direction="vertical"
:active="activeCloseStep"
finish-status="success"
:align-center="true">
<el-step v-for="(step, index) in stopPercent"
:key="step.index"
:title="step.title">
<template #description>
<div style="display: flex; justify-content: left; align-items: center; height: 70px; width: 100%;">
<div :style="{color: step.color}" style="font-size: 16pt; font-weight: 500; height: 50px;display: flex; align-items: center;">
<img :src="step.icon" width="40px" height="40px" style="margin-right: 20px;"/>
{{ step.description }}
</div>
<div class="checkmark">
<span :class="{ 'show-checkmark': step.isCompleted }" class="checkmark"></span>
</div>
</div>
</template>
</el-step>
</el-steps>
</div>
</div>
</template>
<script lang="ts" setup>
import { ref, reactive, onMounted, onUnmounted,computed,watch,onBeforeUnmount } from 'vue'
import store from "../../store/index";
import http from "../../api/http";
import { ElMessage,ElMessageBox } from "element-plus";
import { vFloatNumber } from "../../utils/directives.js";
import { fa } from 'element-plus/es/locale';
import ExtinguisherNewDataPage from "../AIStation/ExtinguisherPage/ExtinguisherNewDataPage.vue";
import {useRoute} from "vue-router";
import {selectOneStartStop} from '../../api/oneKeyStartStop/index.js'
import {getAlarmNumData} from "../../api/AIStation/Extinguisher";
const enterpriseId = ref(null);
const isLoading= ref(false);
const activeStep = ref(-1);
const activeCloseStep = ref(-1);
const clientHeight = ref("500px");
const options = reactive([]);
const transferId = ref(null);
const limit = ref(0);
const dialogFormVisible = ref(false);
const isSingle = ref(false);
const countDown = ref(120);
const props = { multiple: false, emitPath: false }
const isRunning = ref(false);
const isStop = ref(false);
var startPercent = reactive(new Array({
index: 0,
icon: new URL('/imgs/oneKey/ElectricSwitch.png', import.meta.url).href,
title: "步骤一: 电源合闸",
description:"供热设备总断路器状态",
enName: "CircuitBreakerOpenGate",
value: false,
color: "rgb(127 127 127)",
isCompleted: true
}, {
index: 1,
icon: new URL('/imgs/oneKey/PowerTransmission.png', import.meta.url).href,
title: "步骤二: 送电状态",
description:"循环泵、补水泵变频器已送电且三相电压平衡无缺相",
enName: "CircuitBreakerOpenGate",
value: false,
color: "rgb(127 127 127)",
isCompleted: false
}, {
index: 2,
icon: new URL('/imgs/oneKey/Overheated.png', import.meta.url).href,
title: "步骤三: 过热状态",
description:"判断配电柜内器件、线缆、接头等不存在过热等情况",
enName: "CircuitBreakerOpenGate",
value: false,
color: "rgb(127 127 127)",
isCompleted: false
}, {
index: 3,
icon: new URL('/imgs/oneKey/WaterLimit.png', import.meta.url).href,
title: "步骤四: 水箱状态",
description:"判断换热站水箱水位达到“满箱”状态",
enName: "CircuitBreakerOpenGate",
value: false,
color: "rgb(127 127 127)",
isCompleted: false
},{
index: 4,
icon: new URL('/imgs/oneKey/ReplenishmentPump.png', import.meta.url).href,
title: "步骤五: 补水泵状态",
description:"补水泵未处于“故障”状态",
enName: "CircuitBreakerOpenGate",
value: false,
color: "rgb(127 127 127)",
isCompleted: false
},{
index: 5,
icon: new URL('/imgs/oneKey/CirculatingPump.png', import.meta.url).href,
title: "步骤六: 循环泵状态",
description:"循环泵未处于“故障”状态",
enName: "CircuitBreakerOpenGate",
value: false,
color: "rgb(127 127 127)",
isCompleted: false
},{
index: 6,
icon: new URL('/imgs/oneKey/Value.png', import.meta.url).href,
title: "步骤七: 阀门状态",
description:"根据卡片机判断阀门为开启状态",
enName: "CircuitBreakerOpenGate",
value: false,
color: " rgb(127 127 127)",//"rgb(176 63 63)",
isCompleted: false
},{
index: 7,
icon: new URL('/imgs/oneKey/OnekeyStart.png', import.meta.url).href,
title: "步骤八: 一键启动投入",
description:"换热站一键启动投入",
enName: "CircuitBreakerOpenGate",
value: false,
color: "rgb(127 127 127)",
isCompleted: false
}));
const stopPercent = ref(new Array({
index: 0,
icon: new URL('/imgs/oneKey/ReplenishmentPump.png', import.meta.url).href,
title: "步骤一: 关闭补水泵",
description:"关闭换热站补水泵",
color: "rgb(127 127 127)",
isCompleted: true
}, {
index: 1,
icon: new URL('/imgs/oneKey/CirculatingPump.png', import.meta.url).href,
title: "步骤二: 关闭循环泵",
description:"关闭换热站循环泵",
value: false,
color: "rgb(127 127 127)",
isCompleted: false
}, {
index: 2,
icon: new URL('/imgs/oneKey/ElectricValue.png', import.meta.url).href,
title: "步骤三: 关闭一次供水电动阀",
description:"一次网供水电动阀关到位",
value: false,
color: "rgb(127 127 127)",
isCompleted: false
}, {
index: 3,
icon: new URL('/imgs/oneKey/ElectricValue.png', import.meta.url).href,
title: "步骤四: 关闭一次回水电动阀",
description:"一次网回水电动阀关到位",
value: false,
color: "rgb(127 127 127)",
isCompleted: false
},{
index: 4,
icon: new URL('/imgs/oneKey/ElectricValue.png', import.meta.url).href,
title: "步骤五: 关闭二次供水电动阀",
description:"二次网供水电动阀关到位",
value: false,
color: "rgb(127 127 127)",
isCompleted: false
},{
index: 5,
icon: new URL('/imgs/oneKey/ElectricValue.png', import.meta.url).href,
title: "步骤六: 关闭二次回水电动阀",
description:"二次网回水电动阀关到位",
value: false,
color: "rgb(127 127 127)",
isCompleted: false
},{
index: 6,
icon: new URL('/imgs/oneKey/OnekeyStop.png', import.meta.url).href,
title: "步骤七: 一键关闭结束",
description:"换热站一键关闭执行完毕",
value: false,
color: " rgb(127 127 127)",//"rgb(176 63 63)",
isCompleted: false
}));
onMounted(() => {
setContentHeight();
window.addEventListener('resize', setContentHeight);
})
onUnmounted(() => {
window.removeEventListener('resize', setContentHeight);
})
function setContentHeight() {
clientHeight.value = window.innerHeight - 360 + "px";
}
//获取换热机组列表
function getSupplys() {
var result = store.getters.getEnterprise();
enterpriseId.value = store.getters.getEnterpriseId();
if (result) {
result.forEach(element => {
if(element.enterpriseId === enterpriseId.value){
if (element.enterpriseId.toLowerCase() === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()) {
element.serviceCenterList.forEach(center => {
let c = [];
center.supplyList.forEach(supply => {
let chi = [];
supply.transferList.forEach(unit => {
chi.push({ value: unit.unitId, label: unit.unitName,stationId: unit.stationId});
});
c.push({ children: chi, label: supply.supplyName });
});
options.push({ children: c, label: center.serviceCenterName });
})
} else {
element.supplyList.forEach(element => {
let chi = [];
element.transferList.forEach(unit => {
chi.push({ value: unit.unitId, label: unit.unitName,stationId: unit.stationId });
})
options.push({ children: chi, label: element.supplyName });
})
}
}
});
if (options && options.length > 0) {
transferId.value = options[0].children[0].children[0].value;
}
}
}
const onValueChange = (newValue) => {
isSingle.value = true;
var stationId = null;
var count = 0;
var result = store.getters.getEnterprise();
if (result) {
result.forEach(element => {
if(element.enterpriseId === enterpriseId.value){
if (element.enterpriseId.toLowerCase() === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()) {
element.serviceCenterList.forEach(center => {
center.supplyList.forEach(supply => {
supply.transferList.forEach(unit => {
if (unit.unitId === newValue) {
stationId = unit.stationId;
}
});
});
})
} else {
element.supplyList.forEach(element => {
element.transferList.forEach(unit => {
if (unit.unitId === newValue) {
stationId = unit.stationId;
}
})
})
}
}
});
if (stationId === null) {
return;
}
result.forEach(element => {
if(element.enterpriseId === enterpriseId.value){
if (element.enterpriseId.toLowerCase() === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()) {
element.serviceCenterList.forEach(center => {
center.supplyList.forEach(supply => {
supply.transferList.forEach(unit => {
if (unit.unitId !== newValue && unit.stationId === stationId) {
isSingle.value = false;
}
});
});
})
} else {
element.supplyList.forEach(element => {
element.transferList.forEach(unit => {
if (unit.unitId !== newValue && unit.stationId === stationId) {
isSingle.value = false;
}
})
})
}
}
});
}
// if (isSingle.value) {
if (newValue === '9ad563a2-cf55-4ffa-a878-f9c85af106e1') {
stopPercent.value = [{
index: 0,
icon: new URL('/imgs/oneKey/ReplenishmentPump.png', import.meta.url).href,
title: "步骤一: 关闭补水泵",
description:"关闭换热站补水泵",
color: "rgb(127 127 127)",
isCompleted: true
}, {
index: 1,
icon: new URL('/imgs/oneKey/CirculatingPump.png', import.meta.url).href,
title: "步骤二: 关闭循环泵",
description:"关闭换热站循环泵",
value: false,
color: "rgb(127 127 127)",
isCompleted: false
}, {
index: 2,
icon: new URL('/imgs/oneKey/ElectricValue.png', import.meta.url).href,
title: "步骤三: 关闭一次供水电动阀",
description:"一次网供水电动阀关到位",
value: false,
color: "rgb(127 127 127)",
isCompleted: false
}, {
index: 3,
icon: new URL('/imgs/oneKey/ElectricValue.png', import.meta.url).href,
title: "步骤四: 关闭一次回水电动阀",
description:"一次网回水电动阀关到位",
value: false,
color: "rgb(127 127 127)",
isCompleted: false
},{
index: 4,
icon: new URL('/imgs/oneKey/ElectricValue.png', import.meta.url).href,
title: "步骤五: 关闭二次供水电动阀",
description:"二次网供水电动阀关到位",
value: false,
color: "rgb(127 127 127)",
isCompleted: false
},{
index: 5,
icon: new URL('/imgs/oneKey/ElectricValue.png', import.meta.url).href,
title: "步骤六: 关闭二次回水电动阀",
description:"二次网回水电动阀关到位",
value: false,
color: "rgb(127 127 127)",
isCompleted: false
},{
index: 6,
icon: new URL('/imgs/oneKey/OnekeyStop.png', import.meta.url).href,
title: "步骤七: 一键关闭结束",
description:"换热站一键关闭执行完毕",
value: false,
color: " rgb(127 127 127)",//"rgb(176 63 63)",
isCompleted: false
}];
} else {
stopPercent.value = [{
index: 0,
icon: new URL('/imgs/oneKey/ReplenishmentPump.png', import.meta.url).href,
title: "步骤一: 关闭补水泵",
description:"关闭换热站补水泵",
color: "rgb(127 127 127)",
isCompleted: false
}, {
index: 1,
icon: new URL('/imgs/oneKey/CirculatingPump.png', import.meta.url).href,
title: "步骤二: 关闭循环泵",
description:"关闭换热站循环泵",
value: false,
color: "rgb(127 127 127)",
isCompleted: false
}, {
index: 2,
icon: new URL('/imgs/oneKey/ElectricValue.png', import.meta.url).href,
title: "步骤三: 关闭二次供水电动阀",
description:"二次网供水电动阀关到位",
value: false,
color: "rgb(127 127 127)",
isCompleted: false
},{
index: 3,
icon: new URL('/imgs/oneKey/ElectricValue.png', import.meta.url).href,
title: "步骤四: 关闭二次回水电动阀",
description:"二次网回水电动阀关到位",
value: false,
color: "rgb(127 127 127)",
isCompleted: false
},{
index: 4,
icon: new URL('/imgs/oneKey/OnekeyStop.png', import.meta.url).href,
title: "步骤五: 一键关闭结束",
description:"换热站一键关闭执行完毕",
value: false,
color: " rgb(127 127 127)",
isCompleted: false
}];
}
};
async function TransferOpen() {
isLoading.value = true;
isStop.value = false;
try {
startPercent.forEach(item => {
item.color = "rgb(127,127,127)";
});
if (!transferId || transferId === null) {
ElMessage.error("请选择要一键启动的换热站机组!");
return;
}
if (!limit) {
ElMessage.error("请输入水箱液位量程后才能对换热站机组进行一键启动操作!");
return;
}
if (limit.value <= 0) {
ElMessage.error("请输入正确的水箱液位量程!");
return;
}
activeStep.value = -1;
var result = await http.post("api/remote/OnekeyControl/GetTransferStatus", transferId.value);
//console.log(result);
if (result) {
if (!result.success) {
ElMessage.error(result.message);
return;
}
var data = result.data[0];
if (data.aiSendOnekeyStartStop) {
ElMessage.error(data.transferName + "平台已下发一键启停命令!");
return;
}
if (data.firstReplenishmentPump || data.secondReplenishmentPump || data.oneCirculatingPump || data.twoCirculatingPump) {
ElMessage.error(data.transferName + " 循环泵或补水泵已启动,无法执行一键启动命令!");
return;
}
activeStep.value = 0;
if (data.circuitBreakerSwitchOnStatus) {
ElMessage.error(result.data.transferName + " 供热设备总断路器非合闸状态,一键启动失败!");
startPercent[0].color = "rgb(176 63 63)";
return;
}
await new Promise(resolve => setTimeout(resolve, 1000));
activeStep.value = 1;
if (data.circulatingPumpThreeImbalancesAlarm === true || data.replenishmentPumpThreeImbalancesAlarm === true) {
ElMessage.error(data.transferName + " 循环泵、补水泵电表三项不平衡报警,一键启动失败!");
startPercent[1].color = "rgb(176 63 63)";
return;
}
await new Promise(resolve => setTimeout(resolve, 1000));
activeStep.value = 2;
if (data.transferOverheated) {
ElMessage.error(data.transferName + " 内设备过热,一键启动失败!");
startPercent[2].color = "rgb(176 63 63)";
return;
}
await new Promise(resolve => setTimeout(resolve, 1000));
activeStep.value = 3;
if (data.liquidLevel < limit.value) {
ElMessage.error(data.transferName + " 当前水箱液位"+data.liquidLevel+"未达到量程,一键启动失败!");
startPercent[3].color = "rgb(176 63 63)";
return;
}
await new Promise(resolve => setTimeout(resolve, 1000));
activeStep.value = 4;
if (data.oneCirculatingPump === true || data.twoCirculatingPump === true) {
ElMessage.error(data.transferName + " 补水泵故障,一键启动失败!");
startPercent[5].color = "rgb(176 63 63)";
return;
}
await new Promise(resolve => setTimeout(resolve, 1000));
activeStep.value = 5;
if (data.firstCirculatingPumpFault === true || data.secondCirculatingPumpFault === true) {
ElMessage.error(data.transferName + " 循环泵故障,一键启动失败!");
startPercent[5].color = "rgb(176 63 63)";
return;
}
await new Promise(resolve => setTimeout(resolve, 1000));
activeStep.value = 6;
if (data.tabletsValue === false) {
ElMessage.error(data.transferName + " 卡片机读取阀门开启状态异常,一键启动失败!");
startPercent[6].color = "rgb(176 63 63)";
return;
}
await new Promise(resolve => setTimeout(resolve, 1000));
activeStep.value = 7;
dialogFormVisible.value = true;
} else {
ElMessage.error("未获取到一键启动数据");
}
} catch (error) {
ElMessage.error(error.message);
}
finally {
isLoading.value = false;
}
}
function TransferClose() {
activeCloseStep.value = -1;
stopPercent.value.forEach(item => {
item.color = "rgb(127,127,127)";
});
if (!transferId || transferId === null) {
ElMessage.error("请选择要一键停止的换热站机组!");
return;
}
ElMessageBox.confirm(
'一键停止命令需要1-3分钟反馈,确认要一键停止吗?',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'info',
center: true,
draggable: true,
})
.then(async () => {
await OnekeyStop();
})
}
async function OneKeyStart(num) {
dialogFormVisible.value = false;
isLoading.value = true;
try {
var result = await http.post("api/remote/OnekeyControl/WriteStart", { "transferId": transferId.value, "num": num });
if (result) {
if (result.success) {
activeStep.value = 8;
startPercent[7].color = "rgb(103 194 58)";
} else {
startPercent[7].color = "rgb(176 63 63)";
}
ElMessage.success(result.message);
} else {
ElMessage.error("远程服务器连接失败,一键启动未完成!");
}
} catch (error) {
ElMessage.error(error.message);
} finally {
isLoading.value = false;
}
}
async function OnekeyStop(){
try {
isLoading.value = true;
var result = await http.post("api/remote/OnekeyControl/WriteStop", transferId.value);
if (!result) {
ElMessage.error("远程服务器连接异常,一键停止执行失败!");
isLoading.value = false;
return;
}
if (!result.success) {
ElMessage.error(result.message);
isLoading.value = false;
return;
}
isStop.value = true;
countDown.value = 120;
isRunning.value = true;
startCountdown();
}catch (error) {
ElMessage.error(error.message);
isLoading.value = false;
}
}
async function OnekeyStopEnd() {
try {
var result = await http.post("api/remote/OnekeyControl/GetTransferStatus", transferId.value);
if (!result) {
ElMessage.error("远程服务器连接异常,一键停止执行失败!");
return;
}
if (!result.success) {
ElMessage.error(result.message);
return;
}
var data = result.data[0];
activeCloseStep.value = 0;
if (data.firstReplenishmentPump || data.secondReplenishmentPump) {
ElMessage.error(data.transferName + " 补水泵关闭失败!");
stopPercent.value[0].color = "rgb(176 63 63)";
return;
}
await new Promise(resolve => setTimeout(resolve, 1000));
activeCloseStep.value = 1;
if (data.oneCirculatingPump || data.twoCirculatingPump) {
ElMessage.error(data.transferName + " 循环泵关闭失败!");
stopPercent.value[1].color = "rgb(176 63 63)";
return;
}
await new Promise(resolve => setTimeout(resolve, 1000));
var singleIndex = 2;
if (isSingle.value) {
activeCloseStep.value = singleIndex;
if (!data.firstSupplyElectricValveCloseInPlace) {
ElMessage.error(data.transferName + " 一次网供水电动阀关到位失败!");
stopPercent.value[singleIndex].color = "rgb(176 63 63)";
return;
}
await new Promise(resolve => setTimeout(resolve, 1000));
activeCloseStep.value = ++singleIndex;
if (!data.rirstReturnElectricValveCloseInPlace) {
ElMessage.error(data.transferName + " 一次网回水电动阀关到位失败!");
stopPercent.value[singleIndex].color = "rgb(176 63 63)";
return;
}
await new Promise(resolve => setTimeout(resolve, 1000));
}
singleIndex = (isSingle.value ? ++singleIndex : 2);
activeCloseStep.value = singleIndex;
if (!data.secSupplyElectricValveCloseInPlace) {
ElMessage.error(data.transferName + " 二次网供水电动阀关到位失败!");
console.log(singleIndex);
console.log(stopPercent);
stopPercent.value[singleIndex].color = "rgb(176 63 63)";
return;
}
await new Promise(resolve => setTimeout(resolve, 1000));
activeCloseStep.value = ++singleIndex;
if (!data.secReturnElectricValveCloseInPlace) {
ElMessage.error(data.transferName + " 二次网回水电动阀关到位失败!");
stopPercent.value[singleIndex].color = "rgb(176 63 63)";
return;
}
await new Promise(resolve => setTimeout(resolve, 1000));
stopPercent.value[singleIndex].color = "rgb(103 194 58)";
activeCloseStep.value = ++singleIndex;
ElMessage.success("一键停止执行完毕!");
}catch (error) {
ElMessage.error(error.message);
}
finally {
isLoading.value = false;
isStop.value = false;
}
}
let getStepsParams = {}
// 查询启停进度
function getSteps() {
// console.log('111111111111111111111',transferId.value)
if(transferId.value === '9ad563a2-cf55-4ffa-a878-f9c85af106e1' ) {
getStepsParams = {
unitId: options[0].children[0].children[0].value,
stationId: options[0].children[0].children[0].stationId
}
}else {
getStepsParams = {
unitId: options[0].children[0].children[1].value,
stationId: options[0].children[0].children[1].stationId
}
}
selectOneStartStop(getStepsParams).then(res => {
// 一键启动
if(res.code === 200) {
if(res.data.runStepsFlag === true) {
activeStep.value = res.data.runSteps
}else if( res.data.runStepsFlag === false) {
activeStep.value = res.data.runSteps - 1
startPercent[res.data.runSteps-1].color = "rgb(176 63 63)";
}
// 一键停止
if(res.data.stopStepsFlag === true) {
// 北区 1:1 2:2 3:5 4:6 5:7
if(transferId.value === '34d8847c-489c-4879-bcdd-b69c44d8ca50') {
if(res.data.stopSteps === 1 || res.data.stopSteps === 2) {
activeCloseStep.value = res.data.stopSteps
}else {
activeCloseStep.value = res.data.stopSteps - 2
}
}else {
activeCloseStep.value = res.data.stopSteps
}
}else if( res.data.stopStepsFlag === false) {
// 北区 1:1 2:2 3:5 4:6 5:7
if(transferId.value === '34d8847c-489c-4879-bcdd-b69c44d8ca50') {
if(res.data.stopSteps === 1 || res.data.stopSteps === 2) {
activeCloseStep.value = res.data.stopSteps - 1
stopPercent.value[res.data.stopSteps-1].color = "rgb(176 63 63)";
}else {
activeCloseStep.value = res.data.stopSteps - 3
stopPercent.value[res.data.stopSteps-3].color = "rgb(176 63 63)";
}
}else {
activeCloseStep.value = res.data.stopSteps - 1
stopPercent.value[res.data.stopSteps-1].color = "rgb(176 63 63)";
}
}
}
})
}
let timer;
const startTimer = () => {
timer = setInterval(() => {
if (isRunning.value === true && countDown.value > 0) {
countDown.value--;
} else {
clearInterval(timer);
isRunning.value = false;
}
}, 1000);
};
const startCountdown = () => {
startTimer();
};
onMounted(startCountdown);
watch(isRunning, () => {
if (!isRunning.value) {
clearInterval(timer);
OnekeyStopEnd();
}
});
const route = useRoute()
var timerQuery;
watch(
() => route.path, // 只监听路径变化
() => {
if(route.path === '/Remote/OnekeyStartStop') {
getSupplys();
timerQuery = setInterval(() => {
// 查询启停进度
getSteps()
}, 1000); // 每秒调用一次
}else {
// 清理定时任务
clearInterval(timerQuery);
}
},
{ immediate: true } // 只在路径变化时触发
)
</script>
<style lang="scss">
.remoteTitle{
width: 100%;
height: 60px;
}
.el-steps{
font-size: 15pt;
font-weight: 500;
color: blue;
}
.demo-button{
display: right;
margin-left: 15px;
margin-top:-5px;
width: 20%;
align-items: center;
}
.card-content {
display: flex;
justify-content: space-between;
height: 60px;
width: 100%;
}
.checkmark {
display: inline-block;
margin: 10px;
width: 20px;
height: 20px;
border: solid green;
border-width: 0 3px 3px 0;
transform: rotate(45deg);
opacity: 0;
transition: opacity 0.3s ease, transform 0.3s ease;
}
.show-checkmark {
opacity: 1;
transform: rotate(0);
}
.el-dialog{
display: flex;
display: -ms-flex; /* 兼容IE */
flex-direction: column;
-ms-flex-direction: column; /* 兼容IE */
margin:0 !important;
position:absolute;
top:50%;
left:50%;
transform:translate(-50%,-50%);
max-height:calc(100% - 30px);
max-width:calc(100% - 30px);
}
.el-dialog .el-dialog__body{
max-height: 100%;
flex: 1;
-ms-flex: 1 1 auto; /* 兼容IE */
overflow-y: auto;
overflow-x: hidden;
}
.el-dialog__wrapper {
/*隐藏ie和edge中遮罩的滚动条*/
overflow: hidden;
}
.loading-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(230, 253, 260, 0.3);//rgba(0, 0, 0, 0.6);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
z-index: 1000;
p {
margin-top: 60px;
font-size: 26px;
color: #29d78b;
}
@keyframes rotation {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.loading-spinner {
position: relative;
width: 106px;
height: 56px;
background-image: linear-gradient(#29d78b 50px, transparent 0),
linear-gradient(#29d78b 50px, transparent 0),
linear-gradient(#29d78b 50px, transparent 0),
linear-gradient(#29d78b 50px, transparent 0),
radial-gradient(circle 14px, #29d78b 100%, transparent 0);
background-size: 48px 15px, 15px 35px, 15px 35px, 25px 15px, 28px 28px;
background-position: 25px 5px, 58px 20px, 25px 17px, 2px 37px, 76px 0px;
background-repeat: no-repeat;
transform: rotate(-45deg);
&::after,
&::before {
content: "";
position: absolute;
left: -45px;
top: -10px;
width: 56px;
height: 56px;
border: 6px solid #29d78b;
border-radius: 50%;
background-repeat: no-repeat;
background-image: linear-gradient(#29d78b 64px, transparent 0),
linear-gradient(#29d78b 66px, transparent 0),
radial-gradient(circle 4px, #29d78b 100%, transparent 0);
background-size: 40px 1px, 1px 40px, 8px 8px;
background-position: center center;
-webkit-animation: rotation 0.3s linear infinite;
animation: rotation 0.3s linear infinite;
}
&::before {
left: 25px;
top: 60px;
}
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment