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

update

上级 6ca19b5d
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<el-table :data="items" row-key="id" border lazy :load="loadTreeNode" :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.getWidthUnit()!='STAR'> :width="${column.getWidth()?c}" <#else> :min-width="${column.getWidth()?c}" </#if> :align="'${column.getAlign()?lower_case}'">
<template v-slot="{ row, column, $index }"> <template v-slot="{ row, column, $index }">
<#if column.render??> <#if column.render??>
${column.render.code} ${column.render.code}
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
* @param {*} $event 日期信息 * @param {*} $event 日期信息
* @memberof ${srfclassname('${ctrl.codeName}')} * @memberof ${srfclassname('${ctrl.codeName}')}
*/ */
public load(task: any = {}, resolve: 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: ''
...@@ -177,9 +177,16 @@ ...@@ -177,9 +177,16 @@
} }
if(resolve && resolve instanceof Function) { if(resolve && resolve instanceof Function) {
resolve(response.data); resolve(response.data);
} else if(task && task.id) {
task.children = [...response.data];
} else { } else {
this.items = [...response.data]; this.items = [...response.data];
} }
response.data.forEach((item: any) => {
if(!item.collapsed) {
this.load(item);
}
})
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) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册