This commit is contained in:
2023-07-25 20:03:06 +08:00
parent b3d67fb0e8
commit 3a424b4719
14 changed files with 39 additions and 21 deletions

View File

@@ -26,6 +26,23 @@ const useTreeDataStore = defineStore("treeDataStore", {
},
setCurrentNode(nodeKey) {
this.currentNode = nodeKey
},
// 获取轮次信息中差中间的是哪几个轮次
getRoundMiddleInfo() {
let roundLength = this.treeData.length
// 取出最后一个key的值
let lastKey = parseInt(this.treeData[this.treeData.length - 1].key) + 1
// 遍历数组找出key最大值
let key_list = []
this.treeData.forEach((item) => {
key_list.push(parseInt(item.key))
})
if (roundLength !== lastKey) {
let cha = lastKey - roundLength
return lastKey - cha - 1
} else {
return roundLength
}
}
}
})