Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
glsk-data-view-pd
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 a531739b
authored
Jul 10, 2023
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'v1.0.0' of
http://192.168.3.233:8090/h5/glsk-data-view-pd
into v1.0.0
2 parents
9eb44eaa
191ba880
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
104 additions
and
8 deletions
src/components/BarLineOptions.js
src/components/BarOptions.js
src/components/Marquee.vue
src/utils/data.js
src/components/BarLineOptions.js
View file @
a531739
...
...
@@ -67,7 +67,7 @@ function getBarLineOptions(obj) {
data
:
[],
label
:
{
show
:
true
,
position
:
'
insideT
op'
,
position
:
'
t
op'
,
color
:
'#fff'
},
itemStyle
:
{
...
...
@@ -107,7 +107,7 @@ function getBarLineOptions(obj) {
stack
:
'one'
,
label
:
{
show
:
true
,
position
:
'
insideT
op'
,
position
:
'
t
op'
,
color
:
'#fff'
},
data
:
[],
...
...
src/components/BarOptions.js
View file @
a531739
...
...
@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-07 14:04:52
* @LastEditors: huyue
* @LastEditTime: 2023-07-10 1
4:50:24
* @LastEditTime: 2023-07-10 1
5:33:57
*/
import
*
as
echarts
from
'echarts'
function
getBarLineOptions
(
obj
)
{
...
...
@@ -43,7 +43,9 @@ function getBarLineOptions(obj) {
type
:
'bar'
,
data
:
[],
label
:
{
show
:
true
show
:
true
,
position
:
'top'
,
color
:
'#fff'
},
itemStyle
:
{
barBorderRadius
:
[
2
,
2
,
0
,
0
],
// 柱体圆角
...
...
@@ -69,7 +71,9 @@ function getBarLineOptions(obj) {
name
:
'bar2'
,
type
:
'bar'
,
label
:
{
show
:
true
show
:
true
,
position
:
'top'
,
color
:
'#fff'
},
data
:
[],
itemStyle
:
{
...
...
@@ -96,7 +100,9 @@ function getBarLineOptions(obj) {
name
:
'bar3'
,
type
:
'bar'
,
label
:
{
show
:
true
show
:
true
,
position
:
'top'
,
color
:
'#fff'
},
data
:
[],
itemStyle
:
{
...
...
@@ -123,7 +129,9 @@ function getBarLineOptions(obj) {
name
:
'bar4'
,
type
:
'bar'
,
label
:
{
show
:
true
show
:
true
,
position
:
'top'
,
color
:
'#fff'
},
data
:
[],
itemStyle
:
{
...
...
src/components/Marquee.vue
0 → 100644
View file @
a531739
<
template
>
<div
class=
"marquee-box"
ref=
"marqueeBox"
>
<span
class=
"marquee"
ref=
"marqueeText"
:style=
"[
{ transition: `all ${move ? speed : 0}s linear` }, { left: target }]">
{{
text
}}
</span>
</div>
</
template
>
<
script
type=
"text/ecmascript-6"
>
export
default
{
name
:
'Marquee'
,
props
:
{
text
:
String
,
direction
:
{
type
:
Number
,
default
:
5000
},
delay
:
{
type
:
Number
,
default
:
1000
}
},
data
()
{
return
{
move
:
false
,
valueWidth
:
0
,
target
:
0
,
boxWidth
:
0
,
speed
:
0
}
},
mounted
()
{
setTimeout
(()
=>
{
const
{
marqueeBox
,
marqueeText
}
=
this
.
$refs
if
(
!
marqueeBox
)
return
const
boxWidth
=
marqueeBox
.
offsetWidth
const
valueWidth
=
marqueeText
.
offsetWidth
this
.
valueWidth
=
valueWidth
this
.
boxWidth
=
boxWidth
if
(
boxWidth
-
20
<=
valueWidth
)
this
.
run
(
valueWidth
)
},
this
.
delay
)
},
methods
:
{
run
()
{
const
{
valueWidth
,
direction
}
=
this
this
.
target
=
`-
${
valueWidth
}
px`
this
.
move
=
true
this
.
speed
=
direction
/
1000
setTimeout
(()
=>
{
this
.
again
()
},
direction
)
},
again
()
{
const
{
boxWidth
,
valueWidth
,
direction
}
=
this
this
.
move
=
false
this
.
target
=
`
${
boxWidth
}
px`
setTimeout
(()
=>
{
this
.
speed
=
direction
*
(
boxWidth
/
valueWidth
).
toFixed
(
2
)
/
1000
this
.
move
=
true
this
.
reset
()
},
500
)
},
reset
()
{
const
awaitTime
=
(
this
.
speed
+
2
)
*
this
.
delay
this
.
target
=
0
setTimeout
(()
=>
{
this
.
run
()
},
awaitTime
)
}
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.marquee-box
{
width
:
100%
;
height
:
100%
;
overflow
:
hidden
;
position
:
relative
;
.marquee
{
position
:
absolute
;
white-space
:
nowrap
;
display
:
flex
;
align-items
:
center
;
}
.move
{
transform
:
translateX
(
-100%
);
}
}
</
style
>
src/utils/data.js
View file @
a531739
...
...
@@ -17,7 +17,9 @@ const DefaultData = {
label
:
'业务数据 | 2.1会员权益'
,
value
:
'4'
}
]
],
directionTimer
:
3000
,
delayTimer
:
3000
}
const
RankColor
=
[
'linear-gradient(180deg, #FFDA0B 0%, #FFBC24 100%)'
,
'linear-gradient(180deg, #EBE5D6 0%, #BDB4A6 100%)'
,
'linear-gradient(180deg, #EEC08E 0%, #B86E3A 100%)'
]
...
...
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