From 60e8ac11ce15bff0454accc2a2b79780dae63e60 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 22 五月 2022 20:33:32 +0800 Subject: [PATCH] 2022-05-22 --- src/tabviews/custom/components/card/data-card/index.jsx | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx index ff0e6b9..626c136 100644 --- a/src/tabviews/custom/components/card/data-card/index.jsx +++ b/src/tabviews/custom/components/card/data-card/index.jsx @@ -328,7 +328,15 @@ checkTopLine = (id) => { const { config, data } = this.state - if (!data || data.length === 0 || data[0].$disabled) { + let index = 0 + if (id && data) { + index = data.findIndex(item => item.$$uuid === id) + if (index === -1) { + index = 0 + } + } + + if (!data || data.length === 0 || data[index].$disabled) { this.setState({ activeKey: '', selectKeys: [], @@ -340,14 +348,6 @@ MKEmitter.emit('syncBalconyData', config.uuid, [], false) } return - } - - let index = 0 - if (id) { - index = data.findIndex(item => item.$$uuid === id) - if (index === -1) { - index = 0 - } } this.setState({ -- Gitblit v1.8.0