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 '--'
            }
        },
相关推荐
云烟成雨TD7 分钟前
Agent Scope Java 2.x 系列【5】智能体抽象层
java·人工智能·agent
阿伟AI说11 分钟前
Codex 桌面版接入国产模型系列二:Codex++
java·开源软件·ai编程·腾讯云ai代码助手
slongzhang_16 分钟前
jquery 修复怪异模式html未声明“<!DOCTYPE html>”
前端·html·jquery
love_muming32 分钟前
链表每日一练
java·开发语言·数据结构·链表·idea·每日一练
范什么特西35 分钟前
重点:mybatis注意细节
java·mysql·mybatis
乐观勇敢坚强的老彭43 分钟前
GESP一级核心算法:循环与条件判断的结合
java·数据结构·算法
雪宫街道1 小时前
SpringBoot 向 IOC 容器注册组件的两种姿势:@Configuration 与 @Import
java·spring boot·后端·spring
北城以北88881 小时前
虚拟机安装JDK,Tomcat,部署项目
java·开发语言·tomcat
云水一下1 小时前
Vue.js从零到精通系列(三):组件化基础——Props、Emits、插槽与生命周期
前端·javascript·vue.js
终将老去的穷苦程序员1 小时前
基于Android Studio开发的安卓图书借阅管理系统
java·sqlite·android studio·android-studio