Commit da3fb7f5 by 匡雅琴

Merge branch 'v1.0.0' into hotfix_v1.1.0

2 parents fac5d812 de45b260
...@@ -16,10 +16,12 @@ ...@@ -16,10 +16,12 @@
<!-- 内容区域 开始 --> <!-- 内容区域 开始 -->
<div class="content"> <div class="content">
<view-life-scene-data v-if="current == 2" /> <transition :name="transitionName">
<energy-car v-if="current == 1" /> <view-life-scene-data v-if="current == 2" />
<view-operational v-if="current == 3" /> <energy-car v-if="current == 1" />
<view-entire-lifecycleOf-car v-if="current == 0" /> <view-operational v-if="current == 3" />
<view-entire-lifecycleOf-car v-if="current == 0" />
</transition>
</div> </div>
<!-- 内容区域 end --> <!-- 内容区域 end -->
...@@ -55,13 +57,37 @@ export default { ...@@ -55,13 +57,37 @@ export default {
1: '广联新能源车主服务行业大模型', 1: '广联新能源车主服务行业大模型',
2: '广联新能源车主服务行业大模型', 2: '广联新能源车主服务行业大模型',
3: '广联数科运营看板' 3: '广联数科运营看板'
} },
startX: 0,
moveX: 0,
transitionName: ''
} }
}, },
created() { created() {
let _this = this
this.$bus.$on('selectVal', data => { this.$bus.$on('selectVal', data => {
this.activeName = data this.activeName = data
}) })
document.addEventListener('touchstart', function (event) {
_this.startX = event.touches[0].pageX
})
document.addEventListener('touchmove', function (event) {
_this.moveX = event.touches[0].pageX - _this.startX
})
document.addEventListener('touchend', function () {
let m = _this.moveX
if (m < -30) {
console.log('向左滑动事件被触发!')
_this.nextClick()
} else if (m > 30) {
console.log('向右滑动事件被触发!')
_this.prevClick()
}
})
}, },
methods: { methods: {
// selectVal(val) { // selectVal(val) {
...@@ -72,9 +98,10 @@ export default { ...@@ -72,9 +98,10 @@ export default {
prevClick() { prevClick() {
let index = this.current let index = this.current
if (index == 0) { if (index == 0) {
this.current = 3; //this.current = 3
return false return false
} }
this.transitionName = 'slide-right'
this.current = index - 1 this.current = index - 1
}, },
...@@ -82,9 +109,10 @@ export default { ...@@ -82,9 +109,10 @@ export default {
nextClick() { nextClick() {
let index = this.current let index = this.current
if (index == 3) { if (index == 3) {
this.current = 0; //this.current = 0
return false return false
} }
this.transitionName = 'slide-left'
this.current = index + 1 this.current = index + 1
} }
} }
...@@ -119,4 +147,29 @@ html { ...@@ -119,4 +147,29 @@ html {
// background-size: 100% 100%; // background-size: 100% 100%;
} }
} }
.slide-left-enter-active,
.slide-left-leave-active,
.slide-right-enter-active,
.slide-right-leave-active {
will-change: transform;
transition: all 500ms;
position: absolute;
}
.slide-right-enter {
opacity: 0;
transform: translate3d(-100%, 0, 0);
}
.slide-right-leave-active {
opacity: 0;
transform: translate3d(100%, 0, 0);
}
.slide-left-enter {
opacity: 0;
transform: translate3d(100%, 0, 0);
}
.slide-left-leave-active {
opacity: 0;
transform: translate3d(-100%, 0, 0);
}
</style> </style>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
--> -->
<template> <template>
<div> <div>
<div :id="domId" style="width: 100%;" :style="{ height }"></div> <div :id="domId" style="width: 100%" :style="{ height }"></div>
</div> </div>
</template> </template>
...@@ -66,9 +66,12 @@ export default { ...@@ -66,9 +66,12 @@ export default {
this.barLineOptions = getBarOptions({ tooltipFormatter: this.tooltipFormatter }) this.barLineOptions = getBarOptions({ tooltipFormatter: this.tooltipFormatter })
}, },
mounted() { mounted() {
this.barLineDom = document.getElementById(this.domId) let _this = this
this[this.domId] = echarts.init(this.barLineDom) _this.$nextTick(function () {
this.chartBindEvent() _this.barLineDom = document.getElementById(_this.domId)
_this[this.domId] = echarts.init(_this.barLineDom)
_this.chartBindEvent()
})
}, },
methods: { methods: {
tooltipFormatter(obj) { tooltipFormatter(obj) {
...@@ -76,7 +79,9 @@ export default { ...@@ -76,7 +79,9 @@ export default {
var _html = '' var _html = ''
var _txt = '' var _txt = ''
this.tooltipFormatterObj.forEach(item => { this.tooltipFormatterObj.forEach(item => {
_txt += `<div style="display:flex;"><div style="color: #c9c9c9">${item.label}:</div><div style="color: #fff;">${utils.numAddSymbol(_currentItem[item.attrName])}${item.addSymbol || ''}</div></div>` _txt += `<div style="display:flex;"><div style="color: #c9c9c9">${item.label}:</div><div style="color: #fff;">${utils.numAddSymbol(_currentItem[item.attrName])}${
item.addSymbol || ''
}</div></div>`
}) })
_html += `<div style="backdrop-filter: blur(4px);background-color: #051526;border: 2px solid;border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;padding: 10px;"> _html += `<div style="backdrop-filter: blur(4px);background-color: #051526;border: 2px solid;border-image: linear-gradient(90deg, #074989, #30DCFF, #074989) 1;padding: 10px;">
${_txt} ${_txt}
...@@ -84,7 +89,7 @@ export default { ...@@ -84,7 +89,7 @@ export default {
return _html return _html
}, },
drawBar() { drawBar() {
console.log(this.dataList, 222); console.log(this.dataList, 222)
this.barLineOptions.xAxis.data = this.dataList.map(item => item.statMonth) this.barLineOptions.xAxis.data = this.dataList.map(item => item.statMonth)
this.barLineOptions.series[0].data = this.dataList.map(item => item.val) this.barLineOptions.series[0].data = this.dataList.map(item => item.val)
this[this.domId].setOption(this.barLineOptions) this[this.domId].setOption(this.barLineOptions)
......
...@@ -18,7 +18,10 @@ export default { ...@@ -18,7 +18,10 @@ export default {
}, },
mounted() { mounted() {
this.$refs.bigModuleChartRef.drawBar() let _this = this;
_this.$nextTick(function () {
_this.$refs.bigModuleChartRef.drawBar()
})
}, },
methods: {} methods: {}
......
...@@ -26,7 +26,10 @@ export default { ...@@ -26,7 +26,10 @@ export default {
}, },
mounted() { mounted() {
this.$refs.nearThreadChartRef.drawBar() let _this = this;
_this.$nextTick(function(){
_this.$refs.nearThreadChartRef.drawBar()
})
}, },
methods: {} methods: {}
......
...@@ -106,33 +106,47 @@ export default { ...@@ -106,33 +106,47 @@ export default {
watch: { watch: {
analysisList: { analysisList: {
handler() { handler() {
let _this = this
const { rotate, analysisList, colorList } = this const { rotate, analysisList, colorList } = this
const obj = { const obj = {
rotate, rotate,
analysisList, analysisList,
ValueAnalysis ValueAnalysis
} }
this.lineOptions = this.revese ? getBarReverseOptions(obj, colorList) : getBarOptions(obj, colorList) _this.$nextTick(function () {
this.chartBindEvent() _this.lineOptions = _this.revese ? getBarReverseOptions(obj, colorList) : getBarOptions(obj, colorList)
_this.chartBindEvent()
})
}, },
deep: true deep: true
} }
}, },
mounted() { mounted() {
this.lineDom = document.getElementById(this.domId) let _this = this
this[this.domId] = echarts.init(this.lineDom) _this.$nextTick(function () {
this.chartReaize() _this.lineDom = document.getElementById(_this.domId)
this.chartBindEvent() _this[_this.domId] = echarts.init(_this.lineDom)
_this.chartReaize()
_this.chartBindEvent()
})
}, },
methods: { methods: {
chartReaize() { chartReaize() {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
console.log(444) this[this.domId] && this[this.domId].resize()
this[this.domId].resize()
}) })
}, },
chartBindEvent() { chartBindEvent() {
this[this.domId].setOption(this.lineOptions) if(!this[this.domId]){
return false;
}
if(this[this.domId]){
// 防止报错
if(this.lineOptions && this.lineOptions.series){
this[this.domId].setOption(this.lineOptions)
}
}
if (this.revese === false) return if (this.revese === false) return
this.chartAction() this.chartAction()
this[this.domId].getZr().on( this[this.domId].getZr().on(
...@@ -172,6 +186,9 @@ export default { ...@@ -172,6 +186,9 @@ export default {
this.chartAction(this.currentData.dataIndex) this.chartAction(this.currentData.dataIndex)
}, },
chartAction(index = 7) { chartAction(index = 7) {
if(!this[this.domId]){
return false;
}
this[this.domId].dispatchAction({ this[this.domId].dispatchAction({
type: 'showTip', type: 'showTip',
seriesIndex: 0, seriesIndex: 0,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!