css-vxe列表中ant进度条与百分比

1.vxe列表 ant进度条

html 复制代码
 <vxe-column field="actualProgress" title="进度" align="center" width="200">
                <template #default="{ row }">
                    <a-progress
                    :percent="Math.floor(row.actualProgress)"
                    size="small"
                    status="active"
                    :stroke-color="{ '0%': '#4DA6FF', '100%': '#C3DCFF' }"
                    />
                </template>
            </vxe-column>

2.列表中的百分比

2.1 html
html 复制代码
<vxe-column field="Ratio" title="百分比" min-width="132" align="center" :formatter="formatProgress">
2.1 js
javascript 复制代码
// 格式化进度
    formatProgress(record) {
        if (record.cellValue != '' && record.cellValue != null) {
            return this.showProgress(record.cellValue)
        } else {
            return '--'
        }
    },
    // 百分比展示
    showProgress(num) {
      let ps = 0 > num ? -1 * Math.floor(-1 * num) : Math.floor(num);
      return ps + "%";
    },

3.返回是否有值判断

javascript 复制代码
 // 返回是否有值
        getConnect({ cellValue }) {
            if (cellValue != null) {
                return cellValue
            } else {
                return '--'
            }
        },
相关推荐
云烟成雨TD1 天前
Spring AI Alibaba 1.x 系列【6】ReactAgent 同步执行 & 流式执行
java·人工智能·spring
于慨1 天前
Lambda 表达式、方法引用(Method Reference)语法
java·前端·servlet
石小石Orz1 天前
油猴脚本实现生产环境加载本地qiankun子应用
前端·架构
swg3213211 天前
Spring Boot 3.X Oauth2 认证服务与资源服务
java·spring boot·后端
从前慢丶1 天前
前端交互规范(Web 端)
前端
像我这样帅的人丶你还1 天前
别再让JS耽误你进步了。
css·vue.js
gelald1 天前
SpringBoot - 自动配置原理
java·spring boot·后端
殷紫川1 天前
深入理解 AQS:从架构到实现,解锁 Java 并发编程的核心密钥
java
一轮弯弯的明月1 天前
贝尔数求集合划分方案总数
java·笔记·蓝桥杯·学习心得
CHU7290351 天前
便捷约玩,沉浸推理:线上剧本杀APP功能版块设计详解
前端·小程序