From 3683e1475e8d74f690172a468518d88d91a69ccc Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 20 八月 2020 20:15:48 +0800 Subject: [PATCH] 2020-08-20 --- src/utils/utils.js | 14 ++++++-------- 1 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/utils/utils.js b/src/utils/utils.js index 7808f1e..19cc904 100644 --- a/src/utils/utils.js +++ b/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} @@ -1582,8 +1581,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) } -- Gitblit v1.8.0