<template>
  <div class="table-wrap">
    <el-table :data="tableData" ref="tableRef" highlight-current-row size="mini" stripe border height="100%">
      <el-table-column type="index" label="序号" width="60"  show-overflow-tooltip>
      </el-table-column>
      <el-table-column v-for="(item, index) in colunms" :key="index"
            :prop="item.prop"
            :label="item.label"
            :fixed="item.fixed"
            :class-name="item.prop =='msg'?'align-left':'' "
            :show-overflow-tooltip="item.tooltip"
            :min-width="item.width"
            >
      </el-table-column>

    </el-table>
    <!-- 分页-->
    <ls-pagination :pager.sync="pager"  @query="doQuery"></ls-pagination>
  </div>
</template>

<script>
  export default {
    name: 'log-table',
    created() {
      this.doQuery();
    },
    mounted() {
    },
    methods: {
      // 查询数据
      doQuery () {
        var param = {
          currPage: this.pager.curPage,
          pageSize: this.pager.size,
          busSystem: 'cloud-crm-project',
          busId:this.busId
        };
        this.$ajax.post({
          domain: 'logUrl',
          url: 'getLogPageList',
          data: param,
          requestType: 'body',
          showLoad: false,
          success: function (res) {
            if (res.errorCode === 200) {
                 this.tableData = res.data.list || [];
                 this.pager.totals = res.data.totalCount || 0;
            }
          }.bind(this),
          error: function (res) {
            this.$message(res.body.msg || res.msg)
          }.bind(this)
        })
      },
      handleUpdate(row) {
      },
    },
    data() {
      return {

        //分页参数
        pager: {
          curPage: 1,
          size: 10,
          pageOptions: [10, 20, 30],
          totals: 0
        },

        tableData: [],
        //表格列
        colunms: [
           { prop: 'operType', label: '日志类型',   width: 100, fixed: false,  tooltip: true },
           { prop: 'createUser', label: '操作人',   width: 100, fixed: false,  tooltip: true },
           { prop: 'createDate', label: '操作时间',   width: 100, fixed: false,  tooltip: true },
           { prop: 'msg', label: '详情',   width: 350, fixed: false,  tooltip: false }]
      }
    },
    props:{
      busId: {
        type: String,
        default: '',
        required: true
      }
    }
  }
</script>

<style>
</style>
