<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 {
  props: {
    listLoading: Boolean
  },
  inject: ['parentData'],
  mixins,
  data() {
    return {
      searchData: []
    }
  },
  mounted () {
    this.getDef()
  },
  methods: {
    subwayLineChange (val) {
      this.getDef('change')
    },
    getDef (str) {
      let params = { ...this.$refs.ruleForm.baseForm }
      this.searchData = [
        { label: '标题', key: 'title' },
        { label: '所属楼盘', key: 'estate_id', type: 'selectRemote',
          remoteParams: { skey: 'estate_name', api: `house.admestatelist?estate_tag=二手`, opKey: 'estate_name', opVal: 'id' }
        },
        { label: '置业经理', key: 'sale_id', type: 'selectRemote',
          remoteParams: { skey: 'sale_name', api: `user.admsaleuserlist`, opKey: 'sale_name', opVal: 'id' }
        },
        { label: '所属区域', key: 'area_type', type: 'select', options: this.$dictData.area_type},
        { label: '楼盘类型', key: 'product_type', type: 'select', options: this.$dictData.product_type},
        { label: '房源户型', key: 'house_type', type: 'select', options: this.$dictData.house_type},
      ]
      this.setDefaultValue(params, 'searchData')
    },
    searchHandle() {
      const oldform = this.$refs.ruleForm.baseForm
      const newForm = { ...oldform }
      this.$emit('change', newForm)
    }
  }
}
</script>
