diff --git a/packages/fineui/src/case/ztree/asynctree.js b/packages/fineui/src/case/ztree/asynctree.js index f9b5bf6b6..7921ef821 100644 --- a/packages/fineui/src/case/ztree/asynctree.js +++ b/packages/fineui/src/case/ztree/asynctree.js @@ -1,7 +1,19 @@ -import { cjkEncodeDO, deepClone, each, extend, isEmpty, isNotNull, isNull, shortcut } from "@/core"; +import { + cjkEncodeDO, + deepClone, + each, + extend, + isEmpty, + isNotNull, + isNull, + shortcut, + AbsoluteLayout, + createWidget, +} from "@/core"; import { TreeView } from "./treeview"; import { TreeRenderPageService } from "./treerender.page.service"; import $ from "jquery"; +import { IconLabel } from "@/base"; @shortcut() export class AsyncTree extends TreeView { @@ -197,7 +209,34 @@ export class AsyncTree extends TreeView { }, options ); - o.itemsCreator(op, complete); + + let loadingIcon; + createWidget({ + type: AbsoluteLayout.xtype, + element: self.element.find(`#${treeNode.tId}`), + css: { + position: "relative", + }, + items: [ + { + el: { + type: IconLabel.xtype, + width: 20, + height: 20, + cls: "button-loading-font anim-rotate bi-card", + ref: ref => { + loadingIcon = ref; + }, + }, + left: 5, + top: 5, + }, + ], + }); + o.itemsCreator(op, (...args) => { + complete.apply(this, args); + loadingIcon.destroy(); + }); } // 展开节点会将halfCheck置为false以开启自动计算半选, 所以第一次展开节点的时候需要在置为false之前获取配置