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 087bfa1c
authored
Jul 18, 2023
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
饼图样式调整
1 parent
b5778096
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
49 deletions
src/components/PieChart.vue
src/views/home/solar/PurchasePropertion.vue
src/views/home/solar/RightViewContent.vue
src/views/solarDetail/MerchantsPropotion.vue
src/components/PieChart.vue
View file @
087bfa1
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
<
script
>
<
script
>
import
*
as
echarts
from
'echarts'
import
*
as
echarts
from
'echarts'
import
utils
from
'@/utils/util.js'
export
default
{
export
default
{
name
:
'PieChart'
,
name
:
'PieChart'
,
...
@@ -44,6 +45,10 @@ export default {
...
@@ -44,6 +45,10 @@ export default {
size
:
{
size
:
{
type
:
String
,
type
:
String
,
default
:
'0.6vw'
default
:
'0.6vw'
},
formatter
:
{
type
:
Boolean
,
default
:
false
}
}
},
},
...
@@ -75,8 +80,7 @@ export default {
...
@@ -75,8 +80,7 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{},
},
methods
:
{
methods
:
{
// 初始化数据
// 初始化数据
...
@@ -128,10 +132,19 @@ export default {
...
@@ -128,10 +132,19 @@ export default {
color
:
'#fff'
,
color
:
'#fff'
,
formatter
(
params
)
{
formatter
(
params
)
{
const
_dataIndex
=
params
.
dataIndex
const
_dataIndex
=
params
.
dataIndex
const
_avarage
=
_this
.
list
[
_dataIndex
].
averprice
const
_purchaseamount
=
utils
.
numAddSymbol
(
_this
.
list
[
_dataIndex
].
purchaseamount
)
console
.
log
(
_this
.
list
,
_avarage
);
const
_avarage
=
utils
.
numAddSymbol
(
_this
.
list
[
_dataIndex
].
averprice
)
if
(
_avarage
)
return
`
${
params
.
name
}
\n均价¥
${
_avarage
||
''
}
`
console
.
log
(
_purchaseamount
,
_avarage
)
if
(
_this
.
formatter
)
return
`{a|¥
${
_purchaseamount
}
}\n{b|均价¥
${
_avarage
}
}`
return
`
${
params
.
name
}
`
return
`
${
params
.
name
}
`
},
rich
:
{
a
:
{
color
:
'#c8c8c8'
},
b
:
{
color
:
'#ffffff66'
}
}
}
}
}
},
},
...
...
src/views/home/solar/PurchasePropertion.vue
View file @
087bfa1
...
@@ -23,34 +23,35 @@ export default {
...
@@ -23,34 +23,35 @@ export default {
// 采购占比饼图结构
// 采购占比饼图结构
propertionChart
:
{
propertionChart
:
{
id
:
'propertion'
,
id
:
'propertion'
,
keys
:
[
'goodsname'
,
'purchaseamount'
,
'averprice'
],
keys
:
[
'goodsname'
,
'purchaseamount'
],
height
:
'15.34vh'
,
height
:
'15.34vh'
,
colors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
]
colors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
],
formatter
:
true
},
},
// 采购占比数据
// 采购占比数据
propertionData
:
[],
propertionData
:
[],
propertionLegend
:
[
propertionLegend
:
[
{
{
name
:
'goodsname'
,
name
:
'goodsname'
,
width
:
'
2.5
vw'
width
:
'
11.11
vw'
},
},
{
{
name
:
'rate'
,
name
:
'rate'
,
type
:
'decimal'
,
type
:
'decimal'
,
width
:
'1.88vw'
width
:
'1.88vw'
},
},
{
//
{
name
:
'purchaseamount'
,
//
name: 'purchaseamount',
hasIcon
:
'¥'
,
//
hasIcon: '¥',
type
:
'number'
,
//
type: 'number',
width
:
'4.06vw'
//
width: '4.06vw'
},
//
},
{
//
{
name
:
'averprice'
,
//
name: 'averprice',
hasIcon
:
'均价¥'
,
//
hasIcon: '均价¥',
type
:
'number'
,
//
type: 'number',
width
:
'6.24vw'
//
width: '6.24vw'
}
//
}
]
]
}
}
},
},
...
...
src/views/home/solar/RightViewContent.vue
View file @
087bfa1
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
-->
-->
<
template
>
<
template
>
<div
class=
"main-box"
>
<div
class=
"main-box"
>
<pie-chart
class=
"pie-chart"
:id=
"chart.id"
:list=
"listData"
:keys=
"chart.keys"
:height=
"chart.height"
:colors=
"chart.colors"
></pie-chart>
<pie-chart
class=
"pie-chart"
:id=
"chart.id"
:list=
"listData"
:keys=
"chart.keys"
:
formatter=
"chart.formatter"
:
height=
"chart.height"
:colors=
"chart.colors"
></pie-chart>
<Legend
class=
"legend"
:list=
"listData"
:legentList=
"legentList"
:colors=
"legendColors"
></Legend>
<Legend
class=
"legend"
:list=
"listData"
:legentList=
"legentList"
:colors=
"legendColors"
></Legend>
</div>
</div>
</
template
>
</
template
>
...
...
src/views/solarDetail/MerchantsPropotion.vue
View file @
087bfa1
...
@@ -55,60 +55,62 @@ export default {
...
@@ -55,60 +55,62 @@ export default {
id
:
'shopmall'
,
id
:
'shopmall'
,
keys
:
[
'goodsname'
,
'purchaseamount'
],
keys
:
[
'goodsname'
,
'purchaseamount'
],
height
:
'16vh'
,
height
:
'16vh'
,
colors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
]
colors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
],
formatter
:
true
},
},
shopmallLegend
:
[
shopmallLegend
:
[
{
{
name
:
'goodsname'
,
name
:
'goodsname'
,
width
:
'
7
vw'
width
:
'
15.28
vw'
},
},
{
{
name
:
'rate'
,
name
:
'rate'
,
type
:
'decimal'
,
type
:
'decimal'
,
width
:
'3vw'
width
:
'3vw'
},
},
{
//
{
name
:
'purchaseamount'
,
//
name: 'purchaseamount',
hasIcon
:
'¥'
,
//
hasIcon: '¥',
type
:
'number'
,
//
type: 'number',
width
:
'5vw'
//
width: '5vw'
},
//
},
{
//
{
name
:
'averprice'
,
//
name: 'averprice',
hasIcon
:
'均价¥'
,
//
hasIcon: '均价¥',
type
:
'number'
,
//
type: 'number',
width
:
'5vw'
//
width: '5vw'
}
//
}
],
],
// 自采饼图结构
// 自采饼图结构
selfPickChart
:
{
selfPickChart
:
{
id
:
'selfPick'
,
id
:
'selfPick'
,
keys
:
[
'goodsname'
,
'purchaseamount'
],
keys
:
[
'goodsname'
,
'purchaseamount'
],
height
:
'16vh'
,
height
:
'16vh'
,
colors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
]
colors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
],
formatter
:
true
},
},
selfPickLegend
:
[
selfPickLegend
:
[
{
{
name
:
'goodsname'
,
name
:
'goodsname'
,
width
:
'
7
vw'
width
:
'
15.28
vw'
},
},
{
{
name
:
'rate'
,
name
:
'rate'
,
type
:
'decimal'
,
type
:
'decimal'
,
width
:
'3vw'
width
:
'3vw'
},
},
{
//
{
name
:
'purchaseamount'
,
//
name: 'purchaseamount',
hasIcon
:
'¥'
,
//
hasIcon: '¥',
type
:
'number'
,
//
type: 'number',
width
:
'5vw'
//
width: '5vw'
},
//
},
{
//
{
name
:
'averprice'
,
//
name: 'averprice',
hasIcon
:
'均价¥'
,
//
hasIcon: '均价¥',
type
:
'number'
,
//
type: 'number',
width
:
'5vw'
//
width: '5vw'
}
//
}
]
]
}
}
},
},
...
...
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