| | |
| | | <span slot="model" slot-scope="text" style="font-weight: bold"> |
| | | <j-ellipsis :value="text" :length="8"/> |
| | | </span> |
| | | <span slot="duration" slot-scope="text"> |
| | | {{text|getFormattedTime}} |
| | | </span> |
| | | </a-table> |
| | | </div> |
| | | <!-- table区域-end --> |
| | |
| | | width:150 |
| | | }, |
| | | { |
| | | title: '加班时长', |
| | | align: 'center', |
| | | dataIndex: 'duration', |
| | | scopedSlots: {customRender: 'duration'}, |
| | | width:150 |
| | | }, |
| | | { |
| | | title: '备注', |
| | | align: 'center', |
| | | dataIndex: 'remark', |
| | |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | }, |
| | | }, |
| | | filters:{ |
| | | /** |
| | | * 格式化时间 |
| | | * @param seconds 秒数 |
| | | * @returns '' 格式化后时间字符串 |
| | | */ |
| | | getFormattedTime(seconds) { |
| | | var hours = Math.floor(seconds / 3600) |
| | | var minutes = Math.floor((seconds % 3600) / 60) |
| | | var secs = seconds % 60 |
| | | |
| | | if (hours === 0) { |
| | | if (minutes === 0) { |
| | | return secs === 0 ? 0 : `${secs}秒` |
| | | } else { |
| | | if (secs === 0) { |
| | | return `${minutes}分` |
| | | } |
| | | return `${minutes}分 ${secs}秒` |
| | | } |
| | | } else { |
| | | if (minutes === 0 && secs === 0) { |
| | | return `${hours}小时` |
| | | } else if (minutes !== 0 && secs === 0) { |
| | | return `${hours}小时 ${minutes}分` |
| | | } |
| | | } |
| | | return `${hours}小时 ${minutes}分 ${secs}秒` |
| | | } |
| | | }, |
| | | methods: { |
| | | importTemplate(fileName){ |
| | | var a = document.createElement("a"); |