| | |
| | | /** |
| | | * 按钮处理 业务类型新增 |
| | | */ |
| | | import {callPreEvent,callPostEvent} from './BaseAction'; |
| | | import {paramLow,callPreEvent, callPostEvent} from './BaseAction'; |
| | | import {validatenull} from "@/util/validate"; |
| | | import Vue from "vue"; |
| | | |
| | | export const doAction = (options) => { |
| | | let paramVOS = Object.assign({ |
| | | options.paramVOS = paramLow(options.paramVOS) |
| | | const paramVOS = Object.assign({ |
| | | url: 'uiDataController/addSave', |
| | | method: 'post', |
| | | uploadFileUrl: 'vciFileUploadController/uploadFile' |
| | | uploadfileurl: 'vciFileUploadController/uploadFile' |
| | | }, options.paramVOS) |
| | | options.paramVOS = paramVOS; |
| | | |
| | | callPreEvent(options, doBefore,function (options) { |
| | | options.sourceData = options.sourceData || {}; |
| | | |
| | | callPreEvent(options, doBefore, function (options) { |
| | | doAdd(options, function () { |
| | | callPostEvent(options,doAfter, options.callback); |
| | | callPostEvent(options, doAfter, options.callback); |
| | | }); |
| | | }); |
| | | }; |
| | |
| | | * @param callback 回调 |
| | | */ |
| | | export const doAdd = (options,callback)=> { |
| | | this.$message.success('执行增加'); |
| | | const paramVOS = options.paramVOS; |
| | | if (!paramVOS['form'] && !paramVOS['context']) { |
| | | Vue.prototype.$message.error("按钮配置不正确"); |
| | | return false; |
| | | } |
| | | Vue.prototype.$message.success('执行'+paramVOS.title); |
| | | if(callback){ |
| | | callback(options); |
| | | } |
| | |
| | | * @param callback 回调 |
| | | */ |
| | | export const doBefore = (options,callback)=> { |
| | | this.$message.success('执行前置事件'); |
| | | Vue.prototype.$message.success('执行增加前置事件'); |
| | | if(callback){ |
| | | callback(options); |
| | | } |
| | |
| | | * @param callback 回调 |
| | | */ |
| | | export const doAfter = (options,callback)=> { |
| | | this.$message.success('执行后置事件'); |
| | | Vue.prototype.$message.success('执行增加后置事件'); |
| | | if(callback){ |
| | | callback(options); |
| | | } |