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 1/2] =?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; From 32943141625e7371ec654d78f38c414f60d40210 Mon Sep 17 00:00:00 2001 From: sws <1141121512@qq.com> Date: Wed, 14 Aug 2024 18:38:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.=E4=B8=8A=E4=BC=A0=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83=202.=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=BD=AC=E7=A7=BB=E7=BB=84=E4=BB=B6=20sws=202024-08-13?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- src/api/upload.ts | 57 ++++++ .../common/upload/form-upload-category.vue | 35 +++- src/components/common/upload/index.ts | 9 - src/components/common/upload/index.vue | 184 ++++++++---------- .../common/upload/transform-category.vue | 133 +++++++++++++ src/components/footer-nav/index.vue | 2 +- src/store/index.ts | 6 +- src/store/modules/footer-nav-content.ts | 2 +- src/store/modules/upload.ts | 25 +++ src/utils/request.ts | 53 ++--- 11 files changed, 363 insertions(+), 145 deletions(-) create mode 100644 src/api/upload.ts delete mode 100644 src/components/common/upload/index.ts create mode 100644 src/components/common/upload/transform-category.vue create mode 100644 src/store/modules/upload.ts diff --git a/.env.development b/.env.development index 1c4d07ed..59af289d 100644 --- a/.env.development +++ b/.env.development @@ -6,4 +6,4 @@ NODE_ENV='dev' VITE_APP_TITLE = 'shopxo' VITE_APP_PORT = 3000 VITE_APP_BASE_API = '/dev-api' -VITE_APP_BASE_API_URL = 'http://shopxo.com/' \ No newline at end of file +VITE_APP_BASE_API_URL = 'http://shopxo.com/admin.php/' \ No newline at end of file diff --git a/src/api/upload.ts b/src/api/upload.ts new file mode 100644 index 00000000..3c0e003f --- /dev/null +++ b/src/api/upload.ts @@ -0,0 +1,57 @@ +import request from '@/utils/request'; + +class UploadAPI { + /** 分类查询接口*/ + static getTree() { + return request({ + url: `diyapi/attachmentinit`, + method: 'post', + }); + } + /** 分类新增,修改接口 */ + static saveTree(data: any) { + return request({ + url: `diyapi/attachmentcategorysave`, + method: 'post', + data, + }); + } + /** 分类删除接口 */ + static delTree(data: any) { + return request({ + url: `diyapi/attachmentcategorydelete`, + method: 'post', + data, + }); + } + /** 附件移动分类 */ + static moveTree(data: any) { + return request({ + url: `diyapi/attachmentmovecategory`, + method: 'post', + data, + }); + } +} + +export default UploadAPI; + +// 分类树结构 +export interface Tree { + /** 主键 */ + id: string; + /** 父级id */ + pid: string; + /** 名称 */ + name: string; + /** 路径 */ + path: string; + /** 是否开启 */ + is_enable: boolean; + /** 排序 */ + sort: number; + /** 下级 */ + items?: Tree[]; + /** 图标 */ + icon?: string; +} diff --git a/src/components/common/upload/form-upload-category.vue b/src/components/common/upload/form-upload-category.vue index 7c419072..db365f4d 100644 --- a/src/components/common/upload/form-upload-category.vue +++ b/src/components/common/upload/form-upload-category.vue @@ -32,11 +32,14 @@ + diff --git a/src/components/footer-nav/index.vue b/src/components/footer-nav/index.vue index a18c8ba7..1d59b50d 100644 --- a/src/components/footer-nav/index.vue +++ b/src/components/footer-nav/index.vue @@ -15,7 +15,7 @@