Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 30a937e3
authored
Jan 11, 2023
by
liimin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
解决商户名称过长,tip显示风格与系统整体风格不一致的问题
1 parent
9d75daa4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
5 deletions
src/layout/components/NavMenu.vue
src/plugins/element.js
src/layout/components/NavMenu.vue
View file @
30a937e
...
...
@@ -37,7 +37,11 @@
<i
class=
"i i-avatar"
/>
</div>
<template
v-if=
"auth.session"
>
<span
class=
"nav-text nav-text-avatar"
:title=
"showName"
>
{{
showName
}}
</span>
<el-tooltip
class=
"item"
effect=
"dark"
popper-class=
"base-merchant-name-tooltip"
:placement=
"tip.placement"
v-if=
"tip.isShow"
>
<div
slot=
"content"
v-html=
"tip.content"
></div>
<span
class=
"nav-text nav-text-avatar"
>
{{
tip
.
value
}}
</span>
</el-tooltip>
<span
class=
"nav-text nav-text-avatar"
v-else
>
{{
tip
.
value
}}
</span>
<el-dropdown
@
command=
"handleCommand"
trigger=
"click"
:hide-on-click=
"false"
@
visible-change=
"dropdownVisibleChange"
>
<span
class=
"el-dropdown-link"
>
<i
class=
"i i-arrow-down"
:class=
"
{ drOpen }">
</i>
...
...
@@ -97,9 +101,12 @@ export default {
},
computed
:
{
...
mapGetters
([
'auth'
]),
showName
()
{
tip
()
{
const
{
userType
,
userName
,
merchantName
}
=
this
.
auth
?.
session
return
{
userName
,
merchantName
}[{
1
:
'merchantName'
,
2
:
'userName'
}[
userType
]]
||
''
const
value
=
[
undefined
,
merchantName
,
userName
][
userType
]
||
merchantName
const
content
=
value
.
slice
(
0
,
25
)
+
'</br>'
+
value
.
slice
(
25
)
const
isShow
=
value
.
length
>
11
return
{
value
,
content
,
isShow
,
placement
:
'bottom-end'
}
}
},
beforeDestroy
()
{
...
...
@@ -207,6 +214,20 @@ export default {
}
}
</
script
>
<
style
lang=
"scss"
>
$
tip-color
:
#666
!
important
;
.base-merchant-name-tooltip
{
background-color
:
$
tip-color
;
/* 修改箭头位置和背景色 */
&.el-tooltip__popper.is-dark
.popper__arrow
{
left
:
unset
!important
;
right
:
1em
!important
;
&:after
{
border-bottom-color
:
$
tip-color
;
}
}
}
</
style
>
<
style
lang=
"scss"
scoped
>
@import
'~@/assets/style/mixins.scss'
;
@mixin
icon
(
$
color
:
rgb
(
153
,
153
,
153
),
$
font-size
:
20px
)
{
...
...
@@ -231,7 +252,7 @@ export default {
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
max-width
:
1
6
em
;
max-width
:
1
1
em
;
}
}
.nav-left
{
...
...
src/plugins/element.js
View file @
30a937e
import
Vue
from
'vue'
import
{
Message
,
Button
,
ButtonGroup
,
Container
,
Aside
,
Menu
,
MenuItem
,
Submenu
,
MenuItemGroup
,
Header
,
Main
,
Footer
,
Avatar
,
Badge
,
Dropdown
,
DropdownMenu
,
DropdownItem
,
Scrollbar
,
Carousel
,
CarouselItem
,
Form
,
FormItem
,
Input
,
Image
,
Tabs
,
TabPane
,
Loading
,
Dialog
,
Alert
,
Popover
}
from
'element-ui'
import
{
Message
,
Button
,
ButtonGroup
,
Container
,
Aside
,
Menu
,
MenuItem
,
Submenu
,
MenuItemGroup
,
Header
,
Main
,
Footer
,
Avatar
,
Badge
,
Dropdown
,
DropdownMenu
,
DropdownItem
,
Scrollbar
,
Carousel
,
CarouselItem
,
Form
,
FormItem
,
Input
,
Image
,
Tabs
,
TabPane
,
Loading
,
Dialog
,
Alert
,
Popover
,
Tooltip
}
from
'element-ui'
Vue
.
use
(
Button
)
Vue
.
use
(
ButtonGroup
)
Vue
.
use
(
Container
)
...
...
@@ -29,4 +29,5 @@ Vue.use(Loading)
Vue
.
use
(
Dialog
)
Vue
.
use
(
Alert
)
Vue
.
use
(
Popover
)
Vue
.
use
(
Tooltip
)
export
{
Message
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment