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 '--'
            }
        },
相关推荐
BD_Marathon1 天前
【JavaWeb】启动tomcat报错:启动子级时出错
java·tomcat
while(1){yan}1 天前
网络协议TCP
java·网络·网络协议·tcp/ip·青少年编程·电脑常识
IT_陈寒1 天前
SpringBoot 3.2 实战:用这5个新特性让你的API性能提升40%
前端·人工智能·后端
一过菜只因1 天前
JavaWeb后端(spring--boot)
java·开发语言
霍理迪1 天前
HTML初相识
前端·html
yuyu_03041 天前
SOHE智能厨余垃圾处理系统
java·vue
IT枫斗者1 天前
Netty的原理和springboot项目整合
java·spring boot·后端·sql·科技·mysql·spring
Edward111111111 天前
普通java项目转为maven项目 J文件后缀.java变C文件
java·开发语言·maven
一雨方知深秋1 天前
二.java程序基本语法
java·类型转换·变量·方法·运算符·字面量·关键字标识符