修改分页

master
夜笙歌 1 year ago
parent c4bebfff35
commit 7b00b9e1d5

@ -460,25 +460,31 @@
dataB = [title] dataB = [title]
dataC = [title] dataC = [title]
dataB.push(...([...dataA].splice(dataIndex, 6))) dataB.push(...([...dataA].splice(dataIndex, 6)))
dataB.push([' ', '合计', '', totle([title,...dataA], 2), totle([title,...dataA], 3), totle([title,...dataA], 4), totle([title,...dataA], 3) === 0 ? '0%' : ((totle([title,...dataA], 4) / totle([title,...dataA], 3)) * 100).toString().substr(0, 5) + '%', totle([title,...dataA], 6), totle([title,...dataA], 7), totle([title,...dataA], 8), totle([title,...dataA], 9), totle([title,...dataA], 10), totle([title,...dataA], 11), totle([title,...dataA], 12), totle([title,...dataA], 13), totle([title,...dataA], 14), totle([title,...dataA], 15), totle([title,...dataA], 16), totle([title,...dataA], 17)]) if(dataB.length ===1){
dataB.push([' ', '合计', '正常', totle([title,...dataA], 2), totle([title,...dataA], 3), totle([title,...dataA], 4), totle([title,...dataA], 3) === 0 ? '0%' : ((totle([title,...dataA], 4) / totle([title,...dataA], 3)) * 100).toString().substr(0, 5) + '%', totle([title,...dataA], 6), totle([title,...dataA], 7), totle([title,...dataA], 8), totle([title,...dataA], 9), totle([title,...dataA], 10), totle([title,...dataA], 11), totle([title,...dataA], 12), totle([title,...dataA], 13), totle([title,...dataA], 14), totle([title,...dataA], 15), totle([title,...dataA], 16), totle([title,...dataA], 17)])
}else{
dataB.push([' ', '合计', '正常', totle([...dataB], 2), totle([...dataB], 3), totle([...dataB], 4), totle([...dataB], 3) === 0 ? '0%' : ((totle([...dataB], 4) / totle([...dataB], 3)) * 100).toString().substr(0, 5) + '%', totle([...dataB], 6), totle([...dataB], 7), totle([...dataB], 8), totle([...dataB], 9), totle([...dataB], 10), totle([...dataB], 11), totle([...dataB], 12), totle([...dataB], 13), totle([...dataB], 14), totle([...dataB], 15), totle([...dataB], 16), totle([...dataB], 17)])
}
if (dataIndex + 6 > dataA.length) { if (dataIndex + 6 > dataA.length) {
dataIndex = 0 dataIndex = 0
} else { } else {
dataIndex += 6 dataIndex += 6
} }
dataC.push(...([...dataA].splice(dataIndex, 6))) dataC.push(...([...dataA].splice(dataIndex, 6)))
if(dataC.length ===1){
dataC.push([' ', '合计', '', totle([title,...dataA], 2), totle([title,...dataA], 3), totle([title,...dataA], 4), totle([title,...dataA], 3) === 0 ? '0%' : ((totle([title,...dataA], 4) / totle([title,...dataA], 3)) * 100).toString().substr(0, 5) + '%', totle([title,...dataA], 6), totle([title,...dataA], 7), totle([title,...dataA], 8), totle([title,...dataA], 9), totle([title,...dataA], 10), totle([title,...dataA], 11), totle([title,...dataA], 12), totle([title,...dataA], 13), totle([title,...dataA], 14), totle([title,...dataA], 15), totle([title,...dataA], 16), totle([title,...dataA], 17)]) dataC.push([' ', '合计', '', totle([title,...dataA], 2), totle([title,...dataA], 3), totle([title,...dataA], 4), totle([title,...dataA], 3) === 0 ? '0%' : ((totle([title,...dataA], 4) / totle([title,...dataA], 3)) * 100).toString().substr(0, 5) + '%', totle([title,...dataA], 6), totle([title,...dataA], 7), totle([title,...dataA], 8), totle([title,...dataA], 9), totle([title,...dataA], 10), totle([title,...dataA], 11), totle([title,...dataA], 12), totle([title,...dataA], 13), totle([title,...dataA], 14), totle([title,...dataA], 15), totle([title,...dataA], 16), totle([title,...dataA], 17)])
}else{
dataC.push([' ', '合计', '', totle([...dataC], 2), totle([...dataC], 3), totle([...dataC], 4), totle([...dataC], 3) === 0 ? '0%' : ((totle([...dataC], 4) / totle([...dataC], 3)) * 100).toString().substr(0, 5) + '%', totle([...dataC], 6), totle([...dataC], 7), totle([...dataC], 8), totle([...dataC], 9), totle([...dataC], 10), totle([...dataC], 11), totle([...dataC], 12), totle([...dataC], 13), totle([...dataC], 14), totle([...dataC], 15), totle([...dataC], 16), totle([...dataC], 17)])
}
if (dataIndex + 6 > dataA.length) { if (dataIndex + 6 > dataA.length) {
dataIndex = 0 dataIndex = 0
} else { } else {
dataIndex += 6 dataIndex += 6
} }
console.log(dataB) planInfo.loadData([...dataB], 19, {
console.log(dataC)
planInfo.loadData([title,...dataA], 19, {
includeHead: true, includeHead: true,
}) })
planInfo2.loadData([title,...dataA], 19, { planInfo2.loadData([...dataC], 19, {
includeHead: true, includeHead: true,
}) })
} }

@ -431,7 +431,7 @@
let filter = (arr, key, value, key2) => { let filter = (arr, key, value, key2) => {
return arr.filter(e => e[key] === value)?.[0]?.[key2] return arr.filter(e => e[key] === value)?.[0]?.[key2]
} }
let totle = (arr, i) => { let total = (arr, i) => {
return arr.map((e, index) => { return arr.map((e, index) => {
if (index !== 0) { if (index !== 0) {
return e[i + 1] return e[i + 1]
@ -453,14 +453,14 @@
dataB = [title] dataB = [title]
dataC = [title] dataC = [title]
dataB.push(...([...dataA].splice(dataIndex, 6))) dataB.push(...([...dataA].splice(dataIndex, 6)))
dataB.push([' ', '合计', '', totle([...dataB], 2), totle([...dataB], 3), totle([...dataB], 4), totle([...dataB], 3) === 0 ? '0%' : ((totle([...dataB], 4) / totle([...dataB], 3)) * 100).toString().substr(0, 5) + '%', totle([...dataB], 6), totle([...dataB], 7), totle([...dataB], 8), totle([...dataB], 9), totle([...dataB], 10), totle([...dataB], 11), totle([...dataB], 12), totle([...dataB], 13), totle([...dataB], 14), totle([...dataB], 15), totle([...dataB], 16), totle([...dataB], 17)]) dataB.push([' ', '合计', '', total([...dataB], 2), total([...dataB], 3), total([...dataB], 4), total([...dataB], 3) === 0 ? '0%' : ((total([...dataB], 4) / total([...dataB], 3)) * 100).toString().substr(0, 5) + '%', total([...dataB], 6), total([...dataB], 7), total([...dataB], 8), total([...dataB], 9), total([...dataB], 10), total([...dataB], 11), total([...dataB], 12), total([...dataB], 13), total([...dataB], 14), total([...dataB], 15), total([...dataB], 16), total([...dataB], 17)])
if (dataIndex + 6 > dataA.length) { if (dataIndex + 6 > dataA.length) {
dataIndex = 0 dataIndex = 0
} else { } else {
dataIndex += 6 dataIndex += 6
} }
dataC.push(...([...dataA].splice(dataIndex, 6))) dataC.push(...([...dataA].splice(dataIndex, 6)))
dataC.push([' ', '合计', '', totle([...dataC], 2), totle([...dataC], 3), totle([...dataC], 4), totle([...dataC], 3) === 0 ? '0%' : ((totle([...dataC], 4) / totle([...dataC], 3)) * 100).toString().substr(0, 5) + '%', totle([...dataC], 6), totle([...dataC], 7), totle([...dataC], 8), totle([...dataC], 9), totle([...dataC], 10), totle([...dataC], 11), totle([...dataC], 12), totle([...dataC], 13), totle([...dataC], 14), totle([...dataC], 15), totle([...dataC], 16), totle([...dataC], 17)]) dataC.push([' ', '合计', '', total([...dataC], 2), total([...dataC], 3), total([...dataC], 4), total([...dataC], 3) === 0 ? '0%' : ((total([...dataC], 4) / total([...dataC], 3)) * 100).toString().substr(0, 5) + '%', total([...dataC], 6), total([...dataC], 7), total([...dataC], 8), total([...dataC], 9), total([...dataC], 10), total([...dataC], 11), total([...dataC], 12), total([...dataC], 13), total([...dataC], 14), total([...dataC], 15), total([...dataC], 16), total([...dataC], 17)])
if (dataIndex + 6 > dataA.length) { if (dataIndex + 6 > dataA.length) {
dataIndex = 0 dataIndex = 0
} else { } else {

Loading…
Cancel
Save