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
53bbe868
Commit
53bbe868
authored
Sep 21, 2023
by
王礼鸿 Baimax Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
饼图代码提交
parent
bedfa15c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
80 additions
and
51 deletions
+80
-51
apiList.js
src/module/api/apiList.js
+2
-1
ring-pie-chart.vue
src/module/databoard/components/chart/ring-pie-chart.vue
+32
-29
api.js
src/module/databoard/databoard/js/api.js
+0
-12
indexPieData.js
src/module/databoard/databoard/js/indexPieData.js
+29
-0
index.vue
src/module/databoard/index.vue
+17
-9
No files found.
src/module/api/apiList.js
View file @
53bbe868
...
@@ -63,5 +63,6 @@ export const arCompanyMonthlyBar = (company) => fetch("/api/query/dash_board/act
...
@@ -63,5 +63,6 @@ export const arCompanyMonthlyBar = (company) => fetch("/api/query/dash_board/act
// 开票月份 应收账款(结算单位)
// 开票月份 应收账款(结算单位)
export
const
arMonthlyCompanyBar
=
(
month
)
=>
fetch
(
"/api/query/dash_board/action/get_ar_monthly_company_bar"
,
{
aux
:
{
month
:
month
}},
"POST"
)
export
const
arMonthlyCompanyBar
=
(
month
)
=>
fetch
(
"/api/query/dash_board/action/get_ar_monthly_company_bar"
,
{
aux
:
{
month
:
month
}},
"POST"
)
// export const transportTypeFinishPie = () => fetch("/api/query/dash_board/action/get_order_finish_data_by_transport_type_day", {}, "POST")
export
const
transportTypeOrderFinishPie
=
(
date
)
=>
fetch
(
"/api/query/dash_board/action/get_order_finish_data_by_transport_type_day"
,
{
aux
:
{
"cur_day"
:
date
}},
"POST"
)
export
const
customerOrderFinishPie
=
(
date
)
=>
fetch
(
"/api/query/dash_board/action/get_order_finish_data_by_customer_day"
,
{
aux
:
{
"cur_day"
:
date
}},
"POST"
)
src/module/databoard/components/chart/ring-pie-chart.vue
View file @
53bbe868
...
@@ -12,44 +12,40 @@ export default {
...
@@ -12,44 +12,40 @@ export default {
tooltip
:
{
tooltip
:
{
trigger
:
'item'
trigger
:
'item'
},
},
series
:
[
series
:
{
{
name
:
this
.
name
,
name
:
this
.
name
,
type
:
'pie'
,
type
:
'pie'
,
radius
:
[
'40%'
,
'70%'
],
radius
:
[
'40%'
,
'70%'
],
avoidLabelOverlap
:
false
,
avoidLabelOverlap
:
false
,
label
:
{
show
:
true
,
// position: 'center',
fontSize
:
12
,
color
:
'#5eeef4'
,
formatter
(
param
)
{
return
param
.
name
+
'
\
r
\
n'
+
param
.
value
}
},
emphasis
:
{
label
:
{
label
:
{
show
:
true
,
show
:
true
,
// position: 'center',
fontSize
:
12
,
fontSize
:
12
,
fontWeight
:
'bold'
,
color
:
'#5eeef4'
,
color
:
'#5eeef4'
,
formatter
(
param
)
{
}
return
param
.
name
+
'
\
r
\
n'
+
param
.
value
},
}
data
:
this
.
data
},
}
emphasis
:
{
label
:
{
show
:
true
,
fontSize
:
12
,
fontWeight
:
'bold'
,
color
:
'#5eeef4'
,
}
},
data
:
this
.
data
}
]
},
},
chart
:
null
,
chart
:
null
,
}
}
},
},
watch
:
{
watch
:
{
data
(
newValue
,
oldValue
){
data
(
n
,
o
){
this
.
option
.
data
=
newValue
;
this
.
refresh
();
this
.
chart
.
setOption
(
this
.
option
);
},
},
name
(
newName
,
oldName
){
name
(
n
,
o
){
this
.
option
.
series
.
name
=
newName
;
this
.
refresh
();
this
.
chart
.
setOption
(
this
.
option
);
}
}
},
},
methods
:
{
methods
:
{
...
@@ -57,13 +53,20 @@ export default {
...
@@ -57,13 +53,20 @@ export default {
if
(
this
.
chart
)
{
if
(
this
.
chart
)
{
this
.
chart
.
resize
();
this
.
chart
.
resize
();
}
}
},
refresh
(){
this
.
option
.
series
.
data
=
this
.
data
;
this
.
option
.
series
.
name
=
this
.
name
;
if
(
this
.
chart
){
this
.
chart
.
setOption
(
this
.
option
);
}
}
}
},
},
mounted
()
{
mounted
()
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
let
chartDom
=
this
.
$refs
.
chart
;
let
chartDom
=
this
.
$refs
.
chart
;
this
.
chart
=
echarts
.
init
(
chartDom
);
this
.
chart
=
echarts
.
init
(
chartDom
);
this
.
chart
.
setOption
(
this
.
option
);
this
.
refresh
(
);
window
.
addEventListener
(
'resize'
,
this
.
resizeChart
);
window
.
addEventListener
(
'resize'
,
this
.
resizeChart
);
},
500
)
},
500
)
},
},
...
...
src/module/databoard/databoard/js/api.js
deleted
100644 → 0
View file @
bedfa15c
// import {transportTypeFinishPie} from '../../../api/apiList';
//
// export const getTransportTypeFinishPie = (month) => {
// var data = transportTypeFinishPie();
// var res = {};
// console.log(data);
// console.log("data");
// }
//
// export const refreshData = () => {
// getTransportTypeFinishPie();
// }
src/module/databoard/databoard/js/indexPieData.js
0 → 100644
View file @
53bbe868
import
{
customerOrderFinishPie
,
transportTypeOrderFinishPie
}
from
'../../../api/apiList'
;
export
const
getTransportTypeOrderFinishPie
=
async
(
callback
,
date
)
=>
{
let
choiceMap
=
{
'10'
:
'汽运'
,
'20'
:
'铁运'
,
'30'
:
'水运'
,
'50'
:
'码头/仓库'
,
}
let
resList
=
new
Array
();
await
transportTypeOrderFinishPie
(
date
).
then
(
function
(
res
)
{
for
(
let
key
in
choiceMap
)
{
resList
.
push
({
name
:
choiceMap
[
key
],
value
:
res
.
data
[
key
].
cur_unit_weight
});
}
});
callback
(
resList
);
return
resList
}
export
const
getCustomerOrderFinishPie
=
async
(
callback
,
date
)
=>
{
let
resList
=
new
Array
();
await
customerOrderFinishPie
(
date
).
then
(
function
(
res
)
{
for
(
let
key
in
res
.
data
)
{
resList
.
push
({
name
:
key
,
value
:
res
.
data
[
key
].
cur_unit_weight
});
}
});
callback
(
resList
);
return
resList
}
src/module/databoard/index.vue
View file @
53bbe868
<
template
>
<
template
>
<div
class=
"main"
>
<div
class=
"main"
@
click=
"log()"
>
<div
class=
"middle"
>
<div
class=
"middle"
>
<display-board
class=
"trade_left"
title=
"营业情况"
>
<display-board
class=
"trade_left"
title=
"营业情况"
>
<div
<div
...
@@ -133,8 +133,8 @@
...
@@ -133,8 +133,8 @@
</div>
</div>
<display-board
class=
"trade_right"
title=
"当日订单量占比"
>
<display-board
class=
"trade_right"
title=
"当日订单量占比"
>
<div
style=
"height: 100%; display: flex; flex-direction: column; justify-content: space-around; padding: 0 1rem 0 1rem;"
>
<div
style=
"height: 100%; display: flex; flex-direction: column; justify-content: space-around; padding: 0 1rem 0 1rem;"
>
<ring-pie-chart
ref=
"transportTypeChart"
style=
"width: 100%;height: 50%;
"
name=
"运输类型占比"
:data=
"mockData.drddlzb.transportTyp
e"
@
click
.
native=
"routerTo('/order-proportion')"
/>
<ring-pie-chart
ref=
"transportTypeChart"
style=
"width: 100%;height: 50%;
z-index: 999"
name=
"运输类型占比"
:data=
"transportTypeOrderFinishPi
e"
@
click
.
native=
"routerTo('/order-proportion')"
/>
<ring-pie-chart
ref=
"customerChart"
style=
"width: 100%;height: 50%;"
name=
"公司占比"
:data=
"
mockData.drddlzb.customer
"
@
click
.
native=
"routerTo('/order-proportion')"
/>
<ring-pie-chart
ref=
"customerChart"
style=
"width: 100%;height: 50%;"
name=
"公司占比"
:data=
"
customerOrderFinishPie
"
@
click
.
native=
"routerTo('/order-proportion')"
/>
</div>
</div>
</display-board>
</display-board>
</div>
</div>
...
@@ -150,10 +150,9 @@ import WinnersList from "./components/card/winners-list.vue";
...
@@ -150,10 +150,9 @@ import WinnersList from "./components/card/winners-list.vue";
import
TitleContentMark
from
"./components/layout/title-content-mark.vue"
;
import
TitleContentMark
from
"./components/layout/title-content-mark.vue"
;
import
TableColumn
from
"./components/table/table-column.vue"
;
import
TableColumn
from
"./components/table/table-column.vue"
;
import
RingPieChart
from
"./components/chart/ring-pie-chart.vue"
;
import
RingPieChart
from
"./components/chart/ring-pie-chart.vue"
;
import
{
calc_hb_str
,
calc_tb_str
,
conver_amont
}
from
"../util/util"
;
import
{
arSummaryBar
,
arCompanyList
,
getBusinessConditionDatas
,
customerOrderFinishPie
}
from
"../api/apiList"
import
{
arSummaryBar
,
arCompanyList
,
getBusinessConditionDatas
}
from
"../api/apiList"
import
{
calc_hb_str
,
calc_tb_str
,
conver_amont
}
from
"../utils/numUtil"
;
import
{
calc_hb_str
,
calc_tb_str
,
conver_amont
}
from
"../utils/numUtil"
;
// import {refreshData} from "./databoard/js/api
";
import
{
getTransportTypeOrderFinishPie
,
getCustomerOrderFinishPie
}
from
"./databoard/js/indexPieData
"
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -403,13 +402,19 @@ export default {
...
@@ -403,13 +402,19 @@ export default {
"成本"
:
"/turnover-detail"
,
"成本"
:
"/turnover-detail"
,
"毛利"
:
"/turnover-detail"
,
"毛利"
:
"/turnover-detail"
,
},
},
dataset
:{},
transportTypeOrderFinishPie
:[],
customerOrderFinishPie
:[],
arCompanyList
:[],
charts
:
{}
charts
:
{}
}
}
},
},
methods
:
{
methods
:
{
log
(){
},
cellStyleFunction
(
data
)
{
cellStyleFunction
(
data
)
{
let
res
=
{
color
:
'#33ff66'
};
let
res
=
{
color
:
'#33ff66'
};
console
.
log
(
data
+
":"
+
data
.
indexOf
(
'+'
))
//
console.log(data + ":" + data.indexOf('+'))
if
(
data
.
indexOf
(
'-'
)
!==
-
1
)
{
if
(
data
.
indexOf
(
'-'
)
!==
-
1
)
{
res
.
color
=
'#ff3300'
res
.
color
=
'#ff3300'
}
}
...
@@ -476,8 +481,11 @@ export default {
...
@@ -476,8 +481,11 @@ export default {
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
console
.
log
(
err
);
console
.
log
(
err
);
});
});
},
refreshData
(){
getTransportTypeOrderFinishPie
(
res
=>
this
.
transportTypeOrderFinishPie
=
res
,
"2022-06-26"
);
getCustomerOrderFinishPie
(
res
=>
this
.
customerOrderFinishPie
=
res
,
"2022-06-26"
);
}
}
},
},
mounted
()
{
mounted
()
{
this
.
showBusinessConditionDatas
();
this
.
showBusinessConditionDatas
();
...
@@ -486,7 +494,7 @@ export default {
...
@@ -486,7 +494,7 @@ export default {
},
500
)
},
500
)
this
.
getArSummaryBar
();
this
.
getArSummaryBar
();
this
.
getArCompanyList
();
this
.
getArCompanyList
();
// refreshData();
this
.
refreshData
()
},
},
beforeDestroy
()
{
beforeDestroy
()
{
window
.
removeEventListener
(
"resize"
,
this
.
resizeChart
);
window
.
removeEventListener
(
"resize"
,
this
.
resizeChart
);
...
...
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