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

一键启停代码修改

parent c0d04b6f
......@@ -6,7 +6,7 @@
<p v-show="isStop">倒计时{{countDown}}</p>
</div>
<el-dialog v-model="dialogFormVisible" width="30%" title="请选择进行一键启动的循环泵:" center>
<el-dialog @close="onClose" :close-on-click-modal="false" 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>
......@@ -581,17 +581,17 @@ async function TransferOpen() {
});
if (!transferId || transferId === null) {
ElMessage.error("请选择要一键启动的换热站机组!");
scheduledTasks() // 定时查询
scheduledTasks() // 定时查询
return;
}
if (!limit) {
ElMessage.error("请输入水箱液位量程后才能对换热站机组进行一键启动操作!");
scheduledTasks() // 定时查询
scheduledTasks() // 定时查询
return;
}
if (limit.value <= 0) {
ElMessage.error("请输入正确的水箱液位量程!");
scheduledTasks() // 定时查询
scheduledTasks() // 定时查询
return;
}
......@@ -602,19 +602,19 @@ async function TransferOpen() {
if (result) {
if (!result.success) {
ElMessage.error(result.message);
scheduledTasks() // 定时查询
scheduledTasks() // 定时查询
return;
}
var data = result.data[0];
if (data.aiSendOnekeyStartStop) {
ElMessage.error(data.transferName + "平台已下发一键启停命令!");
scheduledTasks() // 定时查询
scheduledTasks() // 定时查询
return;
}
if (data.firstReplenishmentPump || data.secondReplenishmentPump || data.oneCirculatingPump || data.twoCirculatingPump) {
ElMessage.error(data.transferName + " 循环泵或补水泵已启动,无法执行一键启动命令!");
scheduledTasks() // 定时查询
scheduledTasks() // 定时查询
return;
}
......@@ -684,10 +684,10 @@ async function TransferOpen() {
await new Promise(resolve => setTimeout(resolve, 1000));
activeStep.value = 7;
handleSetOneStartStop(stationId.value,transferId.value,false,undefined,8,undefined)
handleSetOneStartStopTwo(stationId.value,transferId.value,false,undefined,8,undefined)
dialogFormVisible.value = true;
} else {
scheduledTasks() // 定时查询
scheduledTasks() // 定时查询
ElMessage.error("未获取到一键启动数据");
}
} catch (error) {
......@@ -724,14 +724,17 @@ function TransferClose() {
.then(async () => {
await OnekeyStop();
}).catch(() => {
scheduledTasks() // 定时查询
scheduledTasks() // 定时查询
});
}
async function onClose() {
dialogFormVisible.value = false;
scheduledTasks() // 定时查询
}
async function OneKeyStart(num) {
console.log('timerQuery',timerQuery)
dialogFormVisible.value = false;
scheduledTasks() // 定时查询
isLoading.value = true;
try {
const userId = userInfo.userId;
......@@ -741,10 +744,10 @@ async function OneKeyStart(num) {
if (result.success) {
activeStep.value = 8;
startPercent[7].color = "rgb(103 194 58)";
await handleSetOneStartStop(stationId.value, transferId.value, true, undefined, 8, undefined)
await handleSetOneStartStopTwo(stationId.value, transferId.value, true, undefined, 8, undefined)
} else {
startPercent[7].color = "rgb(176 63 63)";
await handleSetOneStartStop(stationId.value, transferId.value, false, undefined, 8, undefined)
await handleSetOneStartStopTwo(stationId.value, transferId.value, false, undefined, 8, undefined)
}
ElMessage.success(result.message);
} else {
......@@ -806,7 +809,19 @@ async function handleSetOneStartStop( stationId,unitId,runStepsFlag,stopStepsFla
stopSteps: stopSteps,
}
setOneStartStop(params).then(res => {
scheduledTasks() // 定时查询
scheduledTasks() // 定时查询
})
}
async function handleSetOneStartStopTwo( stationId,unitId,runStepsFlag,stopStepsFlag,runSteps,stopSteps) {
const params = {
stationId: stationId,
unitId: unitId,
runStepsFlag: runStepsFlag,
stopStepsFlag: stopStepsFlag,
runSteps: runSteps,
stopSteps: stopSteps,
}
setOneStartStop(params).then(res => {
})
}
......@@ -816,13 +831,13 @@ async function OnekeyStopEnd() {
try {
var result = await http.post("api/remote/OnekeyControl/GetTransferStatus", transferId.value);
if (!result) {
scheduledTasks() // 定时查询
scheduledTasks() // 定时查询
ElMessage.error("远程服务器连接异常,一键停止执行失败!");
return;
}
if (!result.success) {
scheduledTasks() // 定时查询
scheduledTasks() // 定时查询
ElMessage.error(result.message);
return;
}
......
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