Commit fec6e04b authored by Cai Wei's avatar Cai Wei

feat(*): 修改除尘器监控单位及描述

parent 8796e08a
...@@ -283,7 +283,7 @@ export const getBagMonitoringChartOption = (xData = [], seriesData = []) => ({ ...@@ -283,7 +283,7 @@ export const getBagMonitoringChartOption = (xData = [], seriesData = []) => ({
], ],
}); });
export const getLineOption2 = (xData = [], seriesData = [], legendDesc = "健康度指数(%)") => ({ export const getLineOption2 = (xData = [], seriesData = [], legendDesc = "健康度指数", unit = '') => ({
tooltip: { tooltip: {
trigger: "axis", trigger: "axis",
backgroundColor: 'rgba(24, 29, 33, 0.9)', backgroundColor: 'rgba(24, 29, 33, 0.9)',
...@@ -291,6 +291,21 @@ export const getLineOption2 = (xData = [], seriesData = [], legendDesc = "健康 ...@@ -291,6 +291,21 @@ export const getLineOption2 = (xData = [], seriesData = [], legendDesc = "健康
borderWidth: 2, borderWidth: 2,
textStyle: { textStyle: {
color: '#fff' color: '#fff'
},
formatter: function (params) {
// 展示保留圆点
const icon = '<span style="display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: #399DFA; margin-right: 5px;"></span>';
return `第${params[0].name}天<br/> ${icon} ${params[0].seriesName}: ${params[0].value} ${unit}`;
}
},
// 添加子标题
title: {
text: legendDesc === '除尘器健康度指数' ? '根据除尘器日维度告警数据计算' : '',
right: "20",
top: "0%",
textStyle: {
color: '#909399',
fontSize: 12,
} }
}, },
grid: { grid: {
...@@ -312,6 +327,11 @@ export const getLineOption2 = (xData = [], seriesData = [], legendDesc = "健康 ...@@ -312,6 +327,11 @@ export const getLineOption2 = (xData = [], seriesData = [], legendDesc = "健康
}, },
xAxis: { xAxis: {
type: "category", type: "category",
name: "天",
nameTextStyle: {
color: '#909399',
fontSize: 12,
},
axisTick: { axisTick: {
show: false, show: false,
}, },
...@@ -327,6 +347,11 @@ export const getLineOption2 = (xData = [], seriesData = [], legendDesc = "健康 ...@@ -327,6 +347,11 @@ export const getLineOption2 = (xData = [], seriesData = [], legendDesc = "健康
}, },
yAxis: { yAxis: {
type: "value", type: "value",
name: unit,
nameTextStyle: {
color: '#909399',
fontSize: 12,
},
axisLabel: { axisLabel: {
color: "#909399", color: "#909399",
}, },
......
...@@ -307,79 +307,6 @@ const dustInfo = reactive([ ...@@ -307,79 +307,6 @@ const dustInfo = reactive([
key: "pulseDetectorNum", key: "pulseDetectorNum",
}, },
]); ]);
const option2 = {
series: [
{
type: "gauge",
startAngle: 260,
endAngle: 300,
center: ["50%", "75%"],
radius: "90%",
min: 0,
max: 1,
splitNumber: 8,
axisLine: {
lineStyle: {
width: 3,
color: [
[0.25, "#FF6E76"],
[0.8, "#67c23a"],
[1, "#FF6E76"],
],
},
},
pointer: {
icon: "path://M12.8,0.7l12,40.1H0.7L12.8,0.7z",
length: "12%",
width: 20,
offsetCenter: [0, "-60%"],
itemStyle: {
color: "auto",
},
},
axisTick: {
length: 0,
lineStyle: {
color: "auto",
width: 2,
},
},
splitLine: {
length: 0,
lineStyle: {
color: "auto",
width: 5,
},
},
axisLabel: {
color: "#464646",
fontSize: 20,
distance: -60,
rotate: "tangential",
show: false,
},
title: {
offsetCenter: [0, "50%"],
fontSize: 12,
},
detail: {
fontSize: 20,
offsetCenter: [0, 0],
valueAnimation: true,
formatter: function (value) {
return Math.round(value * 100) + "";
},
color: "inherit",
},
data: [
{
value: 0.7,
name: "压差",
},
],
},
],
};
const indicatorOneInstance = ref(); const indicatorOneInstance = ref();
const indicatorTwoInstance = ref(); const indicatorTwoInstance = ref();
const indicatorFun = (target, domId, option) => { const indicatorFun = (target, domId, option) => {
...@@ -423,7 +350,7 @@ const getHealthIndex = () => { ...@@ -423,7 +350,7 @@ const getHealthIndex = () => {
xData.push(item.time); xData.push(item.time);
seriesData.push(item.healthIndex); seriesData.push(item.healthIndex);
}); });
const option = getLineOption2(xData, seriesData, "健康度指数(%)"); const option = getLineOption2(xData, seriesData, "除尘器健康度指数", "%");
initChart(chartData[0], option, "chart0"); initChart(chartData[0], option, "chart0");
} }
}); });
...@@ -448,7 +375,7 @@ const getPressure = () => { ...@@ -448,7 +375,7 @@ const getPressure = () => {
xData.push(item.time); xData.push(item.time);
seriesData.push(item.pressureDiff); seriesData.push(item.pressureDiff);
}); });
const option = getLineOption2(xData, seriesData, "压力差(kpa)"); const option = getLineOption2(xData, seriesData, "压力差", "kPa");
initChart(chartData[1], option, "chart1"); initChart(chartData[1], option, "chart1");
} }
}); });
...@@ -473,7 +400,7 @@ const getEnergy = () => { ...@@ -473,7 +400,7 @@ const getEnergy = () => {
xData.push(item.time); xData.push(item.time);
seriesData.push(item.energyConsumption); seriesData.push(item.energyConsumption);
}); });
const option = getLineOption2(xData, seriesData, "能耗(kwh)"); const option = getLineOption2(xData, seriesData, "能耗", "kW·h");
initChart(chartData[2], option, "chart2"); initChart(chartData[2], option, "chart2");
} }
}); });
...@@ -748,8 +675,10 @@ const cancelRefreshEvent = () => { ...@@ -748,8 +675,10 @@ const cancelRefreshEvent = () => {
// 取消鼠标事件 // 取消鼠标事件
const cancelAllMouseEvent = () => { const cancelAllMouseEvent = () => {
clearTimeout(refreshTimer); clearTimeout(refreshTimer);
dustBox.value.removeEventListener("mousemove", cancelRefreshEvent) if (dustBox.value) {
dustBox.value.removeEventListener("mousedown", cancelRefreshEvent) dustBox.value.removeEventListener("mousemove", cancelRefreshEvent)
dustBox.value.removeEventListener("mousedown", cancelRefreshEvent)
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -1076,7 +1076,7 @@ export default { ...@@ -1076,7 +1076,7 @@ export default {
) )
.then((result) => { .then((result) => {
localStorage.setItem("menuList", JSON.stringify(result.data)); localStorage.setItem("menuList", JSON.stringify(result.data));
this.$router.push('/dashboard'); this.$router.push('/monitor');
}) })
.catch((e) => { .catch((e) => {
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment