|
|
@ -102,7 +102,7 @@ export default { |
|
|
|
newList.push({ |
|
|
|
num: `${currentList[i]}${currentList[j]}`, |
|
|
|
lable: `${list[i]}${list[j]}`, |
|
|
|
numlable: `${list[i]}${list[j]}${currentList[i]}${currentList[j]}` |
|
|
|
numlable: `${list[i]}${list[j]}` |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
@ -115,10 +115,12 @@ export default { |
|
|
|
for (let s = this.allList.length - 1; s >= 0; s--) { |
|
|
|
let item = JSON.parse(JSON.stringify(this.allList[s])) |
|
|
|
element["numlable"] = newListTemp[i].numlable |
|
|
|
element["num"] = newListTemp[i].num |
|
|
|
element["id"] = item.id |
|
|
|
element["name"] = item.name |
|
|
|
element["data"] = [...item.data] |
|
|
|
element["dataStr"] = item.data.join("_") |
|
|
|
element["dataStrFirstGroup"] = `${item.data.join("_")}${newListTemp[i].numlable}` |
|
|
|
element["note"] = item.note |
|
|
|
element["create_at"] = item.create_at |
|
|
|
element["update_at"] = item.update_at |
|
|
@ -130,7 +132,16 @@ export default { |
|
|
|
newListTempLocal.push({ ...element }) |
|
|
|
} |
|
|
|
} |
|
|
|
let allGroup = _.groupBy(_.filter(newListTempLocal, { has: false }), "dataStr") |
|
|
|
let groupName = _.groupBy(newListTempLocal, "dataStrFirstGroup") |
|
|
|
let newLIstTemp = [] |
|
|
|
for (let key in groupName) { |
|
|
|
let value = groupName[key] |
|
|
|
let filterData = _.filter(value.slice(value.length - 5), { has: true }) |
|
|
|
if (filterData.length === 0) { |
|
|
|
newLIstTemp = newLIstTemp.concat(value) |
|
|
|
} |
|
|
|
} |
|
|
|
let allGroup = _.groupBy(newLIstTemp, "dataStr") |
|
|
|
let allListTemp = [] |
|
|
|
for (let key in allGroup) { |
|
|
|
let value = allGroup[key] |
|
|
@ -141,9 +152,12 @@ export default { |
|
|
|
} |
|
|
|
for (let key1 in perGroup) { |
|
|
|
let element = perGroup[key1]; |
|
|
|
let has = _.get(element, [element.length - 1, "has"], false) || _.get(element, [element.length - 2, "has"], false) || _.get(element, [element.length - 3, "has"], false) || _.get(element, [element.length - 4, "has"], false) || _.get(element, [element.length - 5, "has"], false) |
|
|
|
let hasIndex = _.findLastIndex(element, { has: true }) |
|
|
|
textObj.data.push({ |
|
|
|
name: key1, |
|
|
|
num: element.length |
|
|
|
has: has, |
|
|
|
num: element.length - hasIndex - 1 |
|
|
|
}) |
|
|
|
} |
|
|
|
textObj.str = value[0].data.join(" ") |
|
|
@ -158,9 +172,13 @@ export default { |
|
|
|
let valueItem = value[i]; |
|
|
|
for (let j = 0; j < valueItem.data.length; j++) { |
|
|
|
let dataItem = valueItem.data[j]; |
|
|
|
let findItem = _.find(mergedData, item => item.name === dataItem.name) |
|
|
|
let mergedDataTemp = _.cloneDeep(mergedData) |
|
|
|
let findItem = _.find(mergedDataTemp, item => item.name === dataItem.name) |
|
|
|
if (findItem) { |
|
|
|
findItem.num++ |
|
|
|
if (dataItem.has) { |
|
|
|
findItem.num = 0 |
|
|
|
} |
|
|
|
} else { |
|
|
|
mergedData.push(dataItem) |
|
|
|
} |
|
|
@ -183,14 +201,14 @@ export default { |
|
|
|
} |
|
|
|
this.calList = _.sortBy(this.calList, "id").reverse() |
|
|
|
this.genData() |
|
|
|
this.genDataHistory() |
|
|
|
// this.genDataHistory() |
|
|
|
}, |
|
|
|
clearNumber() { |
|
|
|
this.dataInput = "" |
|
|
|
this.dataInputLIst = [] |
|
|
|
this.calList = [] |
|
|
|
this.genData() |
|
|
|
this.genDataHistory() |
|
|
|
// this.genDataHistory() |
|
|
|
}, |
|
|
|
genData() { |
|
|
|
let newList = "" |
|
|
|