king
2020-07-17 e70553694d5ab6869a85a0db60bc14942a06bc15
2020-07-17
9个文件已修改
188 ■■■■■ 已修改文件
src/locales/en-US/main.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/zh-CN/main.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/components/login/mob-login-2/index.jsx 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/components/login/mob-login-2/index.scss 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/mobshell/index.scss 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/options.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/columncomponent/index.scss 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 106 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/locales/en-US/main.js
@@ -45,6 +45,8 @@
  'main.excel.content.floaterror': '内容应为浮点数',
  'main.excel.content.floatIntover': '整数位超出范围',
  'main.excel.content.floatPointover': '小数位超出范围',
  'main.excel.content.date.over': '时间为负值或太大',
  'main.excel.content.date.formatError': '时间格式错误',
  'main.excel.content.maxlimit': '内容超长',
  'main.excel.content.limitmin': '小于最小值',
  'main.excel.content.limitmax': '大于最大值',
src/locales/zh-CN/main.js
@@ -46,6 +46,8 @@
  'main.excel.content.floaterror': '内容应为浮点数',
  'main.excel.content.floatIntover': '整数位超出范围',
  'main.excel.content.floatPointover': '小数位超出范围',
  'main.excel.content.date.over': '时间为负值或太大',
  'main.excel.content.date.formatError': '时间格式错误',
  'main.excel.content.maxlimit': '内容超长',
  'main.excel.content.limitmin': '小于最小值',
  'main.excel.content.limitmax': '大于最大值',
src/mob/components/login/mob-login-2/index.jsx
@@ -30,9 +30,10 @@
      user: { uuid: Utils.getuuid(), eleType: 'input', content: '邮箱/手机', style: {}},
      password: { uuid: Utils.getuuid(), eleType: 'input', content: '密码', style: {}},
      login: { uuid: Utils.getuuid(), eleType: 'button', content: '登录', style: {fontSize: '16px', color: '#ffffff', textAlign: 'center', lineHeight: 2.4, backgroundColor: '#44a8f2'}},
      phone: { uuid: Utils.getuuid(), eleType: 'button', content: '手机短信登录/注册', style: {fontSize: '16px', color: '#44a8f2', textAlign: 'center', lineHeight: 2.4, border: '1px solid #44a8f2'}},
      phone: { uuid: Utils.getuuid(), eleType: 'button', content: '手机短信登录', style: {fontSize: '16px', color: '#44a8f2', textAlign: 'center', lineHeight: 2.4, border: '1px solid #44a8f2'}},
      register: { uuid: Utils.getuuid(), eleType: 'text', content: '注册', style: {fontSize: '12px', color: '#44a8f2', textAlign: 'left'}},
      lose: { uuid: Utils.getuuid(), eleType: 'text', content: '忘记密码?', style: {fontSize: '12px', color: '#44a8f2', textAlign: 'right', textDecoration: 'underline'}},
      register: { uuid: Utils.getuuid(), eleType: 'text', subItems: [
      auth: { uuid: Utils.getuuid(), eleType: 'text', subItems: [
        {type: 'qq', icon: 'qq', label: 'QQ'},
        {type: 'wechat', icon: 'wechat', label: '微信'},
      ], content: '其他登录方式', style: {fontSize: '14px', color: '#bcbcbc', textAlign: 'center', marginTop: '30px', marginBottom: '20px'}},
@@ -136,6 +137,18 @@
      ...fromJS(card.register.style).toJS(),
      componentId: card.uuid,
      uuid: card.register.uuid,
      items: ['font'],
    }
    this.props.triggerEdit(element)
  }
  editAuth = (e) => {
    const { card } = this.props
    e.stopPropagation()
    let element = {
      ...fromJS(card.auth.style).toJS(),
      componentId: card.uuid,
      uuid: card.auth.uuid,
      items: ['font', 'margin'],
    }
    this.props.triggerEdit(element)
@@ -239,16 +252,23 @@
            <ContentUpdate element={card.phone} updateContent={(ele) => this.updateContent({...card, phone: ele})}/>
            {card.phone.content}
          </Button>
          {card.lose ? <div className={'plat-name ' + (editId === card.lose.uuid ? 'editing' : '')} style={card.lose.style} onClick={this.editLose}>
            <ContentUpdate element={card.lose} updateContent={(ele) => this.updateContent({...card, lose: ele})}/>
            {card.lose.content}
          <div className="row-box">
            {card.register ? <div className={'col-item ' + (editId === card.register.uuid ? 'editing' : '')} style={card.register.style} onClick={this.editRegister}>
              <ContentUpdate element={card.register} updateContent={(ele) => this.updateContent({...card, register: ele})}/>
              {card.register.content}
            </div> : null}
            {card.lose ? <div className={'col-item right ' + (editId === card.lose.uuid ? 'editing' : '')} style={card.lose.style} onClick={this.editLose}>
              <ContentUpdate element={card.lose} updateContent={(ele) => this.updateContent({...card, lose: ele})}/>
              {card.lose.content}
            </div> : null}
            <div style={{clear: 'both'}}></div>
          </div>
          {card.auth ? <div className={'plat-name ' + (editId === card.auth.uuid ? 'editing' : '')} style={card.auth.style} onClick={this.editAuth}>
            <ContentUpdate element={card.auth} updateContent={(ele) => this.updateContent({...card, auth: ele})}/>
            {card.auth.content}
          </div> : null}
          {card.register ? <div className={'plat-name ' + (editId === card.register.uuid ? 'editing' : '')} style={card.register.style} onClick={this.editRegister}>
            <ContentUpdate element={card.register} updateContent={(ele) => this.updateContent({...card, register: ele})}/>
            {card.register.content}
          </div> : null}
          {card.register ? <div className="other-register">
            {card.register.subItems.map(cell => (
          {card.auth ? <div className="other-auth">
            {card.auth.subItems.map(cell => (
              <span key={cell.type}>
                <Icon type={cell.icon} />
                <p>{cell.label}</p>
src/mob/components/login/mob-login-2/index.scss
@@ -32,7 +32,31 @@
  .plat-name:not(.editing):hover {
    border-color: #535353;
  }
  .other-register {
  .row-box {
    position: relative;
    width: 280px;
    margin: 0 auto;
    line-height: 1.5;
    .col-item {
      position: relative;
      display: inline-block;
      width: 50%;
      border: 1px dotted transparent;
    }
    .col-item.right {
      float: right;
    }
    .col-item.editing {
      border: 1px solid #1890ff;
      box-shadow: 0px 0px 2px #1890ff;
    }
    .col-item:not(.editing):hover {
      border-color: #535353;
    }
  }
  .other-auth {
    text-align: center;
    font-size: 26px;
    color: rgb(68, 168, 242);
src/mob/mobshell/index.scss
@@ -19,6 +19,6 @@
    }
  }
  >.ant-empty {
    padding-top: 40px;
    padding-top: 150px;
  }
}
src/store/options.js
@@ -3,5 +3,5 @@
  sysType: 'bG9j$mkYWw=', // yun ( Y2xv$mkdWQ= ) 、 dandian ( U1$mkNP ) 、 yewu ( bG9j$mkYWw= )
  caId: 'MjAyMDAxMTYxMjMzMzU1MDd$mkGQzkyMzI1Rjk4MDY0QUNGQjQ2Mg==',
  cakey: 'MjAyMDAxMTYxMjQwMDQ2NDM$mk2N0QzODE2MjExNUI0MTc4OTVDMQ==',
  cdomain: 'aHR0cDovL2Nsb3V$mkkLm1rOWguY24=' // window.btoa('')
  cdomain: 'aHR0cDovL2Nsb3V$mkkLm1rOWguY24=' // window.btoa('') 域名 不带 /
}
src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx
@@ -89,7 +89,7 @@
        })
        notification.warning({
          top: 92,
          message: '文件解析错误,请检查文件格式!',
          message: '文件解析错误!',
          duration: 5
        })
        // 错误传递
src/templates/sharecomponent/columncomponent/index.scss
@@ -27,6 +27,8 @@
    border: 1px solid #e8e8e8;
    .column-box {
      display: flex;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .column-box:not(:first-child) {
      border-top: 1px solid #e8e8e8;
@@ -41,7 +43,7 @@
        height: 100%;
        .ant-table-column-sorters {
          padding: 0px 8px 12px;
          white-space: nowrap;
          // white-space: nowrap;
        }
        .ant-table-column-fields {
          padding: 0px 8px 5px;
src/utils/utils.js
@@ -766,92 +766,73 @@
          val = val.replace(/(^\s*$)|\t*|\v*/ig, '')
          if (!val && col.required === 'true') { // 必填校验
            let _error =  _position + dict['main.excel.content.emptyerror']
            errors.push(_error)
            errors.push(_position + dict['main.excel.content.emptyerror'])
          } else if (val.length > col.limit) {    // 长度校验
            let _error =  _position + dict['main.excel.content.maxlimit']
            errors.push(_error)
            errors.push(_position + dict['main.excel.content.maxlimit'])
          } else {                               // 关键字校验
            keys.forEach(key => {
              let _patten = new RegExp('(^' + key + '\\s+)|(\\s+' + key + '\\s+)', 'ig')
              if (_patten.test(val)) {
                let _error = _position + dict['main.excel.includekey'] + key
                errors.push(_error)
                errors.push(_position + dict['main.excel.includekey'] + key)
              }
            })
          }
        } else if (/^int/ig.test(col.type)) {
          if (!val && val !== 0) {
            let _error =  _position + dict['main.excel.content.emptyerror']
            errors.push(_error)
            errors.push(_position + dict['main.excel.content.emptyerror'])
          } else {
            let _val = val + ''
            if (!/^(([^0][0-9]+|0)$)|^(([1-9]+)$)/.test(_val)) {               // 检验是否为整数
              let _error = _position + dict['main.excel.content.interror']
              errors.push(_error)
              errors.push(_position + dict['main.excel.content.interror'])
            } else if ((col.min || col.min === 0) && val < col.min) {          // 最小值检验
              let _error = _position + dict['main.excel.content.limitmin']
              errors.push(_error)
              errors.push(_position + dict['main.excel.content.limitmin'])
            } else if ((col.max || col.max === 0) && val > col.max) {          // 最大值检验
              let _error = _position + dict['main.excel.content.limitmax']
              errors.push(_error)
              errors.push(_position + dict['main.excel.content.limitmax'])
            }
          }
        } else if (/^Decimal/ig.test(col.type)) {
          if (!val && val !== 0) {
            let _error =  _position + dict['main.excel.content.emptyerror']
            errors.push(_error)
            errors.push(_position + dict['main.excel.content.emptyerror'])
          } else {
            let _val = val + ''
            let _vals = _val.split('.')
            if (!/^(([^0][0-9]+|0)\.([0-9]+)$)|^(([^0][0-9]+|0)$)|^(([1-9]+)\.([0-9]+)$)|^(([1-9]+)$)/.test(_val)) {                           // 检验是否为浮点数
              let _error = _position + dict['main.excel.content.floaterror']
              errors.push(_error)
            } else if (_vals[0].length > 18) {                         // 检验整数位
              let _error = _position + dict['main.excel.content.floatIntover']
              errors.push(_error)
              errors.push(_position + dict['main.excel.content.floaterror'])
            } else if (_vals[0].length > 18) {                          // 检验整数位
              errors.push(_position + dict['main.excel.content.floatIntover'])
            } else if (_vals[1] && _vals[1].length > col.limit) {       // 最小值检验
              let _error = _position + dict['main.excel.content.floatPointover']
              errors.push(_error)
            } else if ((col.min || col.min === 0) && val < col.min) { // 最小值检验
              let _error = _position + dict['main.excel.content.limitmin']
              errors.push(_error)
            } else if ((col.max || col.max === 0) && val > col.max) { // 最大值检验
              let _error = _position + dict['main.excel.content.limitmax']
              errors.push(_error)
              errors.push(_position + dict['main.excel.content.floatPointover'])
            } else if ((col.min || col.min === 0) && val < col.min) {   // 最小值检验
              errors.push(_position + dict['main.excel.content.limitmin'])
            } else if ((col.max || col.max === 0) && val > col.max) {   // 最大值检验
              errors.push(_position + dict['main.excel.content.limitmax'])
            }
          }
        } else if (col.type === 'date') {
          val = val.replace(/(^\s*$)|\t*|\v*/ig, '')
          if (!val && col.required === 'true') { // 必填校验
            let _error =  _position + dict['main.excel.content.emptyerror']
            errors.push(_error)
          } else {                               // 关键字校验
            keys.forEach(key => {
              let _patten = new RegExp('(^' + key + '\\s+)|(\\s+' + key + '\\s+)', 'ig')
              if (_patten.test(val)) {
                let _error = _position + dict['main.excel.includekey'] + key
                errors.push(_error)
              }
            })
          if (typeof(val) === 'number') {
            if (val > 2958465 || val <= 0) {                 // 时间过大或小于等于0
              errors.push(_position + dict['main.excel.content.date.over'])
            } else {                                         // 时间格式化
              val = this.formatExcelDate(val)
            }
          } else if (typeof(val) === 'string') {
            val = val.replace(/(^\s*$)|\t*|\v*/ig, '')
            if (!val && col.required === 'true') {           // 时间必填校验
              errors.push(_position + dict['main.excel.content.emptyerror'])
            } else if (val && !/^[1-9][0-9]{3}/.test(val)) { // 时间正则校验
              errors.push(_position + dict['main.excel.content.date.formatError'])
            }
          } else {                                           // 时间格式错误
            errors.push(_position + dict['main.excel.content.date.formatError'])
          }
        }
        if (col.type === 'date') {
          vals.push(`case when '${val}'='' then '1900-01-01' else dateadd(day,cast('${val}' as int)-2,'1900-01-01') end`)
        } else {
          vals.push(`'${val}'`)
        }
        vals.push(`'${val}'`)
        if (lindex < 40) {
          if (col.type === 'date') {
            convals.push(`case when '${val}'='' then '1900-01-01' else dateadd(day,cast('${val}' as int)-2,'1900-01-01') end as ${col.Column}`)
          } else {
            convals.push(`'${val}' as ${col.Column}`)
          }
          convals.push(`'${val}' as ${col.Column}`)
        }
      })
@@ -997,6 +978,20 @@
      bottom: _sqlBottom,
      errors: errors.join('; ')
    }
  }
  /**
   * @description 格式化excel中的date值
   * @param {Number} number 时间值
   */
  static formatExcelDate(number) {
    const time = new Date((number - 1) * 24 * 3600000 + 1)
    time.setYear(time.getFullYear() - 70)
    const year = time.getFullYear()
    const month = time.getMonth() + 1
    const date = time.getDate() - 1
    return `${year}-${(month < 10 ? '0' + month : month)}-${(date < 10 ? '0' + date : date)}`
  }
  /**
@@ -1167,7 +1162,9 @@
    // 变量赋值
    _initfields = _initfields.join(',')
    if (_initfields) {
      _sql += `select ${_initfields}
      _sql += `
        select ${_initfields}
        `
    }
@@ -1568,7 +1565,8 @@
      _sql += `
        /* 默认sql */
        insert into snote (remark,createuserid,CreateUser,CreateStaff) select left('删除表:${btn.sql} 数据: ${_msg}${primaryKey}='+@ID@,200),@userid@,@username,@fullname delete ${btn.sql} where ${primaryKey}${_ID};`
        insert into snote (remark,createuserid,CreateUser,CreateStaff) select left('删除表:${btn.sql} 数据: ${_msg}${primaryKey}='+@ID@,200),@userid@,@username,@fullname
        delete ${btn.sql} where ${primaryKey}${_ID};`
    } else if (_actionType === 'insertOrUpdate') {
      _sql += `
        /* 默认sql */