mooho-base-admin-plus 2.8.3 → 2.8.5

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.5",
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) {
@@ -1628,14 +1631,34 @@
1628
1631
  }
1629
1632
  }
1630
1633
 
1631
- if (isRequired) {
1632
- let value = this.parseData(row, column.code);
1634
+ let name = column.name.replaceAll(' <font color="red">*</font>', '');
1633
1635
 
1636
+ if (isRequired) {
1634
1637
  if (value == null || !(String(value) || '').trim()) {
1635
- this.error('Front_Msg_Row_Column_Required|' + (i + 1) + '|' + column.name);
1638
+ this.error('Front_Msg_Row_Column_Required|' + (i + 1) + '|' + name);
1636
1639
  return false;
1637
1640
  }
1638
1641
  }
1642
+
1643
+ // if (column.maxLength != null && value != null && String(value).length > column.maxLength) {
1644
+ // this.error('Front_Msg_Row_Validation_Max_Length|' + (i + 1) + '|' + column.name + '|' + column.maxLength.toString());
1645
+ // return false;
1646
+ // }
1647
+
1648
+ if (column.maxValue != null && !isNaN(value) && value > column.maxValue) {
1649
+ this.error('Front_Msg_Row_Validation_Max_Value|' + (i + 1) + '|' + name + '|' + column.maxValue.toString());
1650
+ return false;
1651
+ }
1652
+
1653
+ if (column.minValue != null && !isNaN(value) && value < column.minValue) {
1654
+ this.error('Front_Msg_Row_Validation_Min_Value|' + (i + 1) + '|' + name + '|' + column.minValue.toString());
1655
+ return false;
1656
+ }
1657
+
1658
+ if (!!(column.pattern || '').trim() && value != null && new RegExp(column.pattern).test(value) == false) {
1659
+ this.error('Front_Msg_Row_Validation_Pattern|' + (i + 1) + '|' + name + '|' + column.pattern);
1660
+ return false;
1661
+ }
1639
1662
  }
1640
1663
  }
1641
1664