| | |
| | | } |
| | | } else if (intertype === 'inner') { |
| | | shows.push('innerFunc', 'output') |
| | | if (Ot === 'requiredOnce') { // 前置函数 |
| | | shows.push('preFunc') |
| | | } |
| | | reRequired.innerFunc = true |
| | | } else { |
| | | shows.push('sql', 'sqlType', 'output') |
| | |
| | | { pattern: /^[a-zA-Z0-9@_]+$/, message: '表名只可使用字母、数字以及_' }, |
| | | { max: formRule.func.max, message: formRule.func.maxMessage } |
| | | ) |
| | | } else if (item.key === 'outerFunc' || item.key === 'callbackFunc') { |
| | | } else if (item.key === 'outerFunc' || item.key === 'callbackFunc' || item.key === 'preFunc') { |
| | | rules.push( |
| | | { pattern: formRule.func.pattern, message: formRule.func.message }, |
| | | { max: formRule.func.max, message: formRule.func.maxMessage } |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'preFunc', |
| | | label: '前置函数', |
| | | initVal: card.preFunc || '', |
| | | tooltip: '前置函数执行完成后,结果会传入内部函数中,此时内部函数会异步执行;当前置函数返回中ErrCode等于-1时,将不再执行内部函数。', |
| | | required: false, |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'control', |
| | | label: '按钮控制', |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'preFunc', |
| | | label: '前置函数', |
| | | initVal: card.preFunc || '', |
| | | tooltip: '前置函数执行完成后,结果会传入内部函数中,此时内部函数会异步执行;当前置函数返回中ErrCode等于-1时,将不再执行内部函数。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'control', |
| | | label: '按钮控制', |
| | |
| | | |
| | | if (params[0].$unCheckParam) { |
| | | this.checkLoopRequest(params, _resolve) |
| | | } else if (btn.preFunc && params.length === 1) { |
| | | let param = params[0] |
| | | let _param = fromJS(param).toJS() |
| | | _param.func = btn.preFunc |
| | | |
| | | Api.genericInterface(_param).then(res => { |
| | | if (res.status) { |
| | | if (res.ErrCode !== '-1') { |
| | | param = {...param, ...res} |
| | | |
| | | delete param.status |
| | | delete param.ErrCode |
| | | delete param.ErrMesg |
| | | delete param.message |
| | | |
| | | setTimeout(() => { |
| | | Api.genericInterface(param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | }, 600) |
| | | } |
| | | |
| | | this.triggerNote(res) // 消息 |
| | | this.execSuccess(res) |
| | | } else { |
| | | this.execError(res) |
| | | } |
| | | }, () => { |
| | | this.updateStatus() |
| | | _resolve() |
| | | }) |
| | | } else if (params.length <= 20 && btn.execType !== 'single') { |
| | | let deffers = params.map((param, i) => { |
| | | return new Promise(resolve => { |
| | | setTimeout(() => { |
| | | let _param = null |
| | | if (btn.preFunc) { |
| | | _param = fromJS(param).toJS() |
| | | param.func = btn.preFunc |
| | | } |
| | | Api.genericInterface(param).then(res => { |
| | | if (btn.preFunc && res.status && res.ErrCode !== '-1') { |
| | | _param = {..._param, ...res} |
| | | |
| | | delete _param.status |
| | | delete _param.ErrCode |
| | | delete _param.ErrMesg |
| | | delete _param.message |
| | | |
| | | setTimeout(() => { |
| | | Api.genericInterface(_param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | }, 600) |
| | | } |
| | | |
| | | if (res.status) { |
| | | this.triggerNote(res) // 消息 |
| | | } |
| | |
| | | loadingNumber: params.length |
| | | }) |
| | | |
| | | let _param = null |
| | | |
| | | if (btn.preFunc) { |
| | | _param = fromJS(param).toJS() |
| | | param.func = btn.preFunc |
| | | } |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | if (btn.preFunc && res.ErrCode !== '-1') { |
| | | _param = {..._param, ...res} |
| | | |
| | | delete _param.status |
| | | delete _param.ErrCode |
| | | delete _param.ErrMesg |
| | | delete _param.message |
| | | |
| | | setTimeout(() => { |
| | | Api.genericInterface(_param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | }, 600) |
| | | } |
| | | |
| | | this.triggerNote(res) // 消息 |
| | | |
| | | if (params.length === 0) { |
| | |
| | | reReadonly.interface = true |
| | | reRequired.interface = false |
| | | } |
| | | } else if (intertype === 'inner') { // preFunc 前置函数 |
| | | } else if (intertype === 'inner') { |
| | | shows.push('innerFunc', 'output') |
| | | reRequired.innerFunc = true |
| | | } else { |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'preFunc', |
| | | label: '前置函数', |
| | | initVal: card.preFunc || '', |
| | | tooltip: usefulFields.length ? `函数名称需以${usefulFields.join(', ')}等字符开始;前置函数执行完成后,结果会传入内部函数中,此时内部函数会异步执行;当前置函数返回中ErrCode等于-1时,将不再执行内部函数。` : '', |
| | | fields: usefulFields, |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'control', |
| | | label: '按钮控制', |