bri-components 1.6.12 → 1.6.13

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.13",
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: []
@@ -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 {
@@ -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
  ? {
@@ -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 () {
@@ -221,13 +226,19 @@ export default {
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);
@@ -442,9 +442,17 @@ export default {
442
442
  };
443
443
  },
444
444
 
445
+ // 新增数据状态
446
+ isCreateStatus () {
447
+ return this.parentObj.__isCreate__ === true;
448
+ },
449
+ // 表格行可增删状态
450
+ isRowCDStatus () {
451
+ return this.isCreateStatus;
452
+ },
445
453
  // 是否筛选状态
446
454
  isSearching () {
447
- return this.parentObj.__isCreate__ === true
455
+ return this.isRowCDStatus
448
456
  ? false
449
457
  : this.$isAdvSearching(this.finalTableAdvSearch);
450
458
  },
@@ -692,7 +700,7 @@ export default {
692
700
  : dftVal
693
701
  : dftInRowVal
694
702
  });
695
- }, {});
703
+ }, this.$deepCopy(this.rowDefault));
696
704
  },
697
705
  parentDataId () {
698
706
  return this.parentObj._id;
@@ -761,8 +769,7 @@ export default {
761
769
  ...(
762
770
  this.canEdit
763
771
  ? [
764
- ...(this.disabledBtns ? [] : this.baseOperationBtns.filter(btn => !["canMoveUp", "canMoveDown"].includes(btn))),
765
- ...(this.useMoveBtns ? ["canMoveUp", "canMoveDown"] : []),
772
+ ...(this.disabledBtns ? [] : this.baseOperationBtns.filter(btn => ["canMoveUp", "canMoveDown"].includes(btn) ? this.useMoveBtns : true)),
766
773
  ...this.otherOperationBtns,
767
774
  ...(this.isQuote ? ["canQuote"] : []),
768
775
  ...(this.isImport ? ["canImport"] : [])
@@ -852,7 +859,7 @@ export default {
852
859
 
853
860
  // 筛选回调
854
861
  searchCb (conditions) {
855
- if (this.parentObj.__isCreate__ !== true) {
862
+ if (!this.isRowCDStatus) {
856
863
  this.isExpandAction = false;
857
864
  this.dftAdvSearch.conditions = conditions;
858
865
 
@@ -868,11 +875,13 @@ export default {
868
875
  // 输入框失去焦点
869
876
  controlBlur (operationItem, row, rowIndex, column, params) {
870
877
  this.dealRuleRecord(row, column);
878
+ this.dealOtherColRuleRecord(row, column);
871
879
  },
872
880
  // 输入框值改变立即
873
881
  quickChangeVal (operationItem, row, rowIndex, column, params) {
874
882
  if (["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type)) {
875
883
  this.dealRuleRecord(row, column);
884
+ this.dealOtherColRuleRecord(row, column);
876
885
  this.change("quickChangeVal", row, rowIndex, column, ...params);
877
886
  }
878
887
  },
@@ -880,6 +889,7 @@ export default {
880
889
  changeVal (operationItem, row, rowIndex, column, params) {
881
890
  if (!["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type)) {
882
891
  this.dealRuleRecord(row, column);
892
+ this.dealOtherColRuleRecord(row, column);
883
893
  this.change("changeVal", row, rowIndex, column, ...params);
884
894
  }
885
895
  },
@@ -1132,7 +1142,7 @@ export default {
1132
1142
  };
1133
1143
  },
1134
1144
  topSummaryRender (h) {
1135
- return this.searchFormList.length
1145
+ return this.searchFormList.length && !this.isRowCDStatus
1136
1146
  ? h("div", {
1137
1147
  style: {
1138
1148
  "display": "flex",
@@ -1199,7 +1209,7 @@ export default {
1199
1209
  });
1200
1210
  },
1201
1211
  topSearchRender (h) {
1202
- return this.searchFormList.length
1212
+ return this.searchFormList.length && !this.isRowCDStatus
1203
1213
  ? h("dsh-default-search", {
1204
1214
  props: {
1205
1215
  formList: this.searchFormList,
@@ -1323,9 +1333,9 @@ export default {
1323
1333
  const operationList = this.rowOperationList.map(btnItem => ({
1324
1334
  ...btnItem,
1325
1335
  disabled: btnItem.type === "canMoveUp"
1326
- ? !(this.getRowDelBtnCanEdit(row, rowIndex) && ["last", "center"].includes(row.__position__))
1336
+ ? !(this.getRowMoveBtnCanEdit(row, rowIndex) && ["last", "center"].includes(row.__position__))
1327
1337
  : btnItem.type === "canMoveDown"
1328
- ? !(this.getRowDelBtnCanEdit(row, rowIndex) && ["first", "center"].includes(row.__position__))
1338
+ ? !(this.getRowMoveBtnCanEdit(row, rowIndex) && ["first", "center"].includes(row.__position__))
1329
1339
  : btnItem.type === "canDelete"
1330
1340
  ? !this.getRowDelBtnCanEdit(row, rowIndex)
1331
1341
  : btnItem.disabled
@@ -1361,18 +1371,18 @@ export default {
1361
1371
  ? this.getOperationIconRender(h, { row, rowIndex, column }, "canCreateChild", iconSize, ++sortNum)
1362
1372
  : h("span", ""),
1363
1373
 
1364
- // 删除该行图标
1374
+ // 删除该行图标(得有删除能力)
1365
1375
  baseBool && ["cascaderTable"].includes(this.inTableType) && this.getRowDelBtnCanEdit(row, rowIndex)
1366
1376
  ? this.getOperationIconRender(h, { row, rowIndex, column }, "canDelete", iconSize, ++sortNum)
1367
1377
  : h("span", ""),
1368
1378
 
1369
1379
  // 下移图标
1370
- baseBool && !this.useMoveInOperationCol && this.getRowDelBtnCanEdit(row, rowIndex) && ["first", "center"].includes(row.__position__)
1380
+ baseBool && !this.useMoveInOperationCol && this.getRowMoveBtnCanEdit(row, rowIndex) && ["first", "center"].includes(row.__position__)
1371
1381
  ? this.getOperationIconRender(h, { row, rowIndex, column }, "canMoveDown", iconSize, ++sortNum)
1372
1382
  : h("span", ""),
1373
1383
 
1374
1384
  // 上移图标
1375
- baseBool && !this.useMoveInOperationCol && this.getRowDelBtnCanEdit(row, rowIndex) && ["last", "center"].includes(row.__position__)
1385
+ baseBool && !this.useMoveInOperationCol && this.getRowMoveBtnCanEdit(row, rowIndex) && ["last", "center"].includes(row.__position__)
1376
1386
  ? this.getOperationIconRender(h, { row, rowIndex, column }, "canMoveUp", iconSize, ++sortNum)
1377
1387
  : h("span", "")
1378
1388
  ];
@@ -1465,7 +1475,7 @@ export default {
1465
1475
  },
1466
1476
 
1467
1477
  /* ----------- 方法 ---------- */
1468
- // 整行校验结果
1478
+ // 校验-整行结果
1469
1479
  getRowRuleResult (row, rowIndex) {
1470
1480
  // return this.usedColumns.every(column => this.getColRuleResult({ row, rowIndex, column }).bool);
1471
1481
 
@@ -1482,36 +1492,7 @@ export default {
1482
1492
 
1483
1493
  return bool;
1484
1494
  },
1485
- getRowFormList (row, rowIndex) {
1486
- return this.selfColumns.map(column => {
1487
- column = this.$transformDynamicProperty(column, row, this.parentObj);
1488
- const unitCanEdit = this.getColCanEdit({ row, rowIndex, column });
1489
-
1490
- return {
1491
- ...column,
1492
- canEdit: unitCanEdit
1493
- };
1494
- });
1495
- },
1496
- // 是否默认行
1497
- getIsDftRow (row, rowIndex) {
1498
- return this.isDftSet ? false : row.__isDefault__;
1499
- },
1500
- // 行按钮是否可操作(删除按钮可编辑 不代表行内容是可编辑的)
1501
- getRowDelBtnCanEdit (row, rowIndex) {
1502
- return row.__readonly__ !== true && // 不能为只读数据
1503
- (this.disabledDeleteDftRow ? row.__isDefault__ !== true : true) && // 默认数据可删除
1504
- (this.disabledDeleteOldRow ? row.__old__ !== true : true); // 老数据可删除
1505
- },
1506
- // 行内容是否可编辑
1507
- getRowCanEdit (row, rowIndex) {
1508
- return this.canEdit && // 是编辑状态
1509
- (this.getIsDftRow(row) ? !this.dftReadonly : true) && // 默认数据可编辑
1510
- (row.__old__ === true ? !this.oldReadonly : true) && // 老数据可编辑
1511
- row.__readonly__ !== true; // 不能为只读数据
1512
- },
1513
-
1514
- // 单元格校验结果
1495
+ // 校验-单元格结果
1515
1496
  getColRuleResult ({ row, rowIndex, column }) {
1516
1497
  column = this.$transformDynamicProperty(column, row, this.parentObj);
1517
1498
 
@@ -1524,7 +1505,7 @@ export default {
1524
1505
  message: "未触发校验,通过!"
1525
1506
  };
1526
1507
  },
1527
- // 获取单元格校验对象
1508
+ // 校验-获取单元格校验对象
1528
1509
  getColRuleResultObj ({ row, rowIndex, column }) {
1529
1510
  // 校验必填不通过 => 校验对比
1530
1511
  const resultObj = {};
@@ -1534,7 +1515,32 @@ export default {
1534
1515
 
1535
1516
  return resultObj;
1536
1517
  },
1537
- // 加工单元格对应的配置
1518
+
1519
+ // 行-是否是默认行
1520
+ getIsDftRow (row, rowIndex) {
1521
+ return this.isDftSet ? false : row.__isDefault__;
1522
+ },
1523
+ // 行-删除按钮是否可操作(删除按钮可编辑 不代表行内容是可编辑的)
1524
+ getRowDelBtnCanEdit (row, rowIndex) {
1525
+ return row.__readonly__ !== true && // 只读数据不可删除
1526
+ (this.disabledDeleteDftRow ? row.__isDefault__ !== true : true) && // 默认数据不可删除
1527
+ (this.disabledDeleteOldRow ? row.__old__ !== true : true); // 老数据不可删除
1528
+ },
1529
+ // 行-移动按钮是否可操作
1530
+ getRowMoveBtnCanEdit (row, rowIndex) {
1531
+ return row.__readonly__ !== true && // 只读数据不可删除
1532
+ (this.disabledDeleteDftRow ? row.__isDefault__ !== true : true) && // 默认数据不可删除
1533
+ (this.disabledDeleteOldRow ? row.__old__ !== true : true); // 老数据不可删除
1534
+ },
1535
+ // 行-内容是否可编辑
1536
+ getRowCanEdit (row, rowIndex) {
1537
+ return this.canEdit && // 是编辑状态
1538
+ (this.getIsDftRow(row) ? !this.dftReadonly : true) && // 默认数据可编辑
1539
+ (row.__old__ === true ? !this.oldReadonly : true) && // 老数据可编辑
1540
+ row.__readonly__ !== true; // 不能为只读数据
1541
+ },
1542
+
1543
+ // 单元格-对应的配置
1538
1544
  getResetCol ({ row, rowIndex, column }) {
1539
1545
  return {
1540
1546
  // isShare: this.isShare,
@@ -1552,13 +1558,13 @@ export default {
1552
1558
  )
1553
1559
  };
1554
1560
  },
1555
- // 单元格最终是否可编辑性
1561
+ // 单元格-最终是否可编辑性
1556
1562
  getUnitCanEdit ({ row, rowIndex, column }) {
1557
1563
  return this.getRowCanEdit(row, rowIndex) &&
1558
1564
  this.getColCanEdit({ row, rowIndex, column }) &&
1559
1565
  this.$isAdvRelyShow(column, row, this.parentObj, true);
1560
1566
  },
1561
- // 单元格本身是否可编辑性
1567
+ // 单元格-本身是否可编辑性
1562
1568
  getColCanEdit ({ row, rowIndex, column }) {
1563
1569
  return (this.getIsDftRow(row) ? !this.dftReadonlyColKeys.includes(column._key) : true) && // 默认行的某列是否可编辑
1564
1570
  (row.__old__ === true ? !this.oldReadonlyColKeys.includes(column._key) : true) && // 老数据行里某些列不可编辑
@@ -1603,7 +1609,7 @@ export default {
1603
1609
  row._id = this.$ObjectID().str;
1604
1610
  }
1605
1611
 
1606
- row.__old__ = this.isDftSet ? false : this.parentObj.__isCreate__ !== true; // 标记老数据
1612
+ row.__old__ = this.isDftSet ? false : !this.isCreateStatus; // 标记老数据
1607
1613
  row.__isDefault__ = this.isDftSet ? true : !!row.__isDefault__; // 标记默认数据(配置端默认值)
1608
1614
 
1609
1615
  // 初次进来 把关于展示的状态值全部清除(只有层级表在用,按理说应放在DshTreeTableMixin.js,但为了清除三大表格的老数据,才放在这)
@@ -1651,10 +1657,24 @@ export default {
1651
1657
  getMixKey (row, column, splitStr = "--") {
1652
1658
  return `${row._id}${splitStr}${column._key}`;
1653
1659
  },
1654
- // 更新校验显示的标记
1660
+ // 校验显示映射上 添加上某单元格的
1655
1661
  dealRuleRecord (row, column) {
1656
- // this.$set(this.ruleRecordMap, this.getMixKey(row, column), true);
1657
- this.ruleRecordMap[this.getMixKey(row, column)] = true;
1662
+ this.$set(this.ruleRecordMap, this.getMixKey(row, column), true);
1663
+ // this.ruleRecordMap[this.getMixKey(row, column)] = true;
1664
+ },
1665
+ // 校验显示映射上 添加上某单元格有牵扯的单元格s
1666
+ dealOtherColRuleRecord (row, column) {
1667
+ this.usedColumns.forEach(otherCol => {
1668
+ if (
1669
+ // (otherCol._saveRuleConfigs && otherCol._saveRuleConfigs.length) ||
1670
+ (otherCol._saveRuleConfigs && otherCol._saveRuleConfigs.some(item => item._fieldKey === column._key)) ||
1671
+ (otherCol._dynamicRules && otherCol._dynamicRules.some(item => this.$getConditionFields(item._advRely).includes(column._key))) ||
1672
+ (otherCol._dynamicRule && otherCol._dynamicRule.some(item => this.$getConditionFields(item._advRely).includes(column._key)))
1673
+ ) {
1674
+ // this.$set(this.ruleRecordMap, this.getMixKey(row, otherCol), true);
1675
+ this.ruleRecordMap[this.getMixKey(row, otherCol)] = true;
1676
+ }
1677
+ });
1658
1678
  }
1659
1679
  }
1660
1680
  };