<template>
  <el-container class="th-search">
    <el-header height="auto">
      <el-scrollbar>
        <th-form
          v-bind="form"
          :is-search="true"
          :options="formOptions"
          @handleSubmit="handleSubmit"
        />
      </el-scrollbar>
    </el-header>
    <el-main>
      <th-table
        v-bind="list"
        v-on="$listeners"
      />
    </el-main>
  </el-container>
</template>
<script>
import ThForm from '../../form/src/form'
import ThTable from '../../table/src/main'

export default {
  name: 'ThSearch',
  components: {
    ThForm,
    ThTable
  },
  props: {
    // 表单属性
    form: {
      type: Object,
      default: () => ({})
    },
    // 表格属性
    list: {
      type: Object,
      default: () => ({})
    },
    formOptions: {
      type: Object,
      default: () => ({})
    }
  },
  methods: {
    // 提交按钮
    handleSubmit(data, btn) {
      this.$emit('handleSubmit', data, btn)
    }
  }
}

</script>
