fileName.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <span style="margin-top: 12px; color: #0d84ff; margin-bottom: 12px">{{ formRef.name }}</span>
  3. </template>
  4. <script setup>
  5. import {ref, reactive, watch, defineProps, defineEmits} from 'vue'
  6. import {message} from 'ant-design-vue'
  7. import {PictureOutlined, CloudUploadOutlined} from '@ant-design/icons-vue'
  8. import UpLoadImg from '@/components/UpLoadImg/index.vue'
  9. import UpLoadDoc from '@/components/UpLoadDoc/index.vue'
  10. import UpLoadSrt from '@/components/UpLoadSrt/index.vue'
  11. import {add, detail} from '@/api/hour/index'
  12. const props = defineProps({
  13. modelValue: [String, Number, Boolean, Object, Array, null]
  14. })
  15. const emit = defineEmits(['update:visible','update:modelValue', 'ok', 'handlerUpSelect', 'handlerNewSelect'])
  16. const formRef = ref({
  17. id : '',
  18. name : ''
  19. })
  20. const setData = (data) => {
  21. console.log("最里面的参数",data)
  22. formRef.value.id = data.id
  23. formRef.value.name = data.name
  24. console.log("最里面的参数更新外面",formRef.value)
  25. emit('update:modelValue',data.id)
  26. }
  27. defineExpose({
  28. setData
  29. })
  30. </script>
  31. <style lang="less" scoped>
  32. .add-class-hours-modal {
  33. .ant-modal-content {
  34. border-radius: 10px;
  35. }
  36. .ant-modal-header {
  37. border-radius: 10px 10px 0 0;
  38. }
  39. .ant-form-item {
  40. margin-bottom: 24px;
  41. }
  42. .video-select-row {
  43. display: flex;
  44. align-items: center;
  45. }
  46. .cover-upload-row {
  47. display: flex;
  48. align-items: center;
  49. .cover-upload-box {
  50. width: 120px;
  51. height: 120px;
  52. background: #f7f8fa;
  53. border-radius: 8px;
  54. display: flex;
  55. align-items: center;
  56. justify-content: center;
  57. margin-right: 24px;
  58. border: 1px dashed #d9d9d9;
  59. cursor: pointer;
  60. .cover-img {
  61. width: 100%;
  62. height: 100%;
  63. object-fit: cover;
  64. border-radius: 8px;
  65. }
  66. .cover-placeholder {
  67. display: flex;
  68. align-items: center;
  69. justify-content: center;
  70. width: 100%;
  71. height: 100%;
  72. color: #bbb;
  73. font-size: 32px;
  74. }
  75. }
  76. .cover-tip {
  77. color: #888;
  78. font-size: 13px;
  79. }
  80. }
  81. .upload-tip {
  82. color: #888;
  83. font-size: 13px;
  84. margin-left: 12px;
  85. }
  86. .footer-btns {
  87. display: flex;
  88. justify-content: flex-end;
  89. gap: 16px;
  90. margin-top: 24px;
  91. }
  92. }
  93. </style>