Browse Source

Merge pull request #3626 in VISUAL/fineui from DEC/fineui:release/11.0 to master

* commit '8833cc2648cf4c3ab476e602b6ec162f8632f6f0':
  BI-130613 fix: 优化代码
  BI-130613 fix: 下拉树展开没有加载
research/test
Aeolus.Zhang-张敬峥 1 year ago
parent
commit
028d6ca3ce
  1. 43
      packages/fineui/src/case/ztree/asynctree.js

43
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 { TreeView } from "./treeview";
import { TreeRenderPageService } from "./treerender.page.service"; import { TreeRenderPageService } from "./treerender.page.service";
import $ from "jquery"; import $ from "jquery";
import { IconLabel } from "@/base";
@shortcut() @shortcut()
export class AsyncTree extends TreeView { export class AsyncTree extends TreeView {
@ -197,7 +209,34 @@ export class AsyncTree extends TreeView {
}, },
options 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之前获取配置 // 展开节点会将halfCheck置为false以开启自动计算半选, 所以第一次展开节点的时候需要在置为false之前获取配置

Loading…
Cancel
Save