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 🙏

© 2024 – Pkg Stats / Ryan Hefner

cls-gantt

v1.0.0

Published

cls-gantt

Downloads

9

Readme

组件

甘特图

demo 地址

安装

npm i cls-gantt

用法

import Tools from "cls-gantt"
Vue.use(Tools)

// 局部使用
import { varForm } from "./index"
Vue.use(varForm)

Props

start_time string 日历列表开始时间

days number 默认 10, 日历列表的总长度

oDayBoxHeight number 40 每一行的高度

oDayBoxWidth nunmber 60 每一天的宽度,18 及以下时为周视图

titles obj[] 按行分组,title 展示名,length 行数

titles = [
    {
        title: "1#",
        length: 5,
    },
]

tasks obj[] 任务贴片

task = [
    {
        task_id: 1, // 唯一识别,不可重复
        text: "螺纹HRB400|Φ20|12000mm,5000吨,完成率60%", // 展示文字
        row_index: 0, // 第几行
        start_date: "2023-01-01 12:00:00", // 开始日期
        duration: 0.5, // 持续时间
        theme: "blue", // 主题色
        is_lock: false, // 锁定状态
        data: { // 其他数据
            hello: 'hello hello hello'
        },
        // 页面操作后产生的值
        // is_selected: true, // 是否选中
        // end_date: "2023-01-13 06:22:00", // 结束事件,拖拽尾部后产生
        // is_drag_changed: true, // 是否被拖拽过,拖拽后产生
        // is_row_index_changed: true,// 是否被拖到其他行
        // row_info: {} // 被拖拽到其他时,新行的行信息
    },
]

themeType 可选的色彩主题

// ("blue", #365BE4, #365BE4),
// ("green", #39C235, #39C235),
// ("red", #F5222D, #F5222D),
// ("orange", #FF9C1C, #FF9C1C)

rows

export default [
    {
        id: 1,
        name: "1#小棒",
    },
    {
        id: 2,
        name: "2#小棒",
    },
    {
        id: 3,
        name: "3#小棒",
    },
    {
        id: 4,
        name: "4#小棒",
    },
    {
        id: 5,
        name: "5#小棒",
    },
]

adsorbType: number 吸附类型: 0 不吸附, 1 小时吸附,2 按天吸附

assistLine: boolean 拖拽辅助线

rightMenulists 右键菜单

rightMenulists: [
    {
        fnName: "heBing",
        params: {},
        icoName: "el-icon-download",
        btnName: "合 并",
        type: 'default',
        // divided: true,
        // disabled: true,
        // children: [],
    },
]

events

task-dbclick (task) => void

// 被点击的任务
handleTaskClick(task) {
    console.log('双击任务:  ', task)
}

task-change (task, origin_task) => void

// 将要改变为,原来的任务item
handleTaskChange(task, origin_task) {
    console.log('改变任务', task, origin_task)
}

task-change-error (task, origin_task, type) => void

// 将要改变为,原来的,错误类型
handleTaskChangeError(task, origin_task, type) {
    console.log('error ' + type, task, origin_task)
}

methods

getData (onlyChanged) => Task[] , onlyChanged 默认 true,获取的数组是否为改变过后的数据

getData() {
    // 默认变化过的
    const data = this.$refs.gantt.getData(true)
    console.log(data)
    // data 数据结构为 Task[]
}

setDayBoxWidth (width: number) => void 设置每天宽度

setBoxWidth(width = 60) {
    this.$refs.gantt.setDayBoxWidth(width)
}