From 06a670976e2145a10ea05207041d3cf3164cd380 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 03 二月 2024 18:13:25 +0800 Subject: [PATCH] Merge branch 'positec' into dms --- src/tabviews/custom/components/table/base-table/index.jsx | 29 ++++++++++++++++++++++++++--- 1 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/tabviews/custom/components/table/base-table/index.jsx b/src/tabviews/custom/components/table/base-table/index.jsx index 0693483..7c86fca 100644 --- a/src/tabviews/custom/components/table/base-table/index.jsx +++ b/src/tabviews/custom/components/table/base-table/index.jsx @@ -137,7 +137,7 @@ let _orderBy = orderBy || setting.order let param = UtilsDM.getQueryDataParams(setting, searches, _orderBy, pageIndex, pageSize, BID) - let result = await Api.genericInterface(param) + let result = await Api.genericInterface(param, setting.js_script) if (result.status) { if (repage === 'false' && result.data && result.data.length === 0 && result.total > 0 && pageIndex > 1) { let _pageIndex = Math.ceil(result.total / pageSize) @@ -566,8 +566,10 @@ BID: id, BData: data }, () => { - this.loadmaindata(true, 'true') - this.getStatFieldsValue() + if (!setting.checkBid) { + this.loadmaindata(true, 'true') + this.getStatFieldsValue() + } }) } } @@ -606,6 +608,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) + } + } + shouldComponentUpdate (nextProps, nextState) { return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) } @@ -621,6 +642,8 @@ if (config.setting.useMSearch) { MKEmitter.addListener('searchRefresh', this.searchRefresh) } + + this.autoExec() } /** -- Gitblit v1.8.0