flx:对接完善雨量监测接口

This commit is contained in:
X_Rian 2024-07-01 17:36:16 +08:00
parent abfca52c18
commit 7074de9ad7
12 changed files with 279 additions and 207 deletions

View File

@ -18,7 +18,6 @@ export const selectDustNoiseDataApi = (params: {}) => {
return http.post(BASEURL + `/xmgl/dustNoiseData/queryTodayTrendGroupByHour`, params); return http.post(BASEURL + `/xmgl/dustNoiseData/queryTodayTrendGroupByHour`, params);
}; };
//查询环境设备最新一条实时数据 //查询环境设备最新一条实时数据
export const getRealTimeDustNoiseDataApi = (params: {}) => { export const getRealTimeDustNoiseDataApi = (params: {}) => {
return http.post(BASEURL + `/xmgl/dustNoiseData/getRealTimeDustNoiseData`, params); return http.post(BASEURL + `/xmgl/dustNoiseData/getRealTimeDustNoiseData`, params);
@ -63,4 +62,16 @@ export const getRealTimeRainRecordApi = (params: {}) => {
// 晴雨表 // 晴雨表
export const getRainWeatherDataApi = (params: {}) => { export const getRainWeatherDataApi = (params: {}) => {
return http.post(BASEURL + `/xmgl/rainBigScreen/getWeatherData`, params); return http.post(BASEURL + `/xmgl/rainBigScreen/getWeatherData`, params);
}; };
//查询空气质量统计
export const getRainAirQualityStatisticsApi = (params: {}) => {
return http.post(BASEURL + `/xmgl/rainBigScreen/getAirQualityStatistics`, params);
};
//今日报警统计
export const getRainAlarmCountTotalApi = (params: {}) => {
return http.post(BASEURL + `/xmgl/rainBigScreen/selectRainAlarmCountTotal`, params);
};
//分页列表查询雨量监测报警记录信息
export const getRainAlarmPage = (params: {}) => {
return http.get(BASEURL + `/xmgl/rainAlarm/page`, params);
};

View File

@ -394,7 +394,7 @@ const getSpecialTrend = async (showLoading: boolean, val: number, isRight?: bool
console.log("特殊作业风险预测趋势", res.result); console.log("特殊作业风险预测趋势", res.result);
randerInfo2.dataList = [ randerInfo2.dataList = [
{ {
name: activeInfo.rightCount == 1 ? "恶劣天气影响风险概率预测" : "隐患未项影响风险概率预测", name: activeInfo.rightCount == 1 ? "恶劣天气影响风险概率预测" : "隐患未项影响风险概率预测",
value: [ value: [
res.result.specialOperationFireSafety, res.result.specialOperationFireSafety,
res.result.highJobSafe, res.result.highJobSafe,
@ -1681,7 +1681,7 @@ let dataList2 = ref([
// emits("openDialog", { // emits("openDialog", {
// index: 7, // index: 7,
// title: params.name + "", // title: params.name + "",
// majorInfo: { // majorInfo: {
// isOverdueRectification: 0, // isOverdueRectification: 0,
// isNotQualified: 1, // isNotQualified: 1,

View File

@ -76,24 +76,23 @@ const getRealTimeDustNoiseData = async () => {
}); });
if (res.result) { if (res.result) {
plantCap.value = res.result; plantCap.value = res.result;
} } else {
// else { plantCap.value = {
// plantCap.value = { crc: "--",
// crc: "--", humidity: "--",
// humidity: "--", noise: "--",
// noise: "--", plateHumidity: "--",
// plateHumidity: "--", plateTemperature: "--",
// plateTemperature: "--", pm10: "--",
// pm10: "--", pm25: "--",
// pm25: "--", pressure: "--",
// pressure: "--", temperature: "--",
// temperature: "--", tsp: "--",
// tsp: "--", voltage: "--",
// voltage: "--", winddirectionName: "--",
// winddirectionName: "--", windspeed: "--"
// windspeed: "--" };
// }; }
// }
// //
mitts.emit("currentDevDetail", currentDevDetail); mitts.emit("currentDevDetail", currentDevDetail);
}; };

View File

@ -16,7 +16,7 @@
v-for="(item, index) in noiseList" v-for="(item, index) in noiseList"
:key="index" :key="index"
:label="item.label" :label="item.label"
:value="item.value" :value="item.label"
@click="checkChange(item.label)" @click="checkChange(item.label)"
/> />
</el-select> </el-select>

View File

@ -10,7 +10,7 @@
<div class="num">{{ offlineDevNum }}</div> <div class="num">{{ offlineDevNum }}</div>
</div> </div>
</div> </div>
<div class="decivList"> <el-scrollbar class="decivList">
<div class="menuDev" v-for="item in deciData" :class="item.devOnline == 1 ? 'online' : 'offline'"> <div class="menuDev" v-for="item in deciData" :class="item.devOnline == 1 ? 'online' : 'offline'">
<div class="decName"> <div class="decName">
<span v-show="item.devOnline == 1"><img src="@/assets/images/dustNoise/onlineImg.png" alt="" /></span> <span v-show="item.devOnline == 1"><img src="@/assets/images/dustNoise/onlineImg.png" alt="" /></span>
@ -23,7 +23,7 @@
<img src="@/assets/images/noData.png" alt="" /> <img src="@/assets/images/noData.png" alt="" />
<p>暂无数据</p> <p>暂无数据</p>
</div> </div>
</div> </el-scrollbar>
</Card> </Card>
</template> </template>

View File

@ -377,10 +377,10 @@ let menuList = ref([
companyPath: "/sewageMonitor", companyPath: "/sewageMonitor",
menuName: "污水监测" menuName: "污水监测"
}, },
// { {
// companyPath: "/rainfallMonitoring", companyPath: "/rainfallMonitoring",
// menuName: "" menuName: "雨量监测"
// } }
] ]
}, },
{ {

View File

@ -16,13 +16,23 @@
<div class="gifImg"> <div class="gifImg">
<img src="@/assets/images/dustNoise/centerGif.gif" alt="" /> <img src="@/assets/images/dustNoise/centerGif.gif" alt="" />
</div> </div>
<div class="menListWd menu">温度:{{ plantCap.temperature || plantCap.temperature == '0' ? plantCap.temperature : "--" }}</div> <div class="menListWd menu">
<div class="menListSd menu">湿度:{{ plantCap.humidity || plantCap.humidity == '0' ? plantCap.humidity : "--" }}%RH</div> 空气温度:{{ plantCap.airTemperature || plantCap.airTemperature == "0" ? plantCap.airTemperature : "--" }}
<div class="menListPm2 menu">PM2.5:{{ plantCap.pm25 || plantCap.pm25 == '0' ? plantCap.pm25 : "--" }}ug/</div> </div>
<div class="menListTs menu">TSP:{{ plantCap.tsp || plantCap.tsp == '0' ? plantCap.tsp : "--" }}ug/</div> <div class="menListSd menu">
<div class="menListPm10 menu">PM10:{{ plantCap.pm10 || plantCap.pm10 == '0' ? plantCap.pm10 : "--" }}ug/</div> 空气湿度:{{ plantCap.airHumidity || plantCap.airHumidity == "0" ? plantCap.airHumidity : "--" }}%RH
<div class="menListZs menu">噪声:{{ plantCap.noise || plantCap.noise == '0' ? plantCap.noise : "--" }}dB</div> </div>
<div class="menListFs menu">风速:{{ plantCap.windspeed || plantCap.windspeed == '0' ? plantCap.windspeed : "--" }}m/s</div> <div class="menListPm2 menu">
大气压:{{ plantCap.atmosphericPressure || plantCap.atmosphericPressure == "0" ? plantCap.atmosphericPressure : "--" }}Kpa
</div>
<div class="menListTs menu">
今日雨量:{{ plantCap.currentRainfall || plantCap.currentRainfall == "0" ? plantCap.currentRainfall : "--" }}mm
</div>
<div class="menListPm10 menu">
昨日雨量:{{ plantCap.dailyRainfall || plantCap.dailyRainfall == "0" ? plantCap.dailyRainfall : "--" }}mm
</div>
<div class="menListZs menu">风力:{{ plantCap.windForce || plantCap.windForce == "0" ? plantCap.windForce : "--" }}</div>
<div class="menListFs menu">风速:{{ plantCap.windSpeed || plantCap.windSpeed == "0" ? plantCap.windSpeed : "--" }}m/s</div>
</div> </div>
</div> </div>
</template> </template>
@ -34,37 +44,37 @@ import mitts from "@/utils/bus"; //兄弟组件传值
import { ref, reactive, onMounted } from "vue"; import { ref, reactive, onMounted } from "vue";
const store = GlobalStore(); const store = GlobalStore();
let deviceName = ref(""); let deviceName = ref("");
let noiseList = ref([]); let noiseList = ref([] as any[]);
let plantCap = ref({ let plantCap = ref({
crc: "--", crc: "--",
humidity: "--", airHumidity: "--",
noise: "--", windForce: "--",
plateHumidity: "--", plateHumidity: "--",
plateTemperature: "--", plateTemperature: "--",
pm10: "--", dailyRainfall: "--",
pm25: "--", atmosphericPressure: "--",
pressure: "--", pressure: "--",
temperature: "--", airTemperature: "--",
tsp: "--", currentRainfall: "--",
voltage: "--", voltage: "--",
winddirectionName: "--", winddirectionName: "--",
windspeed: "--" windSpeed: "--"
}); } as any);
let currentDevDetail = reactive({}); let currentDevDetail = reactive({} as any);
// //
const realTimeMonitor = val => { const realTimeMonitor = (val: any) => {
currentDevDetail = val; currentDevDetail = val;
getRealTimeDustNoiseData(); getRealTimeDustNoiseData();
}; };
// //
const getList = async () => { const getList = async () => {
const res = await getRainDevlApi({ projectSn: store.sn }); const res: any = await getRainDevlApi({ projectSn: store.sn });
console.log("获取设备下拉", res); console.log("获取设备下拉", res);
if (res.result.length > 0) { if (res.result.length > 0) {
noiseList.value = res.result; noiseList.value = res.result;
deviceName.value = res.result[0].devName; deviceName.value = res.result[0].devName;
currentDevDetail = res.result[0]; currentDevDetail = res.result[0];
getRealTimeDustNoiseData(); getRealTimeDustNoiseData();
} }
}; };
@ -76,27 +86,29 @@ const getRealTimeDustNoiseData = async () => {
}); });
if (res.result) { if (res.result) {
plantCap.value = res.result; plantCap.value = res.result;
} } else {
// else { plantCap.value = {
// plantCap.value = { crc: "--",
// crc: "--", airHumidity: "--",
// humidity: "--", windForce: "--",
// noise: "--", plateHumidity: "--",
// plateHumidity: "--", plateTemperature: "--",
// plateTemperature: "--", dailyRainfall: "--",
// pm10: "--", atmosphericPressure: "--",
// pm25: "--", pressure: "--",
// pressure: "--", airTemperature: "--",
// temperature: "--", currentRainfall: "--",
// tsp: "--", voltage: "--",
// voltage: "--", winddirectionName: "--",
// winddirectionName: "--", windSpeed: "--"
// windspeed: "--" };
// }; }
// }
// //
mitts.emit("currentDevDetail", currentDevDetail); mitts.emit("currentDevDetail", currentDevDetail);
}; };
onMounted(() => { onMounted(() => {
getList(); getList();
}); });
@ -122,10 +134,10 @@ onMounted(() => {
font-family: OPPOSansH; font-family: OPPOSansH;
} }
} }
.content{ .content {
position: relative; position: relative;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.selectRight { .selectRight {

View File

@ -2,7 +2,7 @@
<Card title="趋势图"> <Card title="趋势图">
<div class="box"> <div class="box">
<div class="selectRight"> <div class="selectRight">
<!-- <el-date-picker <!-- <el-date-picker
style="width:100%" style="width:100%"
v-model="value1" v-model="value1"
type="daterange" type="daterange"
@ -11,20 +11,19 @@
end-placeholder="结束日期" end-placeholder="结束日期"
> >
</el-date-picker> --> </el-date-picker> -->
<el-select class="m-2" placeholder="Select" size="small" v-model="selectValue"> <el-select class="m-2" placeholder="Select" size="small" v-model="selectValue">
<el-option <el-option
v-for="(item, index) in noiseList" v-for="(item, index) in noiseList"
:key="index" :key="index"
:label="item.label" :label="item.label"
:value="item.value" :value="item.label"
@click="checkChange(item.label)" @click="checkChange(item.label)"
/> />
</el-select> </el-select>
</div> </div>
<div id="myEcharts" ref="myEcharts" style="width: 100%; height: 100%"></div> <div id="myEcharts" ref="myEcharts" style="width: 100%; height: 100%"></div>
</div> </div>
</Card> </Card>
</template> </template>
@ -36,23 +35,23 @@ import * as echarts from "echarts";
import Card from "@/components/card.vue"; import Card from "@/components/card.vue";
import mitts from "@/utils/bus"; // import mitts from "@/utils/bus"; //
const store = GlobalStore(); const store = GlobalStore();
let dustData_24 = ref([]); let dustData_24 = ref([] as any[]);
let xData = ref([]); let xData = ref([] as any[]);
let yData = ref([]); let yData = ref([] as any[]);
let chart = ref(); let chart = ref();
let yUnit = ref("单位:ug/m³") as any; let yUnit = ref("Kpa") as any;
const noiseList = [ const noiseList = [
{ {
value: 0, value: 0,
label: "PM2.5" label: "大气压"
}, },
{ {
value: 1, value: 1,
label: "PM10" label: "今日雨量"
}, },
{ {
value: 2, value: 2,
label: "噪声" label: "昨日雨量"
}, },
// { // {
// value: 3, // value: 3,
@ -64,19 +63,19 @@ const noiseList = [
}, },
{ {
value: 5, value: 5,
label: "TSP" label: "风力"
}, },
{ {
value: 6, value: 6,
label: "温度" label: "空气温度"
}, },
{ {
value: 7, value: 7,
label: "湿度" label: "空气湿度"
} }
]; ];
let receive = ref("" as any); let receive = ref("" as any);
let selectValue = ref("PM2.5" as any); let selectValue = ref("大气压" as any);
function drawChart() { function drawChart() {
let myEchart = echarts.init(document.getElementById("myEcharts")); let myEchart = echarts.init(document.getElementById("myEcharts"));
let option = { let option = {
@ -267,7 +266,7 @@ function drawChart() {
// } // }
} }
// //
const getList = async type => { const getList = async (type: any) => {
// //
// let now = new Date(); // let now = new Date();
// let yy = now.getFullYear(); // // let yy = now.getFullYear(); //
@ -278,47 +277,45 @@ const getList = async type => {
// time += mm + "-"; // time += mm + "-";
// if (dd < 10) time += "0"; // if (dd < 10) time += "0";
// time += dd; // time += dd;
const res = await selectRainDustNoiseDataApi({ const res: any = await selectRainDustNoiseDataApi({
// searchDate: time, // searchDate: time,
deviceId: type, devSn: type,
projectSn: store.sn projectSn: store.sn
}); });
console.log("左下角趋势图", res.result); console.log("左下角趋势图", res.result);
dustData_24.value = res.result; dustData_24.value = res.result;
xData.value = []; xData.value = [];
yData.value = []; yData.value = [];
res.result.forEach(item => { res.result.forEach((item: any) => {
xData.value.push(item.time); xData.value.push(item.time);
yData.value.push(item.pm25); yData.value.push(item.atmosphericPressure);
}); });
drawChart(); drawChart();
checkChange(selectValue.value);
}; };
const checkChange = (val: any) => { const checkChange = (val: any) => {
yData.value = []; yData.value = [];
dustData_24.value.forEach(item => { dustData_24.value.forEach((item: any) => {
if (val == "PM2.5") { if (val == "大气压") {
yData.value.push(item.pm25); yData.value.push(item.atmosphericPressure);
yUnit.value = "ug/m³"; yUnit.value = "Kpa";
} else if (val == "PM10") { } else if (val == "今日雨量") {
yData.value.push(item.pm10); yData.value.push(item.currentRainfall);
yUnit.value = "ug/m³"; yUnit.value = "mm";
} else if (val == "噪声") { } else if (val == "昨日雨量") {
yData.value.push(item.noise); yData.value.push(item.dailyRainfall);
yUnit.value = "dB"; yUnit.value = "mm";
} else if (val == "夜晚噪音") { } else if (val == "风力") {
yData.value.push(item.nightNoise); yData.value.push(item.windForce);
yUnit.value = "dB"; yUnit.value = "";
} else if (val == "风速") { } else if (val == "风速") {
yData.value.push(item.windspeed); yData.value.push(item.windSpeed);
yUnit.value = "m/s"; yUnit.value = "m/s";
} else if (val == "TSP") { } else if (val == "空气温度") {
yData.value.push(item.tsp); yData.value.push(item.airTemperature);
yUnit.value = "ug/m³";
} else if (val == "温度") {
yData.value.push(item.temperature);
yUnit.value = "℃"; yUnit.value = "℃";
} else if (val == "湿度") { } else if (val == "空气湿度") {
yData.value.push(item.humidity); yData.value.push(item.airHumidity);
yUnit.value = "%RH"; yUnit.value = "%RH";
} }
}); });
@ -335,14 +332,13 @@ onMounted(async () => {
// }, // },
// false // false
// ); // );
checkChange(selectValue.value); mitts.on("currentDevDetail", (e: any) => {
mitts.on("currentDevDetail", e => { console.log(11111, e);
receive.value = e.deviceId; receive.value = e.devSn;
getList(e.deviceId); getList(e.devSn);
}); });
}); });
// //
onBeforeUnmount(async () => { onBeforeUnmount(async () => {
mitts.off("currentDevDetail"); mitts.off("currentDevDetail");
echarts.dispose; echarts.dispose;
@ -350,17 +346,17 @@ onBeforeUnmount(async () => {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.box{ .box {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: relative; position: relative;
} }
.selectRight { .selectRight {
position: absolute; position: absolute;
left: 75%; left: 75%;
width: 20%; width: 20%;
top: 6%; top: 6%;
z-index: 9; z-index: 9;
} }
::v-deep .el-input__wrapper { ::v-deep .el-input__wrapper {

View File

@ -10,7 +10,7 @@
<div class="num">{{ offlineDevNum }}</div> <div class="num">{{ offlineDevNum }}</div>
</div> </div>
</div> </div>
<div class="decivList"> <el-scrollbar class="decivList">
<div class="menuDev" v-for="item in deciData" :class="item.online == 1 ? 'online' : 'offline'"> <div class="menuDev" v-for="item in deciData" :class="item.online == 1 ? 'online' : 'offline'">
<div class="decName"> <div class="decName">
<span v-show="item.online == 1"><img src="@/assets/images/dustNoise/onlineImg.png" alt="" /></span> <span v-show="item.online == 1"><img src="@/assets/images/dustNoise/onlineImg.png" alt="" /></span>
@ -23,7 +23,7 @@
<img src="@/assets/images/noData.png" alt="" /> <img src="@/assets/images/noData.png" alt="" />
<p>暂无数据</p> <p>暂无数据</p>
</div> </div>
</div> </el-scrollbar>
</Card> </Card>
</template> </template>
@ -90,6 +90,7 @@ onMounted(() => {
.decivList { .decivList {
width: 100%; width: 100%;
height: 70%; height: 70%;
// overflow-y: scroll;
.menuDev { .menuDev {
height: 20%; height: 20%;
background: url("@/assets/images/dustNoise/listImg.png") no-repeat; background: url("@/assets/images/dustNoise/listImg.png") no-repeat;

View File

@ -7,12 +7,19 @@
<div>报警类型</div> <div>报警类型</div>
</div> </div>
<div class="listBox" ref="scrollRef"> <div class="listBox" ref="scrollRef">
<el-scrollbar style="height: 80%"> <!-- <vue3-seamless-scroll :speed="1" :list="list" :limitScrollNum="5" :step="0.3" :hover="true" class="scroll">
<div v-for="item in list" class="listStyle"> <div v-for="item in list" :key="item.id" class="listStyle">
<div style="margin-left: 10px" class="dev">{{ item.deviceName }}</div> <div style="margin-left: 10px" class="dev">{{ item.deviceName }}</div>
<div>{{ item.tempAlarmTime }}</div> <div>{{ item.tempAlarmTime }}</div>
<div>{{ item.alarmTypeName }}</div> <div>{{ item.alarmTypeName }}</div>
</div> </div>
</vue3-seamless-scroll> -->
<el-scrollbar ref="refScrollbar" style="height: 80%">
<div v-for="item in list" :key="item.id" class="listStyle">
<div style="margin-left: 10px" class="dev">{{ item.devName }}</div>
<div>{{ item.alarmTime }}</div>
<div>{{ alarmListType[item.alarmType - 1] }}</div>
</div>
</el-scrollbar> </el-scrollbar>
<div class="notoDta" v-if="list.length == 0"> <div class="notoDta" v-if="list.length == 0">
<img src="@/assets/images/noData.png" alt="" /> <img src="@/assets/images/noData.png" alt="" />
@ -25,20 +32,66 @@
<script lang="ts" setup> <script lang="ts" setup>
import Card from "@/components/card.vue"; import Card from "@/components/card.vue";
import { selectNewEnvironmentAlarmListApi } from "@/api/modules/headNoise"; import { getRainAlarmPage } from "@/api/modules/headNoise";
import { GlobalStore } from "@/stores"; import { GlobalStore } from "@/stores";
import { ref, onMounted } from "vue"; import { ref, onMounted } from "vue";
const store = GlobalStore(); const store = GlobalStore();
const alarmListType = ref([
const list = ref([]); "风力",
"风速",
"风向",
"累计雨量",
"瞬时雨量",
"今日雨量",
"昨日雨量",
"空气温度",
"空气湿度",
"大气压"
] as any[]);
const refScrollbar = ref(null as any); //
const moreScroll = ref(true as any);
const pageNo = ref(1 as any);
const list = ref([] as any[]);
// //
const getList = async () => { const getList = async (tip: any) => {
const res = await selectNewEnvironmentAlarmListApi({ projectSn: store.sn }); const res: any = await getRainAlarmPage({
projectSn: store.sn,
pageNo: tip == "search" ? 1 : pageNo.value,
pageSize: 10
});
console.log("获取报警记录", res); console.log("获取报警记录", res);
list.value = res.result; if (tip == "more") {
const newResult = res.result.records.map((item: any) => {
return {
...item,
whiteSpace: false
};
});
list.value = list.value.concat(newResult);
} else {
list.value = res.result.records;
}
if (res.result.pages == pageNo.value) {
moreScroll.value = false;
} else {
pageNo.value = pageNo.value + 1;
}
// list.value = res.result;
}; };
onMounted(() => { onMounted(() => {
getList(); getList("search");
refScrollbar.value.wrapRef.addEventListener("scroll", (e: any) => {
const scrollTop = e.target.scrollTop;
const scrollHeight = e.target.scrollHeight;
const clientHeight = e.target.clientHeight;
//
if (scrollTop >= scrollHeight - clientHeight - 1) {
if (moreScroll.value) {
getList("more");
}
}
});
}); });
</script> </script>
@ -46,6 +99,7 @@ onMounted(() => {
.tableBox { .tableBox {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: relative;
.tabList { .tabList {
display: flex; display: flex;
@ -63,13 +117,14 @@ onMounted(() => {
div { div {
text-align: center; text-align: center;
width: 30%; width: 30%;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
} }
.listBox { .listBox {
height: 91%; height: 91%;
position: relative;
.listStyle { .listStyle {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
@ -78,7 +133,7 @@ onMounted(() => {
line-height: 25px; line-height: 25px;
font-size: calc(100vw * 12 / 1920); font-size: calc(100vw * 12 / 1920);
div { div {
text-align: center; text-align: center;
width: 30%; width: 30%;
white-space: nowrap; white-space: nowrap;
@ -91,11 +146,11 @@ onMounted(() => {
} }
} }
.notoDta { .notoDta {
top: 75%; top: 50%;
width: 12%; width: 50%;
margin: 5% -40%; left: 50%;
left: 120%;
position: absolute; position: absolute;
transform: translate(-50%, -50%);
img { img {
width: 40%; width: 40%;
margin: 5% 30%; margin: 5% 30%;
@ -103,7 +158,8 @@ onMounted(() => {
p { p {
color: #fff; color: #fff;
font-size: calc(100vw * 14 / 1920); font-size: calc(100vw * 14 / 1920);
margin: -6% 37%; margin: -6% 0;
text-align: center;
} }
} }
} }

View File

@ -9,10 +9,10 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, reactive, ref, onBeforeUnmount } from "vue"; import { onMounted, reactive, ref } from "vue";
import * as echarts from "echarts"; import * as echarts from "echarts";
import Card from "@/components/card.vue"; import Card from "@/components/card.vue";
import { getAlarmCountTotalApi } from "@/api/modules/headNoise"; import { getRainAlarmCountTotalApi } from "@/api/modules/headNoise";
import { GlobalStore } from "@/stores"; import { GlobalStore } from "@/stores";
const store = GlobalStore(); const store = GlobalStore();
// let timer = ref(null); // let timer = ref(null);
@ -23,22 +23,22 @@ const totalAlarm = ref(0);
// //
let totalData = ref([ let totalData = ref([
{ {
name: "噪声报警", name: "大气压报警",
value: 0, value: 0,
radio: 0 radio: 0
}, },
{ {
name: "PM2.5超标报警", name: "今日雨量报警",
value: 0, value: 0,
radio: 0 radio: 0
}, },
{ {
name: "PM10超标报警", name: "昨日雨量报警",
value: 0, value: 0,
radio: 0 radio: 0
}, },
{ {
name: "TSP报警", name: "风力报警",
value: 0, value: 0,
radio: 0 radio: 0
}, },
@ -61,19 +61,19 @@ let totalData = ref([
// //
let trafficWay = reactive([ let trafficWay = reactive([
{ {
name: "噪声报警", name: "大气压报警",
value: 10 value: 10
}, },
{ {
name: "PM2.5超标报警", name: "今日雨量报警",
value: 10 value: 10
}, },
{ {
name: "PM10超标报警", name: "昨日雨量报警",
value: 10 value: 10
}, },
{ {
name: "TSP报警", name: "风力报警",
value: 10 value: 10
}, },
{ {
@ -373,7 +373,7 @@ let option = ref({
} }
return num; return num;
}, },
data: ["噪声报警", "PM2.5超标报警", "PM10超标报警", "TSP报警", "温度报警", "湿度报警", "风速报警"], data: ["大气压报警", "今日雨量报警", "昨日雨量报警", "风力报警", "温度报警", "湿度报警", "风速报警"],
top: 20, top: 20,
right: 300, right: 300,
left: 280, left: 280,
@ -438,28 +438,28 @@ function getCirlPoint(x0, y0, r, angle) {
// } // }
// //
const getList = async () => { const getList = async () => {
const res = await getAlarmCountTotalApi({ const res: any = await getRainAlarmCountTotalApi({
sn: store.sn, projectSn: store.sn,
selectType: 1 selectType: 1
}); });
// console.log("", res); // console.log("", res);
if (res.result) { if (res.result) {
totalAlarm.value = res.result.totalAlarm; totalAlarm.value = res.result.totalAlarm;
for (let i = 0; i < totalData.value.length; i++) { for (let i = 0; i < totalData.value.length; i++) {
if (totalData.value[i].name == "噪声报警") { if (totalData.value[i].name == "大气压报警") {
totalData.value[i].value = res.result.noiseNum; totalData.value[i].value = res.result.atmosphericPressureNum;
} else if (totalData.value[i].name == "PM2.5超标报警") { } else if (totalData.value[i].name == "今日雨量报警") {
totalData.value[i].value = res.result.pm25Num; totalData.value[i].value = res.result.currentRainfallNum;
} else if (totalData.value[i].name == "PM10超标报警") { } else if (totalData.value[i].name == "昨日雨量报警") {
totalData.value[i].value = res.result.pm10Num; totalData.value[i].value = res.result.dailyRainfallNum;
} else if (totalData.value[i].name == "TSP报警") { } else if (totalData.value[i].name == "风力报警") {
totalData.value[i].value = res.result.tspNum; totalData.value[i].value = res.result.windForceNum;
} else if (totalData.value[i].name == "温度报警") { } else if (totalData.value[i].name == "温度报警") {
totalData.value[i].value = res.result.temperatureNum; totalData.value[i].value = res.result.airTemperatureNum;
} else if (totalData.value[i].name == "湿度报警") { } else if (totalData.value[i].name == "湿度报警") {
totalData.value[i].value = res.result.humidityNum; totalData.value[i].value = res.result.airHumidityNum;
} else if (totalData.value[i].name == "风速报警") { } else if (totalData.value[i].name == "风速报警") {
totalData.value[i].value = res.result.windspeedNum; totalData.value[i].value = res.result.windSpeedNum;
} }
} }
console.log("获取今日报警统计", totalData.value); console.log("获取今日报警统计", totalData.value);

View File

@ -2,36 +2,35 @@
<Card title="空气分析"> <Card title="空气分析">
<div class="box"> <div class="box">
<div class="rightHeader"> <div class="rightHeader">
<div <div
class="day" class="day"
:class="airType == 1 ? 'active' : ''" :class="airType == 1 ? 'active' : ''"
@click=" @click="
airType = 1; airType = 1;
getAirQualityStatistics(); getAirQualityStatistics();
" "
> >
最近30天 最近30天
</div> </div>
<div <div
class="year" class="year"
:class="airType == 2 ? 'active' : ''" :class="airType == 2 ? 'active' : ''"
@click=" @click="
airType = 2; airType = 2;
getAirQualityStatistics(); getAirQualityStatistics();
" "
> >
最近一年 最近一年
</div>
</div> </div>
<div id="rightEcharts" ref="rightEcharts" style="width: 100%; height: 100%"></div>
</div> </div>
<div id="rightEcharts" ref="rightEcharts" style="width: 100%; height: 100%"></div>
</div>
</Card> </Card>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { GlobalStore } from "@/stores"; import { GlobalStore } from "@/stores";
import { getAirQualityStatisticsApi } from "@/api/modules/headNoise"; import { getRainAirQualityStatisticsApi } from "@/api/modules/headNoise";
import * as echarts from "echarts"; import * as echarts from "echarts";
import { onMounted, reactive, ref } from "vue"; import { onMounted, reactive, ref } from "vue";
import Card from "@/components/card.vue"; import Card from "@/components/card.vue";
@ -183,7 +182,7 @@ function rightChart() {
// //
const getAirQualityStatistics = async () => { const getAirQualityStatistics = async () => {
const res = await getAirQualityStatisticsApi({ const res = await getRainAirQualityStatisticsApi({
type: airType.value, type: airType.value,
projectSn: store.sn projectSn: store.sn
}); });
@ -231,14 +230,12 @@ onMounted(async () => {
.day { .day {
width: 80%; width: 80%;
margin-right: 5%; margin-right: 5%;
z-index:99; z-index: 99;
} }
.year { .year {
width: 80%; width: 80%;
margin-right: 8%; margin-right: 8%;
z-index:99; z-index: 99;
} }
} }
</style> </style>