From e5fc2d92b1036aabf9ffc2c9706ed401bd9735c8 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 09 九月 2021 18:14:29 +0800 Subject: [PATCH] 2021-09-09 --- src/tabviews/custom/components/share/normalTable/index.jsx | 32 ++++++++++++++++++++++++-------- 1 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx index 46eba22..b71831a 100644 --- a/src/tabviews/custom/components/share/normalTable/index.jsx +++ b/src/tabviews/custom/components/share/normalTable/index.jsx @@ -51,7 +51,7 @@ try { originVal = parseFloat(originVal) contrastVal = parseFloat(contrastVal) - } catch { + } catch (e) { originVal = NaN } @@ -62,7 +62,7 @@ try { originVal = parseFloat(originVal) contrastVal = parseFloat(contrastVal) - } catch { + } catch (e) { originVal = NaN } @@ -120,7 +120,7 @@ try { originVal = parseFloat(originVal) contrastVal = parseFloat(contrastVal) - } catch { + } catch (e) { originVal = NaN } @@ -131,7 +131,7 @@ try { originVal = parseFloat(originVal) contrastVal = parseFloat(contrastVal) - } catch { + } catch (e) { originVal = NaN } @@ -223,7 +223,7 @@ if (isNaN(content)) { content = '' } - } catch { + } catch (e) { content = '' } @@ -283,7 +283,7 @@ resProps.children = ( <div> - {photos.map((url, i) => ( + {photos && photos.map((url, i) => ( <Col key={i} span={cols}> <div className={'ant-mk-picture' + (scale ? ' scale' : '')} onClick={() => { if (!scale) return @@ -332,7 +332,7 @@ try { _param = window.btoa(_quary) - } catch { + } catch (e) { _param = window.btoa(window.encodeURIComponent(_quary)) } @@ -500,6 +500,7 @@ } componentDidMount () { + MKEmitter.addListener('mkCheckTopLine', this.mkCheckTopLine) MKEmitter.addListener('mkCheckAll', this.mkCheckAll) MKEmitter.addListener('resetTable', this.resetTable) } @@ -511,8 +512,23 @@ this.setState = () => { return } + MKEmitter.removeListener('mkCheckTopLine', this.mkCheckTopLine) MKEmitter.removeListener('mkCheckAll', this.mkCheckAll) MKEmitter.removeListener('resetTable', this.resetTable) + } + + mkCheckTopLine = (menuId) => { + const { MenuID, data, setting } = this.props + + if (MenuID !== menuId || !data || data.length === 0) return + + this.changedata(0) + this.setState({ selectedRowKeys: [0], activeIndex: 0 }) + this.props.chgSelectData([data[0]]) + + if (setting.$hasSyncModule) { + MKEmitter.emit('syncBalconyData', MenuID, [data[0]], data.length === 1) + } } mkCheckAll = (menuId, checked) => { @@ -594,7 +610,7 @@ _param.User_Name = sessionStorage.getItem('User_Name') _param.param = __param src = _url + window.btoa(window.encodeURIComponent(JSON.stringify(_param))) - } catch { + } catch (e) { console.warn('鑿滃崟鍙傛暟瑙f瀽閿欒锛�') } } else { -- Gitblit v1.8.0