cloud-web-corejs 1.0.61 → 1.0.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1008,36 +1008,44 @@ modules = {
1008
1008
  rows.forEach((value) => {
1009
1009
  value.leaf = !value.hasChild;
1010
1010
  });
1011
+ let items = [];
1011
1012
  if (node.level === 0) {
1013
+ let item = {
1014
+ parent: null,
1015
+ fileName: this.title,
1016
+ leaf: rows.length == 0,
1017
+ allFileBtn: true,
1018
+ id: 0,
1019
+ children: rows,
1020
+ };
1021
+ items.push(item);
1012
1022
  setTimeout(() => {
1013
1023
  this.$refs.tree.setCurrentKey(node.childNodes[0].data);
1014
1024
  this.handleNodeData(node.childNodes[0]);
1015
1025
  node.childNodes[0].expand();
1026
+ if (this.option.treeExpandAll) {
1027
+ //默认全部展开树分类
1028
+ node.childNodes[0].childNodes.forEach(item => {
1029
+ if (!item.data.leaf) item.expand();
1030
+ })
1031
+ }
1016
1032
  }, 200);
1017
1033
  this.$nextTick(() => {
1018
1034
  callback && callback();
1019
1035
  });
1020
1036
  this.searchEvent();
1021
1037
  } else {
1038
+ items = rows;
1022
1039
  this.$nextTick(() => {
1040
+ if (this.option.treeExpandAll) {
1041
+ //默认全部展开树分类
1042
+ node.childNodes.forEach(item => {
1043
+ if (!item.data.leaf) item.expand();
1044
+ })
1045
+ }
1023
1046
  callback && callback();
1024
1047
  });
1025
1048
  }
1026
- let items = [];
1027
- if (node.level === 0) {
1028
- let item = {
1029
- parent: null,
1030
- fileName: this.title,
1031
- leaf: rows.length == 0,
1032
- allFileBtn: true,
1033
- id: 0,
1034
- children: rows,
1035
- };
1036
- items.push(item);
1037
- } else {
1038
- items = rows;
1039
- }
1040
-
1041
1049
  resolve(items);
1042
1050
  },
1043
1051
  });