You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <a-drawer :width="500" title="搜索" placement="right" :open="openSearchModel" @close="onClose">
  3. <template #extra>
  4. <a-button style="margin-right: 8px" @click="clearSearch">清空搜索</a-button>
  5. <a-button type="primary" @click="getData">搜索</a-button>
  6. </template>
  7. <a-form :model="commomParams.search">
  8. <a-row :gutter="[10]">
  9. <a-col span="24">
  10. <a-form-item>
  11. <a-input addon-before="招聘会名称" v-model:value="commomParams.search.keyword"
  12. placeholder="请输入招聘会名称" @keyup.enter="getData"/>
  13. </a-form-item>
  14. </a-col>
  15. </a-row>
  16. </a-form>
  17. </a-drawer>
  18. </template>
  19. <script lang="ts" setup>
  20. import { ref, onMounted, watch, computed } from 'vue';
  21. import { useCommon } from '@/hooks/useCommon';
  22. let { store, commomParams, openSearchModel, hideSearch } = useCommon();
  23. let props = defineProps(['search_params']);
  24. const emit = defineEmits();
  25. openSearchModel = computed(() => {
  26. return store.state.openSearchModel;
  27. })
  28. // watch(() => props.search_params, (newVal) => {
  29. // emit('searchData', commomParams.value.search)
  30. // })
  31. const getData = () => {
  32. emit('searchData', commomParams.value.search);
  33. hideSearch()
  34. }
  35. // 清空搜索
  36. const clearSearch = () => {
  37. commomParams.value.search = {
  38. page: 1,
  39. pagesize: 10,
  40. sort: 'id',
  41. sortby: 'desc',
  42. keyword: ''
  43. }
  44. emit('clearData', commomParams.value.search);
  45. hideSearch()
  46. }
  47. const onClose = () => {
  48. clearSearch()
  49. hideSearch()
  50. }
  51. </script>
  52. <style>
  53. </style>