bri-components 1.3.75 → 1.3.76

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.76",
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: [], // 过滤的数据
@@ -342,7 +342,8 @@
342
342
  _displayType: "show",
343
343
  canEdit: !["createdAt", "updatedAt", "_creaters"].includes(formData._key)
344
344
  }).forEach(arr => {
345
- !this.ignoreProperties.includes(arr[0]) && (formData.__parentKey__ ? !this.subIgnoreProperties.includes(arr[0]) : true) &&
345
+ !this.ignoreProperties.includes(arr[0]) &&
346
+ (formData.__parentKey__ ? !this.subIgnoreProperties.includes(arr[0]) : true) &&
346
347
  this.$set(formItem, arr[0], arr[1]);
347
348
  });
348
349
  }
@@ -388,16 +389,31 @@
388
389
  });
389
390
  }
390
391
 
391
- // 对比校验(横向对比和层级对比)-虽然暂时只number和date对比校验,但为了扩展到其他类型时,不修改此处。用type判断:大量使用DshForm的地方有复合类型,type参数(数据类型)没有定义,会出现校验文字
392
- // if (ruleConfig.type) {
393
- if (["number", "date"].includes(formItem._type)) {
392
+ // 对比校验(横向同类型字段对比)-暂时只number和date对比校验
393
+ if (formItem._saveRuleConfigs) {
394
394
  const ruleObj = {
395
395
  message: `${formItem._name}对比不通过!`,
396
396
  trigger: "blur, change",
397
397
  type: "string",
398
398
  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)
399
+ return this.$normalComparedFunc(formItem, this.formData, this.allFormList, this.parentObj, this.parentFormList, this.inTableType, ruleObj)
400
+ ? val
401
+ : false;
402
+ },
403
+ ...ruleConfig
404
+ };
405
+
406
+ rules.push(ruleObj);
407
+ }
408
+
409
+ // 对比校验(层级表格的层级对比)-暂时只number和date对比校验
410
+ if (this.inTableType === "treeTable" && ["downToUp", "upToDown"].includes(formItem._writeSort)) {
411
+ const ruleObj = {
412
+ message: `${formItem._name}层级对比不通过!`,
413
+ trigger: "blur, change",
414
+ type: "string",
415
+ transform: (val) => {
416
+ return this.$levelComparedFunc(formItem, this.formData, this.allListRows, this.inTableType, ruleObj)
401
417
  ? val
402
418
  : false;
403
419
  },
@@ -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) {