import {Component, OnInit} from '@angular/core';
import {FramePageComponent} from "../../core/page/frame.page";
import {BsModalService} from "ngx-bootstrap/modal";
import {FrameParamDetailComponent} from "../frame-param-detail/frame-param-detail.component";
import {MsgService} from "../../../../core/service/msg.service";
import {AjaxService} from "../../../../core/service/ajax.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 = FrameParamDetailComponent;
  }

  ngOnInit() {
  }

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


}
