bri-components 1.3.75 → 1.3.77

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.75",
3
+ "version": "1.3.77",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -93,18 +93,8 @@
93
93
  ...this.commonDealPropsObj
94
94
  };
95
95
  },
96
-
97
- curValDate: {
98
- get () {
99
- const val = this.value[this.controlKey];
100
- return this.$transformDateCompatible(val, this.subType);
101
- },
102
- set (val) {
103
- this.$set(this.value, this.controlKey, this.$transformDate(val, "-", this.subType));
104
- }
105
- },
106
96
  subType () {
107
- return this.selfPropsObj._dateType;
97
+ return this.selfPropsObj._dateType; // 5种,"date", "datetime", "year", "month", "time"
108
98
  },
109
99
  options () {
110
100
  return {
@@ -123,6 +113,16 @@
123
113
  return !compareBool || !caluBool;
124
114
  }
125
115
  };
116
+ },
117
+
118
+ curValDate: {
119
+ get () {
120
+ const val = this.value[this.controlKey];
121
+ return this.$transformDateCompatible(val, this.subType);
122
+ },
123
+ set (val) {
124
+ this.$set(this.value, this.controlKey, this.$transformDate(val, "-", this.subType));
125
+ }
126
126
  }
127
127
  },
128
128
  created () {},
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="DshDaterange">
3
- <template v-if="['time', 'timerange'].includes(subType)">
3
+ <template v-if="['time'].includes(subType)">
4
4
  <!-- 时间范围 -->
5
5
  <TimePicker
6
6
  style="width: 100%;"
@@ -168,7 +168,7 @@
168
168
  computed: {
169
169
  selfPropsObj () {
170
170
  return {
171
- _icon: this.multipleMode ? "ios-people" : "ios-person",
171
+ _icon: this.propsObj._multiple === true ? "ios-people" : "ios-person",
172
172
  _highSearch: false,
173
173
  _changeOnSelect: true,
174
174
  _searchString: "",
@@ -283,7 +283,7 @@
283
283
  computed: {
284
284
  selfPropsObj () {
285
285
  return {
286
- _icon: this.multipleMode ? "ios-people" : "ios-person",
286
+ _icon: this.propsObj._multiple === true ? "ios-people" : "ios-person",
287
287
  _highSearch: false,
288
288
  _reverseFilter: false, // 是否反向过滤,默认正向过滤
289
289
  _userDepartFilterVals: [], // 过滤的数据
@@ -198,16 +198,14 @@
198
198
  },
199
199
 
200
200
  forceValidateTypes: [
201
- "select", "cascader", "regions", "cascaders", "file", "coordinates", "editor",
201
+ "select", "region", "cascader", "regions", "cascaders", "file", "coordinates", "editor",
202
202
  "users", "departments", "labels", "flatTable", "reference", "referenceBy"
203
203
  ],
204
204
  ignoreProperties: [
205
- "_name", "_key", "_default", "_required", "_span", "_br", "_line", "_noLabel", "_clearable",
205
+ "_name", "_key", "_default", "_required", "_regStr", "_regMessage", "_span", "_br", "_line", "_noLabel", "_clearable",
206
206
  "_disabledBtns", "_disabledOldDataRow"
207
- ],
208
- subIgnoreProperties: [
209
- "_regStr", "_regMessage"
210
207
  ]
208
+ // subIgnoreProperties: []
211
209
  };
212
210
  },
213
211
  computed: {
@@ -290,11 +288,9 @@
290
288
  if (this.$refs.dshFormUnit) {
291
289
  errorRefs = this.$refs.dshFormUnit.filter(refItem => !refItem.validate());
292
290
  bool = !errorRefs.length;
293
- } else {
294
- bool = true;
295
291
  }
296
- cb && cb(bool, errorRefs.map(errorRefItem => errorRefItem.formItem));
297
292
 
293
+ cb && cb(bool, errorRefs.map(errorRefItem => errorRefItem.formItem));
298
294
  return bool;
299
295
  },
300
296
  // iview的校验回调
@@ -342,8 +338,9 @@
342
338
  _displayType: "show",
343
339
  canEdit: !["createdAt", "updatedAt", "_creaters"].includes(formData._key)
344
340
  }).forEach(arr => {
345
- !this.ignoreProperties.includes(arr[0]) && (formData.__parentKey__ ? !this.subIgnoreProperties.includes(arr[0]) : true) &&
341
+ if (!this.ignoreProperties.includes(arr[0])) {
346
342
  this.$set(formItem, arr[0], arr[1]);
343
+ }
347
344
  });
348
345
  }
349
346
 
@@ -377,7 +374,7 @@
377
374
  if (ruleConfig.regs && ruleConfig.regs.length) {
378
375
  rules.push({
379
376
  message: formItem._regMessage || `${formItem._name}格式不正确!`,
380
- trigger: "blur",
377
+ trigger: "blur, change",
381
378
  type: "string",
382
379
  transform: (val) => {
383
380
  return this.$isEmptyData(val)
@@ -388,16 +385,31 @@
388
385
  });
389
386
  }
390
387
 
391
- // 对比校验(横向对比和层级对比)-虽然暂时只number和date对比校验,但为了扩展到其他类型时,不修改此处。用type判断:大量使用DshForm的地方有复合类型,type参数(数据类型)没有定义,会出现校验文字
392
- // if (ruleConfig.type) {
393
- if (["number", "date"].includes(formItem._type)) {
388
+ // 对比校验(横向同类型字段对比)-暂时只number和date对比校验
389
+ if (formItem._saveRuleConfigs) {
394
390
  const ruleObj = {
395
391
  message: `${formItem._name}对比不通过!`,
396
392
  trigger: "blur, change",
397
393
  type: "string",
398
394
  transform: (val) => {
399
- return this.$normalComparedFunc(formItem, this.formData, this.allFormList, this.parentObj, this.parentFormList, this.inTableType, ruleObj) &&
400
- this.$levelComparedFunc(formItem, this.formData, this.allListRows, this.inTableType, ruleObj)
395
+ return this.$normalComparedFunc(formItem, this.formData, this.allFormList, this.parentObj, this.parentFormList, this.inTableType, ruleObj)
396
+ ? val
397
+ : false;
398
+ },
399
+ ...ruleConfig
400
+ };
401
+
402
+ rules.push(ruleObj);
403
+ }
404
+
405
+ // 对比校验(层级表格的层级对比)-暂时只number和date对比校验
406
+ if (this.inTableType === "treeTable" && ["downToUp", "upToDown"].includes(formItem._writeSort)) {
407
+ const ruleObj = {
408
+ message: `${formItem._name}层级对比不通过!`,
409
+ trigger: "blur, change",
410
+ type: "string",
411
+ transform: (val) => {
412
+ return this.$levelComparedFunc(formItem, this.formData, this.allListRows, this.inTableType, ruleObj)
401
413
  ? val
402
414
  : false;
403
415
  },
@@ -328,7 +328,6 @@ export default {
328
328
  columns.reduce((newRow, column) => {
329
329
  if (["number", "date"].includes(column._type)) {
330
330
  if (![undefined, null, "", "no"].includes(column._summaryType)) {
331
- console.log(newRow);
332
331
  this.$set(newRow, column._key, newRow[column._key]);
333
332
  }
334
333
  else if (["downToUp"].includes(column._writeSort) && column._noLimitWrite !== true) {
@@ -340,7 +339,7 @@ export default {
340
339
  }, row);
341
340
  }
342
341
 
343
- // 初次进来把前端存的状态值全部清除(除了__readonly__
342
+ // 初次进来把前端存的状态值全部清除(除了__readonly__和__isQuote__不处理)
344
343
  if (this.initFlag) {
345
344
  this.deleteProperties.forEach(property => {
346
345
  delete row[property];