bri-components 1.6.12 → 1.6.14

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bri-components",
3
- "version": "1.6.12",
3
+ "version": "1.6.14",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -98,10 +98,10 @@
98
98
  <upload-list
99
99
  class="BriUpload-list"
100
100
  :mode="showMode"
101
+ :isInTable="isInTable"
101
102
  :canEdit="!disabled"
102
103
  :files="curValList"
103
104
  :propsObj="propsObj"
104
- :listPadding="!isInTable ? '16px' : undefined"
105
105
  :isShowEditIcon="isShowEditIcon"
106
106
  :emptyShowVal="emptyShowVal"
107
107
  @deleteItem="clickDeteItem"
@@ -100,6 +100,7 @@
100
100
  v-else
101
101
  :class="{
102
102
  'uploadList-nodata': !mode.includes('inline'),
103
+ 'uploadList-nodata-height': !mode.includes('inline') && !isInTable,
103
104
  'uploadList-nodata-inline': mode.includes('inline')
104
105
  }"
105
106
  >
@@ -127,6 +128,10 @@
127
128
  return ["single", "image", "file", "imageinline", "fileinline"].includes(val);
128
129
  }
129
130
  },
131
+ isInTable: {
132
+ type: Boolean,
133
+ default: false
134
+ },
130
135
  canEdit: {
131
136
  type: Boolean,
132
137
  default: true
@@ -143,7 +148,6 @@
143
148
  return {};
144
149
  }
145
150
  },
146
- listPadding: String,
147
151
  isShowEditIcon: Boolean,
148
152
  emptyShowVal: String
149
153
  },
@@ -160,6 +164,10 @@
160
164
  };
161
165
  },
162
166
  computed: {
167
+ listPadding () {
168
+ return this.isInTable ? undefined : "16px";
169
+ },
170
+
163
171
  allOperationMap () {
164
172
  return {
165
173
  canDelete: {
@@ -591,10 +599,13 @@
591
599
  width: 100%;
592
600
  height: 100%;
593
601
  text-align: center;
594
- line-height: 120px;
595
602
  color: @placeholderColor;
596
603
  white-space: nowrap;
597
604
 
605
+ &-height {
606
+ line-height: 120px;
607
+ }
608
+
598
609
  &-inline {
599
610
  padding-left: 7px;
600
611
  line-height: 32px;
@@ -25,6 +25,12 @@ export default {
25
25
  logic: "and",
26
26
  conditions: []
27
27
  },
28
+ _default: {
29
+ tree: [],
30
+ list: [],
31
+ rowDefault: {}
32
+ },
33
+
28
34
  ...this.propsObj
29
35
  };
30
36
  },
@@ -93,6 +99,10 @@ export default {
93
99
  return this.$isAdvSearching(this.finalTableAdvSearch);
94
100
  },
95
101
 
102
+ // 用字段配置里_default里的rowDefault(后端schema接口里加工了)稳妥;虽然customShow接口或者流程data里也给了,但表格如果在前端依赖出现,rowDefault会是空对象
103
+ rowDefault () {
104
+ return this.selfPropsObj._default.rowDefault;
105
+ },
96
106
  curVal () {
97
107
  return this.value[this.controlKey] || {
98
108
  tree: []
@@ -142,10 +142,11 @@ export default {
142
142
  // 多选模式 点击选项
143
143
  clickCheckItem (item, index) {
144
144
  if (!this.getCheckItemDisabled(item)) {
145
- this.curValList = this.getItemCheckStatus(item)
146
- ? this.curValList.filter(key => key !== item[this.saveKey])
147
- : [...this.curValList, item[this.saveKey]];
148
- this.curValList = this.curValList.filter(key => this.listDataKeys.includes(key));
145
+ this.curValList = (
146
+ this.getItemCheckStatus(item)
147
+ ? this.curValList.filter(key => key !== item[this.saveKey])
148
+ : [...this.curValList, item[this.saveKey]]
149
+ ).filter(key => this.listDataKeys.includes(key));
149
150
  }
150
151
  },
151
152
 
@@ -57,7 +57,7 @@
57
57
  :canEdit="false"
58
58
  :tableDataObj="curVal"
59
59
  :data="curVal.tree"
60
- :rowDefault="curVal.rowDefault"
60
+ :rowDefault="rowDefault"
61
61
  :columns="subForm"
62
62
  :treeColumns="treeForm"
63
63
  :propsObj="{
@@ -103,7 +103,7 @@
103
103
  :canEdit="!disabled"
104
104
  :tableDataObj="curVal"
105
105
  :data="curVal.tree"
106
- :rowDefault="curVal.rowDefault"
106
+ :rowDefault="rowDefault"
107
107
  :columns="subForm"
108
108
  :treeColumns="treeForm"
109
109
  :propsObj="defaultPropsObj"
@@ -144,7 +144,7 @@
144
144
  :canEdit="!disabled"
145
145
  :tableDataObj="curVal"
146
146
  :data="curVal.tree"
147
- :rowDefault="curVal.rowDefault"
147
+ :rowDefault="rowDefault"
148
148
  :columns="subForm"
149
149
  :treeColumns="treeForm"
150
150
  :propsObj="selfPropsObj"
@@ -10,82 +10,176 @@
10
10
  <Row>
11
11
  <template v-if="showFormList.length">
12
12
  <template v-for="formItem in showFormList">
13
+ <!-- tab页签切换 -->
13
14
  <i-col
15
+ v-if="tabsGpMap[formItem._key] && tabsGpMap[formItem._key].allShowTabFormList.length > 1"
14
16
  :key="formItem._key"
15
17
  :id="formItem._key"
16
18
  class="DshForm-item"
17
- :span="formItem._br ? 24 : (formItem._span || 24)"
19
+ :span="24"
18
20
  >
19
- <FormItem
20
- v-if="hideMap[formItem._key] !== true"
21
- class="DshForm-item-FormItem"
22
- :prop="formItem._key"
23
- @click.native="clickControl(formItem)"
24
- >
25
- <dsh-form-unit
26
- ref="dshFormUnit"
27
- :canEdit="canEdit"
28
- :formData="formData"
29
- :formItem="formItem"
30
- :allFormList="selfAllFormList"
31
- :inTableType="inTableType"
32
- :allListRows="allListRows"
33
- :rowIndex="rowIndex"
34
- :parentFormList="parentFormList"
35
- :parentObj="parentObj"
36
- :changedFields="changedFields"
37
- :height="height"
38
- :rowStyle="rowStyle"
39
- :labelStyle="labelStyle"
40
- :formControlClass="formControlClass"
41
- @change="change(arguments)"
42
- @refChange="refChange(arguments)"
43
- @changeField="changeField"
44
- >
45
- <slot
46
- :canEdit="canEdit"
47
- :formItem="formItem"
48
- :formData="formData"
49
- :allFormList="selfAllFormList"
50
- ></slot>
21
+ <div class="DshForm-item-tabs-wrap">
22
+ <div class="DshForm-item-tabs">
23
+ <div
24
+ v-for="tabFormItem in tabsGpMap[formItem._key].allShowTabFormList"
25
+ :key="tabFormItem._key"
26
+ :class="{
27
+ 'DshForm-item-tabs-option': true,
28
+ 'DshForm-item-tabs-option-active': tabFormItem._key === tabsGpMap[formItem._key].curTabKey,
29
+ }"
30
+ @click="tabsGpMap[formItem._key].curTabKey = tabFormItem._key"
31
+ >{{ tabFormItem._name }}</div>
32
+ </div>
33
+
34
+ <template v-for="tabFormItem in tabsGpMap[formItem._key].allShowTabFormList">
35
+ <FormItem
36
+ v-if="hideMap[tabFormItem._key] !== true && tabFormItem._key === tabsGpMap[formItem._key].curTabKey"
37
+ :key="tabFormItem._key"
38
+ class="DshForm-item-FormItem"
39
+ :prop="tabFormItem._key"
40
+ @click.native="clickControl(tabFormItem)"
41
+ >
42
+ <dsh-form-unit
43
+ ref="dshFormUnit"
44
+ :canEdit="canEdit"
45
+ :formData="formData"
46
+ :formItem="tabFormItem"
47
+ :allFormList="selfAllFormList"
48
+ :inTableType="inTableType"
49
+ :allListRows="allListRows"
50
+ :rowIndex="rowIndex"
51
+ :parentFormList="parentFormList"
52
+ :parentObj="parentObj"
53
+ :changedFields="changedFields"
54
+ :height="height"
55
+ :rowStyle="rowStyle"
56
+ :labelStyle="labelStyle"
57
+ :formControlClass="formControlClass"
58
+ @change="change(arguments)"
59
+ @refChange="refChange(arguments)"
60
+ @changeField="changeField"
61
+ >
62
+ <slot
63
+ :canEdit="canEdit"
64
+ :formItem="tabFormItem"
65
+ :formData="formData"
66
+ :allFormList="selfAllFormList"
67
+ ></slot>
68
+
69
+ <slot
70
+ name="label"
71
+ slot="label"
72
+ :canEdit="canEdit"
73
+ :formItem="tabFormItem"
74
+ :formData="formData"
75
+ :allFormList="selfAllFormList"
76
+ ></slot>
77
+
78
+ <slot
79
+ name="extra"
80
+ slot="extra"
81
+ :canEdit="canEdit"
82
+ :formItem="tabFormItem"
83
+ :formData="formData"
84
+ :allFormList="selfAllFormList"
85
+ ></slot>
86
+
87
+ <slot
88
+ name="corner"
89
+ slot="corner"
90
+ :canEdit="canEdit"
91
+ :formItem="tabFormItem"
92
+ :formData="formData"
93
+ :allFormList="selfAllFormList"
94
+ ></slot>
95
+ </dsh-form-unit>
96
+ </FormItem>
97
+ </template>
98
+ </div>
99
+ </i-col>
51
100
 
52
- <slot
53
- name="label"
54
- slot="label"
55
- :canEdit="canEdit"
56
- :formItem="formItem"
57
- :formData="formData"
58
- :allFormList="selfAllFormList"
59
- ></slot>
101
+ <!-- tab页签 里隐藏的字段不渲染 -->
102
+ <template v-else-if="tabHideFieldKeys.includes(formItem._key)"></template>
60
103
 
61
- <slot
62
- name="extra"
63
- slot="extra"
104
+ <template v-else>
105
+ <i-col
106
+ :key="formItem._key"
107
+ :id="formItem._key"
108
+ class="DshForm-item"
109
+ :span="formItem._br ? 24 : (formItem._span || 24)"
110
+ >
111
+ <FormItem
112
+ v-if="hideMap[formItem._key] !== true"
113
+ class="DshForm-item-FormItem"
114
+ :prop="formItem._key"
115
+ @click.native="clickControl(formItem)"
116
+ >
117
+ <dsh-form-unit
118
+ ref="dshFormUnit"
64
119
  :canEdit="canEdit"
65
- :formItem="formItem"
66
120
  :formData="formData"
67
- :allFormList="selfAllFormList"
68
- ></slot>
69
-
70
- <slot
71
- name="corner"
72
- slot="corner"
73
- :canEdit="canEdit"
74
121
  :formItem="formItem"
75
- :formData="formData"
76
122
  :allFormList="selfAllFormList"
77
- ></slot>
78
- </dsh-form-unit>
79
- </FormItem>
80
- </i-col>
123
+ :inTableType="inTableType"
124
+ :allListRows="allListRows"
125
+ :rowIndex="rowIndex"
126
+ :parentFormList="parentFormList"
127
+ :parentObj="parentObj"
128
+ :changedFields="changedFields"
129
+ :height="height"
130
+ :rowStyle="rowStyle"
131
+ :labelStyle="labelStyle"
132
+ :formControlClass="formControlClass"
133
+ @change="change(arguments)"
134
+ @refChange="refChange(arguments)"
135
+ @changeField="changeField"
136
+ >
137
+ <slot
138
+ :canEdit="canEdit"
139
+ :formItem="formItem"
140
+ :formData="formData"
141
+ :allFormList="selfAllFormList"
142
+ ></slot>
143
+
144
+ <slot
145
+ name="label"
146
+ slot="label"
147
+ :canEdit="canEdit"
148
+ :formItem="formItem"
149
+ :formData="formData"
150
+ :allFormList="selfAllFormList"
151
+ ></slot>
152
+
153
+ <slot
154
+ name="extra"
155
+ slot="extra"
156
+ :canEdit="canEdit"
157
+ :formItem="formItem"
158
+ :formData="formData"
159
+ :allFormList="selfAllFormList"
160
+ ></slot>
161
+
162
+ <slot
163
+ name="corner"
164
+ slot="corner"
165
+ :canEdit="canEdit"
166
+ :formItem="formItem"
167
+ :formData="formData"
168
+ :allFormList="selfAllFormList"
169
+ ></slot>
170
+ </dsh-form-unit>
171
+ </FormItem>
172
+ </i-col>
173
+
174
+ <!-- 换行 -->
175
+ <i-col
176
+ v-if="formItem._wrap"
177
+ :key="formItem._key + '_wrap'"
178
+ style="min-height: 0px;"
179
+ :span="24"
180
+ ></i-col>
181
+ </template>
81
182
 
82
- <!-- 换行 -->
83
- <i-col
84
- v-if="formItem._wrap"
85
- :key="formItem._key + '_wrap'"
86
- style="min-height: 0px;"
87
- :span="24"
88
- ></i-col>
89
183
  </template>
90
184
  </template>
91
185
 
@@ -192,6 +286,7 @@
192
286
  errorObj: {
193
287
  errors: []
194
288
  },
289
+ tabsGpMap: {},
195
290
 
196
291
  forceValidateTypes: [
197
292
  "select", "region", "cascader", "regions", "cascaders", "file", "coordinates", "editor",
@@ -209,6 +304,18 @@
209
304
  },
210
305
  showFormList () {
211
306
  return this.formList.filter(formItem => this.isShow(formItem, this.formData, this.parentObj));
307
+ },
308
+ showFieldKeys () {
309
+ return this.showFormList.map(formItem => formItem._key);
310
+ },
311
+
312
+ tabHideFieldKeys () {
313
+ return Object.values(this.tabsGpMap).reduce((arr, objItem) => {
314
+ return [
315
+ ...arr,
316
+ ...objItem.tabGpFieldKeys
317
+ ];
318
+ }, []);
212
319
  }
213
320
  },
214
321
  watch: {
@@ -224,6 +331,7 @@
224
331
  init () {
225
332
  this.initMonitor();
226
333
  this.initRules();
334
+ this.initTabsGroupMap();
227
335
  },
228
336
  // 初始化监测 -监测所有字段
229
337
  initMonitor () {
@@ -239,6 +347,30 @@
239
347
  return rulesObj;
240
348
  }, this.rules);
241
349
  },
350
+ initTabsGroupMap () {
351
+ this.tabsGpMap = this.showFormList.reduce((map, formItem) => {
352
+ let tabGpFieldKeys = formItem._tabGpFieldKeys;
353
+
354
+ if (tabGpFieldKeys && tabGpFieldKeys.length) {
355
+ const showTabGroupKeys = tabGpFieldKeys.filter(fieldKey => this.showFieldKeys.includes(fieldKey));
356
+ const showTabFormList = showTabGroupKeys.map(fieldKey => this.showFormList.find(formItem => formItem._key === fieldKey));
357
+
358
+ return showTabFormList.length > 0
359
+ ? {
360
+ ...map,
361
+ [formItem._key]: {
362
+ curTabKey: formItem._key,
363
+ tabGpFieldKeys,
364
+ // allTabGpFieldKeys: [formItem._key, ...tabGpFieldKeys],
365
+ allShowTabFormList: [formItem, ...showTabFormList]
366
+ }
367
+ }
368
+ : map;
369
+ } else {
370
+ return map;
371
+ }
372
+ }, {});
373
+ },
242
374
 
243
375
  /* ------- 供外部使用 ---------- */
244
376
  // 获取iview的form组件实例
@@ -469,8 +601,33 @@
469
601
  .DshForm {
470
602
  padding-bottom: 5px;
471
603
 
472
- &-item-FormItem {
473
- margin-bottom: 0px;
604
+ &-item {
605
+ &-FormItem {
606
+ margin-bottom: 0px;
607
+ }
608
+
609
+ &-tabs {
610
+ margin: 8px 12px;
611
+ display: flex;
612
+ flex-direction: row;
613
+
614
+ &-wrap {
615
+ margin: 12px 0px;
616
+ }
617
+
618
+ &-option {
619
+ margin-right: 5px;
620
+ padding: 8px 16px;
621
+ background-color: #e5e5e5;
622
+ // font-weight: 700;
623
+ cursor: pointer;
624
+
625
+ &-active {
626
+ background-color: #ffffff;
627
+ color: @themeColor;
628
+ }
629
+ }
630
+ }
474
631
  }
475
632
 
476
633
  &-nodata {
@@ -200,7 +200,7 @@ export default {
200
200
  // 每条数据都补充全所有字段值(赋一个默认的空值)
201
201
  this.selfColumns.forEach((colItem) => {
202
202
  // 不用row[colItem._key] === undefined判断,是因为后端给的空值不可靠,多选的有时候都能给null
203
- if (!Object.prototype.hasOwnProperty.call(row, colItem._key) && this.$isEmptyData(row[colItem._key])) {
203
+ if (!row.hasOwnProperty(colItem._key) && this.$isEmptyData(row[colItem._key])) {
204
204
  this.$set(row, colItem._key, this.$deepCopy(this.dftInitValMap[colItem._type]));
205
205
  }
206
206
  });
@@ -418,6 +418,19 @@ export default {
418
418
  }
419
419
  },
420
420
 
421
+ // 行-获取每行的表单列表
422
+ getRowFormList (row, rowIndex) {
423
+ return this.selfColumns.map(column => {
424
+ column = this.$transformDynamicProperty(column, row, this.parentObj);
425
+ const unitCanEdit = this.getColCanEdit({ row, rowIndex, column });
426
+
427
+ return {
428
+ ...column,
429
+ canEdit: unitCanEdit
430
+ };
431
+ });
432
+ },
433
+ // 单元格-合并单元格配置
421
434
  bodyCellSpan ({ row, rowIndex, column }) {
422
435
  return {
423
436
  rowspan: this.mergeRowColKeys.includes(column._key)
@@ -428,7 +441,7 @@ export default {
428
441
  colspan: 1
429
442
  };
430
443
  },
431
- // 加工单元格对应的配置
444
+ // 单元格-加工对应的配置
432
445
  getSelfResetCol ({ row, rowIndex, column }) {
433
446
  return this.mergeRowColKeys.includes(column._key)
434
447
  ? {
@@ -443,7 +456,7 @@ export default {
443
456
  // 每条数据都补充全所有字段值(赋一个默认的空值)
444
457
  this.selfColumns.forEach((colItem) => {
445
458
  // 不用row[colItem._key] === undefined判断,是因为后端给的空值不可靠,多选的有时候都能给null
446
- if (!Object.prototype.hasOwnProperty.call(row, colItem._key) && this.$isEmptyData(row[colItem._key])) {
459
+ if (!row.hasOwnProperty(colItem._key) && this.$isEmptyData(row[colItem._key])) {
447
460
  this.$set(row, colItem._key, this.$deepCopy(this.dftInitValMap[colItem._type]));
448
461
  }
449
462
  });
@@ -11,6 +11,11 @@ export default {
11
11
  ...this.treeTableBasePropsObj
12
12
  };
13
13
  },
14
+ // 初始化选择展开几级节点
15
+ dftExpandLevel () {
16
+ return 2;
17
+ // return this.maxLevel;
18
+ },
14
19
 
15
20
  /* --- 列字段 --- */
16
21
  showColumns () {
@@ -23,11 +28,11 @@ export default {
23
28
  },
24
29
  expandColumn () {
25
30
  return {
26
- // title: "开/合",
31
+ title: "开/收",
27
32
  _key: "__isExpand__",
28
33
  key: "__isExpand__",
29
34
  field: "__isExpand__",
30
- width: 48,
35
+ width: 52,
31
36
  align: "center",
32
37
  fixed: "left",
33
38
  renderBodyCell: ({ row, rowIndex, column }, h) => {
@@ -62,14 +67,14 @@ export default {
62
67
  _key: "__treeIndex__",
63
68
  key: "__treeIndex__",
64
69
  field: "__treeIndex__",
65
- width: 28 + 16 + (this.maxLevel - 1) * 36,
70
+ width: 28 + (this.maxLevel - 1) * 24,
66
71
  align: "left",
67
- fixed: "left",
72
+ // fixed: "left",
68
73
  renderBodyCell: ({ row, rowIndex, column }, h) => {
69
74
  return [
70
75
  h("div", {
71
76
  style: {
72
- paddingLeft: `${(row.level - 1) * 18}px`,
77
+ paddingLeft: `${(row.level - 1) * 10}px`,
73
78
  fontWeight: "500"
74
79
  }
75
80
  }, row.__treeIndex__),
@@ -215,19 +220,25 @@ export default {
215
220
  // 每条数据都补充全所有字段值(赋一个默认的空值)
216
221
  this.selfColumns.forEach((colItem) => {
217
222
  // 不用row[colItem._key] === undefined判断,是因为后端给的空值不可靠,多选的有时候都能给null
218
- if (!Object.prototype.hasOwnProperty.call(row, colItem._key) && this.$isEmptyData(row[colItem._key])) {
223
+ if (!row.hasOwnProperty(colItem._key) && this.$isEmptyData(row[colItem._key])) {
219
224
  this.$set(row, colItem._key, this.$deepCopy(this.dftInitValMap[colItem._type]));
220
225
  }
221
226
  });
222
227
 
223
228
  row.level = row.level || levelNum; // TODO:修正数据level属性,后期可以删除
224
- // 第一级的需要显示出来
225
- if (row.level === 1) {
229
+ // 重置计划节点状态 (第一级的需要显示出来)
230
+ if (row.level < this.dftExpandLevel) {
231
+ // 必须用$set
232
+ this.$set(row, "__isExpand__", !!(row.children && row.children.length));
233
+ this.$set(row, "__isShow__", true);
234
+ this.$set(row, "__isTmpShow__", true);
235
+ } else if (row.level === this.dftExpandLevel) {
226
236
  // 必须用$set
227
237
  this.$set(row, "__isExpand__", false);
228
238
  this.$set(row, "__isShow__", true);
229
239
  this.$set(row, "__isTmpShow__", true);
230
240
  } else {
241
+ // 必须用$set
231
242
  this.$set(row, "__isExpand__", false);
232
243
  this.$set(row, "__isShow__", false);
233
244
  this.$set(row, "__isTmpShow__", false);
@@ -237,13 +248,13 @@ export default {
237
248
  else {
238
249
  // 第一级的需要显示出来
239
250
  if (row.level === 1) {
240
- !Object.prototype.hasOwnProperty.call(row, "__isExpand__") && this.$set(row, "__isExpand__", false);
241
- !Object.prototype.hasOwnProperty.call(row, "__isShow__") && this.$set(row, "__isShow__", true);
242
- !Object.prototype.hasOwnProperty.call(row, "__isTmpShow__") && this.$set(row, "__isTmpShow__", true);
251
+ !row.hasOwnProperty("__isExpand__") && this.$set(row, "__isExpand__", false);
252
+ !row.hasOwnProperty("__isShow__") && this.$set(row, "__isShow__", true);
253
+ !row.hasOwnProperty("__isTmpShow__") && this.$set(row, "__isTmpShow__", true);
243
254
  } else {
244
- !Object.prototype.hasOwnProperty.call(row, "__isExpand__") && this.$set(row, "__isExpand__", false);
245
- !Object.prototype.hasOwnProperty.call(row, "__isShow__") && this.$set(row, "__isShow__", false);
246
- !Object.prototype.hasOwnProperty.call(row, "__isTmpShow__") && this.$set(row, "__isTmpShow__", false);
255
+ !row.hasOwnProperty("__isExpand__") && this.$set(row, "__isExpand__", false);
256
+ !row.hasOwnProperty("__isShow__") && this.$set(row, "__isShow__", false);
257
+ !row.hasOwnProperty("__isTmpShow__") && this.$set(row, "__isTmpShow__", false);
247
258
  }
248
259
  }
249
260
  },
@@ -257,22 +268,25 @@ export default {
257
268
  },
258
269
  // 切换子孙后代的显示/隐藏
259
270
  toggleDescendantsShow (row, bool) {
260
- const loop = (row, isFirstSon) => {
271
+ const loop = (row, bool, isFirstSon) => {
261
272
  if (row.children && row.children.length) {
262
273
  row.children.forEach(subRow => {
274
+ // !父级的bool是true,即只有当父级节点是显示状态时,子孙后代才能根据__isTmpShow__设置__isShow__
275
+ let resultBool = bool;
263
276
  if (isFirstSon) {
264
- this.$set(subRow, "__isShow__", bool);
265
- this.$set(subRow, "__isTmpShow__", bool);
277
+ this.$set(subRow, "__isShow__", resultBool);
278
+ this.$set(subRow, "__isTmpShow__", resultBool);
266
279
  } else {
267
- this.$set(subRow, "__isShow__", bool ? !!subRow.__isTmpShow__ : false);
280
+ resultBool = bool ? !!subRow.__isTmpShow__ : false;
281
+ this.$set(subRow, "__isShow__", resultBool);
268
282
  }
269
283
 
270
- loop(subRow);
284
+ loop(subRow, resultBool);
271
285
  });
272
286
  }
273
287
  };
274
288
 
275
- loop(row, true);
289
+ loop(row, bool, true);
276
290
  },
277
291
  // getNewRowData时,额外补充的行相关的数据
278
292
  getSelfNewRowData (level) {