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 261eb3b4..19009184 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
@@ -109,7 +109,9 @@ watch(
diy_data.value.location.x = location_compute(width, val.location.x, 390);
diy_data.value.location.y = location_compute(height, val.location.y, center_height.value);
- diy_data.value.location.staging_y = diy_data.value.location.y;
+ diy_data.value.location.record_x = location_compute(width, val.location.record_x, 390);
+ diy_data.value.location.record_y = location_compute(height, val.location.record_y, center_height.value);
+ diy_data.value.location.staging_y = location_compute(height, val.location.staging_y, center_height.value);
form.value.com_width = width;
form.value.com_height = height;
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 d996539c..2de993e0 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
@@ -69,7 +69,10 @@ watch(diy_data, (val) => {
diy_data.value.location.x = location_compute(width, val.location.x, 390);
diy_data.value.location.y = location_compute(height, val.location.y, center_height.value);
- diy_data.value.location.staging_y = diy_data.value.location.y;
+
+ diy_data.value.location.record_x = location_compute(width, val.location.record_x, 390);
+ diy_data.value.location.record_y = location_compute(height, val.location.record_y, center_height.value);
+ diy_data.value.location.staging_y = location_compute(height, val.location.staging_y, center_height.value);
form.value.com_width = width;
form.value.com_height = height;
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 cf294565..d641a026 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
@@ -110,7 +110,7 @@
diff --git a/src/components/model-custom/model-custom-content.vue b/src/components/model-custom/model-custom-content.vue
index 34759589..b6cdd945 100644
--- a/src/components/model-custom/model-custom-content.vue
+++ b/src/components/model-custom/model-custom-content.vue
@@ -26,7 +26,9 @@
-
+
+
+
@@ -63,6 +65,8 @@ const diy_data = ref({
location: {
x: 0,
y: 0,
+ record_x: 0,
+ record_y: 0,
staging_y: 0,
},
com_data: {},
@@ -71,6 +75,8 @@ const key = ref('');
const dragkey = ref('');
const right_update = (item: any) => {
+ console.log(item, '122545');
+
diy_data.value = item;
// 生成随机id
key.value = Math.random().toString(36).substring(2);
diff --git a/src/utils/index.ts b/src/utils/index.ts
index 4338315e..8f8ef5b0 100644
--- a/src/utils/index.ts
+++ b/src/utils/index.ts
@@ -232,4 +232,21 @@ export const location_compute = (size: number, location: number, container_size:
} else {
return location;
}
+}
+// 判断两个矩形是否有交集或者被包裹
+export const isRectangleIntersecting = (rect1: react1, rect2: react1) => {
+ // 矩形的格式为 { x, y, width, height }
+ const { x: x1, y: y1, width: w1, height: h1 } = rect1;
+ const { x: x2, y: y2, width: w2, height: h2 } = rect2;
+
+ // 检查是否有交集
+ if ((x1 < x2 + w2 && x1 + w1 > x2) && (y1 < y2 + h2 && y1 + h1 > y2)) {
+ return true; // 有交集
+ }
+
+ // 检查是否一个包含另一个
+ if (x1 >= x2 && y1 >= y2 && x1 + w1 <= x2 + w2 && y1 + h1 <= y2 + h2) {
+ return true; // rect1完全包含rect2
+ }
+ return false; // 无交集
}
\ No newline at end of file