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 @@