diff --git a/src/components/ele-admin-pro/packages/modal-util.js b/src/components/ele-admin-pro/packages/modal-util.js index a66aec0..8319b18 100644 --- a/src/components/ele-admin-pro/packages/modal-util.js +++ b/src/components/ele-admin-pro/packages/modal-util.js @@ -7,6 +7,9 @@ * @returns */ function queryParentByClass(el, parentClass) { + if(!el){ + return; + } if (el === document) { return; } diff --git a/src/views/water/river/trend/index.vue b/src/views/water/river/trend/index.vue index d40c5a8..a1e0687 100644 --- a/src/views/water/river/trend/index.vue +++ b/src/views/water/river/trend/index.vue @@ -267,7 +267,10 @@ export default { }, // 指标 handleIndexChange(e){ - + if(!e){ + this.yDisable = false + return + } if(e=='全因子' || e=='纳污红线'){ this.yDisable = true this.selectModel = 'default' @@ -360,17 +363,25 @@ export default { // 趋势图 drawTrend() { - if(this.queryParams.yco == 'Yco_3' && this.queryParams.monitorIndexList.length>0){ - this.$message.error('纵坐标为水质类别时,请勿选择监测指标!'); - return; + if(this.queryParams.monitorIndexList && this.queryParams.monitorIndexList.indexOf('全因子')==-1 && this.queryParams.monitorIndexList.indexOf('纳污红线')==-1){ + if(this.queryParams.yco == 'Yco_3' && this.queryParams.monitorIndexList.length>0){ + this.$message.error('纵坐标为水质类别时,请勿选择监测指标!'); + return; + } } + if(this.queryParams.yco == 'Yco_1' && this.queryParams.monitorIndexList.length>1 && this.queryParams.placeList.length>1){ this.$message.error('纵坐标为浓度时,请勿选择监测指标和断面名称不能同时为多选!'); return; } - riverWaterTrend(this.queryParams).then((res) => { + let params = {...this.queryParams} + if(this.queryParams.monitorIndexList && !Array.isArray(this.queryParams.monitorIndexList)){ + params.monitorIndexList = [...this.queryParams.monitorIndexList] + } + + riverWaterTrend(params).then((res) => { console.log("res", res); if (res.data.code == 0) { this.trendData = res.data.data || []; @@ -387,12 +398,18 @@ export default { let palceOptions = {}; let newPlace = []; data.forEach((item) => { - palceOptions[item.sectionName] = item.sectionName; + if(item.sectionName){ + palceOptions[item.sectionName] = item.sectionName; + }else if(item.stationName){ + palceOptions[item.stationName] = item.stationName; + } + }); newPlace.push({ label: '全选', value: '全选', }) + console.log('palceOptions',palceOptions) for (let i in palceOptions) { newPlace.push({ label: palceOptions[i],