Commit 264d14e4 by 匡雅琴

bug修复

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