From 602e780eb5a67a9dcefb9f7e96d51b016f17bc02 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 09 三月 2023 19:16:16 +0800 Subject: [PATCH] 2023-03-09 --- src/tabviews/custom/components/card/double-data-card/index.jsx | 18 +++++++++++++++++- 1 files changed, 17 insertions(+), 1 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 dd92190..3599a92 100644 --- a/src/tabviews/custom/components/card/double-data-card/index.jsx +++ b/src/tabviews/custom/components/card/double-data-card/index.jsx @@ -282,7 +282,8 @@ } checkTopLine = (id) => { - const { config, data, selected } = this.state + const { config, data, selected, card } = this.state + let _opens = [...this.state.opens] if (!data || data.length === 0) { this.setState({ @@ -300,16 +301,26 @@ let keys = [] let items = [] let last = '' + + if (card.setting.display === 'collapse') { + _opens = [] + } + data.forEach((item, i) => { if (!item.$disabled && item.selected === 'true') { items.push(item) keys.push(i) index = i last = item + + if (card.setting.display === 'collapse') { + _opens.push(i) + } } }) this.setState({ + opens: _opens, activeKey: index, selectKeys: keys, selectedData: items @@ -338,7 +349,12 @@ return } + if (card.setting.display === 'collapse') { + _opens = [index] + } + this.setState({ + opens: _opens, activeKey: index, selectKeys: [index], selectedData: [data[index]] -- Gitblit v1.8.0