diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 73d3f4b5..8c908365 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -44,6 +44,9 @@ importers: dayjs: specifier: 1.11.12 version: 1.11.12 + dhtmlx-gantt: + specifier: 8.0.9 + version: 8.0.9 dompurify: specifier: 3.1.6 version: 3.1.6 @@ -2282,6 +2285,9 @@ packages: devlop@1.1.0: resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} + dhtmlx-gantt@8.0.9: + resolution: {integrity: sha512-DONbnIjmVv7KiuHPmSEjZA2/XoSVGOviqx2vxRk/Vml+m8/YWMhoW+vP/rfkGEL8N764Gay41hI1ztfiNjWIVQ==} + diff-match-patch@1.0.5: resolution: {integrity: sha512-IayShXAgj/QMXgB0IWmKx+rOPuGMhqm5w6jvFxmVenXKIzRqTAAsbBPT3kWQeGANj3jGgvcvv4yK6SxqYmikgw==} @@ -7187,6 +7193,8 @@ snapshots: dependencies: dequal: 2.0.3 + dhtmlx-gantt@8.0.9: {} + diff-match-patch@1.0.5: {} dir-glob@3.0.1: diff --git a/src/typings/components.d.ts b/src/typings/components.d.ts index 374de604..09f7cdd1 100644 --- a/src/typings/components.d.ts +++ b/src/typings/components.d.ts @@ -45,7 +45,6 @@ declare module 'vue' { LangSwitch: typeof import('./../components/common/lang-switch.vue')['default'] LookForward: typeof import('./../components/custom/look-forward.vue')['default'] MenuToggler: typeof import('./../components/common/menu-toggler.vue')['default'] - NAlert: typeof import('naive-ui')['NAlert'] NBreadcrumb: typeof import('naive-ui')['NBreadcrumb'] NBreadcrumbItem: typeof import('naive-ui')['NBreadcrumbItem'] NButton: typeof import('naive-ui')['NButton'] @@ -69,7 +68,6 @@ declare module 'vue' { NFormItemGi: typeof import('naive-ui')['NFormItemGi'] NGi: typeof import('naive-ui')['NGi'] NGrid: typeof import('naive-ui')['NGrid'] - NGridItem: typeof import('naive-ui')['NGridItem'] NInput: typeof import('naive-ui')['NInput'] NInputGroup: typeof import('naive-ui')['NInputGroup'] NInputNumber: typeof import('naive-ui')['NInputNumber'] diff --git a/src/views/plugin/gantt/data.ts b/src/views/plugin/gantt/data.ts new file mode 100644 index 00000000..6331c74c --- /dev/null +++ b/src/views/plugin/gantt/data.ts @@ -0,0 +1,173 @@ +import type { Task } from 'dhtmlx-gantt'; + +export const ganttTasks: Task[] = [ + { + id: 11, + text: 'Soybean 架构设计', + type: 'project', + progress: 0, + open: true, + start_date: new Date('2024-01-10 00:00'), + duration: 12, + parent: 0 + }, + { + id: 12, + text: '测试版本', + start_date: new Date('2024-03-20 00:00'), + type: 'project', + duration: 5, + render: 'split', + parent: '11', + progress: 0, + open: true + }, + { + id: 99, + text: '测试版本1 发布', + start_date: new Date('2024-03-20 00:00'), + end_date: new Date('2024-03-25 00:00'), + parent: '12', + progress: 0, + open: true + }, + { + id: 98, + text: '测试版本2 发布', + start_date: new Date('2024-03-26 00:00'), + duration: 4, + parent: '12', + progress: 0, + open: true + }, + { + id: 97, + text: '测试版本3 发布', + start_date: new Date('2024-03-31 00:00'), + duration: 10, + parent: '12', + progress: 0, + open: true + }, + { + id: 13, + text: '1.0 版本', + start_date: new Date('2024-03-31 00:00'), + type: 'project', + render: 'split', + parent: '11', + progress: 0.5, + open: false, + duration: 11 + }, + { + id: 17, + text: '1.0正式发布', + start_date: new Date('2024-03-31 00:00'), + end_date: new Date('2024-04-03 00:00'), + parent: '13', + progress: 0, + open: true + }, + { + id: 18, + text: '1.0.1 版本', + start_date: new Date('2024-04-03 00:00'), + duration: 5, + parent: '13', + progress: 0, + open: true + }, + { + id: 19, + text: '1.0.2 版本', + start_date: new Date('2024-04-08 00:00'), + duration: 6, + parent: '13', + progress: 0, + open: true + }, + { + id: 20, + text: '1.0.3 版本', + start_date: new Date('2024-04-16 00:00'), + duration: 8, + parent: '13', + progress: 0, + open: true + }, + { + id: 31, + text: '1.0.4 版本', + start_date: new Date('2024-04-17 00:00'), + duration: 8, + parent: '13', + progress: 0, + open: true + }, + { + id: 32, + text: '1.0.5 版本', + start_date: new Date('2024-04-26 00:00'), + duration: 9, + parent: '13', + progress: 0, + open: true + }, + { + id: 33, + text: '1.0.9 版本', + start_date: new Date('2024-05-05 00:00'), + duration: 2, + parent: '13', + progress: 0, + open: true + }, + { + id: 14, + text: '1.1 版本', + start_date: new Date('2024-05-07 00:00'), + duration: 30, + parent: '11', + progress: 0, + open: true + }, + { + id: 15, + text: '1.2 版本', + start_date: new Date('2024-06-06 00:00'), + duration: 46, + parent: '11', + progress: 0, + open: true + }, + { + id: 16, + text: '1.3版本', + type: 'project', + render: 'split', + parent: '11', + progress: 0, + open: true, + start_date: new Date('2024-07-22 00:00'), + duration: 11 + }, + { + id: 21, + text: '1.3.1版本', + start_date: new Date('2024-07-22 00:00'), + duration: 7, + parent: '16', + progress: 0, + open: true + }, + { + id: 22, + text: '1.3.2版本', + start_date: new Date('2024-07-29 00:00'), + duration: 7, + parent: '16', + progress: 0, + open: true + } +]; diff --git a/src/views/plugin/gantt/ganntData.ts b/src/views/plugin/gantt/ganntData.ts deleted file mode 100644 index 42b48f0b..00000000 --- a/src/views/plugin/gantt/ganntData.ts +++ /dev/null @@ -1,173 +0,0 @@ -export const demoData = { - data: [ - { - id: 11, - text: 'Soybean 架构设计', - type: 'project', - progress: 0, - open: true, - start_date: '2024-01-10 00:00', - duration: 12, - parent: 0 - }, - { - id: 12, - text: '测试版本', - start_date: '2024-03-20 00:00', - type: 'project', - duration: 5, - render: 'split', - parent: '11', - progress: 0, - open: true - }, - { - id: 99, - text: '测试版本1 发布', - start_date: '2024-03-20 00:00', - end_date: '2024-03-25 00:00', - parent: '12', - progress: 0, - open: true - }, - { - id: 98, - text: '测试版本2 发布', - start_date: '2024-03-26 00:00', - duration: 4, - parent: '12', - progress: 0, - open: true - }, - { - id: 97, - text: '测试版本3 发布', - start_date: '2024-03-31 00:00', - duration: 10, - parent: '12', - progress: 0, - open: true - }, - { - id: 13, - text: '1.0 版本', - start_date: '2024-03-31 00:00', - type: 'project', - render: 'split', - parent: '11', - progress: 0.5, - open: false, - duration: 11 - }, - { - id: 17, - text: '1.0正式发布', - start_date: '2024-03-31 00:00', - end_date: '2024-04-03 00:00', - parent: '13', - progress: 0, - open: true - }, - { - id: 18, - text: '1.0.1 版本', - start_date: '2024-04-03 00:00', - duration: 5, - parent: '13', - progress: 0, - open: true - }, - { - id: 19, - text: '1.0.2 版本', - start_date: '2024-04-08 00:00', - duration: 6, - parent: '13', - progress: 0, - open: true - }, - { - id: 20, - text: '1.0.3 版本', - start_date: '2024-04-16 00:00', - duration: 8, - parent: '13', - progress: 0, - open: true - }, - { - id: 31, - text: '1.0.4 版本', - start_date: '2024-04-17 00:00', - duration: 8, - parent: '13', - progress: 0, - open: true - }, - { - id: 32, - text: '1.0.5 版本', - start_date: '2024-04-26 00:00', - duration: 9, - parent: '13', - progress: 0, - open: true - }, - { - id: 33, - text: '1.0.9 版本', - start_date: '2024-05-05 00:00', - duration: 2, - parent: '13', - progress: 0, - open: true - }, - { - id: 14, - text: '1.1 版本', - start_date: '2024-05-07 00:00', - duration: 30, - parent: '11', - progress: 0, - open: true - }, - { - id: 15, - text: '1.2 版本', - start_date: '2024-06-06 00:00', - duration: 46, - parent: '11', - progress: 0, - open: true - }, - { - id: 16, - text: '1.3版本', - type: 'project', - render: 'split', - parent: '11', - progress: 0, - open: true, - start_date: '2024-07-22 00:00', - duration: 11 - }, - { - id: 21, - text: '1.3.1版本', - start_date: '2024-07-22 00:00', - duration: 7, - parent: '16', - progress: 0, - open: true - }, - { - id: 22, - text: '1.3.2版本', - start_date: '2024-07-29 00:00', - duration: 7, - parent: '16', - progress: 0, - open: true - } - ] -}; diff --git a/src/views/plugin/gantt/index.vue b/src/views/plugin/gantt/index.vue index cfbd3eb2..07a49a56 100644 --- a/src/views/plugin/gantt/index.vue +++ b/src/views/plugin/gantt/index.vue @@ -1,17 +1,22 @@ - +