king
2023-08-10 ac1d52c46ff9019fcc93cf3d5e7ab17cf850824e
2023-08-10
13个文件已修改
169 ■■■■■ 已修改文件
src/components/header/loginform.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/markcomponent/index.jsx 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/markcomponent/markform/index.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-bar-line/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/printbutton/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/mutilform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/searchcomponent/searchform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/editTable/index.jsx 87 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/modalform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login/logincloudform.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/login/loginform.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/loginform.jsx
@@ -59,8 +59,8 @@
            values.password = oripassword
          }
          
          values.username = values.username.replace(/\t*|\v*|\s*/g, '')
          values.password = values.password.replace(/\t*|\v*|\s*/g, '')
          values.username = values.username.replace(/\t+|\v+|\s+/g, '')
          values.password = values.password.replace(/\t+|\v+|\s+/g, '')
          resolve(values)
        } else {
src/menu/components/share/markcomponent/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { fromJS } from 'immutable'
import { Modal, Col } from 'antd'
import { Modal, Col, notification } from 'antd'
import { AntDesignOutlined } from '@ant-design/icons'
import Utils from '@/utils/utils.js'
@@ -32,6 +32,20 @@
        dataIndex: 'field',
        width: '16%',
        editable: true,
        unique: true,
        uniqueFunc: (data, item) => {
          let index = data.findIndex(mark => mark.uuid !== item.uuid && mark.contrastValue === item.contrastValue && mark.match === item.match && mark.field.join('') === item.field.join(''))
          if (index > -1) {
            notification.warning({
              top: 92,
              message: '此标记已存在!',
              duration: 5
            })
            return false
          }
          return true
        },
        inputType: 'cascader',
        options: [],
        rules: [{
@@ -118,18 +132,24 @@
  markChange = (values) => {
    let _marks = fromJS(this.state.marks).toJS()
    if (values.uuid) {
      _marks = _marks.map(item => {
        if (item.uuid === values.uuid) {
          return values
        } else {
          return item
        }
    let has = false
    _marks.forEach(mark => {
      if (mark.contrastValue === values.contrastValue && mark.match === values.match && mark.field.join('') === values.field.join('')) {
        has = true
      }
    })
    if (has) {
      notification.warning({
        top: 92,
        message: '此标记已存在!',
        duration: 5
      })
    } else {
      values.uuid = Utils.getuuid()
      _marks.push(values)
      return
    }
    values.uuid = Utils.getuuid()
    _marks.push(values)
    this.setState({
      marks: _marks
@@ -319,6 +339,11 @@
          item.fontColor = ''
        }
      }
      if (item.contrastValue) {
        item.contrastValue = item.contrastValue.replace(/\t+|\v+|\s+/g, '')
      }
      if (val && item.contrastValue === val) {
        save = true
      }
src/menu/components/share/markcomponent/markform/index.jsx
@@ -18,6 +18,9 @@
    // 表单提交时检查输入值是否正确
    this.props.form.validateFieldsAndScroll((err, values) => {
      if (!err) {
        if (values.contrastValue) {
          values.contrastValue = values.contrastValue.replace(/\t+|\v+|\s+/g, '')
        }
        this.props.markChange(values)
      }
    })
src/tabviews/custom/components/chart/antv-bar-line/index.jsx
@@ -207,7 +207,7 @@
    let xc = {label: {
      formatter: (val) => {
        if (!val || /^\s*$/.test(val)) return val
        if (!val || /^\s+$/.test(val)) return val
        let _val = `${val}`
        if (_val.length <= limit) return val
        return _val.substring(0, limit) + '...'
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -2866,7 +2866,7 @@
        _item.fieldlen = item.decimal || 0
      } else if (['text', 'textarea', 'linkMain'].includes(_item.type)) {
        _item.value = _item.value + ''
        _item.value = _item.value.replace(/\t*|\v*/g, '')       // 去除制表符
        _item.value = _item.value.replace(/\t+|\v+/g, '')       // 去除制表符
        if (item.interception !== 'false') {                    // 去除首尾空格
          _item.value = _item.value.replace(/(^\s*|\s*$)/g, '')
src/tabviews/zshare/actionList/printbutton/index.jsx
@@ -2167,7 +2167,7 @@
        _item.fieldlen = item.decimal || 0
      } else if (['text', 'textarea', 'linkMain'].includes(_item.type)) {
        _item.value = _item.value + ''
        _item.value = _item.value.replace(/\t*|\v*/g, '')       // 去除制表符
        _item.value = _item.value.replace(/\t+|\v+/g, '')       // 去除制表符
        if (item.interception !== 'false') {                    // 去除首尾空格
          _item.value = _item.value.replace(/(^\s*|\s*$)/g, '')
src/tabviews/zshare/mutilform/index.jsx
@@ -1151,7 +1151,7 @@
            _item.fieldlen = item.decimal || 0
          } else if (['text', 'textarea', 'linkMain'].includes(item.type)) {
            _item.value = _item.value + ''
            _item.value = _item.value.replace(/\t*|\v*/g, '')       // 去除制表符
            _item.value = _item.value.replace(/\t+|\v+/g, '')       // 去除制表符
    
            if (item.interception !== 'false') {                    // 去除首尾空格
              _item.value = _item.value.replace(/(^\s*|\s*$)/g, '')
src/templates/sharecomponent/searchcomponent/searchform/index.jsx
@@ -756,7 +756,7 @@
          ['linkField', 'valueField', 'valueText', 'orderBy'].forEach(item => {
            if (values[item]) {
              values[item] = values[item].replace(/\s* | \t* | \v* | \r*/ig, '')
              values[item] = values[item].replace(/\s+|\t+|\v+|\r+/ig, '')
            }
          })
src/templates/zshare/editTable/index.jsx
@@ -416,7 +416,9 @@
      columns.forEach(col => {
        if (col.unique !== true || !unique) return
        if (col.strict) {
        if (col.uniqueFunc) {
          unique = col.uniqueFunc(data, res.data)
        } else if (col.strict) {
          let key = res.data[col.dataIndex].toLowerCase()
          let _index = data.findIndex(item => key === item[col.dataIndex].toLowerCase())
@@ -455,7 +457,9 @@
        columns.forEach(col => {
          if (col.unique !== true || !unique) return
          if (col.strict) {
          if (col.uniqueFunc) {
            unique = col.uniqueFunc(data, cell)
          } else if (col.strict) {
            let _index = data.findIndex(item => cell[col.dataIndex].toLowerCase() === item[col.dataIndex].toLowerCase())
  
            if (_index > -1) {
@@ -518,15 +522,32 @@
    columns.forEach(col => {
      if (col.unique !== true || !unique) return
      let _index = newData.findIndex(item => record.uuid !== item.uuid && record[col.dataIndex] === item[col.dataIndex])
      if (col.uniqueFunc) {
        unique = col.uniqueFunc(newData, record)
        return
      } else if (col.strict) {
        let key = record[col.dataIndex].toLowerCase()
        let _index = newData.findIndex(item => key === item[col.dataIndex].toLowerCase())
      if (_index > -1) {
        notification.warning({
          top: 92,
          message: col.title + '不可重复!',
          duration: 5
        })
        unique = false
        if (_index > -1) {
          notification.warning({
            top: 92,
            message: col.title + '不可重复!',
            duration: 5
          })
          unique = false
        }
      } else {
        let _index = newData.findIndex(item => record.uuid !== item.uuid && record[col.dataIndex] === item[col.dataIndex])
        if (_index > -1) {
          notification.warning({
            top: 92,
            message: col.title + '不可重复!',
            duration: 5
          })
          unique = false
        }
      }
    })
@@ -557,31 +578,49 @@
      }
      const newData = [...this.state.data]
      const index = newData.findIndex(item => uuid === item.uuid)
      if (index > -1) {
        row = {...newData[index], ...row}
      } else {
        row.uuid = uuid
      }
      let unique = true
      columns.forEach(col => {
        if (col.unique !== true || !unique) return
        let _index = newData.findIndex(item => uuid !== item.uuid && row[col.dataIndex] === item[col.dataIndex])
        if (_index > -1) {
          notification.warning({
            top: 92,
            message: col.title + '不可重复!',
            duration: 5
          })
          unique = false
        if (col.uniqueFunc) {
          unique = col.uniqueFunc(newData, row)
          return
        } else if (col.strict) {
          let key = row[col.dataIndex].toLowerCase()
          let _index = newData.findIndex(item => key === item[col.dataIndex].toLowerCase())
          if (_index > -1) {
            notification.warning({
              top: 92,
              message: col.title + '不可重复!',
              duration: 5
            })
            unique = false
          }
        } else {
          let _index = newData.findIndex(item => row.uuid !== item.uuid && row[col.dataIndex] === item[col.dataIndex])
          if (_index > -1) {
            notification.warning({
              top: 92,
              message: col.title + '不可重复!',
              duration: 5
            })
            unique = false
          }
        }
      })
      if (!unique) return
      if (index > -1) {
        const item = newData[index]
        newData.splice(index, 1, {
          ...item,
          ...row,
        })
        newData.splice(index, 1, row)
        this.setState({ data: newData, editingKey: '' }, () => {
          this.props.onChange(newData)
        })
src/templates/zshare/modalform/index.jsx
@@ -986,7 +986,7 @@
          ['linkField', 'valueField', 'valueText', 'orderBy'].forEach(item => {
            if (values[item]) {
              values[item] = values[item].replace(/\s*|\t*|\v*|\r*/ig, '')
              values[item] = values[item].replace(/\s+|\t+|\v+|\r+/ig, '')
            }
          })
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)) { // 时间正则校验
src/views/login/logincloudform.jsx
@@ -20,8 +20,8 @@
    return new Promise((resolve, reject) => {
      this.props.form.validateFieldsAndScroll((err, values) => {
        if (!err) {
          values.cloudusername = values.cloudusername.replace(/\t*|\v*|\s*/g, '')
          values.cloudpassword = values.cloudpassword.replace(/\t*|\v*|\s*/g, '')
          values.cloudusername = values.cloudusername.replace(/\t+|\v+|\s+/g, '')
          values.cloudpassword = values.cloudpassword.replace(/\t+|\v+|\s+/g, '')
          resolve(values)
        } else {
          reject(err)
src/views/login/loginform.jsx
@@ -161,11 +161,11 @@
      this.props.form.validateFieldsAndScroll((err, values) => {
        if (!err) {
          if (activeKey === 'uname_pwd') {
            values.username = values.username.replace(/\t*|\v*|\s*/g, '')
            values.password = values.password.replace(/\t*|\v*|\s*/g, '')
            values.username = values.username.replace(/\t+|\v+|\s+/g, '')
            values.password = values.password.replace(/\t+|\v+|\s+/g, '')
          } else if (activeKey === 'sms_vcode') {
            values.phone = values.phone.replace(/\t*|\v*|\s*/g, '')
            values.vercode = values.vercode.replace(/\t*|\v*|\s*/g, '')
            values.phone = values.phone.replace(/\t+|\v+|\s+/g, '')
            values.vercode = values.vercode.replace(/\t+|\v+|\s+/g, '')
          }
          resolve({type: activeKey, ...values})
        } else {