<template>
  <base-form slot="content" ref="ruleForm" :data="searchData">
    <div slot="footer">
      <el-button :loading="listLoading" icon="el-icon-search" class="xl-form-btn bgc1" @click="searchHandle">查询</el-button>
      <!-- <el-button :loading="listLoading" icon="el-icon-document" class="xl-form-btn bgc2" @click="toExportExcel">导出{{ this.$route.meta.title }}信息</el-button> -->
    </div>
  </base-form>
</template>
<script>
export default {
  mixins: [],
  props: {
    listLoading: Boolean
  },
  inject: ['parentData'],
  data() {
    return {
      searchData: [
        { label: '点击路径', key: 'path', type: 'select', filterable: true, class: 'c-3', options: this.$dictData.app_pages, defaultValue: '/pagesHouse/indexDtl' },
        { label: '手机号', key: 'phone' },
        { label: '昵称', key: 'nickname' },
        { label: '登录日期', label2: '开始时间', label3: '结束时间', key: 'startEndTime', type: 'datePicker', rules: 1},
        { label: '完整IP', key: 'remote_ip' },
      ]
    }
  },
  methods: {
    searchHandle() {
      const oldform = this.$refs.ruleForm.baseForm
      const newForm = { ...oldform }
      if (newForm.startEndTime) {
        newForm.start_at = newForm.startEndTime[0]
        newForm.end_at = newForm.startEndTime[1]
        delete newForm.startEndTime
      }
      this.$emit('change', newForm)
    }
  }
}
</script>
