page-search.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <!-- 搜索表单 -->
  2. <template>
  3. <ele-card :body-style="{ paddingBottom: '8px' }">
  4. <ProSearch
  5. :items="formItems"
  6. ref="searchRef"
  7. @search="search"
  8. :initKeys="initKeys"
  9. :offset="1"
  10. ></ProSearch>
  11. </ele-card>
  12. </template>
  13. <script setup>
  14. import { reactive, ref, defineEmits } from 'vue';
  15. import ProSearch from '@/components/CommonPage/ProSearch2.vue';
  16. let { proxy } = getCurrentInstance();
  17. const emit = defineEmits(['search']);
  18. const godownList = ref([]);
  19. const formItems = computed(() => {
  20. return [
  21. {
  22. type: 'input',
  23. label: '审核员',
  24. prop: 'sysUserName'
  25. },
  26. {
  27. type: 'daterange',
  28. label: ' ',
  29. prop: 'time',
  30. props: {
  31. format: 'YYYY-MM-DD',
  32. valueFormat: 'YYYY-MM-DD',
  33. onChange: (value) => {
  34. initKeys.startDate = value ? value[0] : '';
  35. initKeys.endDate = value ? value[1] : '';
  36. searchRef.value?.setData(initKeys);
  37. }
  38. },
  39. colProps: {
  40. span: 6
  41. }
  42. }
  43. ];
  44. });
  45. const initKeys = reactive({
  46. startDate: '',
  47. endDate: '',
  48. sysUserName: ''
  49. });
  50. const searchRef = ref(null);
  51. /** 搜索 */
  52. const search = (data) => {
  53. emit('search', { ...data});
  54. };
  55. </script>