From 83d49489218845b986f23d40d1bd4724e8e6dbe9 Mon Sep 17 00:00:00 2001 From: DongZeLiang <2746733890@qq.com> Date: Fri, 1 Mar 2024 15:27:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E5=93=81=E7=B1=BB=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=85=AC=E5=85=B1=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/product/category.js | 8 +++++ src/components/CheckAttribute/index.vue | 13 ++++++++ src/components/CheckAttributeGroup/index.vue | 13 ++++++++ src/components/CheckBrand/index.vue | 13 ++++++++ src/views/product/category/index.vue | 34 +++++++++++++++++--- 5 files changed, 76 insertions(+), 5 deletions(-) diff --git a/src/api/product/category.js b/src/api/product/category.js index a8ab19f..889eebe 100644 --- a/src/api/product/category.js +++ b/src/api/product/category.js @@ -17,6 +17,14 @@ export function getCategory(id) { }) } +// 查询品类信息详细 +export function parentCommonElement(id) { + return request({ + url: '/product/category/parentCommonElement/' + id, + method: 'get' + }) +} + // 新增品类信息 export function addCategory(data) { return request({ diff --git a/src/components/CheckAttribute/index.vue b/src/components/CheckAttribute/index.vue index 45d1076..5b20ab3 100644 --- a/src/components/CheckAttribute/index.vue +++ b/src/components/CheckAttribute/index.vue @@ -70,6 +70,10 @@ export default { value: { type: Array, default: [] + }, + checkedList: { + type: Array, + default: null } }, watch: { @@ -82,6 +86,15 @@ export default { }, immediate: true, }, + checkedList: { + handler(val){ + if (val !== undefined && val.length > 0){ + this.checkedAttributeList = val; + this.attributeIdList = this.checkedAttributeList.map(checked => checked.id); + } + }, + immediate: true + } }, data() { return { diff --git a/src/components/CheckAttributeGroup/index.vue b/src/components/CheckAttributeGroup/index.vue index 948298f..d857d81 100644 --- a/src/components/CheckAttributeGroup/index.vue +++ b/src/components/CheckAttributeGroup/index.vue @@ -67,6 +67,10 @@ export default { value: { type: Array, default: [] + }, + checkedList: { + type: Array, + default: null } }, data() { @@ -92,6 +96,15 @@ export default { }, immediate: true, }, + checkedList: { + handler(val){ + if (val !== undefined && val.length > 0){ + this.checkedAttributeGroupList = val; + this.attributeGroupIdList = this.checkedAttributeGroupList.map(checked => checked.id); + } + }, + immediate: true + } }, created() { this.queryAttributeGroup(); diff --git a/src/components/CheckBrand/index.vue b/src/components/CheckBrand/index.vue index f229487..f0bfaa2 100644 --- a/src/components/CheckBrand/index.vue +++ b/src/components/CheckBrand/index.vue @@ -67,6 +67,10 @@ export default { value: { type: Array, default: [] + }, + checkedList: { + type: Array, + default: null } }, data() { @@ -92,6 +96,15 @@ export default { }, immediate: true, }, + checkedList: { + handler(val){ + if (val !== undefined && val.length > 0){ + this.checkedBrandList = val; + this.brandIdList = this.checkedBrandList.map(checked => checked.id); + } + }, + immediate: true + } }, created() { this.queryBrand(); diff --git a/src/views/product/category/index.vue b/src/views/product/category/index.vue index 5adf2d6..977dd35 100644 --- a/src/views/product/category/index.vue +++ b/src/views/product/category/index.vue @@ -150,13 +150,13 @@ - + - + - + @@ -170,7 +170,14 @@