<!--
 * @Author: wally
 * @email: 18603454788@163.com
 * @Date: 2021-03-18 16:05:24
 * @LastEditors: wally
 * @LastEditTime: 2021-03-24 18:33:27
-->
<template>
  <div class="search-list">
    <span>发榜单位：</span> <a-input style="width: 20%" v-model="getParam.companyName" /> <span>发榜项目：</span>
    <a-input style="width: 20%" v-model="getParam.address" />
    <span class="ml-2">截止时间：</span> <a-range-picker format="YYYY-MM-DD HH:mm:ss" @change="onChange" show-time allow-clear />
    <!-- <span>所属领域：</span>
    <a-input style="width: 20%" v-model="getParam.serviccs" /> -->
    <a-button class="search-btn" type="primary" @click="submit">搜索</a-button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      getParam: {
        companyName: '',
        address: '',
        dataTitle: '',
        serviccs: '',
        startTime: '',
        endTime: '',
      },
    };
  },
  methods: {
    submit() {
      this.$emit('getData', this.getParam);
    },
    onChange(e) {
      if (e.length > 0) {
        this.getParam.startTime = this.$moment(e[0]._d).format('YYYY-MM-DD HH:mm:ss');
        this.getParam.endTime = this.$moment(e[1]._d).format('YYYY-MM-DD HH:mm:ss');
      } else {
        this.getParam.startTime = '';
        this.getParam.endTime = '';
      }
    },
  },
};
</script>

<style lang="stylus" scoped>
.search-list {
  position: relative;
  height: 80px;
  line-height: 80px;
  background: #fff;
  box-shadow: 0 0 10px #ccc;
  border-radius: 4px;
  padding: 0 24px;
  position: relative;
  margin-bottom: 10px;
}

.search-btn {
  position: absolute;
  right: 4px;
  height: 34px;
  top: 24px;
  width: 116.5px;
}
</style>
