当前位置: 首页 > news >正文

vue 甘特图 vxe-gantt 任务里程碑类型的配置用法

vue 甘特图 vxe-gantt 任务里程碑类型的配置用法

查看官网:https://gantt.vxeui.com/
gitbub:https://github.com/x-extends/vxe-gantt
gitee:https://gitee.com/x-extends/vxe-gantt

image

通过设置 task-bar-milestone-config 和 type=moveable 启用里程碑类型

<template><div><vxe-gantt v-bind="ganttOptions"></vxe-gantt></div>
</template><script setup>
import { reactive } from 'vue'
import { VxeGanttTaskType } from 'vxe-gantt'const ganttOptions = reactive({border: true,height: 500,taskBarConfig: {showProgress: true, // 是否显示进度条showContent: true, // 是否在任务条显示内容moveable: true, // 是否允许拖拽任务移动日期resizable: true, // 是否允许拖拽任务调整日期barStyle: {round: true, // 圆角bgColor: '#fca60b', // 任务条的背景颜色completedBgColor: '#65c16f' // 已完成部分任务条的背景颜色}},taskViewConfig: {tableStyle: {width: 280 // 表格宽度},gridding: {leftSpacing: 1, // 左侧间距多少列rightSpacing: 4 // 右侧间距多少列}},taskBarMilestoneConfig: {// 自定义里程碑图标状态颜色iconStatus ({ row }) {if (row.id === 10001) {return 'error'}if (row.id === 10007) {return 'success'}return 'warning'}},columns: [{ type: 'seq', width: 70 },{ field: 'title', title: '任务名称' }],data: [{ id: 10001, title: '项目启动会议', start: '2024-03-01', end: '', progress: 0, type: VxeGanttTaskType.Milestone },{ id: 10002, title: '项目启动与计划', start: '2024-03-03', end: '2024-03-08', progress: 80, type: '' },{ id: 10003, title: '需求评审完成', start: '2024-03-03', end: '', progress: 0, type: VxeGanttTaskType.Milestone },{ id: 10004, title: '技术及方案设计', start: '2024-03-05', end: '2024-03-11', progress: 80, type: '' },{ id: 10005, title: '功能开发', start: '2024-03-08', end: '2024-03-15', progress: 70, type: '' },{ id: 10007, title: '测试环境发布', start: '2024-03-11', end: '', progress: 0, type: VxeGanttTaskType.Milestone },{ id: 10008, title: '系统测试', start: '2024-03-14', end: '2024-03-19', progress: 80, type: '' },{ id: 10009, title: '测试完成', start: '2024-03-19', end: '', progress: 0, type: VxeGanttTaskType.Milestone },{ id: 10010, title: '正式发布上线', start: '2024-03-20', end: '', progress: 0, type: VxeGanttTaskType.Milestone }]
})
</script>

image

使用依赖线

<template><div><vxe-gantt v-bind="ganttOptions"></vxe-gantt></div>
</template><script setup>
import { reactive } from 'vue'
import { VxeGanttDependencyType, VxeGanttTaskType } from 'vxe-gantt'const ganttOptions = reactive({border: true,height: 500,rowConfig: {keyField: 'id' // 行主键},taskBarConfig: {showProgress: true, // 是否显示进度条showContent: true, // 是否在任务条显示内容moveable: true, // 是否允许拖拽任务移动日期resizable: true, // 是否允许拖拽任务调整日期barStyle: {round: true, // 圆角bgColor: '#fca60b', // 任务条的背景颜色completedBgColor: '#65c16f' // 已完成部分任务条的背景颜色}},taskViewConfig: {tableStyle: {width: 280 // 表格宽度},gridding: {leftSpacing: 1, // 左侧间距多少列rightSpacing: 4 // 右侧间距多少列}},taskBarMilestoneConfig: {// 自定义里程碑图标icon ({ row }) {if (row.id === 10001) {return 'vxe-icon-warning-triangle-fill'}if (row.id === 10007) {return 'vxe-icon-square-fill'}if (row.id === 10009) {return 'vxe-icon-warning-circle-fill'}return 'vxe-icon-radio-unchecked-fill'},// 自定义里程碑图标样式iconStyle ({ row }) {if (row.id === 10001) {return {color: '#65c16f'}}if (row.id === 10007) {return {color: '#dc3cc7'}}}},taskLinkConfig: {lineType: 'flowDashed'},links: [{ from: 10001, to: 10002, type: VxeGanttDependencyType.StartToFinish },{ from: 10003, to: 10004, type: VxeGanttDependencyType.StartToStart },{ from: 10007, to: 10008, type: VxeGanttDependencyType.StartToStart },{ from: 10008, to: 10009, type: VxeGanttDependencyType.FinishToStart },{ from: 10009, to: 10010, type: VxeGanttDependencyType.StartToStart }],columns: [{ type: 'seq', width: 70 },{ field: 'title', title: '任务名称' }],data: [{ id: 10001, title: '项目启动会议', start: '2024-03-01', end: '', progress: 0, type: VxeGanttTaskType.Milestone },{ id: 10002, title: '项目启动与计划', start: '2024-03-03', end: '2024-03-08', progress: 80, type: '' },{ id: 10003, title: '需求评审完成', start: '2024-03-03', end: '', progress: 0, type: VxeGanttTaskType.Milestone },{ id: 10004, title: '技术及方案设计', start: '2024-03-05', end: '2024-03-11', progress: 80, type: '' },{ id: 10005, title: '功能开发', start: '2024-03-08', end: '2024-03-15', progress: 70, type: '' },{ id: 10007, title: '测试环境发布', start: '2024-03-11', end: '', progress: 0, type: VxeGanttTaskType.Milestone },{ id: 10008, title: '系统测试', start: '2024-03-14', end: '2024-03-19', progress: 80, type: '' },{ id: 10009, title: '测试完成', start: '2024-03-19', end: '', progress: 0, type: VxeGanttTaskType.Milestone },{ id: 10010, title: '正式发布上线', start: '2024-03-20', end: '', progress: 0, type: VxeGanttTaskType.Milestone }]
})
</script>

https://gitee.com/x-extends/vxe-gantt

http://www.jsqmd.com/news/133240/

相关文章:

  • ESP固件烧录实战指南:从零掌握esptool核心用法
  • w3x2lni:魔兽地图格式转换的终极解决方案
  • 2025年值得N刷的老火锅店排行,本地食客的良心推荐。老火锅/火锅店/重庆火锅/火锅/美食/特色美食/川渝火锅老火锅品牌怎么选择 - 品牌推荐师
  • 毕设 深度学习 opencv 公式识别
  • QCMA:跨平台开源PS Vita管理工具的终极解决方案
  • WebTopo:快速构建专业级拓扑图编辑器的终极指南
  • 3、Visual Studio 2017:提升开发效率的强大特性
  • 揭秘Open-AutoGLM核心技术:如何实现零代码AI应用开发(仅限内部披露)
  • 2025年不错的航空货运公司排行榜,口碑好实力强的航空货运企业推荐 - 工业品牌热点
  • 如何快速掌握ArtPlayer.js:新手入门与进阶技巧完整指南
  • DellFanManagement:戴尔笔记本风扇控制的终极解决方案
  • 5分钟搞定ESP32二维码交互:从配网到数据传输的完整指南
  • 采购必看:升降桌“水”很深?避开这3大误区,5款经认证的智能升降桌深度解析 - 资讯焦点
  • DroneKit-Python无人机开发实战:避开这7个坑的高效编程指南
  • 2025全屋定制板材品牌TOP5权威测评:佰丽爱家/志邦/好莱客等谁更值得选? - mypinpai
  • 2025年软考高项培训机构硬核测评:十大最热品牌优势完全解析 - 资讯焦点
  • python基于vue的企业员工考勤和工资管理系统的设计与实现_0z1xuq0g
  • Illustrator脚本:从设计新手到效率达人的秘密武器
  • 3大核心功能解析:Mermaid Live Editor如何彻底改变图表制作方式
  • 4、Visual Studio 2017与C 7.0新特性全解
  • 2025年AI搜索优化专业供应商推荐:靠谱的AI搜索优化公司有哪些? - 工业品牌热点
  • 2025年门窗第一梯队品牌推荐:门窗关键品牌、卓越品牌有哪些? - 工业推荐榜
  • 终极解决方案:彻底攻克Unity WebGL输入法兼容难题
  • 2025北京合生利源清洁技术发展有限公司,合生利源可以信任吗? - myqiye
  • Upscayl AI图像放大终极指南:从模糊到高清的完整解决方案
  • 工控电源模块PCB封装散热分析:全面讲解
  • Vivado WebPACK版license与系统兼容性核心要点
  • 终极创意二维码生成指南:用ControlNet QR Code Monster v2打造视觉盛宴
  • Open-AutoGLM无法登录?手把手教你排查7类核心问题
  • 游戏翻译不再难:LunaTranslator让你的日文游戏秒变中文