npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

tp-gantt

v1.0.14

Published

一个基于vue甘特图组件,gantt、项目管理

Downloads

13

Readme

tp-gantt

(Vue仿Teambition甘特图 基于ts-gantt改造)

简介

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

快速上手

npm install --save tp-gantt

import tpGantt from 'tp-gantt'
import 'tp-gantt/lib/tp-gantt.css'

components: {
    tpGantt
}
npm run serve

文档

Attributes 参数

| 序号 | 参数 | 说明 | 类型 | 可选值 | 默认值 | 注意 | | ---- | ---- | ---- | ---- | ---- | ---- | ---- | | 1 | data | 数据 | Task[] | | [] | | | 2 | columns | 表格列字段数据 | Column[] | 任务标题、执行者、截止时间、前置依赖 | 不传 | | | | 3 | viewType | 视图类型 | string | 支持日视图(day)、周视图(week)、月视图(month)、季视图(quarter)、年视图(halfYear) | day | TODO 待实现(增加该参数) | | 4 | translateDate | 甘特图时间偏移值 | 支持dayjs对象 或标准时间字符串、日期对象、或ms时间戳 | | 当前时间 | | TODO 待增加该参数 | | | ... | 其他控制字段(待开发) | 控制排序,是否可编辑等 | | | | |

数据类型定义要包含字段

Task 配置项

| 序号 | 参数 | 说明 | 类型 | 默认值 | | ---- | ---- | ---- | ---- | ---- | | 1 | children | 数据的子集children字段,表示为树表 [必须字段]| Task[] | [] | | 2 | content | 任务描述的内容,任务标题列[必须字段] | string | | | 3 | executor | 执行人[必须字段] | String | | | 4 | startDate | 开始时间[必须字段] | 标准日期即可 string或Date | | | 5 | endDate | 截止日期[必须字段] | 标准日期即可 string或Date | | | 6 | collapsed | 是否折叠子任务 | boolean | false | | 7 | color | 外部可根据状态定义条状图颜色 | string | | | 7 | [x : tring ]: any | 其他扩展字段用户自定义 | any | |

Column 配置项

| 序号 | 参数 | 说明 | 类型 | 默认值 | | ---- | ---- | ---- | ---- | ---- | | 1 | width | 列的宽度配置 | number | | | 2 | minWidth | 列最小宽度 | number | | | 3 | name | 列的字段名称 | string | | | 4 | visible | 是否隐藏列(暂未支持) | boolean | | | 5 | sortable | 是否可排序(暂未支持)| boolean | |

Events 事件

| 序号 | 事件名 | 说明 | 回调参数 | | ---- | ---- | ---- | ---- | | 1 | onTaskCreate | 创建任务 | function(parent, task) 依次为任务数据与父级任务数据 | | 3 | onTaskDelete | 删除任务 | function(task) 依次为当前任务行数据 | | 4 | onTaskIndent | 任务左右移动切换父子任务 | function(parent, task) 依次为左右移动的父任务、与移动当前任务 | | 5 | onTaskChangeContent | 任务内容发生变更 | function(task, content, oldContent) 依次为当前行数据 | | 6 | onTaskTimeChange | 任务时间变更(时间dayjs类型) | function(task, startDate, endDate) 依次为当前行数据 | | 7 | onToDetail | 进入详情 | function(task) 当前行数据 | | 8 | onDragSort | 拖拽排序 | function(preParent, parentTask, preIndex, index, handleTask) 移动前后父级任务及位置 | | 9 | changeTaskType | 切换任务类型 | function(task) 当前行数据 |

Methods 方法

版本记录

1.0.9 增加连线功能(注:点击端点连线实现连线)

1.0.0 基于ts-gantt完善修改基础功能