| | |
| | | import Vue from "vue"; |
| | | import AddEditDialog from "@/components/actions/AddEditDialog" |
| | | |
| | | export const doAction = (options) => { |
| | | export const doAction = (options,callback) => { |
| | | options.paramVOS = paramLow(options.paramVOS) |
| | | const paramVOS = Object.assign({ |
| | | url: 'uiDataController/addSave', |
| | | url: '/api/uiDataController/addSave', |
| | | method: 'post', |
| | | uploadfileurl: 'vciFileUploadController/uploadFile' |
| | | }, options.paramVOS) |
| | |
| | | |
| | | callPreEvent(options, doBefore, function (options) { |
| | | doAdd(options, function () { |
| | | callPostEvent(options, doAfter, options.callback); |
| | | callPostEvent(options, doAfter, callback); |
| | | }); |
| | | }); |
| | | }; |
| | |
| | | */ |
| | | 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; |
| | | } |
| | | let vm = instance.$mount(); |
| | | document.body.appendChild(vm.$el); |
| | | instance.visible = true; |
| | | |
| | | } |
| | | /** |