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 d4a62abc
authored
Jul 13, 2023
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
接口联调
1 parent
6b5e9b21
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
136 additions
and
80 deletions
src/components/StatisticsBox.vue
src/components/ViewDate.vue
src/views/home/pages/ViewSolar.vue
src/views/home/pages/index.js
src/views/home/solar/ContentLeft.vue
src/views/home/solar/MerchantTrends.vue
src/views/home/solar/PurchaseTrends.vue
src/views/solarDetail/index.vue
src/components/StatisticsBox.vue
View file @
d4a62ab
...
...
@@ -7,17 +7,17 @@
<div
v-if=
"item.rate"
class=
"statistics-top-rate"
>
占比
<span>
{{
item
.
rate
}}
</span></div>
</div>
<div
class=
"statistics-bottom"
>
<template
v-if=
"bottomType == 'money'"
>
<span>
{{
item
.
moneyName
}}
</span>
<span>
¥
{{
item
.
money
Value
}}
</span>
<template
v-if=
"
item.
bottomType == 'money'"
>
<span>
{{
item
.
bottomLabel
}}
</span>
<span>
¥
{{
item
.
bottom
Value
}}
</span>
</
template
>
<
template
v-else-if=
"bottomType == 'default'"
>
<span>
{{
item
.
moneyName
}}
</span>
<span>
{{
item
.
moneyValue
}}
</span>
</
template
>
<
template
v-else-if=
"bottomType == 'slot'"
>
<
template
v-else-if=
"item.bottomType == 'slot'"
>
<slot
name=
"bottom"
></slot>
</
template
>
<
template
v-else
>
<span>
{{
item
.
bottomLabel
}}
</span>
<span>
{{
item
.
bottomValue
}}
</span>
</
template
>
</div>
</div>
</div>
...
...
@@ -29,11 +29,11 @@ export default {
props
:
{
list
:
{
type
:
Array
},
bottomType
:
{
type
:
String
,
default
:
'default'
}
// bottomType: {
// type: String,
// default: 'default'
// }
},
data
()
{
return
{
...
...
src/components/ViewDate.vue
View file @
d4a62ab
...
...
@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-05 10:35:43
* @LastEditors: huyue
* @LastEditTime: 2023-07-1
2 15:45:33
* @LastEditTime: 2023-07-1
3 15:56:27
-->
<
template
>
<div
class=
"view-date"
>
统计年份:
...
...
@@ -17,12 +17,15 @@
<div
class=
"year-item"
:class=
"year == item ? 'active' : ''"
v-for=
"(item,index) in dataList"
:key=
"index"
@
click
.
s=
"selectYear(item)"
>
{{
item
}}
</div>
</div>
-->
</div>
业务开始时间:
2022年6月30日
</div>
业务开始时间:
{{
businessTime
}}
</div>
</
template
>
<
script
type=
'text/ecmascript-6'
>
import
datas
from
'@/utils/data'
export
default
{
name
:
'ViewDate'
,
props
:
{
businessTime
:
String
},
data
()
{
return
{
isShow
:
false
,
...
...
@@ -38,7 +41,6 @@ export default {
this
.
isShow
=
!
this
.
isShow
},
selectVal
(
val
)
{
console
.
log
(
val
)
this
.
year
=
val
this
.
switchYear
()
},
...
...
src/views/home/pages/ViewSolar.vue
View file @
d4a62ab
...
...
@@ -3,11 +3,11 @@
* @Author: huyue
* @Date: 2023-07-04 13:56:33
* @LastEditors: huyue
* @LastEditTime: 2023-07-
07 14:44:25
* @LastEditTime: 2023-07-
13 15:47:43
-->
<
template
>
<div
class=
"view-content"
>
<ViewDate></ViewDate>
<ViewDate
:businessTime=
"businessTime"
></ViewDate>
<div
class=
"content"
>
<ContentLeft></ContentLeft>
<ContentRight></ContentRight>
...
...
@@ -27,8 +27,14 @@ export default {
},
data
()
{
return
{
businessTime
:
''
}
},
created
()
{
this
.
$bus
.
$on
(
'businessstarttime'
,
data
=>
{
this
.
businessTime
=
data
})
},
methods
:
{
}
}
...
...
src/views/home/pages/index.js
View file @
d4a62ab
...
...
@@ -3,12 +3,11 @@
* @Author: huyue
* @Date: 2023-07-06 10:19:05
* @LastEditors: huyue
* @LastEditTime: 2023-07-
06 11:07:11
* @LastEditTime: 2023-07-
13 15:57:12
*/
import
Vue
from
'vue'
const
componentsFiles
=
require
.
context
(
`./`
,
true
,
/.vue$/
)
componentsFiles
.
keys
().
forEach
(
path
=>
{
const
component
=
componentsFiles
(
path
).
default
console
.
log
(
component
.
name
)
Vue
.
component
(
component
.
name
,
component
)
})
src/views/home/solar/ContentLeft.vue
View file @
d4a62ab
...
...
@@ -3,11 +3,11 @@
* @Author: huyue
* @Date: 2023-07-05 10:35:43
* @LastEditors: huyue
* @LastEditTime: 2023-07-13 1
5:12:3
6
* @LastEditTime: 2023-07-13 1
6:38:2
6
-->
<
template
>
<div
class=
"left"
>
<StatisticsBox
:list=
"solarList"
bottomType=
"money"
></StatisticsBox>
<StatisticsBox
:list=
"solarList"
></StatisticsBox>
<PurchaseTrends></PurchaseTrends>
<div
class=
"left-bottom"
>
<MerchantTrends
class=
"bottom-trends"
></MerchantTrends>
...
...
@@ -35,35 +35,50 @@ export default {
solarList
:
[
{
name
:
'总采购额'
,
valueName
:
'amounttotal'
,
value
:
'2,280,708'
,
moneyName
:
'本月采购额'
,
moneyValue
:
'2,280,708'
bottomLabel
:
'本月采购额'
,
bottemName
:
'amounttotalThismonth'
,
bottomValue
:
'2,280,708'
,
bottomType
:
'money'
},
{
name
:
'总采购额'
,
name
:
'商城采购额'
,
valueName
:
'amountshop'
,
value
:
'2,280,708'
,
moneyName
:
'本月采购额'
,
moneyValue
:
'2,280,708'
,
rate
:
'51%'
bottomLabel
:
'本月采购额'
,
bottemName
:
'amountshopThismonth'
,
bottomValue
:
'2,280,708'
,
rate
:
'51%'
,
rateName
:
'shopRate'
,
bottomType
:
'money'
},
{
name
:
'总采购额'
,
name
:
'自采采购额'
,
valueName
:
'amountself'
,
value
:
'2,280,708'
,
moneyName
:
'本月采购额'
,
moneyValue
:
'2,280,708'
,
rate
:
'49%'
bottomLabel
:
'本月采购额'
,
bottemName
:
'amountselfThismonth'
,
bottomValue
:
'2,280,708'
,
rate
:
'49%'
,
rateName
:
'selfRate'
,
bottomType
:
'money'
},
{
name
:
'总采购额'
,
name
:
'开通商户数'
,
valueName
:
'opentotal'
,
value
:
'2,280,708'
,
moneyName
:
'本月采购额'
,
moneyValue
:
'2,280,708'
bottomLabel
:
'本月开通商户数'
,
bottemName
:
'openThismonth'
,
bottomValue
:
'2,280,708'
},
{
name
:
'总采购额'
,
name
:
'采购商户数'
,
valueName
:
'buytotal'
,
value
:
'2,280,708'
,
moneyName
:
'本月采购额'
,
moneyValue
:
'2,280,708'
bottomLabel
:
'本月采购商户数'
,
bottemName
:
'buyThismonth'
,
bottomValue
:
'2,280,708'
}
]
}
...
...
@@ -74,9 +89,15 @@ export default {
init
()
{
this
.
getSolarList
()
},
getSolarList
()
{
this
.
api
.
solar
.
getAllPurchase
({
req
:
{
year
:
2023
}}).
then
(
res
=>
{
console
.
log
(
res
)
async
getSolarList
()
{
const
_data
=
await
this
.
api
.
solar
.
getAllPurchase
({
req
:
{
year
:
2023
}})
const
_dataList
=
_data
.
data
.
dataList
[
0
]
console
.
log
(
_dataList
)
this
.
$bus
.
$emit
(
'businessstarttime'
,
_dataList
.
businessstarttime
)
this
.
solarList
.
forEach
(
item
=>
{
item
.
value
=
_dataList
[
item
.
valueName
]
item
.
bottomValue
=
_dataList
[
item
.
bottemName
]
if
(
item
.
rateName
)
item
.
rate
=
_dataList
[
item
.
rateName
]
})
}
}
...
...
src/views/home/solar/MerchantTrends.vue
View file @
d4a62ab
...
...
@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-06 16:19:15
* @LastEditors: huyue
* @LastEditTime: 2023-07-1
2 15:57:01
* @LastEditTime: 2023-07-1
3 16:39:55
-->
<
template
>
<div
class=
"merchant-box"
>
...
...
@@ -44,19 +44,33 @@ export default {
},
methods
:
{
init
()
{
const
p
=
new
Promise
((
resolve
)
=>
{
for
(
let
i
=
0
;
i
<
12
;
i
++
)
{
this
.
dataList
.
push
({
month
:
i
+
1
+
'月'
,
data1
:
+
(
Math
.
random
()
*
20
).
toFixed
(
2
),
data2
:
+
(
Math
.
random
()
*
40
).
toFixed
(
2
)
})
}
resolve
()
})
p
.
then
(()
=>
{
this
.
$refs
.
merchantTrendsRef
.
drawBar
()
this
.
getTrendData
()
// const p = new Promise((resolve) => {
// for (let i = 0; i < 12; i++) {
// this.dataList.push({
// month: i + 1 + '月',
// data1: +(Math.random() * 20).toFixed(2),
// data2: +(Math.random() * 40).toFixed(2)
// })
// }
// console.log(this.dataList)
// resolve()
// })
// p.then(() => {
// this.$refs.merchantTrendsRef.drawBar()
// })
},
async
getTrendData
()
{
const
_data
=
await
this
.
api
.
solar
.
getAllOpenBuyTrend
({
req
:
{
year
:
2023
}})
const
_dataList
=
_data
.
data
.
dataList
_dataList
.
forEach
(
item
=>
{
this
.
dataList
.
push
({
month
:
item
.
statDate
,
data1
:
item
.
opennum
,
data2
:
item
.
buynum
})
})
this
.
$refs
.
merchantTrendsRef
.
drawBar
()
}
}
}
...
...
src/views/home/solar/PurchaseTrends.vue
View file @
d4a62ab
...
...
@@ -3,11 +3,11 @@
* @Author: huyue
* @Date: 2023-07-06 16:19:15
* @LastEditors: huyue
* @LastEditTime: 2023-07-
07 18:08:57
* @LastEditTime: 2023-07-
13 17:12:23
-->
<
template
>
<div
class=
"purchase-box"
>
<box-title
title=
"
采购额排名
"
></box-title>
<box-title
title=
"
近一年采购额趋势
"
></box-title>
<BarLineChart
ref=
"purchaseRef"
height=
"30.23vh"
domId=
"purchase"
:dataList
.
sync=
"dataList"
:tooltipFormatterObj=
"tooltipFormatterObj"
></BarLineChart>
<div
class=
"legend"
>
<div
class=
"legend-item shop"
>
...
...
@@ -56,20 +56,34 @@ export default {
},
methods
:
{
init
()
{
const
p
=
new
Promise
((
resolve
)
=>
{
for
(
let
i
=
0
;
i
<
12
;
i
++
)
{
this
.
dataList
.
push
({
month
:
i
+
1
+
'月'
,
data1
:
+
(
Math
.
random
()
*
2000
).
toFixed
(
2
),
data2
:
+
(
Math
.
random
()
*
5000
).
toFixed
(
2
),
data3
:
+
(
Math
.
random
()
*
50
).
toFixed
(
2
)
})
}
resolve
()
})
p
.
then
(()
=>
{
this
.
$refs
.
purchaseRef
.
drawBarLine
()
this
.
getDataList
()
// const p = new Promise((resolve) => {
// for (let i = 0; i < 12; i++) {
// this.dataList.push({
// month: i + 1 + '月',
// data1: +(Math.random() * 2000).toFixed(2),
// data2: +(Math.random() * 5000).toFixed(2),
// data3: +(Math.random() * 50).toFixed(2)
// })
// }
// resolve()
// })
// p.then(() => {
// this.$refs.purchaseRef.drawBarLine()
// })
},
async
getDataList
()
{
const
_data
=
await
this
.
api
.
solar
.
getAllPurchaseTrend
({
req
:
{
year
:
2023
}})
const
_dataList
=
_data
.
data
.
dataList
_dataList
.
forEach
(
item
=>
{
this
.
dataList
.
push
({
month
:
item
.
statDate
,
data1
:
item
.
shopamount
,
data2
:
item
.
selfamount
,
data3
:
item
.
shopratio
})
})
this
.
$refs
.
purchaseRef
.
drawBarLine
()
}
}
}
...
...
src/views/solarDetail/index.vue
View file @
d4a62ab
...
...
@@ -6,8 +6,8 @@
</
template
>
<
template
#
content
>
<div
class=
"solar-detail-content"
>
<view-date></view-date>
<StatisticsBox
class=
"statistic-box"
:list=
"solarDetailList"
bottomType=
"money"
></StatisticsBox>
<view-date></view-date>
z
<StatisticsBox
class=
"statistic-box"
:list=
"solarDetailList"
></StatisticsBox>
<!-- 采购趋势 -->
<div
class=
"tendency-box"
>
<box-title
title=
"近一年采购额趋势"
></box-title>
...
...
@@ -76,32 +76,32 @@ export default {
{
name
:
'总采购额'
,
value
:
'2,280,708'
,
moneyName
:
'本月采购额'
,
money
Value
:
'2,280,708'
bottomLabel
:
'本月采购额'
,
bottom
Value
:
'2,280,708'
},
{
name
:
'总采购额'
,
value
:
'2,280,708'
,
moneyName
:
'本月采购额'
,
money
Value
:
'2,280,708'
bottomLabel
:
'本月采购额'
,
bottom
Value
:
'2,280,708'
},
{
name
:
'总采购额'
,
value
:
'2,280,708'
,
moneyName
:
'本月采购额'
,
money
Value
:
'2,280,708'
bottomLabel
:
'本月采购额'
,
bottom
Value
:
'2,280,708'
},
// {
// name: '总采购额',
// value: '2,280,708',
//
moneyName
: '本月采购额',
//
money
Value: '2,280,708'
//
bottomLabel
: '本月采购额',
//
bottom
Value: '2,280,708'
// },
// {
// name: '总采购额',
// value: '2,280,708',
//
moneyName
: '本月采购额',
//
money
Value: '2,280,708'
//
bottomLabel
: '本月采购额',
//
bottom
Value: '2,280,708'
// }
],
// 商城采购饼图结构
...
...
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