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

一键启停:如果当前换热站只有一个机组,停止会有7个步骤,如果有多个机组,停止只有5个步骤

parent 87abc61a
......@@ -5,7 +5,6 @@ import store from "@/store/index.js";
// 获取AI无人站的token
export function handleGetAIToken() {
return new Promise((resolve, reject) => {
console.log('1111111111111111111111111111111111111111');
const AIToken = localStorage.getItem('AIToken');
if (AIToken) {
// 有存储token判断token有没有过期
......
......@@ -31,7 +31,7 @@
<!-- <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="TransferOpen" >一键启动</el-button>-->
<!-- <el-button type="primary" :loading="isLoading" @click="TransferClose" >一键停止</el-button>-->
<!-- </div>-->
</div>
......@@ -95,8 +95,8 @@
<script lang="ts" setup>
import {handleGetAIToken} from '../AIStation/AItoken.js'
import { ref, reactive, onMounted, onUnmounted,computed,watch,onBeforeUnmount } from 'vue'
import store from "../../store/index";
import http from "../../api/http";
import store from "../../store/index.js";
import http from "../../api/http.js";
import { ElMessage,ElMessageBox } from "element-plus";
import { vFloatNumber } from "../../utils/directives.js";
import { fa } from 'element-plus/es/locale';
......@@ -266,8 +266,111 @@ function setContentHeight() {
//获取换热机组列表
function getSupplys() {
var result = store.getters.getEnterprise();
console.log('result',result[0].serviceCenterList[0].supplyList[0].transferList)
enterpriseId.value = store.getters.getEnterpriseId();
if (result) {
const setNum = result[0].serviceCenterList[0].supplyList[0].transferList.length
if(setNum > 1) {
// 如果有多个机组,停止只有5个步骤
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
}];
}else {
// 当前换热站只有一个机组,停止会有7个步骤
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
}];
}
result.forEach(element => {
if(element.enterpriseId === enterpriseId.value){
if (element.enterpriseId.toLowerCase() === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()) {
......@@ -361,105 +464,105 @@ const onValueChange = (newValue) => {
}
// 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
}];
}
// 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() {
......@@ -761,7 +864,7 @@ function getSteps() {
startPercent[saveActiveStep.value - 1].color = "rgb(127 127 127)";
}
if(saveStopStep.value > -1) {
startPercent[saveStopStep.value].color = "rgb(127 127 127)";
stopPercent.value[saveStopStep.value].color = "rgb(127 127 127)";
}
// 一键启动
if(res.code === 200) {
......@@ -835,6 +938,7 @@ watch(
() => route.path, // 只监听路径变化
async () => {
if (route.path === '/Remote/OnekeyStartStop') {
await store.dispatch("getOrg");
getSupplys();
timerQuery = setInterval(async () => {
await handleGetAIToken()
......
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