Merge pull request 'fix : 修复设备修改判空提示' (#314) from dengjie into dev
Reviewed-on: http://git.feashow.cn/clay/tunnel-cloud-web/pulls/314
This commit is contained in:
@@ -168,14 +168,14 @@ const setValueA = () => {
|
|||||||
if (electricityConsumptionMonthly.value === 0 || length.value === null) {
|
if (electricityConsumptionMonthly.value === 0 || length.value === null) {
|
||||||
valueA.value.style.height = `0px`;
|
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`;
|
valueA.value.style.height = `${width}px`;
|
||||||
}
|
}
|
||||||
const setValueB = () => {
|
const setValueB = () => {
|
||||||
if (monthlySavings.value === 0 || length.value === null) {
|
if (monthlySavings.value === 0 || length.value === null) {
|
||||||
valueB.value.style.height = `0px`;
|
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`;
|
valueB.value.style.height = `${width}px`;
|
||||||
}
|
}
|
||||||
const getBasicData = (data) => {
|
const getBasicData = (data) => {
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
@change="changeFanData(scope.row)"></el-input>
|
@change="changeFanData(scope.row)"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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">
|
<template #default="scope">
|
||||||
<div class="switch">
|
<div class="switch">
|
||||||
<div
|
<div
|
||||||
@@ -310,6 +310,7 @@
|
|||||||
import {ElLoading, ElMessage} from "element-plus";
|
import {ElLoading, ElMessage} from "element-plus";
|
||||||
import {getEquipmentList, editEquipment, getTunnelDetail} from "@/api/tunnelManage";
|
import {getEquipmentList, editEquipment, getTunnelDetail} from "@/api/tunnelManage";
|
||||||
import TunnelTitle from "@/components/tunnelTitle/index.vue";
|
import TunnelTitle from "@/components/tunnelTitle/index.vue";
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const tunnelId = reactive(router.currentRoute.value.params.tunnelId)
|
const tunnelId = reactive(router.currentRoute.value.params.tunnelId)
|
||||||
const userId = reactive(router.currentRoute.value.params.userId)
|
const userId = reactive(router.currentRoute.value.params.userId)
|
||||||
@@ -330,45 +331,88 @@ const frequencyData = ref([])
|
|||||||
const siteId = ref(0)
|
const siteId = ref(0)
|
||||||
const tunnelName = ref('')
|
const tunnelName = ref('')
|
||||||
const changeFan = (e) => {
|
const changeFan = (e) => {
|
||||||
const fanObj = {
|
// const fanObj = {
|
||||||
acquisitionPeriod: e * 1000,
|
// acquisitionPeriod: e * 1000,
|
||||||
tunnelId: tunnelId,
|
// tunnelId: tunnelId,
|
||||||
typeKey: 'frequency'
|
// typeKey: 'frequency'
|
||||||
}
|
// }
|
||||||
frequencyData.value.push(fanObj)
|
// frequencyData.value.push(fanObj)
|
||||||
}
|
}
|
||||||
const changeFanData = (row) => {
|
const changeFanData = (row) => {
|
||||||
editFanData.value.push(row)
|
// editFanData.value.push(row)
|
||||||
}
|
}
|
||||||
const changeWind = (e) => {
|
const changeWind = (e) => {
|
||||||
const windObj = {
|
// const windObj = {
|
||||||
acquisitionPeriod: e * 1000,
|
// acquisitionPeriod: e * 1000,
|
||||||
tunnelId: tunnelId,
|
// tunnelId: tunnelId,
|
||||||
typeKey: 'windPressure'
|
// typeKey: 'windPressure'
|
||||||
}
|
// }
|
||||||
frequencyData.value.push(windObj)
|
// frequencyData.value.push(windObj)
|
||||||
}
|
}
|
||||||
const changeWindData = (row) => {
|
const changeWindData = (row) => {
|
||||||
editWinData.value.push(row)
|
// editWinData.value.push(row)
|
||||||
}
|
}
|
||||||
const changeOther = (e) => {
|
const changeOther = (e) => {
|
||||||
const otherObj = {
|
// const otherObj = {
|
||||||
acquisitionPeriod: e * 1000,
|
// acquisitionPeriod: e * 1000,
|
||||||
tunnelId: tunnelId,
|
// tunnelId: tunnelId,
|
||||||
typeKey: 'sensor'
|
// typeKey: 'sensor'
|
||||||
}
|
// }
|
||||||
frequencyData.value.push(otherObj)
|
// frequencyData.value.push(otherObj)
|
||||||
}
|
}
|
||||||
const changeOtherData = (row) => {
|
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 = () => {
|
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 = {
|
const basicData = {
|
||||||
tunnelId: tunnelId,
|
tunnelId: tunnelId,
|
||||||
acquisitionList: frequencyData.value,
|
acquisitionList: newFrequency,
|
||||||
frequencyChangerList: editFanData.value,
|
frequencyChangerList: newFan,
|
||||||
windPressureSensorList: editWinData.value,
|
windPressureSensorList: newWind,
|
||||||
sensorList: editOtherData.value,
|
sensorList: newSensor,
|
||||||
// shuntList: editFenLiuData.value,
|
// shuntList: editFenLiuData.value,
|
||||||
}
|
}
|
||||||
editEquipment(basicData).then(res => {
|
editEquipment(basicData).then(res => {
|
||||||
@@ -390,7 +434,7 @@ const getList = () => {
|
|||||||
lock: true,
|
lock: true,
|
||||||
text: '正在加载系统资源...',
|
text: '正在加载系统资源...',
|
||||||
background: 'rgba(0, 0, 0, 0.7)',
|
background: 'rgba(0, 0, 0, 0.7)',
|
||||||
customClass:'allLoading'
|
customClass: 'allLoading'
|
||||||
})
|
})
|
||||||
getEquipmentList(tunnelId).then(res => {
|
getEquipmentList(tunnelId).then(res => {
|
||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
|
|||||||
Reference in New Issue
Block a user