| | |
| | | import {paramLow,callPreEvent, callPostEvent} from './BaseAction'; |
| | | import {validatenull} from "@/util/validate"; |
| | | import Vue from "vue"; |
| | | |
| | | import AddEditDialog from "@/components/actions/AddEditDialog" |
| | | |
| | | export const doAction = (options) => { |
| | | options.paramVOS = paramLow(options.paramVOS) |
| | |
| | | */ |
| | | export const doAdd = (options,callback)=> { |
| | | const paramVOS = options.paramVOS; |
| | | if (!paramVOS['form'] && !paramVOS['context']) { |
| | | if (!paramVOS['form'] && !paramVOS['context']&& !paramVOS['content']) { |
| | | Vue.prototype.$message.error("按钮配置不正确"); |
| | | return false; |
| | | } |
| | | |
| | | Vue.prototype.$message.success('执行'+paramVOS.title); |
| | | if(callback){ |
| | | callback(options); |
| | | const dialogConstructor = Vue.extend(AddEditDialog); |
| | | let instance = new dialogConstructor(); |
| | | instance.props={ |
| | | sourceData:options.sourceData, |
| | | dataStore:options.dataStore, |
| | | paramVOS:paramVOS |
| | | } |
| | | const vm = instance.$mount(); |
| | | vm.visible=true; |
| | | vm.dialogClose=function (){ |
| | | document.body.removeChild(vm.$el); |
| | | instance.$destroy(); |
| | | instance = null; |
| | | }; |
| | | vm.prototype.saveCallback=function (){ |
| | | if (callback) { |
| | | callback(options); |
| | | } |
| | | } |
| | | document.body.appendChild(vm.$el); |
| | | |
| | | } |
| | | /** |
| | | * 前置事件 |