From f3d4db769ba9b51b799d981511a710fd443d0e08 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 21 四月 2025 12:18:03 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/tabviews/custom/components/iframe/index.jsx | 60 ++++++++++++++++++++++++------------------------------------ 1 files changed, 24 insertions(+), 36 deletions(-) diff --git a/src/tabviews/custom/components/iframe/index.jsx b/src/tabviews/custom/components/iframe/index.jsx index 02c9a4d..1178319 100644 --- a/src/tabviews/custom/components/iframe/index.jsx +++ b/src/tabviews/custom/components/iframe/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Input, Modal, notification, Empty, Spin } from 'antd' +import { Input, Empty, Spin } from 'antd' import Api from '@/api' import UtilsDM from '@/utils/utils-datamanage.js' @@ -43,6 +43,12 @@ } if (_config.wrap.datatype === 'dynamic') { + _config.setting.onload = _config.setting.sync === 'true' ? 'false' : _config.setting.onload || 'true' + + if (_config.setting.supModule && !BID) { + _config.setting.onload = 'false' + } + if (_config.setting.sync === 'true' && window.GLOB.SyncData.has(_config.dataName)) { _data = window.GLOB.SyncData.get(_config.dataName) || [] _data = _data[0] || {$$empty: true} @@ -67,14 +73,7 @@ linkUrl: linkUrl, data: _data, BID: BID || '', - config: _config, - arr_field: _config.columns.map(col => col.field).join(','), - }, () => { - if (_config.wrap.datatype === 'dynamic' && config.setting.sync !== 'true' && _config.setting.onload === 'true') { - setTimeout(() => { - this.loadData() - }, _config.setting.delay || 0) - } + config: _config }) } @@ -98,6 +97,8 @@ node && node.select && node.select() }, 200) } + + this.initExec() } shouldComponentUpdate (nextProps, nextState) { @@ -116,6 +117,16 @@ MKEmitter.removeListener('searchRefresh', this.searchRefresh) MKEmitter.removeListener('resetSelectLine', this.resetParentParam) MKEmitter.removeListener('transferSyncData', this.transferSyncData) + } + + initExec = () => { + const { config } = this.state + + if (config.wrap.datatype === 'dynamic' && config.setting.onload === 'true') { + setTimeout(() => { + this.loadData() + }, config.setting.delay || 0) + } } transferSyncData = (syncId) => { @@ -166,7 +177,7 @@ } async loadData () { - const { config, arr_field, BID } = this.state + const { config, BID } = this.state if (config.wrap.datatype === 'static') { this.setState({ @@ -190,7 +201,7 @@ } let _orderBy = config.setting.order || '' - let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, 1, 1, BID) + let param = UtilsDM.getQueryDataParams(config.setting, searches, _orderBy, 1, 1, BID) let result = await Api.genericInterface(param) if (result.status) { @@ -205,32 +216,9 @@ data: _data }) - if (result.message) { - if (result.ErrCode === 'Y') { - Modal.success({ - title: result.message - }) - } else if (result.ErrCode === 'S') { - notification.success({ - top: 92, - message: result.message, - duration: 2 - }) - } - } + UtilsDM.querySuccess(result) } else { - if (!result.message) return - if (result.ErrCode === 'N') { - Modal.error({ - title: result.message, - }) - } else if (result.ErrCode !== '-2') { - notification.error({ - top: 92, - message: result.message, - duration: 10 - }) - } + UtilsDM.queryFail(result) } } -- Gitblit v1.8.0