Skip to content

Commit 718de6c

Browse files
committed
feat: add dingtalk click
1 parent c161b49 commit 718de6c

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/components/datav/DigitalFlop.js

+11-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ let wechatFollow = 0
99
let wechatRead = 0
1010
let wechatServeYesterday = 0
1111
let wechatServeToday = 0
12+
let dingWidgetClick = 0
1213

1314
function getData() {
1415
return [
@@ -65,17 +66,17 @@ function getData() {
6566
unit: '次',
6667
},
6768
{
68-
title: '隧道',
69+
title: '钉钉组件点击',
6970
number: {
70-
number: [randomExtend(5, 10)],
71+
number: [dingWidgetClick],
7172
content: '{nt}',
7273
textAlign: 'right',
7374
style: {
7475
fill: '#f46827',
7576
fontWeight: 'bold',
7677
},
7778
},
78-
unit: '',
79+
unit: '',
7980
},
8081
{
8182
title: '服务区',
@@ -149,16 +150,19 @@ export default () => {
149150
getWechatArticleReadNum()
150151
getWechatServiceTimesYesterday()
151152
getWechatServiceTimesToday()
153+
getDingTalkWidgetMetric()
152154

153155
const timer = setInterval(createData, 3000)
154156

155157
const wechatTimer = setInterval(getWechatFollowNum, 30000)
156158
const wechatServiceTimer = setInterval(getWechatServiceTimesToday, 30000)
159+
const dingTalkTimer = setInterval(getDingTalkWidgetMetric, 30000)
157160

158161
return () => {
159162
clearInterval(timer)
160163
clearInterval(wechatTimer)
161164
clearInterval(wechatServiceTimer)
165+
clearInterval(dingTalkTimer)
162166
}
163167
}, [])
164168

@@ -202,3 +206,7 @@ function getWechatServiceTimesToday() {
202206
r => (wechatServeToday = Number(r))
203207
)
204208
}
209+
210+
function getDingTalkWidgetMetric() {
211+
httpGet('https://news.hduhelp.com/subscription/v1/ding/metric').then(r => (dingWidgetClick = r))
212+
}

0 commit comments

Comments
 (0)