Selaa lähdekoodia

解决了 大部分问题

于添 6 kuukautta sitten
vanhempi
sitoutus
f91ef832c8

+ 1 - 0
src/api/courseinfo/index.js

@@ -9,6 +9,7 @@ const request = moduleRequest(`/api/webapp/`)
 // 获取文件列表(区分文件路径)
 export const list = (p) => request('disk/courseinfo/page', p, 'get')
 export const copy = (p) => request('disk/courseinfo/copy', p, 'post')
+export const deletes = (p) => request('disk/courseinfo/delete', p, 'post')
 // 获取文件列表(区分文件类型)
 // export const getFileListByType = (p) => request('file/selectfilebyfiletype', p, 'get')
 

+ 17 - 0
src/api/resourceAudit.js

@@ -47,6 +47,14 @@ export default {
 	courseAllList(data = {}) {
 		return request('disk/courseinfo/allList', data, 'get')
 	},
+	//获取学期列表
+	semesterDownList(data = {}) {
+		return request('disk/semester/downList', data, 'get')
+	},
+	//获取专业列表
+	majordownList(data = {}) {
+		return request('disk/major/downList', data, 'get')
+	},
 	//查询资源表单最后一次提交信息
 	recentlyRecord(data = {}) {
 		return request('disk/courseauditrecord/recentlyRecord', data, 'get')
@@ -79,7 +87,16 @@ export default {
 	orgUserTreeSelector(data = {}) {
 		return request('disk/college/orgUserTreeSelector', data, 'get')
 	},
+	// 学院接口
 	orgList(data = {}) {
 		return request('sys/org/queryList', data, 'get')
+	},
+	//根据学院id和专业id查询班级
+	gradeByZyAndOrgId(data = {}) {
+		return request('disk/grades/queryList', data, 'get')
+	},
+	//资源转换日志
+	resourceConversionLog(data = {}) {
+		return request('disk/userfileconvert/page', data, 'get')
 	}
 }

+ 5 - 0
src/router/portal.js

@@ -128,6 +128,11 @@ const portal = [
 		name: 'userfileconvert',
 		path: '/userfileconvert',
 		component: () => import('@/views/userfileconvert/index.vue'),
+	},
+	{
+		name: 'resourceConversionLog',
+		path: '/resourceConversionLog',
+		component: () => import('@/views/resourceConversionLog/index.vue'),
 	}
 
 ]

+ 4 - 0
src/router/whiteList.js

@@ -185,6 +185,10 @@ const constRouters = [
 	{
 		path: '/userfileconvert',
 		component: () => import('@/views/userfileconvert/index.vue'),
+	},
+	{
+		path: '/resourceConversionLog',
+		component: () => import('@/views/resourceConversionLog/index.vue'),
 	}
 	// {
 	// 	path: '/answerManagement',

+ 16 - 2
src/views/courseManagement/components/ListView.vue

@@ -34,8 +34,16 @@
 					<a-button v-if="record.putawayStatus == 0" size="small"  style="margin-right: 5px">上架</a-button>
 				</a-popover>
 
+				<a-popover v-model:visible="popoverDelVisibles[record.courseId]" title="确定删除?" trigger="click">
+					<template #content>
+						<a-button style="margin-right: 10px" type="primary" @click="handleDelete(record)">确定
+						</a-button>
+						<a-button @click="()=>{	popoverDelVisibles[record.courseId] = false}">取消</a-button>
+					</template>
+					<!--					<a-button size="small" style="margin-right: 5px">选择</a-button>-->
+					<a-button size="small" style="margin-right: 5px">删除</a-button>
+				</a-popover>
 
-				<a-button size="small" @click="handleDelete(record)" style="margin-right: 5px">删除</a-button>
 			</template>
 		</template>
 	</a-table>
@@ -54,7 +62,7 @@
 import tool from '@/utils/tool'
 import {ref, onMounted} from 'vue'
 import {EyeOutlined, EditOutlined, SnippetsOutlined, DeleteOutlined} from '@ant-design/icons-vue'
-import {list,copy} from '@/api/courseinfo'
+import {list,copy,deletes} from '@/api/courseinfo'
 import {useRouter} from 'vue-router'
 import collegeApi from '@/api/college'
 import {updateCourseStatus} from '@/api/course/courseDetail'
@@ -68,6 +76,7 @@ const loading = ref(false) // 列表loading
 const dataSources = ref([])
 const popoverVisible = ref({})
 const popoverVisibles = ref({})
+const popoverDelVisibles = ref({})
 const formState = ref({
 	name: '',
 	loacl: ''
@@ -185,7 +194,12 @@ const handleShelf = (record,num) => {
 
 // 删除按钮点击事件
 const handleDelete = (record) => {
+	popoverDelVisibles.value[record.courseId] = false
 	console.log('删除记录', record)
+	deletes([{courseId : record.courseId}]).then(()=>{
+
+		getList()
+	})
 	// 在这里添加删除记录的逻辑
 }
 const getList = () => {

+ 2 - 2
src/views/portal/components/Header.vue

@@ -46,7 +46,7 @@
 					<a-menu-item style="margin-left: 1px; margin-right: 1px" key="portal/courseManagement">课程管理</a-menu-item>
 					<a-menu-item style="margin-left: 1px; margin-right: 1px" key="answerManagement">问答管理</a-menu-item>
 					<a-menu-item style="margin-left: 1px; margin-right: 1px" key="classManagement">班级管理</a-menu-item>
-					
+
 					<a-menu-item style="margin-left: 1px; margin-right: 1px" key="examinationManagement">考试管理</a-menu-item>
 					<a-menu-item style="margin-left: 1px; margin-right: 1px" key="questionnaireManagement">问卷管理</a-menu-item>
 					<a-menu-item style="margin-left: 1px; margin-right: 1px" key="exampaper">试题管理</a-menu-item>
@@ -57,7 +57,7 @@
 					<a-menu-item style="margin-left: 1px; margin-right: 1px" key="forum">论坛</a-menu-item>
 <!--					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/courseManagement">站内信</a-menu-item>-->
 					<a-menu-item style="margin-left: 1px; margin-right: 1px" key="announcementManagement">课程公告发布</a-menu-item>
-					<a-menu-item style="margin-left: 1px; margin-right: 1px" key="userfileconvert">资源转换</a-menu-item>
+					<a-menu-item style="margin-left: 1px; margin-right: 1px" key="resourceConversionLog">资源转换</a-menu-item>
 <!--					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="courseOpen">课程开课</a-menu-item>-->
 				</a-menu>
 			</div>

+ 353 - 0
src/views/resourceConversionLog/index.vue

@@ -0,0 +1,353 @@
+<template>
+	<div class="resource-conversion-log">
+		<a-card title="资源转换日志" :bordered="false">
+			<!-- 搜索区域 -->
+			<div class="search-area">
+				<a-form layout="inline" :model="searchForm">
+					<a-form-item label="文件名称">
+						<a-input
+							v-model:value="searchForm.fileName"
+							placeholder="请输入文件名称"
+							allow-clear
+							style="width: 200px"
+							@pressEnter="handleSearch"
+						/>
+					</a-form-item>
+					<a-form-item>
+						<a-button type="primary" @click="handleSearch" :loading="loading">
+							<template #icon><SearchOutlined /></template>
+							查询
+						</a-button>
+						<a-button style="margin-left: 8px" @click="handleReset">
+							<template #icon><ReloadOutlined /></template>
+							重置
+						</a-button>
+					</a-form-item>
+				</a-form>
+			</div>
+
+			<!-- 表格 -->
+			<a-table
+				:columns="columns"
+				:data-source="dataSource"
+				:loading="loading"
+				:pagination="pagination"
+				row-key="id"
+				@change="handleTableChange"
+				:scroll="{ x: 1200 }"
+			>
+				<!-- 文件名称列 -->
+				<template #fileName="{ record }">
+					<a-tooltip :title="record.fileName">
+						<span class="file-name">{{ record.fileName }}</span>
+					</a-tooltip>
+				</template>
+
+				<!-- 文件扩展名列 -->
+				<template #extendName="{ record }">
+					<a-tag :color="getExtensionColor(record.extendName)">
+						{{ record.extendName?.toUpperCase() || '-' }}
+					</a-tag>
+				</template>
+
+				<!-- 转换状态列 -->
+				<template #status="{ record }">
+					<a-tag :color="getStatusColor(record.status)">
+						<template #icon>
+							<LoadingOutlined v-if="record.status === '0'" />
+							<CheckCircleOutlined v-else-if="record.status === '1'" />
+							<CloseCircleOutlined v-else-if="record.status === '2'" />
+						</template>
+						{{ getStatusText(record.status) }}
+					</a-tag>
+				</template>
+
+				<!-- 创建时间列 -->
+				<template #createTime="{ record }">
+					{{ formatTime(record.createTime) }}
+				</template>
+
+				<!-- 操作列 -->
+				<template #action="{ record }">
+					<a-space>
+						<a-button type="link" size="small" @click="handleViewDetail(record)"> 查看详情 </a-button>
+						<a-button v-if="record.status === '2'" type="link" size="small" danger @click="handleRetry(record)">
+							重新转换
+						</a-button>
+					</a-space>
+				</template>
+			</a-table>
+		</a-card>
+
+		<!-- 详情弹窗 -->
+		<a-modal v-model:visible="detailVisible" title="转换日志详情" width="600px" :footer="null">
+			<a-descriptions :column="1" bordered v-if="currentRecord">
+				<a-descriptions-item label="文件名称">
+					{{ currentRecord.fileName }}
+				</a-descriptions-item>
+				<a-descriptions-item label="文件扩展名">
+					<a-tag :color="getExtensionColor(currentRecord.extendName)">
+						{{ currentRecord.extendName?.toUpperCase() || '-' }}
+					</a-tag>
+				</a-descriptions-item>
+				<a-descriptions-item label="文件路径">
+					<a-typography-text copyable>{{ currentRecord.filePath || '-' }}</a-typography-text>
+				</a-descriptions-item>
+				<a-descriptions-item label="转换状态">
+					<a-tag :color="getStatusColor(currentRecord.status)">
+						<template #icon>
+							<LoadingOutlined v-if="currentRecord.status === '0'" />
+							<CheckCircleOutlined v-else-if="currentRecord.status === '1'" />
+							<CloseCircleOutlined v-else-if="currentRecord.status === '2'" />
+						</template>
+						{{ getStatusText(currentRecord.status) }}
+					</a-tag>
+				</a-descriptions-item>
+				<a-descriptions-item label="失败原因" v-if="currentRecord.status === '2' && currentRecord.reason">
+					<a-typography-text type="danger">{{ currentRecord.reason }}</a-typography-text>
+				</a-descriptions-item>
+				<a-descriptions-item label="创建时间">
+					{{ formatTime(currentRecord.createTime) }}
+				</a-descriptions-item>
+				<a-descriptions-item label="更新时间" v-if="currentRecord.updateTime">
+					{{ formatTime(currentRecord.updateTime) }}
+				</a-descriptions-item>
+			</a-descriptions>
+		</a-modal>
+	</div>
+</template>
+
+<script setup>
+	import { ref, reactive, onMounted } from 'vue'
+	import { message } from 'ant-design-vue'
+	import {
+		SearchOutlined,
+		ReloadOutlined,
+		LoadingOutlined,
+		CheckCircleOutlined,
+		CloseCircleOutlined
+	} from '@ant-design/icons-vue'
+	import resourceAuditApi from '@/api/resourceAudit'
+	import dayjs from 'dayjs'
+
+	// 搜索表单
+	const searchForm = reactive({
+		fileName: ''
+	})
+
+	// 表格数据
+	const dataSource = ref([])
+	const loading = ref(false)
+
+	// 分页配置
+	const pagination = reactive({
+		current: 1,
+		pageSize: 20,
+		total: 0,
+		showSizeChanger: true,
+		showQuickJumper: true,
+		showTotal: (total) => `共 ${total} 条记录`
+	})
+
+	// 详情弹窗
+	const detailVisible = ref(false)
+	const currentRecord = ref(null)
+
+	// 表格列配置
+	const columns = [
+		{
+			title: '文件名称',
+			dataIndex: 'fileName',
+			key: 'fileName',
+			width: 200,
+			ellipsis: true,
+			slots: { customRender: 'fileName' }
+		},
+		{
+			title: '文件扩展名',
+			dataIndex: 'extendName',
+			key: 'extendName',
+			width: 120,
+			align: 'center',
+			slots: { customRender: 'extendName' }
+		},
+		{
+			title: '转换状态',
+			dataIndex: 'status',
+			key: 'status',
+			width: 120,
+			align: 'center',
+			slots: { customRender: 'status' }
+		},
+		{
+			title: '文件路径',
+			dataIndex: 'filePath',
+			key: 'filePath',
+			width: 250,
+			ellipsis: true
+		},
+		{
+			title: '创建时间',
+			dataIndex: 'createTime',
+			key: 'createTime',
+			width: 180,
+			slots: { customRender: 'createTime' }
+		},
+		{
+			title: '操作',
+			key: 'action',
+			width: 150,
+			align: 'center',
+			fixed: 'right',
+			slots: { customRender: 'action' }
+		}
+	]
+
+	// 获取列表数据
+	const fetchData = async () => {
+		try {
+			loading.value = true
+			const params = {
+				current: pagination.current,
+				size: pagination.pageSize,
+				...searchForm
+			}
+
+			const response = await resourceAuditApi.resourceConversionLog(params)
+
+			if (response.code === 200) {
+				dataSource.value = response.data.records || []
+				pagination.total = response.data.total || 0
+			} else {
+				message.error(response.msg || '获取数据失败')
+			}
+		} catch (error) {
+			console.error('获取转换日志失败:', error)
+			message.error('获取数据失败')
+		} finally {
+			loading.value = false
+		}
+	}
+
+	// 搜索
+	const handleSearch = () => {
+		pagination.current = 1
+		fetchData()
+	}
+
+	// 重置
+	const handleReset = () => {
+		Object.keys(searchForm).forEach((key) => {
+			searchForm[key] = ''
+		})
+		pagination.current = 1
+		fetchData()
+	}
+
+	// 表格变化处理
+	const handleTableChange = (pag) => {
+		pagination.current = pag.current
+		pagination.pageSize = pag.pageSize
+		fetchData()
+	}
+
+	// 查看详情
+	const handleViewDetail = (record) => {
+		currentRecord.value = record
+		detailVisible.value = true
+	}
+
+	// 重新转换
+	const handleRetry = (record) => {
+		// 这里可以调用重新转换的接口
+		message.info('重新转换功能待实现')
+	}
+
+	// 获取状态文本
+	const getStatusText = (status) => {
+		const statusMap = {
+			0: '转换中',
+			1: '转换完成',
+			2: '转换失败'
+		}
+		return statusMap[status] || '未知状态'
+	}
+
+	// 获取状态颜色
+	const getStatusColor = (status) => {
+		const colorMap = {
+			0: 'processing',
+			1: 'success',
+			2: 'error'
+		}
+		return colorMap[status] || 'default'
+	}
+
+	// 获取文件扩展名颜色
+	const getExtensionColor = (extension) => {
+		const colorMap = {
+			pdf: 'red',
+			doc: 'blue',
+			docx: 'blue',
+			ppt: 'orange',
+			pptx: 'orange',
+			xls: 'green',
+			xlsx: 'green',
+			jpg: 'purple',
+			jpeg: 'purple',
+			png: 'purple',
+			gif: 'purple',
+			mp4: 'cyan',
+			avi: 'cyan',
+			mov: 'cyan'
+		}
+		return colorMap[extension?.toLowerCase()] || 'default'
+	}
+
+	// 格式化时间
+	const formatTime = (timestamp) => {
+		if (!timestamp) return '-'
+		return dayjs(timestamp).format('YYYY-MM-DD HH:mm:ss')
+	}
+
+	// 组件挂载时获取数据
+	onMounted(() => {
+		fetchData()
+	})
+</script>
+
+<style scoped>
+	.resource-conversion-log {
+		padding: 20px;
+	}
+
+	.search-area {
+		margin-bottom: 16px;
+		padding: 16px;
+		background: #fafafa;
+		border-radius: 6px;
+	}
+
+	.file-name {
+		max-width: 180px;
+		display: inline-block;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		white-space: nowrap;
+		vertical-align: middle;
+	}
+
+	:deep(.ant-table-thead > tr > th) {
+		background: #fafafa;
+		font-weight: 600;
+	}
+
+	:deep(.ant-table-tbody > tr:hover > td) {
+		background: #f5f5f5;
+	}
+
+	:deep(.ant-descriptions-item-label) {
+		width: 120px;
+		font-weight: 600;
+	}
+</style>

+ 20 - 2
src/views/resourceDetails/components/TallItem.vue

@@ -2,7 +2,15 @@
 	<div>
 		<div>
 			<div style="display: flex; margin-left: 10px; margin-right: 10px">
-				<div style="width: 40px; height: 40px; background: #1e90ff; border-radius: 50%; margin-right: 10px"></div>
+				<div style="width: 40px; height: 40px; background: #1e90ff; border-radius: 50%; margin-right: 10px">
+					<a-image
+						width="100%"
+						height="100%"
+						:src="props.item.avatar"
+						:preview="true"
+						style="border-radius: 50%"
+					/>
+				</div>
 				<div style="width: 100%">
 					<div style="display: flex; flex-direction: column; margin-bottom: 0px">
 						<span style="display: block; font-size: 14px; font-weight: bold; margin-bottom: 0px">{{
@@ -30,7 +38,15 @@
 			</div>
 			<div v-show="props.item.child.length > 0" v-for="(item, index) in props.item.child" :key="index">
 				<div style="display: flex; margin-left: 50px; margin-right: 0px">
-					<div style="width: 40px; height: 40px; background: #1e90ff; border-radius: 50%; margin-right: 10px"></div>
+					<div style="width: 40px; height: 40px; background: #1e90ff; border-radius: 50%; margin-right: 10px">
+							<a-image
+								width="100%"
+								height="100%"
+								:src="item.avater"
+								:preview="true"
+								style="border-radius: 50%"
+							/>
+					</div>
 					<div style="width: 100%">
 						<div style="display: flex; flex-direction: column; margin-bottom: 0px">
 							<span style="display: block; font-size: 14px; font-weight: bold; margin-bottom: 5px">{{
@@ -171,6 +187,8 @@
 	}
 	onMounted(() => {
 		// getList()
+
+		console.log('item有变化吗123123', props.item)
 	})
 
 	EventBus.off('closeInput', handleCloseInput)

+ 1 - 1
src/views/resourceDetails/components/TallList.vue

@@ -248,7 +248,7 @@
 			.then((res) => {
 				if (res.code == 200) {
 					talkList.value = res.data.records
-
+					console.log('放进去了', talkList.value)
 					pagers.pages = res.data.pages
 					pagers.size = res.data.size
 

+ 10 - 1
src/views/resourceDetails/components/VideoDetails.vue

@@ -60,7 +60,16 @@
 					<div class="user-info" style="display: flex; flex-direction: column">
 						<div style="display: flex; align-items: center; justify-content: space-between; width: 100%">
 							<div style="display: flex; align-items: center">
-								<div class="user-avatar"></div>
+								<div class="user-avatar">
+									<a-image
+										width="100%"
+										height="100%"
+										:src="itemData.avatar"
+										:preview="true"
+										style="border-radius: 50%"
+									/>
+								</div>
+
 								<div class="user-details">
 									<div class="user-name">{{ itemData.resourceCreaterUserName }}</div>
 									<div class="publish-time">{{ itemData.uploadTime }}</div>