Parcourir la source

fix: gap_analysis.vue parking_area.vue parking_operate.vue

zouooh il y a 1 an
Parent
commit
5028b686ed

+ 4 - 3
src/pages/index/components/gap_analysis.vue

@@ -26,7 +26,7 @@
26 26
           yAxisName="%"
27 27
           :tooltipFormat="lineTooltipFormat"
28 28
           :encode="[
29
-              { x: 'month', y: 'thisYearAmount', seriesName: '缺口程度',bool:'true' },
29
+              { x: 'month', y: 'lastAmount', seriesName: '缺口程度',bool:'true' },
30 30
             ]"
31 31
           id="sxcyfzqk"
32 32
         />
@@ -140,8 +140,9 @@ export default {
140 140
   mounted() {
141 141
     this.getTcqkbhqs()
142 142
     api.tcqkfx().then(res => {
143
+      console.log(res.data)
143 144
       let arr = []
144
-      let dataSoure = res
145
+      let dataSoure = res.data
145 146
       for (const key in dataSoure) {
146 147
         if (key !== 411100) {
147 148
           console.log(dataSoure[key].zb, '222')
@@ -194,7 +195,7 @@ export default {
194 195
       return `<div class="line-tooltip">
195 196
         <div style="color: ${params[0].color}">${params[0].seriesName}: ${
196 197
         params[0].data.lastAmount || "--"
197
-      }</div>
198
+      }(%)</div>
198 199
       </div>`;
199 200
     },
200 201
     setIntervalMap(chart) {

+ 2 - 2
src/pages/index/components/parking_area.vue

@@ -15,7 +15,7 @@
15 15
           :tooltip="tooltipFormat"
16 16
           :dataset="bardata"
17 17
           :encode="[
18
-            {x: 'month', y: 'cs', seriesName: '饱和度'}]"
18
+            {x: 'month', y: 'hs', seriesName: '饱和度'}]"
19 19
           :labelSize="15"
20 20
           id="fxdqhszzt"
21 21
         />
@@ -162,7 +162,7 @@ export default {
162 162
       const type = params[0].seriesType;
163 163
       const data = params[0].data;
164 164
       // ${params[0].name || "--"}月:
165
-      return `<div class="${type==='bar' ? 'bar-tooltip-dz' : type==='line' ? 'line-tooltip-dz' : ''}">${params[0].seriesName}:${data.cs || "--"}%</div>`;
165
+      return `<div class="${type==='bar' ? 'bar-tooltip-dz' : type==='line' ? 'line-tooltip-dz' : ''}">${params[0].seriesName}:${data.hs || "--"}%</div>`;
166 166
     },
167 167
   }
168 168
 }

+ 11 - 28
src/pages/index/components/parking_operate.vue

@@ -52,14 +52,13 @@
52 52
           :dataset="linedata"
53 53
           :tooltipFormat="lineTooltipFormat"
54 54
           :encode="[
55
-              { x: 'month', y: 'lastYearAmount', seriesName: '泊位收入',bool:'true' },
56
-              { x: 'month', y: 'thisYearAmount', seriesName: '总体收入',bool:'true' },
55
+              { x: 'month', y: 'lastAmount', seriesName: '泊位收入',bool:'true' }
57 56
             ]"
58 57
           id="sxcyfzqk"
59 58
         />
60 59
       </div>
61 60
       <div style="width: 50%; height: 300px">
62
-        <div align="center" style="color: white">特殊车辆进场占比</div>
61
+        <div align="center" style="color: white">车辆类型进场占比</div>
63 62
         <piechart
64 63
           class="model-pie-body"
65 64
           id="chart1"
@@ -131,25 +130,13 @@ export default {
131 130
     return {
132 131
       modelPieColor: ["#4382f6", "#9078f8", "#79a7db", "#FF9800"],
133 132
       modelData: {
134
-        list: [{name: '建筑车', value: 23}, {name: '危险品车', value:5}, {name: '特种车', value:27}, {name: '残疾人车', value:45}]
133
+        list: []
135 134
       },
136
-      linedata: [{month: '星期一',lastYearAmount: 2300, thisYearAmount: 4740}, {month: '星期二', lastYearAmount:3050, thisYearAmount:5600}
137
-        , {month: '星期三', lastYearAmount:2710, thisYearAmount:3781}, {month: '星期四', lastYearAmount:2670, thisYearAmount:4737}, {month: '星期五', lastYearAmount:3200, thisYearAmount:5252}
138
-        , {month: '星期六', lastYearAmount:4030, thisYearAmount:6160}, {month: '星期天', lastYearAmount:4890, thisYearAmount:6979}],
139
-      linedata1: [{month: '星期一', lastYearAmount: 38}, {month: '星期二', lastYearAmount:41}
140
-        , {month: '星期三', lastYearAmount:33}, {month: '星期四', lastYearAmount:23}, {month: '星期五', lastYearAmount:35}
141
-        , {month: '星期六', lastYearAmount:45}, {month: '星期天', lastYearAmount:59}],
142
-      linedata2: [{month: '星期一',lastYearAmount: 21, thisYearAmount: 51}, {month: '星期二', lastYearAmount:38, thisYearAmount:42}
143
-        , {month: '星期三', lastYearAmount:27, thisYearAmount:25}, {month: '星期四', lastYearAmount:23, thisYearAmount:20}, {month: '星期五', lastYearAmount:52, thisYearAmount:34}
144
-        , {month: '星期六', lastYearAmount:58, thisYearAmount:32}, {month: '星期天', lastYearAmount:68, thisYearAmount:37}],
145
-      linedata3: [{month: '二月',lastYearAmount: 5000, thisYearAmount: 4500}, {month: '三月', lastYearAmount:6000, thisYearAmount:5200}
146
-        , {month: '四月', lastYearAmount:5500, thisYearAmount:4800}, {month: '五月', lastYearAmount:6200, thisYearAmount:5100}
147
-        , {month: '六月', lastYearAmount:5800, thisYearAmount:4900}, {month: '七月', lastYearAmount:5500, thisYearAmount:4800}
148
-        , {month: '八月', lastYearAmount:6000, thisYearAmount:5100}, {month: '九月', lastYearAmount:5900, thisYearAmount:5000}
149
-        , {month: '十月', lastYearAmount:5700, thisYearAmount:4700}],
150
-      bardata: [{month: '星期一', hs: 1200, cs: 600},{month: '星期二', hs: 1100, cs: 700}
151
-        ,{month: '星期三', hs:1070, cs: 730},{month: '星期四', hs:1130, cs: 670},{month: '星期五', hs:1070, cs:730}
152
-        ,{month: '星期六', hs: 1310, cs: 490},{month: '星期天', hs: 1390, cs: 410},],
135
+      linedata: [],
136
+      linedata1: [],
137
+      linedata2: [],
138
+      linedata3: [],
139
+      bardata: [],
153 140
     }
154 141
   },
155 142
   mounted() {
@@ -199,19 +186,15 @@ export default {
199 186
       const data = params[0].data;
200 187
       return `<div class="line-tooltip">
201 188
         <div style="color: ${params[0].color}">${params[0].seriesName}: ${
202
-        params[0].data.lastYearAmount || "--"
189
+        params[0].data.lastAmount || "--"
203 190
       }(%)</div>`;
204 191
     },
205 192
     lineTooltipFormat(params) {
206 193
       const data = params[0].data;
207 194
       return `<div class="line-tooltip">
208
-        <div style="color: ${params[1].color}">${params[1].seriesName}: ${
209
-        params[0].data.thisYearAmount || "--"
210
-      }(元)</div>
211 195
         <div style="color: ${params[0].color}">${params[0].seriesName}: ${
212
-        params[0].data.lastYearAmount || "--"
213
-      }(元)</div>
214
-      </div>`;
196
+        params[0].data.lastAmount || "--"
197
+      }(元)</div>`;
215 198
     },
216 199
     lineTooltipFormat2(params) {
217 200
       const data = params[0].data;