于添 пре 6 месеци
родитељ
комит
fb3d655017

+ 4 - 0
src/api/forum/forumApi.js

@@ -14,6 +14,10 @@ export default {
 	submitForm(data, edit = false) {
 		return request(`forum/postinfo/${edit ? 'edit' : 'add'}`, data)
 	},
+	// 发帖接口 // 章节讨论
+	submitFormGetChapter(data) {
+		return request('forum/postinfo/getChapter', data, 'get')
+	},
 	// 帖子详情接口
 	forumTypeDetail(data) {
 		return request('forum/postinfo/detail', data, 'get')

+ 34 - 33
src/views/courseAdd/components/courseInfo.vue

@@ -33,31 +33,31 @@
 			></coverUpload>
 		</a-form-item>
 
-		<a-form-item label="院系" name="collegeTwoId">
-			<a-select
-				v-model:value="formState.collegeTwoId"
-				:fieldNames="{ label: 'name', value: 'id' }"
-				:options="collegeMajorOptions"
-				placeholder="请选择专业"
-				@change="changeCollegeMajor"
-			/>
-<!--			<a-cascader-->
-<!--				v-model:value="majorIdName"-->
-<!--				:options="collegeMajorOptions"-->
+<!--		<a-form-item label="院系" name="collegeTwoId">-->
+<!--			<a-select-->
+<!--				v-model:value="formState.collegeTwoId"-->
 <!--				:fieldNames="{ label: 'name', value: 'id' }"-->
-<!--				placeholder="请选择院系"-->
-<!--				changeOnSelect-->
+<!--				:options="collegeMajorOptions"-->
+<!--				placeholder="请选择专业"-->
 <!--				@change="changeCollegeMajor"-->
 <!--			/>-->
-		</a-form-item>
-		<a-form-item label="专业" name="majorId">
-			<a-select
-				v-model:value="formState.majorId"
-				:fieldNames="{ label: 'majorName', value: 'id' }"
-				:options="majorOptions"
-				placeholder="请选择专业"
-			/>
-		</a-form-item>
+<!--&lt;!&ndash;			<a-cascader&ndash;&gt;-->
+<!--&lt;!&ndash;				v-model:value="majorIdName"&ndash;&gt;-->
+<!--&lt;!&ndash;				:options="collegeMajorOptions"&ndash;&gt;-->
+<!--&lt;!&ndash;				:fieldNames="{ label: 'name', value: 'id' }"&ndash;&gt;-->
+<!--&lt;!&ndash;				placeholder="请选择院系"&ndash;&gt;-->
+<!--&lt;!&ndash;				changeOnSelect&ndash;&gt;-->
+<!--&lt;!&ndash;				@change="changeCollegeMajor"&ndash;&gt;-->
+<!--&lt;!&ndash;			/>&ndash;&gt;-->
+<!--		</a-form-item>-->
+<!--		<a-form-item label="专业" name="majorId">-->
+<!--			<a-select-->
+<!--				v-model:value="formState.majorId"-->
+<!--				:fieldNames="{ label: 'majorName', value: 'id' }"-->
+<!--				:options="majorOptions"-->
+<!--				placeholder="请选择专业"-->
+<!--			/>-->
+<!--		</a-form-item>-->
 
 		<a-form-item label="教室描述" name="courseDesc">
 			<quill-editor
@@ -106,15 +106,15 @@
 		}
 	})
 	const formState = reactive({
-		courseName: null,
-		teacherId: null,
-		courseType: null,
-		courseDesc: null,
-		collegeId: null, //院校一级id
-		collegeTwoId: null, //院校二级id
-		collegeThreeId: null, //院校三级id
-		majorId: null, //专业
-		coverImageId: null //封面id
+		courseName: undefined,
+		teacherId: undefined,
+		courseType: undefined,
+		courseDesc: undefined,
+		collegeId: undefined, //院校一级id
+		collegeTwoId: undefined, //院校二级id
+		collegeThreeId: undefined, //院校三级id
+		majorId: undefined, //专业
+		coverImageId: undefined //封面id
 	})
 	const rules = {
 		courseName: [{ required: true, message: '请输入教室名称', trigger: 'blur' }],
@@ -219,6 +219,7 @@
 	}
 	const changeCollegeMajor = (value, selectedOptions) => {
 		console.log('Selected:', value, selectedOptions)
+		return false
 		if (!value) {
 			formState.collegeTwoId = ''
 			// majorIdName.value = ''
@@ -272,7 +273,7 @@
 			formState.courseName = res.data.courseName
 			formState.teacherId = res.data.teacherId
 			formState.collegeId = res.data.collegeId
-			formState.collegeTwoId = res.data.collegeTwoId
+			// formState.collegeTwoId = res.data.collegeTwoId
 			// majorIdName.value = res.data.collegeAllId?.split(',')
 			getCollegeMajor(formState.collegeTwoId)
 			formState.courseType = res.data.courseType
@@ -280,7 +281,7 @@
 			toRaw(quillEditorRef.value).setHTML(formState.courseDesc)
 			formState.coverImageId = res.data.coverImageId
 			coverImagePath.value = res.data.coverImagePath
-			formState.majorId = res.data.majorId
+			// formState.majorId = res.data.majorId
 		})
 	}
 	//  const quill = toRaw(myQuillEditor.value).getQuill()

+ 15 - 2
src/views/courseAdd/components/courseProduction/index.vue

@@ -56,6 +56,13 @@
 				<a-form-item label="章节名称">
 					<a-input v-model:value="formState.chapterName" placeholder="请输入章节名称"/>
 				</a-form-item>
+				<a-form-item label="章节名称">
+					<a-select v-model:value="formState.knowledgeIds"  placeholder="请选择状态" style="width: 120px; margin-right: 12px">
+						<a-select-option v-for="(item, index) in knowledgeOptions" :key="index" :value="item.value">{{
+								item.label
+							}}</a-select-option>
+					</a-select>
+				</a-form-item>
 			</a-form>
 		</a-modal>
 		<!-- 添加课时模态框 -->
@@ -69,6 +76,7 @@ import addDialog from './addDialog.vue'
 import courseProductionApi from '@/api/courseCenter/courseProduction.js'
 import {useRoute, useRouter} from 'vue-router'
 import { del ,  edit as editApi } from '@/api/hour/index'
+import tool from "@/utils/tool";
 
 
 const router = useRouter()
@@ -76,7 +84,7 @@ const route = useRoute()
 const popoverVisible = ref({})
 const modeTag = ref('add')
 const dialogTitle = ref('添加章节')
-
+const knowledgeOptions = tool.dictList('knowledge')
 
 const props = defineProps({
 	//课程id
@@ -109,7 +117,8 @@ const addDialogRef = ref(null)
 // 表单状态
 const formState = reactive({
 	id: '',
-	chapterName: ''
+	chapterName: '',
+	knowledgeIds : []
 })
 const pagination = reactive({
 	pageSize: 10,
@@ -123,6 +132,7 @@ const showModal = () => {
 	modeTag.value = 'add'
 	modalVisible.value = true
 	formState.chapterName = ''
+	formState.knowledgeIds = []
 }
 
 // 确认按钮点击事件
@@ -237,7 +247,10 @@ const onAddChapter = () => {
 }
 onMounted(() => {
 	console.log('有没有id呢', props.courseInfoId)
+	console.log('有没有字典',knowledgeOptions)
 	getList()
+
+
 })
 </script>
 

+ 3 - 3
src/views/courseAdd/index.vue

@@ -9,9 +9,9 @@
 					<a-tab-pane key="2" tab="课程制作" :disabled="courseInfoId==null">
 						<courseProduction :courseInfoId="courseInfoId" />
 					</a-tab-pane>
-					<a-tab-pane key="3" tab="学员管理" :disabled="courseInfoId==null">
-						<StudentDetails :courseInfoId="courseInfoId"></StudentDetails>
-					</a-tab-pane>
+<!--					<a-tab-pane key="3" tab="学员管理" :disabled="courseInfoId==null">-->
+<!--						<StudentDetails :courseInfoId="courseInfoId"></StudentDetails>-->
+<!--					</a-tab-pane>-->
 <!--					<a-tab-pane key="4" tab="作业布置" :disabled="courseInfoId==null">-->
 <!--						<div>这里是作业布置的内容</div>-->
 <!--					</a-tab-pane>-->

+ 16 - 13
src/views/forum/addForum.vue

@@ -8,7 +8,7 @@
 							<a-input v-model:value="formData.postTitle" placeholder="请输入标题" allow-clear />
 						</a-form-item>
 					</a-col>
-					<a-col :span="8">
+					<a-col :span="8" v-if="formData.postType==0">
 						<a-form-item label="分类:" name="typeId">
 							<a-select
 								v-model:value="formData.typeId"
@@ -35,7 +35,7 @@
 					</a-col>
 					<a-col :span="24">
 						<a-form-item label="内容:" name="postContent">
-							<xn-editor v-model="formData.postContent" placeholder="请输入内容" :height="400"></xn-editor>
+							<xn-editor v-model="formData.postContent" placeholder="请输入内容" :height="600"></xn-editor>
 						</a-form-item>
 					</a-col>
 				</a-row>
@@ -56,6 +56,7 @@
 	import XnEditor from '@/components/Editor/index.vue'
 	import Bowser from 'bowser'
 	import { useRoute, useRouter } from 'vue-router'
+	import sysConfig from '@/config/index'
 	const route = useRoute()
 	const router = useRouter()
 	const { proxy } = getCurrentInstance()
@@ -77,9 +78,8 @@
 		return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
 	}
 
-	// 打开抽屉
-	const onOpen = () => {
-		forumApi.forumTypeList().then((data) => {
+	const getData = async () => {
+		await forumApi.forumTypeList().then((data) => {
 			typeOptions.value = data.map((r) => {
 				return {
 					label: r.typeName,
@@ -88,7 +88,7 @@
 				}
 			})
 		})
-		forumApi.allUserList().then((data) => {
+		await forumApi.allUserList().then((data) => {
 			usertypeOptions.value = data.map((r) => {
 				return {
 					label: r.name,
@@ -103,14 +103,14 @@
 		if (route.query.postType == 2) {
 			errorCorrection()
 		}
+		formData.value.postType = parseFloat(route.query.postType)
 	}
-	setTimeout(() => {
-		onOpen()
-	}, 0)
+	onMounted(() => {
+		getData()
+	})
 	// 关闭抽屉
 	const onClose = () => {
 		formRef.value.resetFields()
-		window.close()
 		router.push({
 			path: '/forum'
 		})
@@ -137,14 +137,12 @@
 					params = {
 						...formData.value,
 						...browserObj.value,
-						postType: route.query.postType
 					}
 				}
 				if (route.query.postType == 2) {
 					params = {
 						...formData.value,
 						...errorVal.value,
-						postType: route.query.postType
 					}
 				}
 				forumApi.submitForm(params).then(() => {
@@ -176,9 +174,14 @@
 	function errorCorrection() {
 		errorVal.value = {
 			contentCorrectionParam: {
-				resourceType: route.query.type,
+				resourceType: route.query.resourceType,
 				resourceId: route.query.id
 			}
 		}
+		let videoUrl = route.query.videoUrl ? decodeURIComponent(atob(route.query.videoUrl)) : ''
+		if (videoUrl) {
+			let html = `<p>${route.query.title}</p><video controls name="media" style="width:100%; height: auto;"><source src="${videoUrl}"></video>`
+			formData.value.postContent = html
+		}
 	}
 </script>

+ 42 - 6
src/views/forum/detail.vue

@@ -2,7 +2,7 @@
 	<div style="display: flex; justify-content: center" class="main-content-wrapper">
 		<div style="width: 1200px">
 			<a-card>
-				<div style="display: flex; justify-content: space-between">
+				<div style="display: flex; justify-content: space-between" v-if="detailObj.userNickName">
 					<div style="display: flex">
 						<a-avatar
 							style="width: 60px; height: 60px"
@@ -20,7 +20,7 @@
 				<div class="forum-list-title">{{ detailObj.postTitle }}</div>
 				<div class="htmlContent" v-html="detailObj.postContent"></div>
 				<div>
-					<span>
+					<span v-if="detailObj.userNickName">
 						<a-tooltip title="点赞">
 							<template v-if="detailObj.isLike == 1">
 								<HeartOutlined :style="{ color: '#fa6c8d' }" @click="like(detailObj, 0)" />
@@ -41,7 +41,7 @@
 						<span>回复</span>
 						<span style="padding-left: 8px">{{ detailObj.replyCount }}</span>
 					</span>
-					<a-tooltip title="举报">
+					<a-tooltip title="举报" v-if="detailObj.userNickName">
 						<WarningOutlined class="ml-2" @click="reportFormRef.onOpen(detailObj, detailObj.postId)" />
 					</a-tooltip>
 				</div>
@@ -117,15 +117,51 @@
 	}
 	function morePaging() {
 		pagination.value.current += 1
-		getDetail(true)
+		if (route.query.postId) {
+			getDetail(true)
+		} else {
+			submitFormGetChapter(true)
+		}
 	}
 	function resetGetList() {
 		pagination.value.size = 10
 		pagination.value.current = 1
 		moreType.value = true
-		getDetail()
+		if (route.query.postId) {
+			getDetail()
+		} else {
+			submitFormGetChapter()
+		}
 	}
-	getDetail()
+	const submitFormGetChapter = (p) => {
+		forumApi
+			.submitFormGetChapter({
+				courseId: route.query.courseId,
+				chapterId: route.query.chapterId,
+				courseName: route.query.courseName,
+				chapterName: route.query.chapterName,
+				...pagination.value
+			})
+			.then((data) => {
+				if (p) {
+					if (data.replyList.records.length > 0) {
+						detailObj.value.replyList.records = detailObj.value.replyList.records.concat(data.replyList.records)
+					} else {
+						pagination.value.current -= 1
+						moreType.value = false
+					}
+				} else {
+					detailObj.value = data
+				}
+			})
+	}
+	onMounted(() => {
+		if (route.query.postId) {
+			getDetail()
+		} else {
+			submitFormGetChapter()
+		}
+	})
 </script>
 
 <style scoped>

Разлика између датотеке није приказан због своје велике величине
+ 6 - 0
src/views/forum/index.vue


+ 1 - 1
src/views/forum/replyForm.vue

@@ -56,7 +56,7 @@
 
 	// 打开抽屉
 	const onOpen = (record, module, childId, formType) => {
-		moduleId.value = module
+		moduleId.value = module ?? record.postId
 		replyid.value = childId ?? '-1'
 		visible.value = true
 		formData.value.formType = formType

Неке датотеке нису приказане због велике количине промена