Merge pull request 'fix : 修复bug' (#326) from dengjie into dev
Reviewed-on: http://git.feashow.cn/clay/tunnel-cloud-web/pulls/326
This commit is contained in:
@@ -69,9 +69,11 @@ import elementResizeDetectorMaker from "element-resize-detector";
|
|||||||
|
|
||||||
import {getNowFormatDate} from "@/utils/date.js";
|
import {getNowFormatDate} from "@/utils/date.js";
|
||||||
import CsvExportor from "csv-exportor";
|
import CsvExportor from "csv-exportor";
|
||||||
|
|
||||||
let myEcharts = reactive({});
|
let myEcharts = reactive({});
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
list: Array,
|
list: Array,
|
||||||
|
windSpeed: Array,
|
||||||
airData: Array
|
airData: Array
|
||||||
});
|
});
|
||||||
const isFullScreen = ref(false);
|
const isFullScreen = ref(false);
|
||||||
@@ -97,9 +99,17 @@ const isWindSpeedVisited = ref(false);
|
|||||||
const showSpeedLoading = ref(false)
|
const showSpeedLoading = ref(false)
|
||||||
const clickMonth = ref('')
|
const clickMonth = ref('')
|
||||||
const clickDay = ref('')
|
const clickDay = ref('')
|
||||||
|
watch(() => props.windSpeed, (now) => {
|
||||||
|
now.forEach(newItem => {
|
||||||
|
windSpeed.value = newItem.value
|
||||||
|
})
|
||||||
|
})
|
||||||
watch(() => props.list, (now) => {
|
watch(() => props.list, (now) => {
|
||||||
airList.value?.forEach(item => {
|
airList.value?.forEach(item => {
|
||||||
now.forEach(newItem => {
|
now.forEach(newItem => {
|
||||||
|
if (newItem.equipmentId === 11) {//风向传感器
|
||||||
|
windDirection.value = newItem.value
|
||||||
|
}
|
||||||
if (item.equipmentId === newItem.equipmentId) {
|
if (item.equipmentId === newItem.equipmentId) {
|
||||||
item.value = newItem.value
|
item.value = newItem.value
|
||||||
}
|
}
|
||||||
@@ -128,13 +138,13 @@ watch(() => props.airData, (now) => {
|
|||||||
//导出csv
|
//导出csv
|
||||||
const handleExport = () => {
|
const handleExport = () => {
|
||||||
let clickUnit = ''
|
let clickUnit = ''
|
||||||
if(dialogTitle.value==='风速'){
|
if (dialogTitle.value === '风速') {
|
||||||
clickUnit=windSpeedUnit.value
|
clickUnit = windSpeedUnit.value
|
||||||
}else if(dialogTitle.value==='风向'){
|
} else if (dialogTitle.value === '风向') {
|
||||||
clickUnit=windDirectionUnit.value
|
clickUnit = windDirectionUnit.value
|
||||||
}else {
|
} else {
|
||||||
airList.value.forEach(item => {
|
airList.value.forEach(item => {
|
||||||
if (item.name=== dialogTitle.value) {
|
if (item.name === dialogTitle.value) {
|
||||||
clickUnit = item.unit
|
clickUnit = item.unit
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -181,19 +191,19 @@ const daySelect = (val) => {
|
|||||||
getChartInfo(openDialogId.value, 'day', '', true, val[0], val[1])
|
getChartInfo(openDialogId.value, 'day', '', true, val[0], val[1])
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (isFullScreen.value) {
|
if (isFullScreen.value) {
|
||||||
getChartInfo(openDialogId.value, 'day', '')
|
getChartInfo(openDialogId.value, 'day', '')
|
||||||
} else {
|
} else {
|
||||||
getChartInfo(openDialogId.value, 'day', '', true)
|
getChartInfo(openDialogId.value, 'day', '', true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
const monthSelect = (val) => {
|
const monthSelect = (val) => {
|
||||||
clickMonth.value = val
|
clickMonth.value = val
|
||||||
if (isFullScreen.value) {
|
if (isFullScreen.value) {
|
||||||
getChartInfo(openDialogId.value, 'month', val)
|
getChartInfo(openDialogId.value, 'month', val)
|
||||||
} else {
|
} else {
|
||||||
getChartInfo(openDialogId.value, 'month', val,true)
|
getChartInfo(openDialogId.value, 'month', val, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//放大弹窗
|
//放大弹窗
|
||||||
@@ -223,7 +233,7 @@ const shrinkScreen = () => {
|
|||||||
myEcharts.resize();
|
myEcharts.resize();
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
isFullScreen.value = true
|
isFullScreen.value = true
|
||||||
initChart(chartData.dates, chartData.values,dataZoomTop)
|
initChart(chartData.dates, chartData.values, dataZoomTop)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const getChartInfo = (equipmentId, type = 'day', time = '', flag, startTime, endTime) => {
|
const getChartInfo = (equipmentId, type = 'day', time = '', flag, startTime, endTime) => {
|
||||||
@@ -241,7 +251,7 @@ const getChartInfo = (equipmentId, type = 'day', time = '', flag, startTime, end
|
|||||||
getEchartsInfo(equipmentId, time, type, startTime, endTime).then(res => {
|
getEchartsInfo(equipmentId, time, type, startTime, endTime).then(res => {
|
||||||
if (res?.code === 1000) {
|
if (res?.code === 1000) {
|
||||||
showSpeedLoading.value = false
|
showSpeedLoading.value = false
|
||||||
chartData=res.data
|
chartData = res.data
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
if (flag) {
|
if (flag) {
|
||||||
const fanChart = document.getElementById('containerWind')
|
const fanChart = document.getElementById('containerWind')
|
||||||
@@ -251,7 +261,7 @@ const getChartInfo = (equipmentId, type = 'day', time = '', flag, startTime, end
|
|||||||
myEcharts.resize();
|
myEcharts.resize();
|
||||||
});
|
});
|
||||||
if (!isFullScreen.value) {
|
if (!isFullScreen.value) {
|
||||||
initChart(res.data.dates, res.data.values,'93%')
|
initChart(res.data.dates, res.data.values, '93%')
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
shrinkScreen()
|
shrinkScreen()
|
||||||
@@ -268,8 +278,8 @@ const getChartInfo = (equipmentId, type = 'day', time = '', flag, startTime, end
|
|||||||
const handleOpenChart = (id, type) => {
|
const handleOpenChart = (id, type) => {
|
||||||
selectTimeButton.value = 2
|
selectTimeButton.value = 2
|
||||||
isWindSpeedVisited.value = true
|
isWindSpeedVisited.value = true
|
||||||
clickMonth.value=''
|
clickMonth.value = ''
|
||||||
clickDay.value=''
|
clickDay.value = ''
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
if (chooseMonthRef.value) {
|
if (chooseMonthRef.value) {
|
||||||
chooseMonthRef.value.clearData()
|
chooseMonthRef.value.clearData()
|
||||||
@@ -282,7 +292,7 @@ const handleOpenChart = (id, type) => {
|
|||||||
if (type === 'air') {
|
if (type === 'air') {
|
||||||
dialogTitle.value = id.name
|
dialogTitle.value = id.name
|
||||||
openDialogId.value = id.equipmentId
|
openDialogId.value = id.equipmentId
|
||||||
getChartInfo(id.equipmentId, 'day','',true)
|
getChartInfo(id.equipmentId, 'day', '', true)
|
||||||
} else {
|
} else {
|
||||||
if (id === "windDirection") {
|
if (id === "windDirection") {
|
||||||
dialogTitle.value = '风向'
|
dialogTitle.value = '风向'
|
||||||
@@ -290,7 +300,7 @@ const handleOpenChart = (id, type) => {
|
|||||||
dialogTitle.value = '风速'
|
dialogTitle.value = '风速'
|
||||||
}
|
}
|
||||||
openDialogId.value = type
|
openDialogId.value = type
|
||||||
getChartInfo(type, 'day','',true)
|
getChartInfo(type, 'day', '', true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const changeDate = (index) => {
|
const changeDate = (index) => {
|
||||||
@@ -307,7 +317,7 @@ const timeSelect = (index) => {
|
|||||||
if (isFullScreen.value) {
|
if (isFullScreen.value) {
|
||||||
getChartInfo(openDialogId.value, changeDate(index))
|
getChartInfo(openDialogId.value, changeDate(index))
|
||||||
} else {
|
} else {
|
||||||
getChartInfo(openDialogId.value, changeDate(index),'',true)
|
getChartInfo(openDialogId.value, changeDate(index), '', true)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -357,7 +367,7 @@ const getAirInfo = (now) => {
|
|||||||
airList.value = airArr
|
airList.value = airArr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const initChart = (type, values,top) => {
|
const initChart = (type, values, top) => {
|
||||||
//3.初始化container容器
|
//3.初始化container容器
|
||||||
myEcharts = echarts.init(document.getElementById('containerWind'));
|
myEcharts = echarts.init(document.getElementById('containerWind'));
|
||||||
//5.传入数据
|
//5.传入数据
|
||||||
@@ -514,6 +524,7 @@ const initChart = (type, values,top) => {
|
|||||||
.input-fan {
|
.input-fan {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
padding-right: 20px;
|
padding-right: 20px;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
//width: 230px;
|
//width: 230px;
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
@@ -538,6 +549,7 @@ const initChart = (type, values,top) => {
|
|||||||
.input-fan {
|
.input-fan {
|
||||||
//margin: 0 26px;
|
//margin: 0 26px;
|
||||||
padding-right: 20px;
|
padding-right: 20px;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
//width: 230px;
|
//width: 230px;
|
||||||
background: #2E5589;
|
background: #2E5589;
|
||||||
|
|||||||
@@ -22,17 +22,16 @@
|
|||||||
<div
|
<div
|
||||||
id="auto"
|
id="auto"
|
||||||
:class="{ active: item.running }"
|
:class="{ active: item.running }"
|
||||||
@click="item.running = true;editOperate(item,true,'启动')"
|
|
||||||
>
|
>
|
||||||
启动
|
启动
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
id="stop"
|
id="stop"
|
||||||
:class="{ active: !item.running }"
|
:class="{ active: !item.running }"
|
||||||
@click="item.running = false;editOperate(item,false,'停止')"
|
|
||||||
>
|
>
|
||||||
停止
|
停止
|
||||||
</div>
|
</div>
|
||||||
|
<!-- @click="item.running = false;editOperate(item,false,'停止')"-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="power">
|
<div class="power">
|
||||||
@@ -197,21 +196,22 @@ watch(() => props.fanData, (now) => {
|
|||||||
watch(() => props.list, (now) => {
|
watch(() => props.list, (now) => {
|
||||||
socketData.value?.forEach(item => {
|
socketData.value?.forEach(item => {
|
||||||
now.forEach(newItem => {
|
now.forEach(newItem => {
|
||||||
if (item.equipmentId === newItem.equipmentId) {
|
if (item.equipmentId === newItem.equipmentId) {
|
||||||
if (newItem.frequencyFeedback) {
|
if (newItem.hasOwnProperty('frequencyFeedback')) {
|
||||||
item.frequencySetting = newItem.frequencySetting
|
item.frequencySetting = newItem.frequencySetting
|
||||||
item.frequencyFeedback = newItem.frequencyFeedback
|
item.frequencyFeedback = newItem.frequencyFeedback
|
||||||
}
|
} else if (newItem.hasOwnProperty('running')) {
|
||||||
|
item.running = newItem.running
|
||||||
|
item.breakdown = newItem.breakdown
|
||||||
|
item.autoMode = newItem.autoMode
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
transducerData.value.forEach(item => {
|
transducerData.value.forEach(item => {
|
||||||
now.forEach(newItem => {
|
now.forEach(newItem => {
|
||||||
if (item.equipmentId === newItem.equipmentId) {
|
if (item.equipmentId === newItem.equipmentId) {
|
||||||
if (newItem.frequencyFeedback) {
|
if (newItem.hasOwnProperty('phaseCurrentA')) {
|
||||||
item.frequencySetting = newItem.frequencySetting
|
|
||||||
item.frequencyFeedback = newItem.frequencyFeedback
|
|
||||||
} else if (newItem.phaseCurrentA) {
|
|
||||||
item.valueA = newItem.phaseCurrentA
|
item.valueA = newItem.phaseCurrentA
|
||||||
item.valueB = newItem.phaseCurrentB
|
item.valueB = newItem.phaseCurrentB
|
||||||
item.valueC = newItem.phaseCurrentC
|
item.valueC = newItem.phaseCurrentC
|
||||||
@@ -353,21 +353,21 @@ const packageData = (item, type, flag) => {
|
|||||||
}
|
}
|
||||||
//启动/停止
|
//启动/停止
|
||||||
const editOperate = (item, flag, type) => {
|
const editOperate = (item, flag, type) => {
|
||||||
ElMessageBox.confirm(`确认${type}${changeNum(item)}号风机吗?`, '系统提示', {
|
// ElMessageBox.confirm(`确认${type}${changeNum(item)}号风机吗?`, '系统提示', {
|
||||||
type: 'warning',
|
// type: 'warning',
|
||||||
closeOnClickModal: false
|
// closeOnClickModal: false
|
||||||
}).then(() => {
|
// }).then(() => {
|
||||||
const data = packageData(item, flag)
|
// const data = packageData(item, flag)
|
||||||
editFrequencyOperationSwitch(data).then(res => {
|
// editFrequencyOperationSwitch(data).then(res => {
|
||||||
if (res.code === 1000) {
|
// if (res.code === 1000) {
|
||||||
ElMessage.success(res.msg)
|
// ElMessage.success(res.msg)
|
||||||
} else {
|
// } else {
|
||||||
ElMessage.error(res.msg)
|
// ElMessage.error(res.msg)
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
}).catch(() => {
|
// }).catch(() => {
|
||||||
item.running = !item.running
|
// item.running = !item.running
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
const changeFrequency = (item) => {
|
const changeFrequency = (item) => {
|
||||||
@@ -394,11 +394,21 @@ const changeModel = (item) => {
|
|||||||
} else {
|
} else {
|
||||||
flag = '手动'
|
flag = '手动'
|
||||||
}
|
}
|
||||||
|
let number = 0
|
||||||
|
if (item.equipmentType === "frequency1") {
|
||||||
|
number = 1
|
||||||
|
} else if (item.equipmentType === "frequency2") {
|
||||||
|
number = 2
|
||||||
|
}
|
||||||
ElMessageBox.confirm(`确认修改${changeNum(item)}号风机的模式为${flag}模式吗?`, '系统提示', {
|
ElMessageBox.confirm(`确认修改${changeNum(item)}号风机的模式为${flag}模式吗?`, '系统提示', {
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
closeOnClickModal: false
|
closeOnClickModal: false
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
const data = packageData(item, item.autoMode)
|
const data = {
|
||||||
|
number: number,
|
||||||
|
state: item.autoMode?1:0,
|
||||||
|
tunnelId: props.tunnelId,
|
||||||
|
}
|
||||||
editFrequencyModelSwitch(data).then(res => {
|
editFrequencyModelSwitch(data).then(res => {
|
||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
ElMessage.success(res.msg)
|
ElMessage.success(res.msg)
|
||||||
@@ -1040,7 +1050,7 @@ input[type="number"] {
|
|||||||
& > div {
|
& > div {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
cursor: pointer;
|
//cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
:close-on-click-modal="false" :close-on-press-escape="false">
|
:close-on-click-modal="false" :close-on-press-escape="false">
|
||||||
<wind-pressure-list v-if="showFan" :list="socketData.windPressure" :win-data="largeScreenData"
|
<wind-pressure-list v-if="showFan" :list="socketData.windPressure" :win-data="largeScreenData"
|
||||||
:loading="showWindLoading" />
|
:loading="showWindLoading" />
|
||||||
<air-info v-if="showFan" :list="socketData.sensor" :air-data="largeScreenData" />
|
<air-info v-if="showFan" :list="socketData.sensor" :windSpeed="socketData.windSpeed" :air-data="largeScreenData" />
|
||||||
<bad-gas-info v-if="showFan" :list="socketData.sensor" :bad-gas-data="largeScreenData" :tunnelId="tunnelId"
|
<bad-gas-info v-if="showFan" :list="socketData.sensor" :bad-gas-data="largeScreenData" :tunnelId="tunnelId"
|
||||||
:loading="showBadLoading" />
|
:loading="showBadLoading" />
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
@@ -249,6 +249,7 @@ const socketData = reactive({
|
|||||||
leftData: [],
|
leftData: [],
|
||||||
windPressure: [],
|
windPressure: [],
|
||||||
sensor: [],
|
sensor: [],
|
||||||
|
windSpeed: [],
|
||||||
});
|
});
|
||||||
let tunnelLen = computed(() => tunnelLength);
|
let tunnelLen = computed(() => tunnelLength);
|
||||||
const queryParams = reactive({
|
const queryParams = reactive({
|
||||||
@@ -581,6 +582,8 @@ const initWebSocket = () => {
|
|||||||
socketData.windPressure = data;
|
socketData.windPressure = data;
|
||||||
} else if (item.typeKey === "sensor") {
|
} else if (item.typeKey === "sensor") {
|
||||||
socketData.sensor = data;
|
socketData.sensor = data;
|
||||||
|
}else if (item.typeKey === "windSpeed") {
|
||||||
|
socketData.windSpeed = data;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user