import React, { Component, Fragment } from 'react'
import {
	Page, Validator, Notification, FormItem,
	InputItem, Input, Bind, SelectItem, Button, Label, DatePickerItem, Section, Table, TextArea, ConfirmButton, Steps
} from '@/components/Common-Library'
import Api from '@/service/api'
import mLoginf from '../model'
import CodeTableFactory from '@/components/CodeTable'

import "./index.less"
import { inject, observer } from 'mobx-react'
import { action, observable, runInAction } from 'mobx'


import Xtycck from './Xtycck'
import Czjl from './Czjl'


import { Card } from 'antd'


const CodeTable = CodeTableFactory.getInstance()
const StepItem = Steps.Item

@inject('UserContext')
@inject('i18n')
@observer
export default class LoginfScreen extends Page {
	@observable
	formBlur = false

	@observable
	extra = { inifrm: 'loginf' }



	constructor(props) {
		super(props)
		// this.state = {
		// 	flag: true
		// }
		this.model = new mLoginf()
	}
	//交易初始化
	async componentWillMount() {
		const rtnmsg = await Api.post('loginf/init',{data:this.model})
		if (rtnmsg.retcod == SUCCESS) {	
			const {data} = rtnmsg
          
			Object.assign(this.model,data)
		}
		//快照模式下，不必开启校验，否则，静默校验，和记录变动
		!this.loadDisplay() && this.model.openMonitor() //开启校验	
	}

	componentWillUnmount() {
		this.model.stopMonitor&&this.model.stopMonitor()//关闭校验
  }
  
	//交易内实现
	renderPage() {
		return (
			<Card title="系统日志" size="small" className="transTitle">
				<Steps>
				

					
					<StepItem title="操作记录查看">
						<Czjl model={this.model} extra={this.extra} />
					</StepItem>
					<StepItem title="系统异常查看">
						<Xtycck model={this.model} extra={this.extra} />
					</StepItem>

				

				</Steps>
			</Card>
		)
	
	}
}
