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
9799e376
Commit
9799e376
authored
Sep 25, 2023
by
王礼鸿 Baimax Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
饼图和占比定时刷新
parent
ddb6e597
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
16 deletions
+47
-16
order-proportion.vue
src/module/databoard/databoard/order-proportion.vue
+18
-8
index.vue
src/module/databoard/index.vue
+12
-0
index.vue
src/module/index/index.vue
+17
-8
No files found.
src/module/databoard/databoard/order-proportion.vue
View file @
9799e376
...
...
@@ -39,7 +39,7 @@
<display-board
class=
"trade_left"
title=
"订单量占比"
title_size=
"large"
>
<winners-list
style=
"height: 96%;overflow: auto;"
id=
"ar_company_list"
:rows=
"currentDetailData"
:show-icon=
"false"
:columns-style=
"
{'title':{'width':'50%'},'订单量(万吨)':{'width':'30%'}}" :col-formatter="{'1':(v)=>v+'%'}"/>
</display-board>
<line-bar-chart
style=
"width: 75%;height: 100%;"
:data=
"currentDetailData"
x=
"company"
y=
"value"
:title=
"chartTitle"
:formatter=
"formatter"
:line-formatter=
"lineFormatter"
bar-formatter=
"
{@value}万元"/>
<line-bar-chart
ref=
"chart"
style=
"width: 75%;height: 100%;"
:data=
"currentDetailData"
x=
"company"
y=
"value"
:title=
"chartTitle"
:formatter=
"formatter"
:line-formatter=
"lineFormatter"
bar-formatter=
"
{@value}万元"/>
</div>
</div>
</
template
>
...
...
@@ -95,7 +95,7 @@ export default {
getHeadData
({
cur_day
:
this
.
today
,
time_type
:
this
.
currentBtn
.
date
,
group_type
:
this
.
currentBtn
.
subdivide
},
(
res
)
=>
{
this
.
currentHeadData
=
res
;
if
(
type
!==
"date"
){
if
(
type
&&
type
!==
"date"
){
this
.
currentCard
=
res
[
0
]?
res
[
0
].
key
:
null
;
this
.
chartTitle
=
res
[
0
]?(
res
[
0
].
title
+
'委托单位占比'
):
null
;
}
...
...
@@ -128,16 +128,26 @@ export default {
},
calcCardWidth
(){
this
.
listCardStyle
.
width
=
"calc((100% - 4rem) / "
+
this
.
currentHeadData
.
length
+
")"
;
}
},
refreshData
(){
this
.
getHeadData
();
},
},
mounted
()
{
this
.
changeDimension
();
setTimeout
(()
=>
{
let
chartDom
=
this
.
$refs
.
chart
;
this
.
chart
=
echarts
.
init
(
chartDom
);
this
.
chart
.
setOption
(
this
.
chartOption
);
},
500
)
},
watch
:{
countDown
(
n
,
o
){
if
(
n
===
1
){
this
.
refreshData
();
}
},
},
props
:{
countDown
:{
type
:
Number
}
}
}
</
script
>
<
style
scoped
>
...
...
src/module/databoard/index.vue
View file @
9799e376
...
...
@@ -528,6 +528,18 @@ export default {
},
beforeDestroy
()
{
window
.
removeEventListener
(
"resize"
,
this
.
resizeChart
);
},
watch
:{
countDown
(
n
,
o
){
if
(
n
===
1
){
this
.
refreshData
();
}
},
},
props
:{
countDown
:{
type
:
Number
}
}
};
</
script
>
...
...
src/module/index/index.vue
View file @
9799e376
...
...
@@ -3,15 +3,15 @@
<div
class=
"head"
@
click=
"goIndex"
>
<div
class=
"text_left"
>
<input
class=
"btn"
type=
"button"
value=
"返回上级"
v-if=
"$route.fullPath !== '/index'"
@
click=
"goIndex"
>
<span>
2023-08-01
</span>
<span>
17:18:29
</span>
<span>
星期三
</span>
<span>
{{
currentDate
}}
</span>
<span>
{{
currentTime
}}
</span>
<span>
{{
currentWeek
}}
</span>
</div>
<div
class=
"text_right"
>
<span>
刷新时间:
{{
countDown
}}
s
</span>
</div>
</div>
<router-view
style=
"height: 90%"
v-if=
"isRouterAlive"
></router-view>
<router-view
style=
"height: 90%"
v-if=
"isRouterAlive"
:countDown=
"countDown"
></router-view>
</div>
</
template
>
...
...
@@ -24,14 +24,17 @@ export default {
name
:
'app'
,
data
()
{
return
{
countDown
:
10000
,
countDown
:
10
,
currentDate
:
null
,
currentTime
:
null
,
currentWeek
:
null
,
isRouterAlive
:
true
,
countDownTimer
:
null
,
week
:
[
'星期天'
,
'星期一'
,
'星期二'
,
'星期三'
,
'星期四'
,
'星期五'
],
}
},
methods
:
{
goIndex
()
{
console
.
log
(
this
.
$router
)
this
.
$router
.
push
({
path
:
'/'
})
},
reload
()
{
...
...
@@ -40,15 +43,21 @@ export default {
this
.
isRouterAlive
=
true
})
},
setCurrentDateTime
(){
let
now
=
new
Date
();
this
.
currentDate
=
now
.
getFullYear
()
+
"-"
+
now
.
getMonth
()
+
"-"
+
now
.
getDate
();
this
.
currentTime
=
now
.
getHours
()
+
":"
+
now
.
getMinutes
()
+
":"
+
now
.
getSeconds
();
this
.
currentWeek
=
this
.
week
[
now
.
getDay
()];
},
},
mounted
()
{
// 倒计时器
this
.
countDownTimer
=
setInterval
(()
=>
{
this
.
countDown
--
if
(
this
.
countDown
<=
0
)
{
// this.reload()
this
.
countDown
=
10
this
.
countDown
=
10
;
}
this
.
setCurrentDateTime
();
},
1000
)
},
beforeDestroy
()
{
...
...
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