11import Clickoutside from 'element-ui/lib/utils/clickoutside' ;
22import { 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" ;
57@Component ( {
68 name : "platform-edit" ,
7- directives : { Clickoutside }
9+ directives : { Clickoutside } ,
10+ components : { C8Dialog }
811} )
912export default class PlatformEditComponent extends Vue {
13+ service : PlatformService = new PlatformService ( ) ;
1014 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 ( ) {
1519 let win : any = this . $refs [ "dialog" ] ;
16- this . dialog = win ;
20+ this . dialog = win ;
1721 }
1822 show ( ) {
19- // this.showBox = true ;
20- this . dialogTableVisible = true ;
23+ this . dialog . title = "平台新增" ;
24+ this . dialog . show ( ) ;
2125 }
2226 close ( ) {
23- this . dialogTableVisible = false ;
27+ this . dialog . close ( ) ;
2428 }
2529 save ( num ) {
30+ console . log ( this . form ) ;
2631 if ( ! this . form . platformName ) {
2732 Message ( {
2833 showClose : true ,
@@ -39,6 +44,11 @@ export default class PlatformEditComponent extends Vue {
3944 } ) ;
4045 return ;
4146 }
47+ this . service . saveModel ( this . form ) . then ( r => {
48+ if ( r . data . result ) {
49+ this . close ( ) ;
50+ }
51+ } ) ;
4252 }
4353}
4454
0 commit comments