From af6486b3629d23e426ce85b87dbc20dfa15b1afe Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 07 十一月 2022 18:50:27 +0800 Subject: [PATCH] 2022-11-07 --- src/tabviews/custom/components/code/sand-box/index.jsx | 26 ++++++++++++++++++-------- 1 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/tabviews/custom/components/code/sand-box/index.jsx b/src/tabviews/custom/components/code/sand-box/index.jsx index e7c6a74..4863e1f 100644 --- a/src/tabviews/custom/components/code/sand-box/index.jsx +++ b/src/tabviews/custom/components/code/sand-box/index.jsx @@ -10,11 +10,9 @@ class SandBoxComponent extends Component { static propTpyes = { - BID: PropTypes.any, // 鐖剁骇Id data: PropTypes.array, // 缁熶竴鏌ヨ鏁版嵁 config: PropTypes.object, // 缁勪欢閰嶇疆淇℃伅 mainSearch: PropTypes.any, // 澶栧眰鎼滅储鏉′欢 - menuType: PropTypes.any, // 鑿滃崟绫诲瀷 } state = { @@ -27,13 +25,25 @@ } UNSAFE_componentWillMount () { - const { data, initdata, BID } = this.props + const { data, initdata } = this.props let _config = fromJS(this.props.config).toJS() let _data = {} let _sync = false + + let BID = '' + let BData = '' + + if (_config.setting.supModule) { + BData = window.GLOB.CacheData.get(_config.setting.supModule) + } else { + BData = window.GLOB.CacheData.get(_config.$pageId) + } + if (BData) { + BID = BData.$BID || '' + } - if (_config.setting && _config.wrap.datatype !== 'static') { + if (_config.wrap.datatype !== 'static') { _sync = _config.setting.sync === 'true' if (_sync && data) { @@ -108,7 +118,7 @@ this.setState({sync: false, data: _data}, () => { this.renderView() }) - } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { + } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { this.setState({}, () => { this.loadData() }) @@ -124,7 +134,7 @@ } async loadData () { - const { mainSearch, menuType } = this.props + const { mainSearch } = this.props const { config, arr_field, BID } = this.state if (config.wrap.datatype === 'static') { @@ -153,7 +163,7 @@ }) let _orderBy = config.setting.order || '' - let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, 1, 1, BID, menuType) + let param = UtilsDM.getQueryDataParams(config.setting, arr_field, searches, _orderBy, 1, 1, BID) let result = await Api.genericInterface(param) if (result.status) { @@ -208,7 +218,7 @@ const { config, loading, html } = this.state return ( - <div className="custom-sand-box" style={{...config.style}}> + <div className="custom-sand-box" id={'anchor' + config.uuid} style={{...config.style}}> {loading ? <div className="loading-mask"> <div className="ant-spin-blur"></div> -- Gitblit v1.8.0