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

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

parent 87abc61a
...@@ -5,7 +5,6 @@ import store from "@/store/index.js"; ...@@ -5,7 +5,6 @@ import store from "@/store/index.js";
// 获取AI无人站的token // 获取AI无人站的token
export function handleGetAIToken() { export function handleGetAIToken() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
console.log('1111111111111111111111111111111111111111');
const AIToken = localStorage.getItem('AIToken'); const AIToken = localStorage.getItem('AIToken');
if (AIToken) { if (AIToken) {
// 有存储token判断token有没有过期 // 有存储token判断token有没有过期
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<!-- <el-input v-model="limit" v-text="limit" style="width: 150px;" v-float-number></el-input>(米)--> <!-- <el-input v-model="limit" v-text="limit" style="width: 150px;" v-float-number></el-input>(米)-->
</div> </div>
<!-- <div class="demo-button">--> <!-- <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>--> <!-- <el-button type="primary" :loading="isLoading" @click="TransferClose" >一键停止</el-button>-->
<!-- </div>--> <!-- </div>-->
</div> </div>
...@@ -95,8 +95,8 @@ ...@@ -95,8 +95,8 @@
<script lang="ts" setup> <script lang="ts" setup>
import {handleGetAIToken} from '../AIStation/AItoken.js' import {handleGetAIToken} from '../AIStation/AItoken.js'
import { ref, reactive, onMounted, onUnmounted,computed,watch,onBeforeUnmount } from 'vue' import { ref, reactive, onMounted, onUnmounted,computed,watch,onBeforeUnmount } from 'vue'
import store from "../../store/index"; import store from "../../store/index.js";
import http from "../../api/http"; import http from "../../api/http.js";
import { ElMessage,ElMessageBox } from "element-plus"; import { ElMessage,ElMessageBox } from "element-plus";
import { vFloatNumber } from "../../utils/directives.js"; import { vFloatNumber } from "../../utils/directives.js";
import { fa } from 'element-plus/es/locale'; import { fa } from 'element-plus/es/locale';
...@@ -266,8 +266,111 @@ function setContentHeight() { ...@@ -266,8 +266,111 @@ function setContentHeight() {
//获取换热机组列表 //获取换热机组列表
function getSupplys() { function getSupplys() {
var result = store.getters.getEnterprise(); var result = store.getters.getEnterprise();
console.log('result',result[0].serviceCenterList[0].supplyList[0].transferList)
enterpriseId.value = store.getters.getEnterpriseId(); enterpriseId.value = store.getters.getEnterpriseId();
if (result) { 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 => { result.forEach(element => {
if(element.enterpriseId === enterpriseId.value){ if(element.enterpriseId === enterpriseId.value){
if (element.enterpriseId.toLowerCase() === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()) { if (element.enterpriseId.toLowerCase() === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()) {
...@@ -361,105 +464,105 @@ const onValueChange = (newValue) => { ...@@ -361,105 +464,105 @@ const onValueChange = (newValue) => {
} }
// if (isSingle.value) { // if (isSingle.value) {
if (newValue === '9ad563a2-cf55-4ffa-a878-f9c85af106e1') { // if (newValue === '9ad563a2-cf55-4ffa-a878-f9c85af106e1') {
stopPercent.value = [{ // stopPercent.value = [{
index: 0, // index: 0,
icon: new URL('/imgs/oneKey/ReplenishmentPump.png', import.meta.url).href, // icon: new URL('/imgs/oneKey/ReplenishmentPump.png', import.meta.url).href,
title: "步骤一: 关闭补水泵", // title: "步骤一: 关闭补水泵",
description:"关闭换热站补水泵", // description:"关闭换热站补水泵",
color: "rgb(127 127 127)", // color: "rgb(127 127 127)",
isCompleted: true // isCompleted: true
}, { // }, {
index: 1, // index: 1,
icon: new URL('/imgs/oneKey/CirculatingPump.png', import.meta.url).href, // icon: new URL('/imgs/oneKey/CirculatingPump.png', import.meta.url).href,
title: "步骤二: 关闭循环泵", // title: "步骤二: 关闭循环泵",
description:"关闭换热站循环泵", // description:"关闭换热站循环泵",
value: false, // value: false,
color: "rgb(127 127 127)", // color: "rgb(127 127 127)",
isCompleted: false // isCompleted: false
}, { // }, {
index: 2, // index: 2,
icon: new URL('/imgs/oneKey/ElectricValue.png', import.meta.url).href, // icon: new URL('/imgs/oneKey/ElectricValue.png', import.meta.url).href,
title: "步骤三: 关闭一次供水电动阀", // title: "步骤三: 关闭一次供水电动阀",
description:"一次网供水电动阀关到位", // description:"一次网供水电动阀关到位",
value: false, // value: false,
color: "rgb(127 127 127)", // color: "rgb(127 127 127)",
isCompleted: false // isCompleted: false
}, { // }, {
index: 3, // index: 3,
icon: new URL('/imgs/oneKey/ElectricValue.png', import.meta.url).href, // icon: new URL('/imgs/oneKey/ElectricValue.png', import.meta.url).href,
title: "步骤四: 关闭一次回水电动阀", // title: "步骤四: 关闭一次回水电动阀",
description:"一次网回水电动阀关到位", // description:"一次网回水电动阀关到位",
value: false, // value: false,
color: "rgb(127 127 127)", // color: "rgb(127 127 127)",
isCompleted: false // isCompleted: false
},{ // },{
index: 4, // index: 4,
icon: new URL('/imgs/oneKey/ElectricValue.png', import.meta.url).href, // icon: new URL('/imgs/oneKey/ElectricValue.png', import.meta.url).href,
title: "步骤五: 关闭二次供水电动阀", // title: "步骤五: 关闭二次供水电动阀",
description:"二次网供水电动阀关到位", // description:"二次网供水电动阀关到位",
value: false, // value: false,
color: "rgb(127 127 127)", // color: "rgb(127 127 127)",
isCompleted: false // isCompleted: false
},{ // },{
index: 5, // index: 5,
icon: new URL('/imgs/oneKey/ElectricValue.png', import.meta.url).href, // icon: new URL('/imgs/oneKey/ElectricValue.png', import.meta.url).href,
title: "步骤六: 关闭二次回水电动阀", // title: "步骤六: 关闭二次回水电动阀",
description:"二次网回水电动阀关到位", // description:"二次网回水电动阀关到位",
value: false, // value: false,
color: "rgb(127 127 127)", // color: "rgb(127 127 127)",
isCompleted: false // isCompleted: false
},{ // },{
index: 6, // index: 6,
icon: new URL('/imgs/oneKey/OnekeyStop.png', import.meta.url).href, // icon: new URL('/imgs/oneKey/OnekeyStop.png', import.meta.url).href,
title: "步骤七: 一键关闭结束", // title: "步骤七: 一键关闭结束",
description:"换热站一键关闭执行完毕", // description:"换热站一键关闭执行完毕",
value: false, // value: false,
color: " rgb(127 127 127)",//"rgb(176 63 63)", // color: " rgb(127 127 127)",//"rgb(176 63 63)",
isCompleted: false // isCompleted: false
}]; // }];
} else { // } else {
stopPercent.value = [{ // stopPercent.value = [{
index: 0, // index: 0,
icon: new URL('/imgs/oneKey/ReplenishmentPump.png', import.meta.url).href, // icon: new URL('/imgs/oneKey/ReplenishmentPump.png', import.meta.url).href,
title: "步骤一: 关闭补水泵", // title: "步骤一: 关闭补水泵",
description:"关闭换热站补水泵", // description:"关闭换热站补水泵",
color: "rgb(127 127 127)", // color: "rgb(127 127 127)",
isCompleted: false // isCompleted: false
}, { // }, {
index: 1, // index: 1,
icon: new URL('/imgs/oneKey/CirculatingPump.png', import.meta.url).href, // icon: new URL('/imgs/oneKey/CirculatingPump.png', import.meta.url).href,
title: "步骤二: 关闭循环泵", // title: "步骤二: 关闭循环泵",
description:"关闭换热站循环泵", // description:"关闭换热站循环泵",
value: false, // value: false,
color: "rgb(127 127 127)", // color: "rgb(127 127 127)",
isCompleted: false // isCompleted: false
}, { // }, {
index: 2, // index: 2,
icon: new URL('/imgs/oneKey/ElectricValue.png', import.meta.url).href, // icon: new URL('/imgs/oneKey/ElectricValue.png', import.meta.url).href,
title: "步骤三: 关闭二次供水电动阀", // title: "步骤三: 关闭二次供水电动阀",
description:"二次网供水电动阀关到位", // description:"二次网供水电动阀关到位",
value: false, // value: false,
color: "rgb(127 127 127)", // color: "rgb(127 127 127)",
isCompleted: false // isCompleted: false
},{ // },{
index: 3, // index: 3,
icon: new URL('/imgs/oneKey/ElectricValue.png', import.meta.url).href, // icon: new URL('/imgs/oneKey/ElectricValue.png', import.meta.url).href,
title: "步骤四: 关闭二次回水电动阀", // title: "步骤四: 关闭二次回水电动阀",
description:"二次网回水电动阀关到位", // description:"二次网回水电动阀关到位",
value: false, // value: false,
color: "rgb(127 127 127)", // color: "rgb(127 127 127)",
isCompleted: false // isCompleted: false
},{ // },{
index: 4, // index: 4,
icon: new URL('/imgs/oneKey/OnekeyStop.png', import.meta.url).href, // icon: new URL('/imgs/oneKey/OnekeyStop.png', import.meta.url).href,
title: "步骤五: 一键关闭结束", // title: "步骤五: 一键关闭结束",
description:"换热站一键关闭执行完毕", // description:"换热站一键关闭执行完毕",
value: false, // value: false,
color: " rgb(127 127 127)", // color: " rgb(127 127 127)",
isCompleted: false // isCompleted: false
}]; // }];
} // }
}; };
async function TransferOpen() { async function TransferOpen() {
...@@ -761,7 +864,7 @@ function getSteps() { ...@@ -761,7 +864,7 @@ function getSteps() {
startPercent[saveActiveStep.value - 1].color = "rgb(127 127 127)"; startPercent[saveActiveStep.value - 1].color = "rgb(127 127 127)";
} }
if(saveStopStep.value > -1) { 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) { if(res.code === 200) {
...@@ -835,6 +938,7 @@ watch( ...@@ -835,6 +938,7 @@ watch(
() => route.path, // 只监听路径变化 () => route.path, // 只监听路径变化
async () => { async () => {
if (route.path === '/Remote/OnekeyStartStop') { if (route.path === '/Remote/OnekeyStartStop') {
await store.dispatch("getOrg");
getSupplys(); getSupplys();
timerQuery = setInterval(async () => { timerQuery = setInterval(async () => {
await handleGetAIToken() 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