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

update

上级 f70e6f4b
......@@ -5,7 +5,7 @@
../../@MACRO/LANG_FUN.ftl
</#ibizinclude>
<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()??>
<#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}'">
......@@ -152,7 +152,7 @@
* @param {*} $event 日期信息
* @memberof ${srfclassname('${ctrl.codeName}')}
*/
public load(task: any = {}) {
public load(task: any = {}, resolve: any) {
const params: any = {
srfnodeid: task && task.id ? task.id : "#",
srfnodefilter: ''
......@@ -175,12 +175,11 @@
this.$Notice.error({ title: "错误", desc: response.info });
return;
}
this.items = [...this.items, ...response.data];
response.data.forEach((item: any) => {
if(!item.collapsed) {
this.load(item);
}
})
if(resolve && resolve instanceof Function) {
resolve(response.data);
} else {
this.items = [...response.data];
}
this.$emit("load", this.items);
}).catch((response: any) => {
if (response && response.status === 401) {
......@@ -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
Object.assign(treeNode, { collapsed: true });
</#if>
<#if node.hasPSDETreeNodeRSs()>
Object.assign(treeNode, { leaf: false });
<#else>
Object.assign(treeNode, { leaf: true });
<#else>
Object.assign(treeNode, { leaf: false });
</#if>
<#if node.getLeafFlagPSDEField()??>
let objLeafFlag = entity.${node.getLeafFlagPSDEField().codeName?lower_case};
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册