田源
2024-07-18 e977b8737d88aa1bd0286fe27bf4fd22cb2501d9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//预置action
import Vue from "vue";
 
export const handlerAction=function (type,options, callback) {
  const handlers = {
    //查看
    view: () => {import("@/components/actions/base/ViewAction").then(module => {
      module.doAction(options,callback);
    })},
    //创建
    add: () => {import("@/components/actions/base/AddAction").then(module => {
      module.doAction(options,callback);
    })},
    //修改
    edit: () =>  {import("@/components/actions/base/EditAction").then(module => {
      module.doAction(options,callback);
    })},
    //删除
    delete: () =>  {import("@/components/actions/base/DeleteAction").then(module => {
      module.doAction(options,callback);
    })},
    //删除
    del: () =>  {import("@/components/actions/base/DeleteAction").then(module => {
      module.doAction(options,callback);
    })},
    //升版
    rev: () =>  {import("@/components/actions/base/RevisionAction").then(module => {
      module.doAction(options,callback);
    })},
    //启动流程
    startwork: () => {import("@/components/actions/base/StartWorkflowAction").then(module => {
      module.doAction(options,callback);
    })},
    //上传文件
    uploadfile: () => {import("@/components/actions/base/uploadFileAction").then(module => {
      module.doAction(options,callback);
    })},
    //下载文件
    downloadfile: () => {import("@/components/actions/base/downloadFileAction").then(module => {
      module.doAction(options,callback);
    })},
    uprevision: () => {import("@/components/actions/base/upRevisionAction").then(module => {
      module.doAction(options,callback);
    })}
  };
  if (handlers[type]) {
    handlers[type]();
  } else {
    Vue.prototype.$message.error('未找到对应action,请重新配置按钮!');
  }
};