风机列表:批量调用
This commit is contained in:
parent
53c4025090
commit
6420ab2496
@ -1,5 +1,5 @@
|
|||||||
import createAxios from '/@/utils/axios'
|
import createAxios from '/@/utils/axios'
|
||||||
|
import { CommandReqType } from '/@/views/backend/equipment/airBlower/type'
|
||||||
export const getAirBlowerListReq = () => {
|
export const getAirBlowerListReq = () => {
|
||||||
return createAxios({
|
return createAxios({
|
||||||
url: '/api/page/turbines/queryWindTurbinesPages',
|
url: '/api/page/turbines/queryWindTurbinesPages',
|
||||||
@ -14,11 +14,7 @@ export const getBelongLineListReq = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const runAirBlowerReq = (data: {
|
export const runAirBlowerReq = (data: (CommandReqType & { measType: 199 | 147 | 146 | 138 | 139 | 140 })[]) => {
|
||||||
deviceId: string,
|
|
||||||
serviceName: string,
|
|
||||||
opValue: 1 | 0
|
|
||||||
}[]) => {
|
|
||||||
return createAxios({
|
return createAxios({
|
||||||
url: '/api/page/turbines/windTurbinesControl',
|
url: '/api/page/turbines/windTurbinesControl',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
|
@ -42,8 +42,8 @@
|
|||||||
<div class="headerRight">
|
<div class="headerRight">
|
||||||
<el-button type="primary" @click="airBlowerOperate('setTurbineFastStart')">{{ t('airBlower.start') }}</el-button>
|
<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('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('setTurbineResetStatusCode')">{{ t('airBlower.reset') }}</el-button>
|
||||||
<el-button style="color: #0064aa" @click="airBlowerOperate('verify')">{{ t('airBlower.verify') }}</el-button>
|
<el-button style="color: #0064aa">{{ t('airBlower.verify') }}</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-main class="mainPart">
|
<el-main class="mainPart">
|
||||||
@ -68,9 +68,7 @@
|
|||||||
<el-table-column v-else :label="item.label" :align="item.align" :width="item.width">
|
<el-table-column v-else :label="item.label" :align="item.align" :width="item.width">
|
||||||
<template v-if="item.custom === 'default'" #default="scope">
|
<template v-if="item.custom === 'default'" #default="scope">
|
||||||
<div v-if="item.prop === 'iturbineoperationmode'">
|
<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 v-if="scope.row.locked === 1" color="rgba(254,55,49,0.20)" style="color: #fe3731">已锁定</el-tag>
|
||||||
>已锁定</el-tag
|
|
||||||
>
|
|
||||||
<el-tag v-if="scope.row.iturbineoperationmode === 20" color="rgba(0,100,170,0.20)" style="color: #0064aa"
|
<el-tag v-if="scope.row.iturbineoperationmode === 20" color="rgba(0,100,170,0.20)" style="color: #0064aa"
|
||||||
>并网</el-tag
|
>并网</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) => {
|
const data = selectList.value.map((item) => {
|
||||||
return {
|
return {
|
||||||
deviceId: item,
|
deviceId: item,
|
||||||
serviceName: type,
|
serviceName: sendTypeEnum[type],
|
||||||
|
serviceCode: type,
|
||||||
|
optDesc: sendTypeEnum[type] + 1,
|
||||||
opValue: 1 as const,
|
opValue: 1 as const,
|
||||||
|
measType: 147 as const,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log(data)
|
console.log(data)
|
||||||
|
|
||||||
runAirBlowerReq(data).then((res) => {
|
runAirBlowerReq(data).then((res) => {
|
||||||
console.log(res)
|
console.log(res);
|
||||||
|
|
||||||
|
// ElMessage.success('操作成功')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user