From eb0482b3fc2e91a626baa6ac73e75e0b0038f552 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 03 十一月 2023 01:25:59 +0800 Subject: [PATCH] 2023-11-03 --- src/utils/utils.js | 31 +++++++++++++++++++------------ 1 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/utils/utils.js b/src/utils/utils.js index 2062f1d..3c4adea 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -979,7 +979,11 @@ }) } } else if (/^Decimal/ig.test(col.type) || /^int/ig.test(col.type)) { - if (!val && val !== 0) { + if (col.required === 'false') { + if (!val || isNaN(val)) { + val = 0 + } + } else if (!val && val !== 0) { errors.push(_position + '鍐呭涓嶅彲涓虹┖') } else if (isNaN(val)) { // 妫�楠屾槸鍚︿负鏁板�� errors.push(_position + '鍐呭搴斾负鏁板��') @@ -2370,6 +2374,10 @@ _sql = _sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) _sql = _sql.replace(/@typename@/ig, `'admin'`) + if (window.GLOB.externalDatabase !== null) { + _sql = _sql.replace(/@db@/ig, window.GLOB.externalDatabase) + } + if (sessionStorage.getItem('dataM') === 'true') { // 鏁版嵁鏉冮檺 _sql = _sql.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, `'Y'`) } else { @@ -2394,9 +2402,8 @@ /** * @description 鑾峰彇鏍囪淇℃伅 */ -export function getMark (marks, record, style = {}) { - style = JSON.parse(JSON.stringify(style)) - let res = {style} +export function getMark (marks, record, style) { + let res = {signType: ''} marks.some(mark => { let originVal = record[mark.field[0]] @@ -2431,22 +2438,22 @@ let type = mark.signType[0] if (type === 'font') { - res.style.color = mark.color + style.color = mark.color res.innerStyle = {color: mark.color} res.signType = ' sign-font' } else if (type === 'background') { - res.style.backgroundColor = mark.color + style.backgroundColor = mark.color if (mark.fontColor) { - res.style.color = mark.fontColor + style.color = mark.fontColor res.innerStyle = {color: mark.fontColor} } } else if (type === 'underline') { - res.style.textDecoration = 'underline' - res.style.color = mark.color + style.textDecoration = 'underline' + style.color = mark.color res.innerStyle = {color: mark.color, textDecoration: 'underline'} } else if (type === 'line-through') { - res.style.textDecoration = 'line-through' - res.style.color = mark.color + style.textDecoration = 'line-through' + style.color = mark.color res.innerStyle = {color: mark.color, textDecoration: 'line-through'} } else if (type.indexOf('icon') > -1) { res.icon = mark.signType[mark.signType.length - 1] @@ -2457,7 +2464,7 @@ res.position = 'back' } } else if (type === 'indent') { - res.style.color = mark.color + style.color = mark.color res.space = Array(mark.signType[1] + 1).join(' ') } else if (type === 'pointfront') { res.position = 'front' -- Gitblit v1.8.0