SearchForm.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <div>
  3. <div class="table-page-search-wrapper">
  4. <a-form layout="inline">
  5. <a-row :gutter="48">
  6. <a-col :md="8" :sm="24">
  7. <a-form-item label="分类名称">
  8. <a-input v-model="queryParam.name" placeholder="请输入分类名称"/>
  9. </a-form-item>
  10. </a-col>
  11. <a-col :md="!advanced && 8 || 24" :sm="24">
  12. <span class="table-page-search-submitButtons" :style="advanced && { float: 'right', overflow: 'hidden' } || {} ">
  13. <a-button type="primary" @click="handlerSearch">查询</a-button>
  14. <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
  15. </span>
  16. </a-col>
  17. </a-row>
  18. </a-form>
  19. </div>
  20. </div>
  21. </template>
  22. <script>
  23. import moment from 'moment'
  24. export default {
  25. name: 'SearchForm',
  26. props: {
  27. },
  28. components: {
  29. },
  30. data () {
  31. return {
  32. // 高级搜索 展开/关闭
  33. advanced: false,
  34. // 查询参数
  35. queryParam: {}
  36. }
  37. },
  38. methods: {
  39. handlerSearch () {
  40. this.$emit('reloadData', this.queryParam)
  41. },
  42. toggleAdvanced () {
  43. this.advanced = !this.advanced
  44. },
  45. resetSearchForm () {
  46. this.queryParam = {
  47. createTime: moment(new Date())
  48. }
  49. }
  50. },
  51. mounted () {
  52. }
  53. }
  54. </script>
  55. <style scoped>
  56. </style>