ÎļþÃû´Ó Source/plt-web/plt-web-ui/src/components/actions/base/BaseAction.js ÐÞ¸Ä |
| | |
| | | import {validatenull} from "@/util/validate"; |
| | | import Vue from 'vue'; |
| | | import {handlerAction} from '../handlers'; |
| | | import {handlerAction} from './handlers'; |
| | | |
| | | /** |
| | | * æé®çåºç¡æå¡ |
| | |
| | | } |
| | | if (button.url && button.url != 'null') { |
| | | //æé
ç½®actionè·¯å¾ï¼ä½¿ç¨è·¯å¾å¯¹åºçjs |
| | | import(`../${button.url}`).then(module => { |
| | | import(`./${button.url}`).then(module => { |
| | | module.doAction(options, callback); |
| | | }) |
| | | } else { |
| | |
| | | * @param preEventName åç½®äºä»¶åç§°ï¼é»è®¤beforeevent |
| | | */ |
| | | export const callPreEvent = (options,fnTarget,callback,preEventName) => { |
| | | let beforeEvent = options.paramVOS[preEventName || 'prepvent']; |
| | | let beforeEvent = options.paramVOS[preEventName || 'preevent']; |
| | | if(beforeEvent) { |
| | | let buttonParse = parseEventByUrl(beforeEvent,options,true); |
| | | if(buttonParse.params){ |
| | | Object.assign(options.paramVOS,buttonParse.params); |
| | | } |
| | | if(validatenull(buttonParse.jsPath)){ |
| | | fnTarget(buttonParse,callback); |
| | | fnTarget(options,callback); |
| | | }else{ |
| | | try { |
| | | import(`../${buttonParse.jsPath}.js`).then(module => { |
| | | import(`./${buttonParse.jsPath}.js`).then(module => { |
| | | module[buttonParse.methodName](options,callback); |
| | | }) |
| | | } catch (error) { |
| | |
| | | let afterEvent = options.paramVOS[postEventName || 'afterevent']; |
| | | if(afterEvent) { |
| | | let buttonParse = parseEventByUrl(afterEvent,options,false); |
| | | if(buttonParse.params){ |
| | | Object.assign(options.paramVOS,buttonParse.params); |
| | | } |
| | | if(validatenull(buttonParse.jsPath)){ |
| | | fnTarget(buttonParse,callback,actionType); |
| | | fnTarget(options,callback,actionType); |
| | | }else{ |
| | | try { |
| | | import(`../${buttonParse.jsPath}.js`).then(module => { |
| | | import(`./${buttonParse.jsPath}.js`).then(module => { |
| | | module[buttonParse.methodName](options,callback,actionType); |
| | | }) |
| | | } catch (error) { |
| | |
| | | let jsPath = url; |
| | | let methodName = defalutmethodName || (isBefore?"doBefore":"doAfter"); |
| | | let params = {}; |
| | | if (url.indexOf("?")) { |
| | | if (url.indexOf("?")>-1) { |
| | | let temp = url.substring(0, url.indexOf("?")); |
| | | if (temp.indexOf("#") > -1) { |
| | | let array = temp.split("#"); |
| | |
| | | } |
| | | let paramArray = url.substring(url.indexOf("?") + 1).split("&"); |
| | | paramArray.forEach(_item=>{ |
| | | if (_item.indexOf("=") < 0) { |
| | | Vue.prototype.$message.error(isBefore?"åç½®äºä»¶":"åç½®äºä»¶" + "çåæ°é
ç½®é误ï¼éè¦è¦xxx=yyy&zzz=açæ¹å¼"); |
| | | return true; |
| | | if(_item){ |
| | | if (_item.indexOf("=") < 0) { |
| | | Vue.prototype.$message.error(isBefore?"åç½®äºä»¶":"åç½®äºä»¶" + "çåæ°é
ç½®é误ï¼éè¦è¦xxx=yyy&zzz=açæ¹å¼"); |
| | | return true; |
| | | } |
| | | params[_item.split("=")[0]] = _item.split("=")[1]; |
| | | } |
| | | params[_item.split("=")[0]] = _item.split("=")[1]; |
| | | }) |
| | | }else{ |
| | | if (url.indexOf("#") > -1) { |