import {Component, OnInit} from '@angular/core';
import {FrameAbstractComponent} from "../../../frame/FrameAbstractComponent";
import {FlexTableComponent} from "../../../../shared/common/FlexTable.component";
import {BsModalService} from "ngx-bootstrap/modal";
import {FormBuilder, Validators} from "@angular/forms";
import { AppComponent } from "../../../../app.component";

@Component({
  selector: 'app-sys-app-serve',
  templateUrl: './sys-app-serve.component.html',
  styleUrls: ['./sys-app-serve.component.scss']
})
export class SysAppServeComponent extends FlexTableComponent implements OnInit {
  public query = {
    query: "",
  };



  QUERY_URL = "sys/sysAppServe/page.htm";
  DELETE_URL = "sys/sysAppServe/delete.htm";
  GET_URL = "sys/sysAppServe/get.htm";
  ADD_URL = "sys/sysAppServe/add.htm";
  EDIT_URL = "sys/sysAppServe/edit.htm";

  constructor(public bsModalService: BsModalService, fb: FormBuilder) {
    super();
    this.formModel = fb.group({
      content: [null, Validators.compose([Validators.required])],
      title: [null, Validators.compose([Validators.required])],
      serve_order: [null, Validators.compose([Validators.required])],
      id: [null],
    });
  }

  ngOnInit() {
    
  }

  carouselContentFilter(str) {
    
    if(str){
        var carContent ='';
        if(str.length >= 40){
           
            carContent = str.substring(0,40) + '...';
        }
        else {
            carContent = str
        }
        return carContent;
    }else{
      return str;
    }
}

}

