From 876a5e6657d67df66bb525d02dd6d147ba81cae5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 05 一月 2023 09:53:37 +0800 Subject: [PATCH] 2023-01-05 --- src/utils/utils.js | 46 +++++++++++++++++++++++++++++++--------------- 1 files changed, 31 insertions(+), 15 deletions(-) diff --git a/src/utils/utils.js b/src/utils/utils.js index a829fa6..8616197 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -59,6 +59,25 @@ } /** + * @description 鑾峰彇鍥捐〃楂樺害 + */ + static getHeight (val) { + if (typeof(val) === 'string') { + if (val.indexOf('px') > -1) { + val = parseFloat(val) + } else if (val.indexOf('vw') > -1) { + val = parseFloat(val) + val = document.body.clientWidth * val / 100 + } else if (val.indexOf('vh') > -1) { + val = parseFloat(val) + val = document.body.clientHeight * val / 100 + } + } + + return parseInt(val || 400) - 30 + } + + /** * @description 鏁版嵁婧愬悕绉帮紝鐢ㄤ簬缁熶竴鏌ヨ * @return {String} name */ @@ -764,6 +783,8 @@ arrfield.push(item.cardValField) if (item.urlField) { arrfield.push(item.urlField) + } else if (item.colorField) { + arrfield.push(item.colorField) } } @@ -789,10 +810,8 @@ arrfield = arrfield.join(',') if (item.orderBy) { - // sql = `select ${item.type === 'checkcard' ? 'top 20' : ''} ${arrfield} from (select distinct ${arrfield},${item.orderBy} as orderfield from ${_datasource} ) a order by orderfield ${item.orderType}` sql = `select distinct ${arrfield},${item.orderBy} as orderfield from ${_datasource} order by orderfield ${item.orderType}` } else { - // sql = `select ${item.type === 'checkcard' ? 'top 20' : ''} ${arrfield} from (select distinct ${arrfield} from ${_datasource}) a` sql = `select distinct ${arrfield} from ${_datasource}` } @@ -810,10 +829,6 @@ sql = sql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`) sql = sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) - - if (window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud')) { - console.info(sql) - } return { sql: sql, @@ -2172,7 +2187,7 @@ style.color = mark.color innerStyle = {color: mark.color} } else if (type === 'background') { - style.background = mark.color + style.backgroundColor = mark.color if (mark.fontColor) { style.color = mark.fontColor innerStyle = {color: mark.fontColor} @@ -2261,7 +2276,7 @@ * @description 鍒涘缓椤甸潰瀛樺偍杩囩▼ * @return {String} */ - static getTableFunc (param, menu, config) { + static getTableFunc (func = 'func', menu, config) { let form = '' let formParam = '' let _vars = ['bid', 'pageindex', 'pagesize', 'ordercol', 'ordertype', 'exceltype', 'septmenuno', 'lang', 'debug', 'loginuid', 'sessionuid', 'userid', 'errorcode', 'retmsg'] @@ -2316,7 +2331,7 @@ ` } - let Ltext = `create proc ${param.innerFunc} + let Ltext = `create proc ${func} ( /*${menu.MenuName}*/ @appkey nvarchar(50)='', @BID nvarchar(50)='',${formParam} @@ -2331,6 +2346,7 @@ @LoginUID nvarchar(50)='', @SessionUid nvarchar(50)='', @UserID nvarchar(50), + @dataM nvarchar(50), @ErrorCode nvarchar(50) out, @retmsg nvarchar(4000) out ) @@ -2552,9 +2568,9 @@ @ErrorSeverity=ERROR_SEVERITY(), @ErrorState=ERROR_STATE(); - RAISERROR(@ErrorMessage, /*-- Message text.*/ - @ErrorSeverity, /*-- Severity.*/ - @ErrorState /*-- State.*/ + RAISERROR(@ErrorMessage, /* Message text.*/ + @ErrorSeverity, /* Severity.*/ + @ErrorState /* State.*/ ); END CATCH @@ -2693,9 +2709,9 @@ @ErrorSeverity=ERROR_SEVERITY(), @ErrorState=ERROR_STATE(); - RAISERROR(@ErrorMessage, /*-- Message text.*/ - @ErrorSeverity, /*-- Severity.*/ - @ErrorState /*-- State.*/ + RAISERROR(@ErrorMessage, /* Message text.*/ + @ErrorSeverity, /* Severity.*/ + @ErrorState /* State.*/ ); END CATCH -- Gitblit v1.8.0