<!--
鉴权行为统计
@Author: linqian
@Date: 2021-05-28 08:51
-->
<template>
  <div>
    <!-- 搜索项 -->
    <search-bar ref="searchbar" :conditionForm="conditionForm" @submitSearch="receiveSearch"></search-bar>
    <!-- 表格 -->
    <new-table
      ref="table"
      :tableUrl="authServiceLogStatisticsTableUrl"
      :tableHeader="tableHeader"
      :condition="condition"
      :lazyLoad="true"
    >
    </new-table>
  </div>
</template>

<script>
import newTable from '@/components/new-table';
import { authServiceLogStatisticsTableUrl } from '@/api/permiss-log-manage';
import searchBar from '@/components/search-bar';
import { searchOpt } from '@/mixins/page-opt';
export default {
  components: {
    newTable,
    searchBar
  },
  mixins: [searchOpt],
  data() {
    return {
      authServiceLogStatisticsTableUrl,
      tableHeader: [
        {
          label: '鉴权类型',
          prop: 'type',
          enum: 'AuthenticationTypeEnum'
        },
        {
          label: '鉴权成功次数',
          prop: 'susSize'
        },
        {
          label: '鉴权失败次数',
          prop: 'failSize'
        },
        {
          label: '鉴权总次数',
          prop: 'totalSize'
        }
      ],
      conditionForm: [
        {
          label: '鉴权时间',
          name: 'createTime',
          op: 'between',
          type: 'DATE',
          value: '',
          valueFormat: 'yyyyMMddHHmmss',
          component: 'DgDatePicker',
          clearable: false
        }
      ]
    };
  },
  computed: {},
  methods: {},
  created() {
    const startTime = this.$moment().subtract('1', 'year').format('YYYYMMDD') + '000000';
    const endTime = this.$moment().format('YYYYMMDD') + '235959';
    this.conditionForm[0].value = [startTime, endTime];
  },
  mounted() {
    this.$nextTick(() => {
      this.$refs.searchbar.handleSearch();
    });
  }
};
</script>

<style lang='scss'>
</style>