ccui2048
v1.0.11
Published
一个简单的甘特图
Downloads
1
Readme
甘特图
介绍
一个div自定义的甘特图(点击的弹框基于elementUI-PLUS 如果使用请先安装elementUI-PLUS)
![图片(https://inspur-scimall.cast.org.cn/2024/05/23/15/1716357867400.png)
安装及使用
npm i ccui2048
//引入ccui2048和css 样式
import ccui2048 from "ccui2048";
import "../node_modules/ccui2048/style.css"
vue页面中使用
<gante :list="state.list" header="甘特图2024"></gante>
参数
list 参数适配后端接口。
参数
gantClickSelf 点击list数据的事件回调 返回当前item
{
list:[], //数据-格式如下
header:'' //标题-,
group[{
name: "wjsc",
color: "rgba(65, 59, 153, 1)",
bacColor: "rgba(65, 59, 153, 0.15)",
}], // 图例 -包含显示颜色和 进度条背景色
xAxis: [{
time: "DATE/TIME",
type: "header",
},
{
time: "07:00",
}
{
time: "08:00",
},
] //x轴显示
yAxis:[{ dataTime: "10-13",}.....] //x轴显示
}
"10-14": {
wjsc: [
{
id: 5,
scheduleDate: "10-14",
scheduleType: "wjsc",
scheduleLocation: "场馆",
scheduleStartTime: "2024-10-14 10:00:00",
scheduleEndTime: "2024-10-14 12:00:00",
scheduleRemark: "wpc第二日比赛",
},
],
},
参数-详解
list:{
"10-14": {
wjsc: [
{
id: 5,
scheduleDate: "10-14",
scheduleType: "wjsc",
scheduleLocation: "场馆",
scheduleStartTime: "2024-10-14 10:00:00",
scheduleEndTime: "2024-10-14 12:00:00",
scheduleSustainDuration: 2,
scheduleRemark: "wpc第二日比赛",
},
],
},
"10-13": {
wpc: [
{
id: 1,
scheduleDate: "10-13",
scheduleType: "wpc",
scheduleLocation: "场馆",
scheduleStartTime: "2024-10-13 10:00:00",
scheduleEndTime: "2024-10-13 12:00:00",
scheduleSustainDuration: 2,
scheduleRemark: "wpc比赛",
},
{
id: 3,
scheduleDate: "10-13",
scheduleType: "wpc",
scheduleLocation: "场馆",
scheduleStartTime: "2024-10-13 18:00:00",
scheduleEndTime: "2024-10-13 20:00:00",
scheduleSustainDuration: 2,
scheduleRemark: "WPC比赛",
},
],
wsc: [
{
id: 2,
scheduleDate: "10-13",
scheduleType: "wsc",
scheduleLocation: "场馆",
scheduleStartTime: "2024-10-13 15:00:00",
scheduleEndTime: "2024-10-13 17:00:00",
scheduleSustainDuration: 2,
scheduleRemark: "wsc比赛",
},
],
activity: [
{
id: 4,
scheduleDate: "10-13",
scheduleType: "activity",
scheduleLocation: "酒店",
scheduleStartTime: "2024-10-13 08:00:00",
scheduleEndTime: "2024-10-13 20:00:00",
scheduleSustainDuration: 12,
scheduleRemark: "接送服务",
},
],
},
}
x轴示例
[
{
time: "DATE/TIME",
type: "header",
},
{
time: "07:00",
},
{
time: "08:00",
},
{
time: "09:00",
},
{
time: "10:00",
},
{
time: "11:00",
},
{
time: "12:00",
},
{
time: "13:00",
},
{
time: "14:00",
},
{
time: "15:00",
},
{
time: "16:00",
},
{
time: "17:00",
},
{
time: "18:00",
},
{
time: "19:00",
},
{
time: "20:00",
},
{
time: "21:00",
},
]
y轴示例
[
{
dataTime: "10-13",
},
{
dataTime: "10-14",
},
{
dataTime: "10-15",
},
{
dataTime: "10-16",
},
{
dataTime: "10-17",
},
{
dataTime: "10-18",
}]