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 40d06003
authored
Jul 27, 2022
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'gh_v1.2.0' into gh_v1.2.1
2 parents
219cea56
4ed1a877
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
16 deletions
src/components/PieChart.vue
src/components/TransitionNumber.vue
src/components/ViewTabs.vue
src/components/ViewTitle.vue
src/mixins/clientMixin.js
src/components/PieChart.vue
View file @
40d0600
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<div
class=
"pie-box"
>
<div
class=
"pie-box"
>
<div
:id=
"id"
:style=
"
{ height: height }" class="pie-chart">
</div>
<div
:id=
"id"
:style=
"
{ height: height }" class="pie-chart">
</div>
<div
class=
"center-content"
:style=
"
{ fontSize: size }">
<div
class=
"center-content"
:style=
"
{ fontSize: size }">
<div
:class=
"[id, 'center-content-num']"
></div>
<div
:class=
"[id, 'center-content-num'
, 'center-content-num-color'
]"
></div>
</div>
</div>
<div
class=
"content-desc"
>
<div
class=
"content-desc"
>
<div
class=
"content-desc-icon"
:style=
"
{ background: descColor }">
</div>
<div
class=
"content-desc-icon"
:style=
"
{ background: descColor }">
</div>
...
@@ -191,7 +191,17 @@ export default {
...
@@ -191,7 +191,17 @@ export default {
},
},
setAnamiteText
()
{
setAnamiteText
()
{
// document.querySelector(`.${this.id}`).nextElementSibling.style = 'animation-iteration-count:infinite;'
// document.querySelector(`.${this.id}`).nextElementSibling.style = 'animation-iteration-count:infinite;'
if
(
document
.
querySelector
(
`.
${
this
.
id
}
`
))
document
.
querySelector
(
`.
${
this
.
id
}
`
).
style
=
`--step:
${
this
.
mainValue
}
`
// if (document.querySelector(`.${this.id}`))
if
(
document
.
querySelector
(
`.
${
this
.
id
}
`
))
{
if
(
typeof
this
.
mainValue
==
'string'
)
{
let
dom
=
document
.
querySelector
(
`.
${
this
.
id
}
`
)
dom
.
classList
.
remove
(
'center-content-num'
)
dom
.
innerText
=
this
.
mainValue
+
'%'
}
else
{
document
.
querySelector
(
`.
${
this
.
id
}
`
).
style
=
`--step:
${
this
.
mainValue
}
`
}
}
// document.querySelector("div").style.setProperty("--percent", Math.random())
// setTimeout(() => {
// setTimeout(() => {
// document.querySelector(`.${this.id}`).nextElementSibling.style = 'animation-iteration-count:0'
// document.querySelector(`.${this.id}`).nextElementSibling.style = 'animation-iteration-count:0'
// }, 3000)
// }, 3000)
...
@@ -219,12 +229,14 @@ export default {
...
@@ -219,12 +229,14 @@ export default {
transform
:
translate
(
-50%
,
-50%
);
transform
:
translate
(
-50%
,
-50%
);
text-align
:
center
;
text-align
:
center
;
max-width
:
40%
;
max-width
:
40%
;
&-num-color
{
color
:
#fff
;
}
&
-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
;
--step
:
0
;
--step
:
0
;
counter-reset
:
count
var
(
--step
);
counter-reset
:
count
var
(
--step
);
z-index
:
var
(
--step
);
z-index
:
var
(
--step
);
...
@@ -243,7 +255,7 @@ export default {
...
@@ -243,7 +255,7 @@ export default {
}
}
}
}
.content-desc
{
.content-desc
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
font-size
:
8px
;
font-size
:
8px
;
color
:
#c8c8c8
;
color
:
#c8c8c8
;
...
@@ -260,7 +272,7 @@ export default {
...
@@ -260,7 +272,7 @@ export default {
width
:
8px
;
width
:
8px
;
height
:
4px
;
height
:
4px
;
border-radius
:
2px
;
border-radius
:
2px
;
margin-right
:
4px
;
margin-right
:
4px
;
}
}
}
}
}
}
...
...
src/components/TransitionNumber.vue
View file @
40d0600
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
>
>
</div>
</div>
</
template
>
</
template
>
<slot
name=
"suffix"
></slot>
</div>
</div>
</template>
</template>
...
@@ -78,4 +79,4 @@ export default {
...
@@ -78,4 +79,4 @@ export default {
inherits
:
false
;
inherits
:
false
;
initial-value
:
15
;
initial-value
:
15
;
}
}
</
style
>
\ No newline at end of file
\ No newline at end of file
</
style
>
src/components/ViewTabs.vue
View file @
40d0600
<
template
>
<
template
>
<div
class=
"tabs"
>
<div
class=
"tabs"
>
<div
class=
"tab
pointer
"
>
<div
class=
"tab"
>
<div
class=
"tab-left box"
@
click=
"changeType('total')"
>
<div
class=
"tab-left box"
@
click=
"changeType('total')"
>
<div
:class=
"
{ 'tab-total-box': true, active: tabType == 'total' }">
<div
:class=
"
{ 'tab-total-box': true, active: tabType == 'total' }">
<div
class=
"total-title-box flex"
>
<div
class=
"total-title-box flex"
>
...
@@ -17,9 +17,11 @@
...
@@ -17,9 +17,11 @@
</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', tabType == i.key ? 'active' : '']"
@
click=
"changeType(i.key)"
>
<div
:key=
"index"
:class=
"['item', 'flex', tabType == i.key ? 'active' : ''
, ['applet', 'publiccus'].includes(i.key) ? '' : 'pointer'
]"
@
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">
<span
v-if=
"['applet', 'publiccus'].includes(i.key)"
class=
"item-txt"
slot=
"suffix"
>
(总)
</span>
</transition-number>
<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 }]">
{{
req
.
queryType
==
0
?
'上月'
:
'昨日'
}}
{{
req
.
queryType
==
0
?
'上月'
:
'昨日'
}}
<template
v-if=
"pageData[i.key].up || pageData[i.key].down"
>
<template
v-if=
"pageData[i.key].up || pageData[i.key].down"
>
...
@@ -126,7 +128,7 @@ export default {
...
@@ -126,7 +128,7 @@ export default {
updata
:
Date
.
now
()
updata
:
Date
.
now
()
}
}
},
},
mounted
()
{},
mounted
()
{
},
methods
:
{
methods
:
{
init
(
params
)
{
init
(
params
)
{
this
.
isGroup
=
true
this
.
isGroup
=
true
...
@@ -144,6 +146,9 @@ export default {
...
@@ -144,6 +146,9 @@ export default {
this
.
getOveralltrend
(
this
.
tabType
)
this
.
getOveralltrend
(
this
.
tabType
)
},
},
changeType
(
type
)
{
changeType
(
type
)
{
if
([
'applet'
,
'publiccus'
].
includes
(
type
))
{
return
true
}
let
title
=
{
let
title
=
{
total
:
'客户总数'
,
total
:
'客户总数'
,
wechat
:
'企微客户数'
,
wechat
:
'企微客户数'
,
...
@@ -383,8 +388,8 @@ export default {
...
@@ -383,8 +388,8 @@ export default {
width
:
27%
;
width
:
27%
;
padding-left
:
0
;
padding-left
:
0
;
white-space
:
nowrap
;
white-space
:
nowrap
;
.describe{
.describe
{
font-size
:
8px
;
font-size
:
8px
;
color
:
#eb6001
;
color
:
#eb6001
;
}
}
}
}
...
@@ -418,6 +423,11 @@ export default {
...
@@ -418,6 +423,11 @@ export default {
color
:
#e8e8e8
;
color
:
#e8e8e8
;
padding-top
:
0.5vh
;
padding-top
:
0.5vh
;
}
}
&
-txt
{
font-size
:
12px
;
color
:
#e8e8e8
;
font-weight
:
400
;
}
&
-total
{
&
-total
{
font-size
:
14px
;
font-size
:
14px
;
color
:
#eb6001
;
color
:
#eb6001
;
...
...
src/components/ViewTitle.vue
View file @
40d0600
...
@@ -49,7 +49,6 @@ export default {
...
@@ -49,7 +49,6 @@ export default {
},
},
getMerchantNum
()
{
getMerchantNum
()
{
this
.
api
.
overview
.
getMerchantNum
({}).
then
(
res
=>
{
this
.
api
.
overview
.
getMerchantNum
({}).
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
.
code
===
'0'
)
{
if
(
res
.
code
===
'0'
)
{
this
.
merchantNum
=
res
.
data
.
dataList
[
0
]
this
.
merchantNum
=
res
.
data
.
dataList
[
0
]
}
}
...
...
src/mixins/clientMixin.js
View file @
40d0600
...
@@ -29,13 +29,18 @@ export default {
...
@@ -29,13 +29,18 @@ export default {
this
.
distributionRank
=
''
this
.
distributionRank
=
''
if
(
res
.
data
.
dataList
.
length
>
0
)
{
if
(
res
.
data
.
dataList
.
length
>
0
)
{
let
distribution
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
distribution
)
let
distribution
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
distribution
)
const
keys
=
Object
.
keys
(
distribution
)
// 删掉“未知”
delete
distribution
[
'未知'
]
let
keys
=
Object
.
keys
(
distribution
)
let
total
=
Object
.
values
(
distribution
).
reduce
((
prev
,
next
)
=>
prev
+
next
)
keys
.
forEach
((
item
,
index
)
=>
{
keys
.
forEach
((
item
,
index
)
=>
{
this
.
clientData
.
push
({
this
.
clientData
.
push
({
name
:
item
,
name
:
item
,
value
:
distribution
[
item
]
// value: distribution[item]
value
:
(
distribution
[
item
]
/
total
*
100
).
toFixed
(
1
)
})
})
})
})
console
.
log
(
this
.
clientData
)
this
.
distributionRank
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
distributionRank
)
this
.
distributionRank
=
JSON
.
parse
(
res
.
data
.
dataList
[
0
].
distributionRank
)
}
}
})
})
...
@@ -51,7 +56,7 @@ export default {
...
@@ -51,7 +56,7 @@ export default {
pieAction
(
data
)
{
pieAction
(
data
)
{
this
.
brandList
=
[]
this
.
brandList
=
[]
let
array
=
this
.
distributionRank
&&
this
.
distributionRank
[
data
.
name
]
let
array
=
this
.
distributionRank
&&
this
.
distributionRank
[
data
.
name
]
if
(
array
&&
array
.
length
>
0
)
{
if
(
array
&&
array
.
length
>
0
)
{
for
(
let
i
of
array
)
{
for
(
let
i
of
array
)
{
this
.
brandList
.
push
(
i
&&
Object
.
keys
(
i
)[
0
])
this
.
brandList
.
push
(
i
&&
Object
.
keys
(
i
)[
0
])
}
}
...
...
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