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
| //预置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);
| })},
| };
| if (handlers[type]) {
| handlers[type]()
| } else {
| Vue.prototype.$message.error('未找到对应action,请重新配置按钮!');
| }
| };
|
|