@@ -6,84 +6,99 @@ import {
6
6
Mutation
7
7
} from "vuex-module-decorators" ;
8
8
import { Vue } from "vue-property-decorator" ;
9
- import store from ' @/store' ;
10
- import { objInstance } from ' ../types' ;
9
+ import store from " @/store" ;
10
+ import { objInstance } from " ../types" ;
11
11
12
12
export interface IDrawing {
13
13
listNodes : Array < objInstance > ;
14
14
listLines : Array < objInstance > ;
15
+ isShowPopupDetail : boolean ;
15
16
}
16
17
17
- @Module ( { dynamic : true , store, name : ' Drawing' } ) ;
18
+ @Module ( { dynamic : true , store, name : " Drawing" } )
18
19
class Drawing extends VuexModule implements IDrawing {
19
20
public listNodes : Array < objInstance > = [ ] ;
20
21
public listLines : Array < objInstance > = [ ] ;
22
+ public isShowPopupDetail : boolean = false ;
21
23
public vm = new Vue ( ) ;
22
24
23
25
@Mutation
24
- setListNodes ( payload : Array < objInstance > ) {
26
+ private setListNodes ( payload : Array < objInstance > ) {
25
27
this . listNodes = payload ;
26
28
}
27
29
28
30
@Mutation
29
- setListLines ( payload : Array < objInstance > ) {
31
+ private setListLines ( payload : Array < objInstance > ) {
30
32
this . listLines = payload ;
31
33
}
32
34
33
- @Action ( { rawError : true } )
35
+ @Mutation
36
+ private setIsShowPopupDetail ( payload : boolean ) {
37
+ this . isShowPopupDetail = payload ;
38
+ }
39
+
40
+ @Action ( { rawError : true } )
34
41
GET_LIST_NODES ( payload : objInstance ) {
35
- this . vm . $post ( "Draw/ViewAllNode" , JSON . stringify ( payload ) ) . then ( ( res : any ) => {
36
- this . context . commit ( "setListNodes" , res ) ;
37
- } )
42
+ this . vm
43
+ . $post ( "Draw/ViewAllNode" , JSON . stringify ( payload ) )
44
+ . then ( ( res : any ) => {
45
+ this . context . commit ( "setListNodes" , res ) ;
46
+ } ) ;
38
47
}
39
48
40
- @Action ( { rawError : true } )
49
+ @Action ( { rawError : true } )
41
50
ADD_NODE ( payload : objInstance ) {
42
51
return this . vm . $post ( "Draw/AddNode" , JSON . stringify ( payload ) ) ;
43
52
}
44
53
45
- @Action ( { rawError : true } )
54
+ @Action ( { rawError : true } )
46
55
REMOVE_NODE ( payload : objInstance ) {
47
56
return this . vm . $post ( "Draw/RemoveNode" , JSON . stringify ( payload ) ) ;
48
57
}
49
58
50
- @Action ( { rawError : true } )
59
+ @Action ( { rawError : true } )
51
60
DETAIL_NODE ( payload : objInstance ) {
52
61
return this . vm . $post ( "Draw/ViewNode" , JSON . stringify ( payload ) ) ;
53
62
}
54
63
55
- @Action ( { rawError : true } )
64
+ @Action ( { rawError : true } )
56
65
UPDATE_NODE ( payload : objInstance ) {
57
66
return this . vm . $post ( "Draw/EditNode" , JSON . stringify ( payload ) ) ;
58
67
}
59
68
60
- @Action ( { rawError : true } )
69
+ @Action ( { rawError : true } )
61
70
GET_LIST_LINES ( payload : objInstance ) {
62
- this . vm . $post ( "Draw/ViewAllLine" , JSON . stringify ( payload ) ) . then ( ( res : any ) => {
63
- this . context . commit ( "setListLines" , res ) ;
64
- } )
71
+ this . vm
72
+ . $post ( "Draw/ViewAllLine" , JSON . stringify ( payload ) )
73
+ . then ( ( res : any ) => {
74
+ this . context . commit ( "setListLines" , res ) ;
75
+ } ) ;
65
76
}
66
77
67
- @Action ( { rawError : true } )
78
+ @Action ( { rawError : true } )
68
79
ADD_LINE ( payload : objInstance ) {
69
80
return this . vm . $post ( "Draw/AddLine" , JSON . stringify ( payload ) ) ;
70
81
}
71
82
72
- @Action ( { rawError : true } )
83
+ @Action ( { rawError : true } )
73
84
REMOVE_LINE ( payload : objInstance ) {
74
85
return this . vm . $post ( "Draw/RemoveLine" , JSON . stringify ( payload ) ) ;
75
86
}
76
87
77
- @Action ( { rawError : true } )
88
+ @Action ( { rawError : true } )
78
89
DETAIL_LINE ( payload : objInstance ) {
79
90
return this . vm . $post ( "/Draw/ViewLine" , JSON . stringify ( payload ) ) ;
80
91
}
81
92
82
- @Action ( { rawError : true } )
93
+ @Action ( { rawError : true } )
83
94
UPDATE_LINE ( payload : objInstance ) {
84
95
return this . vm . $post ( "Draw/EditLine" , JSON . stringify ( payload ) ) ;
85
96
}
86
- }
87
97
98
+ @Action
99
+ SET_IS_SHOW_POPUP_DETAIL ( payload : boolean ) {
100
+ this . context . commit ( "setIsShowPopupDetail" , payload ) ;
101
+ }
102
+ }
88
103
89
104
export const DrawingModule = getModule ( Drawing ) ;
0 commit comments