From 77539495356f5bf0bc69c7a72c09dd5490e66c00 Mon Sep 17 00:00:00 2001 From: zmj <1493694146@qq.com> Date: Fri, 15 Dec 2023 18:20:02 +0800 Subject: [PATCH] yemain1iuyd --- src/api.js | 22 +- src/components/areaMap.vue | 21 +- src/components/detail/centerBottom.vue | 99 ++++++ src/components/detail/leftCenter.vue | 44 +++ src/components/detail/leftTop.vue | 67 ++++ src/components/detail/rightBottom.vue | 79 +++++ src/components/detail/rightTop.vue | 117 +++++++ src/components/index/centerBottom.vue | 53 +++ src/components/index/leftBottom.vue | 59 ++++ src/components/index/leftCenter.vue | 429 ++++++++++++++++++++++--- src/components/index/leftTop.vue | 1 - src/components/index/rightTop.vue | 88 +++++ src/components/index/version.js | 1 - src/components/scrollTable.vue | 4 +- src/components/videoFlv.vue | 2 +- src/components/warnPop.vue | 330 +++++++++++++++++-- src/view/detail.vue | 399 +---------------------- src/view/home.vue | 299 ++--------------- src/view/login.vue | 1 - src/view/option.js | 2 +- 20 files changed, 1380 insertions(+), 737 deletions(-) create mode 100644 src/components/detail/centerBottom.vue create mode 100644 src/components/detail/leftCenter.vue create mode 100644 src/components/detail/leftTop.vue create mode 100644 src/components/detail/rightBottom.vue create mode 100644 src/components/detail/rightTop.vue create mode 100644 src/components/index/centerBottom.vue create mode 100644 src/components/index/leftBottom.vue create mode 100644 src/components/index/rightTop.vue delete mode 100644 src/components/index/version.js diff --git a/src/api.js b/src/api.js index f3acd75..00604ce 100644 --- a/src/api.js +++ b/src/api.js @@ -40,8 +40,22 @@ export function deviceAlarmCountApi(params) { return instacne.get('/api/dataview.device/deviceAlarmCount', { params }) } +export function deviceCountApi(params) { + return instacne.get('/api/dataview.device/deviceCount', { params }) +} +export function plantProductCountApi(params) { + return instacne.get('/api/dataview.land/plantProductCount', { params }) +} - -// -//api/dataview/merchant?mer_id=36&areaCode=510524&streetCode=510524100 -// } +export function landCollectionListApi(params) { + return instacne.get('/api/dataview.land/landCollectionList', { params }) +} +export function landMonitorAlarmHistoryApi(params) { + return instacne.get('/api/dataview.land/landMonitorAlarmHistory', { params }) +} +export function landListApi(params) { + return instacne.get('/api/dataview.land/landList', { params }) +} +export function productListApi(params) { + return instacne.get('/api/dataview.land/productList', { params }) +} diff --git a/src/components/areaMap.vue b/src/components/areaMap.vue index 6c227f6..dfe2c9b 100644 --- a/src/components/areaMap.vue +++ b/src/components/areaMap.vue @@ -41,12 +41,15 @@ + \ No newline at end of file diff --git a/src/components/detail/leftCenter.vue b/src/components/detail/leftCenter.vue new file mode 100644 index 0000000..bd7aa2e --- /dev/null +++ b/src/components/detail/leftCenter.vue @@ -0,0 +1,44 @@ + + \ No newline at end of file diff --git a/src/components/detail/leftTop.vue b/src/components/detail/leftTop.vue new file mode 100644 index 0000000..ea9b824 --- /dev/null +++ b/src/components/detail/leftTop.vue @@ -0,0 +1,67 @@ + + \ No newline at end of file diff --git a/src/components/detail/rightBottom.vue b/src/components/detail/rightBottom.vue new file mode 100644 index 0000000..d552432 --- /dev/null +++ b/src/components/detail/rightBottom.vue @@ -0,0 +1,79 @@ + + + + + + \ No newline at end of file diff --git a/src/components/detail/rightTop.vue b/src/components/detail/rightTop.vue new file mode 100644 index 0000000..8639fb3 --- /dev/null +++ b/src/components/detail/rightTop.vue @@ -0,0 +1,117 @@ + + + + + \ No newline at end of file diff --git a/src/components/index/centerBottom.vue b/src/components/index/centerBottom.vue new file mode 100644 index 0000000..2a18474 --- /dev/null +++ b/src/components/index/centerBottom.vue @@ -0,0 +1,53 @@ + + \ No newline at end of file diff --git a/src/components/index/leftBottom.vue b/src/components/index/leftBottom.vue new file mode 100644 index 0000000..49916b4 --- /dev/null +++ b/src/components/index/leftBottom.vue @@ -0,0 +1,59 @@ + + diff --git a/src/components/index/leftCenter.vue b/src/components/index/leftCenter.vue index 721b9dd..8a70a77 100644 --- a/src/components/index/leftCenter.vue +++ b/src/components/index/leftCenter.vue @@ -1,5 +1,5 @@ - \ No newline at end of file diff --git a/src/components/index/leftTop.vue b/src/components/index/leftTop.vue index 47b5e71..8d6cfec 100644 --- a/src/components/index/leftTop.vue +++ b/src/components/index/leftTop.vue @@ -54,7 +54,6 @@ onMounted( ()=>{ } ).then(res=>{ - console.log(res.data) res.data.list.forEach(item => { config3.data.push( [item.device_name, item.device_code, item.update_time, ` 详情 `,], diff --git a/src/components/index/rightTop.vue b/src/components/index/rightTop.vue new file mode 100644 index 0000000..e2247ab --- /dev/null +++ b/src/components/index/rightTop.vue @@ -0,0 +1,88 @@ + + + \ No newline at end of file diff --git a/src/components/index/version.js b/src/components/index/version.js deleted file mode 100644 index 0e66498..0000000 --- a/src/components/index/version.js +++ /dev/null @@ -1 +0,0 @@ -export const VERSION = '#VERSION#' \ No newline at end of file diff --git a/src/components/scrollTable.vue b/src/components/scrollTable.vue index 8188587..05196d7 100644 --- a/src/components/scrollTable.vue +++ b/src/components/scrollTable.vue @@ -2,12 +2,12 @@
+ `" :align="aligns[i]" v-html="headerItem" />
diff --git a/src/components/warnPop.vue b/src/components/warnPop.vue index d7cd13a..f0ed632 100644 --- a/src/components/warnPop.vue +++ b/src/components/warnPop.vue @@ -5,22 +5,21 @@
- 土壤温度(℃)已预警 10 (次) + 土壤温度(℃)已预警 {{ data.soil_temperature?.alarmCount }} (次)
- 土壤湿度(℃)已预警 10 (次) + 土壤湿度(℃)已预警 {{data.soil_moisture?.alarmCount }} (次)
-
- 土壤PH值 已预警 10 (次) + 土壤PH值 已预警 {{data.soil_PH?.alarmCount }} (次)
@@ -29,7 +28,7 @@
- 土壤氮磷钾 已预警 10 (次) + 土壤氮磷钾 已预警 {{data.soil_potassium_phosphate_nitrogen?.alarmCount }} (次)
@@ -37,7 +36,7 @@
- 土壤PH值 已预警 10 (次) + 风速(m/s) 已预警 {{ data.wind_speed?.alarmCount }} (次)
@@ -45,14 +44,14 @@
- 环境温度(℃)已预警 10 (次) + 环境温度(℃)已预警 {{ data.ambient_temperature?.alarmCount }} (次)
- 环境湿度(℃)已预警 10 (次) + 环境湿度(℃)已预警 {{ data.ambient_humidity?.alarmCount }} (次)
@@ -60,7 +59,7 @@
- 二氧化碳 已预警 10 (次) + 二氧化碳 已预警 {{ data.carbon_dioxide?.alarmCount }} (次)
@@ -138,6 +137,9 @@ import options from "@/view/option" import * as echarts from 'echarts'; import { ref, reactive, onMounted, defineEmits } from "vue" +import { landMonitorAlarmHistoryApi } from "@/api.js" + +const data=reactive({}) const emit = defineEmits(['off']) const off = () => { @@ -152,6 +154,305 @@ const initCharts = (tag, option) => { myChart.setOption(option); } + + + +const setoptionsFn = (X, Y) => { + + let data = { + color: ["#ffc20e", "#00ae9d"], + grid: { + top: "5%", + left: "2%", + right: "5%", + bottom: "5%", + containLabel: true + }, + tooltip: { + trigger: "axis", + backgroundColor: "rgba(61, 85, 102, 0.2)", + borderWidth: 1, + borderColor: "#9DBAE1", // 边框颜色 + // 选中线颜色 + axisPointer: { + lineStyle: { + color: "#9DBAE1" + } + }, + // 字体颜色 + textStyle: { + color: "#fff", + fontSize: 10 + } + }, + legend: { + right: "3%", + icon: "circle", + itemWidth: 8, + itemGap: 20, + textStyle: { + padding: [0, 0, 0, 5] + } + }, + xAxis: [ + { + show: false, + type: "category", + boundaryGap: false, + axisLabel: { + color: "#33a3dc", + fontSize: 14 + }, + axisLine: { + lineStyle: { + color: "rgba(255,255,255,.1)" + } + }, + data: X + } + ], + yAxis: [ + { + show: false, + type: "value", + name: "", + axisLabel: { + color: "#33a3dc", + fontSize: 14 + }, + splitLine: { + lineStyle: { + type: "solid", + color: "rgba(255,255,255,.1)", + width: 1 + } + } + } + ], + series: [ + { + name: "", + type: "line", + smooth: true, // 是否平滑曲线显示 + // symbol:'circle', // 默认是空心圆(中间是白色的),改成实心圆 + symbolSize: 0, + lineStyle: { + normal: { + color: "white" // 线条颜色 + } + }, + areaStyle: { + // 区域填充样式 + normal: { + // 线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。 + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, + [ + { offset: 0, color: "rgba(22,84,158, 0.8)" }, + { offset: 1, color: "rgba(22,84,158, 0.8)" } + ], + false + ) + // shadowColor: "rgba(53,142,215, 0.9)", // 阴影颜色 + // shadowBlur: 20 // shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。 + } + }, + data: Y + }, + + ] + } + return data +} + +const CKP = { + // backgroundColor: "#21263A", + // color: ["#ffc20e", "#00ae9d",'red'], + grid: { + top: "5%", + left: "2%", + right: "5%", + bottom: "5%", + containLabel: true + }, + tooltip: { + trigger: "axis", + backgroundColor: "rgba(61, 85, 102, 0.2)", + borderWidth: 1, + borderColor: "#9DBAE1", // 边框颜色 + // 选中线颜色 + axisPointer: { + lineStyle: { + color: "#9DBAE1" + } + }, + // 字体颜色 + textStyle: { + color: "#fff", + fontSize: 10 + } + }, + legend: { + right: "3%", + icon: "circle", + itemWidth: 8, + itemGap: 20, + show:false, + textStyle: { + padding: [0, 0, 0, 5] + } + }, + xAxis: [ + { + show: false, + type: "category", + boundaryGap: false, + axisLabel: { + color: "#33a3dc", + fontSize: 14 + }, + axisLine: { + lineStyle: { + color: "rgba(255,255,255,.1)" + } + }, + data: ["4月", "5月", "6月", "7月", "8月", "9月", "10月"] + } + ], + yAxis: [ + { + show: false, + type: "value", + name: "", + axisLabel: { + color: "#33a3dc", + fontSize: 14 + }, + splitLine: { + lineStyle: { + type: "solid", + color: "rgba(255,255,255,.1)", + width: 1 + } + } + } + ], + series: [ + { + name: "氮", + type: "line", + smooth: true, // 是否平滑曲线显示 + symbolSize: 0, + lineStyle: { + normal: { + color: "white" // 线条颜色 + } + }, + areaStyle: { + // 区域填充样式 + normal: { + // 线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。 + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, + [ + { offset: 0, color: "rgba(22,84,156, 0.8)" }, + { offset: 1, color: "rgba(22,84,156, 0)" } + ], + false + ) + // shadowColor: "rgba(53,142,215, 0.9)", // 阴影颜色 + // shadowBlur: 20 // shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。 + } + }, + data: [] + }, + { + name: "磷", + type: "line", + smooth: true, // 是否平滑曲线显示 + // symbol:'circle', // 默认是空心圆(中间是白色的),改成实心圆 + symbolSize: 0, + lineStyle: { + normal: { + color: "white" // 线条颜色 + } + }, + areaStyle: { + // 区域填充样式 + normal: { + // 线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。 + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, + [ + { offset: 0, color: "rgba(22,84,156, 0.8)" }, + { offset: 1, color: "rgba(22,84,156, 0)" } + ], + false + ) + // shadowColor: "rgba(53,142,215, 0.9)", // 阴影颜色 + // shadowBlur: 20 // shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。 + } + }, + data: [] + }, { + name: "钾", + type: "line", + smooth: true, // 是否平滑曲线显示 + // symbol:'circle', // 默认是空心圆(中间是白色的),改成实心圆 + symbolSize: 0, + lineStyle: { + normal: { + color: "white" // 线条颜色 + } + }, + areaStyle: { + // 区域填充样式 + normal: { + // 线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。 + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, + [ + { offset: 0, color: "rgba(22,84,156, 0.8)" }, + { offset: 1, color: "rgba(22,84,156, 0)" } + ], + false + ) + // shadowColor: "rgba(53,142,215, 0.9)", // 阴影颜色 + // shadowBlur: 20 // shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。 + } + }, + data: [] + } + ] +} + + + + +landMonitorAlarmHistoryApi({ + areaCode: 510521, + streetCode: 510521100, + land_id: 18 +}).then(res => { + + + for (let key in res.data.list){ + data[key]=res.data.list[key] + } + console.log(data,5656) + + 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_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('r_t', setoptionsFn(res.data.list.ambient_temperature.historyList[0].time, res.data.list.ambient_temperature.historyList[1].value)) + initCharts('r_c', setoptionsFn(res.data.list.ambient_humidity.historyList[0].time, res.data.list.ambient_humidity.historyList[1].value)) + initCharts('r_b', setoptionsFn(res.data.list.carbon_dioxide.historyList[0].time, res.data.list.carbon_dioxide.historyList[1].value)) + CKP.xAxis[0].data = res.data.list.soil_potassium_phosphate_nitrogen.historyList[0].time + let value = res.data.list.soil_potassium_phosphate_nitrogen.historyList[1].value + value.forEach(item => { + CKP.series[0].data.push(item.soil_potassium_phosphate_nitrogen) + CKP.series[1].data.push(item.soil_potassium_phosphate_phosphorus) + CKP.series[2].data.push(item.soil_potassium_phosphate_potassium) + }) + initCharts('c_t', CKP) +}) onMounted(() => { document.getElementById("l_t").removeAttribute('_echarts_instance_'); document.getElementById("l_c").removeAttribute('_echarts_instance_'); @@ -161,15 +462,6 @@ onMounted(() => { document.getElementById("r_t").removeAttribute('_echarts_instance_'); document.getElementById("r_c").removeAttribute('_echarts_instance_'); document.getElementById("r_b").removeAttribute('_echarts_instance_'); - initCharts('l_t', options.plant_temp) - initCharts('l_c', options.plant_temp) - initCharts('l_b', options.plant_temp) - initCharts('c_t', options.CKP) - initCharts('c_b', options.plant_temp) - initCharts('r_t', options.plant_temp) - initCharts('r_c', options.plant_temp) - initCharts('r_b', options.plant_temp) - // initCharts('offline', options.offLine) - + }) \ No newline at end of file diff --git a/src/view/detail.vue b/src/view/detail.vue index 0fe473f..18f4ea9 100644 --- a/src/view/detail.vue +++ b/src/view/detail.vue @@ -2,26 +2,10 @@
-
- 种植总面积: -
- 2 - 2 - 2 - 2 -
-
-
种植种类:
-
-
-
地块
-
-
+
-
- - +
- -
- -
- - {{ item.name }} - {{ item.value }}{{ item.unit }} - 状态正常 - 状态正常 - -
- +
-
-
监控设备总数: 1528
-
-
- - -
- -
-
-
- -
-
- - -
- -
-
- 在线设备统计:1418 台 -
-
- 离线设备统计:1418 - 台 -
-
-
+
- - - - - - -
-
- - {{ item.name }} - {{ item.value }} {{ item.unit }} - 状态正常 - 状态异常 - - -
- +
@@ -113,179 +38,14 @@