From 8d66ff34fae5b048a6b7923cc75d34f13a08be9d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 02 八月 2022 11:42:43 +0800 Subject: [PATCH] Merge branch 'develop' --- src/tabviews/custom/components/chart/antv-dashboard/index.jsx | 25 ++++++++++++++++--------- 1 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/tabviews/custom/components/chart/antv-dashboard/index.jsx b/src/tabviews/custom/components/chart/antv-dashboard/index.jsx index dd536e5..a20be1e 100644 --- a/src/tabviews/custom/components/chart/antv-dashboard/index.jsx +++ b/src/tabviews/custom/components/chart/antv-dashboard/index.jsx @@ -56,7 +56,6 @@ data: PropTypes.array, // 缁熶竴鏌ヨ鏁版嵁 config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 - menuType: PropTypes.any, // 鑿滃崟绫诲瀷 } state = { @@ -204,22 +203,30 @@ }) return } else if (result.run_type) { - this.setState({timer}) + let repeats = config.timerRepeats || 0 + this.setState({timer, repeats}) this.timer = setTimeout(() => { - this.timerTask() + this.timerTask(repeats) }, timer) } }) } - timerTask = () => { - const { timer } = this.state + timerTask = (times) => { + const { timer, repeats } = this.state if (!timer) return this.loadData(true) - + + if (repeats) { + times = times - 1 + if (times <= 0) { + clearTimeout(this.timer) + return + } + } this.timer = setTimeout(() => { - this.timerTask() + this.timerTask(times) }, timer) } @@ -251,7 +258,7 @@ } async loadData (hastimer) { - const { mainSearch, menuType } = this.props + const { mainSearch } = this.props const { config, arr_field, BID } = this.state if (config.setting.supModule && !BID) { // BID 涓嶅瓨鍦ㄦ椂锛屼笉鍋氭煡璇� @@ -277,7 +284,7 @@ } let _orderBy = config.setting.order || '' - let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, '', '', BID, menuType) + let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, '', '', BID) let result = await Api.genericInterface(param) if (result.status) { -- Gitblit v1.8.0