|
@@ -21,7 +21,8 @@ export default {
|
|
|
return {data: [], links: []}
|
|
|
}
|
|
|
},
|
|
|
- stafforpro: ''
|
|
|
+ stafforpro: '',
|
|
|
+ valueDate:[]
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
@@ -93,13 +94,53 @@ export default {
|
|
|
gantt.config.subscales = [
|
|
|
{unit: "day", step: 1, date: "周%D,%d"}
|
|
|
];
|
|
|
+
|
|
|
+ // gantt.config.start_date = new Date(this.valueDate[0]);
|
|
|
+ // gantt.config.end_date = new Date(this.valueDate[0]);
|
|
|
+
|
|
|
+ gantt.config.layout = {
|
|
|
+ css: 'gantt_container',
|
|
|
+ cols: [
|
|
|
+ {
|
|
|
+ width: 500,
|
|
|
+ min_width: 300,
|
|
|
+ rows: [
|
|
|
+ {
|
|
|
+ view: 'grid',
|
|
|
+ scrollX: 'gridScroll',
|
|
|
+ scrollable: true,
|
|
|
+ scrollY: 'scrollVer'
|
|
|
+ },
|
|
|
+ { view: 'scrollbar', id: 'gridScroll', group: 'horizontal' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ { resizer: true, width: 1 },
|
|
|
+ {
|
|
|
+ // width: 950,
|
|
|
+ // min_width: 600,
|
|
|
+ rows: [
|
|
|
+ {
|
|
|
+ view: 'timeline',
|
|
|
+ scrollX: 'scrollHor',
|
|
|
+ scrollable: true,
|
|
|
+ scrollY: 'scrollVer'
|
|
|
+ },
|
|
|
+ { view: 'scrollbar', id: 'scrollHor', group: 'horizontal' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ { view: 'scrollbar', id: 'scrollVer' }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+
|
|
|
//设置任务条样式
|
|
|
gantt.templates.task_class = function (start, end, item) {
|
|
|
return item.parent == 0 ? "person_line" : ""
|
|
|
};
|
|
|
|
|
|
gantt.init(this.$refs.gantt);
|
|
|
+ // this.$props.tasks.data[31].render = "split"
|
|
|
gantt.parse(this.$props.tasks);
|
|
|
+ console.log("tasks",this.$props.tasks.data);
|
|
|
// gantt.groupBy({
|
|
|
// relation_property: "owner",
|
|
|
// groups: [{key:'seya', label: "seya"},{key:'tina', label: "tina"}],
|