Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
fix: 初始化表单状态下标调整
Browse files Browse the repository at this point in the history
  • Loading branch information
btea committed Nov 25, 2020
1 parent 4b36102 commit 3a54312
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/controllers/sheetmanage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit 3a54312

Please sign in to comment.