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 14ef3fe8
authored
Jul 21, 2023
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
饼图样式调整
1 parent
6d3df9b9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
16 deletions
src/components/PieChart.vue
src/views/boutiqueDetail/GoodsPayPropertion.vue
src/views/boutiqueDetail/GoodsSupplierPropertion.vue
src/views/solar/PurchasePropertion.vue
src/views/solar/RightViewContent.vue
src/views/solarDetail/MerchantsPropotion.vue
src/components/PieChart.vue
View file @
14ef3fe
...
...
@@ -47,8 +47,12 @@ export default {
default
:
'12px'
},
formatter
:
{
type
:
Boolean
,
default
:
false
type
:
String
,
default
:
''
},
formatterName
:
{
type
:
String
,
default
:
''
}
},
...
...
@@ -133,24 +137,46 @@ export default {
fontSize
:
this
.
size
,
fontWeight
:
'bold'
,
color
:
'#fff'
,
formatter
:
function
(
params
)
{
formatter
:
(
params
)
=>
{
const
_dataIndex
=
params
.
dataIndex
// 价格
const
_purchaseamount
=
utils
.
numAddSymbol
(
_this
.
list
[
_dataIndex
].
purchaseamount
)
// 均价
const
_avarage
=
utils
.
numAddSymbol
(
_this
.
list
[
_dataIndex
].
averprice
)
// const _html = `<div>¥${_purchaseamount}</div><div style="padding-left: 7px;">均价¥ ${_avarage}</div>`
if
(
_this
.
formatter
)
return
`{a|¥
${
_purchaseamount
}
}\n{b|均价¥
${
_avarage
}
}`
return
`
${
params
.
name
}
`
// return _html
// 总价
let
_totalValue
=
0
_this
.
list
.
forEach
(
item
=>
{
_totalValue
+=
item
.
value
})
let
_html
/**
* price -- 价格+均价组合
* total -- 名称+总数组合
* none -- 不显示内容
* 默认显示名称
*/
switch
(
_this
.
formatter
)
{
case
'price'
:
_html
=
`{a|¥
${
_purchaseamount
}
}\n{b|均价¥
${
_avarage
}
}`
break
case
'total'
:
_html
=
`
${
_this
.
formatterName
}
\n
${
_totalValue
}
`
break
case
'none'
:
_html
=
''
break
default
:
_html
=
params
.
name
}
return
_html
},
rich
:
{
a
:
{
color
:
'#c8c8c8'
,
wordSpacing
:
'5px'
},
b
:
{
color
:
'#ffffff66'
,
fontSize
:
'12px'
,
// padding: ['7px', 0, 0, 0],
lineHeight
:
'28'
}
}
...
...
src/views/boutiqueDetail/GoodsPayPropertion.vue
View file @
14ef3fe
...
...
@@ -46,12 +46,14 @@ export default {
id
:
'goodsPay'
,
keys
:
[
'name'
,
'value'
],
height
:
'15.34vh'
,
colors
:
[
'#34AFFF'
,
'#16E193'
,
'#FFC200'
]
colors
:
[
'#34AFFF'
,
'#16E193'
,
'#FFC200'
],
formatter
:
'total'
,
formatterName
:
'支付订单'
},
goodsPayLegend
:
[
{
name
:
'name'
,
width
:
'
5
vw'
width
:
'
4
vw'
},
{
name
:
'rate'
,
...
...
src/views/boutiqueDetail/GoodsSupplierPropertion.vue
View file @
14ef3fe
...
...
@@ -40,7 +40,9 @@ export default {
id
:
'boutiquePropertion'
,
keys
:
[
'name'
,
'value'
],
height
:
'15.34vh'
,
colors
:
[
'#16E193'
,
'#34AFFF'
]
colors
:
[
'#16E193'
,
'#34AFFF'
],
formatter
:
'total'
,
formatterName
:
'总商品数'
},
propertionLegend
:
[
{
...
...
src/views/solar/PurchasePropertion.vue
View file @
14ef3fe
...
...
@@ -26,7 +26,7 @@ export default {
keys
:
[
'goodsname'
,
'purchaseamount'
],
height
:
'17.34vh'
,
colors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
],
formatter
:
true
formatter
:
'price'
},
// 采购占比数据
propertionData
:
[],
...
...
src/views/solar/RightViewContent.vue
View file @
14ef3fe
...
...
@@ -3,7 +3,7 @@
-->
<
template
>
<div
class=
"main-box"
>
<pie-chart
class=
"pie-chart"
:id=
"chart.id"
:list=
"listData"
:keys=
"chart.keys"
:formatter=
"chart.formatter"
:height=
"chart.height"
:colors=
"chart.colors"
></pie-chart>
<pie-chart
class=
"pie-chart"
:id=
"chart.id"
:list=
"listData"
:keys=
"chart.keys"
:formatter=
"chart.formatter"
:
formatterName=
"chart.formatterName"
:
height=
"chart.height"
:colors=
"chart.colors"
></pie-chart>
<Legend
class=
"legend"
:list=
"listData"
:legentList=
"legentList"
:colors=
"legendColors"
></Legend>
</div>
</
template
>
...
...
src/views/solarDetail/MerchantsPropotion.vue
View file @
14ef3fe
...
...
@@ -56,7 +56,7 @@ export default {
keys
:
[
'goodsname'
,
'purchaseamount'
],
height
:
'18vh'
,
colors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
],
formatter
:
true
formatter
:
'price'
},
shopmallLegend
:
[
{
...
...
@@ -87,7 +87,7 @@ export default {
keys
:
[
'goodsname'
,
'purchaseamount'
],
height
:
'18vh'
,
colors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
],
formatter
:
true
formatter
:
'price'
},
selfPickLegend
:
[
{
...
...
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