bri-components 1.4.40 → 1.4.42

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.4.40",
3
+ "version": "1.4.42",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -111,7 +111,21 @@
111
111
  this.$emit("clickItem", ...params);
112
112
  },
113
113
  clickClear () {
114
- this.$emit("clear");
114
+ const cb = () => {
115
+ this.$emit("clear");
116
+ };
117
+
118
+ if (this.propsObj._useDeleteTip === true) {
119
+ this.$Modal.confirm({
120
+ title: "提示",
121
+ content: "确定清除全部内容吗?",
122
+ onOk: () => {
123
+ cb();
124
+ }
125
+ });
126
+ } else {
127
+ cb();
128
+ }
115
129
  }
116
130
  }
117
131
  };
@@ -203,6 +203,7 @@
203
203
  // 参数event
204
204
  onChange (event) {
205
205
  this.quickChange(); // 立马触发
206
+
206
207
  clearTimeout(this.timer);
207
208
  this.timer = setTimeout(() => {
208
209
  this.change();
@@ -105,12 +105,17 @@ export default {
105
105
  commonDealPropsObj () {
106
106
  const selectControlTypes = ["coordinates", "date", "switch", "select", "checkbox", "file", "region", "regions", "cascader", "cascaders", "users", "departments", "reference"];
107
107
  return {
108
- // TODO: 此处的请输入可能还有请选择之类的,待处理
109
108
  _placeholder: this.canEdit && this.propsObj._enterType !== "calculate" && this.propsObj._disabled !== true && this.propsObj._readonly !== true
110
109
  ? (this.propsObj._placeholder || `${selectControlTypes.includes(this.controlType) ? "选择" : "输入"}${this.propsObj._name}`)
111
110
  : "",
112
111
  _clearable: this.finalCanEdit && !this.propsObj._disabled && !this.propsObj._readonly && (this.propsObj._clearable === undefined ? true : this.propsObj._clearable),
113
- _disabled: !(this.finalCanEdit && !this.propsObj._disabled && !this.propsObj._readonly)
112
+ _disabled: !(this.finalCanEdit && !this.propsObj._disabled && !this.propsObj._readonly),
113
+ // 目前部门、用户在用,以后还会增多
114
+ _useDeleteTip: this.isInDftSearch || this.isInSearch
115
+ ? false
116
+ : this.propsObj._useDeleteTip == undefined
117
+ ? false
118
+ : this.propsObj._useDeleteTip // 删除项进行提示(筛选下删除项不提示)
114
119
  };
115
120
  },
116
121
  // 是否为多选模式
@@ -53,7 +53,6 @@ export default {
53
53
  return {
54
54
  _highSearch: false,
55
55
  _searchString: "",
56
- _useDeleteTip: false, // 删除项进行提示
57
56
 
58
57
  _reverseFilter: false, // 反向过滤
59
58
  _userDepartFilterVals: [], // 过滤的数据的第一级选项
@@ -190,7 +190,7 @@
190
190
  class="selectUsers-show-unit-img"
191
191
  />
192
192
  <span
193
- :key="item._key"
193
+ :key="item._key + 'img'"
194
194
  class="selectUsers-show-unit-text"
195
195
  >
196
196
  {{ getShowName(item) }}
@@ -275,18 +275,20 @@ export default {
275
275
  });
276
276
  },
277
277
  quickChangeVal (operationItem, row, rowIndex, column, params) {
278
- this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
279
- this.dealSameRowsVal({ row, rowIndex, column });
278
+ if (this.isUseQuickChange({ row, rowIndex, column })) {
279
+ this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
280
+ this.dealSameRowsVal({ row, rowIndex, column });
280
281
 
281
- this.change("quickChangeVal", row, rowIndex, column, ...params);
282
+ this.change("quickChangeVal", row, rowIndex, column, ...params);
283
+ }
282
284
  },
283
285
  changeVal (operationItem, row, rowIndex, column, params) {
284
- this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
285
- if (!["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._key)) {
286
+ if (!this.isUseQuickChange({ row, rowIndex, column })) {
287
+ this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
286
288
  this.dealSameRowsVal({ row, rowIndex, column });
287
- }
288
289
 
289
- this.change("changeVal", row, rowIndex, column, ...params);
290
+ this.change("changeVal", row, rowIndex, column, ...params);
291
+ }
290
292
  },
291
293
 
292
294
  /* ----------- 方法 ---------- */
@@ -337,15 +339,19 @@ export default {
337
339
 
338
340
  return rowspan;
339
341
  },
342
+ // 是都满足使用quickChange
343
+ isUseQuickChange ({ row, rowIndex, column }) {
344
+ return ["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type) &&
345
+ this.mergeRowColKeys.includes(column._key) &&
346
+ this.rowspanMap[this.getMixKey(row, column)] > 1;
347
+ },
340
348
  // 合并单元格的行,某列的值全部跟着修改
341
349
  dealSameRowsVal ({ row, rowIndex, column }, list = this.allListData) {
342
- if (this.mergeRowColKeys.includes(column._key) && this.rowspanMap[this.getMixKey(row, column)] > 1) {
343
- const indexInAll = list.findIndex(dataItem => dataItem._id === row._id);
344
- list.slice(indexInAll + 1, indexInAll + this.rowspanMap[this.getMixKey(row, column)])
345
- .forEach(rowItem => {
346
- rowItem[column._key] = this.$deepCopy(row[column._key]);
347
- });
348
- }
350
+ const indexInAll = list.findIndex(dataItem => dataItem._id === row._id);
351
+ list.slice(indexInAll + 1, indexInAll + this.rowspanMap[this.getMixKey(row, column)])
352
+ .forEach(rowItem => {
353
+ rowItem[column._key] = this.$deepCopy(row[column._key]);
354
+ });
349
355
  }
350
356
  }
351
357
  };
@@ -813,8 +813,7 @@ export default {
813
813
  },
814
814
  // 输入框值改变立即
815
815
  quickChangeVal (operationItem, row, rowIndex, column, params) {
816
- this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
817
- this.change("quickChangeVal", row, rowIndex, column, ...params);
816
+ // 啥也不做,平级表格合并单元格时用这个方法
818
817
  },
819
818
  // 输入框值改变
820
819
  changeVal (operationItem, row, rowIndex, column, params) {