bri-components 1.3.20 → 1.3.22

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.22",
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.$transformFieldProperty(column, row, this.parentObj);
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.$transformFieldProperty(column, undefined, this.parentObj);
184
186
 
185
187
  return this.$getHeadRender(h, column, {
186
188
  showRequired: this.showRequired,
@@ -283,6 +285,28 @@
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
+ };
305
+ },
306
+ getUnitCanEdit (col, row) {
307
+ return this.getRowCanEdit(row) &&
308
+ this.getColCanEdit(col, row) &&
309
+ this.$isAdvRelyShow(col, row, this.parentObj, true);
286
310
  }
287
311
  }
288
312
  };
@@ -115,11 +115,7 @@ 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)
122
- );
118
+ return this.columns.filter(column => this.$isAdvRelyShow(column, undefined, this.parentObj, true));
123
119
  },
124
120
  selfRowDefault () {
125
121
  return this.$filterObj(this.filterColumns, this.rowDefault);
@@ -143,7 +139,7 @@ export default {
143
139
 
144
140
  return this.listData.every(row =>
145
141
  this.filterColumns.every(column => {
146
- column = this.$transformFieldProperty(column, column._isRuleByParent ? this.parentObj : row);
142
+ column = this.$transformFieldProperty(column, row, this.parentObj);
147
143
  return this.getRuleResult(column, row).bool;
148
144
  })
149
145
  );
@@ -176,33 +172,12 @@ export default {
176
172
  },
177
173
 
178
174
  /* --------------- 工具方法 ------------- */
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
- };
194
- },
195
- getUnitCanEdit (col, row) {
196
- return this.getRowCanEdit(row) && this.getColCanEdit(col, row);
197
- },
198
175
  getRowCanEdit (row) {
199
176
  return this.canEdit && // 是否是编辑状态
200
- // (!this.disabledOldDataRow || !!this.createRowMap[row._id]) && // 是否让老数据行置灰
201
177
  (!this.disabledOldDataRow || !!row.__isCreate__); // 是否让老数据行置灰
202
178
  },
203
179
  getColCanEdit (col, row) {
204
- return (!col.dependRowCanEdit || row.canEdit !== false) &&
205
- (col._isRelyByParent ? true : this.$isAdvRelyShow(col, row, true)); // 在老数据行里某些列不可编辑; // 在老数据行里某些列不可编辑
180
+ return (!col.dependRowCanEdit || row.canEdit !== false);// 在老数据行里某些列不可编辑
206
181
  },
207
182
  isShowCompare (col, row, oldRow = {}) {
208
183
  return this.useCampare && ["number"].includes(col._type) &&