From fe9f1516f897b61cda7c6309b8574f964b99d312 Mon Sep 17 00:00:00 2001
From: yuanjunzhe <1374457292@qq.com>
Date: Tue, 12 Mar 2024 15:01:06 +0800
Subject: [PATCH] Default Changelist
---
src/api/product/attribute.js | 2 +-
src/api/product/attributeGroup.js | 2 +-
src/api/product/brand.js | 12 +-
src/api/product/category.js | 17 +-
src/api/product/comment.js | 44 ++
src/api/product/{product.js => info.js} | 20 +-
src/api/product/productComment.js | 44 --
src/api/product/rule.js | 2 +-
src/components/CheckAttribute/index.vue | 156 ++++
src/components/CheckAttributeGroup/index.vue | 152 ++++
src/components/CheckBrand/index.vue | 152 ++++
src/components/ImageUpload/index.vue | 1 +
src/views/product/attribute/index.vue | 47 +-
src/views/product/attributeGroup/index.vue | 219 +++++-
src/views/product/brand/index.vue | 77 +-
src/views/product/category/index.vue | 168 ++--
.../{productComment => comment}/index.vue | 75 +-
src/views/product/info/index.vue | 742 ++++++++++++++++++
src/views/product/product/index.vue | 338 --------
src/views/product/rule/index.vue | 163 +++-
20 files changed, 1843 insertions(+), 590 deletions(-)
create mode 100644 src/api/product/comment.js
rename src/api/product/{product.js => info.js} (56%)
delete mode 100644 src/api/product/productComment.js
create mode 100644 src/components/CheckAttribute/index.vue
create mode 100644 src/components/CheckAttributeGroup/index.vue
create mode 100644 src/components/CheckBrand/index.vue
rename src/views/product/{productComment => comment}/index.vue (78%)
create mode 100644 src/views/product/info/index.vue
delete mode 100644 src/views/product/product/index.vue
diff --git a/src/api/product/attribute.js b/src/api/product/attribute.js
index 948166e..bc66f29 100644
--- a/src/api/product/attribute.js
+++ b/src/api/product/attribute.js
@@ -29,7 +29,7 @@ export function addAttribute(data) {
// 修改商品属性
export function updateAttribute(data) {
return request({
- url: '/product/attribute',
+ url: '/product/attribute/'+data.id,
method: 'put',
data: data
})
diff --git a/src/api/product/attributeGroup.js b/src/api/product/attributeGroup.js
index 97500df..22544a2 100644
--- a/src/api/product/attributeGroup.js
+++ b/src/api/product/attributeGroup.js
@@ -29,7 +29,7 @@ export function addAttributeGroup(data) {
// 修改属性组
export function updateAttributeGroup(data) {
return request({
- url: '/product/attributeGroup',
+ url: '/product/attributeGroup/'+data.id,
method: 'put',
data: data
})
diff --git a/src/api/product/brand.js b/src/api/product/brand.js
index 7221cc3..a3023a6 100644
--- a/src/api/product/brand.js
+++ b/src/api/product/brand.js
@@ -1,6 +1,6 @@
import request from '@/utils/request'
-// 查询商品品牌列表
+// 查询品牌信息列表
export function listBrand(query) {
return request({
url: '/product/brand/list',
@@ -9,7 +9,7 @@ export function listBrand(query) {
})
}
-// 查询商品品牌详细
+// 查询品牌信息详细
export function getBrand(id) {
return request({
url: '/product/brand/' + id,
@@ -17,7 +17,7 @@ export function getBrand(id) {
})
}
-// 新增商品品牌
+// 新增品牌信息
export function addBrand(data) {
return request({
url: '/product/brand',
@@ -26,16 +26,16 @@ export function addBrand(data) {
})
}
-// 修改商品品牌
+// 修改品牌信息
export function updateBrand(data) {
return request({
- url: '/product/brand',
+ url: '/product/brand/'+data.id,
method: 'put',
data: data
})
}
-// 删除商品品牌
+// 删除品牌信息
export function delBrand(id) {
return request({
url: '/product/brand/' + id,
diff --git a/src/api/product/category.js b/src/api/product/category.js
index d6ef8a4..fade048 100644
--- a/src/api/product/category.js
+++ b/src/api/product/category.js
@@ -16,6 +16,21 @@ export function getCategory(id) {
method: 'get'
})
}
+// 查询品类共有元素
+export function getTemplateAttribute(id) {
+ return request({
+ url: '/product/category/getTemplateAttribute/' + id,
+ method: 'get'
+ })
+}
+
+// 查询品类信息详细
+export function parentCommonElement(id) {
+ return request({
+ url: '/product/category/parentCommonElement/' + id,
+ method: 'get'
+ })
+}
// 新增品类信息
export function addCategory(data) {
@@ -29,7 +44,7 @@ export function addCategory(data) {
// 修改品类信息
export function updateCategory(data) {
return request({
- url: '/product/category',
+ url: '/product/category/'+data.id,
method: 'put',
data: data
})
diff --git a/src/api/product/comment.js b/src/api/product/comment.js
new file mode 100644
index 0000000..7460851
--- /dev/null
+++ b/src/api/product/comment.js
@@ -0,0 +1,44 @@
+import request from '../../../../cloud-ui123/src/utils/request'
+
+// 查询商品评论列表
+export function listComment(query) {
+ return request({
+ url: '/product/comment/list',
+ method: 'get',
+ params: query
+ })
+}
+
+// 查询商品评论详细
+export function getComment(id) {
+ return request({
+ url: '/product/comment/' + id,
+ method: 'get'
+ })
+}
+
+// 新增商品评论
+export function addComment(data) {
+ return request({
+ url: '/product/comment',
+ method: 'post',
+ data: data
+ })
+}
+
+// 修改商品评论
+export function updateComment(data) {
+ return request({
+ url: '/product/comment/'+data.id,
+ method: 'put',
+ data: data
+ })
+}
+
+// 删除商品评论
+export function delComment(id) {
+ return request({
+ url: '/product/comment/' + id,
+ method: 'delete'
+ })
+}
diff --git a/src/api/product/product.js b/src/api/product/info.js
similarity index 56%
rename from src/api/product/product.js
rename to src/api/product/info.js
index ab8a62d..80b02c2 100644
--- a/src/api/product/product.js
+++ b/src/api/product/info.js
@@ -1,44 +1,44 @@
import request from '@/utils/request'
// 查询商品信息列表
-export function listProduct(query) {
+export function listInfo(query) {
return request({
- url: '/product/product/list',
+ url: '/product/info/list',
method: 'get',
params: query
})
}
// 查询商品信息详细
-export function getProduct(id) {
+export function getInfo(id) {
return request({
- url: '/product/product/' + id,
+ url: '/product/info/' + id,
method: 'get'
})
}
// 新增商品信息
-export function addProduct(data) {
+export function addInfo(data) {
return request({
- url: '/product/product',
+ url: '/product/info',
method: 'post',
data: data
})
}
// 修改商品信息
-export function updateProduct(data) {
+export function updateInfo(data) {
return request({
- url: '/product/product',
+ url: '/product/info/'+data.id,
method: 'put',
data: data
})
}
// 删除商品信息
-export function delProduct(id) {
+export function delInfo(id) {
return request({
- url: '/product/product/' + id,
+ url: '/product/info/' + id,
method: 'delete'
})
}
diff --git a/src/api/product/productComment.js b/src/api/product/productComment.js
deleted file mode 100644
index f17b78b..0000000
--- a/src/api/product/productComment.js
+++ /dev/null
@@ -1,44 +0,0 @@
-import request from '@/utils/request'
-
-// 查询商品评论列表
-export function listProductComment(query) {
- return request({
- url: '/product/productComment/list',
- method: 'get',
- params: query
- })
-}
-
-// 查询商品评论详细
-export function getProductComment(id) {
- return request({
- url: '/product/productComment/' + id,
- method: 'get'
- })
-}
-
-// 新增商品评论
-export function addProductComment(data) {
- return request({
- url: '/product/productComment',
- method: 'post',
- data: data
- })
-}
-
-// 修改商品评论
-export function updateProductComment(data) {
- return request({
- url: '/product/productComment',
- method: 'put',
- data: data
- })
-}
-
-// 删除商品评论
-export function delProductComment(id) {
- return request({
- url: '/product/productComment/' + id,
- method: 'delete'
- })
-}
diff --git a/src/api/product/rule.js b/src/api/product/rule.js
index 18dacc1..f2de650 100644
--- a/src/api/product/rule.js
+++ b/src/api/product/rule.js
@@ -29,7 +29,7 @@ export function addRule(data) {
// 修改商品规格
export function updateRule(data) {
return request({
- url: '/product/rule',
+ url: '/product/rule/'+data.id,
method: 'put',
data: data
})
diff --git a/src/components/CheckAttribute/index.vue b/src/components/CheckAttribute/index.vue
new file mode 100644
index 0000000..c798636
--- /dev/null
+++ b/src/components/CheckAttribute/index.vue
@@ -0,0 +1,156 @@
+
+
+
+
+ 选择属性关联关系
+
+
+
+ 已选择属性
+
+
+
+
+ {{ attribute.name }}
+
+
+
+
+
+
+
+ 未选属性
+
+
+
+
+
+
+
+
+
+
+ 查询
+
+
+
+
+
+ {{ attribute.name }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/CheckAttributeGroup/index.vue b/src/components/CheckAttributeGroup/index.vue
new file mode 100644
index 0000000..628d622
--- /dev/null
+++ b/src/components/CheckAttributeGroup/index.vue
@@ -0,0 +1,152 @@
+
+
+
+
+ 选择属性组关联关系
+
+
+
+ 已选择属性组
+
+
+
+
+ {{ attributeGroup.name }}
+
+
+
+
+
+
+
+ 未选属性组
+
+
+
+
+
+
+
+ 查询
+
+
+
+
+
+ {{ attributeGroup.name }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/CheckBrand/index.vue b/src/components/CheckBrand/index.vue
new file mode 100644
index 0000000..3826612
--- /dev/null
+++ b/src/components/CheckBrand/index.vue
@@ -0,0 +1,152 @@
+
+
+
+
+ 选择品牌关联关系
+
+
+
+ 已选择品牌
+
+
+
+
+ {{ brand.nam }}
+
+
+
+
+
+
+
+ 未选品牌
+
+
+
+
+
+
+
+ 查询
+
+
+
+
+
+ {{ brand.nam }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/ImageUpload/index.vue b/src/components/ImageUpload/index.vue
index 3e32010..5198da2 100644
--- a/src/components/ImageUpload/index.vue
+++ b/src/components/ImageUpload/index.vue
@@ -151,6 +151,7 @@ export default {
handleUploadSuccess(res, file) {
if (res.code === 200) {
this.uploadList.push({name: res.data.url, url: res.data.url});
+ console.log(res.data.url)
this.uploadedSuccessfully();
} else {
this.number--;
diff --git a/src/views/product/attribute/index.vue b/src/views/product/attribute/index.vue
index 4c96735..f55d154 100644
--- a/src/views/product/attribute/index.vue
+++ b/src/views/product/attribute/index.vue
@@ -9,14 +9,6 @@
@keyup.enter.native="handleQuery"
/>
-
-
-
搜索
重置
@@ -71,9 +63,8 @@
-
+
-
@@ -94,7 +85,7 @@
-
+
-
+
+
+
+
-
-
-
@@ -131,6 +122,12 @@ export default {
name: "Attribute",
data() {
return {
+ queryParam: {
+ pageNum: 1,
+ pageSize: 10,
+ name: null,
+ states: null
+ },
// 遮罩层
loading: true,
// 选中数组
@@ -153,13 +150,19 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
- name: null,
- gruopId: null,
+ code: null,
+ name: null
},
// 表单参数
form: {},
// 表单校验
rules: {
+ code: [
+ { required: true, message: "属性编码不能为空", trigger: "blur" }
+ ],
+ name: [
+ { required: true, message: "属性名不能为空", trigger: "blur" }
+ ],
}
};
},
@@ -171,8 +174,8 @@ export default {
getList() {
this.loading = true;
listAttribute(this.queryParams).then(response => {
- this.attributeList = response.rows;
- this.total = response.total;
+ this.attributeList = response.data.rows;
+ this.total = response.data.total;
this.loading = false;
});
},
@@ -185,13 +188,11 @@ export default {
reset() {
this.form = {
id: null,
+ code: null,
name: null,
- gruopId: null,
- remark: null,
createBy: null,
createTime: null,
- updateBy: null,
- updateTime: null
+ remark: null
};
this.resetForm("form");
},
diff --git a/src/views/product/attributeGroup/index.vue b/src/views/product/attributeGroup/index.vue
index 048e218..4e5c04c 100644
--- a/src/views/product/attributeGroup/index.vue
+++ b/src/views/product/attributeGroup/index.vue
@@ -9,6 +9,16 @@
@keyup.enter.native="handleQuery"
/>
+
+
+
+
+
搜索
重置
@@ -63,9 +73,19 @@
-
-
+
+
+
+ {{attributeInfo.name}}
+
+
+
+
+
+
+
+
@@ -96,14 +116,97 @@
/>
-
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+ {{dict.label}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 选择属性关联关系
+
+
+
+ 已选择属性
+
+
+
+
+ {{attribute.name}}
+
+
+
+
+
+
+
+ 未选择属性
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+
+
+
+
+
+ {{attribute.name}}
+
+
+
+
+
+
+
+
+
+