Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
saas-manage
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chehuidong
saas-manage
Commits
91661084
Commit
91661084
authored
Aug 22, 2025
by
qinjianhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 关键字查询amazon属性
parent
dc8f0564
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
111 additions
and
51 deletions
+111
-51
src/views/operation/amazon/amazonAttributeGrouping.vue
+111
-51
No files found.
src/views/operation/amazon/amazonAttributeGrouping.vue
View file @
91661084
...
...
@@ -89,7 +89,9 @@
style=
"width: 100%"
filterable
clearable
popper-class=
"custom-popper-select"
v-model=
"productType"
@
change=
"productTypeChange"
placeholder=
"请选择分类"
>
<el-option
v-for=
"item in productTypeList"
...
...
@@ -434,12 +436,12 @@ export default {
lock
:
true
})
try
{
const
find
=
this
.
shopList
.
find
(
(
item
)
=>
item
.
marketplaceId
===
this
.
shopId
)
//
const find = this.shopList.find(
//
(item) => item.marketplaceId === this.shopId
//
)
const
res
=
await
get
(
'amazon/category/getChildListByKeywords'
,
{
keywords
:
this
.
keyWord
,
shopId
:
find
.
i
d
marketplaceId
:
this
.
shopI
d
})
if
(
res
.
code
!==
200
)
return
this
.
productTypeList
=
res
.
data
.
map
((
item
)
=>
{
...
...
@@ -452,6 +454,26 @@ export default {
loading
.
close
()
}
},
productTypeChange
(
val
)
{
if
(
!
val
)
return
const
item
=
this
.
productTypeList
.
find
(
(
item
)
=>
item
.
browseNodeId
===
val
)
if
(
!
item
)
return
const
categoryPath
=
item
.
browsePathById
?.
split
(
','
)
?.
slice
(
1
)
?.
map
((
e
)
=>
Number
(
e
))
this
.
initCate
(
categoryPath
||
[],
()
=>
{
if
(
item
.
productType
&&
categoryPath
)
{
this
.
aliCatePathIds
=
categoryPath
this
.
categoryTypeChange
(
item
.
productType
,
true
)
}
else
{
this
.
jsonSchema
=
{}
this
.
groupList
=
[]
}
})
},
getCateAttrs
(
id
,
categoryFullPath
,
callback
)
{
if
(
!
id
||
id
.
length
===
0
)
return
if
(
Array
.
isArray
(
id
))
id
=
id
[
id
.
length
-
1
]
...
...
@@ -490,68 +512,100 @@ export default {
})
},
categoryTypeChange
(
val
)
{
const
nodes
=
this
.
$refs
.
amCateCascadersRef
.
getCheckedNodes
()
let
targetNode
if
(
this
.
aliCatePathIds
)
{
targetNode
=
nodes
[
nodes
.
length
-
1
]
}
this
.
dataGroupForm
=
{}
if
(
targetNode
)
{
const
{
data
}
=
targetNode
this
.
getCateAttrs
(
data
.
productTypeDefinitions
,
data
.
browsePathByName
,
({
list
,
groupProps
})
=>
{
this
.
$nextTick
(()
=>
{
const
nodes
=
this
.
$refs
.
amCateCascadersRef
.
getCheckedNodes
()
let
targetNode
if
(
this
.
aliCatePathIds
)
{
targetNode
=
nodes
[
nodes
.
length
-
1
]
}
this
.
dataGroupForm
=
{}
if
(
targetNode
)
{
const
{
data
}
=
targetNode
this
.
getCateAttrs
(
data
.
productTypeDefinitions
,
data
.
browsePathByName
,
({
list
,
groupProps
})
=>
{
if
(
list
)
{
this
.
jsonSchema
=
list
groupProps
.
forEach
((
item
)
=>
{
item
.
propertyList
.
forEach
((
e
)
=>
{
this
.
$set
(
this
.
dataGroupForm
,
e
.
propertyNameEn
,
item
.
id
)
})
})
this
.
cloneDataGroupForm
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
dataGroupForm
)
)
}
else
{
this
.
jsonSchema
=
{}
this
.
dataGroupForm
=
{}
}
}
)
}
else
if
(
val
)
{
this
.
getCateAttrs
(
val
,
''
,
({
list
,
groupProps
})
=>
{
if
(
list
)
{
this
.
jsonSchema
=
list
groupProps
.
forEach
((
item
)
=>
{
item
.
propertyList
.
forEach
((
e
)
=>
{
this
.
$set
(
this
.
dataGroupForm
,
e
.
propertyNameEn
,
item
.
i
d
)
this
.
$set
(
this
.
dataGroupForm
,
e
.
propertyNameEn
,
item
.
groupI
d
)
})
})
this
.
cloneDataGroupForm
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
dataGroupForm
)
)
}
else
{
this
.
jsonSchema
=
{}
this
.
dataGroupForm
=
{}
}
}
)
}
else
if
(
val
)
{
this
.
getCateAttrs
(
val
,
''
,
({
list
,
groupProps
})
=>
{
if
(
list
)
{
this
.
jsonSchema
=
list
groupProps
.
forEach
((
item
)
=>
{
item
.
propertyList
.
forEach
((
e
)
=>
{
this
.
$set
(
this
.
dataGroupForm
,
e
.
propertyNameEn
,
item
.
groupId
)
})
})
}
else
{
this
.
jsonSchema
=
{}
this
.
dataGroupForm
=
{}
}
})
}
else
{
this
.
jsonSchema
=
{}
this
.
dataGroupForm
=
{}
}
})
}
else
{
this
.
jsonSchema
=
{}
this
.
dataGroupForm
=
{}
}
})
},
async
initCate
(
marketplaceId
)
{
async
initCate
(
ids
,
callback
)
{
const
loading
=
this
.
$loading
({
lock
:
true
})
try
{
const
res
=
await
get
(
'amazon/category/getChildListByBrowseNodeId'
,
{
marketplaceId
const
arr
=
[
get
(
'amazon/category/getChildListByBrowseNodeId'
,
{
marketplaceId
:
this
.
shopId
})
if
(
res
.
code
!==
200
)
return
this
.
amCateCascaders
=
res
.
data
}
catch
(
e
)
{
console
.
error
(
e
)
}
finally
{
loading
.
close
()
]
for
(
let
i
=
0
;
i
<
ids
.
length
-
1
;
i
++
)
{
arr
.
push
(
get
(
'amazon/category/getChildListByBrowseNodeId'
,
{
browseNodeId
:
ids
[
i
],
marketplaceId
:
this
.
shopId
})
)
}
Promise
.
all
(
arr
)
.
then
((
res
)
=>
{
const
catearr
=
res
[
0
].
data
.
map
((
e
)
=>
{
return
{
...
e
,
leaf
:
!
e
.
childId
}
})
let
arr1
=
catearr
for
(
let
i
=
0
;
i
<
ids
.
length
-
1
;
i
++
)
{
for
(
const
iterator
of
arr1
)
{
if
(
iterator
.
browseNodeId
===
ids
[
i
])
{
iterator
.
children
=
res
[
i
+
1
].
data
.
map
((
e
)
=>
{
return
{
...
e
,
leaf
:
!
e
.
childId
}
})
arr1
=
iterator
.
children
}
}
}
this
.
amCateCascaders
=
catearr
callback
&&
callback
(
catearr
)
})
.
finally
(()
=>
{
loading
.
close
()
})
},
lazyLoad
(
node
,
resolve
)
{
if
(
node
.
level
===
0
)
return
...
...
@@ -590,7 +644,7 @@ export default {
},
shopChange
(
val
)
{
if
(
!
val
)
return
this
.
initCate
(
val
)
this
.
initCate
(
[]
)
},
async
saveGrouping
()
{
const
nodes
=
this
.
$refs
.
amCateCascadersRef
.
getCheckedNodes
()
...
...
@@ -824,4 +878,10 @@ export default {
font-weight
:
500
;
}
}
.custom-popper-select
{
.el-select-dropdown__item
{
border-bottom
:
1px
solid
#ddd
;
height
:
unset
;
}
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment