leisure-core 1.0.7 → 1.0.9

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.
@@ -696,6 +696,8 @@ export default {
696
696
  cancelButtonText: "取消",
697
697
  type: "warning",
698
698
  }).then(() => {
699
+ const userId = this.$store?.getters?.userinfo?.id ?? "";
700
+ this.$emit("signout", userId);
699
701
  this.$router.push({ path: "/" });
700
702
  localStorage.clear();
701
703
  });
@@ -362,7 +362,9 @@ export default {
362
362
  if (this.allowNegative) {
363
363
  // 更严格的金额正则:不允许单独的负号、小数点、负号+小数点
364
364
  if (this.allowDecimal) {
365
- amountPattern = /^-?(?:[1-9]\d*|0)(?:\.\d{0,2})?$|^-?0\.\d{0,2}$/;
365
+ amountPattern = new RegExp(
366
+ `^-?(?:[1-9]\\d*|0)(?:\\.\\d{0,${this.decimalLimit}})?$|^-?0\\.\\d{0,${this.decimalLimit}}$`
367
+ );
366
368
  } else {
367
369
  amountPattern = /^-?(?:[1-9]\d*|0)$/;
368
370
  }
@@ -386,7 +388,9 @@ export default {
386
388
  }
387
389
  } else {
388
390
  amountPattern = this.allowDecimal
389
- ? /^(?:[1-9]\d*|0)(?:\.\d{0,2})?$|^0\.\d{0,2}$/
391
+ ? new RegExp(
392
+ `^(?:[1-9]\\d*|0)(?:\\.\\d{0,${this.decimalLimit}})?$|^0\\.\\d{0,${this.decimalLimit}}$`
393
+ )
390
394
  : /^(?:[1-9]\d*|0)$/;
391
395
  if (!amountPattern.test(cleanValue)) {
392
396
  isValid = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leisure-core",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "leisure-core是京心数据基于vue2.x开发的一套后台管理系统桌面端组件库,封装了大量实用的UI控件模板,非常方便开发者快速搭建前端应用",
5
5
  "private": false,
6
6
  "author": "北方乐逍遥(zcx7878)",