|
@@ -17,6 +17,65 @@ export default function () {
|
|
|
|
|
|
}, baseConfig(config, 'row-item'), config, tree)
|
|
}, baseConfig(config, 'row-item'), config, tree)
|
|
|
|
|
|
|
|
+ _.assign(newConfig, {
|
|
|
|
+ root: [],
|
|
|
|
+ rootVisible: false,
|
|
|
|
+ tbar: [
|
|
|
|
+ {
|
|
|
|
+ xtype: 'trigger',
|
|
|
|
+ triggerCls: 'x-form-clear-trigger',
|
|
|
|
+ flex: 1,
|
|
|
|
+ emptyText: '搜索过滤',
|
|
|
|
+ enableKeyEvents: true,
|
|
|
|
+ listeners: {
|
|
|
|
+ change: {
|
|
|
|
+ fn(sender, e) {
|
|
|
|
+ const scope = sender.up("yvtree")
|
|
|
|
+ scope.filterByText(this.getRawValue());
|
|
|
|
+ },
|
|
|
|
+ buffer: 500
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ if (!newConfig.hideRefresh) {
|
|
|
|
+ newConfig.tbar.push({
|
|
|
|
+ xtype: 'button', iconCls: 'x-fa fa-refresh', tooltip: '刷新',
|
|
|
|
+ listeners: {
|
|
|
|
+ click(sender) {
|
|
|
|
+ const scope = sender.up("yvtree")
|
|
|
|
+ scope.reload()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!newConfig.hideExpand) {
|
|
|
|
+ newConfig.tbar.push({
|
|
|
|
+ xtype: 'button', iconCls: 'x-fa fa-plus-square-o', tooltip: '全部展开',
|
|
|
|
+ listeners: {
|
|
|
|
+ click(sender) {
|
|
|
|
+ const scope = sender.up("yvtree")
|
|
|
|
+ scope.expandAll()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!newConfig.hideCollapse) {
|
|
|
|
+ newConfig.tbar.push({
|
|
|
|
+ xtype: 'button', iconCls: 'x-fa fa-minus-square-o', tooltip: '全部收起',
|
|
|
|
+ listeners: {
|
|
|
|
+ click(sender) {
|
|
|
|
+ const scope = sender.up("yvtree")
|
|
|
|
+ scope.collapseAll()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
this.superclass.constructor.call(this, newConfig)
|
|
this.superclass.constructor.call(this, newConfig)
|
|
},
|
|
},
|
|
|
|
|
|
@@ -248,62 +307,7 @@ export default function () {
|
|
}, null, [this, view]);
|
|
}, null, [this, view]);
|
|
},
|
|
},
|
|
|
|
|
|
- root: [],
|
|
|
|
- rootVisible: false,
|
|
|
|
- tbar: [
|
|
|
|
- {
|
|
|
|
- xtype: 'trigger',
|
|
|
|
- triggerCls: 'x-form-clear-trigger',
|
|
|
|
- onTriggerClick(sender) {
|
|
|
|
- sender.setValue('');
|
|
|
|
- const scope = sender.up("yvtree")
|
|
|
|
- scope.clearFilter()
|
|
|
|
- },
|
|
|
|
- flex: 1,
|
|
|
|
- emptyText: '搜索过滤',
|
|
|
|
- enableKeyEvents: true,
|
|
|
|
- listeners: {
|
|
|
|
- keyup: {
|
|
|
|
- fn(sender, e) {
|
|
|
|
- if (e.ESC == e.getKey()) {
|
|
|
|
- sender.onTriggerClick(sender);
|
|
|
|
- } else {
|
|
|
|
- const scope = sender.up("yvtree")
|
|
|
|
- scope.filterByText(this.getRawValue());
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- buffer: 500
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- xtype: 'button', iconCls: 'x-fa fa-refresh', tooltip: '刷新',
|
|
|
|
- listeners: {
|
|
|
|
- click(sender) {
|
|
|
|
- const scope = sender.up("yvtree")
|
|
|
|
- scope.reload()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- xtype: 'button', iconCls: 'x-fa fa-plus-square-o', tooltip: '全部展开',
|
|
|
|
- listeners: {
|
|
|
|
- click(sender) {
|
|
|
|
- const scope = sender.up("yvtree")
|
|
|
|
- scope.expandAll()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- xtype: 'button', iconCls: 'x-fa fa-minus-square-o', tooltip: '全部收起',
|
|
|
|
- listeners: {
|
|
|
|
- click(sender) {
|
|
|
|
- const scope = sender.up("yvtree")
|
|
|
|
- scope.collapseAll()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- ],
|
|
|
|
|
|
+
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|