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 6509b9a4
authored
Jul 22, 2022
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
9346226f
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
31 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 @
6509b9a
<
template
>
<
template
>
<div
<div
class=
"marquee-box"
ref=
"marqueeBox"
>
class=
"marquee-box"
<span
class=
"marquee"
ref=
"marqueeText"
:style=
"[
{ transition: `all ${move ? speed : 0}s linear` }, { left: target }]">
{{
text
}}
</span>
ref=
"marqueeBox"
>
<span
class=
"marquee"
ref=
"marqueeText"
:style=
"[
{'transition': `all ${move ? speed : 0}s linear`},{'left':target}]"
>
{{
text
}}
</span>
</div>
</div>
</
template
>
</
template
>
<
script
type=
'text/ecmascript-6'
>
<
script
type=
"text/ecmascript-6"
>
export
default
{
export
default
{
name
:
'Marquee'
,
name
:
'Marquee'
,
props
:
{
props
:
{
...
@@ -34,16 +27,21 @@ export default {
...
@@ -34,16 +27,21 @@ export default {
speed
:
0
speed
:
0
}
}
},
},
mounted
()
{
watch
:{
setTimeout
(()
=>
{
'text'
(
n
){
if
(
n
)
setTimeout
(()
=>
{
let
{
marqueeBox
,
marqueeText
}
=
this
.
$refs
let
{
marqueeBox
,
marqueeText
}
=
this
.
$refs
if
(
!
marqueeBox
)
return
if
(
!
marqueeBox
)
return
let
boxWidth
=
marqueeBox
.
offsetWidth
,
let
boxWidth
=
marqueeBox
.
offsetWidth
,
valueWidth
=
marqueeText
.
offsetWidth
valueWidth
=
marqueeText
.
offsetWidth
this
.
valueWidth
=
valueWidth
this
.
valueWidth
=
valueWidth
this
.
boxWidth
=
boxWidth
this
.
boxWidth
=
boxWidth
if
(
boxWidth
-
2
0
<=
valueWidth
)
this
.
run
(
valueWidth
)
if
(
boxWidth
-
1
0
<=
valueWidth
)
this
.
run
(
valueWidth
)
},
this
.
delay
)
},
this
.
delay
)
}
},
mounted
()
{
},
},
methods
:
{
methods
:
{
run
()
{
run
()
{
...
@@ -76,7 +74,7 @@ export default {
...
@@ -76,7 +74,7 @@ export default {
}
}
</
script
>
</
script
>
<
style
scoped
lang=
'scss'
>
<
style
scoped
lang=
"scss"
>
.marquee-box
{
.marquee-box
{
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
...
...
src/components/PieChart.vue
View file @
6509b9a
...
@@ -35,7 +35,7 @@ export default {
...
@@ -35,7 +35,7 @@ export default {
},
},
radius
:
{
radius
:
{
type
:
Array
,
type
:
Array
,
default
:
()
=>
[
'5
5%'
,
'75
%'
]
default
:
()
=>
[
'5
0%'
,
'70
%'
]
},
},
colors
:
{
colors
:
{
type
:
Array
,
type
:
Array
,
...
@@ -221,15 +221,15 @@ export default {
...
@@ -221,15 +221,15 @@ export default {
text-align
:
center
;
text-align
:
center
;
max-width
:
40%
;
max-width
:
40%
;
&-num
{
&-num
{
overflow
:
hidden
;
//
overflow
:
hidden
;
text-overflow
:
ellipsis
;
//
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
//
white-space
:
nowrap
;
//
font-size
:
0.6vw
;
//
font-size
:
0.6vw
;
color
:
#fff
;
color
:
#fff
;
--step
:
0
;
--step
:
0
;
counter-reset
:
count
var
(
--step
);
counter-reset
:
count
var
(
--step
);
z-index
:
var
(
--step
);
z-index
:
var
(
--step
);
transition
:
--step
1
s
;
transition
:
--step
0.5
s
;
&::before
{
&::before
{
content
:
counter
(
count
);
content
:
counter
(
count
);
}
}
...
@@ -251,7 +251,7 @@ export default {
...
@@ -251,7 +251,7 @@ export default {
text-align
:
center
;
text-align
:
center
;
font-weight
:
400
;
font-weight
:
400
;
position
:
absolute
;
position
:
absolute
;
top
:
9
3
%
;
top
:
9
1
%
;
left
:
50%
;
left
:
50%
;
transform
:
translateX
(
-50%
);
transform
:
translateX
(
-50%
);
text-align
:
center
;
text-align
:
center
;
...
...
src/components/ViewTabs.vue
View file @
6509b9a
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<div
class=
"tabs"
>
<div
class=
"tabs"
>
<div
class=
"tab pointer"
>
<div
class=
"tab pointer"
>
<div
class=
"tab-left box"
@
click=
"changeType('total')"
>
<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=
"total-title-box flex"
>
<div
class=
"title inline total"
>
客户总数
</div>
<div
class=
"title inline total"
>
客户总数
</div>
<div
class=
"title inline"
>
{{
req
.
queryType
==
0
?
'上月'
:
'昨日'
}}
新增
</div>
<div
class=
"title inline"
>
{{
req
.
queryType
==
0
?
'上月'
:
'昨日'
}}
新增
</div>
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
</div>
</div>
<div
class=
"tab-right box"
>
<div
class=
"tab-right box"
>
<template
v-for=
"(i, index) in tabs"
>
<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>
<div
class=
"item-title"
>
{{
i
.
title
}}
</div>
<transition-number
:num=
"pageData[i.key].totalNum"
:idKey=
"`number-$
{i.key}`" class="item-total" />
<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 }]">
<div
:class=
"['item-incr flex',
{ up: pageData[i.key].up }, { down: pageData[i.key].down }]">
...
@@ -34,7 +34,10 @@
...
@@ -34,7 +34,10 @@
<div
class=
"tabs-content box"
>
<div
class=
"tabs-content box"
>
<div
class=
"tabs-title title-icon"
>
<div
class=
"tabs-title title-icon"
>
<span
class=
"icon"
></span>
<span
class=
"icon"
></span>
<span>
客户增长趋势
</span>
<span>
客户增长趋势
<label
class=
"tabs-title-info"
>
-{{ tabTitle }}
</label>
</span>
</div>
</div>
<div
class=
"tabs-content-chart flex"
>
<div
class=
"tabs-content-chart flex"
>
<div
class=
"line flex"
>
<div
class=
"line flex"
>
...
@@ -50,6 +53,7 @@
...
@@ -50,6 +53,7 @@
</template>
</template>
</div>
</div>
<div
class=
"table user-select pointer"
>
<div
class=
"table user-select pointer"
>
<div
class=
"tabs-title-info table-position"
>
({{tabTitle}})
</div>
<div
class=
"table-head"
>
<div
class=
"table-head"
>
<
template
v-for=
"(i, index) in tabHead"
>
<
template
v-for=
"(i, index) in tabHead"
>
<div
:class=
"['table-head-item flex',
{ active: index == tabIndex }]" :key="index" @click="tabIndex = index">
<div
:class=
"['table-head-item flex',
{ active: index == tabIndex }]" :key="index" @click="tabIndex = index">
...
@@ -57,7 +61,7 @@
...
@@ -57,7 +61,7 @@
</div>
</div>
</
template
>
</
template
>
</div>
</div>
<div
class=
"table-body
flex
"
>
<div
class=
"table-body"
>
<
template
v-for=
"(i, index) in tabIndex == 0 ? pageData[tabType].top : pageData[tabType].last"
>
<
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-body-item flex"
:key=
"index"
>
<div
class=
"table-num flex"
>
{{
index
+
1
}}
</div>
<div
class=
"table-num flex"
>
{{
index
+
1
}}
</div>
...
@@ -102,6 +106,7 @@ export default {
...
@@ -102,6 +106,7 @@ export default {
return
{
return
{
tabs
,
tabs
,
tabHead
:
[],
tabHead
:
[],
tabTitle
:
'客户总数'
,
tabType
:
'total'
,
tabType
:
'total'
,
tabIndex
:
0
,
tabIndex
:
0
,
delayTimer
:
3000
,
delayTimer
:
3000
,
...
@@ -140,7 +145,14 @@ export default {
...
@@ -140,7 +145,14 @@ export default {
this
.
getOveralltrend
(
'total'
)
this
.
getOveralltrend
(
'total'
)
},
},
changeType
(
type
)
{
changeType
(
type
)
{
console
.
log
(
type
,
'type'
)
let
title
=
{
'total'
:
'客户总数'
,
'wechat'
:
'企微客户数'
,
'wechatGroup'
:
'企微群数'
,
'applet'
:
'小程序客户数'
,
'publiccus'
:
'公众号客户数'
}
this
.
tabTitle
=
title
[
type
]
this
.
tabType
=
type
this
.
tabType
=
type
this
.
getOveralltrend
(
type
)
this
.
getOveralltrend
(
type
)
},
},
...
@@ -337,8 +349,8 @@ export default {
...
@@ -337,8 +349,8 @@ export default {
display
:
grid
;
display
:
grid
;
grid-template-columns
:
41.5%
57.5%
;
grid-template-columns
:
41.5%
57.5%
;
justify-content
:
space-between
;
justify-content
:
space-between
;
margin-bottom
:
0.5
vh
;
margin-bottom
:
1
vh
;
overflow
:
hidden
;
//
overflow
:
hidden
;
.tab-total-box
{
.tab-total-box
{
height
:
100%
;
height
:
100%
;
padding-left
:
8px
;
padding-left
:
8px
;
...
@@ -427,6 +439,11 @@ export default {
...
@@ -427,6 +439,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
{
&
-content
{
height
:
24.4vh
;
height
:
24.4vh
;
...
@@ -437,6 +454,11 @@ export default {
...
@@ -437,6 +454,11 @@ export default {
.tabs-title
{
.tabs-title
{
font-size
:
12px
;
font-size
:
12px
;
color
:
#e8e8e8
;
color
:
#e8e8e8
;
&-info
{
font-size
:
10px
;
color
:
#eb6001
;
line-height
:
17px
;
}
}
}
&
-chart
{
&
-chart
{
height
:
20.2vh
;
height
:
20.2vh
;
...
@@ -458,6 +480,13 @@ export default {
...
@@ -458,6 +480,13 @@ export default {
.table
{
.table
{
flex
:
3
;
flex
:
3
;
background
:
#262525
;
background
:
#262525
;
position
:
relative
;
.table-position{
position
:
absolute
;
top
:
-20px
;
left
:
50%
;
transform
:
translateX
(
-50%
);
}
&
-head
{
&
-head
{
display
:
grid
;
display
:
grid
;
grid-template-columns
:
repeat
(
2
,
50%
);
grid-template-columns
:
repeat
(
2
,
50%
);
...
@@ -479,8 +508,6 @@ export default {
...
@@ -479,8 +508,6 @@ export default {
}
}
&
-body
{
&
-body
{
height
:
calc
(
100%
-
2.4vh
);
height
:
calc
(
100%
-
2.4vh
);
flex-direction
:
column
;
justify-content
:
space-between
;
&-item
{
&-item
{
line-height
:
3.4vh
;
line-height
:
3.4vh
;
width
:
100%
;
width
:
100%
;
...
@@ -493,6 +520,7 @@ export default {
...
@@ -493,6 +520,7 @@ export default {
}
}
.table-key
{
.table-key
{
width
:
calc
(
100%
-
96px
);
width
:
calc
(
100%
-
96px
);
height
:
3.6vh
;
}
}
.tab-value
{
.tab-value
{
width
:
52px
;
width
:
52px
;
...
...
src/components/ViewTitle.vue
View file @
6509b9a
...
@@ -56,7 +56,7 @@ export default {
...
@@ -56,7 +56,7 @@ export default {
color
:
transparent
;
color
:
transparent
;
background
:
linear-gradient
(
left
,
#e60115
10%
,
#eb6001
25%
,
#f5aa01
50%
,
#fdf006
100%
);
background
:
linear-gradient
(
left
,
#e60115
10%
,
#eb6001
25%
,
#f5aa01
50%
,
#fdf006
100%
);
-webkit-background-clip
:
text
;
-webkit-background-clip
:
text
;
font-size
:
22
px
;
font-size
:
18
px
;
font-weight
:
600
;
font-weight
:
600
;
&::before
{
&::before
{
content
:
''
;
content
:
''
;
...
...
src/components/lineOptions.js
View file @
6509b9a
...
@@ -7,7 +7,7 @@ function getLineOptions(obj) {
...
@@ -7,7 +7,7 @@ function getLineOptions(obj) {
backgroundColor
:
'rgba(68,68,68,0.80)'
,
backgroundColor
:
'rgba(68,68,68,0.80)'
,
textStyle
:
{
textStyle
:
{
color
:
'#FFFFFF'
,
color
:
'#FFFFFF'
,
fontSize
:
'
8
px'
fontSize
:
'
1.5
px'
},
},
formatter
:
tooltipFormatter
||
''
,
formatter
:
tooltipFormatter
||
''
,
confine
:
true
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