diff --git a/src/components/common/custom-module/model-custom-group/model-custom-group-style.vue b/src/components/common/custom-module/model-custom-group/model-custom-group-style.vue index 4e03ec23..d8773b64 100644 --- a/src/components/common/custom-module/model-custom-group/model-custom-group-style.vue +++ b/src/components/common/custom-module/model-custom-group/model-custom-group-style.vue @@ -99,11 +99,13 @@ const size_location_change = (location: { x: number, y: number, record_x: number // 组件大小变化触发事件 const container_size_change = () => { const { spacing = 0, type = 'left', id = '' } = form.value.data_follow; - // 获取新的位置 - const { x: new_x, y: new_y } = get_container_location(props.componentOptions, id, type, spacing, diy_data.value.location.x, diy_data.value.location.y); - // 重新更新位置信息 - diy_data.value.location = { x: new_x, y: new_y, record_x: new_x, record_y: new_y, staging_y: new_y }; - size_location_change(diy_data.value.location); + if (id != '') { + // 获取新的位置 + const { x: new_x, y: new_y } = get_container_location(props.componentOptions, id, type, spacing, diy_data.value.location.x, diy_data.value.location.y); + // 重新更新位置信息 + diy_data.value.location = { x: new_x, y: new_y, record_x: new_x, record_y: new_y, staging_y: new_y }; + size_location_change(diy_data.value.location); + } operation_end(); } // 监听数据变化 diff --git a/src/components/common/custom-module/model-icon/model-icon-style.vue b/src/components/common/custom-module/model-icon/model-icon-style.vue index a935b27c..f9030a04 100644 --- a/src/components/common/custom-module/model-icon/model-icon-style.vue +++ b/src/components/common/custom-module/model-icon/model-icon-style.vue @@ -170,11 +170,13 @@ const size_location_change = (location: { x: number, y: number, record_x: number // 组件大小变化触发事件 const container_size_change = () => { const { spacing = 0, type = 'left', id = '' } = form.value.data_follow; - // 获取新的位置 - const { x: new_x, y: new_y } = get_container_location(props.componentOptions, id, type, spacing, diy_data.value.location.x, diy_data.value.location.y); - // 重新更新位置信息 - diy_data.value.location = { x: new_x, y: new_y, record_x: new_x, record_y: new_y, staging_y: new_y }; - size_location_change(diy_data.value.location); + if (id != '') { + // 获取新的位置 + const { x: new_x, y: new_y } = get_container_location(props.componentOptions, id, type, spacing, diy_data.value.location.x, diy_data.value.location.y); + // 重新更新位置信息 + diy_data.value.location = { x: new_x, y: new_y, record_x: new_x, record_y: new_y, staging_y: new_y }; + size_location_change(diy_data.value.location); + } operation_end(); } diff --git a/src/components/common/custom-module/model-image/model-image-style.vue b/src/components/common/custom-module/model-image/model-image-style.vue index a235a74d..e21a32dd 100644 --- a/src/components/common/custom-module/model-image/model-image-style.vue +++ b/src/components/common/custom-module/model-image/model-image-style.vue @@ -144,11 +144,13 @@ const size_location_change = (location: { x: number, y: number, record_x: number const img_size_change = () => { const { spacing = 0, type = 'left', id = '' } = form.value.data_follow; - // 获取新的位置 - const { x: new_x, y: new_y } = get_container_location(props.componentOptions, id, type, spacing, diy_data.value.location.x, diy_data.value.location.y); - // 重新更新位置信息 - diy_data.value.location = { x: new_x, y: new_y, record_x: new_x, record_y: new_y, staging_y: new_y }; - size_location_change(diy_data.value.location); + if (id != '') { + // 获取新的位置 + const { x: new_x, y: new_y } = get_container_location(props.componentOptions, id, type, spacing, diy_data.value.location.x, diy_data.value.location.y); + // 重新更新位置信息 + diy_data.value.location = { x: new_x, y: new_y, record_x: new_x, record_y: new_y, staging_y: new_y }; + size_location_change(diy_data.value.location); + } operation_end(); } //#region 位置计算 diff --git a/src/components/common/custom-module/model-lines/model-lines-style.vue b/src/components/common/custom-module/model-lines/model-lines-style.vue index 4e544399..249cc390 100644 --- a/src/components/common/custom-module/model-lines/model-lines-style.vue +++ b/src/components/common/custom-module/model-lines/model-lines-style.vue @@ -108,11 +108,13 @@ const size_location_change = (location: { x: number, y: number, record_x: number // 组件大小变化触发事件 const container_size_change = () => { const { spacing = 0, type = 'left', id = '' } = form.value.data_follow; - // 获取新的位置 - const { x: new_x, y: new_y } = get_container_location(props.componentOptions, id, type, spacing, diy_data.value.location.x, diy_data.value.location.y); - // 重新更新位置信息 - diy_data.value.location = { x: new_x, y: new_y, record_x: new_x, record_y: new_y, staging_y: new_y }; - size_location_change(diy_data.value.location); + if (id != '') { + // 获取新的位置 + const { x: new_x, y: new_y } = get_container_location(props.componentOptions, id, type, spacing, diy_data.value.location.x, diy_data.value.location.y); + // 重新更新位置信息 + diy_data.value.location = { x: new_x, y: new_y, record_x: new_x, record_y: new_y, staging_y: new_y }; + size_location_change(diy_data.value.location); + } operation_end(); } // 监听数据变化 diff --git a/src/components/common/custom-module/model-panel/model-panel-style.vue b/src/components/common/custom-module/model-panel/model-panel-style.vue index bf7b2539..7db80aea 100644 --- a/src/components/common/custom-module/model-panel/model-panel-style.vue +++ b/src/components/common/custom-module/model-panel/model-panel-style.vue @@ -130,11 +130,13 @@ const size_location_change = (location: { x: number, y: number, record_x: number // 组件大小变化触发事件 const container_size_change = () => { const { spacing = 0, type = 'left', id = '' } = form.value.data_follow; - // 获取新的位置 - const { x: new_x, y: new_y } = get_container_location(props.componentOptions, id, type, spacing, diy_data.value.location.x, diy_data.value.location.y); - // 重新更新位置信息 - diy_data.value.location = { x: new_x, y: new_y, record_x: new_x, record_y: new_y, staging_y: new_y }; - size_location_change(diy_data.value.location); + if (id != '') { + // 获取新的位置 + const { x: new_x, y: new_y } = get_container_location(props.componentOptions, id, type, spacing, diy_data.value.location.x, diy_data.value.location.y); + // 重新更新位置信息 + diy_data.value.location = { x: new_x, y: new_y, record_x: new_x, record_y: new_y, staging_y: new_y }; + size_location_change(diy_data.value.location); + } operation_end(); } // 监听数据变化 diff --git a/src/components/common/custom-module/model-text/model-text-style.vue b/src/components/common/custom-module/model-text/model-text-style.vue index b266f6d0..6e152e0d 100644 --- a/src/components/common/custom-module/model-text/model-text-style.vue +++ b/src/components/common/custom-module/model-text/model-text-style.vue @@ -248,11 +248,13 @@ const size_location_change = (location: { x: number, y: number, record_x: number // 组件大小变化触发事件 const container_size_change = () => { const { spacing = 0, type = 'left', id = '' } = form.value.data_follow; - // 获取新的位置 - const { x: new_x, y: new_y } = get_container_location(props.componentOptions, id, type, spacing, diy_data.value.location.x, diy_data.value.location.y); - // 重新更新位置信息 - diy_data.value.location = { x: new_x, y: new_y, record_x: new_x, record_y: new_y, staging_y: new_y }; - size_location_change(diy_data.value.location); + if (id != '') { + // 获取新的位置 + const { x: new_x, y: new_y } = get_container_location(props.componentOptions, id, type, spacing, diy_data.value.location.x, diy_data.value.location.y); + // 重新更新位置信息 + diy_data.value.location = { x: new_x, y: new_y, record_x: new_x, record_y: new_y, staging_y: new_y }; + size_location_change(diy_data.value.location); + } operation_end(); } // 监听数据变化