| | |
| | | */ |
| | | export const doAdd = (options,callback)=> { |
| | | const paramVOS = options.paramVOS; |
| | | if (!paramVOS['form'] && !paramVOS['context']&& !paramVOS['content']) { |
| | | if (!paramVOS['form'] && !paramVOS['context'] && !paramVOS['content']) { |
| | | Vue.prototype.$message.error("按钮配置不正确"); |
| | | return false; |
| | | } |
| | | |
| | | 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 (){ |
| | | instance.sourceData = options.sourceData; |
| | | instance.dataStore = options.dataStore; |
| | | instance.paramVOS = paramVOS |
| | | |
| | | instance.type = 'add'; |
| | | instance.dialogClose = function () { |
| | | vm.visible = false; |
| | | document.body.removeChild(vm.$el); |
| | | instance.$destroy(); |
| | | instance = null; |
| | | }; |
| | | vm.prototype.saveCallback=function (){ |
| | | if (callback) { |
| | | callback(options); |
| | | } |
| | | if (callback) { |
| | | instance.saveCallback = callback(options); |
| | | } |
| | | let vm = instance.$mount(); |
| | | document.body.appendChild(vm.$el); |
| | | instance.visible = true; |
| | | |
| | | } |
| | | /** |