Cooklalala 1 тиждень тому
батько
коміт
60898da6ca

+ 16 - 5
src/components/Customize/HybridCharts.vue

@@ -9,8 +9,8 @@
           <div class="panel-item" v-for="item in chartData">
             <div class="color" :style="{'background-color':item.color }"></div>
             <div class="type">{{ item.name }}</div>
-            <div class="number">{{ item.value }}%</div>
-            <div class="amount">¥{{ item.amount }}</div>
+            <div class="number">{{ item.value }}</div>
+<!--            <div class="amount">¥{{ item.amount }}</div>-->
           </div>
         </div>
       </div>
@@ -25,6 +25,7 @@ import boxTop from '@/components/boxTop/index.vue'
 export default {
   data() {
     return {
+      colorList:['#975fe4','#45a5ff','#81c926','#ff8e49','#37cbcb'],
       chartData: [
         {
           value: 30,
@@ -95,9 +96,15 @@ export default {
   watch: {
     data: {
       handler() {
+
+        this.chartData = this.data.map((item, index) => ({
+          value: item.value,
+          name: item.label,
+          color: this.colorList[index],
+          amount:item.ratio
+        }))
         this.getEchart()
         this.getEchartAgain()
-        this.chartData = this.data
       },
       deep: true, // 深度监听
       immediate: true, // 立即执行
@@ -277,7 +284,7 @@ export default {
               padding: [0, 0, 5, 15],
               fontSize: 12,
             },
-            data: dataSource.map(item => item.name)
+            data: dataSource.map(item => item.label)
           }
         ],
         tooltip: {
@@ -334,7 +341,7 @@ export default {
               show: true, // 开启显示
               offset: [10, -20],
               formatter: function (fItem) {
-                let obj = dataSource.find(item => item.name === fItem.name)
+                let obj = dataSource.find(item => item.label === fItem.name)
                 return `{unitWid|交易量}{value|${obj.value}}{unit|交易额}{ratio|${obj.ratio}}`
               },
               position: 'insideRight', // 在上方显示
@@ -459,6 +466,10 @@ export default {
       width: 10px;
       height: 10px;
     }
+    div{
+      width: 80px;
+      text-align: center;
+    }
   }
 }
 

+ 1 - 1
src/components/Customize/liquidfill.vue

@@ -39,7 +39,7 @@ export default {
     this.getEchart()
   },
   watch: {
-    dataArray() {
+    data() {
       this.getEchart()
     },
   },

+ 2 - 1
src/components/Customize/weatherForecast.vue

@@ -127,7 +127,8 @@ export default {
         if (this.dataArray.thisYear) {
           data.data.push(this.dataArray.thisYear || [])
           data.legend.push("今年")
-        } else if (this.dataArray.LastYear) {
+        }
+        if (this.dataArray.LastYear) {
           data.data.push(this.dataArray.LastYear || [])
           data.legend.push("去年")
         }

+ 17 - 22
src/views/page2/index.vue

@@ -171,10 +171,10 @@ export default {
     this.getJSON()
     this.$util.autoVueFn(
         [
-          //     {
-          //       time: 1000 * 60,
-          //       fn: this.getWeatherForecast,
-          //     },
+              {
+                time: 1000 * 60,
+                fn: this.getWeatherForecast,
+              },
           {
             time: 1000 * 60,
             fn: this.getAnalysisOfTransplantYieldInVariousRegions,
@@ -183,10 +183,10 @@ export default {
                 time: 1000 * 60,
                 fn: this.getTransplantAreaInEachRegion,
               },
-          //     {
-          //       time: 1000 * 60,
-          //       fn: this.getAnalysisOfTransplantingSituation,
-          //     },
+              {
+                time: 1000 * 60,
+                fn: this.getAnalysisOfTransplantingSituation,
+              },
               {
                 time: 1000 * 60,
                 fn: this.getStatistics,
@@ -248,13 +248,11 @@ export default {
           .then((res) => {
             const area = []
             const dataArray = {
-              temperature: [],
-              Weather: [],
+              thisYear: [],
             }
-            res.forEach((element) => {
-              area.push(element.时间)
-              dataArray.temperature.push(element.温度)
-              dataArray.Weather.push(element.天气)
+            res.list.forEach((element) => {
+              area.push(element.label)
+              dataArray.thisYear.push(element.value)
             })
             this.Weatherarea = area
             this.WeatherdataArray = dataArray
@@ -282,14 +280,12 @@ export default {
       this.$http.get(`/api/screen/qxjy/orderTotal`).then((res) => {
         const area = []
         const dataArray = {
-          Done: [],
-          Percentage: [],
+          thisYear: [],
         }
-        const date = res
+        const date = res.list
         date.forEach((element) => {
-          area.push(element.名称.slice(0, 2))
-          dataArray.Done.push(element.已移载)
-          dataArray.Percentage.push(element.比率.toFixed(0))
+          area.push(element.label)
+          dataArray.thisYear.push(element.value)
         })
         this.HorizontalArea = area
         this.HorizontalArray = dataArray
@@ -311,8 +307,7 @@ export default {
           thisYear: [],
         }
         res.forEach((element) => {
-          area.push(element.label
-          )
+          area.push(element.label)
           dataArray.thisYear.push(element.value)
         })
         this.trendarea = area

+ 69 - 32
src/views/page3/index.vue

@@ -166,38 +166,38 @@ export default {
   created() {
     this.getJSON()
     this.$util.autoVueFn(
-      [
+        [
+          {
+            time: 1000 * 60,
+            fn: this.commentStatistics,
+          },
+          {
+            time: 1000 * 60,
+            fn: this.hotWords,
+          },
+          {
+            time: 1000 * 60,
+            fn: this.comprehensive,
+          },
+          {
+            time: 1000 * 60,
+            fn: this.commentDistribution,
+          },
+          {
+            time: 1000 * 60,
+            fn: this.getStatistics,
+          },
+          {
+            time: 1000 * 60,
+            fn: this.getTrendAnalysis,
+          },
+        ],
         {
-          time: 1000 * 60,
-          fn: this.commentStatistics,
-        },
-        {
-          time: 1000 * 60,
-          fn: this.hotWords,
-        },
-        {
-          time: 1000 * 60,
-          fn: this.comprehensive,
-        },
-        {
-          time: 1000 * 60,
-          fn: this.commentDistribution,
-        },
-        // {
-        //   time: 1000 * 60,
-        //   fn: this.getStatistics,
-        // },
-        // {
-        //   time: 1000 * 60,
-        //   fn: this.getTrendAnalysis,
-        // },
-      ],
-      {
-        vm: this,
-        batEnd() {
-          this.autoVueFnInit = true
-        },
-      }
+          vm: this,
+          batEnd() {
+            this.autoVueFnInit = true
+          },
+        }
     )
   },
   mounted() {
@@ -243,7 +243,7 @@ export default {
           .then((res) => {
             this.hotWordsList = [];
             res.forEach(e => {
-              this.hotWordsList.push({value:e.value, name:e.label})
+              this.hotWordsList.push({value: e.value, name: e.label})
             })
           })
     },
@@ -259,8 +259,45 @@ export default {
     commentDistribution() {
       return this.$http
           .get(`/api/screen/dspj/commentDistribution`)
+          .then((res) => {
+            this.statisticsData = res.list
+          })
+    },
+    getStatistics() {
+      return this.$http
+          .get(`/api/screen/dspj/thisYearOnYear`)
+          .then((res) => {
+            const area = []
+            const dataArray = {
+              LastYear: [],
+              thisYear: [],
+            }
+            res.forEach((element) => {
+              area.push(element.label)
+              dataArray.thisYear.push(element.value)
+            })
+            this.trendarea = area
+            this.trendDataArray = dataArray
+          })
+    },
+    getTrendAnalysis() {
+      return this.$http
+          .get(`/api/screen/dspj/trande`)
           .then((res) => {
 
+            const area = []
+            const dataArray = {
+              LastYear: [],
+              thisYear: [],
+            }
+            res.forEach((element) => {
+              area.push(element.month)
+              dataArray.thisYear.push(element.thisYear)
+              dataArray.LastYear.push(element.lastYear)
+            })
+            console.log(dataArray,2222222222222222)
+            this.Weatherarea = area
+            this.WeatherdataArray = dataArray
           })
     },
     async getJSON() {