/*
 *@description:查询
 *@author: hudw
 *@date: 2022-03-14 11:45:54
*/
<template>

<a-page-header class="page-header" :title="title" :bordered="false" style="background-color: #fff; margin-bottom: 10px">
    <a-space slot="extra">
      <p-button type="primary" icon="search" @clickSync="submit">查询</p-button>
      <p-button type="primary" @clickSync="mx_reset">重置</p-button>
      <!-- <p-button type="primary" @click="adQueryClick">高级查询</p-button> -->
    </a-space>
    <p-grid-form
    ref="gird"
    :span="6"
    style="font-weight:normal"
    :labelCol="{ span: 6 }"
    :wrapperCol="{ span: 16 }"
    @submit="submit"
    :items="mx_queryFromItems"
  />
  </a-page-header>


</template>
<script>
import { setQueryFormItmes } from './formConfig';

export default {
  components:{},
  props: {
    adQueryUrl: {
      type: String,
    },

    options: {
      //字典
      type: Object,
    },

    fromItems: {
      type: Array,
    },
    title: {
      type: String,
      default() {
        return this.$route.meta.title
      }
    }
  },


  data() {
    return {
      visible: false,
      mx_queryFromItems:this.fromItems?this.fromItems: setQueryFormItmes(this, this.count),
    }
  },
  mounted() {

  },
  methods: {
    searchSubmit() {
      this.mainId = ''
      this?.childrenTableClear?.()
      return this.$refs.mainTable.reload()
    },


    adQueryClick() {
      this.visible = true
    },
    getFieldsValue() {
      return this.$refs.gird.form.getFieldsValue()
    },
    mx_reset() {
      this.$refs.gird.form.resetFields()
    },
    submit(e) {
      e.preventDefault()
      let form = this.$refs.gird.form
      form.validateFields((error, value) => {
        if (error) return
        this.$emit('submit', value)
      })
    },
  },
};
</script>
<style lang="less">
  .page-header {
    .ant-page-header-heading-title {
      font-size: 16px;
    }
  }
  </style>