提交 24dc7f72 编写于 作者: JunZai's avatar JunZai

update

上级 b8648bb7
......@@ -166,32 +166,61 @@ GanttElastic,
* @param {*} $event 日期信息
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public searchEvents(fetchInfo?:any, successCallback?:any, failureCallback?:any ) {
let start = (fetchInfo && fetchInfo.start) ? this.$util.dateFormat(fetchInfo.start) : null;
let end = (fetchInfo && fetchInfo.end) ? this.$util.dateFormat(fetchInfo.end) : null;
let arg = { start: start, end: end };
if(fetchInfo && fetchInfo.query){
Object.assign(arg,{query : fetchInfo.query});
public load() {
const params: any = {
srfnodeid: "#",
srfnodefilter: ''
};
let tempViewParams:any = JSON.parse(JSON.stringify(this.viewparams));
let curNode:any = {};
Util.deepObjectMerge(curNode, {});
let tempContext:any = this.computecurNodeContext(curNode);
if(curNode.data && curNode.data.srfparentdename) {
Object.assign(tempContext,{ srfparentdename: curNode.data.srfparentdename });
Object.assign(tempViewParams,{ srfparentdename: curNode.data.srfparentdename });
}
Object.assign(arg,{viewparams:this.viewparams});
const post: Promise<any> = this.service.search(this.loadAction, JSON.parse(JSON.stringify(this.context)), arg, this.showBusyIndicator);
post.then((response: any) => {
if(curNode.data && curNode.data.srfparentkey) {
Object.assign(tempContext,{ srfparentkey: curNode.data.srfparentkey });
Object.assign(tempViewParams,{ srfparentkey: curNode.data.srfparentkey });
}
Object.assign(params,{viewparams:tempViewParams});
this.service.getNodes(tempContext,params).then((response: any) => {
if (!response || response.status !== 200) {
if (response.errorMessage) {
this.$Notice.error({ title: '错误', desc: response.errorMessage });
}
this.$Notice.error({ title: "错误", desc: response.info });
return;
}
// 默认选中第一项
this.tasks = response.data;
}, (response: any) => {
console.log(response.data);
// const _items = response.data;
// this.formatExpanded(_items);
// resolve([..._items]);
// let isRoot = Object.is(node.level,0);
// let isSelectedAll = node.checked;
// this.setDefaultSelection(_items, isRoot, isSelectedAll);
// this.$emit("load", _items);
}).catch((response: any) => {
if (response && response.status === 401) {
return;
}
this.$Notice.error({ title: '错误', desc: response.errorMessage });
this.$Notice.error({ title: "错误", desc: response.info });
});
}
/**
* 计算当前节点的上下文
*
* @param {*} curNode 当前节点
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public computecurNodeContext(curNode:any){
let tempContext:any = {};
if(curNode && curNode.data && curNode.data.srfappctx){
tempContext = JSON.parse(JSON.stringify(curNode.data.srfappctx));
}else{
tempContext = JSON.parse(JSON.stringify(this.context));
}
return tempContext;
}
/**
* 获取编辑视图信息
*
......
......@@ -530,7 +530,7 @@ import ${srfclassname('${node.getPSAppDataEntity().codeName}')}Service from '@se
<#if node.getPSDETreeNodeDataItems()??>
<#list node.getPSDETreeNodeDataItems() as dataitem>
<#if dataitem.getPSDEField()??>
Object.assign(treeNode, { ${dataitem.name?lower_case}: entity.${dataitem.getPSDEField().codeName?lower_case} });
Object.assign(treeNode, { <#if dataitem.name == "begin">start<#else>${dataitem.name?lower_case}</#if>: entity.${dataitem.getPSDEField().codeName?lower_case} });
</#if>
</#list>
</#if>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册