From bd944c4a8b6374eb84cac580f412a89ad02b5ae0 Mon Sep 17 00:00:00 2001 From: shuaidawang Date: Wed, 18 May 2022 17:12:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E8=A7=84=E6=A0=BC=E5=92=8Csp?= =?UTF-8?q?u=E5=89=8D=E7=AB=AF=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/mall.sql | 4 +- .../src/api/mall/product/property.js | 54 ++++ yudao-ui-admin/src/api/mall/product/spu.js | 54 ++++ .../src/views/mall/product/property/index.vue | 227 +++++++++++++ .../src/views/mall/product/spu/index.vue | 303 ++++++++++++++++++ 5 files changed, 640 insertions(+), 2 deletions(-) create mode 100644 yudao-ui-admin/src/api/mall/product/property.js create mode 100644 yudao-ui-admin/src/api/mall/product/spu.js create mode 100644 yudao-ui-admin/src/views/mall/product/property/index.vue create mode 100644 yudao-ui-admin/src/views/mall/product/spu/index.vue diff --git a/sql/mall.sql b/sql/mall.sql index 4f6a7763e..c3945a1fe 100644 --- a/sql/mall.sql +++ b/sql/mall.sql @@ -129,7 +129,7 @@ CREATE TABLE `market_activity` -- 规格菜单 SQL INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status) -VALUES ('规格管理', '', 2, 3, 2001, 'property', '', 'product/property/index', 0); +VALUES ('规格管理', '', 2, 3, 2001, 'property', '', 'mall/product/property/index', 0); -- 按钮父菜单ID SELECT @parentId := LAST_INSERT_ID(); @@ -149,7 +149,7 @@ VALUES ('规格导出', 'product:property:export', 3, 5, @parentId, '', '', '', -- 商品菜单 SQL INSERT INTO system_menu(name, permission, type, sort, parent_id, path, icon, component, status) -VALUES ('商品管理', '', 2, 2, 2001, 'spu', '', 'product/spu/index', 0); +VALUES ('商品管理', '', 2, 2, 2001, 'spu', '', 'mall/product/spu/index', 0); -- 按钮父菜单ID SELECT @parentId := LAST_INSERT_ID(); diff --git a/yudao-ui-admin/src/api/mall/product/property.js b/yudao-ui-admin/src/api/mall/product/property.js new file mode 100644 index 000000000..58ae320f6 --- /dev/null +++ b/yudao-ui-admin/src/api/mall/product/property.js @@ -0,0 +1,54 @@ +import request from '@/utils/request' + +// 创建规格名称 +export function createProperty(data) { + return request({ + url: '/product/property/create', + method: 'post', + data: data + }) +} + +// 更新规格名称 +export function updateProperty(data) { + return request({ + url: '/product/property/update', + method: 'put', + data: data + }) +} + +// 删除规格名称 +export function deleteProperty(id) { + return request({ + url: '/product/property/delete?id=' + id, + method: 'delete' + }) +} + +// 获得规格名称 +export function getProperty(id) { + return request({ + url: '/product/property/get?id=' + id, + method: 'get' + }) +} + +// 获得规格名称分页 +export function getPropertyPage(query) { + return request({ + url: '/product/property/page', + method: 'get', + params: query + }) +} + +// 导出规格名称 Excel +export function exportPropertyExcel(query) { + return request({ + url: '/product/property/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/yudao-ui-admin/src/api/mall/product/spu.js b/yudao-ui-admin/src/api/mall/product/spu.js new file mode 100644 index 000000000..068e7d838 --- /dev/null +++ b/yudao-ui-admin/src/api/mall/product/spu.js @@ -0,0 +1,54 @@ +import request from '@/utils/request' + +// 创建商品spu +export function createSpu(data) { + return request({ + url: '/product/spu/create', + method: 'post', + data: data + }) +} + +// 更新商品spu +export function updateSpu(data) { + return request({ + url: '/product/spu/update', + method: 'put', + data: data + }) +} + +// 删除商品spu +export function deleteSpu(id) { + return request({ + url: '/product/spu/delete?id=' + id, + method: 'delete' + }) +} + +// 获得商品spu +export function getSpu(id) { + return request({ + url: '/product/spu/get?id=' + id, + method: 'get' + }) +} + +// 获得商品spu分页 +export function getSpuPage(query) { + return request({ + url: '/product/spu/page', + method: 'get', + params: query + }) +} + +// 导出商品spu Excel +export function exportSpuExcel(query) { + return request({ + url: '/product/spu/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/yudao-ui-admin/src/views/mall/product/property/index.vue b/yudao-ui-admin/src/views/mall/product/property/index.vue new file mode 100644 index 000000000..525c58314 --- /dev/null +++ b/yudao-ui-admin/src/views/mall/product/property/index.vue @@ -0,0 +1,227 @@ + + + diff --git a/yudao-ui-admin/src/views/mall/product/spu/index.vue b/yudao-ui-admin/src/views/mall/product/spu/index.vue new file mode 100644 index 000000000..90d12cdd4 --- /dev/null +++ b/yudao-ui-admin/src/views/mall/product/spu/index.vue @@ -0,0 +1,303 @@ + + +