风机列表:批量调用

This commit is contained in:
高云鹏 2024-11-01 17:45:34 +08:00
parent 53c4025090
commit 6420ab2496
2 changed files with 19 additions and 14 deletions

View File

@ -1,5 +1,5 @@
import createAxios from '/@/utils/axios'
import { CommandReqType } from '/@/views/backend/equipment/airBlower/type'
export const getAirBlowerListReq = () => {
return createAxios({
url: '/api/page/turbines/queryWindTurbinesPages',
@ -14,11 +14,7 @@ export const getBelongLineListReq = () => {
})
}
export const runAirBlowerReq = (data: {
deviceId: string,
serviceName: string,
opValue: 1 | 0
}[]) => {
export const runAirBlowerReq = (data: (CommandReqType & { measType: 199 | 147 | 146 | 138 | 139 | 140 })[]) => {
return createAxios({
url: '/api/page/turbines/windTurbinesControl',
method: 'post',

View File

@ -42,8 +42,8 @@
<div class="headerRight">
<el-button type="primary" @click="airBlowerOperate('setTurbineFastStart')">{{ t('airBlower.start') }}</el-button>
<el-button style="color: #0064aa" @click="airBlowerOperate('setTurbineStop')">{{ t('airBlower.stop') }}</el-button>
<el-button style="color: #0064aa" @click="airBlowerOperate('setTurbineResetSafetyChain')">{{ t('airBlower.reset') }}</el-button>
<el-button style="color: #0064aa" @click="airBlowerOperate('verify')">{{ t('airBlower.verify') }}</el-button>
<el-button style="color: #0064aa" @click="airBlowerOperate('setTurbineResetStatusCode')">{{ t('airBlower.reset') }}</el-button>
<el-button style="color: #0064aa">{{ t('airBlower.verify') }}</el-button>
</div>
</el-header>
<el-main class="mainPart">
@ -68,9 +68,7 @@
<el-table-column v-else :label="item.label" :align="item.align" :width="item.width">
<template v-if="item.custom === 'default'" #default="scope">
<div v-if="item.prop === 'iturbineoperationmode'">
<el-tag v-if="scope.row.locked === 1" color="rgba(254,55,49,0.20)" style="color: #fe3731"
>已锁定</el-tag
>
<el-tag v-if="scope.row.locked === 1" color="rgba(254,55,49,0.20)" style="color: #fe3731">已锁定</el-tag>
<el-tag v-if="scope.row.iturbineoperationmode === 20" color="rgba(0,100,170,0.20)" style="color: #0064aa"
>并网</el-tag
>
@ -236,18 +234,29 @@ const selectAirBlower = (type: SelectTypeKeyUnionType) => {
}
}
const airBlowerOperate = (type: 'setTurbineFastStart' | 'setTurbineStop' | 'setTurbineResetSafetyChain' | 'verify') => {
const airBlowerOperate = (type: 'setTurbineFastStart' | 'setTurbineStop' | 'setTurbineResetStatusCode') => {
const sendTypeEnum = {
setTurbineFastStart: '风机快速启动指令',
setTurbineStop: '风机停机指令',
setTurbineResetStatusCode: '风机复位故障代码指令',
}
const data = selectList.value.map((item) => {
return {
deviceId: item,
serviceName: type,
serviceName: sendTypeEnum[type],
serviceCode: type,
optDesc: sendTypeEnum[type] + 1,
opValue: 1 as const,
measType: 147 as const,
}
})
console.log(data)
runAirBlowerReq(data).then((res) => {
console.log(res)
console.log(res);
// ElMessage.success('')
})
}