| | |
| | | import {validatenull} from "@/util/validate"; |
| | | import Vue from 'vue'; |
| | | import {handlers} from '../handlers'; |
| | | import {handlerAction} from '../handlers'; |
| | | |
| | | /** |
| | | * 按钮的基础服务 |
| | |
| | | } |
| | | if (button.url && button.url != 'null') { |
| | | //有配置action路径,使用路径对应的js |
| | | import("../" + button.url + ".js").then(module => { |
| | | import(`../${button.url}`).then(module => { |
| | | module.doAction(options, callback); |
| | | }) |
| | | } else { |
| | | if (handlers[button.actionVO.id.toLowerCase()]) { |
| | | handlers[button.actionVO.id.toLowerCase()]() |
| | | } else { |
| | | Vue.prototype.$message.error('未找到对应action,请重新配置按钮!'); |
| | | } |
| | | //执行通用action |
| | | handlerAction(button.actionVO.id.toLowerCase(),options, callback) |
| | | } |
| | | }; |
| | | |
| | |
| | | fnTarget(buttonParse,callback); |
| | | }else{ |
| | | try { |
| | | import("../"+buttonParse.jsPath+".js").then(module => { |
| | | import(`../${buttonParse.jsPath}.js`).then(module => { |
| | | module[buttonParse.methodName](options,callback); |
| | | }) |
| | | } catch (error) { |
| | |
| | | fnTarget(buttonParse,callback,actionType); |
| | | }else{ |
| | | try { |
| | | import("../"+buttonParse.jsPath+".js").then(module => { |
| | | import(`../${buttonParse.jsPath}.js`).then(module => { |
| | | module[buttonParse.methodName](options,callback,actionType); |
| | | }) |
| | | } catch (error) { |