mirror of
https://github.com/MatMoul/dokytree.git
synced 2024-12-24 08:36:11 +00:00
57 lines
1.3 KiB
Plaintext
57 lines
1.3 KiB
Plaintext
div#HEADFILES
|
|
-
|
|
const maintenances = []
|
|
let fulltime = 0
|
|
const readNode = (curNode) => {
|
|
if(curNode?.data?.maintenances?.length > 0) {
|
|
const nodeItem = {
|
|
name: curNode.data.name,
|
|
maintenances: curNode.data.maintenances,
|
|
}
|
|
maintenances.push(nodeItem)
|
|
}
|
|
curNode.items.forEach((itm) => {
|
|
if(itm?.data?.maintenances?.length > 0) {
|
|
const nodeItem = {
|
|
name: itm.data.name,
|
|
maintenances: itm.data.maintenances,
|
|
}
|
|
nodeItem?.maintenances?.forEach((maintenance) => {
|
|
if(maintenance.yearlytime) fulltime += maintenance.yearlytime
|
|
})
|
|
maintenances.push(nodeItem)
|
|
}
|
|
})
|
|
curNode.nodes.forEach((childNode) => {
|
|
readNode(childNode)
|
|
})
|
|
}
|
|
readNode(doc)
|
|
table
|
|
each itm in maintenances
|
|
tr
|
|
td=itm.name
|
|
td
|
|
table
|
|
thead
|
|
th Type
|
|
th Frequency
|
|
th Yearly time
|
|
th Todo
|
|
each maintenance in itm.maintenances
|
|
tr
|
|
td=maintenance.type
|
|
td=maintenance.frequency
|
|
if typeof maintenance.yearlytime === 'number'
|
|
td=maintenance.yearlytime + ' min'
|
|
else
|
|
td
|
|
td=maintenance.action
|
|
table
|
|
tr
|
|
td Yearly time :
|
|
td=((fulltime / 60) + '').split('.')[0] + ' hour'
|
|
td=((fulltime / 60) + '').split('.')[0] * 130 + ':' + ((fulltime / 60) + '').split('.')[0] * 100 + ' / Years'
|
|
div#FILES
|
|
div#FOOTFILES
|