Parcourir la source

完善首页折线图

Zt il y a 1 an
Parent
commit
8e9e5e8253

+ 1 - 2
reado-app/pages/homePage/index.vue

@@ -33,8 +33,7 @@
 					<view class="title" v-if="echartsData.length">
 						{{item.chartName}}
 					</view>
-					<!-- <lineEcharts :echartsData="item" /> -->
-					<web-view :src="item.src" style="top:10vh;width:100%;height:320px;"></web-view>
+					<web-view :src="item.src" style="top:14vh;width:100%;height:320px;"></web-view>
 				</view>
 			</view>
 		</template>

Fichier diff supprimé car celui-ci est trop grand
+ 369 - 698
reado-app/static/webview/echarts.min.js


+ 9 - 8
reado-app/static/webview/line-wv.html

@@ -65,11 +65,8 @@
 					data: [],
 					axisLabel: {
 						formatter: function(value) {
-							const result = value.replaceAll('-', '').substring(0,
-								9);
-							return result
+							return value.substring(0, 10).split('-').join('')
 						}
-						// formatter: '{value}'
 					}
 				},
 				yAxis: {
@@ -86,17 +83,18 @@
 						lineStyle: {
 							type: 'dashed'
 						},
-						label:{
-							show:false
+						label: {
+							show: false
 						}
 					},
-					backgroundColor: 'rgba(50,50,50,0.5)',
+					position: [0, 20],
 					formatter: function(params) {
+						console.log(params);
 						let result = ''
 						for (let i in params) {
 							if (i == 0) {
 								result += params[i].axisValueLabel
-									.substring(9, 17)
+									.substring(11, 19)
 							}
 							let value = '--'
 							if (params[i].data !== null) {
@@ -105,6 +103,7 @@
 							result += '\n' + params[i].seriesName + ':' +
 								value
 						}
+						console.log(result);
 						return result
 					}
 				},
@@ -141,6 +140,8 @@
 						beforeSend: function(xhr) {
 							this.url =
 								`http://192.168.0.40:8081/chart/getChartById?id=${id}&startTime=${startTime}&endTime=${endTime}`
+							// this.url = window.location.origin +
+							// 	`/chart/getChartById?id=${id}&startTime=${startTime}&endTime=${endTime}` 
 							xhr.setRequestHeader("Authorization", "Bearer " +
 								token);
 							xhr.setRequestHeader("token", token);

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff