| | |
| | | * @param callback 回调,如果存在后置事件,会在执行完成后执行回调,否则直接回调 |
| | | * @param preEventName 后置事件名称,默认 afterevent |
| | | */ |
| | | export const callPostEvent = (options,fnTarget,callback,postEventName)=>{ |
| | | export const callPostEvent = (options,fnTarget,callback,actionType,postEventName)=>{ |
| | | let afterEvent = options.paramVOS[postEventName || 'afterevent']; |
| | | if(afterEvent) { |
| | | let buttonParse = parseEventByUrl(afterEvent,options,false); |
| | | if(validatenull(buttonParse.jsPath)){ |
| | | fnTarget(buttonParse,callback); |
| | | fnTarget(buttonParse,callback,actionType); |
| | | }else{ |
| | | try { |
| | | import("../"+buttonParse.jsPath+".js").then(module => { |
| | | module[buttonParse.methodName](options,callback); |
| | | module[buttonParse.methodName](options,callback,actionType); |
| | | }) |
| | | } catch (error) { |
| | | Vue.prototype.$message.error('未找到后置事件执行js'); |
| | |
| | | } |
| | | }else{ |
| | | if(callback){ |
| | | callback(options); |
| | | callback(actionType); |
| | | } |
| | | } |
| | | }; |