<style lang="scss">
    .preview{
        .el-form-item{
            margin-bottom:15px;
        }
        label,p{
            line-height: 25px !important;
        }
    }
</style>
<template>
    <section>
        <p><span>系统管理></span>系统日志</p>
        <div class="content">
            <div class="filter">
                <el-form size="small" label-width="70px" :inline="true"  label-position="left">
                    <el-form-item label="">
                            <el-input clearable placeholder="请输入操作人名称" v-model="form.op_user_realname"></el-input>
                    </el-form-item>
                    <el-form-item>
                        <el-button  type="primary" @click="search">搜索</el-button>
                    </el-form-item>
                    <el-form-item style="float:right" >
                        <el-button @click="dialogVisible=true,dialogTitle='新增角色'" type="primary">新增角色</el-button>
                    </el-form-item>
                </el-form>
            </div>
            <el-table
                    class="table"
                    :data="list" height="50vh"
                    border  v-loading="loading"
                    default-expand-all row-key="id"
                    style="width: 100%">
                    <el-table-column
                    prop="op_method"  width="300"
                    label="操作类型">
                    </el-table-column>
                    <el-table-column
                    prop="op_user_realname"  
                    label="操作人">
                    </el-table-column>
                    <el-table-column
                    prop="op_module"  
                    label="操作">
                    </el-table-column>
                    <el-table-column
                    prop="op_log_text"  
                    label="操作详情">
                    </el-table-column>
                    <el-table-column
                    prop="ctime"  
                    label="时间">
                    </el-table-column>

            </el-table>
            <Page  ref="pageButton" :current='form.page' :page_size='form.page_size' :total='total' @pageChange='gopage'/>
        </div>
    </section>
</template>
<script>
import Page from '../../components/Page';
export default {
  components:{
        Page
  },
  data(){
    return{
      form:{name:'',page:1,page_size:20},
      form1:{},
      total:1,
      list:[{name:'2333'}],
      loading:false,
      input:'',
      dialogVisible:false,
      dialogTitle:"",
      defaultProps:{},
      data: [],
      selected:[]
    }
  },
  methods:{
        gopage(size) {
            if (size) {
                this.form.page_size = size;
            }
            this.form.page = this.$refs.pageButton.page;
            this.getData();
        },
        search(){
            let parm = this.form
            this.getData()
        },
        getData(){
            var parm=this.form;        
            this.loading=true
            this.$api.getOplogList(parm).then(res=>{
                let list = res.data.data.list;
                this.list = list
                this.total = res.data.data.total
                this.loading = false
            })
        }
  },
  created(){
      this.getData()
  }
}
</script>
