Authored by 鲁尚清

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

@@ -47,6 +47,22 @@ export const monitorCustomLineTrend = { @@ -47,6 +47,22 @@ export const monitorCustomLineTrend = {
47 value: true, 47 value: true,
48 }, 48 },
49 { 49 {
  50 + type: 'el-switch',
  51 + label: '与下拉列表联动',
  52 + name: 'isVuexSelect',
  53 + required: false,
  54 + placeholder: '',
  55 + value: false,
  56 + },
  57 + {
  58 + type: 'el-input-text',
  59 + label: '下拉列表联动kpi',
  60 + name: 'vuexFlagKpiId',
  61 + required: false,
  62 + placeholder: '',
  63 + value: '',
  64 + },
  65 + {
50 type: 'el-select', 66 type: 'el-select',
51 label: 'kpiId', 67 label: 'kpiId',
52 name: 'kpiId', 68 name: 'kpiId',
@@ -246,6 +246,9 @@ export default { @@ -246,6 +246,9 @@ export default {
246 } 246 }
247 if(this.optionsSetup.vuexFlagKpiId==kpiId){ 247 if(this.optionsSetup.vuexFlagKpiId==kpiId){
248 this.hackReset=false; 248 this.hackReset=false;
  249 + if(this.optionsData.dynamicData.contextData.flag==flag){
  250 + this.hackReset=true;
  251 + }
249 this.optionsData.dynamicData.contextData.flag=flag; 252 this.optionsData.dynamicData.contextData.flag=flag;
250 } 253 }
251 } 254 }
@@ -66,10 +66,14 @@ export default { @@ -66,10 +66,14 @@ export default {
66 }, 66 },
67 computed: { 67 computed: {
68 //月季度年按钮通过vuex接收值 68 //月季度年按钮通过vuex接收值
69 - ...mapGetters(['buttonVals']), 69 + ...mapGetters(['buttonVals','selectValues']),
70 buttonVal(){ 70 buttonVal(){
71 return this.buttonVals; 71 return this.buttonVals;
72 }, 72 },
  73 + //与下拉列表通过vuex联动
  74 + selectValue(){
  75 + return this.selectValues;
  76 + },
73 styleObj() { 77 styleObj() {
74 return { 78 return {
75 position: this.ispreview ? "absolute" : "static", 79 position: this.ispreview ? "absolute" : "static",
@@ -107,6 +111,33 @@ export default { @@ -107,6 +111,33 @@ export default {
107 111
108 }, 112 },
109 deep:true 113 deep:true
  114 + },
  115 + //监听下拉列表
  116 + selectValue:{
  117 + handler(val){
  118 + console.log("(((",val)
  119 + if(this.optionsSetup.isVuexSelect){
  120 + let optionsData=this.optionsData;
  121 + if(this.optionsData.dataType=="dynamicData"){
  122 + //改变参下拉列表,重新加载动态数据--待测
  123 + let flag='';
  124 + let kpiId='';
  125 + if(val && val.length>0){
  126 + kpiId=val[0];
  127 + flag=val[1].join(",");
  128 + }
  129 + if(this.optionsSetup.vuexFlagKpiId==kpiId){
  130 + this.hackReset=false;
  131 + if(this.optionsData.dynamicData.contextData.flag==flag){
  132 + this.hackReset=true;
  133 + }
  134 + this.optionsData.dynamicData.contextData.flag=flag;
  135 + }
  136 + }
  137 + }
  138 +
  139 + },
  140 + deep:true
110 } 141 }
111 }, 142 },
112 mounted() { 143 mounted() {
@@ -513,7 +544,6 @@ export default { @@ -513,7 +544,6 @@ export default {
513 }, 544 },
514 getEchartData(val, optionsSetup) { 545 getEchartData(val, optionsSetup) {
515 const data = this.queryEchartsData(val); 546 const data = this.queryEchartsData(val);
516 - this.hackReset=false;  
517 data.then(res => { 547 data.then(res => {
518 this.renderingFn(optionsSetup, res); 548 this.renderingFn(optionsSetup, res);
519 }); 549 });