diff --git a/core/core-frontend/src/components/collapse-switch-item/src/CollapseSwitchItem.vue b/core/core-frontend/src/components/collapse-switch-item/src/CollapseSwitchItem.vue index e46fd207b6..046ce69e8d 100644 --- a/core/core-frontend/src/components/collapse-switch-item/src/CollapseSwitchItem.vue +++ b/core/core-frontend/src/components/collapse-switch-item/src/CollapseSwitchItem.vue @@ -69,7 +69,7 @@ const switchValue = computed({ display: flex; justify-content: space-between; align-items: center; - padding-right: 8px; + padding-right: 10px; flex-grow: 1; :deep(.ed-switch.is-checked .ed-switch__core > .ed-switch__action) { left: calc(100% - 12px); diff --git a/core/core-frontend/src/components/data-visualization/canvas/ContextMenuDetails.vue b/core/core-frontend/src/components/data-visualization/canvas/ContextMenuDetails.vue index e824380a85..02f3516647 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/ContextMenuDetails.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/ContextMenuDetails.vue @@ -10,6 +10,7 @@ import { computed, toRefs } from 'vue' import { ElDivider } from 'element-plus-secondary' import eventBus from '@/utils/eventBus' import { getCurInfo } from '@/store/modules/data-visualization/common' +import { useEmitt } from '@/hooks/web/useEmitt' const dvMainStore = dvMainStoreWithOut() const copyStore = copyStoreWithOut() const lockStore = lockStoreWithOut() @@ -20,6 +21,7 @@ const composeStore = composeStoreWithOut() const { areaData } = storeToRefs(composeStore) const { curComponent } = storeToRefs(dvMainStore) const emit = defineEmits(['close', 'rename']) +const { emitter } = useEmitt() const props = defineProps({ activePosition: { type: String, @@ -157,6 +159,10 @@ const composeDivider = computed(() => { const isGroupArea = computed(() => { return curComponent.value?.component === 'GroupArea' }) + +const editQueryCriteria = () => { + emitter.emit(`editQueryCriteria${curComponent.value.id}`) +} diff --git a/core/core-frontend/src/views/chart/components/editor/index.vue b/core/core-frontend/src/views/chart/components/editor/index.vue index b2138a309e..41746af7ff 100644 --- a/core/core-frontend/src/views/chart/components/editor/index.vue +++ b/core/core-frontend/src/views/chart/components/editor/index.vue @@ -3166,7 +3166,7 @@ span { display: flex; transition: 0.5s; .padding-lr { - padding: 0 8px; + padding: 0 10px; &.no-top-border { border-top: none !important; @@ -3217,7 +3217,7 @@ span { } :deep(.ed-collapse-item__content) { - padding: 16px 8px 0; + padding: 16px 10px 0; border: none; :deep(.ed-checkbox) { height: 20px; diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/table/common.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/table/common.ts index 4fa610f969..92bb20139a 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/table/common.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/table/common.ts @@ -46,7 +46,7 @@ export const TABLE_EDITOR_PROPERTY_INNER: EditorPropertyInner = { 'letterSpace', 'fontShadow' ], - 'tooltip-selector': ['fontSize', 'color', 'backgroundColor'], + 'tooltip-selector': ['fontSize', 'color', 'backgroundColor', 'show'], 'function-cfg': ['emptyDataStrategy'], threshold: ['tableThreshold'] } diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts index 36afc49597..a6a5ef574c 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-info.ts @@ -184,14 +184,10 @@ export class TableInfo extends S2ChartView { } action(param) }) - - // hover - const { showColTooltip } = customAttr.tableHeader - if (showColTooltip) { + // tooltip + const { show } = customAttr.tooltip + if (show) { newChart.on(S2Event.COL_CELL_HOVER, event => this.showTooltip(newChart, event, meta)) - } - const { showTooltip } = customAttr.tableCell - if (showTooltip) { newChart.on(S2Event.DATA_CELL_HOVER, event => this.showTooltip(newChart, event, meta)) } // header resize diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts index 16a5dbf584..a0ee7616b2 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-normal.ts @@ -187,13 +187,10 @@ export class TableNormal extends S2ChartView { } action(param) }) - // hover - const { showColTooltip } = customAttr.tableHeader - if (showColTooltip) { + // tooltip + const { show } = customAttr.tooltip + if (show) { newChart.on(S2Event.COL_CELL_HOVER, event => this.showTooltip(newChart, event, meta)) - } - const { showTooltip } = customAttr.tableCell - if (showTooltip) { newChart.on(S2Event.DATA_CELL_HOVER, event => this.showTooltip(newChart, event, meta)) } // header resize diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts index 8bd20dc78b..473536b92c 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/table/table-pivot.ts @@ -200,16 +200,11 @@ export class TablePivot extends S2ChartView { this.configTooltip(chart, s2Options) // 开始渲染 const s2 = new PivotSheet(containerDom, s2DataConfig, s2Options as unknown as S2Options) - // hover - const { showColTooltip, showRowTooltip } = customAttr.tableHeader - if (showColTooltip) { + // tooltip + const { show } = customAttr.tooltip + if (show) { s2.on(S2Event.COL_CELL_HOVER, event => this.showTooltip(s2, event, meta)) - } - if (showRowTooltip) { s2.on(S2Event.ROW_CELL_HOVER, event => this.showTooltip(s2, event, meta)) - } - const { showTooltip } = customAttr.tableCell - if (showTooltip) { s2.on(S2Event.DATA_CELL_HOVER, event => this.showTooltip(s2, event, meta)) } // click 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 9ed7a1a3a7..a6acb65fe1 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 @@ -750,7 +750,8 @@ export function configTooltip(chart: Chart, option: S2Options) { boxShadow: 'rgba(0, 0, 0, 0.1) 0px 4px 8px 0px', borderRadius: '3px', padding: '4px 12px', - opacity: 0.95 + opacity: 0.95, + position: 'absolute' }, adjustPosition: ({ event }) => { return getTooltipPosition(event) @@ -791,7 +792,7 @@ export function copyContent(s2Instance, event, fieldMeta) { function getTooltipPosition(event) { const s2Instance = event.s2Instance const { x, y } = event - const result = { x: x + 15, y: y + 10 } + const result = { x: x + 15, y } if (!s2Instance) { return result } @@ -809,8 +810,16 @@ function getTooltipPosition(event) { if (result.x && result.x + offsetWidth > width) { result.x -= result.x + offsetWidth - width } - if (result.y && result.y + offsetHeight > height) { - result.y -= offsetHeight + 15 + if (result.y) { + if (result.y > offsetHeight) { + if (result.y - offsetHeight >= 15) { + result.y -= offsetHeight + 15 + } else { + result.y = 0 + } + } else { + result.y += 15 + } } return result } diff --git a/core/core-frontend/src/views/chart/components/js/panel/types/impl/s2.ts b/core/core-frontend/src/views/chart/components/js/panel/types/impl/s2.ts index 89e8b95166..3188b96972 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/types/impl/s2.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/types/impl/s2.ts @@ -3,7 +3,15 @@ import { AntVDrawOptions, ChartLibraryType } from '@/views/chart/components/js/panel/types' -import { S2Theme, SpreadSheet, Style, S2Options, Meta, SERIES_NUMBER_FIELD } from '@antv/s2' +import { + S2Theme, + SpreadSheet, + Style, + S2Options, + Meta, + SERIES_NUMBER_FIELD, + setTooltipContainerStyle +} from '@antv/s2' import { configHeaderInteraction, configTooltip, @@ -86,6 +94,8 @@ export abstract class S2ChartView

extends AntVAbstractCha return } event.s2Instance = s2Instance + const style = s2Instance.options.tooltip.style + setTooltipContainerStyle(s2Instance.tooltip.container, { style }) s2Instance.showTooltip({ position: { x: event.clientX, diff --git a/core/core-frontend/src/views/dashboard/index.vue b/core/core-frontend/src/views/dashboard/index.vue index 8d115c330d..a24593758e 100644 --- a/core/core-frontend/src/views/dashboard/index.vue +++ b/core/core-frontend/src/views/dashboard/index.vue @@ -190,7 +190,7 @@ onMounted(async () => { } let deTemplateData if (createType === 'template') { - const templateParamsApply = JSON.parse(decodeURIComponent(Base64.decode(templateParams + ''))) + const templateParamsApply = JSON.parse(Base64.decode(decodeURIComponent(templateParams + ''))) await decompressionPre(templateParamsApply, result => { deTemplateData = result }) diff --git a/core/core-frontend/src/views/mobile/directory/index.vue b/core/core-frontend/src/views/mobile/directory/index.vue index 17a2744150..abdeb123b1 100644 --- a/core/core-frontend/src/views/mobile/directory/index.vue +++ b/core/core-frontend/src/views/mobile/directory/index.vue @@ -1,5 +1,5 @@