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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import Vue from 'vue'
import uniqueId from 'lodash'
import AuthorityFilter from '../commands/AuthorityFilter'
import CreateNetworkPhysicsLinkDialog from '@/components/DialogComponents/NetworkPhysicsLinkDialog/CreateNetworkPhysicsLinkDialog.vue'
import DeleteNetworkPhysicsLinkDialog from '@/components/DialogComponents/NetworkPhysicsLinkDialog/DeleteNetworkPhysicsLinkDialog.vue'
import ImportNetworkPhysicsLinkDialog from '@/components/DialogComponents/NetworkPhysicsLinkDialog/ImportNetworkPhysicsLinkDialog.vue'
import UpdateNetworkPhysicsLinkDialog from '@/components/DialogComponents/NetworkPhysicsLinkDialog/UpdateNetworkPhysicsLinkDialog.vue'
Vue.component('CreateNetworkPhysicsLinkDialog',CreateNetworkPhysicsLinkDialog);
Vue.component('DeleteNetworkPhysicsLinkDialog',DeleteNetworkPhysicsLinkDialog);
Vue.component('ImportNetworkPhysicsLinkDialog',ImportNetworkPhysicsLinkDialog);
Vue.component('UpdateNetworkPhysicsLinkDialog',UpdateNetworkPhysicsLinkDialog);
//
let CommandTypes = {
CREATE_NETWORK_PHYSICS_LINK_CMD: {
type: 'CreateNetworkPhysicsLink',
executeComponent: 'CreateNetworkPhysicsLinkDialog',
registerComponent: CreateNetworkPhysicsLinkDialog
},
DELETE_NETWORK_PHYSICS_LINK_CMD: {
type: 'DeleteNetworkPhysicsLink',
executeComponent: 'DeleteNetworkPhysicsLinkDialog',
registerComponent: DeleteNetworkPhysicsLinkDialog
},
UPDATE_NETWORK_PHYSICS_LINK_CMD: {
type: 'UpdateNetworkPhysicsLink',
executeComponent: 'UpdateNetworkPhysicsLinkDialog',
registerComponent: UpdateNetworkPhysicsLinkDialog
},
IMPORT_NETWORK_PHYSICS_LINK_CMD: {
type: 'ImportNetworkPhysicsLink',
executeComponent: 'ImportNetworkPhysicsLinkDialog',
registerComponent: ImportNetworkPhysicsLinkDialog
},
};
class NetworkPhysicsCommands {
static createNetworkPhysicsCommand (title, netPhy, commandContext) {
let command = {
id: uniqueId(CommandTypes.CREATE_NETWORK_PHYSICS_LINK_CMD.type),
visible: true,
disabled: false,
target: netPhy,
title: title,
executeComponent: CommandTypes.CREATE_NETWORK_PHYSICS_LINK_CMD.executeComponent,
execute: undefined,
done: undefined,
};
command.execute = function () {
Vue.set(commandContext, command.id, command);
};
command.done = function () {
Vue.delete(commandContext, command.id)
};
return AuthorityFilter.networkPhysicsAuthorityFilter(command)
}
static deleteNetworkPhysicsCommand (netPhy, commandContext) {
let command = {
id: uniqueId(CommandTypes.DELETE_NETWORK_PHYSICS_LINK_CMD.type),
visible: true,
disabled: false,
target: netPhy,
executeComponent: CommandTypes.DELETE_NETWORK_PHYSICS_LINK_CMD.executeComponent,
execute: undefined,
done: undefined,
};
command.execute = function () {
Vue.set(commandContext, command.id, command);
};
command.done = function () {
Vue.delete(commandContext, command.id)
};
return AuthorityFilter.networkPhysicsAuthorityFilter(command)
}
static updateNetworkPhysicsCommand (netPhy, commandContext) {
let command = {
id: uniqueId(CommandTypes.UPDATE_NETWORK_PHYSICS_LINK_CMD.type),
visible: true,
disabled: false,
target: netPhy,
executeComponent: CommandTypes.UPDATE_NETWORK_PHYSICS_LINK_CMD.executeComponent,
execute: undefined,
done: undefined,
};
command.execute = function () {
Vue.set(commandContext, command.id, command);
};
command.done = function () {
Vue.delete(commandContext, command.id)
};
return AuthorityFilter.networkPhysicsAuthorityFilter(command)
}
static importNetworkPhysicsCommand (commandContext) {
let command = {
id: uniqueId(CommandTypes.IMPORT_NETWORK_PHYSICS_LINK_CMD.type),
visible: true,
disabled: false,
target: null,
executeComponent: CommandTypes.IMPORT_NETWORK_PHYSICS_LINK_CMD.executeComponent,
execute: undefined,
done: undefined,
}
command.execute = function () {
Vue.set(commandContext, command.id, command);
}
command.done = function () {
Vue.delete(commandContext, command.id)
}
return AuthorityFilter.networkPhysicsAuthorityFilter(command)
}
}
NetworkPhysicsCommands.CommandTypes = CommandTypes;
export default NetworkPhysicsCommands