bri-components 1.3.20 → 1.3.21

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.20",
3
+ "version": "1.3.21",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -181,7 +181,6 @@
181
181
  computed: {
182
182
  showFormList () {
183
183
  return this.formList.filter(formItem => this.isShow(formItem, this.formData));
184
- // return this.$getNotEmptyFieldList(formList, this.formData, this.canEdit, this.notShowEmpty);
185
184
  }
186
185
  },
187
186
  watch: {
@@ -124,7 +124,9 @@
124
124
  filter: undefined,
125
125
  sortBy: undefined,
126
126
  renderBodyCell: ({ row, column, rowIndex }, h) => {
127
- column = this.$transformFieldProperty(column, column._isRuleByParent ? this.parentObj : row);
127
+ column = this.transformCol(column, row);
128
+ column = this.resetCol(column, row);
129
+ const unitCanEdit = this.getUnitCanEdit(column, row);
128
130
 
129
131
  return [
130
132
  this.isShowCompare(column, row, this.oldListData[rowIndex])
@@ -143,9 +145,9 @@
143
145
  scopedSlots: {
144
146
  default: props => h("dsh-list-unit", {
145
147
  props: {
146
- canEdit: this.getUnitCanEdit(column, row),
148
+ canEdit: unitCanEdit,
147
149
  formData: row,
148
- formItem: this.resetCol(column, row),
150
+ formItem: column,
149
151
  rowIndex: rowIndex,
150
152
  allFormList: this.columns,
151
153
  parentListData: this.listData
@@ -159,9 +161,9 @@
159
161
  })
160
162
  : h("dsh-list-unit", {
161
163
  props: {
162
- canEdit: this.getUnitCanEdit(column, row),
164
+ canEdit: unitCanEdit,
163
165
  formData: row,
164
- formItem: this.resetCol(column, row),
166
+ formItem: column,
165
167
  rowIndex: rowIndex,
166
168
  allFormList: this.columns,
167
169
  parentListData: this.listData
@@ -180,7 +182,7 @@
180
182
  ];
181
183
  },
182
184
  renderHeaderCell: ({ column }, h) => {
183
- column = this.$transformFieldProperty(column, column._isRuleByParent ? this.parentObj : {});
185
+ column = this.transformCol(column);
184
186
 
185
187
  return this.$getHeadRender(h, column, {
186
188
  showRequired: this.showRequired,
@@ -283,6 +285,23 @@
283
285
  // 表单控件失去焦点
284
286
  controlBlur (operationItem, col, row, params) {
285
287
  this.$set(this.ruleRecordMap, `${row._id}dsh${col._key}`, { showRuleMessage: true });
288
+ },
289
+
290
+ resetCol (col, row) {
291
+ let resetMap = {
292
+ select: {
293
+ _optionKind: "dropdown"
294
+ },
295
+ checkbox: {
296
+ _optionKind: "dropdown"
297
+ }
298
+ };
299
+ return {
300
+ ...col,
301
+ ...(resetMap[col._type] || {}),
302
+ // isShare: this.isShare,
303
+ _heightAuto: this.heightAuto
304
+ };
286
305
  }
287
306
  }
288
307
  };
@@ -115,10 +115,10 @@ export default {
115
115
  },
116
116
 
117
117
  filterColumns () {
118
- return this.columns.filter(column =>
119
- column._isRelyByParent
120
- ? this.$isAdvRelyShow(column, this.parentObj, true, true, this.listData)
121
- : !["hide"].includes(column._displayType)
118
+ return this.columns.filter(col =>
119
+ col._isRelyByParent
120
+ ? this.$isAdvRelyShow(col, this.parentObj, true, true, this.listData)
121
+ : !["hide"].includes(col._displayType)
122
122
  );
123
123
  },
124
124
  selfRowDefault () {
@@ -142,9 +142,9 @@ export default {
142
142
  this.showRuleMessage = true;
143
143
 
144
144
  return this.listData.every(row =>
145
- this.filterColumns.every(column => {
146
- column = this.$transformFieldProperty(column, column._isRuleByParent ? this.parentObj : row);
147
- return this.getRuleResult(column, row).bool;
145
+ this.filterColumns.every(col => {
146
+ col = this.transformCol(col, row);
147
+ return this.getRuleResult(col, row).bool;
148
148
  })
149
149
  );
150
150
  },
@@ -176,21 +176,8 @@ export default {
176
176
  },
177
177
 
178
178
  /* --------------- 工具方法 ------------- */
179
- resetCol (col, row) {
180
- let resetMap = {
181
- select: {
182
- _optionKind: "dropdown"
183
- },
184
- checkbox: {
185
- _optionKind: "dropdown"
186
- }
187
- };
188
- return {
189
- ...col,
190
- ...(resetMap[col._type] || {}),
191
- // isShare: this.isShare,
192
- _heightAuto: this.heightAuto
193
- };
179
+ transformCol (col, row) {
180
+ return this.$transformFieldProperty(col, col._isRuleByParent ? this.parentObj : row);
194
181
  },
195
182
  getUnitCanEdit (col, row) {
196
183
  return this.getRowCanEdit(row) && this.getColCanEdit(col, row);