From 920e94fc5483b081b3d43c86df8f56d838f2f14d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 06 一月 2024 22:07:15 +0800 Subject: [PATCH] 2024-01-06 --- src/tabviews/custom/components/card/double-data-card/index.jsx | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 42 insertions(+), 2 deletions(-) diff --git a/src/tabviews/custom/components/card/double-data-card/index.jsx b/src/tabviews/custom/components/card/double-data-card/index.jsx index eb2415e..6ae8f77 100644 --- a/src/tabviews/custom/components/card/double-data-card/index.jsx +++ b/src/tabviews/custom/components/card/double-data-card/index.jsx @@ -36,7 +36,7 @@ loading: false, // 鏁版嵁鍔犺浇鐘舵�� card: null, // 鍗$墖璁剧疆 data: [], // 鏁版嵁 - total: null, + total: 0, precards: [], nextcards: [], selected: 'false', @@ -170,6 +170,9 @@ pageOptions.push(size) pageOptions = pageOptions.sort((a, b) => a - b) } + if (_config.wrap.maxPageSize) { + pageOptions = pageOptions.filter(item => item <= _config.wrap.maxPageSize) + } } if (_config.wrap.zHeight) { @@ -229,6 +232,8 @@ if (config.setting.onload === 'true') { this.initExec() } + + this.autoExec() } shouldComponentUpdate (nextProps, nextState) { @@ -319,6 +324,25 @@ setTimeout(() => { this.loadData() }, config.setting.delay || 0) + } + } + + 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) } } @@ -522,7 +546,9 @@ if (!config.setting.supModule || config.setting.supModule !== MenuID) return if (id !== this.state.BID || id !== '') { this.setState({ BID: id, BData: data, pageIndex: 1 }, () => { - this.loadData() + if (!config.checkBid) { + this.loadData() + } }) } } @@ -1193,6 +1219,20 @@ subClass = opens.indexOf(item.key) > -1 ? 'mk-unfold' : 'mk-collapse' unfold = opens.indexOf(item.key) > -1 } + + if (!unfold && item.children.length > 5) { + return ( + <Col key={index} span={card.setting.width} style={card.wStyle}> + <div className={className} style={wrapStyle}> + <CardItem card={card} cards={config} data={item} onDoubleClick={() => this.onDoubleClick(item.key, subClass)} onClick={() => {this.changeCard(item.key, item, subClass)}}> + <span className="circle-select"></span> + {card.setting.controlIcon === 'left' ? <PlusSquareOutlined className={subClass} onClick={(e) => this.changeUnfold(e, item.key, subClass)}/> : null} + {card.setting.controlIcon === 'right' ? <UpOutlined className={subClass} onClick={(e) => this.changeUnfold(e, item.key, subClass)}/> : null} + </CardItem> + </div> + </Col> + ) + } } return ( -- Gitblit v1.8.0