Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-app-operator-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanbaoming
jiedao-app-operator-master
Commits
5402f91a
Commit
5402f91a
authored
Dec 12, 2024
by
zs嵩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
6
parent
0eeea998
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
25 deletions
+21
-25
SidebarItem.vue
src/layout/components/Sidebar/SidebarItem.vue
+16
-23
edit.vue
src/views/ecw/customer/edit.vue
+5
-2
No files found.
src/layout/components/Sidebar/SidebarItem.vue
View file @
5402f91a
<
template
>
<div
v-if=
"!item.hidden"
>
<template
v-if=
"hasOneShowingChild(item.children,
item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&
!item.alwaysShow"
>
<template
v-if=
"hasOneShowingChild(item.children,
item) && (!onlyOneChild.children || onlyOneChild.noShowingChildren) &&
!item.alwaysShow"
>
<app-link
v-if=
"onlyOneChild.meta"
:to=
"resolvePath(onlyOneChild.path)"
>
<el-menu-item
:index=
"resolvePath(onlyOneChild.path)"
:class=
"
{
'submenu-title-noDropdown':!isNest
}">
<item
:icon=
"onlyOneChild.meta.icon
||(item.meta&&
item.meta.icon)"
:title=
"$l(onlyOneChild.meta, 'title')"
:badge=
"badge"
/>
<el-menu-item
:index=
"resolvePath(onlyOneChild.path)"
:class=
"
{
'submenu-title-noDropdown': !isNest
}">
<item
:icon=
"onlyOneChild.meta.icon
|| (item.meta &&
item.meta.icon)"
:title=
"$l(onlyOneChild.meta, 'title')"
:badge=
"badge"
/>
</el-menu-item>
</app-link>
</
template
>
...
...
@@ -12,27 +12,20 @@
<
template
slot=
"title"
>
<item
v-if=
"item.meta"
:icon=
"item.meta && item.meta.icon"
:title=
"$l(item.meta, 'title')"
:badge=
"badge"
/>
</
template
>
<sidebar-item
v-for=
"child in item.children"
:key=
"child.path"
:is-nest=
"true"
:item=
"child"
:base-path=
"resolvePath(child.path)"
class=
"nest-menu"
/>
<sidebar-item
v-for=
"(child, index) in item.children"
:key=
"index"
:is-nest=
"true"
:item=
"child"
:base-path=
"resolvePath(child.path)"
class=
"nest-menu"
/>
</el-submenu>
</div>
</template>
<
script
>
import
path
from
'
path
'
import
{
isExternal
}
from
'
@/utils/validate
'
import
Item
from
'
./Item
'
import
AppLink
from
'
./Link
'
import
FixiOSBug
from
'
./FixiOSBug
'
import
path
from
"
path
"
import
{
isExternal
}
from
"
@/utils/validate
"
import
Item
from
"
./Item
"
import
AppLink
from
"
./Link
"
import
FixiOSBug
from
"
./FixiOSBug
"
export
default
{
name
:
'
SidebarItem
'
,
name
:
"
SidebarItem
"
,
components
:
{
Item
,
AppLink
},
mixins
:
[
FixiOSBug
],
props
:
{
...
...
@@ -47,24 +40,24 @@ export default {
},
basePath
:
{
type
:
String
,
default
:
''
default
:
""
}
},
data
()
{
this
.
onlyOneChild
=
null
return
{}
},
computed
:{
badge
(){
computed
:
{
badge
()
{
return
this
.
$store
.
getters
.
badgeData
[
this
.
item
.
meta
?.
badgeField
]
}
},
methods
:
{
hasOneShowingChild
(
children
=
[],
parent
)
{
if
(
!
children
)
{
children
=
[]
;
children
=
[]
}
const
showingChildren
=
children
.
filter
(
item
=>
{
const
showingChildren
=
children
.
filter
(
(
item
)
=>
{
if
(
item
.
hidden
)
{
return
false
}
else
{
...
...
@@ -81,7 +74,7 @@ export default {
// Show parent if there are no child router to display
if
(
showingChildren
.
length
===
0
)
{
this
.
onlyOneChild
=
{
...
parent
,
path
:
''
,
noShowingChildren
:
true
}
this
.
onlyOneChild
=
{
...
parent
,
path
:
""
,
noShowingChildren
:
true
}
return
true
}
...
...
src/views/ecw/customer/edit.vue
View file @
5402f91a
...
...
@@ -1021,8 +1021,8 @@ export default {
return
true
}
})
let
typeIds
=
this
.
form
.
products
.
map
(
item
=>
item
.
typeId
)
if
(
new
Set
(
typeIds
).
size
!==
typeIds
.
length
)
{
let
typeIds
=
this
.
form
.
products
.
map
(
(
item
)
=>
item
.
typeId
)
if
(
new
Set
(
typeIds
).
size
!==
typeIds
.
length
)
{
callback
(
new
Error
(
this
.
$t
(
"
主营类别不能重复
"
)))
return
}
...
...
@@ -1321,6 +1321,9 @@ export default {
competitorIds
:
Number
(
response
.
data
.
competitorIds
),
productTypes
:
this
.
stringArrToNumberArr
(
response
.
data
.
productTypes
)
}
if
(
!
this
.
form
.
products
)
{
this
.
form
.
products
=
[]
}
if
(
!
this
.
form
.
products
.
length
)
{
this
.
form
.
products
.
push
({
typeId
:
undefined
,
productIds
:
[],
productList
:
[]
})
}
...
...
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