| | |
| | | if (component.type === 'table') { |
| | | let getColumns = (cols) => { |
| | | return cols.filter(item => { |
| | | if (item.type === 'colspan') { |
| | | if (item.Hide === 'true') return false |
| | | |
| | | if (item.type === 'number') { |
| | | if (typeof(item.decimal) === 'number') { |
| | | item.round = Math.pow(10, item.decimal) |
| | | if (item.format === 'percent') { |
| | | item.decimal = item.decimal > 2 ? item.decimal - 2 : 0 |
| | | } |
| | | } |
| | | } else if (item.type === 'formula') { |
| | | if (typeof(item.decimal) === 'number') { |
| | | item.round = Math.pow(10, item.decimal) |
| | | } |
| | | } else if (item.type === 'colspan') { |
| | | item.subcols = getColumns(item.subcols) |
| | | if (item.subcols.length === 0) { |
| | | return false |
| | |
| | | if (cell.format === 'percent') { |
| | | cell.decimal = cell.decimal > 2 ? cell.decimal - 2 : 0 |
| | | } |
| | | } else if (cell.eleType === 'formula' && typeof(cell.decimal) === 'number') { |
| | | cell.round = Math.pow(10, cell.decimal) |
| | | } |
| | | } |
| | | |