@@ -73,8 +104,36 @@ defineExpose({
width: 0px !important;
height: 0px !important;
}
+.ruler-vertical {
+ position: absolute;
+ left: 30px;
+ top: 30px;
+ transform-origin: top left;
+ transform: rotate(90deg);
+ overflow-y: auto;
+ overflow-x: hidden;
+ z-index: 1;
+ .ruler {
+ .ruler-line {
+ top: 0;
+ }
+ .ruler-tick {
+ top: 0;
+ .tick-label {
+ transform: rotate(180deg);
+ }
+ }
+ }
+}
+
+.ruler-shadow {
+ position: absolute;
+ height: 30px;
+ z-index: 10;
+ overflow: hidden;
+}
+
.ruler-outer {
- width: 100%;
overflow-x: auto;
background-color: #2c2c2c;
}
diff --git a/core/core-frontend/src/custom-component/common/DeRulerVertical.vue b/core/core-frontend/src/custom-component/common/DeRulerVertical.vue
new file mode 100644
index 0000000000..1c83edb05a
--- /dev/null
+++ b/core/core-frontend/src/custom-component/common/DeRulerVertical.vue
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+
diff --git a/core/core-frontend/src/views/data-visualization/index.vue b/core/core-frontend/src/views/data-visualization/index.vue
index 8bd5e7314a..b184c4ca81 100644
--- a/core/core-frontend/src/views/data-visualization/index.vue
+++ b/core/core-frontend/src/views/data-visualization/index.vue
@@ -65,6 +65,7 @@ const contextmenuStore = contextmenuStoreWithOut()
const composeStore = composeStoreWithOut()
const canvasCacheOutRef = ref(null)
const deWRulerRef = ref(null)
+const deHRulerRef = ref(null)
const {
fullscreenFlag,
@@ -82,6 +83,7 @@ const canvasInner = ref(null)
const leftSidebarRef = ref(null)
const dvLayout = ref(null)
const canvasCenterRef = ref(null)
+const mainHeight = ref(300)
const state = reactive({
datasetTree: [],
scaleHistory: null,
@@ -179,9 +181,9 @@ const initScroll = () => {
nextTick(() => {
const { width, height } = canvasStyleData.value
const mainWidth = canvasCenterRef.value.clientWidth
- const mainHeight = canvasCenterRef.value.clientHeight
+ mainHeight.value = canvasCenterRef.value.clientHeight
const scrollX = (1.5 * width - mainWidth) / 2
- const scrollY = (1.5 * height - mainHeight) / 2 + 20
+ const scrollY = (1.5 * height - mainHeight.value) / 2 + 20
// 设置画布初始滚动条位置
canvasOut.value.scrollTo(scrollX, scrollY)
})
@@ -361,7 +363,9 @@ const viewsPropertiesShow = computed(
const scrollCanvas = e => {
deWRulerRef.value.rulerScroll(e)
+ deHRulerRef.value.rulerScroll(e)
}
+
eventBus.on('handleNew', handleNew)
@@ -393,7 +397,13 @@ eventBus.on('handleNew', handleNew)
+
+
+
+
+
+
From 7058c97b9814ebbb0076259cfd51619fb1b10b93 Mon Sep 17 00:00:00 2001
From: wangjiahao <1522128093@qq.com>
Date: Sun, 23 Jun 2024 23:41:27 +0800
Subject: [PATCH 2/2] =?UTF-8?q?feat(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):?=
=?UTF-8?q?=20=E5=A2=9E=E5=8A=A0=E5=BD=93=E5=89=8D=E7=82=B9=E5=87=BB?=
=?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=88=BB=E5=BA=A6=E5=B0=BA=E5=AE=9A=E4=BD=8D?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/custom-component/common/DeRuler.vue | 40 ++++++++++++++++++-
1 file changed, 39 insertions(+), 1 deletion(-)
diff --git a/core/core-frontend/src/custom-component/common/DeRuler.vue b/core/core-frontend/src/custom-component/common/DeRuler.vue
index 0624526f2f..a12441b9ae 100644
--- a/core/core-frontend/src/custom-component/common/DeRuler.vue
+++ b/core/core-frontend/src/custom-component/common/DeRuler.vue
@@ -21,12 +21,43 @@ const props = defineProps({
const labelInterval = 5
-const { canvasStyleData } = storeToRefs(dvMainStore)
+const { canvasStyleData, curComponent } = storeToRefs(dvMainStore)
const rulerSize = computed(() =>
props.direction === 'horizontal' ? canvasStyleData.value.width : canvasStyleData.value.height
)
+const curComponentSize = computed(() => {
+ if (curComponent.value) {
+ return (
+ ((props.direction === 'horizontal'
+ ? curComponent.value.style.width
+ : curComponent.value.style.height) *
+ canvasStyleData.value.scale) /
+ 100
+ )
+ } else {
+ return 0
+ }
+})
+
+const curComponentShadow = computed(() => {
+ if (curComponent.value) {
+ return {
+ left:
+ (props.direction === 'horizontal'
+ ? curComponent.value.style.left
+ : curComponent.value.style.top) + 'px',
+ width:
+ (props.direction === 'horizontal'
+ ? curComponent.value.style.width
+ : curComponent.value.style.height) + 'px'
+ }
+ } else {
+ return {}
+ }
+})
+
const ticks = computed(() => {
const result = []
let currentValue = 0
@@ -84,6 +115,7 @@ defineExpose({