Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
gh
/
data-view
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 4053f749
authored
Jul 22, 2022
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'gh_v1.2.0' of
http://192.168.3.233:8090/gh/data-view
into gh_v1.2.0
2 parents
5aac943e
d9c4b429
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
32 deletions
src/components/Marquee.vue
src/components/PieChart.vue
src/components/ViewTabs.vue
src/components/ViewTitle.vue
src/components/lineOptions.js
src/components/Marquee.vue
View file @
4053f74
<
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
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'
>
<
script
type=
"text/ecmascript-6"
>
export
default
{
name
:
'Marquee'
,
props
:
{
...
...
@@ -34,16 +27,21 @@ export default {
speed
:
0
}
},
mounted
()
{
setTimeout
(()
=>
{
watch
:{
'text'
(
n
){
if
(
n
)
setTimeout
(()
=>
{
let
{
marqueeBox
,
marqueeText
}
=
this
.
$refs
if
(
!
marqueeBox
)
return
let
boxWidth
=
marqueeBox
.
offsetWidth
,
valueWidth
=
marqueeText
.
offsetWidth
this
.
valueWidth
=
valueWidth
this
.
boxWidth
=
boxWidth
if
(
boxWidth
-
2
0
<=
valueWidth
)
this
.
run
(
valueWidth
)
if
(
boxWidth
-
1
0
<=
valueWidth
)
this
.
run
(
valueWidth
)
},
this
.
delay
)
}
},
mounted
()
{
},
methods
:
{
run
()
{
...
...
@@ -76,7 +74,7 @@ export default {
}
</
script
>
<
style
scoped
lang=
'scss'
>
<
style
scoped
lang=
"scss"
>
.marquee-box
{
width
:
100%
;
height
:
100%
;
...
...
@@ -92,4 +90,4 @@ export default {
transform
:
translateX
(
-100%
);
}
}
</
style
>
\ No newline at end of file
</
style
>
src/components/PieChart.vue
View file @
4053f74
...
...
@@ -35,7 +35,7 @@ export default {
},
radius
:
{
type
:
Array
,
default
:
()
=>
[
'5
5%'
,
'75
%'
]
default
:
()
=>
[
'5
0%'
,
'70
%'
]
},
colors
:
{
type
:
Array
,
...
...
@@ -221,15 +221,15 @@ export default {
text-align
:
center
;
max-width
:
40%
;
&-num
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
//
overflow
:
hidden
;
//
text-overflow
:
ellipsis
;
//
white-space
:
nowrap
;
//
font-size
:
0.6vw
;
color
:
#fff
;
--step
:
0
;
counter-reset
:
count
var
(
--step
);
z-index
:
var
(
--step
);
transition
:
--step
1
s
;
transition
:
--step
0.5
s
;
&::before
{
content
:
counter
(
count
);
}
...
...
@@ -251,7 +251,7 @@ export default {
text-align
:
center
;
font-weight
:
400
;
position
:
absolute
;
top
:
9
3
%
;
top
:
9
1
%
;
left
:
50%
;
transform
:
translateX
(
-50%
);
text-align
:
center
;
...
...
src/components/ViewTabs.vue
View file @
4053f74
...
...
@@ -2,7 +2,7 @@
<div
class=
"tabs"
>
<div
class=
"tab pointer"
>
<div
class=
"tab-left box"
@
click=
"changeType('total')"
>
<div
class=
"tab-total-box
"
>
<div
:class=
"
{ 'tab-total-box': true, active: tabType == 'total' }
">
<div
class=
"total-title-box flex"
>
<div
class=
"title inline total"
>
客户总数
</div>
<div
class=
"title inline"
>
{{
req
.
queryType
==
0
?
'上月'
:
'昨日'
}}
新增
</div>
...
...
@@ -17,7 +17,7 @@
</div>
<div
class=
"tab-right box"
>
<template
v-for=
"(i, index) in tabs"
>
<div
:key=
"index"
class=
"item flex
"
@
click=
"changeType(i.key)"
>
<div
:key=
"index"
:class=
"['item', 'flex', tabType == i.key ? 'active' : '']
"
@
click=
"changeType(i.key)"
>
<div
class=
"item-title"
>
{{
i
.
title
}}
</div>
<transition-number
:num=
"pageData[i.key].totalNum"
:idKey=
"`number-$
{i.key}`" class="item-total" />
<div
:class=
"['item-incr flex',
{ up: pageData[i.key].up }, { down: pageData[i.key].down }]">
...
...
@@ -34,7 +34,10 @@
<div
class=
"tabs-content box"
>
<div
class=
"tabs-title title-icon"
>
<span
class=
"icon"
></span>
<span>
客户增长趋势
</span>
<span>
客户增长趋势
<label
class=
"tabs-title-info"
>
-{{ tabTitle }}
</label>
</span>
</div>
<div
class=
"tabs-content-chart flex"
>
<div
class=
"line flex"
>
...
...
@@ -50,6 +53,7 @@
</template>
</div>
<div
class=
"table user-select pointer"
>
<div
class=
"tabs-title-info table-position"
>
({{ tabTitle }})
</div>
<div
class=
"table-head"
>
<
template
v-for=
"(i, index) in tabHead"
>
<div
:class=
"['table-head-item flex',
{ active: index == tabIndex }]" :key="index" @click="tabIndex = index">
...
...
@@ -57,7 +61,7 @@
</div>
</
template
>
</div>
<div
class=
"table-body
flex
"
>
<div
class=
"table-body"
>
<
template
v-for=
"(i, index) in tabIndex == 0 ? pageData[tabType].top : pageData[tabType].last"
>
<div
class=
"table-body-item flex"
:key=
"index"
>
<div
class=
"table-num flex"
>
{{
index
+
1
}}
</div>
...
...
@@ -102,6 +106,7 @@ export default {
return
{
tabs
,
tabHead
:
[],
tabTitle
:
'客户总数'
,
tabType
:
'total'
,
tabIndex
:
0
,
delayTimer
:
3000
,
...
...
@@ -140,7 +145,14 @@ export default {
this
.
getOveralltrend
(
'total'
)
},
changeType
(
type
)
{
console
.
log
(
type
,
'type'
)
let
title
=
{
'total'
:
'客户总数'
,
'wechat'
:
'企微客户数'
,
'wechatGroup'
:
'企微群数'
,
'applet'
:
'小程序客户数'
,
'publiccus'
:
'公众号客户数'
}
this
.
tabTitle
=
title
[
type
]
this
.
tabType
=
type
this
.
getOveralltrend
(
type
)
},
...
...
@@ -222,7 +234,9 @@ export default {
})
},
draw
(
lineData
,
queryType
)
{
console
.
log
(
lineData
)
let
data
=
[],
Min
=
0
,
xData
=
[],
title
=
{
'total'
:
'客户总数'
,
...
...
@@ -237,6 +251,7 @@ export default {
xData
.
push
(
queryType
==
0
?
`
${
month
==
0
?
'1月'
:
`
${
Number
(
month
)
+
1
}
月`
}
`
:
new
Date
(
e
.
statDate
).
format
(
'MM-dd'
))
data
.
push
(
e
.
totalNum
)
})
Min
=
Math
.
min
(...
data
)
let
options
=
{
tooltip
:
{
trigger
:
'axis'
,
...
...
@@ -275,6 +290,7 @@ export default {
},
yAxis
:
{
type
:
'value'
,
min
:
Min
,
splitLine
:
{
lineStyle
:
{
color
:
'rgba(96,98,102,0.2)'
...
...
@@ -337,8 +353,8 @@ export default {
display
:
grid
;
grid-template-columns
:
41.5%
57.5%
;
justify-content
:
space-between
;
margin-bottom
:
0.5
vh
;
overflow
:
hidden
;
margin-bottom
:
1
vh
;
//
overflow
:
hidden
;
.tab-total-box
{
height
:
100%
;
padding-left
:
8px
;
...
...
@@ -427,6 +443,11 @@ export default {
}
}
}
.active
{
background
:
rgba
(
235
,
96
,
1
,
0.1
);
box-sizing
:
border-box
;
border
:
1px
solid
rgba
(
235
,
96
,
1
,
0.8
);
}
}
&
-content
{
height
:
24.4vh
;
...
...
@@ -437,6 +458,11 @@ export default {
.tabs-title
{
font-size
:
12px
;
color
:
#e8e8e8
;
&-info
{
font-size
:
10px
;
color
:
#eb6001
;
line-height
:
17px
;
}
}
&
-chart
{
height
:
20.2vh
;
...
...
@@ -458,6 +484,13 @@ export default {
.table
{
flex
:
3
;
background
:
#262525
;
position
:
relative
;
.table-position
{
position
:
absolute
;
top
:
-20px
;
left
:
50%
;
transform
:
translateX
(
-50%
);
}
&
-head
{
display
:
grid
;
grid-template-columns
:
repeat
(
2
,
50%
);
...
...
@@ -479,8 +512,6 @@ export default {
}
&
-body
{
height
:
calc
(
100%
-
2.4vh
);
flex-direction
:
column
;
justify-content
:
space-between
;
&-item
{
line-height
:
3.4vh
;
width
:
100%
;
...
...
@@ -493,6 +524,7 @@ export default {
}
.table-key
{
width
:
calc
(
100%
-
96px
);
height
:
3.6vh
;
}
.tab-value
{
width
:
52px
;
...
...
src/components/ViewTitle.vue
View file @
4053f74
...
...
@@ -72,7 +72,7 @@ export default {
color
:
transparent
;
background
:
linear-gradient
(
left
,
#e60115
10%
,
#eb6001
25%
,
#f5aa01
50%
,
#fdf006
100%
);
-webkit-background-clip
:
text
;
font-size
:
22
px
;
font-size
:
18
px
;
font-weight
:
600
;
&::before
{
content
:
''
;
...
...
src/components/lineOptions.js
View file @
4053f74
...
...
@@ -7,7 +7,7 @@ function getLineOptions(obj) {
backgroundColor
:
'rgba(68,68,68,0.80)'
,
textStyle
:
{
color
:
'#FFFFFF'
,
fontSize
:
'
8
px'
fontSize
:
'
1.5
px'
},
formatter
:
tooltipFormatter
||
''
,
confine
:
true
...
...
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