Commit 264d14e4 by 匡雅琴

bug修复

1 parent a806727f
......@@ -23,7 +23,8 @@ export default {
type: Array,
default: () => ['1', '2', '3', '4', '5', '6']
},
linetype: Number
linetype: Number,
lineChartsYear: String
},
data() {
return {
......@@ -37,9 +38,18 @@ export default {
methods: {
drawBarLine() {
this.barLineOptions = {
grid: {
right: '19%',
},
xAxis: {
type: 'category',
name: this.linetype == 1 ? '周' : '天',
name: (this.linetype == 1 ? '周' : '天')+'\n('+this.lineChartsYear + '年'+')',
// nameLocation: 'center',
// nameGap: 20,
nameTextStyle: {
fontSize: 10,
lineHeight: 16
},
boundaryGap: true,//坐标轴两边留白
data: this.xAxisData,
axisLabel: { //坐标轴刻度标签的相关设置。
......
......@@ -96,9 +96,7 @@
</div>
<div class="detail-msg">
<div class="detail-msg-left">设备状态:</div>
<!-- <div class="detail-msg-desc"> {{ basicData.deviceInformationVOList ?
basicData.deviceInformationVOList[0].deviceStateStr : '-' }}</div> -->
<template v-if="basicData.deviceInformationVOList.length">
<template v-if="basicData.deviceInformationVOList&&basicData.deviceInformationVOList.length">
<div class="detail-msg-right">
<div class="detail-msg-desc" v-for="item in basicData.deviceInformationVOList">
<div>{{ item.sourceStr }}-{{ item.sn }}</div>
......@@ -118,7 +116,7 @@
<div class="title">用车行为分析</div>
<div class="line-charts" v-if="xAxisDataList.length">
<LineCharts id="useCarCharts" ref="useCarChartsRef" height="250px" :linetype="linetype" :dataList="useCarData"
:xAxisData="xAxisDataList"></LineCharts>
:xAxisData="xAxisDataList" :lineChartsYear="lineChartsYear"></LineCharts>
</div>
<div v-else class="empty-box">
<img src="@/assets/images/empty-status.png" alt="">
......@@ -162,7 +160,8 @@ export default {
pieList: [],
resultList: [],
linetype: 1,
boxShow: false
boxShow: false,
lineChartsYear: ''
};
},
......@@ -171,7 +170,7 @@ export default {
const _vehicleId = _this.$route.query.vehicleId
this.vehicleId = _vehicleId
_this.$mapInit({ version: '1.4.2' }).then(AMap => {
window.AMap = AMap;
// window.AMap = AMap;
_this.initMap();
})
},
......@@ -304,6 +303,7 @@ export default {
this.linetype = res.data.statisticsType
let _int = res.data.statisticsType == 1 ? 'weekInt' : 'dayInt'
let _type = res.data.statisticsType == 1 ? 'weekNum' : 'dayNum'
this.lineChartsYear = _dataList[_dataList.length - 1].yearInt
_dataList.forEach(item => {
this.xAxisDataList.push(item[_int])
this.useCarData.push(item[_type])
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!