From f9816a4078fdba44115c69025d9982997f23b484 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 29 四月 2024 16:00:49 +0800 Subject: [PATCH] Merge branch 'develop' --- src/tabviews/zshare/actionList/normalbutton/index.jsx | 87 ++++++++++++++++++++++++++----------------- 1 files changed, 53 insertions(+), 34 deletions(-) diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index f58f2fe..30564b9 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -28,6 +28,7 @@ columns: PropTypes.any, // 瀛楁鍒� setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 disabled: PropTypes.any, // 琛屾寜閽鐢� + name: PropTypes.any } state = { @@ -755,6 +756,9 @@ param.username = sessionStorage.getItem('User_Name') || '' param.fullname = sessionStorage.getItem('Full_Name') || '' } + if (btn.dataM === 'true') { + param.dataM = sessionStorage.getItem('dataM') === 'true' ? 'Y' : '' + } let primaryId = '' @@ -796,6 +800,9 @@ if (btn.recordUser === 'true') { param.username = sessionStorage.getItem('User_Name') || '' param.fullname = sessionStorage.getItem('Full_Name') || '' + } + if (btn.dataM === 'true') { + param.dataM = sessionStorage.getItem('dataM') === 'true' ? 'Y' : '' } let primaryId = setting.primaryKey ? cell[setting.primaryKey] || '' : '' @@ -2344,9 +2351,9 @@ tabId = btn.refreshTab[btn.refreshTab.length - 1] } - if (btn.formCache === 'clear') { // 娓呴櫎琛ㄥ崟缂撳瓨 - window.GLOB.CacheMap = new Map() - } + // if (btn.formCache === 'clear') { // 娓呴櫎琛ㄥ崟缂撳瓨 + // window.GLOB.CacheMap = new Map() + // } if (tabId && btn.$MenuID === tabId) { // 鍒锋柊褰撳墠鑿滃崟鏃讹紝鍋滄鍏朵粬鎿嶄綔 MKEmitter.emit('reloadMenuView', tabId, 'table') @@ -2474,9 +2481,38 @@ if (!id) return - setTimeout(() => { - window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: id, tempId: btn.verify.printTempId, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM') })))) - }, 500) + if (btn.verify.preHandle === 'true' && btn.verify.pre_func && /#position-print/.test(btn.verify.pre_func)) { + MKEmitter.emit('queryModuleParam', btn.$menuId, (res) => { + let searches = {} + res.search && res.search.forEach(item => { + searches[item.key] = item.value + }) + let _param = { id: id || '', tempId: btn.verify.printTempId, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM')} + + try { + // eslint-disable-next-line + let func = new Function('btn', 'searches', 'param', 'systemType', btn.verify.pre_func) + _param = func(btn, searches, _param, window.GLOB.systemType) + } catch (e) { + console.warn(e) + } + + if (!_param || _param.error) { + notification.warning({ + top: 92, + message: _param ? _param.error : '鏈幏鍙栧埌鎵撳嵃鍙傛暟锛岃嚜瀹氫箟鑴氭湰閿欒锛�', + duration: 5 + }) + return + } + + window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify(_param)))) + }) + } else { + setTimeout(() => { + window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: id, tempId: btn.verify.printTempId, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM') })))) + }, 200) + } } sendWxMessage = (verify, id) => { @@ -3169,7 +3205,7 @@ } modelconfirm = () => { - const { btn, BID } = this.props + const { BID } = this.props const { btnconfig, selines } = this.state let _this = this @@ -3314,7 +3350,7 @@ this.execSubmit(selines, () => {}, result) } else { confirm({ - title: btn.tipTitle || '纭畾瑕佹墽琛屽悧?', + title: btnconfig.setting.tipTitle || '纭畾瑕佹墽琛屽悧?', onOk() { return new Promise(resolve => { _this.execSubmit(selines, resolve, result) @@ -3494,7 +3530,7 @@ } render() { - const { btn } = this.props + const { btn, name } = this.props const { loadingNumber, loadingTotal, loading, disabled, hidden, check, count } = this.state if (hidden) return null @@ -3513,42 +3549,25 @@ } let label = '' - let icon = '' - let type = 'link' - let className = '' - if (btn.show === 'button') { - label = btn.label - icon = btn.icon || '' - } else if (btn.show === 'link') { - label = <span>{btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span> - icon = '' + if (btn.show === 'link') { + label = <span>{name || btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon} /> : ''}</span> } else if (btn.show === 'icon') { - icon = btn.icon || '' - } else if (!btn.$toolbtn) { - icon = btn.icon || '' - label = btn.label - className = 'mk-btn mk-' + (btn.class || 'unset') + label = !loading ? <MkIcon type={btn.icon} /> : null + } else if (btn.$toolbtn) { + label = <span>{!loading && btn.icon ? <MkIcon style={{marginRight: '8px'}} type={btn.icon} /> : ''}{loadingNumber && !loadingTotal ? `(${loadingNumber})` : ''}{btn.label}</span> } else { - type = '' - icon = btn.icon || '' - label = btn.label - className = 'mk-btn mk-' + (btn.class || 'unset') - } - - if (loadingNumber && btn.progress !== 'progressbar' && btn.$toolbtn && (!btn.show || btn.show === 'button')) { - label = (loadingNumber ? `(${loadingNumber})` : '') + btn.label + label = <span>{!loading && btn.icon ? <MkIcon style={{marginRight: '8px'}} type={btn.icon} /> : ''}{name || btn.label}</span> } let BTN = <Button - type={type} - icon={icon} + type="link" id={'button' + btn.uuid} title={disabled ? (btn.reason || '') : (btn.show === 'icon' ? btn.label : '')} loading={loading} disabled={disabled} style={btn.style} - className={className} + className={btn.$toolbtn ? (btn.hover || '') : ''} onClick={(e) => {e.stopPropagation(); this.actionTrigger()}} >{label}</Button> -- Gitblit v1.8.0