From 2998f413a5e196e99df887787aa4b250cd9f3b78 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 24 十二月 2024 14:56:23 +0800 Subject: [PATCH] Merge branch 'positec' into dms --- src/tabviews/custom/components/interfaces/interItem/index.jsx | 29 +++++++++++++++++++---------- 1 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/tabviews/custom/components/interfaces/interItem/index.jsx b/src/tabviews/custom/components/interfaces/interItem/index.jsx index 87e0bd9..bd37fa6 100644 --- a/src/tabviews/custom/components/interfaces/interItem/index.jsx +++ b/src/tabviews/custom/components/interfaces/interItem/index.jsx @@ -1,4 +1,4 @@ -import {Component} from 'react' +import { Component } from 'react' import PropTypes from 'prop-types' import Api from '@/api' @@ -15,6 +15,7 @@ } loading = false + loadTimer = null state = { BID: '' @@ -39,9 +40,7 @@ } if (config.setting.onload !== 'false') { - setTimeout(() => { - this.loadData() - }, config.setting.delay) + this.loadData() } else { MKEmitter.addListener('initFinish', this.initFinish) } @@ -84,9 +83,7 @@ if (config.MenuID !== MenuID) return if (config.setting.onload === 'false') { - setTimeout(() => { - this.loadData() - }, config.setting.delay) + this.loadData() } } @@ -107,13 +104,25 @@ this.loadData() } - async loadData () { + loadData = () => { + const { config } = this.props + + this.loadTimer && clearTimeout(this.loadTimer) + + this.loadTimer = setTimeout(() => { + this.execLoadData() + }, config.setting.delay) + } + + async execLoadData () { const { config } = this.props const { BID } = this.state if (config.setting.supModule && !BID) { - MKEmitter.emit('mkPublicData', config.uuid, { $$empty: true, $$uuid: '' }) - MKEmitter.emit('resetSelectLine', config.uuid, '', { $$empty: true, $$uuid: '' }) + setTimeout(() => { + MKEmitter.emit('mkPublicData', config.uuid, { $$empty: true, $$uuid: '' }) + MKEmitter.emit('resetSelectLine', config.uuid, '', { $$empty: true, $$uuid: '' }) + }, 20) this.loading = false return } -- Gitblit v1.8.0