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