zhangsq 7 ヶ月 前
コミット
dfcbc738a6

+ 27 - 0
src/api/semesterApi.js

@@ -0,0 +1,27 @@
+import { baseRequest } from '@/utils/request'
+
+const request = (url, ...arg) => baseRequest(`/api/webapp/disk/semester/` + url, ...arg)
+
+/**
+ * 学期表Api接口管理器
+ *
+ * @author honorfire
+ * @date  2025/07/22 18:17
+ **/
+export default {
+	// 获取学期表分页
+	semesterPage(data) {
+		return request('page', data, 'get')
+	},
+	// 提交学期表表单 edit为true时为编辑,默认为新增
+	semesterSubmitForm(data, edit = false) {
+		return request(edit ? 'edit' : 'add', data)
+	},
+	// 删除学期表
+	semesterDelete(data) {
+		return request('delete', data)
+	},
+	// 获取学期表详情
+	semesterDetail(data) {
+		return request('detail', data, 'get')
+	}}

+ 47 - 0
src/api/studentCourseCenter/index.js

@@ -0,0 +1,47 @@
+// 文件模块相关接口
+import { moduleRequest } from '@/utils/reSourceRequest'
+
+const request = moduleRequest(`/api/webapp/`)
+
+/**
+ * 获取文件列表相关接口
+ */
+// 获取文件列表(区分文件路径)
+export const list = (p) => request('disk/coursecentry/page', p, 'get')
+// 获取文件列表(区分文件类型)
+// export const getFileListByType = (p) => request('file/selectfilebyfiletype', p, 'get')
+
+// 进入详情之后增加观看次数
+export const addViewCount = (p) => request('disk/courseauditrecord/addViewCount', p, 'post')
+//详情
+export const detail = (p) => request('disk/courseauditrecord/detail', p, 'get')
+//收藏增加
+export const add = (p) => request('disk/collect/add', p, 'post')
+//收藏查询
+export const queryList = (p) => request('disk/collect/queryList', p, 'get')
+//取消收藏
+export const cancel = (p) => request('disk/collect/cancel', p, 'post')
+//添加评论/回复
+export const addComment = (p) => request('disk/comment/add', p, 'post')
+//修改评论
+export const editComment = (p) => request('disk/comment/edit', p, 'post')
+//删除评论
+export const deleteComment = (p) => request('disk/comment/delete', p, 'post')
+//评论查询
+export const pageComment = (p) => request('disk/comment/page', p, 'get')
+//点赞
+export const giveComment = (p) => request('disk/comment/give', p, 'get')
+//取消点赞
+export const giveCancelComment = (p) => request('disk/comment/giveCancel', p, 'get')
+//资源中心的详情
+export const resourcecentreDetail = (p) => request('disk/resourcecentre/detail', p, 'get')
+//获取分享链接
+export const getShareLink = (p) => request('disk/courseauditrecord/getShareLink', p, 'get')
+//搜索条件
+export const getQueryTreeAll = (p) => request('disk/type/treeAll', p, 'get')
+//获取评论列表hot
+export const getTalkPageList = (p) => request('disk/comment/pageList', p, 'get')
+//筛查文件格式
+export const getAllListFileFormat = (p) => request('disk/fileformat/allList', p, 'get')
+
+export const checkAuth = (p) => request('disk/fileformat/allList', p, 'get')

+ 7 - 7
src/views/courseCenter/components/ResourceList.vue

@@ -50,15 +50,15 @@
 									border-radius: 4px;
 								"
 							>
-								共{{ item.lessonCount }}节课
+								共{{ item.hourCount }}节课
 							</div>
 						</div>
 					</div>
 					<div style="display: flex; flex-direction: column; padding: 5px 10px">
-						<span style="font-size: 16px; font-weight: bold">{{ item.fileName }}</span>
-						<span style="font-size: 12px">{{ item.collegeIdName }}</span>
-						<span style="font-size: 12px">{{ item.majorIdName }}</span>
-						<div style="display: flex; justify-content: space-between">
+						<span style="font-size: 16px; font-weight: bold">{{ item.courseName || '-' }}</span>
+						<span style="font-size: 12px">{{ item.majorIdName || '-' }}</span>
+						<span style="font-size: 12px">{{ item.teacherIdName || '-' }}</span>
+						<!-- <div style="display: flex; justify-content: space-between">
 							<div style="display: flex; justify-content: center; align-items: center">
 								<FieldTimeOutlined />
 								<div style="width: 5px"></div>
@@ -70,7 +70,7 @@
 								<div style="width: 5px"></div>
 								<span style="font-size: 12px">{{ item.viewCount }}</span>
 							</div>
-						</div>
+						</div> -->
 					</div>
 				</div>
 			</a-col>
@@ -92,7 +92,7 @@
 <script setup>
 	import { ref, onMounted } from 'vue'
 	import TabSwitcher from './TabSwitcher.vue'
-	import { list } from '@/api/portal'
+	import { list } from '@/api/studentCourseCenter'
 	import tool from '@/utils/tool'
 	import EventBus from '@/utils/EventBus'
 	import sysConfig from '@/config/index'

+ 93 - 0
src/views/semester/form.vue

@@ -0,0 +1,93 @@
+<template>
+	<xn-form-container
+		:title="formData.id ? '编辑学期表' : '增加学期表'"
+		:width="700"
+		:visible="visible"
+		:destroy-on-close="true"
+		@close="onClose"
+	>
+		<a-form ref="formRef" :model="formData" :rules="formRules" layout="vertical">
+			<a-form-item label="年度:" name="multiyear">
+				<a-input v-model:value="formData.multiyear" placeholder="请输入年度" allow-clear />
+			</a-form-item>
+			<a-form-item label="季度:" name="quater">
+				<a-input v-model:value="formData.quater" placeholder="请输入季度" allow-clear />
+			</a-form-item>
+			<a-form-item label="起始时间起:" name="startTime">
+				<a-date-picker
+					v-model:value="formData.startTime"
+					value-format="YYYY-MM-DD HH:mm:ss"
+					show-time
+					placeholder="请选择起始时间起"
+					style="width: 100%"
+				/>
+			</a-form-item>
+			<a-form-item label="起始时间止:" name="endTime">
+				<a-date-picker
+					v-model:value="formData.endTime"
+					value-format="YYYY-MM-DD HH:mm:ss"
+					show-time
+					placeholder="请选择起始时间止"
+					style="width: 100%"
+				/>
+			</a-form-item>
+			<a-form-item label="学期名称:" name="name">
+				<a-input v-model:value="formData.name" placeholder="请输入学期名称" allow-clear />
+			</a-form-item>
+		</a-form>
+		<template #footer>
+			<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
+			<a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
+		</template>
+	</xn-form-container>
+</template>
+
+<script setup name="semesterForm">
+	import { cloneDeep } from 'lodash-es'
+	import { required } from '@/utils/formRules'
+	import semesterApi from '@/api/semesterApi'
+	// 抽屉状态
+	const visible = ref(false)
+	const emit = defineEmits({ successful: null })
+	const formRef = ref()
+	// 表单数据
+	const formData = ref({})
+	const submitLoading = ref(false)
+
+	// 打开抽屉
+	const onOpen = (record) => {
+		visible.value = true
+		if (record) {
+			let recordData = cloneDeep(record)
+			formData.value = Object.assign({}, recordData)
+		}
+	}
+	// 关闭抽屉
+	const onClose = () => {
+		formRef.value.resetFields()
+		formData.value = {}
+		visible.value = false
+	}
+	// 默认要校验的
+	const formRules = {}
+	// 验证并提交数据
+	const onSubmit = () => {
+		formRef.value.validate().then(() => {
+			submitLoading.value = true
+			const formDataParam = cloneDeep(formData.value)
+			semesterApi
+				.semesterSubmitForm(formDataParam, formDataParam.id)
+				.then(() => {
+					onClose()
+					emit('successful')
+				})
+				.finally(() => {
+					submitLoading.value = false
+				})
+		})
+	}
+	// 抛出函数
+	defineExpose({
+		onOpen
+	})
+</script>

+ 124 - 0
src/views/semester/index.vue

@@ -0,0 +1,124 @@
+<template>
+	<a-card :bordered="false">
+		<s-table
+			ref="table"
+			:columns="columns"
+			:data="loadData"
+			:alert="options.alert.show"
+			bordered
+			:row-key="(record) => record.id"
+			:tool-config="toolConfig"
+			:row-selection="options.rowSelection"
+		>
+			<template #operator class="table-operator">
+				<a-space>
+					<a-button type="primary" @click="formRef.onOpen()">
+						<template #icon><plus-outlined /></template>
+						新增
+					</a-button>
+					<xn-batch-delete :selectedRowKeys="selectedRowKeys" @batchDelete="deleteBatchSemester" />
+				</a-space>
+			</template>
+			<template #bodyCell="{ column, record }">
+				<template v-if="column.dataIndex === 'action'">
+					<a-space>
+						<a @click="formRef.onOpen(record)">编辑</a>
+						<a-divider type="vertical" />
+						<a-popconfirm title="确定要删除吗?" @confirm="deleteSemester(record)">
+							<a-button type="link" danger size="small">删除</a-button>
+						</a-popconfirm>
+					</a-space>
+				</template>
+			</template>
+		</s-table>
+	</a-card>
+	<Form ref="formRef" @successful="table.refresh(true)" />
+</template>
+
+<script setup name="semester">
+	import Form from './form.vue'
+	import semesterApi from '@/api/semesterApi'
+	const table = ref()
+	const formRef = ref()
+	const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
+	const columns = [
+		{
+			title: '年度',
+			dataIndex: 'multiyear'
+		},
+		{
+			title: '季度',
+			dataIndex: 'quater'
+		},
+		{
+			title: '起始时间起',
+			dataIndex: 'startTime'
+		},
+		{
+			title: '起始时间止',
+			dataIndex: 'endTime'
+		},
+		{
+			title: '学期名称',
+			dataIndex: 'name'
+		},
+		{
+			title: '操作',
+			dataIndex: 'action',
+			align: 'center',
+			width: '150px'
+		}
+	]
+	// 操作栏通过权限判断是否显示
+	// if (hasPerm(['semesterEdit', 'semesterDelete'])) {
+	// 	columns.push({
+	// 		title: '操作',
+	// 		dataIndex: 'action',
+	// 		align: 'center',
+	// 		width: '150px'
+	// 	})
+	// }
+	const selectedRowKeys = ref([])
+	// 列表选择配置
+	const options = {
+		// columns数字类型字段加入 needTotal: true 可以勾选自动算账
+		alert: {
+			show: true,
+			clear: () => {
+				selectedRowKeys.value = ref([])
+			}
+		},
+		rowSelection: {
+			onChange: (selectedRowKey, selectedRows) => {
+				selectedRowKeys.value = selectedRowKey
+			}
+		}
+	}
+	const loadData = (parameter) => {
+		return semesterApi.semesterPage(parameter).then((data) => {
+			return data
+		})
+	}
+	// 重置
+	const reset = () => {
+		searchFormRef.value.resetFields()
+		table.value.refresh(true)
+	}
+	// 删除
+	const deleteSemester = (record) => {
+		let params = [
+			{
+				id: record.id
+			}
+		]
+		semesterApi.semesterDelete(params).then(() => {
+			table.value.refresh(true)
+		})
+	}
+	// 批量删除
+	const deleteBatchSemester = (params) => {
+		semesterApi.semesterDelete(params).then(() => {
+			table.value.clearRefreshSelected()
+		})
+	}
+</script>