From dca6e7f79862121180ece90e7ba699216242f3b9 Mon Sep 17 00:00:00 2001 From: szdot Date: Sun, 5 Nov 2023 06:54:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E7=B1=BB=E5=88=A0=E9=99=A4=20;=20=20s?= =?UTF-8?q?pu=E6=B7=BB=E5=8A=A0=E9=A1=B5=20sku=E7=BB=84=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=8F=8A=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SelectionPath.vue | 18 ++++++-- src/components/skuTransfer.vue | 4 +- src/store/index.js | 26 +++++++++-- .../layout/components/main/category/index.vue | 39 +++++++++++++++- .../components/main/product/spu/add.vue | 44 +++++++++++++------ 5 files changed, 107 insertions(+), 24 deletions(-) diff --git a/src/components/SelectionPath.vue b/src/components/SelectionPath.vue index 05ae588..7d3f43a 100644 --- a/src/components/SelectionPath.vue +++ b/src/components/SelectionPath.vue @@ -73,9 +73,14 @@ export default { }, watch: { categoryList (val) { - if (this.defaultPath !== '') { - this.form.path = this.defaultPath + if (this.defaultPath !== '') { // 首先 默认不是所有分类 先归为未分类 + this.form.path = 'none' } + val.forEach(element => { // 再遍历对比 所有分类 看默认分类是否存在 存在则改成对应分类 + if (element.path === this.defaultPath) { + this.form.path = this.defaultPath + } + }) this.updatePath() }, shop_id () { // 商铺selection改变时 分类selection如果不是"全部分类" 则改成"未分类" @@ -91,9 +96,14 @@ export default { }, created () { if (this.categoryList.length > 0) { - if (this.defaultPath !== '') { - this.form.path = this.defaultPath + if (this.defaultPath !== '') { // 首先 默认不是所有分类 先归为未分类 + this.form.path = 'none' } + this.categoryList.forEach(element => { // 再遍历对比 所有分类 看默认分类是否存在 存在则改成对应分类 + if (element.path === this.defaultPath) { + this.form.path = this.defaultPath + } + }) this.updatePath() } }, diff --git a/src/components/skuTransfer.vue b/src/components/skuTransfer.vue index 5d24713..4a9bf3c 100644 --- a/src/components/skuTransfer.vue +++ b/src/components/skuTransfer.vue @@ -1,6 +1,6 @@