Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_admin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_admin
Commits
50fe79b2
Commit
50fe79b2
authored
Jul 25, 2023
by
xiaoman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix: 类目展示错误的问题
parent
d75ccac1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
10 deletions
+32
-10
src/views/mall/category.vue
src/views/mall/category.vue
+32
-10
No files found.
src/views/mall/category.vue
View file @
50fe79b2
...
...
@@ -149,6 +149,7 @@ export default {
components
:
{
TreeTable
},
data
()
{
return
{
ids
:
[
0
],
uploadPath
,
props
:
{
stripe
:
false
,
...
...
@@ -235,7 +236,7 @@ export default {
}
},
created
()
{
this
.
getAllCategories
(
0
)
this
.
getAllCategories
()
},
methods
:
{
// 成交记录
...
...
@@ -245,26 +246,43 @@ export default {
onBack
()
{
this
.
activeLevel
--
this
.
categoryList
.
length
=
this
.
categoryList
.
length
-
1
if
(
this
.
activeLevel
===
0
)
{
this
.
ids
=
[
0
]
}
else
{
this
.
ids
.
pop
()
}
},
handleRadioClick
(
option
)
{
// console.log(option); // eslint-disable-line
},
handleChild
(
val
)
{
this
.
activeLevel
=
val
.
level
this
.
getAllCategories
(
val
.
id
)
this
.
ids
.
push
(
val
.
id
)
this
.
getAllCategories
()
},
getAllCategories
(
id
=
0
)
{
getAllCategories
()
{
const
id
=
this
.
ids
[
this
.
ids
.
length
-
1
]
this
.
listLoading
=
true
const
data
=
{
id
:
id
||
0
}
getCategory
(
data
).
then
(
res
=>
{
if
(
res
&&
res
.
data
&&
res
.
data
.
data
&&
res
.
data
.
data
.
categoryList
)
{
if
([
'
create
'
,
'
update
'
,
'
delete
'
].
includes
(
this
.
dialogStatus
))
{
this
.
categoryList
.
splice
(
this
.
activeLevel
,
1
,
{
list
:
res
.
data
.
data
.
categoryList
,
path
:
res
.
data
.
data
.
categoryPath
})
this
.
$forceUpdate
()
}
else
{
this
.
categoryList
.
push
({
list
:
res
.
data
.
data
.
categoryList
,
path
:
res
.
data
.
data
.
categoryPath
})
}
}
this
.
listLoading
=
false
}).
catch
(()
=>
{
this
.
categories
=
[]
...
...
@@ -307,7 +325,8 @@ export default {
title
:
'
成功
'
,
message
:
'
创建成功
'
})
location
.
reload
()
// location.reload()
this
.
getAllCategories
()
})
.
catch
(
response
=>
{
this
.
$notify
.
error
({
...
...
@@ -342,7 +361,8 @@ export default {
title
:
'
成功
'
,
message
:
'
更新成功
'
})
location
.
reload
()
// location.reload()
this
.
getAllCategories
()
})
.
catch
(
response
=>
{
this
.
$notify
.
error
({
...
...
@@ -354,13 +374,15 @@ export default {
})
},
handleDelete
(
row
)
{
this
.
dialogStatus
=
'
delete
'
deleteCategory
(
row
)
.
then
(()
=>
{
this
.
$notify
.
success
({
title
:
'
成功
'
,
message
:
'
删除成功
'
})
location
.
reload
()
// location.reload()
this
.
getAllCategories
()
})
.
catch
(
response
=>
{
this
.
$notify
.
error
({
...
...
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