diff --git a/jeecgboot-vue3/src/views/applet/course-page/AppletCoursePageList.vue b/jeecgboot-vue3/src/views/applet/course-page/AppletCoursePageList.vue index 9055b29..4ef457e 100644 --- a/jeecgboot-vue3/src/views/applet/course-page/AppletCoursePageList.vue +++ b/jeecgboot-vue3/src/views/applet/course-page/AppletCoursePageList.vue @@ -27,9 +27,9 @@
-
+
{{ page.title || `${index + 1}` }}
@@ -114,17 +114,15 @@
- -
- uploaded -
-
- -
上传图片
-
-
+
@@ -137,15 +135,13 @@
- - - - - 上传视频 - - +
@@ -250,6 +246,7 @@ import { ref, reactive, computed, unref, onMounted, watch } from 'vue'; import { useRoute, useRouter } from 'vue-router'; import { useMessage } from '/@/hooks/web/useMessage'; import { Icon } from '/@/components/Icon'; +import { JImageUpload, JUpload } from '/@/components/Form'; import { saveOrUpdate, getById, list, deleteOne, add, edit } from './AppletCoursePage.api'; import { initDictOptions } from '/@/utils/dict/JDictSelectUtil'; @@ -596,8 +593,7 @@ function addImageContent() { contentComponents.value.push({ type: 'image', imageUrl: '', - alt: '', - fileList: [] + alt: '' }); } @@ -607,8 +603,7 @@ function addImageContent() { function addVideoContent() { contentComponents.value.push({ type: 'video', - url: '', - fileList: [] + url: '' }); } @@ -619,49 +614,19 @@ function removeComponent(index: number) { contentComponents.value.splice(index, 1); } -/** - * 文件上传前处理 - */ -function beforeUpload(file: any) { - const isImage = file.type.indexOf('image/') === 0; - const isVideo = file.type.indexOf('video/') === 0; - - if (!isImage && !isVideo) { - createMessage.error('只能上传图片或视频文件!'); - return false; - } - - const isLt10M = file.size / 1024 / 1024 < 10; - if (!isLt10M) { - createMessage.error('文件大小不能超过 10MB!'); - return false; - } - - return true; -} - /** * 图片上传变化处理 */ -function handleImageChange(info: any, component: any) { - if (info.file.status === 'done') { - // 这里应该从服务器响应中获取图片URL - component.imageUrl = info.file.response?.url || URL.createObjectURL(info.file.originFileObj); - } else if (info.file.status === 'error') { - createMessage.error('图片上传失败'); - } +function handleImageChange(value: string, component: any) { + // JImageUpload组件直接返回图片URL字符串 + component.imageUrl = value; } /** * 视频上传变化处理 */ -function handleVideoChange(info: any, component: any) { - if (info.file.status === 'done') { - // 这里应该从服务器响应中获取视频URL - component.url = info.file.response?.url || URL.createObjectURL(info.file.originFileObj); - } else if (info.file.status === 'error') { - createMessage.error('视频上传失败'); - } +function handleVideoChange(value: string, component: any) { + component.url = value; } /**