From 24842b40de5cd60700bf69dfd38a0332f5431e36 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 23 五月 2025 10:55:07 +0800 Subject: [PATCH] Merge branch 'master' into positec --- src/tabviews/zshare/actionList/excelInbutton/index.jsx | 60 ++++++++++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 46 insertions(+), 14 deletions(-) diff --git a/src/tabviews/zshare/actionList/excelInbutton/index.jsx b/src/tabviews/zshare/actionList/excelInbutton/index.jsx index b932b2c..a022b65 100644 --- a/src/tabviews/zshare/actionList/excelInbutton/index.jsx +++ b/src/tabviews/zshare/actionList/excelInbutton/index.jsx @@ -121,7 +121,7 @@ if (setting.supModule && !BID) { notification.warning({ top: 92, - message: dict['sup_key_req'] || '闇�瑕佷笂绾т富閿�硷紒', + message: setting.supModTip || dict['sup_key_req'] || '闇�瑕佷笂绾т富閿�硷紒', duration: 5 }) } else if (btn.Ot === 'requiredSgl' && data.length !== 1) { @@ -187,7 +187,7 @@ } if (tabId && btn.$MenuID === tabId) { // 鍒锋柊褰撳墠鑿滃崟鏃讹紝鍋滄鍏朵粬鎿嶄綔 - MKEmitter.emit('reloadMenuView', tabId) + MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') return } @@ -216,7 +216,7 @@ } if (tabId) { - MKEmitter.emit('reloadMenuView', tabId) + MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') } if (btn.switchTab && btn.switchTab.length > 0) { @@ -278,7 +278,7 @@ tabId = btn.refreshTab[btn.refreshTab.length - 1] } if (tabId && btn.$MenuID === tabId) { // 鍒锋柊褰撳墠鑿滃崟鏃讹紝鍋滄鍏朵粬鎿嶄綔 - MKEmitter.emit('reloadMenuView', tabId, 'table') + MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') return } @@ -303,7 +303,7 @@ } if (tabId) { - MKEmitter.emit('reloadMenuView', tabId) + MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') } } @@ -695,17 +695,34 @@ for (let i = 0; i < 26; i++) { cols.push('A' + cols[i]) } + let columns = fromJS(btn.verify.columns).toJS() + columns = columns.filter((col, index) => { + col.colIndex = cols[index] || (index + 1) + if (col.import !== 'init' && (/^Decimal/ig.test(col.type) || /^int/ig.test(col.type))) { + col.declen = 0 + if (/^Decimal/ig.test(col.type)) { + col.declen = +col.type.match(/\d+/g)[1] + } + col.declen = col.declen || 0 + } + if (col.required === 'false') { + delete col.min + delete col.max + } + + return col.import !== 'false' + }) let lines = data.map((item, lindex) => { let vals = [] - btn.verify.columns.forEach((col, cindex) => { - if (col.import === 'false') return - + columns.forEach(col => { let val = item[col.Column] !== undefined ? item[col.Column] : '' - let _colindex = cols[cindex] || (cindex + 1) - let _position = (_topline + lindex + 1) + '琛� ' + _colindex + '鍒� ' + let _position = (_topline + lindex + 1) + '琛� ' + col.colIndex + '鍒� ' + let eLen = errors.length - if (col.import === 'init') { + if (col.$error) { + + } else if (col.import === 'init') { if (/^Nvarchar/ig.test(col.type)) { val = '' } else if (/^Decimal/ig.test(col.type) || /^int/ig.test(col.type)) { @@ -741,15 +758,26 @@ if (!val || isNaN(val)) { val = 0 } - } else if (!val && val !== 0) { + } + if (!val && val !== 0) { errors.push(_position + '鍐呭涓嶅彲涓虹┖') } else if (isNaN(val)) { // 妫�楠屾槸鍚︿负鏁板�� errors.push(_position + '鍐呭搴斾负鏁板��') - } else if ((col.min || col.min === 0) && val < col.min) { // 鏈�灏忓�兼楠� + } else if (typeof(col.min) === 'number' && val < col.min) { // 鏈�灏忓�兼楠� errors.push(_position + '灏忎簬鏈�灏忓��') - } else if ((col.max || col.max === 0) && val > col.max) { // 鏈�澶у�兼楠� + } else if (typeof(col.max) === 'number' && val > col.max) { // 鏈�澶у�兼楠� errors.push(_position + '澶т簬鏈�澶у��') + } else { + let _float = (val + '').split('.')[1] + if (_float && _float.length > col.declen) { + if (col.declen) { + errors.push(_position + `鏁板�间笉鍙ぇ浜�${col.declen}浣嶅皬鏁癭) + } else { + errors.push(_position + '鏁板�煎簲涓烘暣鏁�') + } + } } + val = val + '' } else if (col.type === 'date' || col.type === 'datetime') { if (typeof(val) === 'number') { if (val > 2958465 || val <= 0) { // 鏃堕棿杩囧ぇ鎴栧皬浜庣瓑浜�0 @@ -785,6 +813,10 @@ } } + if (errors.length > eLen) { + col.$error = true + } + vals.push(val) }) -- Gitblit v1.8.0