// import './lib/ColorField';
// import './lib/FilesTab';
// Bryntum umd lite bundle comes without polyfills to support Angular's zone.js
import {
Grid,
ProjectModel,
TaskModel,
Gantt,
Tooltip,
} from '@bryntum/gantt/gantt.lite.umd.js';
class MyModel extends TaskModel {
static get fields() {
return [
// { name : 'deadline', type : 'date' },
{ name: 'color' },
];
}
}
const project = new ProjectModel({
taskModelClass: MyModel as unknown as TaskModel,
taskStore: {
data: [
{
id: null,
name: 'dsfdsf',
expanded: true,
children: [
{
id: 11,
name: 'sdfdsf',
manuallyScheduled: true,
startDate: '2021-04-09',
duration: 1,
color: '#D8D8D8',
processId: '123',
isTaskAddtional: false,
},
],
},
{
id: null,
name: 'sdfdsf',
expanded: true,
children: [
{
id: 21,
name: 'jhkhk',
manuallyScheduled: true,
startDate: '2021-06-01',
duration: 5,
color: '#D8D8D8',
processId: '123',
isTaskAddtional: false,
},
],
},
{
id: null,
name: 'hjhkh',
expanded: true,
rollup: true,
children: [
{
id: 31,
name: 'gggggggg',
manuallyScheduled: true,
startDate: '2021-06-01',
duration: 10,
color: '#D8D8D8',
processId: '123',
isTaskAddtional: false,
},
{
id: 32,
name: 'jjjjjjjjjj',
manuallyScheduled: true,
startDate: '2021-06-01',
duration: 4,
color: '#D8D8D8',
processId: '123',
isTaskAddtional: false,
},
],
},
{
id: null,
name: 'rrrrrrrrr',
expanded: true,
rollup: true,
children: [
{
id: 51,
name: 'hhhhhhh',
manuallyScheduled: true,
startDate: '2021-06-14',
duration: 9,
color: '#000000',
processId: '123',
isTaskAddtional: false,
},
],
},
{
id: null,
name: 'ppppppppp',
expanded: true,
rollup: true,
children: [
{
id: '71',
name: '木完日',
manuallyScheduled: true,
startDate: '2021-06-04',
duration: 2,
color: '#000000',
processId: '123',
isTaskAddtional: false,
},
{
id: '72',
name: 'dgfdgfdg',
manuallyScheduled: true,
startDate: '2021-06-04',
duration: 2,
color: '#1882CD',
processId: '123',
isTaskAddtional: false,
},
],
},
{
id: null,
name: 'hhhhhhhh',
expanded: true,
rollup: true,
children: [
{
id: '91',
name: '66666666666',
manuallyScheduled: true,
startDate: '2021-06-29',
duration: 3,
resizable: true,
draggable: true,
color: '#FF5A5A',
processId: '123',
isTaskAddtional: false,
},
],
},
{
cls: 'fooHiddenTask',
color: '#E15A5A',
draggable: true,
duration: 1,
id: '600',
isInChargeTask: undefined,
isTaskAddtional: true,
manuallyScheduled: true,
name: 'Material 3',
processId: null,
resizable: false,
startDate: '2021-06-16',
taskId: 5,
type: 2,
},
],
},
// autoLoad: true,
});
export default {
columns: [{ type: 'name', field: 'name', text: '', width: 150 }],
emptyText: 'データ無し',
visibleDate: {
date: new Date(),
block: 'start',
},
zoomOnTimeAxisDoubleClick: false,
subGridConfigs: {
locked: { collapsed: false },
},
features: {
sort: false,
pdfExport: {
exportServer: 'https://localhost:8080',
translateURLsToAbsolute: 'https://localhost:8080',
orientation: 'landscape',
paperFormat: 'A3',
exportMask: '処理中...',
exporterType: 'multipage',
openAfterExport: false,
},
rowReorder: false,
taskTooltip: false,
cellEdit: false,
taskDrag: {
showTooltip: false,
disabled: true,
},
taskResize: {
showTooltip: false,
disabled: true,
},
taskMenu: false,
taskEdit: false,
timeRanges: {
// showCurrentTimeLine: {
// name: "今日",
// },
showCurrentTimeLine: true,
},
viewPreset: {
base: 'weekAndDay',
tickWidth: 52,
headers: [
{
unit: 'month',
dateFormat: 'YYYY年 MMM',
},
{
unit: 'day',
dateFormat: 'ddd',
},
{
unit: 'day',
dateFormat: 'D',
},
],
},
eventColor: null,
dependencies: false,
},
taskRenderer: ({ taskRecord, renderData }) => {
if (taskRecord.color) {
renderData.style += `background-color:${taskRecord.color}`;
}
if (taskRecord.isLeaf && !taskRecord.isMilestone) {
return taskRecord.name;
}
},
project,
};