Quellcode durchsuchen

自定义天气预报图

wsy vor 3 Jahren
Ursprung
Commit
1919edfb24
42 geänderte Dateien mit 145 neuen und 2 gelöschten Zeilen
  1. BIN
      src/assets/icon/svg/weather/01.png
  2. BIN
      src/assets/icon/svg/weather/02.png
  3. BIN
      src/assets/icon/svg/weather/03.png
  4. BIN
      src/assets/icon/svg/weather/04.png
  5. BIN
      src/assets/icon/svg/weather/05.png
  6. BIN
      src/assets/icon/svg/weather/06.png
  7. BIN
      src/assets/icon/svg/weather/07.png
  8. BIN
      src/assets/icon/svg/weather/08.png
  9. BIN
      src/assets/icon/svg/weather/11.png
  10. BIN
      src/assets/icon/svg/weather/12.png
  11. BIN
      src/assets/icon/svg/weather/13.png
  12. BIN
      src/assets/icon/svg/weather/14.png
  13. BIN
      src/assets/icon/svg/weather/15.png
  14. BIN
      src/assets/icon/svg/weather/16.png
  15. BIN
      src/assets/icon/svg/weather/17.png
  16. BIN
      src/assets/icon/svg/weather/18.png
  17. BIN
      src/assets/icon/svg/weather/19.png
  18. BIN
      src/assets/icon/svg/weather/20.png
  19. BIN
      src/assets/icon/svg/weather/21.png
  20. BIN
      src/assets/icon/svg/weather/22.png
  21. BIN
      src/assets/icon/svg/weather/23.png
  22. BIN
      src/assets/icon/svg/weather/24.png
  23. BIN
      src/assets/icon/svg/weather/25.png
  24. BIN
      src/assets/icon/svg/weather/26.png
  25. BIN
      src/assets/icon/svg/weather/29.png
  26. BIN
      src/assets/icon/svg/weather/30.png
  27. BIN
      src/assets/icon/svg/weather/31.png
  28. BIN
      src/assets/icon/svg/weather/32.png
  29. BIN
      src/assets/icon/svg/weather/33.png
  30. BIN
      src/assets/icon/svg/weather/34.png
  31. BIN
      src/assets/icon/svg/weather/35.png
  32. BIN
      src/assets/icon/svg/weather/36.png
  33. BIN
      src/assets/icon/svg/weather/37.png
  34. BIN
      src/assets/icon/svg/weather/38.png
  35. BIN
      src/assets/icon/svg/weather/39.png
  36. BIN
      src/assets/icon/svg/weather/40.png
  37. BIN
      src/assets/icon/svg/weather/41.png
  38. BIN
      src/assets/icon/svg/weather/42.png
  39. BIN
      src/assets/icon/svg/weather/43.png
  40. BIN
      src/assets/icon/svg/weather/44.png
  41. 140 0
      src/components/chart/line/weather-line-chart.vue
  42. 5 2
      src/views/HealthControl/Health10.vue

BIN
src/assets/icon/svg/weather/01.png


BIN
src/assets/icon/svg/weather/02.png


BIN
src/assets/icon/svg/weather/03.png


BIN
src/assets/icon/svg/weather/04.png


BIN
src/assets/icon/svg/weather/05.png


BIN
src/assets/icon/svg/weather/06.png


BIN
src/assets/icon/svg/weather/07.png


BIN
src/assets/icon/svg/weather/08.png


BIN
src/assets/icon/svg/weather/11.png


BIN
src/assets/icon/svg/weather/12.png


BIN
src/assets/icon/svg/weather/13.png


BIN
src/assets/icon/svg/weather/14.png


BIN
src/assets/icon/svg/weather/15.png


BIN
src/assets/icon/svg/weather/16.png


BIN
src/assets/icon/svg/weather/17.png


BIN
src/assets/icon/svg/weather/18.png


BIN
src/assets/icon/svg/weather/19.png


BIN
src/assets/icon/svg/weather/20.png


BIN
src/assets/icon/svg/weather/21.png


BIN
src/assets/icon/svg/weather/22.png


BIN
src/assets/icon/svg/weather/23.png


BIN
src/assets/icon/svg/weather/24.png


BIN
src/assets/icon/svg/weather/25.png


BIN
src/assets/icon/svg/weather/26.png


BIN
src/assets/icon/svg/weather/29.png


BIN
src/assets/icon/svg/weather/30.png


BIN
src/assets/icon/svg/weather/31.png


BIN
src/assets/icon/svg/weather/32.png


BIN
src/assets/icon/svg/weather/33.png


BIN
src/assets/icon/svg/weather/34.png


BIN
src/assets/icon/svg/weather/35.png


BIN
src/assets/icon/svg/weather/36.png


BIN
src/assets/icon/svg/weather/37.png


BIN
src/assets/icon/svg/weather/38.png


BIN
src/assets/icon/svg/weather/39.png


BIN
src/assets/icon/svg/weather/40.png


BIN
src/assets/icon/svg/weather/41.png


BIN
src/assets/icon/svg/weather/42.png


BIN
src/assets/icon/svg/weather/43.png


BIN
src/assets/icon/svg/weather/44.png


+ 140 - 0
src/components/chart/line/weather-line-chart.vue

@@ -0,0 +1,140 @@
+<template>
+  <div class="chart" :id="id"></div>
+</template>
+
+<script>
+import util from "@/helper/util.js";
+import partten from "@/helper/partten.js";
+import * as echarts from "echarts";
+
+export default {
+  name: "weather-line-chart",
+  componentName: "weather-line-char",
+  props: {
+    width: {
+      type: String,
+      default: "100%",
+    },
+    height: {
+      type: String,
+      default: "270px",
+    },
+  },
+  data() {
+    return {
+      id: "",
+      chart: null,
+    };
+  },
+  methods: {
+    initChart() {
+      const chart = echarts.init(this.$el);
+      let option = {
+        grid: {
+          top: 10,
+          bottom: 50,
+        },
+        xAxis: {
+          type: "category",
+          data: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
+        },
+        yAxis: [
+          {
+            axisLine: { show: false },
+            axisTick: { show: false },
+            axisLabel: { show: false },
+            splitLine: { show: false },
+          },
+        ],
+
+        series: [
+          {
+            type: "custom",
+            renderItem: function (param, api) {
+              return {
+                type: "group",
+                children: [
+                  {
+                    type: "image",
+                    style: {
+                      image:
+                        require("@assets/icon/svg/weather/02.png"),
+                      x: 0,
+                      y: 0,
+                      width: 20,
+                      height: 20,
+                    },
+                    position: [param.dataIndexInside * 80 +80, 0],
+                  },
+                ],
+              };
+            },
+            data: [0, 10, 20],
+            yAxisIndex: 0,
+            z: 11,
+          },{
+            type: 'custom',
+            renderItem: function(param, api){
+                        return {
+            type: 'path',
+            shape: {
+                pathData: 'M31 16l-15-15v9h-26v12h26v9z',
+                      x: 0,
+                      y: 0,
+                      width: 20,
+                      height: 20,
+            },
+            rotation: 0,
+            position: [param.dataIndexInside * 80 +80, 200],
+            style: api.style({
+                stroke: '#555',
+                lineWidth: 1
+            })
+        };
+            },
+
+            data: [10,20,30],
+            z: 10
+        }
+        ],
+      };
+
+      chart.clear();
+      chart.setOption(option);
+      this.resize = function () {
+        chart.resize();
+      };
+
+      window.addEventListener("resize", this.resize);
+    },
+  },
+  created() {
+    this.id = "pie-chart-" + util.newGUID();
+  },
+  mounted() {
+    this.$nextTick(() => {
+      setTimeout(() => {
+        this.$el.style.width = this.width;
+        this.$el.style.height = this.height;
+        this.initChart();
+      }, 1000);
+    });
+  },
+  updated() {
+    this.$nextTick(() => {
+      this.initChart();
+    });
+  },
+  unmounted() {
+    window.removeEventListener("resize", this.resize);
+  },
+};
+</script>
+
+<style lang="less">
+.chart {
+  width: 100%;
+  height: 100%;
+  display: inline-block;
+}
+</style>

+ 5 - 2
src/views/HealthControl/Health10.vue

@@ -102,6 +102,7 @@
           <img-line-chart
             height="270px"
           />
+          <!-- <weather-line-chart/> -->
         </div>
       </el-col>
     </el-row>
@@ -133,7 +134,8 @@ import TableLineChart from "../../components/chart/line/table-line-chart.vue";
 import ImgLineChart from "../../components/chart/line/img-line-chart.vue";
 import ZoomLineChart from "../../components/chart/line/zoom-line-chart.vue";
 import HealthReport from "@com/other/healthReport/index.vue";
-import WtChooser from "@com/coms/wt-chooser/wt-chooser.vue"
+import WeatherLineChart from "@com/chart/line/weather-line-chart.vue";
+import WtChooser from "@com/coms/wt-chooser/wt-chooser.vue";
 
 export default {
   setup() {},
@@ -144,7 +146,8 @@ export default {
     ImgLineChart,
     ZoomLineChart,
     HealthReport,
-    WtChooser
+    WtChooser,
+    WeatherLineChart,
   },
   data() {
     const that = this;