1
1
import Clickoutside from 'element-ui/lib/utils/clickoutside' ;
2
2
import { Vue , Prop , Component } from 'vue-property-decorator' ;
3
- import { Message , Dialog } from 'element-ui' ;
4
-
3
+ import { Message } from 'element-ui' ;
4
+ import C8Dialog from "@/components/c8-dialog/c8-dialog.vue" ;
5
+ import C8DialogComponent from "@/components/c8-dialog/c8-dialog.component" ;
6
+ import PlatformService from "@/services/platform.service" ;
5
7
@Component ( {
6
8
name : "platform-edit" ,
7
- directives : { Clickoutside }
9
+ directives : { Clickoutside } ,
10
+ components : { C8Dialog }
8
11
} )
9
12
export default class PlatformEditComponent extends Vue {
13
+ service : PlatformService = new PlatformService ( ) ;
10
14
form : any = { } ;
11
- private dialog :Dialog ;
12
- formLabelWidth :String = "100px" ;
13
- dialogTableVisible :boolean = false ;
14
- mounted ( ) {
15
+ private dialog : C8DialogComponent ;
16
+ formLabelWidth : String = "100px" ;
17
+ // dialogTableVisible:boolean=false;
18
+ mounted ( ) {
15
19
let win : any = this . $refs [ "dialog" ] ;
16
- this . dialog = win ;
20
+ this . dialog = win ;
17
21
}
18
22
show ( ) {
19
- // this.showBox = true ;
20
- this . dialogTableVisible = true ;
23
+ this . dialog . title = "平台新增" ;
24
+ this . dialog . show ( ) ;
21
25
}
22
26
close ( ) {
23
- this . dialogTableVisible = false ;
27
+ this . dialog . close ( ) ;
24
28
}
25
29
save ( num ) {
30
+ console . log ( this . form ) ;
26
31
if ( ! this . form . platformName ) {
27
32
Message ( {
28
33
showClose : true ,
@@ -39,6 +44,11 @@ export default class PlatformEditComponent extends Vue {
39
44
} ) ;
40
45
return ;
41
46
}
47
+ this . service . saveModel ( this . form ) . then ( r => {
48
+ if ( r . data . result ) {
49
+ this . close ( ) ;
50
+ }
51
+ } ) ;
42
52
}
43
53
}
44
54
0 commit comments