提交 6ca19b5d 编写于 作者: JunZai's avatar JunZai

update

上级 f70e6f4b
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
../../@MACRO/LANG_FUN.ftl ../../@MACRO/LANG_FUN.ftl
</#ibizinclude> </#ibizinclude>
<template> <template>
<el-table :data="items" row-key="id" border lazy :load="load" :tree-props="{ children: 'children', hasChildren: 'leaf' }"> <el-table :data="items" row-key="id" border lazy :load="loadTreeNode" :tree-props="{ children: 'children', hasChildren: 'leaf' }">
<#if ctrl.getPSDETreeColumns()??> <#if ctrl.getPSDETreeColumns()??>
<#list ctrl.getPSDETreeColumns() as column> <#list ctrl.getPSDETreeColumns() as column>
<el-table-column show-overflow-tooltip prop="${column.getName()?lower_case}" label="${column.getCaption()}"<#if column.getWidth() gt 0> :width="${column.getWidth()?c}"</#if> :align="'${column.getAlign()?lower_case}'"> <el-table-column show-overflow-tooltip prop="${column.getName()?lower_case}" label="${column.getCaption()}"<#if column.getWidth() gt 0> :width="${column.getWidth()?c}"</#if> :align="'${column.getAlign()?lower_case}'">
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
* @param {*} $event 日期信息 * @param {*} $event 日期信息
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public load(task: any = {}) { public load(task: any = {}, resolve: any) {
const params: any = { const params: any = {
srfnodeid: task && task.id ? task.id : "#", srfnodeid: task && task.id ? task.id : "#",
srfnodefilter: '' srfnodefilter: ''
...@@ -175,12 +175,11 @@ ...@@ -175,12 +175,11 @@
this.$Notice.error({ title: "错误", desc: response.info }); this.$Notice.error({ title: "错误", desc: response.info });
return; return;
} }
this.items = [...this.items, ...response.data]; if(resolve && resolve instanceof Function) {
response.data.forEach((item: any) => { resolve(response.data);
if(!item.collapsed) { } else {
this.load(item); this.items = [...response.data];
} }
})
this.$emit("load", this.items); this.$emit("load", this.items);
}).catch((response: any) => { }).catch((response: any) => {
if (response && response.status === 401) { if (response && response.status === 401) {
...@@ -190,6 +189,15 @@ ...@@ -190,6 +189,15 @@
}); });
} }
/**
* 加载节点
*
* @memberof TreeTable
*/
public loadTreeNode(tree: any, treeNode: any, resolve: any) {
this.load(tree, resolve);
}
/** /**
* 计算当前节点的上下文 * 计算当前节点的上下文
* *
......
...@@ -543,9 +543,9 @@ import ${srfclassname('${node.getPSAppDataEntity().codeName}')}Service from '@se ...@@ -543,9 +543,9 @@ import ${srfclassname('${node.getPSAppDataEntity().codeName}')}Service from '@se
Object.assign(treeNode, { collapsed: true }); Object.assign(treeNode, { collapsed: true });
</#if> </#if>
<#if node.hasPSDETreeNodeRSs()> <#if node.hasPSDETreeNodeRSs()>
Object.assign(treeNode, { leaf: false });
<#else>
Object.assign(treeNode, { leaf: true }); Object.assign(treeNode, { leaf: true });
<#else>
Object.assign(treeNode, { leaf: false });
</#if> </#if>
<#if node.getLeafFlagPSDEField()??> <#if node.getLeafFlagPSDEField()??>
let objLeafFlag = entity.${node.getLeafFlagPSDEField().codeName?lower_case}; let objLeafFlag = entity.${node.getLeafFlagPSDEField().codeName?lower_case};
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册