|
@@ -1,10 +1,17 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div ref="chartDom" class="chart"></div>
|
|
|
|
|
|
|
+ <div class="chart-wrap">
|
|
|
|
|
+ <div ref="chartDom" class="chart">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="chart-weather">
|
|
|
|
|
+ <i class="chart-i" v-for="(item, index) in weatherChartData" :key="index" :class="'qi-' + item.iconDay + '-fill'"></i>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
import { onMounted, ref, nextTick } from "vue";
|
|
import { onMounted, ref, nextTick } from "vue";
|
|
|
import * as echarts from "echarts";
|
|
import * as echarts from "echarts";
|
|
|
|
|
+import "qweather-icons/font/qweather-icons.css";
|
|
|
|
|
|
|
|
// const props = defineProps({
|
|
// const props = defineProps({
|
|
|
// list: {
|
|
// list: {
|
|
@@ -16,13 +23,6 @@ import * as echarts from "echarts";
|
|
|
|
|
|
|
|
let demoData = [
|
|
let demoData = [
|
|
|
{
|
|
{
|
|
|
- sourceof: null,
|
|
|
|
|
- create_by: null,
|
|
|
|
|
- update_by: null,
|
|
|
|
|
- remark: null,
|
|
|
|
|
- sys_dept_code: null,
|
|
|
|
|
- createTime: null,
|
|
|
|
|
- updateTime: null,
|
|
|
|
|
rq: "08/28",
|
|
rq: "08/28",
|
|
|
weatherZgwd: 30,
|
|
weatherZgwd: 30,
|
|
|
weatherZdwd: 18,
|
|
weatherZdwd: 18,
|
|
@@ -30,20 +30,9 @@ let demoData = [
|
|
|
weatherTqNight: "晴",
|
|
weatherTqNight: "晴",
|
|
|
weatherImgDay: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
weatherImgDay: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
|
weatherImgNight: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
weatherImgNight: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
|
- windDirectDay: "南风",
|
|
|
|
|
- windDirectNight: "南风",
|
|
|
|
|
- windPowerDay: "微风",
|
|
|
|
|
- windPowerNight: "微风",
|
|
|
|
|
week: "星期三",
|
|
week: "星期三",
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- sourceof: null,
|
|
|
|
|
- create_by: null,
|
|
|
|
|
- update_by: null,
|
|
|
|
|
- remark: null,
|
|
|
|
|
- sys_dept_code: null,
|
|
|
|
|
- createTime: null,
|
|
|
|
|
- updateTime: null,
|
|
|
|
|
rq: "08/29",
|
|
rq: "08/29",
|
|
|
weatherZgwd: 31,
|
|
weatherZgwd: 31,
|
|
|
weatherZdwd: 19,
|
|
weatherZdwd: 19,
|
|
@@ -51,20 +40,9 @@ let demoData = [
|
|
|
weatherTqNight: "晴",
|
|
weatherTqNight: "晴",
|
|
|
weatherImgDay: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
weatherImgDay: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
|
weatherImgNight: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
weatherImgNight: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
|
- windDirectDay: "南风",
|
|
|
|
|
- windDirectNight: "南风",
|
|
|
|
|
- windPowerDay: "微风",
|
|
|
|
|
- windPowerNight: "微风",
|
|
|
|
|
week: "星期四",
|
|
week: "星期四",
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- sourceof: null,
|
|
|
|
|
- create_by: null,
|
|
|
|
|
- update_by: null,
|
|
|
|
|
- remark: null,
|
|
|
|
|
- sys_dept_code: null,
|
|
|
|
|
- createTime: null,
|
|
|
|
|
- updateTime: null,
|
|
|
|
|
rq: "08/30",
|
|
rq: "08/30",
|
|
|
weatherZgwd: 30,
|
|
weatherZgwd: 30,
|
|
|
weatherZdwd: 19,
|
|
weatherZdwd: 19,
|
|
@@ -72,20 +50,9 @@ let demoData = [
|
|
|
weatherTqNight: "多云",
|
|
weatherTqNight: "多云",
|
|
|
weatherImgDay: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
weatherImgDay: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
|
weatherImgNight: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
weatherImgNight: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
|
- windDirectDay: "西南风",
|
|
|
|
|
- windDirectNight: "北风",
|
|
|
|
|
- windPowerDay: "微风",
|
|
|
|
|
- windPowerNight: "微风",
|
|
|
|
|
week: "星期五",
|
|
week: "星期五",
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- sourceof: null,
|
|
|
|
|
- create_by: null,
|
|
|
|
|
- update_by: null,
|
|
|
|
|
- remark: null,
|
|
|
|
|
- sys_dept_code: null,
|
|
|
|
|
- createTime: null,
|
|
|
|
|
- updateTime: null,
|
|
|
|
|
rq: "08/31",
|
|
rq: "08/31",
|
|
|
weatherZgwd: 30,
|
|
weatherZgwd: 30,
|
|
|
weatherZdwd: 21,
|
|
weatherZdwd: 21,
|
|
@@ -93,20 +60,9 @@ let demoData = [
|
|
|
weatherTqNight: "雷阵雨",
|
|
weatherTqNight: "雷阵雨",
|
|
|
weatherImgDay: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
weatherImgDay: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
|
weatherImgNight: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
weatherImgNight: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
|
- windDirectDay: "北风",
|
|
|
|
|
- windDirectNight: "南风",
|
|
|
|
|
- windPowerDay: "3~4级",
|
|
|
|
|
- windPowerNight: "3~4级",
|
|
|
|
|
week: "星期六",
|
|
week: "星期六",
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- sourceof: null,
|
|
|
|
|
- create_by: null,
|
|
|
|
|
- update_by: null,
|
|
|
|
|
- remark: null,
|
|
|
|
|
- sys_dept_code: null,
|
|
|
|
|
- createTime: null,
|
|
|
|
|
- updateTime: null,
|
|
|
|
|
rq: "09/01",
|
|
rq: "09/01",
|
|
|
weatherZgwd: 25,
|
|
weatherZgwd: 25,
|
|
|
weatherZdwd: 16,
|
|
weatherZdwd: 16,
|
|
@@ -114,20 +70,9 @@ let demoData = [
|
|
|
weatherTqNight: "多云",
|
|
weatherTqNight: "多云",
|
|
|
weatherImgDay: "https://d.scggqx.com/forecast/img/多云.png",
|
|
weatherImgDay: "https://d.scggqx.com/forecast/img/多云.png",
|
|
|
weatherImgNight: "https://d.scggqx.com/forecast/img/多云.png",
|
|
weatherImgNight: "https://d.scggqx.com/forecast/img/多云.png",
|
|
|
- windDirectDay: "北风",
|
|
|
|
|
- windDirectNight: "北风",
|
|
|
|
|
- windPowerDay: "3~4级",
|
|
|
|
|
- windPowerNight: "3~4级",
|
|
|
|
|
week: "星期日",
|
|
week: "星期日",
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- sourceof: null,
|
|
|
|
|
- create_by: null,
|
|
|
|
|
- update_by: null,
|
|
|
|
|
- remark: null,
|
|
|
|
|
- sys_dept_code: null,
|
|
|
|
|
- createTime: null,
|
|
|
|
|
- updateTime: null,
|
|
|
|
|
rq: "09/02",
|
|
rq: "09/02",
|
|
|
weatherZgwd: 26,
|
|
weatherZgwd: 26,
|
|
|
weatherZdwd: 15,
|
|
weatherZdwd: 15,
|
|
@@ -135,20 +80,9 @@ let demoData = [
|
|
|
weatherTqNight: "晴",
|
|
weatherTqNight: "晴",
|
|
|
weatherImgDay: "https://d.scggqx.com/forecast/img/阴.png",
|
|
weatherImgDay: "https://d.scggqx.com/forecast/img/阴.png",
|
|
|
weatherImgNight: "https://d.scggqx.com/forecast/img/阴.png",
|
|
weatherImgNight: "https://d.scggqx.com/forecast/img/阴.png",
|
|
|
- windDirectDay: "北风",
|
|
|
|
|
- windDirectNight: "北风",
|
|
|
|
|
- windPowerDay: "3~4级",
|
|
|
|
|
- windPowerNight: "微风",
|
|
|
|
|
week: "星期一",
|
|
week: "星期一",
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- sourceof: null,
|
|
|
|
|
- create_by: null,
|
|
|
|
|
- update_by: null,
|
|
|
|
|
- remark: null,
|
|
|
|
|
- sys_dept_code: null,
|
|
|
|
|
- createTime: null,
|
|
|
|
|
- updateTime: null,
|
|
|
|
|
rq: "09/03",
|
|
rq: "09/03",
|
|
|
weatherZgwd: 27,
|
|
weatherZgwd: 27,
|
|
|
weatherZdwd: 18,
|
|
weatherZdwd: 18,
|
|
@@ -156,20 +90,9 @@ let demoData = [
|
|
|
weatherTqNight: "阴",
|
|
weatherTqNight: "阴",
|
|
|
weatherImgDay: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
weatherImgDay: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
|
weatherImgNight: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
weatherImgNight: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
|
- windDirectDay: "无持续风向",
|
|
|
|
|
- windDirectNight: "无持续风向",
|
|
|
|
|
- windPowerDay: "微风",
|
|
|
|
|
- windPowerNight: "微风",
|
|
|
|
|
week: "星期二",
|
|
week: "星期二",
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- sourceof: null,
|
|
|
|
|
- create_by: null,
|
|
|
|
|
- update_by: null,
|
|
|
|
|
- remark: null,
|
|
|
|
|
- sys_dept_code: null,
|
|
|
|
|
- createTime: null,
|
|
|
|
|
- updateTime: null,
|
|
|
|
|
rq: "09/04",
|
|
rq: "09/04",
|
|
|
weatherZgwd: 27,
|
|
weatherZgwd: 27,
|
|
|
weatherZdwd: 18,
|
|
weatherZdwd: 18,
|
|
@@ -177,10 +100,6 @@ let demoData = [
|
|
|
weatherTqNight: "阴",
|
|
weatherTqNight: "阴",
|
|
|
weatherImgDay: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
weatherImgDay: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
|
weatherImgNight: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
weatherImgNight: "https://d.scggqx.com/forecast/img/小雨.png",
|
|
|
- windDirectDay: "无持续风向",
|
|
|
|
|
- windDirectNight: "无持续风向",
|
|
|
|
|
- windPowerDay: "微风",
|
|
|
|
|
- windPowerNight: "微风",
|
|
|
|
|
week: "星期二",
|
|
week: "星期二",
|
|
|
},
|
|
},
|
|
|
];
|
|
];
|
|
@@ -199,8 +118,6 @@ let weatherImgDaylist = ref([
|
|
|
"多云"
|
|
"多云"
|
|
|
]);
|
|
]);
|
|
|
let weatherImgNightlist = [];
|
|
let weatherImgNightlist = [];
|
|
|
-let windDirectlist = [];
|
|
|
|
|
-let windPowerlist = [];
|
|
|
|
|
let weatherZgwdlist = [];
|
|
let weatherZgwdlist = [];
|
|
|
let weatherZdwdlist = [];
|
|
let weatherZdwdlist = [];
|
|
|
|
|
|
|
@@ -217,8 +134,6 @@ demoData.forEach((item) => {
|
|
|
weatherNightlist.push(item.weatherTqNight);
|
|
weatherNightlist.push(item.weatherTqNight);
|
|
|
// weatherImgDaylist.push(item.weatherImgDay);
|
|
// weatherImgDaylist.push(item.weatherImgDay);
|
|
|
weatherImgNightlist.push(item.weatherImgNight);
|
|
weatherImgNightlist.push(item.weatherImgNight);
|
|
|
- windDirectlist.push(item.windDirectDay);
|
|
|
|
|
- windPowerlist.push(item.windPowerDay);
|
|
|
|
|
weatherZgwdlist.push(item.weatherZgwd);
|
|
weatherZgwdlist.push(item.weatherZgwd);
|
|
|
weatherZdwdlist.push(item.weatherZdwd);
|
|
weatherZdwdlist.push(item.weatherZdwd);
|
|
|
});
|
|
});
|
|
@@ -227,10 +142,10 @@ minWD = Math.min(...weatherZdwdlist) - 30;
|
|
|
let weatherImgDaylistStyle = weatherImgDaylist.value.map((item) => {
|
|
let weatherImgDaylistStyle = weatherImgDaylist.value.map((item) => {
|
|
|
let dateUrl = item;
|
|
let dateUrl = item;
|
|
|
return {
|
|
return {
|
|
|
- backgroundColor: {
|
|
|
|
|
- // image: "@/assets/images/home/多云.png",
|
|
|
|
|
- image: require(`@/assets/images/home/${item}.svg`)
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ // backgroundColor: {
|
|
|
|
|
+ // // image: "@/assets/images/home/多云.png",
|
|
|
|
|
+ // image: require(`@/assets/images/home/${item}.svg`)
|
|
|
|
|
+ // },
|
|
|
height: 20,
|
|
height: 20,
|
|
|
width: 20,
|
|
width: 20,
|
|
|
color: "#fff"
|
|
color: "#fff"
|
|
@@ -295,7 +210,7 @@ const options = {
|
|
|
// 日期
|
|
// 日期
|
|
|
type: "category",
|
|
type: "category",
|
|
|
position: "top",
|
|
position: "top",
|
|
|
- offset: -40,
|
|
|
|
|
|
|
+ offset: -46,
|
|
|
boundaryGap: false,
|
|
boundaryGap: false,
|
|
|
zlevel: 100,
|
|
zlevel: 100,
|
|
|
axisLine: {
|
|
axisLine: {
|
|
@@ -461,12 +376,14 @@ const options = {
|
|
|
],
|
|
],
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const weatherChartData = ref([])
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
|
|
|
|
|
const point = sessionStorage.getItem('point')
|
|
const point = sessionStorage.getItem('point')
|
|
|
// 获取气象图表数据
|
|
// 获取气象图表数据
|
|
|
VE_API.mini_farm.gardenItemChart({point}).then(({data}) =>{
|
|
VE_API.mini_farm.gardenItemChart({point}).then(({data}) =>{
|
|
|
console.log('tq', data)
|
|
console.log('tq', data)
|
|
|
|
|
+ weatherChartData.value = data.weatherData
|
|
|
// minData.value = res.data.weatherData.map(item =>item.tempMin)
|
|
// minData.value = res.data.weatherData.map(item =>item.tempMin)
|
|
|
// lineYdata.value = res.data.weatherData.map(item =>item.tempMax)
|
|
// lineYdata.value = res.data.weatherData.map(item =>item.tempMax)
|
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
@@ -509,6 +426,33 @@ function dateFormat(date) {
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
|
|
+.chart-wrap {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ .chart-weather {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ left: 0;
|
|
|
|
|
+ top: 20px;
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ .chart-i {
|
|
|
|
|
+ color: #FFD489;
|
|
|
|
|
+ width: 16px;
|
|
|
|
|
+ padding-left: 34px;
|
|
|
|
|
+ }
|
|
|
|
|
+ .chart-i:nth-child(1) {
|
|
|
|
|
+ padding-left: 10px;
|
|
|
|
|
+ }
|
|
|
|
|
+ .chart-i:nth-child(2) {
|
|
|
|
|
+ padding-left: 32px;
|
|
|
|
|
+ }
|
|
|
|
|
+ .chart-i:nth-child(3) {
|
|
|
|
|
+ padding-left: 34px;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
.chart {
|
|
.chart {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
height: 100%;
|
|
height: 100%;
|