邓洁: 设备接口部分对接
This commit is contained in:
@@ -26,9 +26,9 @@
|
||||
<el-menu-item index="3">
|
||||
<span>其他传感器</span>
|
||||
</el-menu-item>
|
||||
<!-- <el-menu-item index="4">-->
|
||||
<!-- <span>分流器</span>-->
|
||||
<!-- </el-menu-item>-->
|
||||
<!-- <el-menu-item index="4">-->
|
||||
<!-- <span>分流器</span>-->
|
||||
<!-- </el-menu-item>-->
|
||||
</el-menu>
|
||||
</div>
|
||||
<div class="box-right" v-if="changeIndex==1">
|
||||
@@ -53,17 +53,20 @@
|
||||
<el-table-column prop="equipmentName" label="设备名称" align="center"/>
|
||||
<el-table-column prop="phaseCurrentAOffset" label="A电流" align="center">
|
||||
<template #default="scope">
|
||||
<el-input placeholder="请输入A电流" v-model="scope.row.phaseCurrentAOffset"></el-input>
|
||||
<el-input placeholder="请输入A电流" v-model="scope.row.phaseCurrentAOffset"
|
||||
@change="changeCurrent(scope.row)"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="phaseCurrentBOffset" label="B电流" align="center">
|
||||
<template #default="scope">
|
||||
<el-input placeholder="请输入B电流" v-model="scope.row.phaseCurrentBOffset"></el-input>
|
||||
<el-input placeholder="请输入B电流" v-model="scope.row.phaseCurrentBOffset"
|
||||
@change="changeCurrent(scope.row)"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="phaseCurrentCOffset" label="C电流" align="center">
|
||||
<template #default="scope">
|
||||
<el-input placeholder="请输入C电流" v-model="scope.row.phaseCurrentCOffset"></el-input>
|
||||
<el-input placeholder="请输入C电流" v-model="scope.row.phaseCurrentCOffset"
|
||||
@change="changeCurrent(scope.row)"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="state" label="状态" align="center">
|
||||
@@ -71,15 +74,15 @@
|
||||
<div class="switch">
|
||||
<div
|
||||
:class="{ active: scope.row.state }"
|
||||
@click=" scope.row.state = true"
|
||||
@click="scope.row.state = 1;changeState(scope.row)"
|
||||
>
|
||||
启动
|
||||
启用
|
||||
</div>
|
||||
<div
|
||||
:class="{ active: ! scope.row.state }"
|
||||
@click=" scope.row.state = false"
|
||||
@click=" scope.row.state = 0;changeState(scope.row)"
|
||||
>
|
||||
停止
|
||||
停用
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -90,7 +93,7 @@
|
||||
<div class="cancel-btn">
|
||||
取消
|
||||
</div>
|
||||
<div class="sure-btn" @click="router.back(-1)">
|
||||
<div class="sure-btn" @click="handleEditFan">
|
||||
确定
|
||||
</div>
|
||||
</div>
|
||||
@@ -119,7 +122,7 @@
|
||||
<el-table-column prop="unit" label="单位" align="center"/>
|
||||
<el-table-column prop="alarmValue" label="阈值" align="center">
|
||||
<template #default="scope">
|
||||
<el-input placeholder="请输入阈值" v-model="scope.row.alarmValue"></el-input>
|
||||
<el-input placeholder="请输入阈值" v-model="scope.row.alarmValue" @change="changeCurrent(scope.row)"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="state" label="状态" align="center">
|
||||
@@ -127,15 +130,15 @@
|
||||
<div class="switch">
|
||||
<div
|
||||
:class="{ active: scope.row.state }"
|
||||
@click=" scope.row.state = true"
|
||||
@click=" scope.row.state = 1;changeState(scope.row)"
|
||||
>
|
||||
启动
|
||||
启用
|
||||
</div>
|
||||
<div
|
||||
:class="{ active: ! scope.row.state }"
|
||||
@click=" scope.row.state = false"
|
||||
@click=" scope.row.state = 0;changeState(scope.row)"
|
||||
>
|
||||
停止
|
||||
停用
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -146,7 +149,7 @@
|
||||
<div class="cancel-btn">
|
||||
取消
|
||||
</div>
|
||||
<div class="sure-btn" @click="router.back(-1)">
|
||||
<div class="sure-btn" @click="editWinPresure">
|
||||
确定
|
||||
</div>
|
||||
</div>
|
||||
@@ -174,12 +177,12 @@
|
||||
<el-table-column prop="offset" label="偏移量" align="center"/>
|
||||
<el-table-column prop="unit" label="单位" align="center">
|
||||
<template #default="scope">
|
||||
<el-input placeholder="请输入单位" v-model="scope.row.unit"></el-input>
|
||||
<el-input placeholder="请输入单位" v-model="scope.row.unit" @change="changeCurrent(scope.row)"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="alarmValue" label="阈值" align="center">
|
||||
<template #default="scope">
|
||||
<el-input placeholder="请输入阈值" v-model="scope.row.alarmValue"></el-input>
|
||||
<el-input placeholder="请输入阈值" v-model="scope.row.alarmValue" @change="changeCurrent(scope.row)"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="state" label="状态" align="center">
|
||||
@@ -187,15 +190,15 @@
|
||||
<div class="switch">
|
||||
<div
|
||||
:class="{ active: scope.row.state }"
|
||||
@click=" scope.row.state = true"
|
||||
@click=" scope.row.state = 1;changeState(scope.row)"
|
||||
>
|
||||
启动
|
||||
启用
|
||||
</div>
|
||||
<div
|
||||
:class="{ active: ! scope.row.state }"
|
||||
@click=" scope.row.state = false"
|
||||
@click=" scope.row.state = 0;changeState(scope.row)"
|
||||
>
|
||||
停止
|
||||
停用
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -206,7 +209,7 @@
|
||||
<div class="cancel-btn" @click="isVisited=false">
|
||||
取消
|
||||
</div>
|
||||
<div class="sure-btn" @click="router.back(-1)">
|
||||
<div class="sure-btn" @click="editOtherSensor">
|
||||
确定
|
||||
</div>
|
||||
</div>
|
||||
@@ -244,13 +247,13 @@
|
||||
:class="{ active: scope.row.state }"
|
||||
@click=" scope.row.state = true"
|
||||
>
|
||||
启动
|
||||
启用
|
||||
</div>
|
||||
<div
|
||||
:class="{ active: ! scope.row.state }"
|
||||
@click=" scope.row.state = false"
|
||||
>
|
||||
停止
|
||||
停用
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -272,7 +275,9 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {getEquipmentList} from "@/api/tunnelManage";
|
||||
import {getEquipmentList, editFan} from "@/api/tunnelManage";
|
||||
import {ElMessage} from "element-plus";
|
||||
import {editEquipment} from "../../api/tunnelManage";
|
||||
|
||||
const router = useRouter()
|
||||
const tunnelId = reactive(router.currentRoute.value.params.tunnelId)
|
||||
@@ -460,6 +465,64 @@ const fenliuData = ref([
|
||||
// state: false,
|
||||
// }
|
||||
])
|
||||
const fanItem=ref({})
|
||||
const windItem=ref({})
|
||||
const sensorItem=ref({})
|
||||
const changeCurrent = (row) => {
|
||||
fanItem.value=getFanEditItem(row)
|
||||
windItem.value=getWindEditItem(row)
|
||||
sensorItem.value=getSensorEditItem(row)
|
||||
}
|
||||
const changeState = (row) => {
|
||||
fanItem.value=getFanEditItem(row)
|
||||
windItem.value=getWindEditItem(row)
|
||||
sensorItem.value=getSensorEditItem(row)
|
||||
}
|
||||
const getFanEditItem = (item) => {
|
||||
return {
|
||||
equipmentId: item.equipmentId,
|
||||
phaseCurrentAOffset: parseInt(item.phaseCurrentAOffset),
|
||||
phaseCurrentBOffset: parseInt(item.phaseCurrentBOffset),
|
||||
phaseCurrentCOffset: parseInt(item.phaseCurrentCOffset),
|
||||
state: item.state,
|
||||
}
|
||||
}
|
||||
const getWindEditItem = (item) => {
|
||||
return {
|
||||
equipmentId: item.equipmentId,
|
||||
alarmValue: item.alarmValue,
|
||||
state: item.state,
|
||||
}
|
||||
}
|
||||
const getSensorEditItem = (item) => {
|
||||
return {
|
||||
equipmentId: item.equipmentId,
|
||||
unit: item.unit,
|
||||
alarmValue: item.alarmValue,
|
||||
state: item.state,
|
||||
}
|
||||
}
|
||||
const editWinPresure=()=>{
|
||||
editEquipment([windItem.value]).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success('修改成功')
|
||||
}
|
||||
})
|
||||
}
|
||||
const editOtherSensor=()=>{
|
||||
editEquipment([sensorItem.value]).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success('修改成功')
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleEditFan = () => {
|
||||
editFan([fanItem.value]).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success('修改成功')
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleChangeMenu = (e) => {
|
||||
console.log('切换', e)
|
||||
changeIndex.value = e
|
||||
@@ -471,9 +534,9 @@ const getList = () => {
|
||||
fanData.value = res.data.frequencyChangerList
|
||||
winData.value = res.data.windPressureSensorList
|
||||
otherData.value = res.data.sensorList
|
||||
res.data.acquisitionList.map(item=>{
|
||||
if(item.tunnelId==tunnelId){
|
||||
collectionFrequency.value=item.acquisitionPeriod
|
||||
res.data.acquisitionList.map(item => {
|
||||
if (item.tunnelId == tunnelId) {
|
||||
collectionFrequency.value = item.acquisitionPeriod
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user