import {Component, OnInit, ViewChild} from '@angular/core';
import {AjaxService} from '../../../../core/ajax/ajax.service';
import {BsModalService} from 'ngx-bootstrap';
import {MsgService} from '../../../../core/msg/msg.service';
import {FramePageComponent} from '../../core/FramePageComponent';
import {FarmeDictDetailComponent} from '../farme-dict-detail/farme-dict-detail.component';
import {PagerComponent} from '../../../../core/pager/pager.component';

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

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

  ngOnInit() {
  }

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

      }, { RequestWithLoading: true});
    });
  }


}
