From 9a16e09fa16625c24c4770d286657e59bb4bed21 Mon Sep 17 00:00:00 2001 From: duan <1004387497@qq.com> Date: Thu, 27 Feb 2025 10:20:13 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9B=BE=E5=BA=93=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/product/index.ts | 7 +- src/components/mycomponents/addImg.vue | 203 +++++++++--------- .../mycomponents/addImgconfig/gallery.ts | 51 +++++ .../addImgconfig/imageComponent.vue | 104 +++------ .../mycomponents/addImgconfig/picture.ts | 51 +++++ src/views/inventory/consumables.vue | 17 +- .../inventory/consumablesconfig/Content.vue | 23 ++ .../consumablesconfig/DataStatistics.vue | 103 +++++++++ .../inventory/consumablesconfig/Search.vue | 61 ++++++ .../consumablesconfig/component/AddButton.vue | 7 + .../consumablesconfig/component/Paging.vue | 22 ++ .../consumablesconfig/component/Table.vue | 34 +++ src/views/product/indexconfig/addgoods.vue | 60 +++--- 13 files changed, 541 insertions(+), 202 deletions(-) create mode 100644 src/components/mycomponents/addImgconfig/gallery.ts create mode 100644 src/components/mycomponents/addImgconfig/picture.ts create mode 100644 src/views/inventory/consumablesconfig/Content.vue create mode 100644 src/views/inventory/consumablesconfig/DataStatistics.vue create mode 100644 src/views/inventory/consumablesconfig/Search.vue create mode 100644 src/views/inventory/consumablesconfig/component/AddButton.vue create mode 100644 src/views/inventory/consumablesconfig/component/Paging.vue create mode 100644 src/views/inventory/consumablesconfig/component/Table.vue diff --git a/src/api/product/index.ts b/src/api/product/index.ts index 6fc4b8b..dcad8f2 100644 --- a/src/api/product/index.ts +++ b/src/api/product/index.ts @@ -11,7 +11,7 @@ const AuthAPI = { params, }); }, - // 单位新增 + // 新增 addunit(data: any) { return request({ url: `${baseURL}`, @@ -19,14 +19,14 @@ const AuthAPI = { data, }); }, - // 获取详情 + // 详情 getunitinfo(id: number) { return request({ url: `${baseURL}/${id}`, method: "get", }); }, - // 编辑确定 + // 编辑 update(data: Object) { return request({ url: `${baseURL}`, @@ -56,6 +56,7 @@ const AuthAPI = { method: "get", }); }, + }; diff --git a/src/components/mycomponents/addImg.vue b/src/components/mycomponents/addImg.vue index 963817e..ec01139 100644 --- a/src/components/mycomponents/addImg.vue +++ b/src/components/mycomponents/addImg.vue @@ -2,19 +2,27 @@ + 新增分类
    -
  • - {{ item.name }} ({{ item.count }}) +
    + {{ item.name }} +
    + 修改  + 删除  +
    +
-
我的图片 -
- + - +
diff --git a/src/components/mycomponents/addImgconfig/picture.ts b/src/components/mycomponents/addImgconfig/picture.ts new file mode 100644 index 0000000..1ee67d9 --- /dev/null +++ b/src/components/mycomponents/addImgconfig/picture.ts @@ -0,0 +1,51 @@ +import request from "@/utils/request"; +const baseURL = "/account/admin/picture/gallery"; +// 图片管理 +const AuthAPI = { + /** 列表*/ + getPage(params: any) { + return request({ + url: `${baseURL}/page`, + method: "get", + params, + }); + }, + // 新增 + add(data: any) { + return request({ + url: `${baseURL}`, + method: "post", + data, + }); + }, + + // 修改 + update(data: Object) { + return request({ + url: `${baseURL}`, + method: "put", + data, + }); + }, + // 删除 + deleteByIds(id: number | String) { + return request({ + url: `${baseURL}/${id}`, + method: "delete", + }); + }, + +}; + +export interface Responseres { + code?: number | null; + data?: any; + msg?: null | string; + [property: string]: any; +} + +export default AuthAPI; + + + + diff --git a/src/views/inventory/consumables.vue b/src/views/inventory/consumables.vue index 41a40c8..abe5038 100644 --- a/src/views/inventory/consumables.vue +++ b/src/views/inventory/consumables.vue @@ -1 +1,16 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/src/views/inventory/consumablesconfig/Content.vue b/src/views/inventory/consumablesconfig/Content.vue new file mode 100644 index 0000000..acaa56b --- /dev/null +++ b/src/views/inventory/consumablesconfig/Content.vue @@ -0,0 +1,23 @@ + + + \ No newline at end of file diff --git a/src/views/inventory/consumablesconfig/DataStatistics.vue b/src/views/inventory/consumablesconfig/DataStatistics.vue new file mode 100644 index 0000000..f5c93d9 --- /dev/null +++ b/src/views/inventory/consumablesconfig/DataStatistics.vue @@ -0,0 +1,103 @@ + + + + + \ No newline at end of file diff --git a/src/views/inventory/consumablesconfig/Search.vue b/src/views/inventory/consumablesconfig/Search.vue new file mode 100644 index 0000000..aaaa1f6 --- /dev/null +++ b/src/views/inventory/consumablesconfig/Search.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/src/views/inventory/consumablesconfig/component/AddButton.vue b/src/views/inventory/consumablesconfig/component/AddButton.vue new file mode 100644 index 0000000..7d93775 --- /dev/null +++ b/src/views/inventory/consumablesconfig/component/AddButton.vue @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/src/views/inventory/consumablesconfig/component/Paging.vue b/src/views/inventory/consumablesconfig/component/Paging.vue new file mode 100644 index 0000000..e04fbf6 --- /dev/null +++ b/src/views/inventory/consumablesconfig/component/Paging.vue @@ -0,0 +1,22 @@ + + \ No newline at end of file diff --git a/src/views/inventory/consumablesconfig/component/Table.vue b/src/views/inventory/consumablesconfig/component/Table.vue new file mode 100644 index 0000000..bb10f57 --- /dev/null +++ b/src/views/inventory/consumablesconfig/component/Table.vue @@ -0,0 +1,34 @@ + + + diff --git a/src/views/product/indexconfig/addgoods.vue b/src/views/product/indexconfig/addgoods.vue index 7b6d794..4907560 100644 --- a/src/views/product/indexconfig/addgoods.vue +++ b/src/views/product/indexconfig/addgoods.vue @@ -33,32 +33,26 @@ - - - +
-
- - +
+ + + +
+
- --> +
注:第一张图为商品封面图,图片尺寸为750×750
- + 单规格商品 @@ -309,7 +303,6 @@ let datas = reactive({ showSelectSku: false, selectSkuItem: {}, addGroupIndex: -1, - imgList: [], }) let shopListRef = ref(null) @@ -328,7 +321,6 @@ interface datasForm { showSelectSku: boolean, selectSkuItem: any, addGroupIndex: any, - imgList: any[] } interface RuleForm { name: string, @@ -343,7 +335,7 @@ interface RuleForm { skuList: string[], weight: any, isAllowTempModifyPrice: any, - days: string[], + days: any, useTime: string[], startTime: string, endTime: string, @@ -529,13 +521,11 @@ function addgoods(index: number = -1) { (shopListRef.value as any)?.opens() } function deleteEvent(d: any) { - let index = datas.imgList.findIndex((ele) => ele.url == d.url); - datas.imgList.splice(index, 1); + let index = ruleForm.images.findIndex((ele) => ele == d); + ruleForm.images.splice(index, 1); } function successEvent(d: any) { - // this.form.images.push(d[0].url); - // this.imgList.push(d[0]); - + ruleForm.images.push(d[0].url); } // 分组选择商品 function selectShopRes(res: Array) { @@ -757,11 +747,17 @@ const submitForm = async (formEl: FormInstance | undefined) => { // console.log(ruleForm, '套餐') } if (ruleForm.id) { + setTimeout(() => { + ruleForm.days = ruleForm.days.split(',') + }, 600); let res = await UserAPI3.update(ruleForm) if (res.code == 200) { ElMessage.success("修改成功"); } } else { + setTimeout(() => { + ruleForm.days = ruleForm.days.split(',') + }, 600); let res = await UserAPI3.addunit(ruleForm) if (res.code == 200) { ElMessage.success("添加成功"); @@ -869,6 +865,10 @@ const resetForm = (formEl: FormInstance | undefined) => { margin-bottom: 20px; } +.showStyle:hover>.buttonstyle { + display: block; +} + .upImgStyle { cursor: pointer; width: 148px; @@ -880,4 +880,16 @@ const resetForm = (formEl: FormInstance | undefined) => { font-size: 30px; color: #ccc; } + +.buttonstyle { + border-radius: 50%; + color: #db1616; + background-color: #fff; + font-size: 20px; + display: none; + position: absolute; + right: 0px; + top: -10px; + z-index: 10; +} \ No newline at end of file