From b334fa8df9aa7a5abeca905aeef2ef4d7e039eb3 Mon Sep 17 00:00:00 2001
From: sws <1141121512@qq.com>
Date: Tue, 13 Aug 2024 19:02:46 +0800
Subject: [PATCH] =?UTF-8?q?1."=E6=B7=BB=E5=8A=A0=E7=83=AD=E5=8C=BA?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8C=89=E9=92=AE=E4=B8=8E=E5=8F=8C=E5=87=BB?=
=?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BC=98=E5=8C=96"=20sws=202024-08-13?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/common/hot/index.scss | 3 +++
src/components/common/hot/index.vue | 23 +++++++++++++++++++++--
src/types/global.d.ts | 2 +-
3 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/src/components/common/hot/index.scss b/src/components/common/hot/index.scss
index 3e3e8cc5..5c493b94 100644
--- a/src/components/common/hot/index.scss
+++ b/src/components/common/hot/index.scss
@@ -133,6 +133,9 @@
.name {
width: 9.8rem;
}
+ .add_hot {
+ width: 8.8rem;
+ }
}
}
}
diff --git a/src/components/common/hot/index.vue b/src/components/common/hot/index.vue
index 550f657f..02eb6cbf 100644
--- a/src/components/common/hot/index.vue
+++ b/src/components/common/hot/index.vue
@@ -39,13 +39,14 @@
@@ -142,7 +143,7 @@ const end_drag = (event: MouseEvent) => {
if (rect_end.value.width > 16 && rect_end.value.height > 16) {
hot_list.value.data.push({
name: '热区' + (hot_list.value.data.length + 1),
- link: { name: '', link: '' },
+ link: {},
drag_start: cloneDeep(rect_start.value),
drag_end: cloneDeep(rect_end.value),
});
@@ -332,6 +333,24 @@ const rect_style = computed(() => {
const del_event = (index: number) => {
hot_list.value.data.splice(index, 1);
};
+const add_event = () => {
+ hot_list.value.data.push({
+ name: '热区' + (hot_list.value.data.length + 1),
+ link: {},
+ drag_start: {
+ x: 0,
+ y: 0,
+ width: 0,
+ height: 0,
+ },
+ drag_end: {
+ x: 100,
+ y: 100,
+ width: 100,
+ height: 100,
+ },
+ });
+};
//#endregion 右侧热区编辑-----------------------------------------------end
//#region 设置热区弹窗-----------------------------------------------start
diff --git a/src/types/global.d.ts b/src/types/global.d.ts
index 91d5b5ed..576641bf 100644
--- a/src/types/global.d.ts
+++ b/src/types/global.d.ts
@@ -102,7 +102,7 @@ declare global {
*/
type linkData = {
id?: number;
- name: string;
+ name?: string;
link?: String;
data?: Data[];
icon?: string;