解决计量单位页面校验错误的bug

This commit is contained in:
季圣华
2023-03-17 19:08:41 +08:00
parent e37b2e440d
commit 6153c49765
2 changed files with 3 additions and 3 deletions

View File

@@ -35,7 +35,7 @@ export function isURL (s) {
* @param {*} s * @param {*} s
*/ */
export function isDecimalTwo (s) { export function isDecimalTwo (s) {
let reg = /^(([^0][0-9]+|0)\.([0-9]{1,2})$)|^([^0][0-9]+|0)$/ let reg = /^[0-9]+(\.[0-9]{1,2})?$/
return reg.test(s) return reg.test(s)
} }
@@ -44,7 +44,7 @@ export function isDecimalTwo (s) {
* @param {*} s * @param {*} s
*/ */
export function isDecimalThree (s) { export function isDecimalThree (s) {
let reg = /^(([^0][0-9]+|0)\.([0-9]{1,3})$)|^([^0][0-9]+|0)$/ let reg = /^[0-9]+(\.[0-9]{1,3})?$/
return reg.test(s) return reg.test(s)
} }

View File

@@ -13,7 +13,7 @@
@ok="handleOk" @ok="handleOk"
@cancel="handleCancel" @cancel="handleCancel"
cancelText="关闭" cancelText="关闭"
style="top:100px; height:50%;"> style="top:100px; height:55%;">
<template slot="footer"> <template slot="footer">
<a-button key="back" v-if="isReadOnly" @click="handleCancel"> <a-button key="back" v-if="isReadOnly" @click="handleCancel">
关闭 关闭