/**
|
* 按钮处理 业务类型删除
|
*/
|
import {paramLow,callPreEvent,callPostEvent} from './BaseAction';
|
import {validatenull} from "@/util/validate";
|
import Vue from "vue";
|
|
export const doAction = (options) => {
|
options.paramVOS = paramLow(options.paramVOS)
|
const paramVOS = Object.assign({
|
url: 'uiDataController/addSave',
|
method: 'post',
|
uploadfileurl: 'vciFileUploadController/uploadFile'
|
}, options.paramVOS)
|
options.paramVOS = paramVOS;
|
|
options.sourceData = options.sourceData || {};
|
options.dataStore = options.dataStore || [];
|
if (!options.dataStore || options.dataStore.length < 1) {
|
Vue.prototype.$message.error("请选择需要删除的数据");
|
return false;
|
}
|
if (!paramVOS.multi && options.dataStore.length > 1) {
|
Vue.prototype.$message.error("仅能选择一条数据来操作");
|
return false;
|
}
|
|
callPreEvent(options, doBefore,function (options) {
|
doAdd(options, function () {
|
callPostEvent(options,doAfter, options.callback);
|
});
|
});
|
};
|
|
/**
|
* 执行
|
* @param options 按钮的配置信息
|
* @param callback 回调
|
*/
|
export const doAdd = (options,callback)=> {
|
const paramVOS = options.paramVOS;
|
Vue.prototype.$message.success('执行'+paramVOS.title);
|
if(callback){
|
callback(options);
|
}
|
}
|
/**
|
* 前置事件
|
* @param options 按钮的配置信息
|
* @param callback 回调
|
*/
|
export const doBefore = (options,callback)=> {
|
Vue.prototype.$message.success('执行删除前置事件');
|
if(callback){
|
callback(options);
|
}
|
}
|
/**
|
* 后置事件
|
* @param options 按钮的配置信息
|
* @param callback 回调
|
*/
|
export const doAfter = (options,callback)=> {
|
Vue.prototype.$message.success('执行删除后置事件');
|
if(callback){
|
callback(options);
|
}
|
}
|