1.3.0 • Published 4 months ago

geek-ganttnew v1.3.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 months ago

gantt

简介

甘特图(Gantt chart)又称为横道图、条状图(Bar chart)、生产计划进度图。其通过条状图来显示项目,进度,和其他时间相关的系统进展的内在关Markdown Oper Preview to the Side系随着时间进展的情况。

展示页面

已支持el-table参数及事件列表

    :fit="fit"
    :size="size"
    :border="border"
    :data="selfData"
    :stripe="stripe"
    :height="height"
    :row-key="rowKey"
    :row-style="rowStyle"
    :class="dateTypeClass"
    :cell-style="cellStyle"
    :max-height="maxHeight"
    :tree-props="selfProps"
    :current-row-key="rowKey"
    :row-class-name="rowClassName"
    :cell-class-name="cellClassName"
    :expand-row-keys="expandRowKeys"
    :header-row-style="headerRowStyle"
    :header-cell-style="headerCellStyle"
    :default-expand-all="defaultExpandAll"
    :header-row-class-name="headerRowClassName"
    :highlight-current-row="highlightCurrentRow"
    :header-cell-class-name="headerCellClassName"
    :currentPage="pages.currentPage"
    :pageSizes="pages.pageSizes"
    :pageSize="pages.pageSize"
    :total="pages.total"
    
    :colorArr='colorArr'
    :colorLower='colorLower'
    :bgOne='bg_one'
    :bgTwo="bg_two"
    :bgThree="bg_three"
    :bgFour="bg_four"
    :bgLower="bg_lower"

    @header-contextmenu="handleHeaderContextMenu"
    @selection-change="handleSelectionChange"
    @row-contextmenu="handleRowContextMenu"
    @current-change="handleCurrentChange"
    @cell-mouse-enter="handleMouseEnter"
    @cell-mouse-leave="handleMouseLeave"
    @expand-change="handleExpandChange"
    @filter-change="handleFilterChange"
    @cell-dblclick="handleCellDbClick"
    @header-click="handleHeaderClick"
    @row-dblclick="handleRowDbClick"
    @sort-change="handleSortChange"
    @cell-click="handleCellClick"
    @select-all="handleSelectAll"
    @row-click="handleRowClick"
    @select="handleSelect"
    @rowClick="rowClick"
    @current-change-page="currentChange"

快速上手

npm i llz-gantt --save

npm i llz-gantt -S

import llzGantt from "llz-gantt/src/pages/wl-gantt" components:{llzGantt},

Attributes 参数

序号参数说明类型可选值默认值注意
1data数据Array-[]-
2dateTypegantt图区日期表头类型StringmonthAndDay、yearAndMonth、yearAndDayyearAndMonth-
3treeProps树表配置项Object--见下方props
4startDate项目开始时间String、Object必填-注意:不要求任务时间线在项目开始时间内,并且当任务时间超出项目时间时,将更新项目时间
5endDate项目结束时间String、Object必填-注意:不要求任务时间线在项目开始时间内,并且当任务时间超出项目时间时,将更新项目时间
6checkSource是否检查源数据符合规则Boolean--检查源数据为自动修改不符合规范的时间为符合规则的期望值
7treatIdAsIdentityId是否使用id来作为自增idBoolean-false如果是请保证id本来就简短的数字型而不是较长的字符串或guid
8autoGanttDateType自动调整gantt时间跨度类型,具体规则见版本记录1Boolean-true-
9nameFormatter名称列格式化内容函数Function--Function(row, column, cellValue, index)
10其他Table Attributes文档地址----
11usePreColumn是否使用内置前置任务列Boolean-false-
12preMultiple前置任务是否可以多选Boolean-true如果开启多选则pre字段必须是Array,否则可以是Number\String
13preFormatter前置内容列格式化函数Function--如不传则根据prop name字段+,拼接
14emptyCellText空值单元格占位符String-'-'-
15useCheckColumn是否使用内置复选框列Boolean-false-
16useIndexColumn是否使用内置序号列Boolean-false-
17edit是否可编辑Boolean-true-
18parentChild使用复选框时,是否父子关联Boolean-true必须配置props的id、children字段
19ganttOnly是否只显示图形Boolean-false-
20lazy同el-tableBoolean-false-
21load同el-tableFunction---
22contextMenuOptions右键浮窗配置项,如果存在则点击gantt右键显示配置的浮窗信息Array--数组内对象属性有: @param {String} label 展示名称 @param {String} prop 绑定的字段 * @param {String} icon 可选 字体图标class
23useRealTime是否使用实际开始时间、实际结束时间,开启则在计划时间蓝色条外展示实际时间棕红色条Boolean-false-
24color项目开始时间颜色String-blue-
25realColor时间开发时间颜色String-pick-
26otherColor其他时间颜色String-black-
27alreadyColor真实开发时间颜色String-green-
28currentPage状态布局String-center-
29pageSizes每页显示个数选择器的选项设置Array-10, 20, 30, 50, 100-
30pageSize每页显示条目个数Number-10-
31total总条目数Number-0-

新版支持双行无限极+无限极颜色自定义

| 1 | colorArr | 上面无限极颜色定义 | Array | - | '红色','绿色','黄色','黑色','粉红色','橙黄色','紫色' | - |
| 2 | colorLower | 下面无限极TAB显隐颜色 | Array | - | '红色' | - |
| 3 | bgOne | 第一条第一种颜色自定义 | String | - | 'yellow' | | 4 | bgTwo | 第一条第二种颜色自定义 | String | - | 'yellow' | | 5 | bgThree | 第一条第三种颜色自定义 | String | - | 'yellow' | | 6 | bgFour | 第一条第四种颜色自定义 | String | - | 'yellow' | | 7 | bgFive | 第一条第五种颜色自定义 | String | - | 'yellow' | | 8 | bgSix | 第一条第六种颜色自定义 | String | - | 'yellow' | | 9 | bgSeven | 第一条第七种颜色自定义 | String | - | 'yellow' | | 10 | bgLower | 第二条颜色自定义 | String | - | 'yellow' |

|

props 配置项

序号参数说明默认值
1children数据的子集children字段,表示为树表children
2name用于显示名字的字段name
3id每条数据的id,必须唯一id
4pid每条数据的父节点id字段pid
5startDate每条数据的开始时间字段startDate
6endDate每条数据的结束时间字段endDate
7identityId数据自增ididentityId
8parents自增父级id树,逗号分隔parents
9pre前置任务字段,字段值应是前置任务的idpre
10hasChildren指定哪些行是包含子节点hasChildren
11realStartDate实际开始时间字段realEndDate
12realEndDate实际结束时间字段realEndDate

Events 事件

序号事件名说明回调参数
1timeChange当任务时间发生更改时触发function(row) 依次为当前行数据
2其他Table Events文档地址--
3preChange前置任务修改事件function(row) 依次为当前行数据
4nameChange名称修改事件function(row) 依次为当前行数据
5taskAdd添加任务事件function(row) 依次为当前行数据
6taskRemove删除任务事件function(row) 依次为当前行数据
7rowClick右键点击事件function(row) 依次为当前行数据
8current-change-pagecurrentPage 改变时会触发function(row) 当前页
9size-changecurrentPage 改变时会触发function(row) 每页条数

Methods 方法

序号方法名说明回调参数
1loadTree手动调用树表懒加载function(row) 依次为要展开的行信息
2loadTreeAdd更新树表懒加载后的子节点function(id, list) 依次为要更新的节点id,要添加的子节点list,注意此为合并list和原来的子节点数据
3loadTreeRemove移除懒加载数据的子节点function(id, list) 依次为要更新的节点id,要删掉的子字节的rowKey

这里是重点!!!!!!# llz-gantt

简介

甘特图(Gantt chart)又称为横道图、条状图(Bar chart)、生产计划进度图。其通过条状图来显示项目,进度,和其他时间相关的系统进展的内在关Markdown Oper Preview to the Side系随着时间进展的情况。

展示页面

已支持el-table参数及事件列表

    :fit="fit"
    :size="size"
    :border="border"
    :data="selfData"
    :stripe="stripe"
    :height="height"
    :row-key="rowKey"
    :row-style="rowStyle"
    :class="dateTypeClass"
    :cell-style="cellStyle"
    :max-height="maxHeight"
    :tree-props="selfProps"
    :current-row-key="rowKey"
    :row-class-name="rowClassName"
    :cell-class-name="cellClassName"
    :expand-row-keys="expandRowKeys"
    :header-row-style="headerRowStyle"
    :header-cell-style="headerCellStyle"
    :default-expand-all="defaultExpandAll"
    :header-row-class-name="headerRowClassName"
    :highlight-current-row="highlightCurrentRow"
    :header-cell-class-name="headerCellClassName"
    :currentPage="pages.currentPage"
    :pageSizes="pages.pageSizes"
    :pageSize="pages.pageSize"
    :total="pages.total"
    
    :colorArr='colorArr'
    :colorLower='colorLower'
    :bgOne='bg_one'
    :bgTwo="bg_two"
    :bgThree="bg_three"
    :bgFour="bg_four"
    :bgLower="bg_lower"

    @header-contextmenu="handleHeaderContextMenu"
    @selection-change="handleSelectionChange"
    @row-contextmenu="handleRowContextMenu"
    @current-change="handleCurrentChange"
    @cell-mouse-enter="handleMouseEnter"
    @cell-mouse-leave="handleMouseLeave"
    @expand-change="handleExpandChange"
    @filter-change="handleFilterChange"
    @cell-dblclick="handleCellDbClick"
    @header-click="handleHeaderClick"
    @row-dblclick="handleRowDbClick"
    @sort-change="handleSortChange"
    @cell-click="handleCellClick"
    @select-all="handleSelectAll"
    @row-click="handleRowClick"
    @select="handleSelect"
    @rowClick="rowClick"
    @current-change-page="currentChange"

快速上手

npm i llz-gantt --save

npm i llz-gantt -S

import llzGantt from "llz-gantt/src/pages/wl-gantt" components:{llzGantt},

Attributes 参数

序号参数说明类型可选值默认值注意
1data数据Array-[]-
2dateTypegantt图区日期表头类型StringmonthAndDay、yearAndMonth、yearAndDayyearAndMonth-
3treeProps树表配置项Object--见下方props
4startDate项目开始时间String、Object必填-注意:不要求任务时间线在项目开始时间内,并且当任务时间超出项目时间时,将更新项目时间
5endDate项目结束时间String、Object必填-注意:不要求任务时间线在项目开始时间内,并且当任务时间超出项目时间时,将更新项目时间
6checkSource是否检查源数据符合规则Boolean--检查源数据为自动修改不符合规范的时间为符合规则的期望值
7treatIdAsIdentityId是否使用id来作为自增idBoolean-false如果是请保证id本来就简短的数字型而不是较长的字符串或guid
8autoGanttDateType自动调整gantt时间跨度类型,具体规则见版本记录1Boolean-true-
9nameFormatter名称列格式化内容函数Function--Function(row, column, cellValue, index)
10其他Table Attributes文档地址----
11usePreColumn是否使用内置前置任务列Boolean-false-
12preMultiple前置任务是否可以多选Boolean-true如果开启多选则pre字段必须是Array,否则可以是Number\String
13preFormatter前置内容列格式化函数Function--如不传则根据prop name字段+,拼接
14emptyCellText空值单元格占位符String-'-'-
15useCheckColumn是否使用内置复选框列Boolean-false-
16useIndexColumn是否使用内置序号列Boolean-false-
17edit是否可编辑Boolean-true-
18parentChild使用复选框时,是否父子关联Boolean-true必须配置props的id、children字段
19ganttOnly是否只显示图形Boolean-false-
20lazy同el-tableBoolean-false-
21load同el-tableFunction---
22contextMenuOptions右键浮窗配置项,如果存在则点击gantt右键显示配置的浮窗信息Array--数组内对象属性有: @param {String} label 展示名称 @param {String} prop 绑定的字段 * @param {String} icon 可选 字体图标class
23useRealTime是否使用实际开始时间、实际结束时间,开启则在计划时间蓝色条外展示实际时间棕红色条Boolean-false-
24color项目开始时间颜色String-blue-
25realColor时间开发时间颜色String-pick-
26otherColor其他时间颜色String-black-
27alreadyColor真实开发时间颜色String-green-
28currentPage状态布局String-center-
29pageSizes每页显示个数选择器的选项设置Array-10, 20, 30, 50, 100-
30pageSize每页显示条目个数Number-10-
31total总条目数Number-0-

|

props 配置项

序号参数说明默认值
1children数据的子集children字段,表示为树表children
2name用于显示名字的字段name
3id每条数据的id,必须唯一id
4pid每条数据的父节点id字段pid
5startDate每条数据的开始时间字段startDate
6endDate每条数据的结束时间字段endDate
7identityId数据自增ididentityId
8parents自增父级id树,逗号分隔parents
9pre前置任务字段,字段值应是前置任务的idpre
10hasChildren指定哪些行是包含子节点hasChildren
11realStartDate实际开始时间字段realEndDate
12realEndDate实际结束时间字段realEndDate

Events 事件

序号事件名说明回调参数
1timeChange当任务时间发生更改时触发function(row) 依次为当前行数据
2其他Table Events文档地址--
3preChange前置任务修改事件function(row) 依次为当前行数据
4nameChange名称修改事件function(row) 依次为当前行数据
5taskAdd添加任务事件function(row) 依次为当前行数据
6taskRemove删除任务事件function(row) 依次为当前行数据
7rowClick右键点击事件function(row) 依次为当前行数据
8current-change-pagecurrentPage 改变时会触发function(row) 当前页
9size-changecurrentPage 改变时会触发function(row) 每页条数

Methods 方法

序号方法名说明回调参数
1loadTree手动调用树表懒加载function(row) 依次为要展开的行信息
2loadTreeAdd更新树表懒加载后的子节点function(id, list) 依次为要更新的节点id,要添加的子节点list,注意此为合并list和原来的子节点数据
3loadTreeRemove移除懒加载数据的子节点function(id, list) 依次为要更新的节点id,要删掉的子字节的rowKey

这里是重点!!!!!! 最新版的修改参数。 双栏无限极展示,颜色自定义

序号方法名说明
1bgOne颜色自定义 rgba()
2bgTwo颜色自定义 rgba()
3bgThree颜色自定义 rgba()
4bgFour颜色自定义 rgba()
5bg_lower颜色自定义 rgba()

这里是重点!!!!!! 最新版的修改参数。 双栏无限极展示,data参数配置

序号方法名说明
1topinfiniteArray[] 上层无限极
2infiniteBetweenArray[] 下层无限极
3topinfiniteStartString '' 上层无限极开始,
4topinfiniteEndString '' 上层无限极结束,
5infiniteStartString '' 下层无限极开始
6infiniteEndString '' 下层无限极结束

下面是data JSON示例

data: [ { id: "1", pid: "0", name: "旅行", topinfinite: { topinfiniteStart:"2021-01-28", topinfiniteEnd:"2021-01-29", bg:"bgOne"}, { topinfiniteStart:"2021-02-06",topinfiniteEnd:"2021-02-10", bg:"bgTwo" } , infiniteBetween: {infiniteStart:'2021-02-01',infiniteEnd:'2021-02-01', bg:"bgOne"}, {infiniteStart:'2021-02-08',infiniteEnd:'2021-02-10', bg:"bgTwo"}, {infiniteStart:'2021-02-12',infiniteEnd:'2021-02-15', bg:"bgThree"}, {infiniteStart:'2021-02-20',infiniteEnd:'2021-02-25', bg:"bgTwo"}, } ]

1.3.0

4 months ago

1.2.9

5 months ago

1.2.8

5 months ago

1.2.7

5 months ago

1.2.6

5 months ago

1.2.5

5 months ago

1.2.4

5 months ago

1.2.3

6 months ago

1.2.2

6 months ago

1.2.1

6 months ago