From 6e700ba9a0485e0c6d674f8dc286de169890a0df Mon Sep 17 00:00:00 2001 From: lichong <18518571399@163.com> Date: Tue, 27 Aug 2024 00:10:25 +0800 Subject: [PATCH] 12 --- src/renderer/src/App.vue | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/src/renderer/src/App.vue b/src/renderer/src/App.vue index b4b1623..6726d09 100644 --- a/src/renderer/src/App.vue +++ b/src/renderer/src/App.vue @@ -340,27 +340,32 @@ export default { jifenData[`pos${i}${j}`] = 0 } } - // 模式一按照位置积分 - for (let i = 0; i < posData.length; i++) { - let posItem = posData[i]; - for (let j = 0; j < allData.length; j++) { - let item = _.compact(_.split(allData[j], ",")) - if (item.indexOf(`${i + 1}`) === -1) { - for (let k = 0; k < item.length; k++) { - let maxingItem = item[k]; - jifenData[`pos${posItem}${maxingItem}`]++ + // 模式一按照位置积分(竖着) + for (let i = 0; i < allData.length; i++) { + let item = _.compact(_.split(allData[i], ",")) + let moshi1Arr = [] + for (let j = 0; j < item.length; j++) { + moshi1Arr.push(posData[Number(j) - 1]) + } + for (let j = 0; j < item.length; j++) { + for (let k = 1; k < 11; k++) { + if (moshi1Arr.indexOf(`${k}`) === -1) { + jifenData[`pos${k}${item[j]}`]++ } } } } - // 模式二按照号码积分 - for (let j = 0; j < allData.length; j++) { - let item = _.compact(_.split(allData[j], ",")) - for (let i = 0; i < posData.length; i++) { - if (item.indexOf(`${i + 1}`) === -1) { - for (let k = 0; k < item.length; k++) { - let maxingItem = item[k]; - jifenData[`pos${maxingItem}${i + 1}`]++ + // 模式二按照位置积分(横着) + for (let i = 0; i < allData.length; i++) { + let item = _.compact(_.split(allData[i], ",")) + let moshi1Arr = [] + for (let j = 0; j < item.length; j++) { + moshi1Arr.push(posData[Number(item[j]) - 1]) + } + for (let j = 0; j < moshi1Arr.length; j++) { + for (let k = 1; k < 11; k++) { + if (item.indexOf(`${k}`) === -1) { + jifenData[`pos${moshi1Arr[j]}${k}`]++ } } }