bri-components 1.4.83 → 1.4.85

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.
@@ -3,7 +3,14 @@ import { resourceData } from "bri-datas";
3
3
  export default {
4
4
  mixins: [],
5
5
  components: {},
6
- props: {},
6
+ props: {
7
+ treeColumns: {
8
+ type: Array,
9
+ default () {
10
+ return [];
11
+ }
12
+ }
13
+ },
7
14
  data () {
8
15
  return {
9
16
  searchMode: "flat", // "flat", "tree"
@@ -34,27 +41,25 @@ export default {
34
41
  computed: {
35
42
  treeTableBasePropsObj () {
36
43
  return {
37
- _treeForm: [],
44
+ // _treeForm: [],
38
45
  _maxLevel: 3 // 最大级数
39
46
  };
40
47
  },
41
- treeForm () {
42
- return this.selfPropsObj._treeForm;
43
- },
44
- treeFormKeys () {
45
- return this.treeForm.map(treeFormItem => treeFormItem._key);
46
- },
47
48
  maxLevel () {
48
49
  return this.selfPropsObj._maxLevel || 3;
49
50
  },
51
+ treeColKeys () {
52
+ return this.treeColumns.map(colItem => colItem._key);
53
+ },
50
54
 
55
+ /* --- 列字段 --- */
51
56
  selfColumns () {
52
57
  return this.columns.map(column => {
53
58
  // 层级表格类型,level字段的进行特殊处理(treeForm加工成_data)
54
59
  return column._key === "level"
55
60
  ? {
56
61
  ...column,
57
- _data: this.treeForm.map((treeFormItem, treeFormIndex) => ({
62
+ _data: this.treeColumns.map((treeFormItem, treeFormIndex) => ({
58
63
  name: treeFormItem._name,
59
64
  _key: (treeFormIndex + 1),
60
65
  color: Object.keys(resourceData.colorMap)[treeFormIndex + 1]
@@ -63,6 +68,7 @@ export default {
63
68
  : column;
64
69
  });
65
70
  },
71
+
66
72
  selfAllOperationMap () {
67
73
  return {
68
74
  canCreateChild: {
@@ -109,7 +115,7 @@ export default {
109
115
  list.splice(newRowIndex, 0, newRow);
110
116
 
111
117
  // 展开子级
112
- this.toggleExpand(row, true);
118
+ this.toggleExpand && this.toggleExpand(row, true);
113
119
 
114
120
  this.change("createChildRow", newRow, newRowIndex, null);
115
121
  },
@@ -126,7 +132,7 @@ export default {
126
132
  this.change("deleteRow", row, rowIndex, null);
127
133
  }
128
134
  });
129
- },
135
+ }
130
136
  // // 节点操作 -删除所有子行
131
137
  // clickDeleteChilds (operationItem, row, rowIndex, col) {
132
138
  // this.$Modal.confirm({
@@ -139,43 +145,5 @@ export default {
139
145
  // }
140
146
  // });
141
147
  // },
142
-
143
- selfFixRowItem (row, levelNum) {
144
- if (this.initFlag) {
145
- // TODO:修正数据level属性,后期可以删除
146
- row.level = row.level || levelNum;
147
- }
148
- },
149
- // 展开/隐藏节点
150
- toggleExpand (row, bool = true) {
151
- this.isExpandAction = true;
152
- this.$set(row, "__isExpand__", bool);
153
-
154
- this.toggleDescendantsShow(row, bool);
155
- },
156
- // 切换子孙后代的显示/隐藏
157
- toggleDescendantsShow (row, bool) {
158
- const loop = (row, isFirstSon) => {
159
- if (row.children && row.children.length) {
160
- row.children.forEach(subRow => {
161
- if (isFirstSon) {
162
- this.$set(subRow, "__isRendered__", true);
163
- this.$set(subRow, "__isShow__", bool);
164
- this.$set(subRow, "__isTmpShow__", bool);
165
- } else {
166
- if (bool) {
167
- this.$set(subRow, "__isShow__", subRow.__isTmpShow__);
168
- } else {
169
- this.$set(subRow, "__isShow__", false);
170
- }
171
- }
172
-
173
- loop(subRow);
174
- });
175
- }
176
- };
177
-
178
- loop(row, true);
179
- }
180
148
  }
181
149
  };
Binary file
Binary file
@@ -196,9 +196,9 @@
196
196
  padding: 4px 16px;
197
197
  position: relative;
198
198
 
199
- &-expand {
199
+ // &-expand {
200
200
 
201
- }
201
+ // }
202
202
  &-treeIndex {
203
203
  padding: 4px 16px 4px 12px!important;
204
204
  }