From 82a31fe3da000a476cbfa9ea74b3582e17ccf150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B4=AA=E6=B4=AA?= <2498601771@qq.com> Date: Tue, 30 Apr 2024 15:49:42 +0800 Subject: [PATCH] =?UTF-8?q?CN-1642=20fix:=20=E4=BF=AE=E5=A4=8D=E6=96=B0?= =?UTF-8?q?=E5=A2=9Ereport=E6=97=B6=EF=BC=8C=E5=88=87=E6=8D=A2category?= =?UTF-8?q?=E5=90=8E=E8=BE=93=E5=85=A5params=EF=BC=8C=E5=86=8D=E5=88=87?= =?UTF-8?q?=E6=8D=A2category=E6=90=9C=E7=B4=A2params=E4=B8=8D=E7=94=9F?= =?UTF-8?q?=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/rightBox/report/ReportBox.vue | 25 ++++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/components/rightBox/report/ReportBox.vue b/src/components/rightBox/report/ReportBox.vue index 3298bec7..96801168 100644 --- a/src/components/rightBox/report/ReportBox.vue +++ b/src/components/rightBox/report/ReportBox.vue @@ -546,6 +546,7 @@ export default { loadParamOptions () { if (_.isArray(this.editObject.categoryParams) && !_.isEmpty(this.editObject.categoryParams)) { this.editObject.categoryParams.forEach(param => { + this.paramsOptions = _.cloneDeep(this.newParamsOptions) if (!this.paramsOptions.some(p => p.key === param.key)) { axios.get(api.dict, { params: { type: param.key, pageSize: -1 } }).then(response => { if (response.status === 200) { @@ -750,22 +751,20 @@ export default { * @param filterVal */ filterMethod (filterVal) { + const key = this.editObject.categoryParams[0].key if (filterVal) { - if (_.isString(filterVal)) { - const filterArr = _.cloneDeep(this.newParamsOptions[0].options).filter(d => d.toLowerCase().includes(filterVal.toLowerCase())) - this.$nextTick(() => { - this.paramsOptions[0].options = filterArr - }) - } else if (_.isNumber(filterVal)) { - const filterArr = _.cloneDeep(this.newParamsOptions[0].options).filter(d => d.toLowerCase().includes(filterVal)) - this.$nextTick(() => { - this.paramsOptions[0].options = filterArr - }) + const obj = this.newParamsOptions.find(d => d.key === key) + if (_.isString(filterVal) && obj) { + const filterArr = _.cloneDeep(obj.options).filter(d => d.toLowerCase().includes(filterVal.toLowerCase())) + const paramsOptionsObj = this.paramsOptions.find(d => d.key === key) + paramsOptionsObj.options = filterArr + } else if (_.isNumber(filterVal) && obj) { + const filterArr = _.cloneDeep(obj.options).filter(d => d.toLowerCase().includes(filterVal)) + const paramsOptionsObj = this.paramsOptions.find(d => d.key === key) + paramsOptionsObj.options = filterArr } } else { - this.$nextTick(() => { - this.paramsOptions = _.cloneDeep(this.newParamsOptions) - }) + this.paramsOptions = _.cloneDeep(this.newParamsOptions) } } }