| | |
| | | /** |
| | | * action通用入口 |
| | | */ |
| | | export const doAction = (button,options) => { |
| | | export const doAction = (button,options,callback) => { |
| | | options.paramVOS['title']=replaceFreeMarker(options.paramVOS.title,options.dataStore,options.sourceData); |
| | | |
| | | if(button.url && button.url!='null'){ |
| | | //有配置action路径,使用路径对应的js |
| | | let buttonParse = parseEventByUrl(button.url,options,false); |
| | | import("../"+buttonParse.jsPath+".js").then(module => { |
| | | module.doAction(options); |
| | | import("../"+button.url+".js").then(module => { |
| | | module.doAction(options,callback); |
| | | }) |
| | | }else { |
| | | //通用action |
| | |
| | | view: () => {}, |
| | | //创建 |
| | | add: () => {import("@/actions/base/AddAction").then(module => { |
| | | module.doAction(options); |
| | | module.doAction(options,callback); |
| | | })}, |
| | | //修改 |
| | | edit: () => {import("@/actions/base/EditAction").then(module => { |
| | | module.doAction(options); |
| | | module.doAction(options,callback); |
| | | })}, |
| | | //删除 |
| | | delete: () => {import("@/actions/base/DeleteAction").then(module => { |
| | | module.doAction(options); |
| | | module.doAction(options,callback); |
| | | })}, |
| | | }; |
| | | if(validatenull(options.paramVOS.context)) { |
| | |
| | | fnTarget(buttonParse,callback); |
| | | }else{ |
| | | try { |
| | | import("../"+buttonParse.jsPath).then(module => { |
| | | import("../"+buttonParse.jsPath+".js").then(module => { |
| | | module[buttonParse.methodName](options,callback); |
| | | }) |
| | | } catch (error) { |
| | |
| | | fnTarget(buttonParse,callback); |
| | | }else{ |
| | | try { |
| | | import("../"+buttonParse.jsPath).then(module => { |
| | | import("../"+buttonParse.jsPath+".js").then(module => { |
| | | module[buttonParse.methodName](options,callback); |
| | | }) |
| | | } catch (error) { |