index.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <Dialog
  3. :show="true"
  4. :isH5="!isPC"
  5. :isHeaderShow="false"
  6. :isFooterShow="false"
  7. :background="false"
  8. @update:show="reset"
  9. >
  10. <Transfer
  11. :isSearch="props.isNeedSearch"
  12. :title="props.title"
  13. :list="props.userList"
  14. :isH5="!isPC"
  15. :isRadio="props.isRadio"
  16. :total="props.total"
  17. @getMore="handleGetMore"
  18. @search="handleSearchUser"
  19. @submit="submit"
  20. @cancel="reset"
  21. />
  22. </Dialog>
  23. </template>
  24. <script lang="ts" setup>
  25. import { isPC } from '../../../utils/env';
  26. import Dialog from '../Dialog/index.vue';
  27. import Transfer from '../Transfer/index.vue';
  28. const emits = defineEmits(['complete', 'search', 'getMore']);
  29. const props = defineProps({
  30. isRadio: {
  31. type: Boolean,
  32. default: false,
  33. },
  34. isNeedSearch: {
  35. type: Boolean,
  36. default: false,
  37. },
  38. title: {
  39. type: String,
  40. default: '',
  41. },
  42. userList: {
  43. type: Array,
  44. default: () => ([]),
  45. },
  46. total: {
  47. type: Number,
  48. default: 0,
  49. },
  50. });
  51. const reset = () => {
  52. emits('complete', []);
  53. };
  54. const submit = (dataList: any) => {
  55. emits('complete', dataList);
  56. };
  57. const handleSearchUser = (userID: string) => {
  58. emits('search', userID);
  59. };
  60. const handleGetMore = () => {
  61. emits('getMore');
  62. };
  63. </script>