king
2023-08-10 ac1d52c46ff9019fcc93cf3d5e7ab17cf850824e
src/utils/utils.js
@@ -983,7 +983,7 @@
          val = val.replace(/'/ig, '"')
        }
        val = val.replace(/(^\s*$)|\t*|\v*/ig, '')
        val = val.replace(/(^\s+$)|\t+|\v+/ig, '')
        if (!val && col.required === 'true') {            // 必填校验
          errors.push(_position + '内容不可为空')
@@ -1018,7 +1018,7 @@
            val = moment('19000101', 'YYYYMMDD').add(Math.floor(val - 2), 'days').format('YYYY-MM-DD')
          }
        } else if (typeof(val) === 'string') {
          val = val.replace(/(^\s*$)|\t*|\v*/ig, '')
          val = val.replace(/(^\s+$)|\t+|\v+/ig, '')
          if (!val && col.required === 'true') {           // 时间必填校验
            errors.push(_position + '内容不可为空')
          } else if (val && !/^[1-9][0-9]{3}/.test(val)) { // 时间正则校验