import {Component} from '@angular/core';
import {IonicPage, LoadingController, NavController, NavParams} from 'ionic-angular';
import * as Mock from "mockjs";
import {MineService} from "../mine.service";

@Component({
    selector: 'page-operation',
    templateUrl: 'operation.html',
})
export class OperationPage {

    dbList = [];

    constructor(public navCtrl: NavController, public navParams: NavParams,
                private mine: MineService,private loadCtrl:LoadingController) {
    }

    ionViewDidLoad() {
        this.getList();
    }

    getList() {
        const load = this.loadCtrl.create();
        load.present();
        const data = {
            page: 1,
            limit: "1000",
            flag: 0
        };
        this.mine.dblog(data).subscribe(
            (res) => {
                load.dismiss();
                if (res.code == "0") {
                    this.dbList = res.page.list.log;
                }
            }
        )
    }

}
