Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bdc
/
bdcjg-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
45fc5511
authored
2023-07-04 13:48:58 +0800
by
renchao@pashanhoo.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style:首页增加定时器
1 parent
59e5c23d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
16 deletions
src/components/Echart/Columnarsmat/index.vue
src/components/Echart/Rose/index.vue
src/components/Echart/Columnarsmat/index.vue
View file @
45fc551
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-07-04 13:48:00
-->
<
template
>
<!-- 登记类型总量 -->
<!-- 登记类型总量 -->
<Chart
:cdata=
"cdata"
/>
</
template
>
<
script
>
import
Chart
from
"./Chart"
;
import
work
from
"@/api/work"
;
export
default
{
import
Chart
from
"./Chart"
;
import
work
from
"@/api/work"
;
export
default
{
data
()
{
return
{
cdata
:
{
timer
:
null
,
category
:
[],
lineData
:
[],
},
...
...
@@ -19,7 +25,10 @@ export default {
Chart
,
},
mounted
()
{
this
.
getDjlxtotal
();
this
.
getDjlxtotal
()
this
.
timer
=
setInterval
(()
=>
{
this
.
getDjlxtotal
()
},
10000
)
// 10s
},
methods
:
{
getDjlxtotal
()
{
...
...
@@ -42,8 +51,11 @@ export default {
}
});
}
},
destroyed
()
{
clearInterval
(
this
.
timer
)
}
};
};
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
...
...
src/components/Echart/Rose/index.vue
View file @
45fc551
<!--
* @Author: xiaomiao 1158771342@qq.com
* @Date: 2023-03-09 15:24:53
* @LastEditors:
xiaomiao 1158771342@qq.com
* @LastEditTime: 2023-0
3-16 15:58:03
* @LastEditors:
Please set LastEditors
* @LastEditTime: 2023-0
7-04 13:45:56
* @FilePath: \上报\bdcjg-web\src\components\Echart\Rose\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
...
...
@@ -18,6 +18,7 @@
export
default
{
data
()
{
return
{
timer
:
null
,
cdata
:
[],
getdata
:
[],
};
...
...
@@ -25,13 +26,17 @@
components
:
{
Chart
,
},
created
()
{
this
.
addhousetotal
()
this
.
timer
=
setInterval
(()
=>
{
this
.
addhousetotal
()
},
10000
)
// 10s
},
mounted
()
{
this
.
addhousetotal
();
window
.
addEventListener
(
"resize"
,
()
=>
{
this
.
cdata
=
[];
this
.
addhousetotal
();
});
},
methods
:
{
async
addhousetotal
()
{
...
...
@@ -53,12 +58,9 @@
console
.
log
(
"error"
,
error
);
}
}
},
// 处理数据方法
setadat
(
delarr
)
{
this
.
cdata
=
delarr
.
splice
(
0
,
6
);
let
sum
=
0
for
(
var
i
=
0
;
i
<
delarr
.
length
;
i
++
)
{
...
...
@@ -73,9 +75,10 @@
},
// 排序方法
up
(
x
,
y
)
{
return
y
.
value
-
x
.
value
}
},
destroyed
()
{
clearInterval
(
this
.
timer
)
}
}
};
</
script
>
<
style
lang=
"scss"
scoped
></
style
>
...
...
Please
register
or
sign in
to post a comment