Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-skynet-admin
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
najiu-frontend
najiu-skynet-admin
Commits
bafd1f2c
Commit
bafd1f2c
authored
Sep 28, 2021
by
朱松文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tooltip
parent
b662a00d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
16 deletions
+41
-16
index.vue
src/components/Camera/index.vue
+39
-14
main.ts
src/main.ts
+2
-2
No files found.
src/components/Camera/index.vue
View file @
bafd1f2c
...
@@ -14,17 +14,23 @@
...
@@ -14,17 +14,23 @@
>
>
<div
:class=
"
{item:true,active:currentCameraId === item.cameraId}">
<div
:class=
"
{item:true,active:currentCameraId === item.cameraId}">
<div
class=
"item-name"
>
<div
class=
"item-name"
>
<Icon
name=
"camera"
iconClass=
"icon-camera"
/>
<div
class=
"item-name-icon"
>
<!--
<el-popover
<Icon
name=
"camera"
iconClass=
"icon-camera"
/>
placement=
"top-start"
</div>
title=
"标题"
<div
class=
"item-name-title"
>
width=
"200"
<span
v-if=
"!item.cameraName || item.cameraName.length
<
=
14
"
>
{{
item
.
cameraName
}}
</span>
trigger=
"hover"
<span>
content=
"这是一段内容,这是一段内容,这是一段内容,这是一段内容。"
{{
handleCameraName
(
item
.
cameraName
)
}}
>
<el-tooltip
<el-button
slot=
"reference"
>
hover 激活
</el-button>
v-if=
"item.cameraName && item.cameraName.length>14"
</el-popover>
-->
effect=
"dark"
<span>
{{
handleCameraName
(
item
.
cameraName
)
}}
</span>
:content=
"item.cameraName"
placement=
"top-start"
>
<el-button>
...
</el-button>
</el-tooltip>
</span>
</div>
</div>
</div>
<div
class=
"item-total"
>
<div
class=
"item-total"
>
<span>
{{
item
.
number
}}
</span>
<span>
{{
item
.
number
}}
</span>
...
@@ -57,15 +63,15 @@ export default class Camera extends BaseVue {
...
@@ -57,15 +63,15 @@ export default class Camera extends BaseVue {
}
}
handleCameraName
(
name
:
string
)
{
handleCameraName
(
name
:
string
)
{
if
(
name
&&
name
.
length
>
1
4
)
{
if
(
name
&&
name
.
length
>
1
2
)
{
return
name
.
substr
(
0
,
1
4
)
+
"
...
"
;
return
name
.
substr
(
0
,
1
2
)
;
}
}
return
name
;
return
name
;
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
scoped
>
.area-camera
{
.area-camera
{
margin-top
:
15px
;
margin-top
:
15px
;
// border: 1px solid red;
// border: 1px solid red;
...
@@ -100,8 +106,15 @@ export default class Camera extends BaseVue {
...
@@ -100,8 +106,15 @@ export default class Camera extends BaseVue {
padding-left
:
40px
;
padding-left
:
40px
;
padding-right
:
10px
;
padding-right
:
10px
;
.item-name
{
.item-name
{
display
:
flex
;
height
:
35px
;
height
:
35px
;
line-height
:
35px
;
line-height
:
35px
;
.item-name-icon
{
width
:
24px
;
}
.item-name-title
{
flex
:
1
;
}
}
}
.item-total
{
.item-total
{
display
:
flex
;
display
:
flex
;
...
@@ -124,5 +137,17 @@ export default class Camera extends BaseVue {
...
@@ -124,5 +137,17 @@ export default class Camera extends BaseVue {
padding-right
:
10px
;
padding-right
:
10px
;
}
}
}
}
::v-deep
{
.el-button
{
padding
:
0
;
height
:
35px
;
line-height
:
35px
;
font-size
:
14px
;
color
:
#d7d7d7
;
background
:
transparent
;
border
:
0
;
margin
:
0
;
}
}
}
}
</
style
>
</
style
>
src/main.ts
View file @
bafd1f2c
...
@@ -3,7 +3,7 @@ import App from "./App.vue";
...
@@ -3,7 +3,7 @@ import App from "./App.vue";
import
router
from
"
./router
"
;
import
router
from
"
./router
"
;
import
store
from
"
./store
"
;
import
store
from
"
./store
"
;
import
"
@/utils/rem
"
;
import
"
@/utils/rem
"
;
import
{
Message
,
Table
,
TableColumn
,
Button
,
Dialog
,
Form
,
FormItem
,
Input
,
InputNumber
,
Pagination
,
Loading
,
DatePicker
,
Empty
,
Popover
}
from
'
element-ui
'
;
import
{
Message
,
Table
,
TableColumn
,
Button
,
Dialog
,
Form
,
FormItem
,
Input
,
InputNumber
,
Pagination
,
Loading
,
DatePicker
,
Empty
,
Tooltip
}
from
'
element-ui
'
;
Vue
.
config
.
productionTip
=
false
;
Vue
.
config
.
productionTip
=
false
;
...
@@ -19,7 +19,7 @@ Vue.use(Pagination);
...
@@ -19,7 +19,7 @@ Vue.use(Pagination);
Vue
.
use
(
DatePicker
)
Vue
.
use
(
DatePicker
)
Vue
.
use
(
Loading
);
Vue
.
use
(
Loading
);
Vue
.
use
(
Empty
)
Vue
.
use
(
Empty
)
Vue
.
use
(
Popover
)
Vue
.
use
(
Tooltip
)
Vue
.
prototype
.
$loading
=
Loading
.
service
;
Vue
.
prototype
.
$loading
=
Loading
.
service
;
Vue
.
prototype
.
$message
=
Message
;
Vue
.
prototype
.
$message
=
Message
;
...
...
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