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

gantt-elastic-add

v1.0.0

Published

基于GanttElastic组件的二次开发

Downloads

2

Readme

基于GanttElastic组件的二次开发,增加功能: 1、增加任务列表和甘特图的收缩 2、扩展自定义插槽列 3、任务列表可选择 4、前置任务finish-to-start模式 5、

安装

npm install gantt-npm

使用

<template>
  <div id="app">
		<gantt-elastic-add
			ref="gantt"
			:tasks="tasks"
			:options="options"
		></gantt-elastic-add>
  </div>
</template>

<script>
import GanttElasticAdd from 'gantt-npm'
import dayjs from 'dayjs'

export default {
  name: 'app',
  components: {
		GanttElasticAdd
  },
  data() {
	  return {
			tasks: [
				{taskName: '任务1', id: '0', start: 1647360000000, end: 1647446400000, type: 'project'},
				{taskName: '子任务1', id: '1', pid: '0', start: 1647360000000, end: 1647360000000, type: 'task'},
				{taskName: '子任务2', id: '2', pid: '0', start: 1647446400000, end: 1647446400000, dependentOn: ['1'], type: 'task'},
				{taskName: '任务2', id: '3'}
			],
			options: {
			    taskMapping: {
			      progress: "percent",
			    },
			    maxRows: 100,
			    maxHeight: 650,
			    height: 180,
			    title: {
			      label: "Gantt Title",
			      html: false
			    },
			    row: {
			      height: 32,
			    },
			    times: {
			      timeScale: 60 * 100 * 9,
			      timeZoom: 21,
			      firstTaskTime: new Date('2021-10-12').getTime(),
			      lastTaskTime: new Date('2022-10-12').getTime()
			    },
			    calendar: {
			      height: 50,
			      workingDays: [0, 1, 2, 3, 4, 5, 6],
			      gap: 0,
			      day: {
			        height: 25,
			      },
			      month: {
			        height: 25
			      },
			      hour: {
			        display: false
			      },
			    },
			    chart: {
			      progress: {
			        bar: false
			      },
			      expander: {
			        display: true
			      }
			    },
			    taskList: {
			      expander: {
			        straight: false
			      },
			      check: true,
			      widthThreshold: 100,
			      columns: [
			        {
			          id: 1,
			          label: "序号",
			          value: "serial",
			          width: 50,
			          style: {
			            "task-list-item-value-container": {
			              "text-align": "center",
			              width: "100%"
			            }
			          }
			        },
			        {
			          id: 2,
			          label: "任务名称",
			          value: 'taskName',
			          width: 180,
			          expander: true,
			          html: false,
								slot: 'title',
			          events: {
			          },
			          style: {
			            'task-list-header-label': {
			              display: 'flex',
			              'justify-content': 'center',
			              'align-items': 'center'
			            }
			          }
			        },
			        {
			          id: 3,
			          label: '工期(天)',
			          value: 'timeLimit',
			          width: 80,
			          slot: 'timeLimit',
			          style: {
			            "task-list-item-value-container": {
			              "text-align": "center",
			              width: "100%"
			            }
			          }
			        },
			        {
			          id: 4,
			          label: "开始日期",
			          value: task => task.start ? dayjs(task.start).format('YYYY-MM-DD') : '',
			          html: true,
			          width: 120,
			          style: {
			            "task-list-header-label": {
			              "text-align": "center",
			              width: "100%"
			            },
			            "task-list-item-value-container": {
			              "text-align": "center",
			              width: "100%"
			            }
			          },
			          events: {
			          }
			        },
			        {
			          id: 5,
			          label: "结束日期",
			          value: task => task.end ? dayjs(task.end).format('YYYY-MM-DD') : '',
			          width: 120,
			          style: {
			            "task-list-header-label": {
			              "text-align": "center",
			              width: "100%"
			            },
			            "task-list-item-value-container": {
			              "text-align": "center",
			              width: "100%"
			            }
			          }
			        },
			        {
			          id: 6,
			          label: '前置任务',
			          value: 'dependentOn',
			          width: 100,
			          style: {
			            "task-list-item-value-container": {
			              "text-align": "center",
			              width: "100%"
			            }
			          }
			        },
			      ]
			    },
			    locale: {
			      name: "zh",
			      Now: "Now",
			      weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
			      weekdaysShort: '日_一_二_三_四_五_六'.split('_'),
			      weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
			      months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
			      monthsShort: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
			      weekStart: 1,
			      relativeTime: {
			        future: 'in %s',
			        past: '%s ago',
			        s: '几秒钟',
			        m: '一分钟',
			        mm: '%d 分钟',
			        h: '一小时',
			        hh: '%d 小时',
			        d: '一天',
			        dd: '%d 天',
			        M: '一月',
			        MM: '%d 月',
			        y: '一年',
			        yy: '%d 年',
			      },
			      formats: {
			        LT: 'HH:mm',
			        LTS: 'HH:mm:ss',
			        L: 'DD/MM/YYYY',
			        LL: 'D MMMM YYYY',
			        LLL: 'D MMMM YYYY HH:mm',
			        LLLL: 'dddd, D MMMM YYYY HH:mm',
			      },
			      ordinal: (n) => {
			        const s = ['th', 'st', 'nd', 'rd'];
			        const v = n % 100;
			        return `[${n}${s[(v - 20) % 10] || s[v] || s[0]}]`;
			      },
			
			      "X-Scale": "Zoom-X",
			      "Y-Scale": "Zoom-Y",
			      "Task list width": "Task list",
			      "Before/After": "Expand",
			      "Display task list": "Task list"
			    }
			},
	  }
  },
}
</script>

文档

待更新