diff --git a/package.json b/package.json index 796ed212..f8b898d8 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,8 @@ "@sa/utils": "workspace:*", "@visactor/vchart": "1.12.8", "@visactor/vchart-theme": "1.12.1", + "@visactor/vtable-editors": "1.10.1", + "@visactor/vtable-gantt": "1.10.1", "@visactor/vue-vtable": "1.10.1", "@vueuse/components": "^11.1.0", "@vueuse/core": "11.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ddf78970..fd6e7acb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -47,6 +47,12 @@ importers: '@visactor/vchart-theme': specifier: 1.12.1 version: 1.12.1(@visactor/vchart@1.12.8) + '@visactor/vtable-editors': + specifier: 1.10.1 + version: 1.10.1 + '@visactor/vtable-gantt': + specifier: 1.10.1 + version: 1.10.1 '@visactor/vue-vtable': specifier: 1.10.1 version: 1.10.1 @@ -2814,6 +2820,17 @@ packages: resolution: {integrity: sha512-iZ3iAmqJz6lYQgeHi5qThvnZJZEDtNTMQw93SxxMxBy6Xhz3KNGQMswKMMcdb7czs+48OB7SnDl4tXoq6foZOw==} dev: false + /@visactor/vtable-gantt@1.10.1: + resolution: {integrity: sha512-QZ6U64JH7qLr8LkHa+LhNBjbHuPuIBFbGHVmh6HixVaV1IFZPsmQ2WV/VX8wMMyVuDHth4Z+7Yh89MJQdQeTkA==} + dependencies: + '@visactor/vdataset': 0.18.17 + '@visactor/vscale': 0.18.17 + '@visactor/vtable': 1.10.1 + '@visactor/vtable-editors': 1.10.1 + '@visactor/vutils': 0.18.17 + cssfontparser: 1.2.1 + dev: false + /@visactor/vtable@1.10.1: resolution: {integrity: sha512-UHxyIIp28zpxQKMpqitAYadHDksjSayH5m4TKuYo9H3V0UmN6csp8OPS5J0vexfiKDu4YhAIZPcfFsWq5ZD7OA==} dependencies: diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index 5282664e..9caf710a 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -214,6 +214,8 @@ const local: App.I18n.Schema = { plugin_excel: 'Excel', plugin_pdf: 'PDF preview', plugin_gantt: 'Gantt Chart', + plugin_gantt_dhtmlx: 'dhtmlxGantt', + plugin_gantt_vtable: 'VTableGantt', plugin_typeit: 'Typeit', plugin_tables: 'Tables', plugin_tables_vtable: 'VTable' diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index 3f880917..00cc923f 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -214,6 +214,8 @@ const local: App.I18n.Schema = { plugin_excel: 'Excel', plugin_pdf: 'PDF 预览', plugin_gantt: '甘特图', + plugin_gantt_dhtmlx: 'dhtmlxGantt', + plugin_gantt_vtable: 'VTableGantt', plugin_typeit: '打字机', plugin_tables: '表格', plugin_tables_vtable: 'VTable' diff --git a/src/router/elegant/imports.ts b/src/router/elegant/imports.ts index 40a4ff05..27bc8c48 100644 --- a/src/router/elegant/imports.ts +++ b/src/router/elegant/imports.ts @@ -47,7 +47,8 @@ export const views: Record Promise import("@/views/plugin/editor/markdown/index.vue"), plugin_editor_quill: () => import("@/views/plugin/editor/quill/index.vue"), plugin_excel: () => import("@/views/plugin/excel/index.vue"), - plugin_gantt: () => import("@/views/plugin/gantt/index.vue"), + plugin_gantt_dhtmlx: () => import("@/views/plugin/gantt/dhtmlx/index.vue"), + plugin_gantt_vtable: () => import("@/views/plugin/gantt/vtable/index.vue"), plugin_icon: () => import("@/views/plugin/icon/index.vue"), plugin_map: () => import("@/views/plugin/map/index.vue"), plugin_pdf: () => import("@/views/plugin/pdf/index.vue"), diff --git a/src/router/elegant/routes.ts b/src/router/elegant/routes.ts index e8078e2b..3dc302a7 100644 --- a/src/router/elegant/routes.ts +++ b/src/router/elegant/routes.ts @@ -492,12 +492,32 @@ export const generatedRoutes: GeneratedRoute[] = [ { name: 'plugin_gantt', path: '/plugin/gantt', - component: 'view.plugin_gantt', meta: { title: 'plugin_gantt', i18nKey: 'route.plugin_gantt', icon: 'ant-design:bar-chart-outlined' - } + }, + children: [ + { + name: 'plugin_gantt_dhtmlx', + path: '/plugin/gantt/dhtmlx', + component: 'view.plugin_gantt_dhtmlx', + meta: { + title: 'plugin_gantt_dhtmlx', + i18nKey: 'route.plugin_gantt_dhtmlx' + } + }, + { + name: 'plugin_gantt_vtable', + path: '/plugin/gantt/vtable', + component: 'view.plugin_gantt_vtable', + meta: { + title: 'plugin_gantt_vtable', + i18nKey: 'route.plugin_gantt_vtable', + localIcon: 'visactor' + } + } + ] }, { name: 'plugin_icon', diff --git a/src/router/elegant/transform.ts b/src/router/elegant/transform.ts index f2aea48c..ed5a79c4 100644 --- a/src/router/elegant/transform.ts +++ b/src/router/elegant/transform.ts @@ -220,6 +220,8 @@ const routeMap: RouteMap = { "plugin_editor_quill": "/plugin/editor/quill", "plugin_excel": "/plugin/excel", "plugin_gantt": "/plugin/gantt", + "plugin_gantt_dhtmlx": "/plugin/gantt/dhtmlx", + "plugin_gantt_vtable": "/plugin/gantt/vtable", "plugin_icon": "/plugin/icon", "plugin_map": "/plugin/map", "plugin_pdf": "/plugin/pdf", diff --git a/src/typings/elegant-router.d.ts b/src/typings/elegant-router.d.ts index 87d194e9..e7c44fbb 100644 --- a/src/typings/elegant-router.d.ts +++ b/src/typings/elegant-router.d.ts @@ -74,6 +74,8 @@ declare module "@elegant-router/types" { "plugin_editor_quill": "/plugin/editor/quill"; "plugin_excel": "/plugin/excel"; "plugin_gantt": "/plugin/gantt"; + "plugin_gantt_dhtmlx": "/plugin/gantt/dhtmlx"; + "plugin_gantt_vtable": "/plugin/gantt/vtable"; "plugin_icon": "/plugin/icon"; "plugin_map": "/plugin/map"; "plugin_pdf": "/plugin/pdf"; @@ -192,7 +194,8 @@ declare module "@elegant-router/types" { | "plugin_editor_markdown" | "plugin_editor_quill" | "plugin_excel" - | "plugin_gantt" + | "plugin_gantt_dhtmlx" + | "plugin_gantt_vtable" | "plugin_icon" | "plugin_map" | "plugin_pdf" diff --git a/src/views/plugin/gantt/data.ts b/src/views/plugin/gantt/dhtmlx/data.ts similarity index 100% rename from src/views/plugin/gantt/data.ts rename to src/views/plugin/gantt/dhtmlx/data.ts diff --git a/src/views/plugin/gantt/index.vue b/src/views/plugin/gantt/dhtmlx/index.vue similarity index 100% rename from src/views/plugin/gantt/index.vue rename to src/views/plugin/gantt/dhtmlx/index.vue diff --git a/src/views/plugin/gantt/vtable/data.ts b/src/views/plugin/gantt/vtable/data.ts new file mode 100644 index 00000000..cb80dc6a --- /dev/null +++ b/src/views/plugin/gantt/vtable/data.ts @@ -0,0 +1,721 @@ +export const basicGanttRecords = [ + { + id: 1, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-24', + end: '2024-08-15', + progress: 31, + priority: 'P0', + children: [ + { + id: 2, + title: 'Project Feature Review', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-24', + end: '2024-07-24', + progress: 60, + priority: 'P0' + }, + { + id: 3, + title: 'Determine project scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-25', + end: '2024-07-26', + progress: 100, + priority: 'P1' + }, + { + id: 3, + title: 'Project Create', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-27', + end: '2024-07-26', + progress: 100, + priority: 'P1' + }, + { + id: 3, + title: 'Develop feature 1', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-08-01', + end: '2024-08-15', + progress: 0, + priority: 'P1' + } + ] + }, + { + id: 2, + title: 'Scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-24', + end: '2024-08-01', + progress: 60, + priority: 'P0' + }, + { + id: 3, + title: 'Determine project scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-24', + end: '2024-08-04', + progress: 100, + priority: 'P1', + children: [ + { + id: 1, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-08-01', + end: '2024-08-01', + progress: 90, + priority: 'P0' + }, + { + id: 1, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-30', + end: '2024-08-04', + progress: 31, + priority: 'P0' + }, + { + id: 2, + title: 'Scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024.07.26', + end: '2024.07.08', + progress: 60, + priority: 'P0' + }, + { + id: 3, + title: 'Determine project scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-29', + end: '2024-07-31', + progress: 100, + priority: 'P1' + }, + { + id: 1, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '07.24.2024', + end: '08.04.2024', + progress: 31, + priority: 'P0' + }, + { + id: 2, + title: 'Scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-16', + end: '2024-07-18', + progress: 60, + priority: 'P0' + }, + { + id: 3, + title: 'Determine project scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-08-09', + end: '2024-09-11', + progress: 100, + priority: 'P1' + } + ] + }, + + { + id: 1, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-24', + end: '2024-08-04', + progress: 31, + priority: 'P0' + }, + { + id: 2, + title: 'Scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-26', + end: '2024-07-28', + progress: 60, + priority: 'P0', + children: [ + { + id: 3, + title: 'Determine project scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-29', + end: '2024-07-31', + progress: 100, + priority: 'P1', + children: [ + { + id: 1, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-24', + end: '2024-08-04', + progress: 31, + priority: 'P0' + }, + { + id: 2, + title: 'Scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-26', + end: '2024-07-28', + progress: 60, + priority: 'P0' + }, + { + id: 3, + title: 'Determine project scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-29', + end: '2024-07-31', + progress: 100, + priority: 'P1' + } + ] + }, + { + id: 1, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-24', + end: '2024-08-04', + progress: 31, + priority: 'P0', + children: [ + { + id: 1, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-24', + end: '2024-08-04', + progress: 31, + priority: 'P0' + }, + { + id: 2, + title: 'Scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-06', + end: '2024-07-08', + progress: 60, + priority: 'P0' + }, + { + id: 3, + title: 'Determine project scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-29', + end: '2024-07-31', + progress: 100, + priority: 'P1' + } + ] + }, + { + id: 2, + title: 'Scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-26', + end: '2024-07-28', + progress: 60, + priority: 'P0' + }, + { + id: 3, + title: 'Determine project scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-29', + end: '2024-07-31', + progress: 100, + priority: 'P1', + children: [ + { + id: 1, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-24', + end: '2024-08-04', + progress: 31, + priority: 'P0' + }, + { + id: 2, + title: 'Scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-06', + end: '2024-07-08', + progress: 60, + priority: 'P0' + } + ] + }, + { + id: 1, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-24', + end: '2024-08-04', + progress: 31, + priority: 'P0' + }, + { + id: 2, + title: 'Scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-26', + end: '2024-07-28', + progress: 60, + priority: 'P0' + }, + { + id: 3, + title: 'Determine project scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-29', + end: '2024-07-31', + progress: 100, + priority: 'P1' + } + ] + }, + + { + id: 3, + title: 'Determine project scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-29', + end: '2024-07-31', + progress: 100, + priority: 'P1', + children: [ + { + id: 1, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-24', + end: '2024-08-04', + progress: 31, + priority: 'P0' + }, + { + id: 2, + title: 'Scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-23', + end: '2024-07-28', + progress: 60, + priority: 'P0' + }, + { + id: 3, + title: 'Determine project scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-29', + end: '2024-07-31', + progress: 100, + priority: 'P1' + }, + { + id: 1, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-30', + end: '2024-08-14', + progress: 31, + priority: 'P0' + }, + { + id: 2, + title: 'Scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-24', + end: '2024-08-04', + progress: 60, + priority: 'P0' + } + ] + }, + { + id: 1, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-24', + end: '2024-08-04', + progress: 31, + priority: 'P0', + children: [ + { + id: 3, + title: 'Determine project scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-24', + end: '2024-08-04', + progress: 100, + priority: 'P1' + }, + { + id: 1, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-08-04', + end: '2024-08-04', + progress: 90, + priority: 'P0' + }, + { + id: 2, + title: 'Scope', + developer: 'liufangfang.jane@bytedance.com', + start: '07/24/2024', + end: '08/04/2024', + progress: 60, + priority: 'P0' + } + ] + }, + { + id: 2, + title: 'Scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-27', + end: '2024-07-28', + progress: 60, + priority: 'P0' + }, + { + id: 3, + title: 'Determine project scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-29', + end: '2024-07-31', + progress: 100, + priority: 'P1', + children: [ + { + id: 1, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '07.24.2024', + end: '08.04.2024', + progress: 31, + priority: 'P0' + }, + { + id: 2, + title: 'Scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-26', + end: '2024-07-28', + progress: 60, + priority: 'P0' + }, + { + id: 3, + title: 'Determine project scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-08-09', + end: '2024-09-11', + progress: 100, + priority: 'P1' + }, + { + id: 1, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-24', + end: '2024-08-04', + progress: 31, + priority: 'P0' + }, + { + id: 2, + title: 'Scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-26', + end: '2024-07-28', + progress: 60, + priority: 'P0' + }, + { + id: 3, + title: 'Determine project scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-29', + end: '2024-07-31', + progress: 100, + priority: 'P1' + }, + { + id: 1, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-24', + end: '2024-08-04', + progress: 31, + priority: 'P0' + }, + { + id: 2, + title: 'Scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-26', + end: '2024-07-28', + progress: 60, + priority: 'P0' + }, + { + id: 3, + title: 'Determine project scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-29', + end: '2024-07-31', + progress: 100, + priority: 'P1' + } + ] + }, + { + id: 1, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-24', + end: '2024-08-04', + progress: 31, + priority: 'P0', + children: [ + { + id: 3, + title: 'Determine project scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-24', + end: '2024-08-04', + progress: 100, + priority: 'P1' + }, + { + id: 1, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-24', + end: '2024-08-04', + progress: 31, + priority: 'P0' + }, + { + id: 2, + title: 'Scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024.07.06', + end: '2024.07.08', + progress: 60, + priority: 'P0' + }, + { + id: 3, + title: 'Determine project scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-29', + end: '2024-07-31', + progress: 100, + priority: 'P1' + } + ] + } +]; + +export const linkGanttRecords = [ + { + id: 1, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-15', + end: '2024-07-16', + progress: 31, + priority: 'P0' + }, + { + id: 2, + title: 'Scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-16', + end: '2024-07-17', + progress: 60, + priority: 'P0' + }, + { + id: 3, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-18', + end: '2024-07-19', + progress: 90, + priority: 'P0' + }, + { + id: 4, + title: 'Determine project scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024/07/17', + end: '2024/07/18', + progress: 100, + priority: 'P1' + }, + { + id: 5, + title: 'Scope', + developer: 'liufangfang.jane@bytedance.com', + start: '07/19/2024', + end: '07/20/2024', + progress: 60, + priority: 'P0' + }, + { + id: 6, + title: 'Determine project scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-24', + end: '2024-08-04', + progress: 100, + priority: 'P1' + }, + { + id: 7, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-24', + end: '2024-08-04', + progress: 31, + priority: 'P0' + }, + { + id: 8, + title: 'Scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024.07.06', + end: '2024.07.08', + progress: 60, + priority: 'P0' + }, + { + id: 9, + title: 'Determine project scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024/07/09', + end: '2024/07/11', + progress: 100, + priority: 'P1' + }, + { + id: 10, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '07.24.2024', + end: '08.04.2024', + progress: 31, + priority: 'P0' + }, + + { + id: 11, + title: 'Software Development', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-24', + end: '2024-08-04', + progress: 31, + priority: 'P0' + }, + { + id: 12, + title: 'Scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-06', + end: '2024-07-08', + progress: 60, + priority: 'P0' + }, + { + id: 13, + title: 'Determine project scope', + developer: 'liufangfang.jane@bytedance.com', + start: '2024-07-09', + end: '2024-07-11', + progress: 100, + priority: 'P1' + } +]; + +export const customGanttRecords = [ + { + id: 1, + title: 'Project Task 1', + developer: 'bear.xiong', + avatar: 'https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/custom-render/bear.jpg', + start: '2024-07-24', + end: '2024-07-26', + progress: 31, + priority: 'P0' + }, + { + id: 2, + title: 'Project Task 2', + developer: 'wolf.lang', + avatar: 'https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/custom-render/wolf.jpg', + start: '07/25/2024', + end: '07/28/2024', + progress: 60, + priority: 'P0' + }, + { + id: 3, + title: 'Project Task 3', + developer: 'rabbit.tu', + avatar: 'https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/custom-render/rabbit.jpg', + start: '2024-07-28', + end: '2024-08-01', + progress: 100, + priority: 'P1' + }, + { + id: 1, + title: 'Project Task 4', + developer: 'cat.mao', + avatar: 'https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/custom-render/cat.jpg', + start: '2024-07-31', + end: '2024-08-03', + progress: 31, + priority: 'P0' + }, + { + id: 2, + title: 'Project Task 5', + developer: 'bird.niao', + avatar: 'https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/custom-render/bird.jpeg', + start: '2024-08-02', + end: '2024-08-04', + progress: 60, + priority: 'P0' + }, + { + id: 3, + title: 'Project Task 6', + developer: 'flower.hua', + avatar: 'https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/custom-render/flower.jpg', + start: '2024-08-03', + end: '2024-08-10', + progress: 100, + priority: 'P1' + } +]; diff --git a/src/views/plugin/gantt/vtable/index.vue b/src/views/plugin/gantt/vtable/index.vue new file mode 100644 index 00000000..6f2c548b --- /dev/null +++ b/src/views/plugin/gantt/vtable/index.vue @@ -0,0 +1,815 @@ + + +