From d76f29a5a20e6b7250c3f4ee0a78869e535f69a9 Mon Sep 17 00:00:00 2001
From: weipengfei <2187978347@qq.com>
Date: Wed, 21 Feb 2024 18:07:33 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/api.js | 10 +++++
src/view/delivery/components/center.vue | 24 +++++++++--
src/view/delivery/components/right.vue | 23 +++++++++--
src/view/delivery/components/rightCard.vue | 38 ++++++++++++++---
src/view/delivery/index.vue | 11 +++--
src/view/index/components/left.vue | 22 ++++++----
src/view/index/components/right.vue | 26 +++++++++---
src/view/indexc/components/center2.vue | 47 +++++++++++++++++-----
8 files changed, 162 insertions(+), 39 deletions(-)
diff --git a/src/api/api.js b/src/api/api.js
index 66ec694..a452973 100644
--- a/src/api/api.js
+++ b/src/api/api.js
@@ -39,4 +39,14 @@ export const getFarmDeviceAlarmCount = (data) => {
// 具体基地设备警告
export const getFarmInfo = (data) => {
return axios.get('dataview.farm/farmInfo', { params: data });
+}
+
+// 硬件产品
+export const getDeviceDesc = (data) => {
+ return axios.get('dataview.device/deviceDesc', { params: data });
+}
+
+// 智能监测数据
+export const getAlarmRangeList = (data) => {
+ return axios.get('dataview.farm/alarmRangeList', { params: data });
}
\ No newline at end of file
diff --git a/src/view/delivery/components/center.vue b/src/view/delivery/components/center.vue
index 335d689..fb464aa 100644
--- a/src/view/delivery/components/center.vue
+++ b/src/view/delivery/components/center.vue
@@ -542,10 +542,17 @@ onMounted(() => {
if (route.query.name) {
filterMap()
}
- dataValue = props.list;
- dataValue[0] = {
- name: '福集镇养殖基地',
- value: [105.36, 29.20]
+ // dataValue = props.list;
+ // dataValue[0] = {
+ // name: '福集镇养殖基地',
+ // value: [105.36, 29.20]
+ // }
+ if(route.query.local){
+ dataValue[0] = {
+ name: route.query.farm_name,
+ value: route.query.local.split(',')
+ };
+ console.log(dataValue);
}
// changeType('luxian');
mapInfo();
@@ -571,6 +578,7 @@ onMounted(() => {
+ {{ route.query.farm_name }}
@@ -607,5 +615,13 @@ onMounted(() => {
height: 100%;
}
}
+ .map-t{
+ position: absolute;
+ top: 2rem;
+ left: 2rem;
+ color: #fff;
+ font-family: 'ifonts';
+ font-size: 1.4rem;
+ }
}
diff --git a/src/view/delivery/components/right.vue b/src/view/delivery/components/right.vue
index 827ef3f..6ff7f2b 100644
--- a/src/view/delivery/components/right.vue
+++ b/src/view/delivery/components/right.vue
@@ -1,10 +1,26 @@
@@ -18,8 +34,9 @@ onMounted(() => {
diff --git a/src/view/delivery/components/rightCard.vue b/src/view/delivery/components/rightCard.vue
index e3ba79c..f3ebd13 100644
--- a/src/view/delivery/components/rightCard.vue
+++ b/src/view/delivery/components/rightCard.vue
@@ -2,13 +2,38 @@
import { ref, reactive, onMounted } from "vue"
import * as echarts from "echarts"
+const props = defineProps({
+ info: {
+ type: Object,
+ default: ()=>{}
+ }
+})
+
+function getRecentSevenDays() {
+ const dates = [];
+
+ for (let i = 6; i >= 0; i--) {
+ const date = new Date();
+ date.setDate(date.getDate() - i);
+
+ const month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
+ const day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
+
+ const formattedDate = month + '-' + day;
+ dates.push(formattedDate);
+ }
+
+ return dates;
+}
+
+
const chartsRef = ref(null)
const initMap = () => {
const charts = echarts.init(chartsRef.value);
let option = {
title: {
show: true,
- text: '甲烷',
+ text: props.info.name,
top: "10%",
left: "12%",
textStyle: {
@@ -62,7 +87,7 @@ const initMap = () => {
color: '#fff',
},
},
- data: ['12.01', '12.02', '12.03', '12.04', '12.05', '12.06', '12.07'],
+ data: getRecentSevenDays(),
},
],
yAxis: [
@@ -91,7 +116,7 @@ const initMap = () => {
],
series: [
{
- name: '工厂1',
+ name: '线',
type: 'line',
smooth: true,
// showSymbol: false,/
@@ -124,7 +149,7 @@ const initMap = () => {
shadowBlur: 10,
},
},
- data: [100, 138, 350, 173, 180, 150, 180],
+ data: props.info.RangeMonitorData,
},
],
}
@@ -140,8 +165,8 @@ onMounted(() => {
监测正常
-
-
甲烷监测设备
+
+
{{ info.name }}
@@ -155,6 +180,7 @@ onMounted(() => {
justify-content: space-evenly;
.left {
height: 100%;
+ width: 6rem;
display: flex;
flex-direction: column;
justify-content: center;
diff --git a/src/view/delivery/index.vue b/src/view/delivery/index.vue
index 1b34c59..31d12ac 100644
--- a/src/view/delivery/index.vue
+++ b/src/view/delivery/index.vue
@@ -4,22 +4,25 @@ import leftItme from "./components/left.vue";
import centerItme from "./components/center.vue";
import bottomItme from "./components/bottom.vue";
import { useRoute } from 'vue-router';
+import { ref } from "vue";
+
const route = useRoute();
+const key = ref(Date.now());
diff --git a/src/view/index/components/left.vue b/src/view/index/components/left.vue
index 3788044..edbd00a 100644
--- a/src/view/index/components/left.vue
+++ b/src/view/index/components/left.vue
@@ -266,7 +266,7 @@ onMounted(() => {
养殖规模
-
{{ farmInfo.totalScale }}亩
+
{{ farmInfo.totalScale }}只
{
-
{{ farmList[0].farm_name }}
+
+
{{ farmList[0]?.farm_name || "" }}
-
{{ farmList[1].farm_name }}
+
+
{{ farmList[1]?.farm_name || "" }}
-
{{ farmList[2].farm_name }}
+
+
{{ farmList[2]?.farm_name || "" }}
-
{{ farmList[3].farm_name }}
+
+
{{ farmList[3]?.farm_name || "" }}
-
-
+
+
查看全部
diff --git a/src/view/index/components/right.vue b/src/view/index/components/right.vue
index 7504846..3c1d8e9 100644
--- a/src/view/index/components/right.vue
+++ b/src/view/index/components/right.vue
@@ -1,5 +1,9 @@
@@ -41,13 +55,13 @@ onMounted(() => {
-
+
-
-
4G中转站
+
+
{{item.name}}
- 主要功能详细介绍,主要功能详细介绍,主要功能详细介绍,主要功能详细介绍,主要功能详细介绍,主要功能详细介绍,主要功能详细介绍,主要功能详细介绍,
+ {{ item.desc }}
diff --git a/src/view/indexc/components/center2.vue b/src/view/indexc/components/center2.vue
index 73474bb..767cbbb 100644
--- a/src/view/indexc/components/center2.vue
+++ b/src/view/indexc/components/center2.vue
@@ -1,9 +1,10 @@