<template>
  <div class="fullheight">
    <ht-table
      @load="loadData"
      :data="data"
      :pageResult="pageResult"
      :quick-search-props="seacrh"
      :default-sorter="[{direction: 'DESC',property: 'create_Time_'}]"
      ref="htTable"
      :default-querys="[{'property': 'type', 'value': 0}]"
      :show-export="false"
      :show-custom-column="false"
      @row-click="rowClick"
    >
      <template v-slot:toolbar>
      </template>

      <template>
        <ht-table-column type="index" width="50" align="center" label="序号" />
        <ht-table-column prop="clientIp" label="登录IP" :sortable="true" width="140" />
        <!-- <ht-table-column prop="timestamp" label="操作时间" width="130">
          <template v-slot="{row}">
            <span>{{ formatTime(row.timestamp) }}</span>
          </template>
        </ht-table-column> -->
        <ht-table-column prop="createTime" label="操作时间" width="150" />
        <ht-table-column prop="operate" label="操作" width="120" :show-overflow-tooltip="true"/>
        <ht-table-column prop="javaMethod" label="请求java方法" width="120" :show-overflow-tooltip="true" />
        <ht-table-column prop="costTime" label="耗时" width="70" />
        <ht-table-column prop="params" label="请求参数" :show-overflow-tooltip="true" />
      </template>
    </ht-table>
  </div>
</template>
<script>
import uc from '@/api/uc.js'
import moment from 'moment' //日期格式化插件
export default {
  components: {},
  data() {
    return {
      data: [],
      seacrh: [{label: '登录IP', prop: 'client_Ip'}],
      pageResult: {
        page: 1,
        pageSize: 10,
        showTotal: true,
      },
    }
  },
  computed: {
  },
  methods: {
    //   格式化时间
    formatTime(time) {
      return moment(time).format('YYYY-MM-DD HH:mm:ss')
    },
    rowClick(row, column, event) {
      this.$refs.htTable.$refs.htTable.toggleRowSelection(row)
    },
     loadData(param, cb) {
      uc
        .AdministratorLog(param)
        .then(response => {
          this.data = response.rows;
          this.pageResult = {
            page: response.page,
            pageSize: response.pageSize,
            total: response.total
          };
         
        })
        .finally(() => cb());
    },
   
   
  },
}
</script>

<style lang="scss" scoped>
@import '@/assets/css/element-variables.scss';

.aside-width {
  width: $--aside-width !important;
}
</style>
