Authored by 鲁尚清

【无】预测趋势图增加和下拉列表联动效果

... ... @@ -47,6 +47,22 @@ export const monitorCustomLineTrend = {
value: true,
},
{
type: 'el-switch',
label: '与下拉列表联动',
name: 'isVuexSelect',
required: false,
placeholder: '',
value: false,
},
{
type: 'el-input-text',
label: '下拉列表联动kpi',
name: 'vuexFlagKpiId',
required: false,
placeholder: '',
value: '',
},
{
type: 'el-select',
label: 'kpiId',
name: 'kpiId',
... ...
... ... @@ -246,6 +246,9 @@ export default {
}
if(this.optionsSetup.vuexFlagKpiId==kpiId){
this.hackReset=false;
if(this.optionsData.dynamicData.contextData.flag==flag){
this.hackReset=true;
}
this.optionsData.dynamicData.contextData.flag=flag;
}
}
... ...
... ... @@ -66,10 +66,14 @@ export default {
},
computed: {
//月季度年按钮通过vuex接收值
...mapGetters(['buttonVals']),
...mapGetters(['buttonVals','selectValues']),
buttonVal(){
return this.buttonVals;
},
//与下拉列表通过vuex联动
selectValue(){
return this.selectValues;
},
styleObj() {
return {
position: this.ispreview ? "absolute" : "static",
... ... @@ -107,6 +111,33 @@ export default {
},
deep:true
},
//监听下拉列表
selectValue:{
handler(val){
console.log("(((",val)
if(this.optionsSetup.isVuexSelect){
let optionsData=this.optionsData;
if(this.optionsData.dataType=="dynamicData"){
//改变参下拉列表,重新加载动态数据--待测
let flag='';
let kpiId='';
if(val && val.length>0){
kpiId=val[0];
flag=val[1].join(",");
}
if(this.optionsSetup.vuexFlagKpiId==kpiId){
this.hackReset=false;
if(this.optionsData.dynamicData.contextData.flag==flag){
this.hackReset=true;
}
this.optionsData.dynamicData.contextData.flag=flag;
}
}
}
},
deep:true
}
},
mounted() {
... ... @@ -513,7 +544,6 @@ export default {
},
getEchartData(val, optionsSetup) {
const data = this.queryEchartsData(val);
this.hackReset=false;
data.then(res => {
this.renderingFn(optionsSetup, res);
});
... ...