From 08293737e1ec22e4763c61ef661262a9a06e4a78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Fri, 21 Feb 2025 11:45:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=96=87=E6=9C=AC=E5=AE=BD?= =?UTF-8?q?=E9=AB=98=E8=87=AA=E5=AE=9A=E4=B9=89=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom-module/custom-location/index.vue | 24 ++++++++------ .../common/custom-module/model-text/index.vue | 31 ++++++++++++++++--- .../model-text/model-text-style.vue | 24 +++++++++++--- .../model-custom/components/index-default.ts | 2 ++ .../model-custom/components/index.vue | 18 ++++++++++- 5 files changed, 80 insertions(+), 19 deletions(-) diff --git a/src/components/common/custom-module/custom-location/index.vue b/src/components/common/custom-module/custom-location/index.vue index 86158dfe..ccbb3ac4 100644 --- a/src/components/common/custom-module/custom-location/index.vue +++ b/src/components/common/custom-module/custom-location/index.vue @@ -19,10 +19,10 @@ - + - + @@ -37,20 +37,24 @@ const props = defineProps({ // 跟随内容 const data_follow = defineModel('follow', { type: Object, default: { follow_type: 'none', follow_id: '', follow_spacing: 0 }}); // x轴 Y轴设计 -const data_location = defineModel({ type: Object, default: () => ({ x: 0, y: 0, staging_y: 0 }) }); +const data_location = defineModel({ type: Object, default: () => ({ x: 0, y: 0, record_x: 0, record_y: 0, staging_y: 0 }) }); const emit = defineEmits(['operation_end']); // 失去焦点时触发事件 const operation_end = () => { emit('operation_end'); }; +// x轴变化时,更新记录的位置 +const location_x_change = (val: number) => { + data_location.value.record_x = val; +} +// y轴变化时,更新记录的位置 +const location_y_change = (val: number) => { + data_location.value.record_y = val; + data_location.value.staging_y = val +}; // 跟随id发生变化时的处理 const follow_id_change = () => { - + emit('operation_end'); + } -// 监听y轴 -watch(() => data_location.value.y, (val) => { - if (val !== data_location.value.staging_y) { - data_location.value.staging_y = val; - } -}); \ No newline at end of file diff --git a/src/components/common/custom-module/model-text/index.vue b/src/components/common/custom-module/model-text/index.vue index 5185d1dd..2befca40 100644 --- a/src/components/common/custom-module/model-text/index.vue +++ b/src/components/common/custom-module/model-text/index.vue @@ -1,5 +1,5 @@