<template>
  <div id="admin-data">
    <el-row>
      <el-col :span="24" class="main">
        <el-col :span="24" class="one">
          <el-col :span="24" class="one_1"> 主要管理人员信息查询 </el-col>
          <el-col :span="24" class="one_2">
            <el-form ref="searchFrom" :model="searchFrom" label-width="140px">
              <el-col :span="24" class="one_2txt">
                <el-col :span="8">
                  <el-form-item label="姓名">
                    <el-input v-model="searchFrom.name"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="公民身份号码">
                    <el-input v-model="searchFrom.card"></el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="性别">
                    <el-select v-model="searchFrom.gender" clearable placeholder="请选择">
                      <el-option label="男" value="男"> </el-option>
                      <el-option label="女" value="女"> </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
              </el-col>
              <el-col :span="24" class="one_2txt">
                <el-col :span="16">
                  <el-form-item label="出生日期">
                    <el-date-picker v-model="searchFrom.birth" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
                    </el-date-picker>
                  </el-form-item>
                </el-col>
                <el-col :span="8" class="btn">
                  <el-button type="primary" size="mini" @click="search">查询</el-button>
                </el-col>
              </el-col>
            </el-form>
          </el-col>
        </el-col>
        <el-col :span="24" class="two">
          <data-table :fields="fields" :opera="opera" :data="list" :total="total" @view="toView"> </data-table>
        </el-col>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'admin-data',
  props: {},
  components: {},
  data: function () {
    return {
      // 查询
      searchFrom: {},
      // 列表
      fields: [
        { label: '姓名', model: 'name' },
        { label: '公民身份号码', model: 'card' },
        { label: '性别', model: 'gender' },
        { label: '出生日期', model: 'birth' },
        { label: '学历', model: 'education' },
        { label: '联系电话', model: 'phone' },
      ],
      opera: [{ label: '详情', method: 'view' }],
      list: [{ id: '1', company_name: '2' }],
      total: 0,
    };
  },
  created() {},
  methods: {
    async search() {
      console.log(this.searchFrom);
    },
    // 详情
    toView({ data }) {},
  },
  computed: {
    ...mapState(['user']),
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
  watch: {
    test: {
      deep: true,
      immediate: true,
      handler(val) {},
    },
  },
};
</script>

<style lang="less" scoped>
.main {
  .one {
    .one_1 {
      height: 40px;
      line-height: 40px;
      border-bottom: 1px solid #ccc;
      margin: 0 0 10px 0;
      font-size: 18px;
      font-weight: bold;
    }
    .one_2 {
      .one_2txt {
        border: 1px solid #ccc;
        /deep/.el-form-item {
          margin: 0;
        }
        /deep/.el-date-editor.el-input,
        .el-date-editor.el-input__inner {
          width: 100%;
        }
        /deep/.el-select {
          width: 100%;
        }
        .btn {
          text-align: right;
          padding: 5px 5px;
        }
      }
    }
  }
}
</style>
