<!--
 * @Author: your name
 * @Date: 2022-01-06 13:37:14
 * @LastEditTime: 2022-01-06 16:37:43
 * @LastEditors: Please set LastEditors
 * @Description: 汇总数据 - 个体数据页面
 * @FilePath: \goldenPig\src\views\SummaryData\IndividualData.vue
-->
<template>
  <div class="individual-data">
    <search-cpn v-bind="searchConfig" @handleSearch="handleSearchEvent">
      <!-- 耳根温度 -->
      <template #earTemp="scope">
        <el-input
          v-model="searchForm2[scope.item.field1]"
          style="width: calc(50% - 16px)"
        ></el-input>
        &nbsp;—&nbsp;
        <el-input
          v-model="searchForm2[scope.item.field2]"
          style="width: calc(50% - 16px)"
        ></el-input>
      </template>

      <!-- 环境温度 -->
      <template #envTemp="scope">
        <el-input
          v-model="searchForm2[scope.item.field1]"
          style="width: calc(50% - 16px)"
        ></el-input>
        &nbsp;—&nbsp;
        <el-input
          v-model="searchForm2[scope.item.field2]"
          style="width: calc(50% - 16px)"
        ></el-input>
      </template>

      <!-- 信号强度 -->
      <template #signal="scope">
        <el-input
          v-model="searchForm2[scope.item.field1]"
          style="width: calc(50% - 16px)"
        ></el-input>
        &nbsp;—&nbsp;
        <el-input
          v-model="searchForm2[scope.item.field2]"
          style="width: calc(50% - 16px)"
        ></el-input>
      </template>
    </search-cpn>
  </div>
</template>
<script>
// 搜索
import SearchCpn from "@/components/search-cpn";
import { formItemProp } from "./config/search.config";
export default {
  components: {
    SearchCpn,
  },
  data() {
    return {
      searchConfig: {},
      searchForm1: {
        farmId: "",
        date: [],
        eartag: "",
        deviceCode: "",
      },
      searchForm2: {
        earTemp1: "",
        earTemp2: "",
        envTemp1: "",
        envTemp2: "",
        signal1: "",
        signal2: "",
      },
    };
  },
  created() {
    this.searchConfig = { formItemProp, searchForm: this.searchForm1 };
  },
  methods: {
    handleSearchEvent(params) {
      console.log("点击了查询按钮，获得的参数", {
        ...params,
        ...this.searchForm2,
      });
    },
  },
};
</script>
<style scoped></style>
