Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
shld-databoard-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
潘自豪 Rambo Pan
shld-databoard-ui
Commits
338a5dff
Commit
338a5dff
authored
Sep 27, 2023
by
王礼鸿 Baimax Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
饼图和占比定时刷新
parent
46ede36b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
11 deletions
+28
-11
orderProportionHeadData.js
src/module/databoard/databoard/js/orderProportionHeadData.js
+22
-5
order-proportion.vue
src/module/databoard/databoard/order-proportion.vue
+6
-6
No files found.
src/module/databoard/databoard/js/orderProportionHeadData.js
View file @
338a5dff
...
...
@@ -11,6 +11,7 @@ export const getHeadData = async (aux,callback) => {
let
resList
=
new
Array
();
await
getOrderFinishDataByCondition
(
aux
).
then
(
function
(
res
)
{
resList
=
dataFormatter
(
aux
,
res
.
data
);
console
.
log
(
resList
)
});
callback
(
resList
);
return
resList
...
...
@@ -20,17 +21,22 @@ export const getHeadData = async (aux,callback) => {
function
dataFormatter
(
aux
,
data
){
let
res
=
new
Array
();
let
otherBaseItem
;
if
(
aux
.
group_type
===
'01'
){
formatType01Data
(
aux
,
res
,
data
);
otherBaseItem
=
formatType01Data
(
aux
,
res
,
data
);
}
else
{
formatNotType01Data
(
aux
,
res
,
data
);
otherBaseItem
=
formatNotType01Data
(
aux
,
res
,
data
);
}
if
(
otherBaseItem
){
res
.
push
(
otherBaseItem
)
}
return
res
;
}
function
formatNotType01Data
(
aux
,
res
,
data
){
let
otherBaseItem
;
let
sum
=
{
title
:
"当日"
,
title
:
aux
.
time_type
===
'day'
?
'当日'
:
'截至当日'
,
data
:
[
{
title
:
'订单量'
,
...
...
@@ -86,12 +92,18 @@ function formatNotType01Data(aux,res, data){
sum
.
data
[
i
].
today
+=
item
.
data
[
i
].
today
;
sum
.
data
[
i
].
yesterday
+=
item
.
data
[
i
].
yesterday
;
}
if
(
key
===
'其他基地'
){
otherBaseItem
=
item
;
}
else
{
res
.
push
(
item
);
}
}
return
otherBaseItem
;
}
//转换领域细分数据
function
formatType01Data
(
aux
,
res
,
data
)
{
let
otherBaseItem
;
let
sum
=
{
title
:
"当日订单量(不含仓库)"
,
amount
:
0
,
...
...
@@ -119,11 +131,16 @@ function formatType01Data(aux,res, data) {
};
sum
.
amount
+=
data
[
key
].
cur_unit_weight
;
sum
.
hb
[
0
].
amount
+=
data
[
key
].
pre_unit_weight
;
if
(
key
===
'其他基地'
){
otherBaseItem
=
item
;
}
else
{
res
.
push
(
item
);
}
}
calcProportion
(
res
);
sum
.
amount
=
conver_amont
(
sum
.
amount
);
sum
.
hb
[
0
].
amount
=
conver_amont
(
sum
.
hb
[
0
].
amount
);
return
otherBaseItem
;
}
function
calcProportion
(
list
)
{
...
...
src/module/databoard/databoard/order-proportion.vue
View file @
338a5dff
...
...
@@ -17,14 +17,15 @@
<div
style=
"width: 60%; height: 100%; float:left; padding: 2% 2% 0 8%; line-height: 40px; display: flex; align-items: center;font-size: 16px;"
>
<table-column
style=
"float: left;width: 25%;"
:data=
"data.hb"
name=
"title"
/>
<table-column
style=
"float: left;width: 40%;"
:data=
"data.hb"
name=
"amount"
/>
<table-column
style=
"float: left;width: 35%;"
:data=
"data.hb"
name=
"rate"
cell-style-js=
"var res =
{color: 'rgb(
255, 51, 0)'}; if(data.indexOf('+') !== -1){res.color = 'rgb(51, 255, 102
)'} res;"/>
<table-column
style=
"float: left;width: 35%;"
:data=
"data.hb"
name=
"rate"
cell-style-js=
"var res =
{color: 'rgb(
51, 255, 102)'}; if(data.indexOf('+') !== -1){res.color = 'rgb(255, 51, 0
)'} res;"/>
</div>
</contrast-card>
</div>
<div
class=
"card-board"
v-if=
"currentBtn.subdivide !== '01'"
>
<contrast-card
v-for=
"data in currentHeadData"
style=
"height: 100%;width: 18%;"
:class=
"
{'selectCard': currentCard === data.key}" @click.native="selectCard(data)" :style="listCardStyle">
<!-- 标题-->
<div
style=
"width: 100%; height: 20%; float:left; padding: 2%; line-height: 28px; display: flex; align-items: center; font-size: 14px;"
>
<table-column
style=
"float: left;width: 80%;"
:data=
"[]"
name=
"title"
:title=
"data.title"
:title-formatter=
"value=> value+'(万元)'"
show-head
:title-style=
"
{'font-size': '18px','padding-left':'3%','white-space': 'nowrap',}"/>
<table-column
style=
"float: left;width: 80%;"
:data=
"[]"
name=
"title"
:title=
"data.title"
:title-formatter=
"value=> value+'(万元)'"
show-head
:title-style=
"
{'font-size': '18px','padding-left':'3%','white-space': 'nowrap',
'font-weight': 'bold',
}"/>
<table-column
style=
"float: left;width: 0;font-size: 24px;font-weight: bold;color: #5eeef4;text-align: center;"
:data=
"[]"
name=
"today"
/>
<table-column
style=
"float: left;width: 20%;"
:data=
"[]"
name=
"yesterday"
:title=
"dateTimeChoice[currentBtn.date]"
show-head
/>
</div>
...
...
@@ -48,7 +49,6 @@
import
TitleContentMark
from
"../components/layout/title-content-mark.vue"
;
import
TableColumn
from
"../components/table/table-column.vue"
;
import
ContrastCard
from
"../components/card/contrast-card.vue"
;
import
*
as
echarts
from
"echarts"
;
import
DisplayBoard
from
"../components/container/display-board.vue"
;
import
WinnersList
from
"../components/card/winners-list.vue"
;
import
LineBarChart
from
"../components/chart/line-bar-chart.vue"
;
...
...
@@ -62,7 +62,7 @@ export default {
components
:
{
LineBarChart
,
WinnersList
,
DisplayBoard
,
ContrastCard
,
TableColumn
,
TitleContentMark
},
data
()
{
return
{
today
:
moment
().
format
(
"yyyy-MM-DD"
)
,
today
:
'2022-06-26'
,
currentHeadData
:[],
currentDetailData
:[],
chart
:
null
,
...
...
@@ -96,10 +96,10 @@ export default {
getHeadData
({
cur_day
:
this
.
today
,
time_type
:
this
.
currentBtn
.
date
,
group_type
:
this
.
currentBtn
.
subdivide
},
(
res
)
=>
{
this
.
currentHeadData
=
res
;
if
(
type
&&
type
!==
"date"
){
//
if (type && type !== "date"){
this
.
currentCard
=
res
[
0
]?
res
[
0
].
key
:
null
;
this
.
chartTitle
=
res
[
0
]?(
res
[
0
].
title
+
'委托单位占比'
):
null
;
}
//
}
this
.
calcCardWidth
();
this
.
getDetailData
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment