From 6092c17b4571e1082d1272fa3104c780af66453d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 17 十二月 2023 11:10:19 +0800 Subject: [PATCH] 2023-12-17 --- src/tabviews/custom/components/card/double-data-card/index.jsx | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/src/tabviews/custom/components/card/double-data-card/index.jsx b/src/tabviews/custom/components/card/double-data-card/index.jsx index e65fe19..eabc964 100644 --- a/src/tabviews/custom/components/card/double-data-card/index.jsx +++ b/src/tabviews/custom/components/card/double-data-card/index.jsx @@ -229,6 +229,8 @@ if (config.setting.onload === 'true') { this.initExec() } + + this.autoExec() } shouldComponentUpdate (nextProps, nextState) { @@ -322,6 +324,25 @@ } } + autoExec = (times) => { + const { config } = this.state + + if (!config.wrap.autoExec) return + + let btn = document.getElementById('button' + config.wrap.autoExec) + + this.autoTimer && clearTimeout(this.autoTimer) + + if (btn) { + MKEmitter.emit('triggerBtnId', config.wrap.autoExec, []) + } else if (!times || times < 20) { + times = times ? times + 1 : 1 + this.autoTimer = setTimeout(() => { + this.autoExec(times) + }, 1000) + } + } + searchRefresh = (searchId) => { const { config } = this.state -- Gitblit v1.8.0