fix: 修复打包问题
This commit is contained in:
parent
7be3eca61e
commit
3293384d8e
@ -28,7 +28,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch, nextTick, onMounted } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
|
||||||
// Props
|
// Props
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -63,7 +63,7 @@ watch(() => props.visible, (newVal) => {
|
|||||||
// 监听选中的文件夹变化,实时传递给父组件
|
// 监听选中的文件夹变化,实时传递给父组件
|
||||||
watch(selectedFolder, (newVal) => {
|
watch(selectedFolder, (newVal) => {
|
||||||
if (props.getValue && newVal) {
|
if (props.getValue && newVal) {
|
||||||
const folder = props.availableFolders.find(f => f.id === newVal)
|
const folder = props.availableFolders.find((f: { id: number }) => f.id === newVal as unknown as number)
|
||||||
if (folder) {
|
if (folder) {
|
||||||
props.getValue(folder)
|
props.getValue(folder)
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ watch(selectedFolder, (newVal) => {
|
|||||||
// 处理文件夹选择变化
|
// 处理文件夹选择变化
|
||||||
const handleFolderChange = () => {
|
const handleFolderChange = () => {
|
||||||
if (selectedFolder.value) {
|
if (selectedFolder.value) {
|
||||||
const folder = props.availableFolders.find(f => f.id === selectedFolder.value)
|
const folder = props.availableFolders.find((f: { id: number }) => f.id === selectedFolder.value as unknown as number)
|
||||||
if (folder) {
|
if (folder) {
|
||||||
emit('confirm', folder)
|
emit('confirm', folder)
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,6 @@ import CourseCreate from '@/components/admin/CourseComponents/CourseCreate.vue'
|
|||||||
import CourseEditor from '@/views/teacher/course/CourseEditor.vue'
|
import CourseEditor from '@/views/teacher/course/CourseEditor.vue'
|
||||||
import CoursewareManagement from '@/views/teacher/course/CoursewareManagement.vue'
|
import CoursewareManagement from '@/views/teacher/course/CoursewareManagement.vue'
|
||||||
import ChapterManagement from '@/views/teacher/course/ChapterManagement.vue'
|
import ChapterManagement from '@/views/teacher/course/ChapterManagement.vue'
|
||||||
import PracticeManagement from '@/views/teacher/course/PracticeManagement.vue'
|
|
||||||
import QuestionBankManagement from '@/views/teacher/course/QuestionBankManagement.vue'
|
import QuestionBankManagement from '@/views/teacher/course/QuestionBankManagement.vue'
|
||||||
import CertificateManagement from '@/views/teacher/course/CertificateManagement.vue'
|
import CertificateManagement from '@/views/teacher/course/CertificateManagement.vue'
|
||||||
import DiscussionManagement from '@/views/teacher/course/DiscussionManagement.vue'
|
import DiscussionManagement from '@/views/teacher/course/DiscussionManagement.vue'
|
||||||
|
@ -282,7 +282,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
|
||||||
// 题目类型定义
|
// 题目类型定义
|
||||||
const questionTypes = [
|
const questionTypes = [
|
||||||
|
@ -85,16 +85,20 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { NAlert } from 'naive-ui'
|
import { NAlert } from 'naive-ui'
|
||||||
|
|
||||||
|
// 定义通知类型
|
||||||
|
interface Notification {
|
||||||
|
id: number
|
||||||
|
type: 'success' | 'failed'
|
||||||
|
message: string
|
||||||
|
}
|
||||||
|
|
||||||
// Props
|
// Props
|
||||||
const props = defineProps({
|
const { visible } = defineProps<{
|
||||||
visible: {
|
visible: boolean
|
||||||
type: Boolean,
|
}>()
|
||||||
default: false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
// Emits
|
// Emits
|
||||||
const emit = defineEmits(['close', 'upload-more'])
|
const emit = defineEmits(['close', 'upload-more'])
|
||||||
@ -117,15 +121,15 @@ const fileList = ref([
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
const notifications = ref([]) // 默认不显示通知
|
const notifications = ref<Notification[]>([]) // 默认不显示通知
|
||||||
|
|
||||||
// 文件输入引用
|
// 文件输入引用
|
||||||
const fileInput = ref<HTMLInputElement>()
|
const fileInput = ref<HTMLInputElement>()
|
||||||
|
|
||||||
// 计算属性
|
// 计算属性
|
||||||
const hasFailedFiles = computed(() => {
|
// const hasFailedFiles = computed(() => {
|
||||||
return fileList.value.some(file => file.status === 'failed')
|
// return fileList.value.some((file: any) => file.status === 'failed')
|
||||||
})
|
// })
|
||||||
|
|
||||||
// 方法
|
// 方法
|
||||||
const closeModal = () => {
|
const closeModal = () => {
|
||||||
@ -187,7 +191,7 @@ const simulateUpload = (file: any) => {
|
|||||||
|
|
||||||
// 3秒后自动移除通知
|
// 3秒后自动移除通知
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const index = notifications.value.findIndex(n => n.id === notificationId)
|
const index = notifications.value.findIndex((n: Notification) => n.id === notificationId)
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
notifications.value.splice(index, 1)
|
notifications.value.splice(index, 1)
|
||||||
}
|
}
|
||||||
@ -224,28 +228,7 @@ const getFileImage = (fileName: string) => {
|
|||||||
return `/images/profile/${imageName}`
|
return `/images/profile/${imageName}`
|
||||||
}
|
}
|
||||||
|
|
||||||
const getFileIcon = (fileName: string) => {
|
|
||||||
const extension = fileName.split('.').pop()?.toLowerCase()
|
|
||||||
switch (extension) {
|
|
||||||
case 'doc':
|
|
||||||
case 'docx':
|
|
||||||
return 'icon-doc'
|
|
||||||
case 'pdf':
|
|
||||||
return 'icon-pdf'
|
|
||||||
case 'xls':
|
|
||||||
case 'xlsx':
|
|
||||||
return 'icon-xls'
|
|
||||||
case 'ppt':
|
|
||||||
case 'pptx':
|
|
||||||
return 'icon-ppt'
|
|
||||||
case 'mp3':
|
|
||||||
return 'icon-mp3'
|
|
||||||
case 'mp4':
|
|
||||||
return 'icon-mp4'
|
|
||||||
default:
|
|
||||||
return 'icon-file'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const formatFileSize = (bytes: number) => {
|
const formatFileSize = (bytes: number) => {
|
||||||
if (bytes === 0) return '0 B'
|
if (bytes === 0) return '0 B'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user