/*
 *@description:查询
 *@author: hudw
 *@date: 2022-03-14 11:45:54
*/
<template>
  <a-page-header class="page-header" :title="$route.meta.title" :bordered="false" style="background-color: #fff; margin-bottom: 10px">
    <p-grid-form ref="gird" :span="6" selfUpdate :layout="$attrs.layout" style="font-weight: normal" :labelCol="{ span: 9 }" :wrapperCol="{ span: 14 }" @submit="submit" :items="mx_queryFromItems" />
    <a-space slot="extra">
      <p-button type="primary" icon="search" @clickSync="submit">查询</p-button>
      <p-button type="primary" @clickSync="mx_reset">重置</p-button>
    </a-space>
  </a-page-header>
</template>
<script>
export default {
  components: {
  },
  name: 'search-bar',
  props: {
    adQueryUrl: {
      type: String,
    },

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

    fromItems: {
      type: Array,
    },
  },
  data() {
    return {
      fieldOptions: null,
      mx_queryFromItems:this.fromItems
    }
  },
  mounted() {},
  computed: {

  },
  watch: {



  },
  methods: {

    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>


