提交 2cacfb76 编写于 作者: JunZai's avatar JunZai

update

上级 8e231710
...@@ -2,16 +2,8 @@ ...@@ -2,16 +2,8 @@
../../@MACRO/LANG_FUN.ftl ../../@MACRO/LANG_FUN.ftl
</#ibizinclude> </#ibizinclude>
<template> <template>
<gantt-elastic :class="ganttClass" :tasks="tasks" :options="getOptions(this.locale)" :dynamic-style="dynamicStyle" @taskList-item-dblclick="taskClick" @task-item-expand="taskItemExpand">
</gantt-elastic>
</template>
<#assign import_block>
import GanttElastic from "ibiz-gantt-elastic/src/GanttElastic.vue";
</#assign>
<#assign component_block> </template>
GanttElastic,
</#assign>
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_HEADER-BASE.vue.ftl
...@@ -40,32 +32,7 @@ GanttElastic, ...@@ -40,32 +32,7 @@ GanttElastic,
* @type {any[]} * @type {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public ganttClass: string = "gantt"; public controlClass: string = "${ctrl.name}";
/**
* 语言
*
* @public
* @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public locale: string = 'zh-CN';
/**
* 语言资源
*
* @public
* @type {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public localeZH: any = {
weekdays: ['星期一','星期二','星期三','星期四','星期五','星期六','星期日'],
months: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
Now: "现在",
"X-Scale": "时间颗粒度",
"Display task list": "显示列表",
"Before/After": "数据范围"
}
/** /**
* 配置参数 * 配置参数
...@@ -75,34 +42,7 @@ GanttElastic, ...@@ -75,34 +42,7 @@ GanttElastic,
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public options: any = { public options: any = {
isflex: true,
maxRows: 1000,
dataType: 'treegrid',
title: {
label: ""
},
header: {
yScole: false,
taskListWidth: false,
},
calendar: {
hour: {
display: false
}
},
chart: {
progress: {
bar: false
},
expander: {
display: true
},
},
taskList: { taskList: {
expander: {
straight: false
},
labelField: 'text',
columns: [ columns: [
<#if ctrl.getPSDETreeColumns()??> <#if ctrl.getPSDETreeColumns()??>
<#list ctrl.getPSDETreeColumns() as column> <#list ctrl.getPSDETreeColumns() as column>
...@@ -137,33 +77,13 @@ GanttElastic, ...@@ -137,33 +77,13 @@ GanttElastic,
}; };
/** /**
* 样式 * 数据集合
* *
* @public * @public
* @type {any[]} * @type {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}items
*/
public dynamicStyle: any = {};
/**
* 日程事件集合
*
* @public
* @type {any[]}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public tasks: any[] = [];
/**
* 监听语言变化
*
* @public
* @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
@Watch('$i18n.locale') public items: any[] = [];
public onLocaleChange(newval: any, val: any) {
this.locale = newval;
}
/** /**
* 获取列属性值 * 获取列属性值
...@@ -209,19 +129,6 @@ GanttElastic, ...@@ -209,19 +129,6 @@ GanttElastic,
return codelist.emptytext; return codelist.emptytext;
} }
/**
* 获取部件参数
*
* @returns {any}
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public getOptions() {
if(Object.is(this.locale, 'zh-CN')) {
return { locale: this.localeZH, ...this.options };
}
return this.options;
}
/** /**
* 搜索获取日程事件 * 搜索获取日程事件
* *
...@@ -251,13 +158,13 @@ GanttElastic, ...@@ -251,13 +158,13 @@ GanttElastic,
this.$Notice.error({ title: "错误", desc: response.info }); this.$Notice.error({ title: "错误", desc: response.info });
return; return;
} }
this.tasks = [...this.tasks, ...response.data]; this.items = [...this.items, ...response.data];
response.data.forEach((item: any) => { response.data.forEach((item: any) => {
if(!item.collapsed) { if(!item.collapsed) {
this.load(item); this.load(item);
} }
}) })
this.$emit("load", this.tasks); this.$emit("load", this.items);
}).catch((response: any) => { }).catch((response: any) => {
if (response && response.status === 401) { if (response && response.status === 401) {
return; return;
...@@ -285,16 +192,11 @@ GanttElastic, ...@@ -285,16 +192,11 @@ GanttElastic,
/** /**
* 节点展开 * 节点展开
* *
* @param {*} task 当前节点 * @param {*} item 当前节点
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public taskItemExpand(task: any) { public itemExpand(item: any) {
if(!task.collapsed) { i
let index: number = this.tasks.findIndex((item: any) => Object.is(task.id, item.parentId));
if(index < 0) {
this.load(task);
}
}
} }
/** /**
...@@ -343,24 +245,9 @@ GanttElastic, ...@@ -343,24 +245,9 @@ GanttElastic,
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public created() { public created() {
this.locale = this.$i18n.locale;
this.load(); this.load();
} }
/**
* 点击事件
*
* @returns
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public taskClick({event, data}: {event: any, data: any}) {
const _this: any = this;
let key: string = data.id.split(';')[0];
if(_this[key + '_opendata'] instanceof Function) {
_this[key + '_opendata']([data]);
}
}
<#ibizinclude> <#ibizinclude>
../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl ../@MACRO/CONTROL/CONTROL_BOTTOM-BASE.vue.ftl
</#ibizinclude> </#ibizinclude>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册