From 4906cecd142534a912108aa04a71a4fe12bf9281 Mon Sep 17 00:00:00 2001 From: Siyu Kong Date: Thu, 30 Mar 2023 16:57:27 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=B1=9E=E6=80=A7api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mall/product/property.ts | 103 +++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 src/api/mall/product/property.ts diff --git a/src/api/mall/product/property.ts b/src/api/mall/product/property.ts new file mode 100644 index 00000000..dd693c5c --- /dev/null +++ b/src/api/mall/product/property.ts @@ -0,0 +1,103 @@ +import request from '@/config/axios' + +/** + * 商品属性 + */ +export interface PropertyVO { + id?: number + /** 名称 */ + name: string + /** 备注 */ + remark?: string +} + +/** + * 属性值 + */ +export interface PropertyValueVO { + id?: number + /** 属性项的编号 */ + propertyId?: number + /** 名称 */ + name: string + /** 备注 */ + remark?: string +} + +/** + * 商品属性值的明细 + */ +export interface PropertyValueDetailVO { + /** 属性项的编号 */ + propertyId: number // 属性的编号 + /** 属性的名称 */ + propertyName: string + /** 属性值的编号 */ + valueId: number + /** 属性值的名称 */ + valueName: string +} + +// ------------------------ 属性项 ------------------- + +// 创建属性项 +export const createProperty = (data: PropertyVO) => { + return request.post({ url: '/product/property/create', data }) +} + +// 更新属性项 +export const updateProperty = (data: PropertyVO) => { + return request.put({ url: '/product/property/update', data }) +} + +// 删除属性项 +export const deleteProperty = (id: number) => { + return request.delete({ url: `/product/property/delete?id=${id}` }) +} + +// 获得属性项 +export const getProperty = (id: number): Promise => { + return request.get({ url: `/product/property/get?id=${id}` }) +} + +// 获得属性项分页 +export const getPropertyPage = (params: PageParam & any) => { + return request.get({ url: '/product/property/page', params }) +} + +// 获得属性项列表 +export const getPropertyList = (params: any) => { + return request.get({ url: '/product/property/list', params }) +} + +// 获得属性项列表 +export const getPropertyListAndValue = (params: any) => { + return request.get({ url: '/product/property/get-value-list', params }) +} + +// ------------------------ 属性值 ------------------- + +// 获得属性值分页 +export const getPropertyValuePage = (params: PageParam & any) => { + return request.get({ url: '/product/property/value/page', params }) +} + +// 获得属性值 +export const getPropertyValue = (id: number): Promise => { + return request.get({ url: `/product/property/value/get?id=${id}` }) +} + +// 创建属性值 +export const createPropertyValue = (data: PropertyValueVO) => { + return request.post({ url: '/product/property/value/create', data }) +} + +// 更新属性值 +export const updatePropertyValue = (data: PropertyValueVO) => { + return request.put({ url: '/product/property/value/update', data }) +} + +// 删除属性值 +export const deletePropertyValue = (id: number) => { + return request.delete({ url: `/product/property/value/delete?id=${id}` }) +} From fdbae2dd37c345173d3166231d7f4712d8c0aaf3 Mon Sep 17 00:00:00 2001 From: Siyu Kong Date: Thu, 30 Mar 2023 16:57:48 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=B1=9E=E6=80=A7=E5=80=BC=E8=B7=AF=E7=94=B1=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/modules/remaining.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 43375961..d768f217 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -294,6 +294,22 @@ const remainingRouter: AppRouteRecordRaw[] = [ } } ] + }, + { + path: '/property', + component: Layout, + name: 'property', + meta: { + hidden: true + }, + children: [ + { + path: 'value/:propertyId(\\d+)', + component: () => import('@/views/mall/product/property/value/index.vue'), + name: 'PropertyValue', + meta: { title: '商品属性值', icon: '', activeMenu: '/product/property' } + } + ] } ] From 1724f2c674d7d902953fbfe03a5b8840a525038f Mon Sep 17 00:00:00 2001 From: Siyu Kong Date: Thu, 30 Mar 2023 16:58:06 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=95=86?= =?UTF-8?q?=E5=93=81=E5=B1=9E=E6=80=A7(=E5=80=BC)=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mall/product/property/form.vue | 94 ++++++++++ src/views/mall/product/property/index.vue | 149 ++++++++++++++++ .../mall/product/property/value/form.vue | 101 +++++++++++ .../mall/product/property/value/index.vue | 162 ++++++++++++++++++ 4 files changed, 506 insertions(+) create mode 100644 src/views/mall/product/property/form.vue create mode 100644 src/views/mall/product/property/index.vue create mode 100644 src/views/mall/product/property/value/form.vue create mode 100644 src/views/mall/product/property/value/index.vue diff --git a/src/views/mall/product/property/form.vue b/src/views/mall/product/property/form.vue new file mode 100644 index 00000000..360af99b --- /dev/null +++ b/src/views/mall/product/property/form.vue @@ -0,0 +1,94 @@ + + diff --git a/src/views/mall/product/property/index.vue b/src/views/mall/product/property/index.vue new file mode 100644 index 00000000..36cb5a11 --- /dev/null +++ b/src/views/mall/product/property/index.vue @@ -0,0 +1,149 @@ + + diff --git a/src/views/mall/product/property/value/form.vue b/src/views/mall/product/property/value/form.vue new file mode 100644 index 00000000..51224986 --- /dev/null +++ b/src/views/mall/product/property/value/form.vue @@ -0,0 +1,101 @@ + + diff --git a/src/views/mall/product/property/value/index.vue b/src/views/mall/product/property/value/index.vue new file mode 100644 index 00000000..03b021ab --- /dev/null +++ b/src/views/mall/product/property/value/index.vue @@ -0,0 +1,162 @@ + +