selectPeople.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <a-modal
  3. v-model:visible="modeVisible"
  4. class="custom-class"
  5. title="选择人员"
  6. placement="right"
  7. width="1000px"
  8. :closable="false"
  9. @close="visible=false"
  10. @ok="submit">
  11. <normalTable rowKey="userid" ref="list" size="small" :param="param" :columns="utils.TBLayout('staffTable')" @onSelect="onSelect">
  12. <template #tb_cell="{data}">
  13. {{ data.record[data.column.dataIndex] }}
  14. </template>
  15. </normalTable>
  16. </a-modal>
  17. <slot name="input"></slot>
  18. </template>
  19. <script setup>
  20. import {ref, defineProps, defineEmits} from 'vue'
  21. import utils from '@/utils/utils'
  22. import normalTable from '@/template/normalTable/index.vue'
  23. let modeVisible = ref(false)
  24. let param = ref({
  25. "id": 20221031141102,
  26. "content": {
  27. "pageSize":20,
  28. "pageNumber":1,
  29. "where": {
  30. "condition": "",
  31. }
  32. }
  33. })
  34. let list = ref()
  35. let emit = defineEmits(['selectPeople'])
  36. let result = ref('')
  37. let submit = () => {
  38. emit('selectPeople',result.value)
  39. modeVisible.value = false
  40. }
  41. let onSelect = (data) => {
  42. console.log(data);
  43. result.value = data
  44. }
  45. defineExpose({
  46. modeVisible,
  47. list,
  48. result
  49. })
  50. </script>
  51. <style scoped>
  52. </style>