mooho-base-admin-plus 2.8.3 → 2.8.4

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,7 +1,7 @@
1
1
  {
2
2
  "name": "mooho-base-admin-plus",
3
3
  "description": "MOOHO basic framework for admin by Vue3",
4
- "version": "2.8.3",
4
+ "version": "2.8.4",
5
5
  "author": "jinyifan <jinyifan@mooho.com.cn>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -183,6 +183,8 @@
183
183
  :clearable="!isReadonly(rowData(row, index), column)"
184
184
  :style="{ width: column.controlWidth == null ? null : column.controlWidth - 8 + 'px' }"
185
185
  :placeholder="column.description"
186
+ :max="column.maxValue"
187
+ :min="column.minValue"
186
188
  @on-change="onDataChange(rowData(row, index), column)"
187
189
  @on-blur="onBlur(rowData(row, index), column)"
188
190
  />
@@ -1609,6 +1611,7 @@
1609
1611
 
1610
1612
  for (let j = 0; j < this.columns.length; j++) {
1611
1613
  let column = this.columns[j];
1614
+ let value = this.parseData(row, column.code);
1612
1615
 
1613
1616
  // 不显示的不验证
1614
1617
  if (row._isShow && row._isShow[column.code] == false) {
@@ -1629,13 +1632,31 @@
1629
1632
  }
1630
1633
 
1631
1634
  if (isRequired) {
1632
- let value = this.parseData(row, column.code);
1633
-
1634
1635
  if (value == null || !(String(value) || '').trim()) {
1635
1636
  this.error('Front_Msg_Row_Column_Required|' + (i + 1) + '|' + column.name);
1636
1637
  return false;
1637
1638
  }
1638
1639
  }
1640
+
1641
+ // if (column.maxLength != null && value != null && String(value).length > column.maxLength) {
1642
+ // this.error('Front_Msg_Row_Validation_Max_Length|' + (i + 1) + '|' + column.name + '|' + column.maxLength.toString());
1643
+ // return false;
1644
+ // }
1645
+
1646
+ if (column.maxValue != null && !isNaN(value) && value > column.maxValue) {
1647
+ this.error('Front_Msg_Row_Validation_Max_Value|' + (i + 1) + '|' + column.name + '|' + column.maxValue.toString());
1648
+ return false;
1649
+ }
1650
+
1651
+ if (column.minValue != null && !isNaN(value) && value < column.minValue) {
1652
+ this.error('Front_Msg_Row_Validation_Min_Value|' + (i + 1) + '|' + column.name + '|' + column.minValue.toString());
1653
+ return false;
1654
+ }
1655
+
1656
+ if (!!(column.pattern || '').trim() && value != null && new RegExp(column.pattern).test(value) == false) {
1657
+ this.error('Front_Msg_Row_Validation_Pattern|' + (i + 1) + '|' + column.name + '|' + column.pattern);
1658
+ return false;
1659
+ }
1639
1660
  }
1640
1661
  }
1641
1662