<!-- 搜索表单 -->
<template>
  <seekPage :seekList="seekList" :formLength="3" @search="search"></seekPage>
</template>
<script>
export default {
  data() {
    return {};
  },
  props: {
    levelList: {
      type: Array,
      default: () => []
    }
  },
  computed: {
    // 表格列配置
    seekList() {
      return [
        {
          label: '关键字：',
          value: 'searchName',
          type: 'input',
          placeholder: '单号/客户名称/设备名称'
        },
        {
          label: '工单编号:',
          value: 'code',
          type: 'input',
          placeholder: ''
        },
        {
          label: '客户名称:',
          value: 'contactName',
          type: 'input',
          placeholder: ''
        },
        {
          label: '设备名称:',
          value: 'deviceName',
          width: 380,
          type: 'input',
          placeholder: ''
        },
        {
          label: '故障等级:',
          value: 'faultLevel',
          width: 380,
          type: 'select',
          planList: this.levelList,
          placeholder: ''
        }, 
        {
          label: '计划单号:',
          value: 'planCode',
          width: 380,
          type: 'select',
          planList: this.levelList,
          placeholder: ''
        },
        {
          label: '计划名称:',
          value: 'planName',
          width: 380,
          type: 'select',
          planList: this.levelList,
          placeholder: ''
        },
        {
          label: '报工人:',
          value: 'executeUserName',
          width: 380,
          type: 'select',
          planList: this.levelList,
          placeholder: ''
        },
        {
          label: '验收人:',
          value: 'accepterUserName',
          width: 380,
          type: 'select',
          planList: this.levelList,
          placeholder: ''
        }
      ];
    }
  },
  methods: {
    /* 搜索 */
    search(e) {
      this.$emit('search', {
        ...e
      });
    }
  }
};
</script>
