Bladeren bron

代码提交

zhangsq 8 maanden geleden
bovenliggende
commit
5183c6b65b
5 gewijzigde bestanden met toevoegingen van 692 en 714 verwijderingen
  1. 1 0
      .env.development
  2. 208 209
      src/views/InventoryReview/index.vue
  3. 283 271
      src/views/myResources/index.vue
  4. 92 92
      src/views/myResources/releaseModal.vue
  5. 108 142
      src/views/taskProgress/index.vue

+ 1 - 0
.env.development

@@ -6,6 +6,7 @@ VITE_TITLE = Snowy
 
 # 接口地址
 VITE_API_BASEURL = http://192.168.31.14:9003
+# VITE_API_BASEURL = http://192.168.31.80:9003
 # VITE_API_BASEURL = http://192.168.31.6:9003
 
 # 本地端口

+ 208 - 209
src/views/InventoryReview/index.vue

@@ -85,238 +85,237 @@
 	</a-card>
 </template>
 
-  <script setup>
-import { ref, onMounted } from 'vue'
-import InventoryReviewApi from '@/api/InventoryReview.js'
-import CustomPagination from '@/components/customPagination.vue'
-// 状态管理
-const activeKey = ref('pending')
-const loading = ref(false)
-const judgeVisible = ref(false)
-const finalResult = ref(null)
-const formState = reactive({
-	fileName: null,
-	examineStatus: null,
-	orgName: null
-})
-// 表格数据
-const columns = [
-	{
-		title: '资源名称',
-		key: 'fileName',
-		dataIndex: 'fileName',
-		width: 200,
-		align: 'center'
-	},
-	{
-		title: '大小',
-		key: 'fileSizeNum',
-		dataIndex: 'fileSizeNum',
-		width: 100,
-		align: 'center'
-	},
-	{
-		title: '申请人',
-		key: 'createUser',
-		dataIndex: 'createUser',
-		width: 200,
-		align: 'center'
-	},
-	{
-		title: '组织结构',
-		key: 'orgName',
-		dataIndex: 'orgName',
-		width: 150,
-		align: 'center'
-	},
-	{
-		title: '申请时间',
-		key: 'createTime',
-		dataIndex: 'createTime',
-		width: 150,
-		align: 'center'
-	},
-	{
-		title: '智能审核',
-		key: 'examineReason',
-		dataIndex: 'examineReason',
-		width: 100,
-		align: 'center'
-	},
-	{
-		title: '待审核人',
-		key: 'auditor',
-		dataIndex: 'auditor',
-		width: 150,
-		align: 'center'
-	},
-	{
-		title: '操作',
-		key: 'operation',
-		width: 100,
-		align: 'center'
-	}
-]
+<script setup>
+	import { ref, onMounted } from 'vue'
+	import InventoryReviewApi from '@/api/InventoryReview.js'
+	import CustomPagination from '@/components/customPagination.vue'
+	// 状态管理
+	const activeKey = ref('pending')
+	const loading = ref(false)
+	const judgeVisible = ref(false)
+	const finalResult = ref(null)
+	const formState = reactive({
+		fileName: null,
+		examineStatus: null,
+		orgName: null
+	})
+	// 表格数据
+	const columns = [
+		{
+			title: '资源名称',
+			key: 'fileName',
+			dataIndex: 'fileName',
+			width: 200,
+			align: 'center'
+		},
+		{
+			title: '大小',
+			key: 'fileSizeNum',
+			dataIndex: 'fileSizeNum',
+			width: 100,
+			align: 'center'
+		},
+		{
+			title: '申请人',
+			key: 'createUser',
+			dataIndex: 'createUser',
+			width: 200,
+			align: 'center'
+		},
+		{
+			title: '组织结构',
+			key: 'orgName',
+			dataIndex: 'orgName',
+			width: 150,
+			align: 'center'
+		},
+		{
+			title: '申请时间',
+			key: 'createTime',
+			dataIndex: 'createTime',
+			width: 150,
+			align: 'center'
+		},
+		{
+			title: '智能审核',
+			key: 'examineReason',
+			dataIndex: 'examineReason',
+			width: 100,
+			align: 'center'
+		},
+		{
+			title: '待审核人',
+			key: 'auditor',
+			dataIndex: 'auditor',
+			width: 150,
+			align: 'center'
+		},
+		{
+			title: '操作',
+			key: 'operation',
+			width: 100,
+			align: 'center'
+		}
+	]
 
-const dataSource = ref([])
-const classify_results = ref([
-	{ value: '1', label: '通过' },
-	{ value: '0', label: '驳回' }
-])
+	const dataSource = ref([])
+	const classify_results = ref([
+		{ value: '1', label: '通过' },
+		{ value: '0', label: '驳回' }
+	])
 
-const pagination = reactive({
-	pageSize: 10,
-	pageNum: 1,
-	total: 0
-})
-//勾选的ID列表
-const selectedRowKeys = ref([])
-//列表勾选
-const rowSelection = computed(() => {
-	return {
-		selectedRowKeys: unref(selectedRowKeys),
-		onChange: onSelectChange,
-		hideDefaultSelections: true
+	const pagination = reactive({
+		pageSize: 10,
+		pageNum: 1,
+		total: 0
+	})
+	//勾选的ID列表
+	const selectedRowKeys = ref([])
+	//列表勾选
+	const rowSelection = computed(() => {
+		return {
+			selectedRowKeys: unref(selectedRowKeys),
+			onChange: onSelectChange,
+			hideDefaultSelections: true
+		}
+	})
+	//勾选方法
+	const onSelectChange = (changaRowKeys) => {
+		selectedRowKeys.value = changaRowKeys
 	}
-})
-//勾选方法
-const onSelectChange = (changaRowKeys) => {
-	selectedRowKeys.value = changaRowKeys
-}
 
-// 翻页
-const handlePageChange = (page) => {
-	pagination.pageNum = page
-	getListData()
-}
-// 每页条数
-const handlePageSizeChange = (pageNum, size) => {
-	pagination.pageNum = 1
-	pagination.pageSize = size
-	getListData()
-}
-const getListData = () => {
-	let params = {
-		pageNum: pagination.pageNum,
-		pageSize: pagination.pageSize,
-		orgName: formState.orgName,
-		examineStatus: formState.examineStatus,
-		fileName: formState.fileName
+	// 翻页
+	const handlePageChange = (page) => {
+		pagination.pageNum = page
+		getListData()
 	}
-	InventoryReviewApi.queryList(params)
-		.then((res) => {
-			console.log(res, '审核列表')
-			dataSource.value = res.data
-			pagination.total = res.total
-		})
-		.catch((err) => {
-			console.log(err)
-		})
-}
-
-// 方法
-const handleSearch = () => {
-	// 处理搜索逻辑
-	getListData()
-}
-
-//批量审批
-const handleBatchApprove = () => {
-	judgeVisible.value = true
-}
-const handleOk = () => {
-	if (!finalResult.value) {
-		message.error('请选择审核类型')
+	// 每页条数
+	const handlePageSizeChange = (pageNum, size) => {
+		pagination.pageNum = 1
+		pagination.pageSize = size
+		getListData()
 	}
-	const idList = selectedRowKeys.value
-	const params = []
-	idList.forEach((res) => {
-		params.push({
-			id: res,
-			result: finalResult.value
-		})
-	})
-	loading.value = true
-	return
-}
-
-const handleExportDetails = () => {
-	// 处理导出详情逻辑
-}
-
-const handleAudit = (record, state) => {
-	// 处理单个审核逻辑
-	console.log('审核记录:', record)
-	if (state == 0) {
+	const getListData = () => {
 		let params = {
-			targetId: record.id,
-			examineReason: 'asdasd'
+			pageNum: pagination.pageNum,
+			pageSize: pagination.pageSize,
+			orgName: formState.orgName,
+			examineStatus: formState.examineStatus,
+			fileName: formState.fileName
 		}
-		InventoryReviewApi.reject(params)
+		InventoryReviewApi.queryList(params)
 			.then((res) => {
-				console.log(res, '驳回')
+				console.log(res, '审核列表')
+				dataSource.value = res.data
+				pagination.total = res.total
 			})
 			.catch((err) => {
 				console.log(err)
 			})
-	} else {
-		let params = {
-			targetId: record.id,
-			examineReason: 'asdasd'
+	}
+
+	// 方法
+	const handleSearch = () => {
+		// 处理搜索逻辑
+		getListData()
+	}
+
+	//批量审批
+	const handleBatchApprove = () => {
+		judgeVisible.value = true
+	}
+	const handleOk = () => {
+		if (!finalResult.value) {
+			message.error('请选择审核类型')
 		}
-		InventoryReviewApi.reject(params)
-			.then((res) => {
-				console.log(res, '通过')
-			})
-			.catch((err) => {
-				console.log(err)
+		const idList = selectedRowKeys.value
+		const params = []
+		idList.forEach((res) => {
+			params.push({
+				id: res,
+				result: finalResult.value
 			})
+		})
+		loading.value = true
+		return
 	}
-}
-
-const formatSize = (size) => {
-	if (size < 1024) return `${size}B`
-	else if (size < 1024 * 1024) return `${(size / 1024).toFixed(2)}KB`
-	else if (size < 1024 * 1024 * 1024) return `${(size / (1024 * 1024)).toFixed(2)}MB`
-	else return `${(size / (1024 * 1024 * 1024)).toFixed(2)}GB`
-}
 
-const formatDate = (dateStr) => {
-	return new Date(dateStr).toLocaleString()
-}
-onMounted(() => {
-	getListData()
-})
-</script>
+	const handleExportDetails = () => {
+		// 处理导出详情逻辑
+	}
 
-  <style scoped>
-.resource-item {
-	display: flex;
-	align-items: center;
-}
+	const handleAudit = (record, state) => {
+		// 处理单个审核逻辑
+		console.log('审核记录:', record)
+		if (state == 0) {
+			let params = {
+				targetId: record.id,
+				examineReason: 'asdasd'
+			}
+			InventoryReviewApi.reject(params)
+				.then((res) => {
+					console.log(res, '驳回')
+				})
+				.catch((err) => {
+					console.log(err)
+				})
+		} else {
+			let params = {
+				targetId: record.id,
+				examineReason: 'asdasd'
+			}
+			InventoryReviewApi.reject(params)
+				.then((res) => {
+					console.log(res, '通过')
+				})
+				.catch((err) => {
+					console.log(err)
+				})
+		}
+	}
 
-.thumbnail {
-	width: 40px;
-	height: 40px;
-	margin-right: 8px;
-}
-.dis-flex-end {
-	display: flex;
-	justify-content: flex-end;
-}
-.margin-top {
-	margin-top: 15px;
-}
+	const formatSize = (size) => {
+		if (size < 1024) return `${size}B`
+		else if (size < 1024 * 1024) return `${(size / 1024).toFixed(2)}KB`
+		else if (size < 1024 * 1024 * 1024) return `${(size / (1024 * 1024)).toFixed(2)}MB`
+		else return `${(size / (1024 * 1024 * 1024)).toFixed(2)}GB`
+	}
 
-@media (max-width: 768px) {
+	const formatDate = (dateStr) => {
+		return new Date(dateStr).toLocaleString()
+	}
+	onMounted(() => {
+		getListData()
+	})
+</script>
+<style scoped>
 	.resource-item {
-		flex-direction: column;
-		align-items: flex-start;
+		display: flex;
+		align-items: center;
 	}
 
 	.thumbnail {
-		margin-right: 0;
-		margin-bottom: 8px;
+		width: 40px;
+		height: 40px;
+		margin-right: 8px;
+	}
+	.dis-flex-end {
+		display: flex;
+		justify-content: flex-end;
+	}
+	.margin-top {
+		margin-top: 15px;
+	}
+
+	@media (max-width: 768px) {
+		.resource-item {
+			flex-direction: column;
+			align-items: flex-start;
+		}
+
+		.thumbnail {
+			margin-right: 0;
+			margin-bottom: 8px;
+		}
 	}
-}
 </style>

+ 283 - 271
src/views/myResources/index.vue

@@ -54,7 +54,10 @@
 							<a @click="handlePublish(record)">发布</a>
 							<a-divider type="vertical" />
 							<a-dropdown>
-								<a class="ant-dropdown-link"> 更多 <DownOutlined /> </a>
+								<a class="ant-dropdown-link">
+									更多
+									<DownOutlined />
+								</a>
 								<template #overlay>
 									<a-menu>
 										<a-menu-item>
@@ -78,7 +81,10 @@
 							<a @click="handleAudit(record)">审核</a>
 							<a-divider type="vertical" />
 							<a-dropdown>
-								<a class="ant-dropdown-link"> 更多 <DownOutlined /> </a>
+								<a class="ant-dropdown-link">
+									更多
+									<DownOutlined />
+								</a>
 								<template #overlay>
 									<a-menu>
 										<a-menu-item>
@@ -93,7 +99,10 @@
 							<a @click="handlePermission(record)">权限</a>
 							<a-divider type="vertical" />
 							<a-dropdown>
-								<a class="ant-dropdown-link"> 更多 <DownOutlined /> </a>
+								<a class="ant-dropdown-link">
+									更多
+									<DownOutlined />
+								</a>
 								<template #overlay>
 									<a-menu>
 										<a-menu-item>
@@ -114,7 +123,10 @@
 							<a @click="handleRestore(record)">恢复</a>
 							<a-divider type="vertical" />
 							<a-dropdown>
-								<a class="ant-dropdown-link"> 更多 <DownOutlined /> </a>
+								<a class="ant-dropdown-link">
+									更多
+									<DownOutlined />
+								</a>
 								<template #overlay>
 									<a-menu>
 										<a-menu-item>
@@ -160,282 +172,282 @@
 	</a-card>
 </template>
 
-  <script setup>
-import { ref } from 'vue'
-import { DownOutlined } from '@ant-design/icons-vue'
-import { Modal, Upload } from 'ant-design-vue'
-import releaseModal from './releaseModal.vue'
-// 数据源
-const dataSource = ref([
-	{
-		id: 1,
-		name: '资源名称资源名称',
-		format: 'mp4',
-		uploadTime: '2020-11-25 23:26:08',
-		status: 'processing', // processing, uploaded, pending, published, deleted
-		department: '航空理论系',
-		major: '商务服务',
-		courseType: '选修'
-	},
-	{
-		id: 2,
-		name: '资源名称资源名称',
-		format: 'mp4',
-		uploadTime: '2020-11-25 23:26:08',
-		status: 'pending', // processing, uploaded, pending, published, deleted
-		department: '航空理论系1',
-		major: '商务服务',
-		courseType: '选修'
-	},
-	{
-		id: 3,
-		name: '资源名称资源名称',
-		format: 'mp4',
-		uploadTime: '2020-11-25 23:26:08',
-		status: 'published', // processing, uploaded, pending, published, deleted
-		department: '航空理论系2',
-		major: '商务服务',
-		courseType: '选修'
+<script setup>
+	import { ref } from 'vue'
+	import { DownOutlined } from '@ant-design/icons-vue'
+	import { Modal, Upload } from 'ant-design-vue'
+	import releaseModal from './releaseModal.vue'
+	// 数据源
+	const dataSource = ref([
+		{
+			id: 1,
+			name: '资源名称资源名称',
+			format: 'mp4',
+			uploadTime: '2020-11-25 23:26:08',
+			status: 'processing', // processing, uploaded, pending, published, deleted
+			department: '航空理论系',
+			major: '商务服务',
+			courseType: '选修'
+		},
+		{
+			id: 2,
+			name: '资源名称资源名称',
+			format: 'mp4',
+			uploadTime: '2020-11-25 23:26:08',
+			status: 'pending', // processing, uploaded, pending, published, deleted
+			department: '航空理论系1',
+			major: '商务服务',
+			courseType: '选修'
+		},
+		{
+			id: 3,
+			name: '资源名称资源名称',
+			format: 'mp4',
+			uploadTime: '2020-11-25 23:26:08',
+			status: 'published', // processing, uploaded, pending, published, deleted
+			department: '航空理论系2',
+			major: '商务服务',
+			courseType: '选修'
+		}
+	])
+
+	// 当前激活的标签页
+	const activeKey = ref('unpublished')
+	//发布按钮状态
+	const releaseVisible = ref(false)
+
+	// 搜索值
+	const searchValue = ref('')
+
+	// 列定义
+	const columnsUnpublished = [
+		{
+			title: '编号',
+			dataIndex: 'id',
+			key: 'id'
+		},
+		{
+			title: '资源名称',
+			dataIndex: 'name',
+			key: 'name'
+		},
+		{
+			title: '课件格式',
+			dataIndex: 'format',
+			key: 'format'
+		},
+		{
+			title: '上传时间',
+			dataIndex: 'uploadTime',
+			key: 'uploadTime'
+		},
+		{
+			title: '状态',
+			key: 'status'
+		},
+		{
+			title: '操作',
+			key: 'action'
+		}
+	]
+
+	const columnsPending = [
+		{
+			title: '编号',
+			dataIndex: 'id',
+			key: 'id'
+		},
+		{
+			title: '资源名称',
+			dataIndex: 'name',
+			key: 'name'
+		},
+		{
+			title: '所属院系',
+			dataIndex: 'department',
+			key: 'department'
+		},
+		{
+			title: '所属专业',
+			dataIndex: 'major',
+			key: 'major'
+		},
+		{
+			title: '课程类型',
+			dataIndex: 'courseType',
+			key: 'courseType'
+		},
+		{
+			title: '课件格式',
+			dataIndex: 'format',
+			key: 'format'
+		},
+		{
+			title: '上传时间',
+			dataIndex: 'uploadTime',
+			key: 'uploadTime'
+		},
+		{
+			title: '状态',
+			key: 'status'
+		},
+		{
+			title: '操作',
+			key: 'action'
+		}
+	]
+
+	const columnsPublished = [...columnsPending]
+	const columnsRecycle = [...columnsPending]
+
+	const currentColumns = computed(() => {
+		switch (activeKey.value) {
+			case 'unpublished':
+				return columnsUnpublished
+			case 'pending':
+				return columnsPending
+			case 'published':
+				return columnsPublished
+			case 'recycle':
+				return columnsRecycle
+			default:
+				return []
+		}
+	})
+
+	const currentDataSource = computed(() => {
+		return dataSource.value.filter((item) => {
+			if (activeKey.value === 'unpublished') {
+				return ['processing', 'uploaded'].includes(item.status)
+			} else if (activeKey.value === 'pending') {
+				return item.status === 'pending'
+			} else if (activeKey.value === 'published') {
+				return item.status === 'published'
+			} else if (activeKey.value === 'recycle') {
+				return item.status === 'deleted'
+			}
+			return false
+		})
+	})
+
+	// 方法
+	const handleSearch = () => {
+		console.log('Search:', searchValue.value)
+	}
+
+	const handleReset = () => {
+		searchValue.value = ''
+	}
+	const tabChange = () => {
+		// dataSource.value = []
 	}
-])
-
-// 当前激活的标签页
-const activeKey = ref('unpublished')
-//发布按钮状态
-const releaseVisible = ref(false)
-
-// 搜索值
-const searchValue = ref('')
-
-// 列定义
-const columnsUnpublished = [
-	{
-		title: '编号',
-		dataIndex: 'id',
-		key: 'id'
-	},
-	{
-		title: '资源名称',
-		dataIndex: 'name',
-		key: 'name'
-	},
-	{
-		title: '课件格式',
-		dataIndex: 'format',
-		key: 'format'
-	},
-	{
-		title: '上传时间',
-		dataIndex: 'uploadTime',
-		key: 'uploadTime'
-	},
-	{
-		title: '状态',
-		key: 'status'
-	},
-	{
-		title: '操作',
-		key: 'action'
+
+	const handleUpload = () => {
+		console.log('Upload Resource')
+	}
+
+	const handlePublish = (record) => {
+		console.log('Publish:', record)
+		releaseVisible.value = true
+	}
+
+	const handleAudit = (record) => {
+		console.log('Audit:', record)
+	}
+
+	const handlePermission = (record) => {
+		console.log('Permission:', record)
+	}
+
+	const handleRestore = (record) => {
+		console.log('Restore:', record)
+	}
+
+	// 上传资源模态框
+	const uploadModalVisible = ref(false)
+
+	// 文件列表
+	const fileList = ref([])
+
+	// 显示上传模态框
+	const showUploadModal = () => {
+		uploadModalVisible.value = true
 	}
-]
-
-const columnsPending = [
-	{
-		title: '编号',
-		dataIndex: 'id',
-		key: 'id'
-	},
-	{
-		title: '资源名称',
-		dataIndex: 'name',
-		key: 'name'
-	},
-	{
-		title: '所属院系',
-		dataIndex: 'department',
-		key: 'department'
-	},
-	{
-		title: '所属专业',
-		dataIndex: 'major',
-		key: 'major'
-	},
-	{
-		title: '课程类型',
-		dataIndex: 'courseType',
-		key: 'courseType'
-	},
-	{
-		title: '课件格式',
-		dataIndex: 'format',
-		key: 'format'
-	},
-	{
-		title: '上传时间',
-		dataIndex: 'uploadTime',
-		key: 'uploadTime'
-	},
-	{
-		title: '状态',
-		key: 'status'
-	},
-	{
-		title: '操作',
-		key: 'action'
+
+	// 关闭模态框
+	const handleUploadCancel = () => {
+		uploadModalVisible.value = false
+		fileList.value = []
 	}
-]
-
-const columnsPublished = [...columnsPending]
-const columnsRecycle = [...columnsPending]
-
-const currentColumns = computed(() => {
-	switch (activeKey.value) {
-		case 'unpublished':
-			return columnsUnpublished
-		case 'pending':
-			return columnsPending
-		case 'published':
-			return columnsPublished
-		case 'recycle':
-			return columnsRecycle
-		default:
-			return []
+
+	// 确认上传
+	const handleUploadOk = () => {
+		// 这里可以添加实际的上传逻辑
+		console.log('Upload confirmed:', fileList.value)
+		uploadModalVisible.value = false
+		fileList.value = []
 	}
-})
-
-const currentDataSource = computed(() => {
-	return dataSource.value.filter((item) => {
-		if (activeKey.value === 'unpublished') {
-			return ['processing', 'uploaded'].includes(item.status)
-		} else if (activeKey.value === 'pending') {
-			return item.status === 'pending'
-		} else if (activeKey.value === 'published') {
-			return item.status === 'published'
-		} else if (activeKey.value === 'recycle') {
-			return item.status === 'deleted'
+
+	// 上传前的钩子函数
+	const beforeUpload = (file) => {
+		const isLt2G = file.size / 1024 / 1024 / 1024 < 2
+		if (!isLt2G) {
+			Modal.error({ content: '文件大小不能超过 2GB!' })
 		}
-		return false
-	})
-})
-
-// 方法
-const handleSearch = () => {
-	console.log('Search:', searchValue.value)
-}
-
-const handleReset = () => {
-	searchValue.value = ''
-}
-const tabChange = () => {
-	// dataSource.value = []
-}
-
-const handleUpload = () => {
-	console.log('Upload Resource')
-}
-
-const handlePublish = (record) => {
-	console.log('Publish:', record)
-	releaseVisible.value = true
-}
-
-const handleAudit = (record) => {
-	console.log('Audit:', record)
-}
-
-const handlePermission = (record) => {
-	console.log('Permission:', record)
-}
-
-const handleRestore = (record) => {
-	console.log('Restore:', record)
-}
-
-// 上传资源模态框
-const uploadModalVisible = ref(false)
-
-// 文件列表
-const fileList = ref([])
-
-// 显示上传模态框
-const showUploadModal = () => {
-	uploadModalVisible.value = true
-}
-
-// 关闭模态框
-const handleUploadCancel = () => {
-	uploadModalVisible.value = false
-	fileList.value = []
-}
-
-// 确认上传
-const handleUploadOk = () => {
-	// 这里可以添加实际的上传逻辑
-	console.log('Upload confirmed:', fileList.value)
-	uploadModalVisible.value = false
-	fileList.value = []
-}
-
-// 上传前的钩子函数
-const beforeUpload = (file) => {
-	const isLt2G = file.size / 1024 / 1024 / 1024 < 2
-	if (!isLt2G) {
-		Modal.error({ content: '文件大小不能超过 2GB!' })
+		return isLt2G
 	}
-	return isLt2G
-}
-
-// 移除文件
-const handleRemove = (file) => {
-	const index = fileList.value.indexOf(file)
-	const newFileList = fileList.value.slice()
-	newFileList.splice(index, 1)
-	fileList.value = newFileList
-}
-
-// 文件状态改变时的处理函数
-const handleChange = ({ file, fileList: newFileList }) => {
-	fileList.value = newFileList
-
-	if (file.status === 'uploading') {
-		file.percent = 0
+
+	// 移除文件
+	const handleRemove = (file) => {
+		const index = fileList.value.indexOf(file)
+		const newFileList = fileList.value.slice()
+		newFileList.splice(index, 1)
+		fileList.value = newFileList
 	}
 
-	if (file.status === 'done') {
-		Modal.success({ content: '文件上传成功' })
-	} else if (file.status === 'error') {
-		Modal.error({ content: '文件上传失败' })
+	// 文件状态改变时的处理函数
+	const handleChange = ({ file, fileList: newFileList }) => {
+		fileList.value = newFileList
+
+		if (file.status === 'uploading') {
+			file.percent = 0
+		}
+
+		if (file.status === 'done') {
+			Modal.success({ content: '文件上传成功' })
+		} else if (file.status === 'error') {
+			Modal.error({ content: '文件上传失败' })
+		}
 	}
-}
 </script>
 
-  <style scoped>
-.editable-cell {
-	position: relative;
-}
-
-.ant-dropdown-link {
-	margin-left: 8px;
-}
-
-.upload-area {
-	border: 2px dashed #3ca9f5;
-	padding: 40px;
-	text-align: center;
-}
-
-.upload-area p {
-	margin: 10px 0;
-}
-
-.file-item {
-	display: flex;
-	align-items: center;
-	margin: 10px 0;
-}
-
-.file-item .ant-progress {
-	flex: 1;
-	margin: 0 10px;
-}
+<style scoped>
+	.editable-cell {
+		position: relative;
+	}
+
+	.ant-dropdown-link {
+		margin-left: 8px;
+	}
+
+	.upload-area {
+		border: 2px dashed #3ca9f5;
+		padding: 40px;
+		text-align: center;
+	}
+
+	.upload-area p {
+		margin: 10px 0;
+	}
+
+	.file-item {
+		display: flex;
+		align-items: center;
+		margin: 10px 0;
+	}
+
+	.file-item .ant-progress {
+		flex: 1;
+		margin: 0 10px;
+	}
 </style>

+ 92 - 92
src/views/myResources/releaseModal.vue

@@ -51,106 +51,106 @@
 	</a-modal>
 </template>
 <script setup>
-import { ref, reactive } from 'vue'
-import { Modal, Upload } from 'ant-design-vue'
-import { PlusOutlined } from '@ant-design/icons-vue'
-const emit = defineEmits(['close'])
-// 表单数据
-const uploadForm = reactive({
-	resourceName: '',
-	resourceType: '',
-	courseName: '',
-	courseDescription: '',
-	coverImage: ''
-})
-
-// 封面文件列表
-const coverFileList = ref([])
-const fileList = ref([])
-
-const uploadModalVisible = ref(true)
-
-// 显示上传模态框
-// const showUploadModal = () => {
-// 	uploadModalVisible.value = true
-// }
-
-// 关闭模态框
-const handleUploadCancel = () => {
-	uploadModalVisible.value = false
-	Object.assign(uploadForm, {
+	import { ref, reactive } from 'vue'
+	import { Modal, Upload } from 'ant-design-vue'
+	import { PlusOutlined } from '@ant-design/icons-vue'
+	const emit = defineEmits(['close'])
+	// 表单数据
+	const uploadForm = reactive({
 		resourceName: '',
 		resourceType: '',
 		courseName: '',
 		courseDescription: '',
 		coverImage: ''
 	})
-	fileList.value = []
-	coverFileList.value = []
-	emit('close')
-}
-
-// 确认上传
-const handleUploadOk = () => {
-	// 这里可以添加实际的上传逻辑
-	console.log('Upload confirmed:', uploadForm, fileList.value, coverFileList.value)
-	uploadModalVisible.value = false
-	Object.assign(uploadForm, {
-		resourceName: '',
-		resourceType: '',
-		courseName: '',
-		courseDescription: '',
-		coverImage: ''
-	})
-	fileList.value = []
-	coverFileList.value = []
-}
-
-// 上传封面前的钩子函数
-const beforeUploadCover = (file) => {
-	const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'
-	if (!isJpgOrPng) {
-		Modal.error({ content: '仅支持上传jpg/png格式文件!' })
+
+	// 封面文件列表
+	const coverFileList = ref([])
+	const fileList = ref([])
+
+	const uploadModalVisible = ref(true)
+
+	// 显示上传模态框
+	// const showUploadModal = () => {
+	// 	uploadModalVisible.value = true
+	// }
+
+	// 关闭模态框
+	const handleUploadCancel = () => {
+		uploadModalVisible.value = false
+		Object.assign(uploadForm, {
+			resourceName: '',
+			resourceType: '',
+			courseName: '',
+			courseDescription: '',
+			coverImage: ''
+		})
+		fileList.value = []
+		coverFileList.value = []
+		emit('close')
 	}
-	const isLt500K = file.size / 1024 < 500
-	if (!isLt500K) {
-		Modal.error({ content: '单个文件不能超过500kb!' })
+
+	// 确认上传
+	const handleUploadOk = () => {
+		// 这里可以添加实际的上传逻辑
+		console.log('Upload confirmed:', uploadForm, fileList.value, coverFileList.value)
+		uploadModalVisible.value = false
+		Object.assign(uploadForm, {
+			resourceName: '',
+			resourceType: '',
+			courseName: '',
+			courseDescription: '',
+			coverImage: ''
+		})
+		fileList.value = []
+		coverFileList.value = []
+	}
+
+	// 上传封面前的钩子函数
+	const beforeUploadCover = (file) => {
+		const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'
+		if (!isJpgOrPng) {
+			Modal.error({ content: '仅支持上传jpg/png格式文件!' })
+		}
+		const isLt500K = file.size / 1024 < 500
+		if (!isLt500K) {
+			Modal.error({ content: '单个文件不能超过500kb!' })
+		}
+		return isJpgOrPng && isLt500K
+	}
+
+	// 移除封面文件
+	const handleRemoveCover = (file) => {
+		const index = coverFileList.value.indexOf(file)
+		const newFileList = coverFileList.value.slice()
+		newFileList.splice(index, 1)
+		coverFileList.value = newFileList
+	}
+
+	// 封面文件状态改变时的处理函数
+	const handleChangeCover = ({ file, fileList: newFileList }) => {
+		coverFileList.value = newFileList
 	}
-	return isJpgOrPng && isLt500K
-}
-
-// 移除封面文件
-const handleRemoveCover = (file) => {
-	const index = coverFileList.value.indexOf(file)
-	const newFileList = coverFileList.value.slice()
-	newFileList.splice(index, 1)
-	coverFileList.value = newFileList
-}
-
-// 封面文件状态改变时的处理函数
-const handleChangeCover = ({ file, fileList: newFileList }) => {
-	coverFileList.value = newFileList
-}
 </script>
 <style scoped>
-.upload-area {
-	border: 2px dashed #3ca9f5;
-	padding: 40px;
-	text-align: center;
-}
-
-.upload-area p {
-	margin: 10px 0;
-}
-
-.file-item {
-	display: flex;
-	align-items: center;
-	margin: 10px 0;
-}
-
-.file-item .ant-progress {
-	flex: 1;
-	margin: 0 10px;
-}
+	.upload-area {
+		border: 2px dashed #3ca9f5;
+		padding: 40px;
+		text-align: center;
+	}
+
+	.upload-area p {
+		margin: 10px 0;
+	}
+
+	.file-item {
+		display: flex;
+		align-items: center;
+		margin: 10px 0;
+	}
+
+	.file-item .ant-progress {
+		flex: 1;
+		margin: 0 10px;
+	}
 </style>

+ 108 - 142
src/views/taskProgress/index.vue

@@ -8,34 +8,22 @@
 				<a-radio-group v-model:value="selectedDepartment" button-style="solid">
 					<a-radio-button value="全部">全部</a-radio-button>
 					<a-radio-button value="航空理论系">航空理论系</a-radio-button>
-					<!-- 更多选项 -->
+					<a-radio-button value="军事理论系">军事理论系</a-radio-button>
+					<a-radio-button value="政治工作系">政治工作系</a-radio-button>
+					<a-radio-button value="机务工程系">机务工程系</a-radio-button>
+					<a-radio-button value="航空机务系">航空机务系</a-radio-button>
 				</a-radio-group>
-				<a-link style="float: right" @click="toggleDepartmentOptions">{{
-					isDepartmentExpanded ? '收起' : '展开'
-				}}</a-link>
 			</div>
-			<div v-if="isDepartmentExpanded" class="expanded-options">
-				<a-radio-button value="军事理论系">军事理论系</a-radio-button>
-				<a-radio-button value="政治工作系">政治工作系</a-radio-button>
-				<a-radio-button value="机务工程系">机务工程系</a-radio-button>
-				<a-radio-button value="航空机务系">航空机务系</a-radio-button>
-			</div>
-
 			<!-- 课程选择 -->
 			<div class="filter-group" style="margin-top: 16px">
 				<span class="filter-label">所选课程:</span>
 				<a-radio-group v-model:value="selectedCourse" button-style="solid">
 					<a-radio-button value="全部">全部</a-radio-button>
 					<a-radio-button value="初级飞行训练">初级飞行训练</a-radio-button>
-					<!-- 更多选项 -->
+					<a-radio-button value="高级飞行训练">高级飞行训练</a-radio-button>
+					<a-radio-button value="实弹训练">实弹训练</a-radio-button>
+					<a-radio-button value="低空战术飞行">低空战术飞行</a-radio-button>
 				</a-radio-group>
-				<a-link style="float: right" @click="toggleCourseOptions">{{ isCourseExpanded ? '收起' : '展开' }}</a-link>
-			</div>
-			<div v-if="isCourseExpanded" class="expanded-options">
-				<a-radio-button value="高级飞行训练">高级飞行训练</a-radio-button>
-				<a-radio-button value="实弹训练">实弹训练</a-radio-button>
-				<a-radio-button value="低空战术飞行">低空战术飞行</a-radio-button>
-				<!-- 更多选项 -->
 			</div>
 
 			<!-- 课程类型选择 -->
@@ -44,11 +32,7 @@
 				<a-radio-group v-model:value="selectedCourseType" button-style="solid">
 					<a-radio-button value="全部">全部</a-radio-button>
 					<a-radio-button value="热门资源">热门资源</a-radio-button>
-					<!-- 更多选项 -->
 				</a-radio-group>
-				<a-link style="float: right" @click="toggleCourseTypeOptions">{{
-					isCourseTypeExpanded ? '收起' : '展开'
-				}}</a-link>
 			</div>
 
 			<!-- 课件格式选择 -->
@@ -56,16 +40,10 @@
 				<span class="filter-label">课件格式:</span>
 				<a-radio-group v-model:value="selectedFileType" button-style="solid">
 					<a-radio-button value="全部">全部</a-radio-button>
-					<a-radio-button value="ppt">PPT</a-radio-button>
-					<!-- 更多选项 -->
+					<a-radio-button value="word">Word</a-radio-button>
+					<a-radio-button value="excel">Excel</a-radio-button>
+					<a-radio-button value="pdf">PDF</a-radio-button>
 				</a-radio-group>
-				<a-link style="float: right" @click="toggleFileTypeOptions">{{ isFileTypeExpanded ? '收起' : '展开' }}</a-link>
-			</div>
-			<div v-if="isFileTypeExpanded" class="expanded-options">
-				<a-radio-button value="word">Word</a-radio-button>
-				<a-radio-button value="excel">Excel</a-radio-button>
-				<a-radio-button value="pdf">PDF</a-radio-button>
-				<!-- 更多选项 -->
 			</div>
 
 			<!-- 已选条件展示 -->
@@ -128,118 +106,106 @@
 	</div>
 </template>
 
-  <script setup>
-import { ref, computed, watch } from 'vue'
-
-// 模拟数据
-const resources = [
-	{
-		title: '学术交流英语',
-		description: '学术交流英语描述',
-		school: '来源学校',
-		author: '姓名',
-		date: '05-22 10:49',
-		views: '10000',
-		cover: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'
+<script setup>
+	import { ref, computed, watch } from 'vue'
+
+	// 模拟数据
+	const resources = [
+		{
+			title: '学术交流英语',
+			description: '学术交流英语描述',
+			school: '来源学校',
+			author: '姓名',
+			date: '05-22 10:49',
+			views: '10000',
+			cover: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'
+		}
+		// 更多资源项...
+	]
+
+	const recommendedResources = [
+		{
+			title: '资源名称',
+			date: '05-22',
+			views: '10000'
+		}
+		// 更多推荐资源项...
+	]
+
+	// 筛选条件
+	const selectedDepartment = ref('全部')
+	const selectedCourse = ref('全部')
+	const selectedCourseType = ref('全部')
+	const selectedFileType = ref('全部')
+	const searchKeyword = ref('')
+
+	const selectedTags = ref([])
+	watch(
+		[selectedDepartment, selectedCourse, selectedCourseType, selectedFileType],
+		(newValues) => {
+			selectedTags.value = [
+				...(newValues[0] !== '全部' ? [newValues[0]] : []),
+				...(newValues[1] !== '全部' ? [newValues[1]] : []),
+				...(newValues[2] !== '全部' ? [newValues[2]] : []),
+				...(newValues[3] !== '全部' ? [newValues[3]] : [])
+			]
+		},
+		{ immediate: true }
+	)
+	// 过滤资源
+	const filteredResources = computed(() => {
+		return resources.filter((resource) => {
+			const deptMatch = selectedDepartment.value === '全部' || resource.department === selectedDepartment.value
+			const courseMatch = selectedCourse.value === '全部' || resource.course === selectedCourse.value
+			const typeMatch = selectedCourseType.value === '全部' || resource.type === selectedCourseType.value
+			const formatMatch = selectedFileType.value === '全部' || resource.format === selectedFileType.value
+
+			return deptMatch && courseMatch && typeMatch && formatMatch
+		})
+	})
+
+	// 清除筛选条件
+	const clearFilters = () => {
+		selectedDepartment.value = '全部'
+		selectedCourse.value = '全部'
+		selectedCourseType.value = '全部'
+		selectedFileType.value = '全部'
+		selectedTags.value = []
 	}
-	// 更多资源项...
-]
-
-const recommendedResources = [
-	{
-		title: '资源名称',
-		date: '05-22',
-		views: '10000'
+
+	// 处理标签关闭
+	const handleTagClose = (tag) => {
+		selectedTags.value = selectedTags.value.filter((t) => t !== tag)
+		if (tag === selectedDepartment.value) selectedDepartment.value = '全部'
+		else if (tag === selectedCourse.value) selectedCourse.value = '全部'
+		else if (tag === selectedCourseType.value) selectedCourseType.value = '全部'
+		else if (tag === selectedFileType.value) selectedFileType.value = '全部'
+	}
+
+	// 搜索功能
+	const onSearch = (value) => {
+		console.log('search:', value)
+		// 这里可以添加搜索逻辑
 	}
-	// 更多推荐资源项...
-]
-
-// 筛选条件
-const selectedDepartment = ref('全部')
-const selectedCourse = ref('全部')
-const selectedCourseType = ref('全部')
-const selectedFileType = ref('全部')
-const searchKeyword = ref('')
-
-const selectedTags = ref([])
-
-// 展开/收起状态
-const isDepartmentExpanded = ref(false)
-const isCourseExpanded = ref(false)
-const isCourseTypeExpanded = ref(false)
-const isFileTypeExpanded = ref(false)
-
-// 过滤资源
-const filteredResources = computed(() => {
-	return resources.filter((resource) => {
-		const deptMatch = selectedDepartment.value === '全部' || resource.department === selectedDepartment.value
-		const courseMatch = selectedCourse.value === '全部' || resource.course === selectedCourse.value
-		const typeMatch = selectedCourseType.value === '全部' || resource.type === selectedCourseType.value
-		const formatMatch = selectedFileType.value === '全部' || resource.format === selectedFileType.value
-
-		return deptMatch && courseMatch && typeMatch && formatMatch
-	})
-})
-
-// 清除筛选条件
-const clearFilters = () => {
-	selectedDepartment.value = '全部'
-	selectedCourse.value = '全部'
-	selectedCourseType.value = '全部'
-	selectedFileType.value = '全部'
-	selectedTags.value = []
-}
-
-// 处理标签关闭
-const handleTagClose = (tag) => {
-	selectedTags.value = selectedTags.value.filter((t) => t !== tag)
-	if (tag === selectedDepartment.value) selectedDepartment.value = '全部'
-	else if (tag === selectedCourse.value) selectedCourse.value = '全部'
-	else if (tag === selectedCourseType.value) selectedCourseType.value = '全部'
-	else if (tag === selectedFileType.value) selectedFileType.value = '全部'
-}
-
-// 搜索功能
-const onSearch = (value) => {
-	console.log('search:', value)
-	// 这里可以添加搜索逻辑
-}
-
-// 切换展开/收起状态
-const toggleDepartmentOptions = () => {
-	isDepartmentExpanded.value = !isDepartmentExpanded.value
-}
-
-const toggleCourseOptions = () => {
-	isCourseExpanded.value = !isCourseExpanded.value
-}
-
-const toggleCourseTypeOptions = () => {
-	isCourseTypeExpanded.value = !isCourseTypeExpanded.value
-}
-
-const toggleFileTypeOptions = () => {
-	isFileTypeExpanded.value = !isFileTypeExpanded.value
-}
 </script>
 
-  <style scoped>
-.resource-page {
-	padding: 20px;
-}
-
-.filter-group {
-	display: flex;
-	align-items: center;
-}
-
-.filter-label {
-	margin-right: 10px;
-}
-
-.expanded-options {
-	display: flex;
-	flex-wrap: wrap;
-	margin-top: 8px;
-}
+<style scoped>
+	.resource-page {
+		padding: 20px;
+	}
+
+	.filter-group {
+		display: flex;
+		align-items: center;
+	}
+
+	.filter-label {
+		margin-right: 10px;
+	}
+
+	.expanded-options {
+		display: flex;
+		flex-wrap: wrap;
+		margin-top: 8px;
+	}
 </style>