From 4b322bcaac0b127dd0481eaa842a23d2765b0a9a Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Wed, 4 Dec 2024 17:11:57 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E8=A1=A8=E7=9A=84=E6=97=A5=E6=9C=9F=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=EF=BC=8C=E5=9C=A8=E6=9D=A1=E4=BB=B6=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=B8=AD=E6=97=A0=E6=B3=95=E8=AE=BE=E7=BD=AE=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=80=BC=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 | 8 +--- .../js/panel/common/common_table.ts | 37 ++++++++++--------- 2 files changed, 20 insertions(+), 25 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 c6e8d9b377..facea94afb 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 @@ -191,7 +191,6 @@ const initOptions = (item, fieldObj) => { item.options = JSON.parse(JSON.stringify(textOptions)) } else if (fieldObj.deType === 1) { item.options = JSON.parse(JSON.stringify(dateOptions)) - item.type = 'fixed' } else { item.options = JSON.parse(JSON.stringify(valueOptions)) } @@ -375,12 +374,7 @@ const changeConditionItemType = item => { } } const getFieldOptions = fieldItem => { - const deType = state.fields.filter(ele => ele.id === fieldItem.fieldId)?.[0]?.deType - if (deType === 1) { - return fieldOptions.filter(ele => ele.value === 'fixed') - } else { - return fieldOptions - } + return fieldOptions } init() diff --git a/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts b/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts index 9bebf104f2..4c329d2340 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/common/common_table.ts @@ -49,7 +49,7 @@ import Exceljs from 'exceljs' import { saveAs } from 'file-saver' import { ElMessage } from 'element-plus-secondary' import { useI18n } from '@/hooks/web/useI18n' -const { t } = useI18n() +const { t:i18nt } = useI18n() export function getCustomTheme(chart: Chart): S2Theme { const headerColor = hexColorToRGBA( @@ -772,40 +772,41 @@ export function mappingColor(value, defaultColor, field, type, filedValueMap?, r } } else { // time - const tv = new Date(t.value.replace(/-/g, '/') + ' GMT+8').getTime() + const fc = field.conditions[i] + tv = new Date(tv.replace(/-/g, '/') + ' GMT+8').getTime() const v = new Date(value.replace(/-/g, '/') + ' GMT+8').getTime() - if (t.term === 'eq') { + if (fc.term === 'eq') { if (v === tv) { - color = t[type] + color = fc[type] flag = true } - } else if (t.term === 'not_eq') { + } else if (fc.term === 'not_eq') { if (v !== tv) { - color = t[type] + color = fc[type] flag = true } - } else if (t.term === 'lt') { + } else if (fc.term === 'lt') { if (v < tv) { - color = t[type] + color = fc[type] flag = true } - } else if (t.term === 'gt') { + } else if (fc.term === 'gt') { if (v > tv) { - color = t[type] + color = fc[type] flag = true } - } else if (t.term === 'le') { + } else if (fc.term === 'le') { if (v <= tv) { - color = t[type] + color = fc[type] flag = true } - } else if (t.term === 'ge') { + } else if (fc.term === 'ge') { if (v >= tv) { - color = t[type] + color = fc[type] flag = true } - } else if (t.term === 'default') { - color = t[type] + } else if (fc.term === 'default') { + color = fc[type] flag = true } if (flag) { @@ -1832,10 +1833,10 @@ export const configSummaryRow = (chart, s2Options, newData, tableHeader, basicSt } if (viewMeta.colIndex === 0) { if (tableHeader.showIndex) { - viewMeta.fieldValue = basicStyle.summaryLabel ?? t('chart.total_show') + viewMeta.fieldValue = basicStyle.summaryLabel ?? i18nt('chart.total_show') } else { if (xAxis.length) { - viewMeta.fieldValue = basicStyle.summaryLabel ?? t('chart.total_show') + viewMeta.fieldValue = basicStyle.summaryLabel ?? i18nt('chart.total_show') } } }