<template>
  <div class="app-container">
    <search-form
      :list-loading="listLoading"
      @change="searchHandle"
    />
    <table-list
      :list-loading="listLoading"
      :data="tableData2"
      :columns="listConfig"
      :current-page="currentPage"
      :page-size="pageSize"
      :total-records="totalRecords"
      @currentChange="pageHandle"
    />
  </div>
</template>
<script>
import { arrToObj } from '@/utils'
import SearchForm from './components/searchForm/AdminUapi'
import baseTable from '_m/baseTable.js'
import xData from './mixin'
export default {
  name: 'index',
  components: {
    SearchForm,
  },
  provide() {
    return {
      parentData: this
    }
  },
  mixins: [baseTable],
  data() {
    return {
      apiStr: 'base.admapiloglist',
      searchForm: null,
      isDtlShow: false,
      curObj: {},
      ...xData
    }
  },
  computed: {
    tableData2() {
      const arr = [...this.tableData]
      arr.map(item => {
        const cData = item.data ? JSON.parse(item.data) : {}
        console.log(cData)
      })
      return arr
    }
  },
  created() {},
  mounted() {
    this.listConfig = {
      rows: [
        { label: '昵称', prop: 'username' },
        { label: '接口', prop: 'url' },
        { label: '操作时间', prop: 'create_at' },
        { label: '操作IP', prop: 'remote_ip' },
      ]
    }
  },
  methods: {
  }
}
</script>
