From 93124d056146448b83bffe2d002adb6306a00cf9 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 12 Nov 2024 21:21:24 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E4=BB=AA=E8=A1=A8=E6=9D=BF=E3=80=81?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=94=AF=E6=8C=81=E8=BE=85=E5=8A=A9=E7=BD=91?= =?UTF-8?q?=E6=A0=BC=E7=BA=BF=20#12591?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard-style/OverallSetting.vue | 9 ++ .../components/data-visualization/DeGrid.vue | 92 +++++++++++++++++++ .../data-visualization/canvas/CanvasCore.vue | 21 ++++- .../visualization/CanvasBaseSetting.vue | 18 +++- core/core-frontend/src/utils/canvasUtils.ts | 2 + .../editor/util/dataVisualization.ts | 2 + 6 files changed, 138 insertions(+), 6 deletions(-) create mode 100644 core/core-frontend/src/components/data-visualization/DeGrid.vue diff --git a/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/OverallSetting.vue b/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/OverallSetting.vue index 279c7cb8f8..42940643b5 100644 --- a/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/OverallSetting.vue +++ b/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/OverallSetting.vue @@ -200,6 +200,15 @@ + + 显示辅助网格 + diff --git a/core/core-frontend/src/components/data-visualization/DeGrid.vue b/core/core-frontend/src/components/data-visualization/DeGrid.vue new file mode 100644 index 0000000000..b4673faddc --- /dev/null +++ b/core/core-frontend/src/components/data-visualization/DeGrid.vue @@ -0,0 +1,92 @@ + + + + + diff --git a/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue b/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue index 8a929df9d0..fe1e1ad056 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue @@ -45,6 +45,7 @@ import DragInfo from '@/components/visualization/common/DragInfo.vue' import { activeWatermarkCheckUser } from '@/components/watermark/watermark' import PopArea from '@/custom-component/pop-area/Component.vue' import DatasetParamsComponent from '@/components/visualization/DatasetParamsComponent.vue' +import DeGrid from '@/components/data-visualization/DeGrid.vue' const snapshotStore = snapshotStoreWithOut() const dvMainStore = dvMainStoreWithOut() @@ -56,6 +57,10 @@ const { curComponent, dvInfo, editMode, tabMoveOutComponentId, canvasState } = const { editorMap, areaData } = storeToRefs(composeStore) const emits = defineEmits(['scrollCanvasToTop']) const props = defineProps({ + themes: { + type: String, + default: 'dark' + }, isEdit: { type: Boolean, default: true @@ -168,7 +173,6 @@ const props = defineProps({ default: true } }) -const userInfo = ref(null) const { baseWidth, @@ -187,7 +191,8 @@ const { canvasId, canvasStyleData, componentData, - canvasViewInfo + canvasViewInfo, + themes } = toRefs(props) const editorX = ref(0) @@ -275,6 +280,13 @@ const initWatermark = (waterDomId = 'editor-canvas-main') => { } } +const matrixStyle = computed(() => { + return { + width: baseWidth.value, + height: baseHeight.value + } +}) + const dragInfoShow = computed(() => { return ( dvInfo.value.type === 'dashboard' && @@ -1409,6 +1421,10 @@ const contextMenuShow = computed(() => { const markLineShow = computed(() => isMainCanvas(canvasId.value)) +const showGrid = computed(() => { + return Boolean(canvasStyleData.value.dashboard.showGrid) && isMainCanvas(canvasId.value) +}) + // 批量设置 const dataVBatchOptAdaptor = () => { @@ -1540,6 +1556,7 @@ defineExpose({ :show-position="'popEdit'" > +
显示弹窗区查询按钮 @@ -27,7 +27,7 @@ size="small" :effect="themes" v-model="canvasStyleData.suspensionButtonAvailable" - @change="onPopButtonChange" + @change="onThemeChange" >
显示放大、导出等悬浮按钮 @@ -42,6 +42,16 @@
+ + + 显示辅助网格 +
@@ -51,14 +61,14 @@ import icon_info_outlined from '@/assets/svg/icon_info_outlined.svg' import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot' import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain' import { storeToRefs } from 'pinia' -import { ElIcon } from 'element-plus-secondary' +import { ElFormItem, ElIcon } from 'element-plus-secondary' import Icon from '../icon-custom/src/Icon.vue' const snapshotStore = snapshotStoreWithOut() const dvMainStore = dvMainStoreWithOut() const { canvasStyleData } = storeToRefs(dvMainStore) -const onPopButtonChange = () => { +const onThemeChange = () => { snapshotStore.recordSnapshotCache() } diff --git a/core/core-frontend/src/utils/canvasUtils.ts b/core/core-frontend/src/utils/canvasUtils.ts index 1e76287636..e01fff11d9 100644 --- a/core/core-frontend/src/utils/canvasUtils.ts +++ b/core/core-frontend/src/utils/canvasUtils.ts @@ -227,6 +227,8 @@ export function historyAdaptor( canvasVersion ) { //历史字段适配 + canvasStyleResult.dashboard['showGrid'] = canvasStyleResult.dashboard['showGrid'] || false + canvasStyleResult.dashboard['matrixBase'] = canvasStyleResult.dashboard['matrixBase'] || 4 canvasStyleResult.component['seniorStyleSetting'] = canvasStyleResult.component['seniorStyleSetting'] || deepCopy(SENIOR_STYLE_SETTING_LIGHT) canvasStyleResult['suspensionButtonAvailable'] = diff --git a/core/core-frontend/src/views/chart/components/editor/util/dataVisualization.ts b/core/core-frontend/src/views/chart/components/editor/util/dataVisualization.ts index 21a1dfaac2..69ab686328 100644 --- a/core/core-frontend/src/views/chart/components/editor/util/dataVisualization.ts +++ b/core/core-frontend/src/views/chart/components/editor/util/dataVisualization.ts @@ -61,6 +61,8 @@ export const MOBILE_SETTING_DARK = { export const DEFAULT_DASHBOARD_STYLE_BASE = { gap: 'yes', gapSize: 5, + showGrid: false, + matrixBase: 4, // 当前matrix的基数 (是pcMatrixCount的几倍) resultMode: 'all', // 图表结果显示模式 all 图表 custom 仪表板自定义 resultCount: 1000 // 图表结果显示条数 }