ElementUI Timeline 时间线
一、概述
可视化地呈现时间流信息。
官方链接:https://element.eleme.cn/#/zh-CN/component/timeline
二、优化
官方列举的样式,不符合实际需求,因此需要自己写一个。
test.vue

<template> <div style="width: 50%"> <div class="handle-list"> <div class="data-title"> <div style="border-bottom: 1px solid #eee;margin-bottom: 20px;"></div> <div class="press text">处理进度</div> <div class="des text">描述</div> <div class="users text">处理人员</div> <div class="times text">处理时间</div> </div> <div> <div class="data-title handle-items" v-for='(item,index) in processData' :key="item.id"> <div class="press"> <div class="handle-items-icons"> <div class="icon" :class="{'icon-circle' :index==0}"></div> <div class="icon-line" v-if="item.status>1"></div> <div class="icon-line-last" v-if="index==processData.length"></div> </div> <div class="handle-message handle-message1" style="margin-left: 20px;"> <div class="item-name">{{ item.process }}</div> </div> </div> <div class="des"> <div class="handle-message handle-message1"> <div class="item-name">{{ item.desc }}</div> </div> </div> <div class="users"> <div class="handle-message handle-message1"> <div class="item-name">{{ item.operate }}</div> </div> </div> <div class="times"> <div class="handle-message handle-message1"> <div class="item-name">{{ item.createTime }}</div> </div> </div> </div> </div> </div> </div> </template> <script> export default { data() { return { texts: ['差', '一般', '好', '非常好', '非常棒'], value: null, processData: [ { id:4, process:'完成工单', status:4, desc:'快件已经签收,签收人:本人', operate:'小张', createTime:'2021/09/17 09:58:52' }, { id:3, process:'快件到达', status:3, desc:'快件已经到达北京市丰台区', operate:'小张', createTime:'2021/09/17 08:58:52' }, { id: 2, process: '分派工单', status: 2, desc: '已分派工单给小王【12345678910】', operate: '小张', createTime: '2021/09/16 21:58:52' }, { id: 1, process: '创建工单', status: 1, desc: '已创建工单【202109162058】', operate: '小张', createTime: '2021/09/16 20:58:52' }, ] } }, methods: {}, } </script> <style rel="stylesheet/scss" lang="scss" scoped> .data-title { border-bottom: 1px solid #eee; margin-bottom: 20px; display: flex; } .press { width: 100px; } .des { flex: 1; } .users { width: 120px; } .times { width: 160px; } .text { height: 13px; font-size: 13px; font-family: PingFangSC-Regular, PingFang SC; font-weight: 400; color: #999999; line-height: 13px; } .handle-list { margin-bottom: 20px; .handle-items { display: flex; position: relative; border-bottom: none; margin-bottom: 0; padding-bottom: 37px; .handle-items-icons { position: absolute; height: 100%; width: 10px; display: flex; flex-direction: column; align-items: center; .icon { /*position:absolute;*/ width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid #CCCCCC; box-sizing: border-box; } .icon-circle { border: none; background: linear-gradient(134deg, #3D98FF 0%, #8086E4 100%); } .icon-line { width: 1px; flex: 1; background: linear-gradient(180deg, #CCCCCC 0%, rgba(204, 204, 204, 0.2) 100%); } .icon-line-last { width: 1px; height: 100%; background: linear-gradient(207deg, #2C81EC 0%, rgba(44, 129, 236, 0.2) 100%); } } .handle-message { /*display: flex;*/ // justify-content: center; align-items: center; font-size: 13px; font-weight: 400; color: #333333; line-height: 18px; .item-name { /*width: 56px;*/ height: 14px; font-size: 14px; font-family: PingFangSC-Regular, PingFang SC; font-weight: 400; color: #333333; line-height: 14px; } } .handle-message1 { padding-bottom: 0; } } .handle-items1 { padding-bottom: 15px; } } </style>
效果如下:
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
2021-01-06 istio kiali jaeger 关联
2021-01-06 istio kiali 亲和性调度
2021-01-06 istio kiali 内部介绍
2019-01-06 django 实现文件下载功能