fix : 修复设备修改判空提示
This commit is contained in:
@@ -168,14 +168,14 @@ const setValueA = () => {
|
||||
if (electricityConsumptionMonthly.value === 0 || length.value === null) {
|
||||
valueA.value.style.height = `0px`;
|
||||
}
|
||||
let width = (electricityConsumptionMonthly.value * length.value?.offsetHeight) / 40000;
|
||||
let width = (electricityConsumptionMonthly.value * length.value?.offsetHeight) /100000;
|
||||
valueA.value.style.height = `${width}px`;
|
||||
}
|
||||
const setValueB = () => {
|
||||
if (monthlySavings.value === 0 || length.value === null) {
|
||||
valueB.value.style.height = `0px`;
|
||||
}
|
||||
let width = (monthlySavings.value * length.value?.offsetHeight) / 40000;
|
||||
let width = (monthlySavings.value * length.value?.offsetHeight) / 100000;
|
||||
valueB.value.style.height = `${width}px`;
|
||||
}
|
||||
const getBasicData = (data) => {
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
@change="changeFanData(scope.row)"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="state" label="状态" align="center" min-width="86">
|
||||
<el-table-column prop="state" label="状态" align="center" min-width="86">
|
||||
<template #default="scope">
|
||||
<div class="switch">
|
||||
<div
|
||||
@@ -310,6 +310,7 @@
|
||||
import {ElLoading, ElMessage} from "element-plus";
|
||||
import {getEquipmentList, editEquipment, getTunnelDetail} from "@/api/tunnelManage";
|
||||
import TunnelTitle from "@/components/tunnelTitle/index.vue";
|
||||
|
||||
const router = useRouter()
|
||||
const tunnelId = reactive(router.currentRoute.value.params.tunnelId)
|
||||
const userId = reactive(router.currentRoute.value.params.userId)
|
||||
@@ -330,45 +331,88 @@ const frequencyData = ref([])
|
||||
const siteId = ref(0)
|
||||
const tunnelName = ref('')
|
||||
const changeFan = (e) => {
|
||||
const fanObj = {
|
||||
acquisitionPeriod: e * 1000,
|
||||
tunnelId: tunnelId,
|
||||
typeKey: 'frequency'
|
||||
}
|
||||
frequencyData.value.push(fanObj)
|
||||
// const fanObj = {
|
||||
// acquisitionPeriod: e * 1000,
|
||||
// tunnelId: tunnelId,
|
||||
// typeKey: 'frequency'
|
||||
// }
|
||||
// frequencyData.value.push(fanObj)
|
||||
}
|
||||
const changeFanData = (row) => {
|
||||
editFanData.value.push(row)
|
||||
// editFanData.value.push(row)
|
||||
}
|
||||
const changeWind = (e) => {
|
||||
const windObj = {
|
||||
acquisitionPeriod: e * 1000,
|
||||
tunnelId: tunnelId,
|
||||
typeKey: 'windPressure'
|
||||
}
|
||||
frequencyData.value.push(windObj)
|
||||
// const windObj = {
|
||||
// acquisitionPeriod: e * 1000,
|
||||
// tunnelId: tunnelId,
|
||||
// typeKey: 'windPressure'
|
||||
// }
|
||||
// frequencyData.value.push(windObj)
|
||||
}
|
||||
const changeWindData = (row) => {
|
||||
editWinData.value.push(row)
|
||||
// editWinData.value.push(row)
|
||||
}
|
||||
const changeOther = (e) => {
|
||||
const otherObj = {
|
||||
acquisitionPeriod: e * 1000,
|
||||
tunnelId: tunnelId,
|
||||
typeKey: 'sensor'
|
||||
}
|
||||
frequencyData.value.push(otherObj)
|
||||
// const otherObj = {
|
||||
// acquisitionPeriod: e * 1000,
|
||||
// tunnelId: tunnelId,
|
||||
// typeKey: 'sensor'
|
||||
// }
|
||||
// frequencyData.value.push(otherObj)
|
||||
}
|
||||
const changeOtherData = (row) => {
|
||||
editOtherData.value.push(row)
|
||||
// editOtherData.value.push(row)
|
||||
}
|
||||
const changeData = (item) => {
|
||||
return {
|
||||
equipmentId: item.equipmentId,
|
||||
unit: item.unit,
|
||||
alarmValue: item.alarmValue,
|
||||
miniRange: parseInt(item.miniRange),
|
||||
maxRange: parseInt(item.maxRange),
|
||||
state: item.state,
|
||||
}
|
||||
}
|
||||
const editEquip = () => {
|
||||
let newFrequency = [{
|
||||
acquisitionPeriod: fanFrequency.value * 1000,
|
||||
tunnelId: parseInt(tunnelId),
|
||||
typeKey: 'frequency'
|
||||
}, {
|
||||
acquisitionPeriod: windFrequency.value * 1000,
|
||||
tunnelId: parseInt(tunnelId),
|
||||
typeKey: 'windPressure'
|
||||
}, {
|
||||
acquisitionPeriod: otherFrequency.value * 1000,
|
||||
tunnelId: parseInt(tunnelId),
|
||||
typeKey: 'sensor'
|
||||
}]
|
||||
let newFan = []
|
||||
let newWind = []
|
||||
let newSensor = []
|
||||
fanData.value.forEach(item => {
|
||||
let obj = {
|
||||
equipmentId: item.equipmentId,
|
||||
ratedPower:parseInt(item.ratedPower),
|
||||
acurrentValue: parseInt(item.acurrentValue),
|
||||
bcurrentValue: parseInt(item.bcurrentValue),
|
||||
ccurrentValue: parseInt(item.ccurrentValue),
|
||||
state: parseInt(item.state)
|
||||
}
|
||||
newFan.push(obj)
|
||||
})
|
||||
winData.value.forEach(item => {
|
||||
newWind.push(changeData(item))
|
||||
})
|
||||
otherData.value.forEach(item => {
|
||||
newSensor.push(changeData(item))
|
||||
})
|
||||
const basicData = {
|
||||
tunnelId: tunnelId,
|
||||
acquisitionList: frequencyData.value,
|
||||
frequencyChangerList: editFanData.value,
|
||||
windPressureSensorList: editWinData.value,
|
||||
sensorList: editOtherData.value,
|
||||
acquisitionList: newFrequency,
|
||||
frequencyChangerList: newFan,
|
||||
windPressureSensorList: newWind,
|
||||
sensorList: newSensor,
|
||||
// shuntList: editFenLiuData.value,
|
||||
}
|
||||
editEquipment(basicData).then(res => {
|
||||
@@ -390,7 +434,7 @@ const getList = () => {
|
||||
lock: true,
|
||||
text: '正在加载系统资源...',
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
customClass:'allLoading'
|
||||
customClass: 'allLoading'
|
||||
})
|
||||
getEquipmentList(tunnelId).then(res => {
|
||||
if (res.code === 1000) {
|
||||
|
||||
Reference in New Issue
Block a user