bri-components 1.3.96 → 1.3.97

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.3.96",
3
+ "version": "1.3.97",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -1,7 +1,8 @@
1
1
  <template>
2
2
  <div :class="{
3
3
  uploadList: true,
4
- [`uploadList-${showMode}`]: true
4
+ [`uploadList-${showMode}`]: true,
5
+ [`uploadList-${propsObj._fileType}`]: true
5
6
  }">
6
7
  <!-- 普通文本模式 -->
7
8
  <template v-if="showMode ==='old'">
@@ -9,38 +10,57 @@
9
10
  <div
10
11
  v-if="files.length"
11
12
  ref="viewerImage"
12
- class="uploadList-list"
13
+ :class="['uploadList-list', `uploadList-list-${propsObj._fileType}`]"
13
14
  >
14
15
  <div
15
16
  v-for="(fileItem, fileIndex) in files"
16
17
  :key="fileItem._key || fileItem._id"
17
- class="item"
18
+ :class="{
19
+ 'item': propsObj._fileType === 'image',
20
+ [`item-${propsObj._fileType}`]: true
21
+ }"
18
22
  >
19
23
  <!-- 展示图 -->
20
- <div class="item-show">
21
- <img
22
- v-if="fileItem.mimetype.includes('image')"
23
- :data-original="fileItem.url"
24
- :src="$imageResize(fileItem.url, imageResizeConfig)"
25
- :alt="fileItem.name"
26
- >
27
- <img
28
- v-else
29
- :src="getFileImage(fileItem)"
30
- :alt="fileItem.name"
31
- >
32
- </div>
33
-
34
- <!-- 展示名称 -->
35
- <p class="item-name-title">{{ fileItem.name }}</p>
36
-
37
- <!-- 图标 -->
38
- <dsh-icons
39
- class="item-action"
40
- item-class="item-action-icon"
41
- :list="$getOperationList(getBtns(fileItem))"
42
- @click="$dispatchEvent($event, fileItem, fileIndex)"
43
- ></dsh-icons>
24
+ <template v-if="propsObj._fileType === 'image'">
25
+ <div class="item-show">
26
+ <img
27
+ v-if="fileItem.mimetype.includes('image')"
28
+ :data-original="fileItem.url"
29
+ :src="$imageResize(fileItem.url, imageResizeConfig)"
30
+ :alt="fileItem.name"
31
+ >
32
+ <img
33
+ v-else
34
+ :src="getFileImage(fileItem)"
35
+ :alt="fileItem.name"
36
+ >
37
+ </div>
38
+
39
+ <!-- 展示名称 -->
40
+ <p class="item-name-title">{{ fileItem.name }}</p>
41
+
42
+ <!-- 图标 -->
43
+ <dsh-icons
44
+ class="item-action"
45
+ item-class="item-action-icon"
46
+ :list="$getOperationList(getBtns(fileItem))"
47
+ @click="$dispatchEvent($event, fileItem, fileIndex)"
48
+ ></dsh-icons>
49
+ </template>
50
+
51
+ <template v-else>
52
+ <a
53
+ :href="fileItem.downloadUrl"
54
+ target="black"
55
+ >{{ fileItem.name }}</a>
56
+
57
+ <dsh-icons
58
+ class="item-file-action"
59
+ item-class="item-file-action-icon"
60
+ :list="$getOperationList(getBtns(fileItem))"
61
+ @click="$dispatchEvent($event, fileItem, fileIndex)"
62
+ ></dsh-icons>
63
+ </template>
44
64
  </div>
45
65
  </div>
46
66
 
@@ -352,6 +372,36 @@
352
372
  }
353
373
  }
354
374
  }
375
+
376
+ // file 模式
377
+ &-file {
378
+ flex-direction: column;
379
+ .item-file {
380
+ flex: 0 0 100%;
381
+ height: auto;
382
+ display: flex;
383
+ flex-direction: row;
384
+ justify-content: space-between;
385
+ align-items: center;
386
+ border-radius: 0px;
387
+ margin: 0px;
388
+ background: transparent;
389
+ line-height: 22px;
390
+ height: 22px !important;
391
+ &:hover {
392
+ background: #f4f5fa;
393
+ }
394
+ a {
395
+ text-overflow: ellipsis;
396
+ overflow: hidden;
397
+ }
398
+ .DshIcons {
399
+ margin-left: 5px;
400
+ color: @textColor;
401
+ white-space: nowrap;
402
+ }
403
+ }
404
+ }
355
405
  }
356
406
 
357
407
  &-inline {
@@ -75,6 +75,17 @@ export default {
75
75
  // 值为不是[]类型用的
76
76
  curVal: {
77
77
  get () {
78
+ // 原选项变动了或选项动态改变时,过滤掉已不存在的选项值
79
+ if (!this.isInTable) {
80
+ if (["select"].includes(this.controlType)) {
81
+ if (!this.$dataType(this.propsObj._filterFunc, "function")) {
82
+ this.value[this.controlKey] = this.listData.some(item => item[this.saveKey] === this.value[this.controlKey])
83
+ ? this.value[this.controlKey]
84
+ : "";
85
+ }
86
+ }
87
+ }
88
+
78
89
  return this.value[this.controlKey];
79
90
  },
80
91
  set (val) {
@@ -90,6 +101,26 @@ export default {
90
101
  // 值为[]类型用的
91
102
  curValList: {
92
103
  get () {
104
+ // 原选项变动了或选项动态改变时,过滤掉已不存在的选项值
105
+ if (!this.isInTable) {
106
+ const valList = this.value[this.controlKey] || [];
107
+ if ((["select"].includes(this.controlType) && this.multipleMode) || ["checkbox"].includes(this.controlType)) {
108
+ this.value[this.controlKey] = valList.some(valKey => !this.listDataKeys.includes(valKey))
109
+ ? valList.filter(valKey => this.listDataKeys.includes(valKey))
110
+ : valList;
111
+ }
112
+ // else if (["region", "cascader"].includes(this.controlType)) {
113
+ // this.value[this.controlKey] = this.$getTreeLinealDatas(valList, this.cascaderAllData, undefined, this.saveKey).length
114
+ // ? valList
115
+ // : [];
116
+ // }
117
+ // else if (["regions", "cascaders"].includes(this.controlType)) {
118
+ // this.value[this.controlKey] = valList.filter(valListItem =>
119
+ // this.$getTreeLinealDatas(valListItem, this.cascaderAllData, undefined, this.saveKey).length
120
+ // );
121
+ // }
122
+ }
123
+
93
124
  return this.value[this.controlKey] || [];
94
125
  },
95
126
  set (valList) {
@@ -115,7 +146,7 @@ export default {
115
146
  },
116
147
  // 字段的真实key
117
148
  fieldKey () {
118
- return this.controlKey === "_default"
149
+ return this.isDftSet
119
150
  ? this.value._key
120
151
  : (this.propsObj.__realKey__ || this.controlKey);
121
152
  },
@@ -192,6 +223,10 @@ export default {
192
223
  // isShare () {
193
224
  // return !!this.propsObj.isShare;
194
225
  // },
226
+ // 是否在设置默认值下
227
+ isDftSet () {
228
+ return this.controlKey === "_default";
229
+ },
195
230
  // 在单元格内
196
231
  isInTable () {
197
232
  return !!this.propsObj.inTable;
@@ -26,6 +26,7 @@ export default {
26
26
  _customData: [],
27
27
  _reverseFilter: false, // 是否反向过滤,默认正向过滤
28
28
  _selectFilterVals: [], // 过滤的数据
29
+ _selectFilterKey: undefined, // 用作过滤的属性,默认用_saveKey对应的属性
29
30
 
30
31
  ...this.propsObj,
31
32
  ...this.commonDealPropsObj
@@ -53,20 +54,27 @@ export default {
53
54
  selectFilterVals () {
54
55
  return this.selfPropsObj._selectFilterVals;
55
56
  },
57
+ selectFilterKey () {
58
+ return this.selfPropsObj._selectFilterKey;
59
+ },
56
60
 
57
61
  listData () {
58
62
  let listData = this.selfPropsObj._data.concat(this.initListData);
59
- if (this.selectFilterVals.length) {
60
- listData = listData.filter(item =>
63
+ listData = this.selectFilterVals.length
64
+ ? listData.filter(item =>
61
65
  this.reverseFilter
62
- ? !this.selectFilterVals.includes(item[this.saveKey])
63
- : this.selectFilterVals.includes(item[this.saveKey])
64
- );
65
- }
66
-
67
- return this.$dataType(this.selfPropsObj._filterFunc, "function")
66
+ ? !this.selectFilterVals.includes(item[this.selectFilterKey || this.saveKey])
67
+ : this.selectFilterVals.includes(item[this.selectFilterKey || this.saveKey])
68
+ )
69
+ : listData;
70
+ listData = this.$dataType(this.selfPropsObj._filterFunc, "function")
68
71
  ? this.selfPropsObj._filterFunc(listData, this.selfPropsObj, this.value)
69
72
  : listData;
73
+
74
+ return listData;
75
+ },
76
+ listDataKeys () {
77
+ return this.listData.map(item => item[this.saveKey]);
70
78
  },
71
79
  curValObj () {
72
80
  return this.getItemObj(this.curVal);
@@ -164,7 +164,7 @@
164
164
  clickInput () {
165
165
  if (this.finalCanEdit) {
166
166
  if (!this.renderList) {
167
- if (this.controlKey === "_default") {
167
+ if (this.isDftSet) {
168
168
  this.listData = this.originLabels.map(item => {
169
169
  return {
170
170
  ...item,
@@ -306,11 +306,10 @@
306
306
  callback: data => {
307
307
  this.loading = false;
308
308
  this.departmentList = this.listFilterVals.length
309
- ? data.list.filter(
310
- item =>
311
- this.reverseFilter
312
- ? !this.listFilterVals.includes(item._key)
313
- : this.listFilterVals.includes(item._key)
309
+ ? data.list.filter(item =>
310
+ this.reverseFilter
311
+ ? !this.listFilterVals.includes(item._key)
312
+ : this.listFilterVals.includes(item._key)
314
313
  )
315
314
  : data.list;
316
315
  }
@@ -348,8 +348,8 @@
348
348
  let rules = [];
349
349
  let ruleConfig = this.$getFieldRuleConfig(formItem);
350
350
 
351
- // 数据格式校验
352
- if (ruleConfig.type) {
351
+ // 数据格式校验 -关联表格类型的会被过滤掉
352
+ if (ruleConfig.type && (!ruleConfig.fields || Object.entries(ruleConfig.fields).every(arr => !arr[1].transform))) {
353
353
  rules.push({
354
354
  message: `${formItem._name}数据格式有错!`,
355
355
  trigger: "blur, change",
@@ -36,8 +36,9 @@ export default {
36
36
  icon: "md-trash",
37
37
  color: "red",
38
38
  event: "clickDeleteCol"
39
- },
40
-
39
+ }
40
+ },
41
+ otherOperationMap: {
41
42
  clickNode: {
42
43
  name: "点击节点",
43
44
  type: "clickNode",
@@ -53,7 +54,6 @@ export default {
53
54
  type: "changeNode",
54
55
  event: "changeNode"
55
56
  }
56
-
57
57
  // canClearNode: {
58
58
  // name: "清除内容",
59
59
  // type: "canClearNode",
@@ -71,6 +71,19 @@ export default {
71
71
  };
72
72
  },
73
73
  computed: {
74
+ typePropsObj () {
75
+ return {
76
+ _dftReadonlyTreeColKeys: [], // 默认的数据只读的表头列
77
+ _oldReadonlyTreeColKeys: [] // 保存的数据只读的表头列
78
+ };
79
+ },
80
+ dftReadonlyTreeColKeys () {
81
+ return this.isDftSet ? [] : this.selfPropsObj._dftReadonlyTreeColKeys || []; // 配置端有问题,高级以依赖时候值成undefined了
82
+ },
83
+ oldReadonlyTreeColKeys () {
84
+ return this.isDftSet ? [] : this.selfPropsObj._oldReadonlyTreeColKeys || []; // 配置端有问题,高级以依赖时候值成undefined了
85
+ },
86
+
74
87
  allTreeData () {
75
88
  return this.getCalcuedTree(this.data, this.treeColumns, this.selfColumns);
76
89
  },
@@ -82,11 +95,11 @@ export default {
82
95
  },
83
96
 
84
97
  showColumns () {
85
- return this.mergeColumns(this.treeColumns, this.contentColumns);
98
+ return this.mergeColumns(this.treeColumns);
86
99
  },
87
100
  // 供表格渲染行使用的columns的数组集合, 每一行columns不一样,组成二重数组
88
101
  rowColumnsArr () {
89
- return this.transformRowColumnsArr(this.allTreeData, this.treeColumns, this.contentColumns);
102
+ return this.transformRowColumnsArr(this.allTreeData, this.treeColumns);
90
103
  }
91
104
  },
92
105
  created () {
@@ -141,7 +154,10 @@ export default {
141
154
  // 树形、汇总节点操作 -点击
142
155
  clickNode (operationItem, col, row, rowIndex) {
143
156
  if (col.colType === "tree") {
144
- if (!this.getRowIsDftDisabled(row) || col._readonlyOnDftRow !== true) {
157
+ if (
158
+ (this.getIsDftRow(row) ? !this.dftReadonlyTreeColKeys.includes(col._key) : true) && // 默认行的某列是否可编辑
159
+ (row.__old__ === true ? !this.oldReadonlyTreeColKeys.includes(col._key) : true) // 老数据行里某些列不可编辑
160
+ ) {
145
161
  row.isEdit = true;
146
162
  this.$nextTick(() => {
147
163
  this.$refs[`${col._id}${row._id}`][0] && this.$refs[`${col._id}${row._id}`][0].focus();
@@ -402,11 +418,16 @@ export default {
402
418
  ...(column.level < this.maxLevel ? ["canCreateCol"] : []), // 限制最大添加到几级
403
419
  ...(column.level > 1 && column.canDelete === true ? ["canDeleteCol"] : []) // 只有一级和最后两级节点数不一致时,不能删
404
420
  ]
405
- : this.getRowIsDftDisabled(row)
406
- ? []
407
- : row.isLeaf === true
408
- ? ["canCreate", "canDelete"]
409
- : ["canCreate", "canCreateChild", "canDelete", "canDeleteChilds"]
421
+ : row.isLeaf === true
422
+ ? [
423
+ "canCreate",
424
+ ...(this.getRowBtnCanEdit(row, rowIndex) ? ["canDelete"] : [])
425
+ ]
426
+ : [
427
+ "canCreate",
428
+ "canCreateChild",
429
+ ...(this.getRowBtnCanEdit(row, rowIndex) ? ["canDelete", "canDeleteChilds"] : [])
430
+ ]
410
431
  );
411
432
 
412
433
  return !this.isSearching &&
@@ -537,7 +558,7 @@ export default {
537
558
 
538
559
  /* ----------- 工具方法 ---------- */
539
560
  // 合并表头
540
- mergeColumns (treeForm = [], subForm = []) {
561
+ mergeColumns (treeForm = [], subForm = this.showContentColumns) {
541
562
  return treeForm
542
563
  .reduce((arr, treeFormItem, treeFormIndex) => {
543
564
  return arr.concat(
@@ -555,11 +576,7 @@ export default {
555
576
  );
556
577
  }, [])
557
578
  .concat(
558
- subForm.filter(subFormItem =>
559
- this.hideStatus === true
560
- ? !this.hideColKeys.includes(subFormItem._key)
561
- : true
562
- ).map(subFormItem => (
579
+ subForm.map(subFormItem => (
563
580
  {
564
581
  ...subFormItem,
565
582
  nodeKey: treeForm[treeForm.length - 1]._key,
@@ -640,14 +657,14 @@ export default {
640
657
  return nodes;
641
658
  },
642
659
  // 转化渲染使用的columns数组
643
- transformRowColumnsArr (nodes = [], treeForm = [], subForm = []) {
660
+ transformRowColumnsArr (nodes = [], treeForm = []) {
644
661
  let loop = (nodes, rowColumnsArr) => {
645
662
  nodes = this.getFilteredNodes(nodes);
646
663
 
647
664
  return nodes.reduce((rowColumnsArr, node, nodeIndex) => {
648
665
  if (nodeIndex !== 0 || rowColumnsArr.length === 0) {
649
666
  rowColumnsArr.push(
650
- this.mergeColumns(treeForm.slice(node.level - 1), subForm)
667
+ this.mergeColumns(treeForm.slice(node.level - 1))
651
668
  );
652
669
  }
653
670
 
@@ -695,15 +712,7 @@ export default {
695
712
  const children = loop(rowItem.children);
696
713
  return !!children.length;
697
714
  } else {
698
- const bool = this.$isAdvRelyAccord(this.finalTableAdvSearch, rowItem);
699
- // 重置
700
- rowItem.__isSearchShow__ = false;
701
- if (bool) {
702
- rowItem.__isRendered__ = true;
703
- rowItem.__isSearchShow__ = true;
704
- }
705
-
706
- return bool;
715
+ return this.dealSearchShow(rowItem);
707
716
  }
708
717
  });
709
718
  };
@@ -80,12 +80,16 @@ export default {
80
80
  const list = this.data;
81
81
  const newRow = this.getNewRowData();
82
82
 
83
- // 处理单元格合并相关(当前列是合并列,则该列之前的合并列,要复制这一行对应列的值;当前列是普通列,按最后合并列的操作处理)
83
+ // 处理单元格合并相关(当前列是合并列,则该列之前的合并列,要复制这一行对应列的值;当前列是普通列,按该列前的最后合并列的操作处理)
84
84
  if (col) {
85
- if (col._mergeRow === true) {
85
+ if (this.mergeRowColKeys.includes(col._key)) {
86
86
  const newList = this.allListData.slice(rowIndex); // 从该行开始截取
87
- const nextRowIndex = newList.findIndex(rowItem => rowItem[col._key] !== row[col._key]); // 寻找该单元格值开始不一样的行(特殊情况是最后一行,nextRowIndex为-1)
88
- row = nextRowIndex < 0 ? newList[newList.length - 1] : newList[nextRowIndex - 1]; // 取该单元格值一样的最后一行
87
+ const nextRowIndex = this.$isEmptyData(row[col._key])
88
+ ? 1
89
+ : newList.findIndex(rowItem => rowItem[col._key] !== row[col._key]); // 寻找该单元格值开始不一样的行(特殊情况是最后一行,nextRowIndex为-1)
90
+ row = nextRowIndex < 0
91
+ ? newList[newList.length - 1]
92
+ : newList[nextRowIndex - 1]; // 取该单元格值一样的最后一行
89
93
 
90
94
  const colIndex = this.mergeRowColumns.findIndex(column => column._key === col._key);
91
95
  this.mergeRowColumns.reduce((obj, column, columnIndex) => {
@@ -98,7 +102,7 @@ export default {
98
102
  }
99
103
  else {
100
104
  const colIndex = this.selfColumns.findIndex(column => column._key === col._key);
101
- const mergeRowColumns = this.selfColumns.filter((column, columnIndex) => columnIndex < colIndex && column._mergeRow === true);
105
+ const mergeRowColumns = this.selfColumns.filter((column, columnIndex) => columnIndex < colIndex && this.mergeRowColKeys.includes(column._key));
102
106
  mergeRowColumns.slice(0, mergeRowColumns.length - 1).reduce((obj, column) => {
103
107
  return Object.assign(obj, {
104
108
  [column._key]: this.$deepCopy(row[column._key])
@@ -198,7 +198,7 @@ export default {
198
198
  }, rowItem);
199
199
  }
200
200
 
201
- this.fixRowItem(rowItem);
201
+ this.fixRowItem(rowItem, levelNum);
202
202
  });
203
203
  loop(treeData);
204
204
 
@@ -96,48 +96,6 @@ export default {
96
96
  isEnlarge: false,
97
97
  isEnlargeFlag: true, // 为重渲染膜态框内容而用
98
98
 
99
- topOperationMap: {
100
- canHideOrShow: {
101
- name: "显示/隐藏字段",
102
- type: "canHideOrShow",
103
- // icon: "md-share-alt",
104
- size: "small",
105
- btnType: "text",
106
- event: "toggleHideOrShow"
107
- },
108
- canQuote: {
109
- name: "引用",
110
- type: "canQuote",
111
- icon: "ios-copy",
112
- size: "small",
113
- btnType: "text",
114
- event: "clickQuote"
115
- },
116
- canImport: {
117
- name: "导入",
118
- type: "canImport",
119
- icon: "ios-create-outline",
120
- size: "small",
121
- btnType: "text",
122
- event: "clickImport"
123
- },
124
- canExport: {
125
- name: "导出",
126
- type: "canExport",
127
- icon: "md-share-alt",
128
- size: "small",
129
- btnType: "text",
130
- event: "clickExport"
131
- },
132
- canEnlarge: {
133
- name: "全屏展示",
134
- type: "canEnlarge",
135
- icon: "md-expand",
136
- size: "small",
137
- btnType: "text",
138
- event: "clickEnlarge"
139
- }
140
- },
141
99
  baseOperationMap: {
142
100
  canCreate: {
143
101
  name: "添加一行",
@@ -179,12 +137,56 @@ export default {
179
137
  color: "#E83636",
180
138
  disabled: false,
181
139
  event: "clickDeleteChilds"
182
- },
140
+ }
141
+ },
142
+ otherOperationMap: {
183
143
  changeVal: {
184
144
  name: "改变输入框值",
185
145
  type: "changeVal",
186
146
  event: "changeVal"
187
147
  }
148
+ },
149
+ topOperationMap: {
150
+ canHideOrShow: {
151
+ name: "显示/隐藏字段",
152
+ type: "canHideOrShow",
153
+ // icon: "md-share-alt",
154
+ size: "small",
155
+ btnType: "text",
156
+ event: "toggleHideOrShow"
157
+ },
158
+ canQuote: {
159
+ name: "引用",
160
+ type: "canQuote",
161
+ icon: "ios-copy",
162
+ size: "small",
163
+ btnType: "text",
164
+ event: "clickQuote"
165
+ },
166
+ canImport: {
167
+ name: "导入",
168
+ type: "canImport",
169
+ icon: "ios-create-outline",
170
+ size: "small",
171
+ btnType: "text",
172
+ event: "clickImport"
173
+ },
174
+ canExport: {
175
+ name: "导出",
176
+ type: "canExport",
177
+ icon: "md-share-alt",
178
+ size: "small",
179
+ btnType: "text",
180
+ event: "clickExport"
181
+ },
182
+ canEnlarge: {
183
+ name: "全屏展示",
184
+ type: "canEnlarge",
185
+ icon: "md-expand",
186
+ size: "small",
187
+ btnType: "text",
188
+ event: "clickEnlarge"
189
+ }
188
190
  }
189
191
  };
190
192
  },
@@ -201,6 +203,10 @@ export default {
201
203
  controlKey () {
202
204
  return this.propsObj._key;
203
205
  },
206
+ // 是否在设置默认值下
207
+ isDftSet () {
208
+ return this.controlKey === "_default";
209
+ },
204
210
  controlType () {
205
211
  return this.propsObj._type;
206
212
  },
@@ -216,15 +222,6 @@ export default {
216
222
  allScreenKey () {
217
223
  return this.propsObj.allScreenKey;
218
224
  },
219
- selfColumns () {
220
- return this.columns;
221
- },
222
- mergeRowColumns () {
223
- return this.selfColumns.filter(column => column._mergeRow === true);
224
- },
225
- filterColumns () {
226
- return this.selfColumns.filter(col => this.$isAdvRelyShow(col, this.allListData, this.parentObj, true));
227
- },
228
225
 
229
226
  commonPropsObj () {
230
227
  return {
@@ -239,13 +236,17 @@ export default {
239
236
  _useSelection: false, // 使用选择列 -配置端暂时用不到
240
237
  _useIndex: true, // 使用序号列
241
238
  _useSummary: false, // 使用汇总行
239
+ _mergeRowColKeys: [], // 合并行的列
240
+
242
241
  _disabledBtns: false, // 禁用增删按钮
243
- // _disabledCreateBtn: false, // 置灰新增按钮,目前只内部使用,comp_web数据表配置页那块
242
+ _showCreateBtnColKeys: [], // 显示添加图标的列
244
243
  _disabledFootCreateBtn: false, // 禁用底部新增按钮
245
- _disabledDeleteDftRow: false, // 默认数据行禁止删除
246
- _disabledOldDataRow: false, // 置灰老数据行包含删除
247
- _showCreateBtnColKeys: [], // 显示插入一行按钮的列
248
- _hideColKeys: [], // 隐藏/查看列字段的keys
244
+ _disabledDeleteDftRow: false, // 默认的数据行禁止删除
245
+ _disabledDeleteOldRow: false, // 保存的数据行禁止删除
246
+ _dftReadonly: false, // 默认的数据只读
247
+ _dftReadonlyColKeys: [], // 默认的数据只读的列
248
+ _oldReadonly: false, // 保存的数据只读
249
+ _oldReadonlyColKeys: [], // 保存的数据只读的列
249
250
 
250
251
  _searchList: [], // 作为搜索的字段
251
252
  _searchLabelWidth: 100, // 搜索的label宽度
@@ -254,8 +255,7 @@ export default {
254
255
  conditions: []
255
256
  }, // 筛选默认值(cascaderTable和flatTable组件里默认值情使用时,以及modSetForm里,会重置_tableAdvSearch)
256
257
 
257
- _isImport: false, // 导入
258
- _isExport: false, // 导出
258
+ _hideColKeys: [], // 隐藏/查看列字段的keys
259
259
  _isQuote: false, // 引用
260
260
  _quoteDisabledColKeys: [], // 引用数据行不可编辑咧
261
261
  _quoteListFields: [], // 引用列表的显示字段
@@ -263,8 +263,10 @@ export default {
263
263
  logic: "and",
264
264
  conditions: []
265
265
  }, // 引用列表筛选条件
266
- ...this.propsObj,
266
+ _isImport: false, // 导入
267
+ _isExport: false, // 导出
267
268
 
269
+ ...this.propsObj,
268
270
  _contentHeight: this.propsObj._contentHeight || 500 // 表格最大高度
269
271
  };
270
272
  },
@@ -312,26 +314,37 @@ export default {
312
314
  useSummary () {
313
315
  return this.selfPropsObj._useSummary;
314
316
  },
317
+ mergeRowColKeys () {
318
+ return this.selfPropsObj._mergeRowColKeys || []; // 配置端有问题,高级以依赖时候值成undefined了
319
+ },
320
+
315
321
  disabledBtns () {
316
- return this.controlKey === "_default" ? false : this.selfPropsObj._disabledBtns;
322
+ return this.isDftSet ? false : this.selfPropsObj._disabledBtns;
323
+ },
324
+ showCreateBtnColKeys () {
325
+ return this.selfPropsObj._showCreateBtnColKeys || []; // 配置端有问题,高级以依赖时候值成undefined了
317
326
  },
318
- // disabledCreateBtn () {
319
- // return this.selfPropsObj._disabledCreateBtn;
320
- // },
321
327
  disabledFootCreateBtn () {
322
- return this.selfPropsObj._disabledFootCreateBtn;
328
+ return this.isDftSet ? false : this.selfPropsObj._disabledFootCreateBtn;
323
329
  },
324
330
  disabledDeleteDftRow () {
325
- return this.selfPropsObj._disabledDeleteDftRow;
331
+ return this.isDftSet ? false : this.selfPropsObj._disabledDeleteDftRow;
326
332
  },
327
- disabledOldDataRow () {
328
- return this.controlKey === "_default" ? false : this.selfPropsObj._disabledOldDataRow;
333
+ disabledDeleteOldRow () {
334
+ return this.isDftSet ? false : this.selfPropsObj._disabledDeleteOldRow;
329
335
  },
330
- showCreateBtnColKeys () {
331
- return this.selfPropsObj._showCreateBtnColKeys || []; // 配置端有问题,高级以依赖时候值成undefined了
336
+
337
+ dftReadonly () {
338
+ return this.isDftSet ? false : this.selfPropsObj._dftReadonly;
332
339
  },
333
- hideColKeys () {
334
- return this.selfPropsObj._hideColKeys;
340
+ dftReadonlyColKeys () {
341
+ return this.isDftSet ? [] : this.selfPropsObj._dftReadonlyColKeys || []; // 配置端有问题,高级以依赖时候值成undefined了
342
+ },
343
+ oldReadonly () {
344
+ return this.isDftSet ? false : this.selfPropsObj._oldReadonly;
345
+ },
346
+ oldReadonlyColKeys () {
347
+ return this.isDftSet ? [] : this.selfPropsObj._oldReadonlyColKeys || []; // 配置端有问题,高级以依赖时候值成undefined了
335
348
  },
336
349
 
337
350
  searchLabelWidth () {
@@ -410,16 +423,7 @@ export default {
410
423
  },
411
424
  renderedListData () {
412
425
  return this.allListData.filter(rowItem => {
413
- if (this.isSearching) {
414
- const bool = this.$isAdvRelyAccord(this.finalTableAdvSearch, rowItem);
415
-
416
- // 重置
417
- rowItem.__isSearchShow__ = false;
418
- if (bool) {
419
- rowItem.__isRendered__ = true;
420
- rowItem.__isSearchShow__ = true;
421
- }
422
- }
426
+ this.dealSearchShow(rowItem);
423
427
 
424
428
  return rowItem.__isRendered__;
425
429
  });
@@ -459,102 +463,15 @@ export default {
459
463
  return !!this.compareListData.length;
460
464
  },
461
465
 
462
- tablePropsObj () {
463
- return {
464
- // rowStyleOption: {
465
- // hoverHighlight: true,
466
- // clickHighlight: true,
467
- // stripe: true // 斑马纹
468
- // },
469
- maxHeight: this.contentHeight,
470
- // 通过实例方法 hideColumnsByKeys(keys)将列隐藏,通过实例方法 showColumnsByKeys(keys)将隐藏的列显示
471
- columnHiddenOption: {
472
- defaultHiddenColumnKeys: [...this.hideColKeys] // 必须这么写,不解构,切换一次隐藏/显示后,hideColKeys会变成空数组
473
- },
474
- cellStyleOption: this.cellStyleOption,
475
- cellSpanOption: {
476
- bodyCellSpan: ({ row, rowIndex, column }) => {
477
- // 合并单元格(单元格值为空时不合并)
478
- if (column._mergeRow === true) {
479
- if (this.$isEmptyData(row[column._key])) {
480
- return {
481
- rowspan: 1,
482
- colspan: 1
483
- };
484
- } else {
485
- if (
486
- rowIndex !== 0 &&
487
- row[column._key] === this.showListData[rowIndex - 1][column._key]
488
- ) {
489
- return {
490
- rowspan: 0,
491
- colspan: 0
492
- };
493
- } else {
494
- const newList = this.showListData.slice(rowIndex);
495
- const newIndex = newList.findIndex(rowItem => row[column._key] !== rowItem[column._key]);
496
- return {
497
- rowspan: newIndex === -1 ? newList.length : newIndex,
498
- colspan: 1
499
- };
500
- }
501
- }
502
- }
503
- }
504
- },
505
- eventCustomOption: {
506
- bodyCellEvents: ({ row, rowIndex, column }) => {
507
- return {
508
- click: (event) => {
509
- // console.log("click::", row, rowIndex, column, event);
510
- },
511
- dblclick: (event) => {
512
- // console.log("dblclick::", row, rowIndex, column, event);
513
- },
514
- contextmenu: (event) => {
515
- // console.log("contextmenu::", row, rowIndex, column, event);
516
- },
517
- mouseenter: (event) => {
518
- this.$set(this.hoverRecordMap, `${row._id}dsh${column._key}`, true);
519
- },
520
- mouseleave: (event) => {
521
- this.$set(this.hoverRecordMap, `${row._id}dsh${column._key}`, false);
522
- }
523
- };
524
- }
525
- }
526
- };
466
+ /* */
467
+ selfColumns () {
468
+ return this.columns;
527
469
  },
528
- cellStyleOption () {
529
- return {
530
- bodyCellClass: ({ row, rowIndex, column }) => {
531
- return "bri-table-td" +
532
- `${column._mergeRow
533
- ? " bri-table-td-merge"
534
- : ""
535
- }` +
536
- `${this.getRowCanEdit(row, rowIndex)
537
- ? " bri-table-td-edit"
538
- : ""
539
- }` +
540
- `${this.isSearching
541
- ? row.__isSearchShow__ === false
542
- ? " bri-table-td-hide"
543
- : ""
544
- : row.__isShow__ === true
545
- ? this.isExpandAction
546
- ? " bri-table-td-visible"
547
- : ""
548
- : " bri-table-td-hide"
549
- }` +
550
- `${["__isExpand__"].includes(column._key)
551
- ? " bri-table-td-expand"
552
- : ["__index__"].includes(column._key)
553
- ? " bri-table-td-index"
554
- : ""
555
- }`;
556
- }
557
- };
470
+ mergeRowColumns () {
471
+ return this.selfColumns.filter(colItem => this.mergeRowColKeys.includes(colItem._key));
472
+ },
473
+ filterColumns () {
474
+ return this.selfColumns.filter(colItem => this.$isAdvRelyShow(colItem, this.allListData, this.parentObj, true));
558
475
  },
559
476
  contentColumns () {
560
477
  return this.filterColumns.map(colItem => ({
@@ -641,6 +558,13 @@ export default {
641
558
  ...colItem
642
559
  }));
643
560
  },
561
+ showContentColumns () {
562
+ return this.contentColumns.filter(colItem =>
563
+ this.hideStatus === true
564
+ ? !this.hideColKeys.includes(colItem._key)
565
+ : true
566
+ );
567
+ },
644
568
  selectionColumn () {
645
569
  return {
646
570
  _key: "__selection__",
@@ -668,8 +592,7 @@ export default {
668
592
  props: {
669
593
  list: operationList.map(btnItem => ({
670
594
  ...btnItem,
671
- disabled: !this.getRowBtnCanEdit(row, rowIndex) ||
672
- (this.disabledDeleteDftRow ? this.getRowIsDftDisabled(row, rowIndex) : false)
595
+ disabled: !this.getRowBtnCanEdit(row, rowIndex)
673
596
  }))
674
597
  },
675
598
  on: {
@@ -682,31 +605,112 @@ export default {
682
605
  };
683
606
  },
684
607
 
685
- isImport () {
686
- return this.selfPropsObj._isImport;
687
- },
688
- importParams () {
608
+ tablePropsObj () {
689
609
  return {
690
- _id: this.parentDataId,
691
- _key: this.controlKey,
692
- importType: this.inTableType
610
+ // rowStyleOption: {
611
+ // hoverHighlight: true,
612
+ // clickHighlight: true,
613
+ // stripe: true // 斑马纹
614
+ // },
615
+ maxHeight: this.contentHeight,
616
+ // 通过实例方法 hideColumnsByKeys(keys)将列隐藏,通过实例方法 showColumnsByKeys(keys)将隐藏的列显示
617
+ columnHiddenOption: {
618
+ defaultHiddenColumnKeys: [...this.hideColKeys] // 必须这么写,不解构,切换一次隐藏/显示后,hideColKeys会变成空数组
619
+ },
620
+ cellStyleOption: this.cellStyleOption,
621
+ cellSpanOption: {
622
+ bodyCellSpan: ({ row, rowIndex, column }) => {
623
+ // 合并单元格(单元格值为空时不合并)
624
+ if (this.mergeRowColKeys.includes(column._key)) {
625
+ if (this.$isEmptyData(row[column._key])) {
626
+ return {
627
+ rowspan: 1,
628
+ colspan: 1
629
+ };
630
+ }
631
+ else {
632
+ if (
633
+ rowIndex !== 0 &&
634
+ row[column._key] === this.showListData[rowIndex - 1][column._key]
635
+ ) {
636
+ return {
637
+ rowspan: 0,
638
+ colspan: 0
639
+ };
640
+ } else {
641
+ const newList = this.showListData.slice(rowIndex);
642
+ const newIndex = newList.findIndex(rowItem => row[column._key] !== rowItem[column._key]);
643
+ return {
644
+ rowspan: newIndex === -1 ? newList.length : newIndex,
645
+ colspan: 1
646
+ };
647
+ }
648
+ }
649
+ }
650
+ }
651
+ },
652
+ eventCustomOption: {
653
+ bodyCellEvents: ({ row, rowIndex, column }) => {
654
+ return {
655
+ click: (event) => {
656
+ // console.log("click::", row, rowIndex, column, event);
657
+ },
658
+ dblclick: (event) => {
659
+ // console.log("dblclick::", row, rowIndex, column, event);
660
+ },
661
+ contextmenu: (event) => {
662
+ // console.log("contextmenu::", row, rowIndex, column, event);
663
+ },
664
+ mouseenter: (event) => {
665
+ this.$set(this.hoverRecordMap, `${row._id}dsh${column._key}`, true);
666
+ },
667
+ mouseleave: (event) => {
668
+ this.$set(this.hoverRecordMap, `${row._id}dsh${column._key}`, false);
669
+ }
670
+ };
671
+ }
672
+ }
693
673
  };
694
674
  },
695
- isExport () {
696
- return this.selfPropsObj._isExport;
697
- },
698
- exportParams () {
675
+ cellStyleOption () {
699
676
  return {
700
- screenKey: this.screenKey,
701
- _id: this.parentDataId,
702
- _key: this.controlKey,
703
- advSearch: this.finalTableAdvSearch
677
+ bodyCellClass: ({ row, rowIndex, column }) => {
678
+ return "bri-table-td" +
679
+ `${this.mergeRowColKeys.includes(column._key)
680
+ ? " bri-table-td-merge"
681
+ : ""
682
+ }` +
683
+ `${this.getRowCanEdit(row, rowIndex)
684
+ ? " bri-table-td-edit"
685
+ : ""
686
+ }` +
687
+ `${this.isSearching
688
+ ? row.__isSearchShow__ === false
689
+ ? " bri-table-td-hide"
690
+ : ""
691
+ : row.__isShow__ === true
692
+ ? this.isExpandAction
693
+ ? " bri-table-td-visible"
694
+ : ""
695
+ : " bri-table-td-hide"
696
+ }` +
697
+ `${["__isExpand__"].includes(column._key)
698
+ ? " bri-table-td-expand"
699
+ : ["__index__"].includes(column._key)
700
+ ? " bri-table-td-index"
701
+ : ""
702
+ }`;
703
+ }
704
704
  };
705
705
  },
706
+
707
+ hideColKeys () {
708
+ return this.selfPropsObj._hideColKeys;
709
+ },
706
710
  isQuote () {
707
711
  return this.selfPropsObj._isQuote;
708
712
  },
709
- quoteDisabledColKeys () {
713
+ quoteReadonlyColKeys () {
710
714
  return this.selfPropsObj._quoteDisabledColKeys;
711
715
  },
712
716
  quoteListFields () {
@@ -736,6 +740,27 @@ export default {
736
740
  }
737
741
  };
738
742
  },
743
+ isImport () {
744
+ return this.selfPropsObj._isImport;
745
+ },
746
+ importParams () {
747
+ return {
748
+ _id: this.parentDataId,
749
+ _key: this.controlKey,
750
+ importType: this.inTableType
751
+ };
752
+ },
753
+ isExport () {
754
+ return this.selfPropsObj._isExport;
755
+ },
756
+ exportParams () {
757
+ return {
758
+ screenKey: this.screenKey,
759
+ _id: this.parentDataId,
760
+ _key: this.controlKey,
761
+ advSearch: this.finalTableAdvSearch
762
+ };
763
+ },
739
764
  modalPropsObj () {
740
765
  return {
741
766
  mode: "fullscreen",
@@ -743,21 +768,21 @@ export default {
743
768
  };
744
769
  },
745
770
 
746
- topOperationBtns () {
747
- return Object.keys(this.topOperationMap);
748
- },
749
771
  baseOperationBtns () {
750
772
  return Object.keys(this.baseOperationMap);
751
773
  },
774
+ otherOperationBtns () {
775
+ return Object.keys(this.otherOperationMap);
776
+ },
777
+ topOperationBtns () {
778
+ return Object.keys(this.topOperationMap);
779
+ },
752
780
  allOperationMap () {
753
781
  return {
754
- ...(this.topOperationMap || {}),
755
782
  ...(this.baseOperationMap || {}),
783
+ ...(this.otherOperationMap || {}),
784
+ ...(this.topOperationMap || {}),
756
785
 
757
- canHideOrShow: {
758
- ...this.topOperationMap.canHideOrShow,
759
- name: this.hideStatus ? "显示字段" : "隐藏字段"
760
- },
761
786
  canCreate: {
762
787
  ...this.baseOperationMap.canCreate,
763
788
  name: this.showMode === "form"
@@ -771,6 +796,10 @@ export default {
771
796
  ? this.baseOperationMap.canCreateChild.name.replace("行", "条")
772
797
  : this.baseOperationMap.canCreateChild.name
773
798
  // disabled: !!this.disabledCreateBtn
799
+ },
800
+ canHideOrShow: {
801
+ ...this.topOperationMap.canHideOrShow,
802
+ name: this.hideStatus ? "显示字段" : "隐藏字段"
774
803
  }
775
804
  };
776
805
  },
@@ -781,16 +810,18 @@ export default {
781
810
  undefined,
782
811
  this.canEdit
783
812
  ? [
784
- ...(this.hideColKeys.length ? ["canHideOrShow"] : []),
813
+ ...(this.disabledBtns ? [] : this.baseOperationBtns),
814
+ ...this.otherOperationBtns,
785
815
  ...(this.isQuote ? ["canQuote"] : []),
786
816
  ...(this.isImport ? ["canImport"] : []),
817
+
787
818
  ...(this.isExport ? ["canExport"] : []),
788
- "canEnlarge",
789
- ...(this.disabledBtns ? ["changeVal"] : this.baseOperationBtns)
819
+ ...(this.hideColKeys.length ? ["canHideOrShow"] : []),
820
+ "canEnlarge"
790
821
  ]
791
822
  : [
792
- ...(this.hideColKeys.length ? ["canHideOrShow"] : []),
793
823
  ...(this.isExport ? ["canExport"] : []),
824
+ ...(this.hideColKeys.length ? ["canHideOrShow"] : []),
794
825
  "canEnlarge"
795
826
  ]
796
827
  );
@@ -862,9 +893,9 @@ export default {
862
893
  } else {
863
894
  this.$refs.briTable.hideColumnsByKeys(this.hideColKeys);
864
895
  }
865
-
866
- this.hideStatus = !this.hideStatus;
867
896
  }
897
+
898
+ this.hideStatus = !this.hideStatus;
868
899
  },
869
900
 
870
901
  /* ----------- 引用 ---------- */
@@ -1269,7 +1300,7 @@ export default {
1269
1300
  }
1270
1301
  ),
1271
1302
  // __old__: false,
1272
- __isDefault__: this.controlKey === "_default",
1303
+ __isDefault__: this.isDftSet,
1273
1304
  __isRendered__: true,
1274
1305
  __isShow__: true,
1275
1306
  __isTmpShow__: true,
@@ -1281,7 +1312,7 @@ export default {
1281
1312
  ...this.$deepCopy(this.selfRowDefault),
1282
1313
  _id: this.$ObjectID().str,
1283
1314
  // __old__: false,
1284
- __isDefault__: this.controlKey === "_default",
1315
+ __isDefault__: this.isDftSet,
1285
1316
  __isRendered__: true,
1286
1317
  __isShow__: true,
1287
1318
  __isTmpShow__: true,
@@ -1292,32 +1323,36 @@ export default {
1292
1323
  },
1293
1324
  // 整行校验结果
1294
1325
  getRowRuleResult (row, rowIndex) {
1295
- return this.filterColumns.every(column => this.getColRuleResult(column, row, rowIndex).bool);
1326
+ return this.filterColumns.every(colItem => this.getColRuleResult(colItem, row, rowIndex).bool);
1296
1327
  },
1297
1328
  getRowFormList (row, rowIndex) {
1298
- return this.selfColumns.map(column => {
1299
- column = this.$transformDynamicProperty(column, row, this.parentObj);
1300
- const unitCanEdit = this.getColCanEdit(column, row, rowIndex);
1329
+ return this.selfColumns.map(colItem => {
1330
+ colItem = this.$transformDynamicProperty(colItem, row, this.parentObj);
1331
+ const unitCanEdit = this.getColCanEdit(colItem, row, rowIndex);
1301
1332
 
1302
1333
  return {
1303
- ...column,
1334
+ ...colItem,
1304
1335
  canEdit: unitCanEdit
1305
1336
  };
1306
1337
  });
1307
1338
  },
1308
- // 是否禁止操作 在关于默认行方面
1309
- getRowIsDftDisabled (row, rowIndex) {
1310
- return this.controlKey === "_default" ? false : row.__isDefault__;
1339
+ // 是否默认行
1340
+ getIsDftRow (row, rowIndex) {
1341
+ return this.isDftSet ? false : row.__isDefault__;
1311
1342
  },
1312
- // 行按钮是否可编辑(删除按钮可编辑 不代表行内容是可编辑的)
1343
+ // 行按钮是否可操作(删除按钮可编辑 不代表行内容是可编辑的)
1313
1344
  getRowBtnCanEdit (row, rowIndex) {
1314
1345
  return this.canEdit && // 是编辑状态
1315
- (this.disabledOldDataRow ? row.__old__ !== true : true) && // 老数据行不置灰/置灰时是新增数据
1346
+ (this.disabledDeleteDftRow ? row.__isDefault__ !== true : true) && // 默认数据可删除
1347
+ (this.disabledDeleteOldRow ? row.__old__ !== true : true) && // 老数据可删除
1316
1348
  row.__readonly__ !== true; // 不能为只读数据
1317
1349
  },
1318
1350
  // 行内容是否可编辑
1319
1351
  getRowCanEdit (row, rowIndex) {
1320
- return this.getRowBtnCanEdit(row, rowIndex);
1352
+ return this.canEdit && // 是编辑状态
1353
+ (this.getIsDftRow(row) ? !this.dftReadonly : true) && // 默认数据可编辑
1354
+ (row.__old__ === true ? !this.oldReadonly : true) && // 老数据可编辑
1355
+ row.__readonly__ !== true; // 不能为只读数据
1321
1356
  },
1322
1357
 
1323
1358
  // 单元格校验结果
@@ -1385,11 +1420,12 @@ export default {
1385
1420
  : true
1386
1421
  ) &&
1387
1422
  !(["cascaderTable"].includes(this.controlType) && ["level", "children"].includes(col._key)) && // 层级表格的固定字段不可编辑
1388
- (col._oldReadonly ? row.__old__ !== true : true) && // 老数据行里某些列不可编辑
1389
- (row.__isQuote__ ? !this.quoteDisabledColKeys.includes(col._key) : true) && // 引用过来的数据是否可编辑
1423
+ (col._oldReadonly ? row.__old__ !== true : true) && // 某些列在老数据行里不可编辑
1424
+ (this.getIsDftRow(row) ? !this.dftReadonlyColKeys.includes(col._key) : true) && // 默认行的某列是否可编辑
1425
+ (row.__old__ === true ? !this.oldReadonlyColKeys.includes(col._key) : true) && // 老数据行里某些列不可编辑
1426
+ (row.__isQuote__ ? !this.quoteReadonlyColKeys.includes(col._key) : true) && // 引用过来的数据是否可编辑
1390
1427
  !["calculate"].includes(col._enterType) && // 计算的不可编辑
1391
1428
  col._readonly !== true && // 只读
1392
- (!this.getRowIsDftDisabled(row) || col._readonlyOnDftRow !== true) && // 默认行的某列是否可编辑
1393
1429
  col.canEdit !== false; // 字段本身编辑权限 考虑为undefined时候
1394
1430
  },
1395
1431
  // 单元格最终编辑状态
@@ -1426,13 +1462,14 @@ export default {
1426
1462
  }
1427
1463
  },
1428
1464
  // 初始化时 修复数据
1429
- fixRowItem (row) {
1465
+ fixRowItem (row, levelNum) {
1430
1466
  if (this.initFlag) {
1431
1467
  // TODO:修正数据level属性,后期可以删除
1432
1468
  if (["cascaderTable"].includes(this.controlType)) {
1433
1469
  row.level = row.level || levelNum;
1434
1470
  }
1435
1471
 
1472
+ // 配置端设置的地方,不会运行下面的,因为_default被过滤掉没值,defaultListDataIds就是空的
1436
1473
  if (row._id) {
1437
1474
  if (this.defaultListDataIds.includes(row._id)) {
1438
1475
  row.__isDefault__ = true;
@@ -1444,8 +1481,8 @@ export default {
1444
1481
  row._id = this.$ObjectID().str;
1445
1482
  }
1446
1483
 
1447
- row.__old__ = this.controlKey === "_default" ? false : !this.parentObj.__isCreate__; // 标记老数据
1448
- row.__isDefault__ = this.controlKey === "_default" ? true : !!row.__isDefault__; // 标记默认数据(配置端默认值)
1484
+ row.__old__ = this.isDftSet ? false : !this.parentObj.__isCreate__; // 标记老数据
1485
+ row.__isDefault__ = this.isDftSet ? true : !!row.__isDefault__; // 标记默认数据(配置端默认值)
1449
1486
 
1450
1487
  // 初次进来 把关于展示的状态值全部清除
1451
1488
  this.resetProperties.forEach(property => {
@@ -1472,6 +1509,23 @@ export default {
1472
1509
  row.__isExpand__ = false;
1473
1510
  }
1474
1511
  }
1512
+ },
1513
+ dealSearchShow (rowItem) {
1514
+ if (this.isSearching) {
1515
+ const bool = this.$isAdvRelyAccord(this.finalTableAdvSearch, rowItem);
1516
+
1517
+ // 重置
1518
+ rowItem.__isSearchShow__ = false;
1519
+ if (bool) {
1520
+ rowItem.__isRendered__ = true;
1521
+ rowItem.__isSearchShow__ = true;
1522
+ }
1523
+
1524
+ return bool;
1525
+ }
1526
+ else {
1527
+ return true;
1528
+ }
1475
1529
  }
1476
1530
  }
1477
1531
  };
@@ -13,6 +13,7 @@ export default {
13
13
  selfPropsObj () {
14
14
  return {
15
15
  _treeForm: [],
16
+ ...(this.typePropsObj || {}),
16
17
  ...this.commonPropsObj,
17
18
 
18
19
  _maxLevel: this.commonPropsObj._maxLevel || 3 // 最大级数
@@ -88,7 +89,7 @@ export default {
88
89
  clickDeleteChilds (operationItem, row, rowIndex, col) {
89
90
  this.$Modal.confirm({
90
91
  title: "警告",
91
- content: "确定删除该行及其所有下级吗?",
92
+ content: "确定删除所有下级吗?",
92
93
  onOk: () => {
93
94
  row.children.splice(0);
94
95
 
@@ -1,15 +1,15 @@
1
1
  <template>
2
2
  <div class="DshListUnit">
3
- <template v-if="formItem._type === 'index'">
3
+ <template v-if="selfFormItem._type === 'index'">
4
4
  <span>{{ indexStr || rowIndex + 1 }}</span>
5
5
  </template>
6
6
 
7
- <template v-else-if="formItem.render">
7
+ <template v-else-if="selfFormItem.render">
8
8
  <dsh-list-render
9
- :column="formItem"
9
+ :column="selfFormItem"
10
10
  :row="formData"
11
11
  :index="rowIndex"
12
- :render="formItem.render"
12
+ :render="selfFormItem.render"
13
13
  ></dsh-list-render>
14
14
  </template>
15
15
 
@@ -19,7 +19,7 @@
19
19
  :canEdit="canEdit"
20
20
  :value="formData"
21
21
  :propsObj="{
22
- ...formItem,
22
+ ...selfFormItem,
23
23
  size: 'default',
24
24
  inTable: true
25
25
  }"
@@ -59,6 +59,10 @@ export default {
59
59
  computed: {
60
60
  curComponentName () {
61
61
  return componentNameMap[this.formItem._type] || "DshUndeveloped";
62
+ },
63
+
64
+ selfFormItem () {
65
+ return this.$transformDynamicProperty(this.formItem, this.formData, this.parentObj);
62
66
  }
63
67
  },
64
68
  created () { },