Commit 19fd264f by qinjianhui

fix: 问题修改

parent 91661084
...@@ -301,6 +301,14 @@ export default { ...@@ -301,6 +301,14 @@ export default {
icon: 'el-icon-box', icon: 'el-icon-box',
index: '/saas/import-template', index: '/saas/import-template',
children: [] children: []
},
{
id: 12,
path: '',
label: '亚马逊属性分类',
icon: 'el-icon-s-check',
index: '/operation/amazonAttributeGrouping',
children: []
} }
// { // {
// id: 11, // id: 11,
...@@ -344,14 +352,6 @@ export default { ...@@ -344,14 +352,6 @@ export default {
children: [] children: []
}, },
{ {
id: 6_3,
path: '',
label: 'Amazon attribute grouping',
icon: 'el-icon-s-check',
index: '/operation/amazonAttributeGrouping',
children: []
},
{
id: 9, id: 9,
path: '', path: '',
label: 'sql执行工具', label: 'sql执行工具',
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
v-for="item in shopList" v-for="item in shopList"
:key="item.id" :key="item.id"
:label="item.shopName" :label="item.shopName"
:value="item.marketplaceId"></el-option> :value="item.id"></el-option>
</el-select> </el-select>
</div> </div>
<div class="category-title"> <div class="category-title">
...@@ -315,13 +315,14 @@ export default { ...@@ -315,13 +315,14 @@ export default {
currentGroupPropertiesMap() { currentGroupPropertiesMap() {
const groupedProperties = {} const groupedProperties = {}
const result = {} const result = {}
Object.keys(this.dataGroupForm).forEach((key) => { for (const key of Object.keys(this.dataGroupForm)) {
if (!this.dataGroupForm[key]) continue
result[this.dataGroupForm[key]] = { result[this.dataGroupForm[key]] = {
...result[this.dataGroupForm[key]], ...result[this.dataGroupForm[key]],
[key]: true [key]: true
} }
groupedProperties[key] = true groupedProperties[key] = true
}) }
if (this.jsonSchema?.properties) { if (this.jsonSchema?.properties) {
const notGroupedProperties = Object.keys(this.jsonSchema.properties) const notGroupedProperties = Object.keys(this.jsonSchema.properties)
.filter((key) => !groupedProperties[key]) .filter((key) => !groupedProperties[key])
...@@ -436,12 +437,12 @@ export default { ...@@ -436,12 +437,12 @@ export default {
lock: true lock: true
}) })
try { try {
// const find = this.shopList.find( const find = this.shopList.find(
// (item) => item.marketplaceId === this.shopId (item) => item.id === this.shopId
// ) )
const res = await get('amazon/category/getChildListByKeywords', { const res = await get('amazon/category/getChildListByKeywords', {
keywords: this.keyWord, keywords: this.keyWord,
marketplaceId: this.shopId marketplaceId: find.marketplaceId
}) })
if (res.code !== 200) return if (res.code !== 200) return
this.productTypeList = res.data.map((item) => { this.productTypeList = res.data.map((item) => {
...@@ -477,15 +478,12 @@ export default { ...@@ -477,15 +478,12 @@ export default {
getCateAttrs(id, categoryFullPath, callback) { getCateAttrs(id, categoryFullPath, callback) {
if (!id || id.length === 0) return if (!id || id.length === 0) return
if (Array.isArray(id)) id = id[id.length - 1] if (Array.isArray(id)) id = id[id.length - 1]
const find = this.shopList.find(
(item) => item.marketplaceId === this.shopId
)
const loading = this.$loading({ const loading = this.$loading({
lock: true lock: true
}) })
get('amazon/category/getAttributeByProductType', { get('amazon/category/getAttributeByProductType', {
productType: id, productType: id,
shopId: find.id shopId: this.shopId
}) })
.then(async (res) => { .then(async (res) => {
if (res.code !== 200) return if (res.code !== 200) return
...@@ -562,19 +560,22 @@ export default { ...@@ -562,19 +560,22 @@ export default {
}) })
}, },
async initCate(ids, callback) { async initCate(ids, callback) {
const shopId = this.shopList.find(
(item) => item.id === this.shopId
)?.marketplaceId
const loading = this.$loading({ const loading = this.$loading({
lock: true lock: true
}) })
const arr = [ const arr = [
get('amazon/category/getChildListByBrowseNodeId', { get('amazon/category/getChildListByBrowseNodeId', {
marketplaceId: this.shopId marketplaceId: shopId
}) })
] ]
for (let i = 0; i < ids.length - 1; i++) { for (let i = 0; i < ids.length - 1; i++) {
arr.push( arr.push(
get('amazon/category/getChildListByBrowseNodeId', { get('amazon/category/getChildListByBrowseNodeId', {
browseNodeId: ids[i], browseNodeId: ids[i],
marketplaceId: this.shopId marketplaceId: shopId
}) })
) )
} }
...@@ -609,12 +610,15 @@ export default { ...@@ -609,12 +610,15 @@ export default {
}, },
lazyLoad(node, resolve) { lazyLoad(node, resolve) {
if (node.level === 0) return if (node.level === 0) return
const shopId = this.shopList.find(
(item) => item.id === this.shopId
)?.marketplaceId
if (node.children && node.children.length > 0) { if (node.children && node.children.length > 0) {
resolve([]) resolve([])
} else { } else {
get('amazon/category/getChildListByBrowseNodeId', { get('amazon/category/getChildListByBrowseNodeId', {
browseNodeId: node.value, browseNodeId: node.value,
marketplaceId: this.shopId marketplaceId: shopId
}) })
.then((res) => { .then((res) => {
res.data.forEach((e) => { res.data.forEach((e) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment