当前位置: 首页 > 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.gsyq.cn/news/146158.html

相关文章:

  • 2025年值得N刷的老火锅店排行,本地食客的良心推荐。老火锅/火锅店/重庆火锅/火锅/美食/特色美食/川渝火锅老火锅品牌怎么选择 - 品牌推荐师
  • 毕设 深度学习 opencv 公式识别
  • 揭秘Open-AutoGLM核心技术:如何实现零代码AI应用开发(仅限内部披露)
  • 5分钟搞定ESP32二维码交互:从配网到数据传输的完整指南
  • 2025全屋定制板材品牌TOP5权威测评:佰丽爱家/志邦/好莱客等谁更值得选? - mypinpai
  • python基于vue的企业员工考勤和工资管理系统的设计与实现_0z1xuq0g
  • 2025年软考高项培训机构硬核测评:十大最热品牌优势完全解析 - 资讯焦点
  • 2025年门窗第一梯队品牌推荐:门窗关键品牌、卓越品牌有哪些? - 工业推荐榜
  • Upscayl AI图像放大终极指南:从模糊到高清的完整解决方案
  • 2025年全屋定制品牌对比推荐:佰丽爱家和易高、欧派等怎么选? - mypinpai
  • Open-AutoGLM无法登录?手把手教你排查7类核心问题
  • 外墙GRC线条生产商与定制厂家哪家好?哪家售后完善? - 工业推荐榜
  • 构建多语言OCR识别系统的完整实践指南
  • B站关注列表一键清理攻略:3分钟掌握批量取关功能
  • 多智能体路径规划实战指南:从零开始构建AGV调度系统
  • 基于微信小程序的菜谱设计与实现任务书
  • Blinker物联网开发终极指南:从零构建智能设备系统
  • Lua反编译实战指南:从字节码到可读源码的完整解析
  • 恒压源改恒流源的实用方案
  • ESPTool终极配置指南:从零搭建高效的物联网开发环境
  • 告别杂乱任务栏:CenterTaskbar让你的Windows桌面瞬间变高级
  • Open-AutoGLM API密钥管理与安全对接,企业级最佳实践深度解析
  • VideoTrans:AI驱动的实时视频翻译终极解决方案
  • http复习2.0
  • 你好,我是袋鼠帝。字节在编程工具(Trae)上面是国内最早发力的,但是编程模型迟迟没有推出。不过就在今天,字节终于!给豆包升级了编程能力,推出了他们的首款编程模型:Doubao-Seed-Code
  • Wonder3D技术深度解析:从单图到3D模型的革命性突破
  • Fleet开发go好用吗
  • Windows系统硬件信息伪装完全指南:EASY-HWID-SPOOFER深度解析
  • Paperless-ngx 完全指南:打造高效无纸化文档管理系统
  • 3分钟上手Kazam:Linux桌面录屏的完整解决方案