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 '--'
            }
        },
相关推荐
liweiweili1262 小时前
Tomcat 服务器日志
java·运维·服务器·tomcat
LZQqqqqo3 小时前
C# 中生成随机数的常用方法
java·算法·c#
葵续浅笑3 小时前
LeetCode - 合并两个有序链表 / 删除链表的倒数第 N 个结点
java·算法·leetcode
longze_74 小时前
Vue中:deep()和 ::v-deep选择器的区别
前端·javascript·vue.js
2301_793086874 小时前
Springboot 04 starter
java·spring boot·后端
太阳伞下的阿呆7 小时前
本地环境vue与springboot联调
前端·vue.js·spring boot
seabirdssss7 小时前
错误: 找不到或无法加载主类 原因: java.lang.ClassNotFoundException
java·开发语言
阳光是sunny7 小时前
走进微前端(1)手写single-spa核心原理
前端·javascript·vue.js
还是鼠鼠7 小时前
tlias智能学习辅助系统--SpringAOP-进阶-通知顺序
java·后端·mysql·spring·mybatis·springboot
君莫笑几人回8 小时前
关于记录一下“bug”,在做图片上传的时候出现的小问题
java·开发语言·spring boot