Commit da3fb7f5 by 匡雅琴

Merge branch 'v1.0.0' into hotfix_v1.1.0

2 parents fac5d812 de45b260
......@@ -16,10 +16,12 @@
<!-- 内容区域 开始 -->
<div class="content">
<view-life-scene-data v-if="current == 2" />
<energy-car v-if="current == 1" />
<view-operational v-if="current == 3" />
<view-entire-lifecycleOf-car v-if="current == 0" />
<transition :name="transitionName">
<view-life-scene-data v-if="current == 2" />
<energy-car v-if="current == 1" />
<view-operational v-if="current == 3" />
<view-entire-lifecycleOf-car v-if="current == 0" />
</transition>
</div>
<!-- 内容区域 end -->
......@@ -55,13 +57,37 @@ export default {
1: '广联新能源车主服务行业大模型',
2: '广联新能源车主服务行业大模型',
3: '广联数科运营看板'
}
},
startX: 0,
moveX: 0,
transitionName: ''
}
},
created() {
let _this = this
this.$bus.$on('selectVal', 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: {
// selectVal(val) {
......@@ -72,9 +98,10 @@ export default {
prevClick() {
let index = this.current
if (index == 0) {
this.current = 3;
//this.current = 3
return false
}
this.transitionName = 'slide-right'
this.current = index - 1
},
......@@ -82,9 +109,10 @@ export default {
nextClick() {
let index = this.current
if (index == 3) {
this.current = 0;
//this.current = 0
return false
}
this.transitionName = 'slide-left'
this.current = index + 1
}
}
......@@ -119,4 +147,29 @@ html {
// 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>
......@@ -7,7 +7,7 @@
-->
<template>
<div>
<div :id="domId" style="width: 100%;" :style="{ height }"></div>
<div :id="domId" style="width: 100%" :style="{ height }"></div>
</div>
</template>
......@@ -66,9 +66,12 @@ export default {
this.barLineOptions = getBarOptions({ tooltipFormatter: this.tooltipFormatter })
},
mounted() {
this.barLineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.barLineDom)
this.chartBindEvent()
let _this = this
_this.$nextTick(function () {
_this.barLineDom = document.getElementById(_this.domId)
_this[this.domId] = echarts.init(_this.barLineDom)
_this.chartBindEvent()
})
},
methods: {
tooltipFormatter(obj) {
......@@ -76,7 +79,9 @@ export default {
var _html = ''
var _txt = ''
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;">
${_txt}
......@@ -84,7 +89,7 @@ export default {
return _html
},
drawBar() {
console.log(this.dataList, 222);
console.log(this.dataList, 222)
this.barLineOptions.xAxis.data = this.dataList.map(item => item.statMonth)
this.barLineOptions.series[0].data = this.dataList.map(item => item.val)
this[this.domId].setOption(this.barLineOptions)
......
......@@ -18,7 +18,10 @@ export default {
},
mounted() {
this.$refs.bigModuleChartRef.drawBar()
let _this = this;
_this.$nextTick(function () {
_this.$refs.bigModuleChartRef.drawBar()
})
},
methods: {}
......
......@@ -26,7 +26,10 @@ export default {
},
mounted() {
this.$refs.nearThreadChartRef.drawBar()
let _this = this;
_this.$nextTick(function(){
_this.$refs.nearThreadChartRef.drawBar()
})
},
methods: {}
......
......@@ -106,33 +106,47 @@ export default {
watch: {
analysisList: {
handler() {
let _this = this
const { rotate, analysisList, colorList } = this
const obj = {
rotate,
analysisList,
ValueAnalysis
}
this.lineOptions = this.revese ? getBarReverseOptions(obj, colorList) : getBarOptions(obj, colorList)
this.chartBindEvent()
_this.$nextTick(function () {
_this.lineOptions = _this.revese ? getBarReverseOptions(obj, colorList) : getBarOptions(obj, colorList)
_this.chartBindEvent()
})
},
deep: true
}
},
mounted() {
this.lineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.lineDom)
this.chartReaize()
this.chartBindEvent()
let _this = this
_this.$nextTick(function () {
_this.lineDom = document.getElementById(_this.domId)
_this[_this.domId] = echarts.init(_this.lineDom)
_this.chartReaize()
_this.chartBindEvent()
})
},
methods: {
chartReaize() {
window.addEventListener('resize', () => {
console.log(444)
this[this.domId].resize()
this[this.domId] && this[this.domId].resize()
})
},
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
this.chartAction()
this[this.domId].getZr().on(
......@@ -172,6 +186,9 @@ export default {
this.chartAction(this.currentData.dataIndex)
},
chartAction(index = 7) {
if(!this[this.domId]){
return false;
}
this[this.domId].dispatchAction({
type: 'showTip',
seriesIndex: 0,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!