import { Component, OnInit } from '@angular/core';
import {BsModalService} from 'ngx-bootstrap';
import {FrameRoleResComponent} from '../../role/frame-role-res/frame-role-res.component';
import {FrameRoleDetailComponent} from '../../role/frame-role-detail/frame-role-detail.component';
import {FramePageComponent} from '../../core/FramePageComponent';
import {FarmeParamDetailComponent} from '../farme-param-detail/farme-param-detail.component';
import {AjaxService} from '../../../../core/ajax/ajax.service';
import {MsgService} from '../../../../core/msg/msg.service';

@Component({
  selector: 'app-frame-param-page',
  templateUrl: './frame-param-page.component.html',
  styleUrls: ['./frame-param-page.component.scss']
})
export class FrameParamPageComponent  extends FramePageComponent implements OnInit {

  constructor(private modalService: BsModalService) {
    super(modalService);
    this.modalComponent = FarmeParamDetailComponent;
  }

  ngOnInit() {
  }

  reloadParam() {
    MsgService.confirm(`确定要重新加载系统参数吗？如果参数较多，该操作可能需要比较长的时间，请谨慎使用该功能!`, () => {
      AjaxService.request('frame/param/reload.htm', {}, () => {
        MsgService.successAlert(`参数加载成功，后台参数已经生效，前端参数需重新登录！`);
      }, { RequestWithLoading: true});
    });
  }


}
