Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
gh
/
dj-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 feeab6d8
authored
Oct 27, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
72ab07ba
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
59 additions
and
72 deletions
src/components/PieChart.vue
src/mixins/userMixin.js
src/views/map/index.vue
src/views/saas/business.vue
src/views/saas/category.vue
src/views/saas/overview.vue
src/views/user/age.vue
src/views/user/buyCar.vue
src/views/user/mileage.vue
src/views/user/price.vue
src/components/PieChart.vue
View file @
feeab6d
<
template
>
<div
class=
"pie-box"
>
<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', 'center-content-num-color']"
></div>
</div>
</div>
-->
<!--
<div
class=
"content-desc"
>
<div
class=
"content-desc-icon"
:style=
"
{ background: descColor }">
</div>
{{
numDesc
}}
...
...
@@ -76,8 +76,6 @@ export default {
},
mounted
()
{
this
.
initData
()
this
.
draw
()
},
methods
:
{
...
...
@@ -91,7 +89,6 @@ export default {
value
:
item
[
keys
[
1
]]
})
})
console
.
log
(
this
.
viewData
)
},
draw
()
{
if
(
this
.
mTime
)
clearInterval
(
this
.
mTime
)
...
...
@@ -124,9 +121,11 @@ export default {
},
emphasis
:
{
label
:
{
show
:
false
,
fontSize
:
'14'
,
fontWeight
:
'bold'
show
:
true
,
fontSize
:
this
.
size
,
fontWeight
:
'bold'
,
color
:
'#fff'
,
formatter
:
'{d}%'
}
},
labelLine
:
{
...
...
@@ -140,7 +139,6 @@ export default {
this
.
echartsPie
.
clear
()
this
.
mainValue
=
0
this
.
numDesc
=
''
// this.setAnamiteText()
this
.
echartsPie
.
setOption
(
this
.
option
)
this
.
pieActive
()
this
.
mTime
=
setInterval
(
this
.
pieActive
,
15000
)
...
...
@@ -153,7 +151,7 @@ export default {
this
.
mainValue
=
data
.
data
.
value
this
.
numDesc
=
data
.
data
.
name
this
.
descColor
=
data
.
color
this
.
setAnamiteText
()
// 停止定时器,清除之前的高亮
clearInterval
(
this
.
mTime
)
this
.
currentIndex
=
data
.
dataIndex
...
...
@@ -163,8 +161,6 @@ export default {
},
// 事件触发
emitEvent
(
data
)
{
// this.text = data.name
// this.subtext = data.value
this
.
echartsPie
.
setOption
(
this
.
option
)
this
.
$emit
(
'pieAction'
,
data
)
},
...
...
@@ -183,29 +179,7 @@ export default {
seriesIndex
:
0
,
dataIndex
:
this
.
currentIndex
})
//高亮项this.currentIndex
// this.mainValue = this.option.series[0].data[this.currentIndex].value
// this.numDesc = this.option.series[0].data[this.currentIndex].name
// this.descColor = this.option.color[this.currentIndex]
// this.setAnamiteText()
},
setAnamiteText
()
{
// document.querySelector(`.${this.id}`).nextElementSibling.style = 'animation-iteration-count:infinite;'
// 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(() => {
// document.querySelector(`.${this.id}`).nextElementSibling.style = 'animation-iteration-count:0'
// }, 3000)
this
.
descColor
=
this
.
option
.
color
[
this
.
currentIndex
]
},
//高亮
pieActive
()
{
...
...
src/mixins/userMixin.js
View file @
feeab6d
...
...
@@ -13,7 +13,6 @@ export default {
methods
:
{
getDistribution
()
{
this
.
api
.
user
.
getDistribution
().
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
.
code
==
0
)
{
res
.
data
.
dataList
.
forEach
(
item
=>
{
if
(
item
.
queryitem
==
'年龄'
)
this
.
ageData
=
item
.
distribution
...
...
src/views/map/index.vue
View file @
feeab6d
...
...
@@ -311,8 +311,7 @@ export default {
}
}
this
.
api
.
map
.
getMerchantInProgressThisMonth
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
console
.
log
(
'??????'
)
})
},
methods
:
{
...
...
src/views/saas/business.vue
View file @
feeab6d
...
...
@@ -12,7 +12,7 @@
<business-view
:businessNum=
"businessNum"
></business-view>
</div>
<div
class=
"business-category"
>
<Category
></Category>
<Category
:categoryData=
"categoryData"
></Category>
</div>
</div>
</
template
>
...
...
@@ -28,7 +28,8 @@ export default {
name
:
'Business'
,
data
()
{
return
{
businessNum
:
''
businessNum
:
''
,
categoryData
:[],
}
},
mounted
()
{
...
...
@@ -42,6 +43,20 @@ export default {
this
.
api
.
sass
.
getSaasValueaddedTransformationOverview
().
then
(
res
=>
{
if
(
res
.
code
==
0
)
{
this
.
businessNum
=
res
.
data
.
dataList
[
0
]
this
.
categoryData
=
[
{
name
:
'权益类'
,
value
:
this
.
businessNum
.
equity
},
{
name
:
'膜类'
,
value
:
this
.
businessNum
.
membrane
},
{
name
:
'电子类'
,
value
:
this
.
businessNum
.
electronics
}
]
}
})
}
...
...
src/views/saas/category.vue
View file @
feeab6d
<
template
>
<div
class=
"
user
-box"
>
<div
class=
"
category
-box"
>
<div
class=
"title title-icon"
>
<span
class=
"icon"
></span>
<span>
品类业务
</span>
</div>
<div
class=
"
user
-container flex"
>
<
!--
<pie-chart
ref=
"pieChart"
:id=
"chart.id"
:list=
"ageData"
:keys=
"chart.keys"
:radius=
"chart.radius"
height=
"6.1vh"
@
pieAction=
"pieAction"
></pie-chart>
--
>
/
<Legend
:list=
"area
Data"
></Legend>
<div
class=
"
category
-container flex"
>
<
pie-chart
ref=
"pieChart"
:id=
"chart.id"
:list=
"categoryData"
height=
"8.29vh"
></pie-chart
>
<Legend
class=
"category-legend"
:list=
"category
Data"
></Legend>
</div>
</div>
</
template
>
<
script
>
// import { userMixin } from '../../mixins/index'
export
default
{
name
:
'Category'
,
// mixins: [userMixin],
data
()
{
return
{
chart
:
{
id
:
'category'
,
keys
:
[
'name'
,
'num'
],
radius
:
[
'56%'
,
'85%'
]
id
:
'category'
}
}
},
props
:
{
categoryData
:
{
type
:
Array
,
default
:
()
=>
[]
}
},
methods
:
{}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.user-box
{
.category-box
{
height
:
13.9vh
;
background
:
#0b0e31
;
.title
{
font-size
:
10px
;
}
.legend-item
{
width
:
4.65vw
;
height
:
1.83vh
;
background
:
#0d133b
;
font-weight
:
400
;
font-size
:
9px
;
color
:
#fff
;
span
{
width
:
5px
;
height
:
5px
;
border-radius
:
50%
;
margin
:
4px
;
display
:
inline-block
;
.category-container
{
height
:
11.34vh
;
margin
:
1.59vh
1.67vw
1.46vh
1.11vw
;
.category-legend{
width
:
4.2vw
;
}
}
}
...
...
src/views/saas/overview.vue
View file @
feeab6d
...
...
@@ -106,7 +106,6 @@ export default {
},
getMerchantData
()
{
this
.
api
.
sass
.
getMerchantData
().
then
(
res
=>
{
console
.
log
(
res
)
if
(
res
.
code
==
0
)
{
this
.
merchantData
=
res
.
data
.
dataList
[
0
]
}
...
...
src/views/user/age.vue
View file @
feeab6d
...
...
@@ -6,7 +6,7 @@
<span>
客户年龄分布
</span>
</div>
<div
class=
"user-container flex"
>
<pie-chart
ref=
"pieChart"
:id=
"chart.id"
:list=
"ageData"
:keys=
"chart.keys"
:radius=
"chart.radius"
height=
"6.1vh"
@
pieAction=
"pieAction"
></pie-chart>
<pie-chart
ref=
"pieChart"
:id=
"chart.id"
:
size=
"chart.size"
:
list=
"ageData"
:keys=
"chart.keys"
:radius=
"chart.radius"
height=
"6.1vh"
@
pieAction=
"pieAction"
></pie-chart>
<div
class=
"legend-item flex"
>
<span
:style=
"
{ background: descColor }">
</span>
{{
selectData
&&
selectData
.
name
}}
...
...
@@ -25,7 +25,8 @@ export default {
chart
:
{
id
:
'user-age'
,
keys
:
[
'name'
,
'num'
],
radius
:
[
'56%'
,
'85%'
]
radius
:
[
'56%'
,
'85%'
],
size
:
'8px'
},
selectData
:
''
,
descColor
:
''
...
...
src/views/user/buyCar.vue
View file @
feeab6d
...
...
@@ -6,7 +6,7 @@
<span>
购车年限
</span>
</div>
<div
class=
"user-container flex"
>
<pie-chart
@
pieAction=
"pieAction"
ref=
"pieChart"
:id=
"chart.id"
:list=
"buyCarData"
:keys=
"chart.keys"
:radius=
"chart.radius"
height=
"6.1vh"
></pie-chart>
<pie-chart
@
pieAction=
"pieAction"
:size=
"chart.size"
ref=
"pieChart"
:id=
"chart.id"
:list=
"buyCarData"
:keys=
"chart.keys"
:radius=
"chart.radius"
height=
"6.1vh"
></pie-chart>
<div
class=
"legend-item flex"
>
<span
:style=
"
{ background: descColor }">
</span>
{{
selectData
&&
selectData
.
name
}}
...
...
@@ -27,7 +27,8 @@ export default {
chart
:
{
id
:
'bugCar'
,
keys
:
[
'name'
,
'num'
],
radius
:
[
'56%'
,
'85%'
]
radius
:
[
'56%'
,
'85%'
],
size
:
'8px'
}
}
},
...
...
src/views/user/mileage.vue
View file @
feeab6d
...
...
@@ -6,7 +6,7 @@
<span>
里程分布
</span>
</div>
<div
class=
"user-container flex"
>
<pie-chart
@
pieAction=
"pieAction"
ref=
"pieChart"
:id=
"chart.id"
:list=
"mileageData"
:keys=
"chart.keys"
:radius=
"chart.radius"
height=
"6.1vh"
></pie-chart>
<pie-chart
@
pieAction=
"pieAction"
:size=
"chart.size"
ref=
"pieChart"
:id=
"chart.id"
:list=
"mileageData"
:keys=
"chart.keys"
:radius=
"chart.radius"
height=
"6.1vh"
></pie-chart>
<div
class=
"legend-item flex"
>
<span
:style=
"
{ background: descColor }">
</span>
{{
selectData
&&
selectData
.
name
}}
...
...
@@ -27,7 +27,8 @@ export default {
chart
:
{
id
:
'mileage'
,
keys
:
[
'name'
,
'num'
],
radius
:
[
'56%'
,
'85%'
]
radius
:
[
'56%'
,
'85%'
],
size
:
'8px'
}
}
},
...
...
src/views/user/price.vue
View file @
feeab6d
...
...
@@ -6,7 +6,7 @@
<span>
车价占比
</span>
</div>
<div
class=
"user-container flex"
>
<pie-chart
@
pieAction=
"pieAction"
ref=
"pieChart"
:id=
"chart.id"
:list=
"priceData"
:keys=
"chart.keys"
:radius=
"chart.radius"
height=
"6.1vh"
></pie-chart>
<pie-chart
@
pieAction=
"pieAction"
ref=
"pieChart"
:
size=
"chart.size"
:
id=
"chart.id"
:list=
"priceData"
:keys=
"chart.keys"
:radius=
"chart.radius"
height=
"6.1vh"
></pie-chart>
<div
class=
"legend-item flex"
>
<span
:style=
"
{ background: descColor }">
</span>
{{
selectData
&&
selectData
.
name
}}
...
...
@@ -27,7 +27,8 @@ export default {
chart
:
{
id
:
'user-price'
,
keys
:
[
'name'
,
'num'
],
radius
:
[
'56%'
,
'85%'
]
radius
:
[
'56%'
,
'85%'
],
size
:
'8px'
}
}
},
...
...
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