From 3a54312c93a6daebf575639dd612e0d01be2a296 Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Wed, 25 Nov 2020 19:38:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=9D=E5=A7=8B=E5=8C=96=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E7=8A=B6=E6=80=81=E4=B8=8B=E6=A0=87=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/sheetmanage.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/controllers/sheetmanage.js b/src/controllers/sheetmanage.js index b8fbddf..9928302 100644 --- a/src/controllers/sheetmanage.js +++ b/src/controllers/sheetmanage.js @@ -185,6 +185,33 @@ const sheetmanage = { return curindex; }, getCurSheet: function() { + if (Store.luckysheetfile.length) { + let hasActive = false, indexs = [] + Store.luckysheetfile.forEach(item => { + if ('undefined' === typeof item.index) { + item.index = this.generateRandomSheetIndex() + } + if (indexs.includes(item.index)) { + item.index = this.generateRandomSheetIndex() + }else { + indexs.push(item.index) + } + + if ('undefined' === typeof item.status) { + item.status = 0 + } + if (item.status == 1) { + if (hasActive) { + item.status = 0 + }else { + hasActive = true + } + } + }) + if (!hasActive) { + Store.luckysheetfile[0].status = 1 + } + } Store.currentSheetIndex = Store.luckysheetfile[0].index; for (let i = 0; i < Store.luckysheetfile.length; i++) {