Commit 7a06d7a4 authored by liushuai's avatar liushuai

修复定制化图表显示问题

parent 78177e11
<template>
<div class="setting">
<div name="dataZoom" class="dataZoom">
<div slot="title" class="collapse-item">
<div slot="title" class="collapse-item" @click="change">
数据区域缩放
<el-switch
<el-switch ref="switch" style="pointer-events: none;"
v-model="show"
@change="changeShow"
active-color="#13ce66">
</el-switch>
......@@ -33,7 +31,22 @@
mounted() {
this.activeNames=["dataZoom"]
},
watch:{
"show":function (newval,oldVal) {
for(var i in this.chartSettingsDataZoom){
let item = this.chartSettingsDataZoom[i]
item.show = newval
}
this.$store.commit('charts/updateChartSettingsDataZoom', this.chartSettingsDataZoom);
},
},
methods:{
change(){
// 获取 el-switch 的实例
const elSwitch = this.$refs.switch;
// 手动触发 el-switch 的点击事件
elSwitch.$el.click();
},
changeShow(value){
for(var i in this.chartSettingsDataZoom){
let item = this.chartSettingsDataZoom[i]
......@@ -50,6 +63,7 @@
flex: 1;
}
.collapse-item{
cursor: pointer;
/*width: 100%;*/
font-weight: bold;
line-height: 40px;
......
......@@ -44,6 +44,16 @@
computed: {
...mapState('charts',['chartSettingsSeries'])
},
watch:{
'activeNames':function (newVal,oldVal) {
if(this.activeNames.length>0){
this.chartSettingsSeries.showPoint=true
}else {
this.chartSettingsSeries.showPoint=false
}
this.$store.commit('charts/updateChartSettingsSeries', this.chartSettingsSeries);
}
},
mounted() {
if(this.show==true){
this.activeNames=["point"]
......
......@@ -251,11 +251,12 @@
},
watch:{
'activeNames':function (newVal,oldVal) {
if(newVal.length>0){
if(this.activeNames.length>0){
this.chartSettingsYAxis.show = true
}else {
this.chartSettingsYAxis.show = false
}
// console.log( this.chartSettingsYAxis.show )
this.$store.commit('charts/updateChartSettingYAxis', this.chartSettingsYAxis);
},
'axisShow':function (newVal,oldVal) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment