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 5195e009
authored
Jul 07, 2023
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
详情页面搭建
1 parent
99c4f028
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
246 additions
and
6 deletions
src/components/PieChart.vue
src/components/Ranking.vue
src/router/routes.js
src/views/home/solar/ContentRight.vue
src/views/home/solar/RightViewContent.vue
src/views/solarDetail/index.vue
src/components/PieChart.vue
View file @
5195e00
...
...
@@ -39,7 +39,7 @@ export default {
},
colors
:
{
type
:
Array
,
default
:
()
=>
[
'#
FF6E76'
,
'#7CFFB2'
,
' #FDF006'
,
'#4FA0FF'
,
'#EB6001'
,
'#BF98FF'
,
'#58D9F9
'
]
default
:
()
=>
[
'#
16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001
'
]
},
size
:
{
type
:
String
,
...
...
src/components/Ranking.vue
View file @
5195e00
<
template
>
<div>
<div
v-for=
"(item, index) in rankingsList"
:key=
"index"
class=
"ranking-box-item"
@
click=
"goDetailPage(item)"
>
<div
class=
"ranking-box-item-left"
>
<div
v-for=
"(itm, inx) in rankingDataObj"
:key=
"inx"
>
<template
v-if=
"inx === 0"
>
<div
class=
"ranking-box-item-left"
>
<div
class=
"circle"
:style=
"
{ 'background-image': index
< 3
?
RankColor
[
index
]
:
''
}"
>
{{
index
+
1
}}
</div>
<div
class=
"text"
>
{{
item
.
name
}}
</div>
<div
class=
"text"
>
{{
item
[
itm
.
name
]
}}
</div>
</div>
</
template
>
<
template
v-else
>
<div
class=
"ranking-box-item-right"
>
{{
item
[
itm
.
name
]
}}
</div>
</
template
>
</div>
<div
class=
"ranking-box-item-right"
>
{{
item
.
value
}}
</div>
</div>
</div>
</template>
<
script
>
import
datas
from
'@/utils/data'
import
router
from
'../router'
export
default
{
name
:
'Ranking'
,
props
:
{
// 排名对象值
rankingsList
:
{
type
:
Array
,
default
:
()
=>
[]
},
// 排名对象映射关系
rankingDataObj
:
{
type
:
Array
,
default
:
()
=>
[]
}
},
data
()
{
...
...
@@ -33,6 +46,7 @@ export default {
// 跳转详情页面
goDetailPage
(
item
)
{
console
.
log
(
item
)
router
.
push
(
'/solarDetail'
)
}
}
}
...
...
src/router/routes.js
View file @
5195e00
...
...
@@ -15,6 +15,14 @@ const pages = [
keepAlive
:
true
,
backgroundColor
:
'#F7F7F7'
}
},
{
name
:
'solarDetail'
,
meta
:
{
isTab
:
true
,
keepAlive
:
true
,
backgroundColor
:
'#F7F7F7'
}
}
]
const
keepAlives
=
[]
...
...
@@ -50,6 +58,7 @@ const getPages = _ => {
name
,
meta
:
e
.
meta
||
{},
component
:
resolve
=>
require
([
`views/
${
name
}
/index.vue`
],
resolve
)
// component: resolve => require([`views/home/detail/${name}/index.vue`], resolve)
}
if
(
e
.
children
)
route
.
children
=
setChildren
(
e
,
name
)
if
(
e
.
meta
&&
e
.
meta
.
keepAlive
)
keepAlives
.
push
(
name
)
...
...
src/views/home/solar/ContentRight.vue
View file @
5195e00
...
...
@@ -30,7 +30,7 @@
</div>
<div
class=
"merchant-box-item-right"
>
{{
item
.
value
}}
</div>
</div>
-->
<ranking
:rankingsList=
"merchantsList"
></ranking>
<ranking
:rankingsList=
"merchantsList"
:rankingDataObj=
"merchantsDataObj"
></ranking>
</div>
</div>
</div>
...
...
@@ -70,25 +70,42 @@ export default {
merchantsList
:
[
{
name
:
'公转一号店'
,
merchant
:
'云南宏胜瑞达汽车销售'
,
value
:
'345489'
},
{
name
:
'公转一号店'
,
merchant
:
'云南宏胜瑞达汽车销售'
,
value
:
'345489'
},
{
name
:
'公转一号店'
,
merchant
:
'云南宏胜瑞达汽车销售'
,
value
:
'345489'
},
{
name
:
'公转一号店'
,
merchant
:
'云南宏胜瑞达汽车销售'
,
value
:
'345489'
},
{
name
:
'公转一号店'
,
merchant
:
'云南宏胜瑞达汽车销售'
,
value
:
'345489'
}
],
merchantsDataObj
:
[
{
name
:
'name'
},
{
name
:
'merchant'
},
{
name
:
'value'
,
type
:
'number'
}
],
// 采购进度饼图结构
progressChart
:
{
id
:
'progress'
,
...
...
src/views/home/solar/RightViewContent.vue
View file @
5195e00
<!-- 太阳膜右侧下面两个盒子里面内容 -->
<!-- 太阳膜右侧下面两个盒子里面内容
饼图左右结构都可用这个组件
-->
<
template
>
<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>
...
...
src/views/solarDetail/index.vue
0 → 100644
View file @
5195e00
<
template
>
<div
class=
"layout"
>
<view-container>
<template
#
title
>
<view-title></view-title>
</
template
>
<
template
#
content
>
<div
class=
"solar-detail-content"
>
<view-date></view-date>
<!-- 采购趋势 -->
<div
class=
"tendency-box"
>
<box-title
title=
"近一年采购额趋势"
></box-title>
<Charts></Charts>
</div>
<!-- 商品占比 -->
<div
class=
"propotion-box flex"
>
<div
class=
"propotion-box-left"
>
<box-title
title=
"商城采购商品占比"
></box-title>
<RightViewContent
class=
"content-box"
:chart=
"shopmallChart"
:listData=
"shopmallData"
:legentList=
"shopmallLegend"
:legendColors=
"shopmallLegendColors"
></RightViewContent>
</div>
<div
class=
"propotion-box-right"
>
<box-title
title=
"自采商品占比"
></box-title>
<RightViewContent
class=
"content-box"
:chart=
"selfPickChart"
:listData=
"selfPickData"
:legentList=
"selfPickLegend"
:legendColors=
"selfPickLegendColors"
></RightViewContent>
</div>
</div>
</div>
</
template
>
</view-container>
</div>
</template>
<
script
>
import
RightViewContent
from
'../home/solar/RightViewContent.vue'
export
default
{
name
:
'SolarDetail'
,
components
:
{
RightViewContent
},
data
()
{
return
{
// 商城采购饼图结构
shopmallChart
:
{
id
:
'shopmall'
,
keys
:
[
'goodsName'
,
'per'
],
height
:
'16vh'
,
colors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
]
},
// 商城采购数据
shopmallData
:
[
{
goodsName
:
'商品1'
,
per
:
0.36
,
price
:
4568
,
averagePrice
:
668
},
{
goodsName
:
'商品1'
,
per
:
0.2
,
price
:
4568
,
averagePrice
:
668
},
{
goodsName
:
'商品1'
,
per
:
0.16
,
price
:
4568
,
averagePrice
:
668
},
{
goodsName
:
'品1发货'
,
per
:
0.1
,
price
:
4568
,
averagePrice
:
668
},
{
goodsName
:
'商品1'
,
per
:
0.09
,
price
:
4568
,
averagePrice
:
668
},
{
goodsName
:
'商品1'
,
per
:
0.09
,
price
:
4568
,
averagePrice
:
668
}
],
shopmallLegend
:
[
{
name
:
'goodsName'
},
{
name
:
'per'
},
{
name
:
'price'
,
hasIcon
:
'¥'
},
{
name
:
'averagePrice'
,
hasIcon
:
'均价¥'
}
],
shopmallLegendColors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
],
// 自采饼图结构
selfPickChart
:
{
id
:
'selfPick'
,
keys
:
[
'goodsName'
,
'per'
],
height
:
'16vh'
,
colors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
]
},
// 自采采购数据
selfPickData
:
[
{
goodsName
:
'商品1'
,
per
:
0.36
,
price
:
4568
,
averagePrice
:
668
},
{
goodsName
:
'商品1'
,
per
:
0.2
,
price
:
4568
,
averagePrice
:
668
},
{
goodsName
:
'商品1'
,
per
:
0.16
,
price
:
4568
,
averagePrice
:
668
},
{
goodsName
:
'品1发货'
,
per
:
0.1
,
price
:
4568
,
averagePrice
:
668
},
{
goodsName
:
'商品1'
,
per
:
0.09
,
price
:
4568
,
averagePrice
:
668
},
{
goodsName
:
'商品1'
,
per
:
0.09
,
price
:
4568
,
averagePrice
:
668
}
],
selfPickLegend
:
[
{
name
:
'goodsName'
},
{
name
:
'per'
},
{
name
:
'price'
,
hasIcon
:
'¥'
},
{
name
:
'averagePrice'
,
hasIcon
:
'均价¥'
}
],
selfPickLegendColors
:
[
'#16E193'
,
'#747DFF'
,
'#E588FF'
,
'#34AFFF'
,
'#FFC200'
,
'#EB6001'
]
}
},
mounted
()
{},
methods
:
{}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.solar-detail-content
{
width
:
100%
;
height
:
100%
;
box-sizing
:
border-box
;
padding
:
1.78vh
24px
;
gap
:
0
16px
;
.tendency-box
{
width
:
96.67vw
;
height
:
39.78vh
;
box-shadow
:
inset
0
0
20px
0
#3d57ff69
;
margin-top
:
1.78vh
;
}
.propotion-box
{
justify-content
:
space-between
;
margin-top
:
1.78vh
;
&-left,
&-right
{
width
:
47.78vw
;
height
:
25.33vh
;
box-shadow
:
inset
0
0
20px
0
#3d57ff69
;
}
}
}
</
style
>
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