新增展馆展示

This commit is contained in:
lxz 2024-01-02 18:13:39 +08:00
parent 5bc6506e55
commit f5b4cdc073
4 changed files with 35 additions and 41 deletions

View File

@ -6,7 +6,7 @@ import scrollTable from "@/components/scrollTable.vue"
import { ref, reactive, onMounted } from "vue" import { ref, reactive, onMounted } from "vue"
import { plantProductCountApi } from "@/api.js" import { plantProductCountApi } from "@/api.js"
import { areaObj } from "@/store/index.js" import { areaObj } from "@/store/index.js"
const userInfoStore=areaObj() const userInfoStore = areaObj()
// ...userInfoStore.userInfo // ...userInfoStore.userInfo
const alignFn = (num) => { const alignFn = (num) => {
let arr = [] let arr = []
@ -22,7 +22,7 @@ const config2 = reactive({
headerStyle: "background:#0E316B", headerStyle: "background:#0E316B",
align: alignFn(4), align: alignFn(4),
data: [ ] data: []
}) })
@ -52,7 +52,7 @@ plantProductCountApi(
).then(res => { ).then(res => {
correctionListFn(res.data.list).forEach(item => { correctionListFn(res.data.list).forEach(item => {
config2.data.push( config2.data.push(
[item[0].kind, `<img src=${ item[0].qr_code} style='width:25px;height:25px;transform: translateY(5PX);'/>` , item[1].kind,`<img src=${ item[1].qr_code} style='width:25px;height:25px;transform: translateY(5PX);'/>` ] [item[0].kind, `<img src=${item[0].qr_code} style='width:25px;height:25px;transform: translateY(5PX);'/>`, item[1].kind, `<img src=${item[1].qr_code} style='width:25px;height:25px;transform: translateY(5PX);'/>`]
) )
}) })
}) })

View File

@ -46,7 +46,7 @@ const setOnlineFn = (data) => {
title: [ title: [
{ {
text: (data.value / data.total * 100) + '%', text: (data.value / data.total * 100).toFixed(2) + '%',
x: 'center', x: 'center',
top: '42%', top: '42%',
textStyle: { textStyle: {

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="content" id="eq"> <div class="content" id="eq">
<div class="eq" v-for="item in productList" :key="item"> <div class="eq" v-for="item in productList" :key="item">
<img :src="item.image" style="width:8vw;height: 100%;border-radius: 1vh;" alt=""> <img :src="item.image" style="height: 100%;border-radius: 1vh;" alt="">
<div <div
style="display: flex;flex-direction: column;justify-content: space-between;margin-left: 1vw;color: #CAD5E5;"> style="display: flex;flex-direction: column;justify-content: space-between;margin-left: 1vw;color: #CAD5E5;">
<div style="display: flex;align-items: center;"> <div style="display: flex;align-items: center;">

View File

@ -4,22 +4,22 @@
<div class="l"> <div class="l">
<div style="position: relative;padding-top: 5px;"> <div style="position: relative;padding-top: 5px;">
<div style="position: absolute;top: 0;"> <div style="position: absolute;top: 0;font-size: 10px;">
土壤温度已预警 <span style="color: #B7555A;">{{ data.soil_temperature?.alarmCount }}</span> 土壤温度已预警 <span style="color: #B7555A;">{{ data.soil_temperature?.alarmCount }}</span>
</div> </div>
<div class="t" style="width: 15vw;" id="l_t"></div> <div class="t" style="width: 15vw;" id="l_t"></div>
</div> </div>
<div style="position: relative;padding-top: 5px;"> <div style="position: relative;padding-top: 5px;">
<div style="position: absolute;top: 0;"> <div style="position: absolute;top: 0;font-size: 10px;">
土壤湿度已预警 <span style="color: #B7555A;">{{data.soil_moisture?.alarmCount }}</span> 土壤湿度已预警 <span style="color: #B7555A;">{{ data.soil_moisture?.alarmCount }}</span>
</div> </div>
<div class="t" id="l_c"></div> <div class="t" id="l_c"></div>
</div> </div>
<div style="position: relative;padding-top: 5px;"> <div style="position: relative;padding-top: 5px;">
<div style="position: absolute;top: 0;"> <div style="position: absolute;top: 0;font-size: 10px;">
土壤PH值 已预警 <span style="color: #B7555A;">{{data.soil_PH?.alarmCount }}</span> 土壤PH值 已预警 <span style="color: #B7555A;">{{ data.soil_PH?.alarmCount }}</span>
</div> </div>
<div class="t" id="l_b"></div> <div class="t" id="l_b"></div>
</div> </div>
@ -27,15 +27,16 @@
<div class="c"> <div class="c">
<div> <div>
<div style="position: absolute;top: 0;"> <div style="position: absolute;top: 0;font-size: 10px;margin-bottom: 2px;">
土壤氮磷钾 已预警 <span style="color: #B7555A;">{{data.soil_potassium_phosphate_nitrogen?.alarmCount }}</span> 土壤氮磷钾 已预警 <span style="color: #B7555A;">{{ data.soil_potassium_phosphate_nitrogen?.alarmCount }}</span>
</div> </div>
<div class="c-t" id="c_t"></div> <div class="c-t" id="c_t"></div>
</div> </div>
<div class="c-b"> <div class="c-b">
<div style="position: absolute;top: 0;left: 5vw;"> <div style="position: absolute;top: 0;left: 5vw;font-size: 10px;">
风速m/s 已预警 <span style="color: #B7555A;">{{ data.wind_speed?.alarmCount }}</span> 风速m/s 已预警 <span style="color: #B7555A;">{{ data.wind_speed?.alarmCount }}</span>
</div> </div>
<div id="c_b" style="width: 100%;height: 100%;"></div> <div id="c_b" style="width: 100%;height: 100%;"></div>
@ -43,14 +44,14 @@
</div> </div>
<div class="l"> <div class="l">
<div style="position: relative;padding-top: 5px;"> <div style="position: relative;padding-top: 5px;">
<div style="position: absolute;top: 0;"> <div style="position: absolute;top: 0;font-size: 10px;">
环境温度已预警 <span style="color: #B7555A;">{{ data.ambient_temperature?.alarmCount }}</span> 环境温度已预警 <span style="color: #B7555A;">{{ data.ambient_temperature?.alarmCount }}</span>
</div> </div>
<div class="t" style="width: 14vw;" id="r_t"></div> <div class="t" style="width: 14vw;" id="r_t"></div>
</div> </div>
<div style="position: relative;padding-top: 5px;"> <div style="position: relative;padding-top: 5px;">
<div style="position: absolute;top: 0;"> <div style="position: absolute;top: 0;font-size: 10px;">
环境湿度已预警 <span style="color: #B7555A;">{{ data.ambient_humidity?.alarmCount }}</span> 环境湿度已预警 <span style="color: #B7555A;">{{ data.ambient_humidity?.alarmCount }}</span>
</div> </div>
<div class="t" id="r_c"></div> <div class="t" id="r_c"></div>
@ -58,7 +59,7 @@
<!-- <div class="l-c"></div> --> <!-- <div class="l-c"></div> -->
<div style="position: relative;padding-top: 5px;"> <div style="position: relative;padding-top: 5px;">
<div style="position: absolute;top: 0;"> <div style="position: absolute;top: 0;font-size: 10px;">
二氧化碳 已预警 <span style="color: #B7555A;">{{ data.carbon_dioxide?.alarmCount }}</span> 二氧化碳 已预警 <span style="color: #B7555A;">{{ data.carbon_dioxide?.alarmCount }}</span>
</div> </div>
<div class="t" id="r_b"></div> <div class="t" id="r_b"></div>
@ -136,17 +137,17 @@
<script setup> <script setup>
import options from "@/view/option" import options from "@/view/option"
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import { ref, reactive, onMounted, defineEmits,defineProps } from "vue" import { ref, reactive, onMounted, defineEmits, defineProps } from "vue"
import { landMonitorAlarmHistoryApi } from "@/api.js" import { landMonitorAlarmHistoryApi } from "@/api.js"
import { areaObj } from "@/store/index.js" import { areaObj } from "@/store/index.js"
const userStore=areaObj() const userStore = areaObj()
const props = defineProps({ const props = defineProps({
item:Object, item: Object,
}) })
const data=reactive({}) const data = reactive({})
const emit = defineEmits(['off']) const emit = defineEmits(['off'])
const off = () => { const off = () => {
@ -164,7 +165,7 @@ const initCharts = (tag, option) => {
const setoptionsFn = (X, Y) => { const setoptionsFn = (X, Y, tits) => {
let data = { let data = {
color: ["#ffc20e", "#00ae9d"], color: ["#ffc20e", "#00ae9d"],
@ -179,6 +180,7 @@ const setoptionsFn = (X, Y) => {
trigger: "axis", trigger: "axis",
backgroundColor: "rgba(61, 85, 102, 0.2)", backgroundColor: "rgba(61, 85, 102, 0.2)",
borderWidth: 1, borderWidth: 1,
confine:true,
borderColor: "#9DBAE1", // borderColor: "#9DBAE1", //
// 线 // 线
axisPointer: { axisPointer: {
@ -189,16 +191,7 @@ const setoptionsFn = (X, Y) => {
// //
textStyle: { textStyle: {
color: "#fff", color: "#fff",
fontSize: 10 fontSize: 8
}
},
legend: {
right: "3%",
icon: "circle",
itemWidth: 8,
itemGap: 20,
textStyle: {
padding: [0, 0, 0, 5]
} }
}, },
xAxis: [ xAxis: [
@ -238,7 +231,7 @@ const setoptionsFn = (X, Y) => {
], ],
series: [ series: [
{ {
name: "", name: tits,
type: "line", type: "line",
smooth: true, // 线 smooth: true, // 线
// symbol:'circle', // // symbol:'circle', //
@ -285,6 +278,7 @@ const CKP = {
trigger: "axis", trigger: "axis",
backgroundColor: "rgba(61, 85, 102, 0.2)", backgroundColor: "rgba(61, 85, 102, 0.2)",
borderWidth: 1, borderWidth: 1,
confine:true,
borderColor: "#9DBAE1", // borderColor: "#9DBAE1", //
// 线 // 线
axisPointer: { axisPointer: {
@ -303,7 +297,7 @@ const CKP = {
icon: "circle", icon: "circle",
itemWidth: 8, itemWidth: 8,
itemGap: 20, itemGap: 20,
show:false, show: false,
textStyle: { textStyle: {
padding: [0, 0, 0, 5] padding: [0, 0, 0, 5]
} }
@ -438,12 +432,12 @@ landMonitorAlarmHistoryApi({
}).then(res => { }).then(res => {
for (let key in res.data.list){ for (let key in res.data.list) {
data[key]=res.data.list[key] data[key] = res.data.list[key]
} }
initCharts('l_t', setoptionsFn(res.data.list.soil_temperature.historyList[0].time, res.data.list.soil_temperature.historyList[1].value)) initCharts('l_t', setoptionsFn(res.data.list.soil_temperature.historyList[0].time, res.data.list.soil_temperature.historyList[1].value),'土壤温度')
initCharts('l_c', setoptionsFn(res.data.list.soil_moisture.historyList[0].time, res.data.list.soil_moisture.historyList[1].value)) initCharts('l_c', setoptionsFn(res.data.list.soil_moisture.historyList[0].time, res.data.list.soil_moisture.historyList[1].value),'土壤湿度')
initCharts('l_b', setoptionsFn(res.data.list.soil_PH.historyList[0].time, res.data.list.soil_PH.historyList[1].value)) initCharts('l_b', setoptionsFn(res.data.list.soil_PH.historyList[0].time, res.data.list.soil_PH.historyList[1].value))
initCharts('c_b', setoptionsFn(res.data.list.wind_speed.historyList[0].time, res.data.list.wind_speed.historyList[1].value)) initCharts('c_b', setoptionsFn(res.data.list.wind_speed.historyList[0].time, res.data.list.wind_speed.historyList[1].value))
initCharts('r_t', setoptionsFn(res.data.list.ambient_temperature.historyList[0].time, res.data.list.ambient_temperature.historyList[1].value)) initCharts('r_t', setoptionsFn(res.data.list.ambient_temperature.historyList[0].time, res.data.list.ambient_temperature.historyList[1].value))