From de3beab32ec3275aead3039df785f93c556ac9aa Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Fri, 11 Oct 2024 17:13:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E5=AD=97=E6=AE=B5=E5=88=A0=E9=99=A4=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E6=89=93=E5=BC=80=E9=85=8D=E7=BD=AE=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E6=97=B6=E5=8D=A1=E9=A1=B5=E9=9D=A2=E5=8D=A1?= =?UTF-8?q?=E6=AD=BB=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/dialog/TableThresholdEdit.vue | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/TableThresholdEdit.vue b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/TableThresholdEdit.vue index 66468c0fd6..c6e8d9b377 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/TableThresholdEdit.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-senior/components/dialog/TableThresholdEdit.vue @@ -216,6 +216,18 @@ const initFields = () => { fields = [...xAxis, ...yAxis] } state.fields.splice(0, state.fields.length, ...fields) + // 字段不存在时 + let change = false + state.thresholdArr.forEach(item => { + const fieldItemObj = state.fields.filter(ele => ele.id === item.fieldId) + if (fieldItemObj.length === 0) { + change = true + item.fieldId = null + } + }) + if (change) { + changeThreshold() + } } const addThreshold = () => { state.thresholdArr.push(JSON.parse(JSON.stringify(state.thresholdObj))) @@ -294,11 +306,20 @@ const dynamicSummaryOptions = [ ] const getConditionsFields = (fieldItem, conditionItem, conditionItemField) => { - const fieldItemDeType = state.fields.filter(ele => ele.id === fieldItem.fieldId)?.[0]?.deType - if (fieldItemDeType === undefined || fieldItemDeType === null) { + const fieldItemObj = state.fields.filter(ele => ele.id === fieldItem.fieldId) + + if ( + fieldItemObj.length === 0 || + fieldItemObj[0]?.deType === undefined || + fieldItemObj[0]?.deType === null + ) { + fieldItem.fieldId = null conditionItem.fieldId = null conditionItemField.fieldId = null + return [] } + + const fieldItemDeType = fieldItemObj[0]?.deType const result = state.fields.filter(item => { // 文本、时间、boole、地理位置时,需要同类型的字段