king
2020-08-31 b3547d1c531e479021219fda5df153a11b9b52a3
src/utils/utils.js
@@ -689,7 +689,7 @@
    arrfield = arrfield.join(',')
    if (item.orderBy) {
      sql = 'select distinct ' + arrfield + ',' + item.orderBy + ' as orderfield from ' + _datasource + ' order by orderfield ' + item.orderType
      sql = `select ${arrfield} from (select distinct ${arrfield},${item.orderBy} as orderfield from ${_datasource} ) a order by orderfield ${item.orderType}`
    } else {
      sql = 'select distinct ' + arrfield + ' from ' + _datasource
    }
@@ -765,11 +765,11 @@
          val = val.replace(/(^\s*$)|\t*|\v*/ig, '')
          if (!val && col.required === 'true') { // 必填校验
          if (!val && col.required === 'true') {            // 必填校验
            errors.push(_position + dict['main.excel.content.emptyerror'])
          } else if (val.length > col.limit) {    // 长度校验
          } else if (col.limit && val.length > col.limit) { // 长度校验
            errors.push(_position + dict['main.excel.content.maxlimit'])
          } else {                               // 关键字校验
          } else {                                          // 关键字校验
            keys.forEach(key => {
              let _patten = new RegExp('(^' + key + '\\s+)|(\\s+' + key + '\\s+)', 'ig')
              if (_patten.test(val)) {
@@ -948,8 +948,7 @@
        
        aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg`
      // if (window.GLOB.systemType !== 'production' && options.sysType !== 'cloud') {
      if (window.GLOB.systemType !== 'production') {
      if ((window.GLOB.systemType !== 'production' && options.sysType !== 'cloud') || window.debugger === true) {
        let fsql = `
        ${_sql}
        ${_sqlInsert}
@@ -1430,6 +1429,8 @@
      let values = []
      formdata.forEach(item => {
        if (item.writein === false) return
        keys.push(item.key.toLowerCase())
        values.push('@' + item.key)
      })
@@ -1473,6 +1474,8 @@
      let _arr = []
      formdata.forEach(item => {
        if (item.writein === false) return
        _arr.push(item.key.toLowerCase())
        _form.push(item.key + '=@' + item.key)
      })
@@ -1582,8 +1585,7 @@
    _sql += `
        aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg`
    // if (window.GLOB.systemType !== 'production' && options.sysType !== 'cloud') {
    if (window.GLOB.systemType !== 'production') {
    if ((window.GLOB.systemType !== 'production' && options.sysType !== 'cloud') || window.debugger === true) {
      _sql = _sql.replace(/\n\s{8}/ig, '\n')
      console.log(_sql)
    }