| | |
| | | |
| | | let val = form.value |
| | | if (form.type === 'number' || form.type === 'rate') { |
| | | if (isNaN(val)) { |
| | | if (isNaN(val) || val === '') { |
| | | val = 0 |
| | | } |
| | | } else if (['date', 'datemonth'].includes(form.type)) { |
| | |
| | | let val = form.value |
| | | |
| | | if (form.type === 'number' || form.type === 'rate') { |
| | | if (isNaN(val)) { |
| | | if (isNaN(val) || val === '') { |
| | | val = 0 |
| | | } |
| | | _initFormfields.push(`@${_key}=${val}`) |
| | |
| | | if (params.length === 0) { |
| | | this.execSuccess(result) |
| | | _resolve() |
| | | } else if (btn.execInterval) { |
| | | setTimeout(() => { |
| | | this.customLoopRequest(params, _resolve) |
| | | }, btn.execInterval) |
| | | } else { |
| | | this.customLoopRequest(params, _resolve) |
| | | } |
| | |
| | | if (params.length === 0) { |
| | | this.execSuccess(result) |
| | | _resolve() |
| | | } else if (btn.execInterval) { |
| | | setTimeout(() => { |
| | | this.customLoopRequest(params, _resolve) |
| | | }, btn.execInterval) |
| | | } else { |
| | | this.customLoopRequest(params, _resolve) |
| | | } |
| | |
| | | if (params.length === 0) { |
| | | this.execSuccess(res) |
| | | _resolve() |
| | | } else if (btn.execInterval) { |
| | | setTimeout(() => { |
| | | this.customLoopRequest(params, _resolve) |
| | | }, btn.execInterval) |
| | | } else { |
| | | this.customLoopRequest(params, _resolve) |
| | | } |
| | |
| | | if (params.length === 0) { |
| | | this.execSuccess(res) |
| | | _resolve() |
| | | } else if (btn.execInterval) { |
| | | setTimeout(() => { |
| | | this.innerLoopRequest(params, btn, _resolve) |
| | | }, btn.execInterval) |
| | | } else { |
| | | this.innerLoopRequest(params, btn, _resolve) |
| | | } |
| | |
| | | if (params.length === 0) { |
| | | this.execSuccess(result) |
| | | _resolve() |
| | | } else if (btn.execInterval) { |
| | | setTimeout(() => { |
| | | this.outerLoopRequest(params, _resolve) |
| | | }, btn.execInterval) |
| | | } else { |
| | | this.outerLoopRequest(params, _resolve) |
| | | } |
| | |
| | | if (params.length === 0) { |
| | | this.execSuccess(result) |
| | | _resolve() |
| | | } else if (btn.execInterval) { |
| | | setTimeout(() => { |
| | | this.outerLoopRequest(params, _resolve) |
| | | }, btn.execInterval) |
| | | } else { |
| | | this.outerLoopRequest(params, _resolve) |
| | | } |
| | |
| | | if (params.length === 0) { |
| | | this.execSuccess(res) |
| | | _resolve() |
| | | } else if (btn.execInterval) { |
| | | setTimeout(() => { |
| | | this.outerLoopRequest(params, _resolve) |
| | | }, btn.execInterval) |
| | | } else { |
| | | this.outerLoopRequest(params, _resolve) |
| | | } |
| | |
| | | res.message = res.message.replace(/\s*<<.*>>\s*/g, '') |
| | | val = val ? val[0].replace(/<<|>>/g, '') : '' |
| | | |
| | | if (/^http/.test(val)) { |
| | | if (/^(http|\/\/)/.test(val)) { |
| | | let audio = document.createElement('audio') |
| | | audio.src = val |
| | | audio.play() |
| | |
| | | } |
| | | |
| | | if (tabId && btn.$MenuID === tabId) { // 刷新当前菜单时,停止其他操作 |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') |
| | | |
| | | if (menu) { |
| | | MKEmitter.emit('modifyTabs', menu, true) |
| | |
| | | } |
| | | |
| | | if (tabId) { |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') |
| | | } |
| | | |
| | | if (btn.switchTab && btn.switchTab.length > 0) { |
| | |
| | | res.message = res.message.replace(/\s*<<.*>>\s*/g, '') |
| | | val = val ? val[0].replace(/<<|>>/g, '') : '' |
| | | |
| | | if (/^http/.test(val)) { |
| | | if (/^(http|\/\/)/.test(val)) { |
| | | let audio = document.createElement('audio') |
| | | audio.src = val |
| | | audio.play() |
| | |
| | | tabId = btn.refreshTab[btn.refreshTab.length - 1] |
| | | } |
| | | if (tabId && btn.$MenuID === tabId) { // 刷新当前菜单时,停止其他操作 |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') |
| | | return |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | if (tabId) { |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') |
| | | } |
| | | } |
| | | |
| | |
| | | let key = item.field.toLowerCase() |
| | | let _readin = item.readin !== 'false' |
| | | |
| | | if (item.type === 'linkMain' && item.verifyVal === 'true') { |
| | | _item.$verify = true |
| | | _item.label = item.label |
| | | } |
| | | if (_item.type === 'date') { // 时间兼容 |
| | | _item.precision = item.precision || 'day' |
| | | } else if (_item.type === 'datetime') { |
| | |
| | | */ |
| | | getModels = () => { |
| | | const { BID, btn, BData } = this.props |
| | | const { btnconfig, visible, dict, confirmLoading, submitType } = this.state |
| | | const { btnconfig, visible, dict, confirmLoading, submitType, loadingNumber, loadingTotal } = this.state |
| | | |
| | | if (!btnconfig || !btnconfig.setting) return null |
| | | |
| | | let title = btn.label |
| | | let width = btnconfig.setting.width > 100 ? btnconfig.setting.width : btnconfig.setting.width + 'vw' |
| | | let clickouter = btnconfig.setting.clickouter === 'close' |
| | | let num = loadingNumber && !loadingTotal ? `(${loadingNumber}) ` : '' |
| | | |
| | | if (btnconfig.setting.display === 'drawer') { |
| | | let height = '100vh' |
| | |
| | | onCancel={this.handleCancel} |
| | | footer={[ |
| | | <Button key="cancel" onClick={this.handleCancel}>{dict['cancel'] || '取消'}</Button>, |
| | | btn.extBtn === 'true' ? <Button key="extend" className={'extend-btn ' + (btn.extStyle || '')} disabled={confirmLoading && submitType !== btn.extValue} loading={confirmLoading && submitType === btn.extValue} onClick={() => this.handleOk(btn.extValue)}>{btn.extLabel}</Button> : null, |
| | | btn.extBtn === 'true' ? <Button key="confirm" className={'confirm-btn ' + (btn.confStyle || '')} disabled={confirmLoading && submitType !== ''} loading={confirmLoading && submitType === ''} onClick={() => this.handleOk()}>{btn.confLabel || dict['ok'] || '确定'}</Button> : null, |
| | | btn.extBtn !== 'true' ? <Button key="confirm" type="primary" loading={confirmLoading} onClick={() => this.handleOk()}>{dict['ok'] || '确定'}</Button> : null |
| | | btn.extBtn === 'true' ? <Button key="extend" className={'extend-btn ' + (btn.extStyle || '')} disabled={confirmLoading && submitType !== btn.extValue} loading={confirmLoading && submitType === btn.extValue} onClick={() => this.handleOk(btn.extValue)}>{submitType === btn.extValue ? num : ''}{btn.extLabel}</Button> : null, |
| | | btn.extBtn === 'true' ? <Button key="confirm" className={'confirm-btn ' + (btn.confStyle || '')} disabled={confirmLoading && submitType !== ''} loading={confirmLoading && submitType === ''} onClick={() => this.handleOk()}>{submitType === '' ? num : ''}{btn.confLabel || dict['ok'] || '确定'}</Button> : null, |
| | | btn.extBtn !== 'true' ? <Button key="confirm" type="primary" loading={confirmLoading} onClick={() => this.handleOk()}>{num}{dict['ok'] || '确定'}</Button> : null |
| | | ]} |
| | | destroyOnClose |
| | | > |