* @description html进度条 * @param title * @param percent * @returns
(title, current, total)
| 2013 | * @returns |
| 2014 | */ |
| 2015 | function getProgressHTML(title, current, total) { |
| 2016 | // html |
| 2017 | const progressHTML = `<div |
| 2018 | style=" |
| 2019 | display: flex; |
| 2020 | align-items: center; |
| 2021 | justify-content: space-between; |
| 2022 | padding: 1px 0; |
| 2023 | " |
| 2024 | > |
| 2025 | <span>${title}</span> |
| 2026 | <span>${getHighlightHTML(`${current}`)} / ${total}</span> |
| 2027 | </div> |
| 2028 | <div |
| 2029 | style=" |
| 2030 | background: white; |
| 2031 | border-radius: 10px; |
| 2032 | height: 10px; |
| 2033 | border: 1px solid #eee; |
| 2034 | flex-shrink: 1; |
| 2035 | " |
| 2036 | > |
| 2037 | <div |
| 2038 | style=" |
| 2039 | background: linear-gradient(to left, #188fff80, #1890ff); |
| 2040 | height: 100%; |
| 2041 | width: ${((100 * current) / total).toFixed(1)}%; |
| 2042 | border-radius: 10px; |
| 2043 | " |
| 2044 | ></div> |
| 2045 | </div>`; |
| 2046 | return progressHTML; |
| 2047 | } |
| 2048 | /** |
| 2049 | * @description html高亮文本 |
| 2050 | * @param text |
no test coverage detected