Commit f0f21e74 authored by Cai Wei's avatar Cai Wei

Merge branch 'dev' of https://app.bmetech.com/liuzhaohui/dctomproject into dev

parents bb3a936a 44bcd6c2
...@@ -269,48 +269,45 @@ export const getGaugeOption = (option) => { ...@@ -269,48 +269,45 @@ export const getGaugeOption = (option) => {
endAngle: 320, endAngle: 320,
center: ["50%", "50%"], center: ["50%", "50%"],
radius: "90%", radius: "90%",
min: 0, min: option.min || 0,
max: 1, max: option.max || 100,
splitNumber: 8, splitNumber: 8,
axisLine: { axisLine: {
lineStyle: { lineStyle: {
width: 5, width: 30,
color: [ color: [
[0.2, "#FF6E76"], [0.2, "#fd666d"],
[0.8, "#67c23a"], [0.8, "#48cd4d"],
[1, "#FF6E76"], [1, "#fd666d"],
], ],
}, },
}, },
pointer: { pointer: {
icon: "path://M12.8,0.7l12,40.1H0.7L12.8,0.7z",
length: "12%",
width: 20,
offsetCenter: [0, "-60%"],
itemStyle: { itemStyle: {
color: "auto", color: 'auto'
}, }
}, },
axisTick: { axisTick: {
length: 0, distance: -30,
length: 10,
lineStyle: { lineStyle: {
color: "auto", color: "#fff",
width: 2, width: 2,
}, },
}, },
splitLine: { splitLine: {
length: 0, distance: -30,
length: 38,
lineStyle: { lineStyle: {
color: "auto", color: '#fff',
width: 5, width: 2
}, },
}, },
axisLabel: { axisLabel: {
color: "#464646", color: 'inherit',
fontSize: 20, fontSize: 10,
distance: -60, distance: 30,
rotate: "tangential", rotate: "tangential",
show: false,
}, },
title: { title: {
offsetCenter: [0, "70%"], offsetCenter: [0, "70%"],
......
<template> <template>
<div class="title layout1"> <div class="title layout1">
<span class="warn-title">告警</span> <span class="warn-title">{{ title }}</span>
<span class="jump-icon">>></span> <span class="jump-icon">>></span>
</div> </div>
<div class="content"> <div class="content">
...@@ -15,6 +15,10 @@ const props = defineProps({ ...@@ -15,6 +15,10 @@ const props = defineProps({
type: Array, type: Array,
default: () => [], default: () => [],
}, },
title: {
type: String,
default: "告警",
}
}); });
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
</div> </div>
</div> </div>
<div class="warn-info"> <div class="warn-info">
<warnCom :listInfo="warnInfoList"></warnCom> <warnCom title="告警" :listInfo="warnInfoList"></warnCom>
</div> </div>
</div> </div>
<div class="right-box"> <div class="right-box">
...@@ -109,14 +109,14 @@ ...@@ -109,14 +109,14 @@
</div> </div>
</div> </div>
<div class="warn-info"> <div class="warn-info">
<warnCom :listInfo="closedLoopInfoList"></warnCom> <warnCom title="闭环" :listInfo="closedLoopInfoList"></warnCom>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script setup> <script setup>
import { ref, reactive, onMounted, watch, computed } from "vue"; import { ref, reactive, onMounted, onUnmounted, watch, computed } from "vue";
import * as echarts from "echarts"; import * as echarts from "echarts";
import { getDataFun } from "@/request/method.js"; import { getDataFun } from "@/request/method.js";
import { useUsersStore } from "@/pinia/user.js"; import { useUsersStore } from "@/pinia/user.js";
...@@ -148,7 +148,7 @@ const option = { ...@@ -148,7 +148,7 @@ const option = {
}, },
], ],
}; };
const chartInstance = reactive([null, null, null]); const chartInstance = reactive({});
const chartData = reactive([{}, {}, {}]); const chartData = reactive([{}, {}, {}]);
const initChart = (instance, option, domEl) => { const initChart = (instance, option, domEl) => {
if (instance && instance.dispose) { if (instance && instance.dispose) {
...@@ -156,6 +156,7 @@ const initChart = (instance, option, domEl) => { ...@@ -156,6 +156,7 @@ const initChart = (instance, option, domEl) => {
} }
instance = echarts.init(document.getElementById(domEl)); instance = echarts.init(document.getElementById(domEl));
instance.setOption(option); instance.setOption(option);
chartInstance[domEl] = instance;
}; };
const dustInfo = reactive([ const dustInfo = reactive([
{ {
...@@ -455,14 +456,26 @@ const getDustDetail = () => { ...@@ -455,14 +456,26 @@ const getDustDetail = () => {
}, },
], ],
]; ];
indicatorFun(indicatorOneInstance, "indicatorOne", getGaugeOption({ indicatorFun(
indicatorOneInstance,
"indicatorOne",
getGaugeOption({
value: dustInfo[0].value / 100, value: dustInfo[0].value / 100,
chartName:'压差' chartName: "压差",
})); min: 1,
indicatorFun(indicatorTwoInstance, "indicatorTwo", getGaugeOption({ max: 100,
value: dustInfo[1].value / 55, })
chartName:'粉尘浓度' );
})); indicatorFun(
indicatorTwoInstance,
"indicatorTwo",
getGaugeOption({
value: dustInfo[1].value,
chartName: "粉尘浓度",
min: 5,
max: 50,
})
);
}) })
.catch(() => { .catch(() => {
dustInfo.forEach((item) => { dustInfo.forEach((item) => {
...@@ -470,28 +483,6 @@ const getDustDetail = () => { ...@@ -470,28 +483,6 @@ const getDustDetail = () => {
}); });
}); });
}; };
const testList = reactive([
{
id: 1,
info: "测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1",
},
{
id: 2,
info: "测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1",
},
{
id: 3,
info: "测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1",
},
// {
// id: 4,
// info: "测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1",
// },
// {
// id: 5,
// info: "测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1测试1",
// },
]);
const closedLoopInfoList = ref([]); const closedLoopInfoList = ref([]);
const warnInfoList = ref([]); const warnInfoList = ref([]);
// 获取告警信息 // 获取告警信息
...@@ -517,9 +508,20 @@ const getAlarmInfo = () => { ...@@ -517,9 +508,20 @@ const getAlarmInfo = () => {
warnInfoList.value = []; warnInfoList.value = [];
}); });
}; };
const resizeFun = () => {
indicatorOneInstance && indicatorOneInstance.value.resize();
indicatorTwoInstance && indicatorTwoInstance.value.resize();
Object.keys(chartInstance).forEach((key) => {
chartInstance[key] && chartInstance[key].resize();
});
};
onMounted(() => { onMounted(() => {
getDusterNameEnum(); getDusterNameEnum();
window.addEventListener("resize", resizeFun);
}); });
onUnmounted(() => {
window.removeEventListener("resize", resizeFun);
})
watch( watch(
() => form.dusterNo, () => form.dusterNo,
() => { () => {
......
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