bri-components 1.2.97 → 1.2.99

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.2.97",
3
+ "version": "1.2.99",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -159,10 +159,10 @@
159
159
  ></dsh-list-unit>
160
160
 
161
161
  <span
162
- v-if="!getRuleResult(col, row[col.nodeKey]).bool"
162
+ v-if="!getRuleResult(col, row[col.nodeKey], rowIndex).bool"
163
163
  class="table-row-td-tip"
164
164
  >
165
- {{ getRuleResult(col, row[col.nodeKey]).message }}
165
+ {{ getRuleResult(col, row[col.nodeKey], rowIndex).message }}
166
166
  </span>
167
167
  </td>
168
168
  </template>
@@ -411,8 +411,9 @@
411
411
  validate () {
412
412
  this.showRuleMessage = true;
413
413
 
414
- return this.rows.every(dataItem =>
415
- this.subColumns.every(col => this.getRuleResult(col, dataItem, true).bool)
414
+ const subColumns = this.columns.filter(col => col.colType === "data");
415
+ return this.rows.every((row, rowIndex) =>
416
+ subColumns.every(col => this.getRuleResult(col, row[col.nodeKey], rowIndex, true).bool)
416
417
  );
417
418
  },
418
419
 
@@ -537,8 +538,19 @@
537
538
  this.$set(this.ruleRecordMap, `${row._id}dsh${col._key}`, { showRuleMessage: true });
538
539
  },
539
540
  // 是否显示 单元格校验提示文字
540
- getRuleResult (col, row, showRuleMessage = this.showRuleMessage) {
541
+ getRuleResult (col, row, rowIndex, showRuleMessage = this.showRuleMessage) {
541
542
  if ((this.ruleRecordMap[`${row._id}dsh${col._key}`] || {}).showRuleMessage || showRuleMessage) {
543
+ if (col._regStr && [";", ";"].some(symbol => col._regStr.includes(symbol))) {
544
+ col._regStr = col._regStr
545
+ .replace(/\n/g, "")
546
+ .split(";")
547
+ .reduce((arr, item) => arr.concat(item.split(";")), [])[rowIndex];
548
+ col._regMessage = (col._regMessage || "")
549
+ .replace(/\n/g, "")
550
+ .split(";")
551
+ .reduce((arr, item) => arr.concat(item.split(";")), [])[rowIndex];
552
+ }
553
+
542
554
  return this.$getFieldRuleResult(col, row);
543
555
  } else {
544
556
  return {