fix: 修复打包问题
This commit is contained in:
parent
7be3eca61e
commit
3293384d8e
@ -28,7 +28,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch, nextTick, onMounted } from 'vue'
|
||||
import { ref } from 'vue'
|
||||
|
||||
// Props
|
||||
const props = defineProps({
|
||||
|
@ -63,7 +63,7 @@ watch(() => props.visible, (newVal) => {
|
||||
// 监听选中的文件夹变化,实时传递给父组件
|
||||
watch(selectedFolder, (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) {
|
||||
props.getValue(folder)
|
||||
}
|
||||
@ -73,7 +73,7 @@ watch(selectedFolder, (newVal) => {
|
||||
// 处理文件夹选择变化
|
||||
const handleFolderChange = () => {
|
||||
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) {
|
||||
emit('confirm', folder)
|
||||
}
|
||||
|
@ -43,7 +43,6 @@ import CourseCreate from '@/components/admin/CourseComponents/CourseCreate.vue'
|
||||
import CourseEditor from '@/views/teacher/course/CourseEditor.vue'
|
||||
import CoursewareManagement from '@/views/teacher/course/CoursewareManagement.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 CertificateManagement from '@/views/teacher/course/CertificateManagement.vue'
|
||||
import DiscussionManagement from '@/views/teacher/course/DiscussionManagement.vue'
|
||||
|
@ -282,7 +282,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue'
|
||||
import { ref } from 'vue'
|
||||
|
||||
// 题目类型定义
|
||||
const questionTypes = [
|
||||
|
@ -85,16 +85,20 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue'
|
||||
import { ref } from 'vue'
|
||||
import { NAlert } from 'naive-ui'
|
||||
|
||||
// Props
|
||||
const props = defineProps({
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
// 定义通知类型
|
||||
interface Notification {
|
||||
id: number
|
||||
type: 'success' | 'failed'
|
||||
message: string
|
||||
}
|
||||
})
|
||||
|
||||
// Props
|
||||
const { visible } = defineProps<{
|
||||
visible: boolean
|
||||
}>()
|
||||
|
||||
// Emits
|
||||
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 hasFailedFiles = computed(() => {
|
||||
return fileList.value.some(file => file.status === 'failed')
|
||||
})
|
||||
// const hasFailedFiles = computed(() => {
|
||||
// return fileList.value.some((file: any) => file.status === 'failed')
|
||||
// })
|
||||
|
||||
// 方法
|
||||
const closeModal = () => {
|
||||
@ -187,7 +191,7 @@ const simulateUpload = (file: any) => {
|
||||
|
||||
// 3秒后自动移除通知
|
||||
setTimeout(() => {
|
||||
const index = notifications.value.findIndex(n => n.id === notificationId)
|
||||
const index = notifications.value.findIndex((n: Notification) => n.id === notificationId)
|
||||
if (index > -1) {
|
||||
notifications.value.splice(index, 1)
|
||||
}
|
||||
@ -224,28 +228,7 @@ const getFileImage = (fileName: string) => {
|
||||
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) => {
|
||||
if (bytes === 0) return '0 B'
|
||||
|
Loading…
x
Reference in New Issue
Block a user