| | |
| | | import moment from 'moment' |
| | | import qs from 'qs' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Button, Modal, notification, message, Drawer, Switch, Checkbox, Progress } from 'antd' |
| | | import { Button, Modal, notification, message, Popover, Drawer, Switch, Checkbox, Progress } from 'antd' |
| | | import md5 from 'md5' |
| | | |
| | | import Api from '@/api' |
| | |
| | | } |
| | | } |
| | | |
| | | param.exec_type = 'y' // 后台解码 |
| | | param.exec_type = window.GLOB.execType || 'y' // 后台解码 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | |
| | | param.LText = param.LText.replace(/\$check@|@check\$/ig, '') |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.LText = Utils.formatOptions(param.LText, param.exec_type) |
| | | } else if (btn.OpenType === 'pop' || btn.OpenType === 'formSubmit' || btn.OpenType === 'form') { // 表单 |
| | | if (btn.sqlType === 'insert') { // 系统函数添加时,生成uuid |
| | | primaryId = '' |
| | |
| | | } |
| | | } |
| | | |
| | | param.exec_type = 'y' // 后台解码 |
| | | param.exec_type = window.GLOB.execType || 'y' // 后台解码 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | |
| | | param.LText = param.LText.replace(/\$check@|@check\$/ig, '') |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.LText = Utils.formatOptions(param.LText, param.exec_type) |
| | | } else { |
| | | param.ID = primaryId |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | param.exec_type = 'y' // 后台解码 |
| | | param.exec_type = window.GLOB.execType || 'y' // 后台解码 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | |
| | | param.LText = param.LText.replace(/\$check@|@check\$/ig, '') |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.LText = Utils.formatOptions(param.LText, param.exec_type) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (param.$unCheckParam) { |
| | | param.$unCheckParam.LText = param.$unCheckParam.LText.replace(/\$check@/ig, '/*').replace(/@check\$/ig, '*/') |
| | | param.$unCheckParam.LText = Utils.formatOptions(param.$unCheckParam.LText) |
| | | param.$unCheckParam.LText = Utils.formatOptions(param.$unCheckParam.LText, param.exec_type) |
| | | param.$unCheckParam.menuname = btn.logLabel |
| | | |
| | | if (window.GLOB.probation) { |
| | |
| | | } |
| | | } |
| | | |
| | | param.exec_type = 'y' // 后台解码 |
| | | param.exec_type = window.GLOB.execType || 'y' // 后台解码 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | |
| | | param.LText = param.LText.replace(/\$check@|@check\$/ig, '') |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.LText = Utils.formatOptions(param.LText, param.exec_type) |
| | | } else if (btn.OpenType === 'pop') { // 表单 |
| | | if (index !== 0) { |
| | | let _cell = {} |
| | |
| | | } |
| | | } |
| | | |
| | | param.exec_type = 'y' // 后台解码 |
| | | param.exec_type = window.GLOB.execType || 'y' // 后台解码 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | |
| | | param.LText = param.LText.replace(/\$check@|@check\$/ig, '') |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.LText = Utils.formatOptions(param.LText, param.exec_type) |
| | | } else { |
| | | param.ID = primaryId |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | param.exec_type = 'y' // 后台解码 |
| | | param.exec_type = window.GLOB.execType || 'y' // 后台解码 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | |
| | | param.LText = param.LText.replace(/\$check@|@check\$/ig, '') |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.LText = Utils.formatOptions(param.LText, param.exec_type) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (param.$unCheckParam) { |
| | | param.$unCheckParam.LText = param.$unCheckParam.LText.replace(/\$check@/ig, '/*').replace(/@check\$/ig, '*/') |
| | | param.$unCheckParam.LText = Utils.formatOptions(param.$unCheckParam.LText) |
| | | param.$unCheckParam.LText = Utils.formatOptions(param.$unCheckParam.LText, param.exec_type) |
| | | param.$unCheckParam.menuname = btn.logLabel |
| | | |
| | | if (window.GLOB.probation) { |
| | |
| | | |
| | | if (btn.intertype === 'system') { |
| | | params = this.getSystemParam(data, formdata) |
| | | if (btn.returnValue === 'true') { |
| | | params = params.map(item => { |
| | | item.script_type = 'Y' |
| | | return item |
| | | }) |
| | | } |
| | | } else { |
| | | params = this.getInnerParam(data, formdata) |
| | | } |
| | |
| | | return |
| | | } |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | Api.genericInterface(param, btn.$innerScript, 'inner').then(res => { |
| | | record.mk_api_key = res.mk_api_key || '' |
| | | |
| | | if (res.status) { |
| | |
| | | param.menuname = param.menuname + '(回调)' |
| | | } |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | Api.genericInterface(param, btn.$callbackScript, 'callback').then(res => { |
| | | if (res.status) { |
| | | this.triggerNote(res, param.ID) // 消息 |
| | | |
| | |
| | | sql = sql.replace(/@typename@/ig, `'admin'`) |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | | sql = sql.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'') |
| | | sql = sql.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, `'Y'`) |
| | | } else { |
| | | sql = sql.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'') |
| | | sql = sql.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, `''`) |
| | | } |
| | | |
| | | if (window.GLOB.debugger === true) { |
| | |
| | | } |
| | | |
| | | param.LText = sql |
| | | param.exec_type = 'y' // 后台解码 |
| | | param.exec_type = window.GLOB.execType || 'y' // 后台解码 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.LText = Utils.formatOptions(param.LText, param.exec_type) |
| | | param.menuname = btn.logLabel |
| | | |
| | | if (window.GLOB.probation) { |
| | |
| | | return |
| | | } |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | Api.genericInterface(param, btn.$innerScript, 'inner').then(res => { |
| | | if (res.status) { |
| | | if ((res.mk_ex_invoke === 'false' || res.mk_ex_invoke === false) && params.length === 0) { |
| | | this.execSuccess(res) |
| | |
| | | } |
| | | } |
| | | |
| | | Api.genericInterface(result).then(res => { |
| | | Api.genericInterface(result, btn.$outerScript, 'outer').then(res => { |
| | | if (!res) return // LoginError时中断请求 |
| | | if (ver_token && res.ErrCode === 'token_error') { |
| | | res.ErrCode = 'E' |
| | |
| | | func: btn.callbackFunc |
| | | } |
| | | |
| | | // special 函数 s_sDataDictb_TBBack 云端验证 |
| | | if (window.GLOB.mkHS && param.func === 's_sDataDictb_TBBack' && param.LTextOut) { |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LTextOut, param.timestamp) |
| | | param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) |
| | | if (window.GLOB.mkHS) { |
| | | if (btn.callbackFunc === 's_sVersion_Local_add' && window.GLOB.forcedUpdate) { // special 传输号添加回调处理 |
| | | param.local_userid = sessionStorage.getItem('LocalUserID') || '' |
| | | } else if (btn.callbackFunc === 's_sDataDictb_TBBack' && param.LTextOut) { // special 函数 s_sDataDictb_TBBack 云端验证 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LTextOut, param.timestamp) |
| | | param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) |
| | | } |
| | | } |
| | | } else { |
| | | if (result.status) { |
| | |
| | | param.menuname = param.menuname + '(回调)' |
| | | } |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | Api.genericInterface(param, btn.$callbackScript, 'callback').then(res => { |
| | | if (res.status) { |
| | | this.triggerNote(res, param.ID) // 消息 |
| | | |
| | |
| | | const { autoMatic } = this.state |
| | | |
| | | if (btn.resetForms) { |
| | | MKEmitter.emit('resetForms', btn.uuid) |
| | | let data = {} |
| | | |
| | | Object.keys(res).forEach(key => { |
| | | data[key.toLowerCase()] = res[key] |
| | | }) |
| | | |
| | | delete data.errcode |
| | | delete data.errmesg |
| | | delete data.message |
| | | delete data.status |
| | | |
| | | MKEmitter.emit('resetForms', btn.uuid, data) |
| | | MKEmitter.emit('refreshByButtonResult', btn.$menuId, 'resetData', btn, null, null, data) |
| | | } |
| | | |
| | | if (this.preCallback) { |
| | |
| | | tabId = btn.refreshTab[btn.refreshTab.length - 1] |
| | | } |
| | | |
| | | if (btn.formCache === 'clear') { // 清除表单缓存 |
| | | window.GLOB.CacheMap = new Map() |
| | | } |
| | | |
| | | if (tabId && btn.$MenuID === tabId) { // 刷新当前菜单时,停止其他操作 |
| | | MKEmitter.emit('reloadMenuView', tabId, 'table') |
| | | return |
| | |
| | | } else if (/\$focus/.test(btn.syncComponentId)) { |
| | | MKEmitter.emit('reloadData', btn.syncComponentId.split('$')[0], btn.syncComponentId.split('$')[1]) |
| | | } else { |
| | | MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | if (btn.syncDelay) { |
| | | this.delayTimer && clearTimeout(this.delayTimer) |
| | | this.delayTimer = setTimeout(() => { |
| | | MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | }, btn.syncDelay) |
| | | } else { |
| | | MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | upid: id |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(Utils.getuuid()) |
| | | param.LText = Utils.getuuid() |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | |
| | | msg_result: msg |
| | | } |
| | | |
| | | _p.LText = Utils.formatOptions(Utils.getuuid()) |
| | | _p.LText = Utils.getuuid() |
| | | _p.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | _p.secretkey = Utils.encrypt(_p.LText, _p.timestamp) |
| | | |
| | |
| | | upid: id |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(Utils.getuuid()) |
| | | param.LText = Utils.getuuid() |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | |
| | | upid: id |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(Utils.getuuid()) |
| | | param.LText = Utils.getuuid() |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | |
| | | label = (loadingNumber ? `(${loadingNumber})` : '') + btn.label |
| | | } |
| | | |
| | | let BTN = <Button |
| | | type={type} |
| | | icon={icon} |
| | | id={'button' + btn.uuid} |
| | | title={disabled ? (btn.reason || '') : (btn.show === 'icon' ? btn.label : '')} |
| | | loading={loading} |
| | | disabled={disabled} |
| | | style={btn.style} |
| | | className={className} |
| | | onClick={(e) => {e.stopPropagation(); this.actionTrigger()}} |
| | | >{label}</Button> |
| | | |
| | | if (btn.hoverTitle) { |
| | | BTN = <Popover mouseLeaveDelay={0.3} mouseEnterDelay={0.3} content={btn.hoverTitle} trigger="hover"> |
| | | {BTN} |
| | | </Popover> |
| | | } |
| | | |
| | | return <> |
| | | <Button |
| | | type={type} |
| | | icon={icon} |
| | | id={'button' + btn.uuid} |
| | | title={disabled ? (btn.reason || '') : (btn.show === 'icon' ? btn.label : '')} |
| | | loading={loading} |
| | | disabled={disabled} |
| | | style={btn.style} |
| | | className={className} |
| | | onClick={(e) => {e.stopPropagation(); this.actionTrigger()}} |
| | | >{label}</Button> |
| | | {BTN} |
| | | <span onClick={(e) => {e.stopPropagation()}}>{this.getModels()}</span> |
| | | {loadingTotal ? <Progress className="mk-button-progress" percent={(loadingTotal - loadingNumber) / loadingTotal * 100} size="small" showInfo={false} /> : null} |
| | | </> |