relation.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <CzrDialog
  3. :show="show"
  4. :title="titleCpt"
  5. @onClose="$emit('update:show', false)"
  6. width="62.5rem"
  7. height="auto"
  8. max-height="90%"
  9. :loading="state.loading"
  10. :show-close="false"
  11. :show-submit="false"
  12. >
  13. <div class="bm-form"></div>
  14. </CzrDialog>
  15. </template>
  16. <script setup lang="ts">
  17. import {
  18. computed,
  19. getCurrentInstance,
  20. nextTick,
  21. reactive,
  22. ref,
  23. watch,
  24. } from 'vue'
  25. import { ElMessage, ElMessageBox } from 'element-plus'
  26. import { useAppStore, useDialogStore, useDictionaryStore } from '@/stores'
  27. import { useRouter } from 'vue-router'
  28. const DialogStore = useDialogStore()
  29. const emit = defineEmits(['update:show', 'refresh'])
  30. const { proxy } = getCurrentInstance()
  31. const props = defineProps({
  32. show: { default: false },
  33. transfer: <any>{},
  34. })
  35. const state: any = reactive({
  36. loading: false,
  37. form: {},
  38. })
  39. const ref_form = ref()
  40. const titleCpt = computed(() => {
  41. let t = '关联用户'
  42. return t
  43. })
  44. watch(
  45. () => props.show,
  46. (n) => {
  47. if (n) {
  48. initDictionary()
  49. state.form = {}
  50. if (props.transfer.mode !== 'add') {
  51. initData()
  52. }
  53. nextTick(() => {
  54. ref_form.value.reset()
  55. })
  56. }
  57. },
  58. )
  59. const initDictionary = () => {}
  60. const initData = () => {
  61. // state.loading = true
  62. // userDetail(props.transfer.id)
  63. // .then(({ data }: any) => {
  64. // state.form = data
  65. // })
  66. // .catch(() => {})
  67. // .finally(() => {
  68. // state.loading = false
  69. // })
  70. }
  71. </script>
  72. <style lang="scss" scoped></style>