Преглед изворни кода

通知公告结束 班级管理结束

于添 пре 7 месеци
родитељ
комит
57542dbf3b

+ 18 - 0
src/api/grades/index.js

@@ -0,0 +1,18 @@
+// 文件模块相关接口
+import { moduleRequest } from '@/utils/reSourceRequest'
+
+const request = moduleRequest(`/api/webapp/`)
+
+/**
+ * 获取文件列表相关接口
+ */
+// 获取文件列表(区分文件路径)
+export const list = (p) => request('disk/grades/page', p, 'get')
+// 进入详情之后增加观看次数
+export const addItem = (p) => request('disk/grades/add', p, 'post')
+export const editItem = (p) => request('disk/grades/edit', p, 'post')
+//详情
+export const detail = (p) => request('disk/grades/detail', p, 'get')
+//收藏增加
+//资源列表 排除没权限得条目
+export const courceDownList = (p) => request('disk/grades/delete', p, 'post')

+ 18 - 0
src/api/notice/index.js

@@ -0,0 +1,18 @@
+// 文件模块相关接口
+import { moduleRequest } from '@/utils/reSourceRequest'
+
+const request = moduleRequest(`/api/webapp/`)
+
+/**
+ * 获取文件列表相关接口
+ */
+// 获取文件列表(区分文件路径)
+export const list = (p) => request('disk/notice/page', p, 'get')
+// 进入详情之后增加观看次数
+export const addItem = (p) => request('disk/notice/add', p, 'post')
+export const editItem = (p) => request('disk/notice/edit', p, 'post')
+//详情
+export const detail = (p) => request('disk/notice/detail', p, 'get')
+//收藏增加
+//资源列表 排除没权限得条目
+export const courceDownList = (p) => request('disk/notice/delete', p, 'post')

+ 11 - 1
src/router/portal.js

@@ -1,4 +1,4 @@
- 
+
 const portal = [
 	// {
 	// 	name: 'portal',
@@ -81,6 +81,16 @@ const portal = [
 		name: 'tlogin',
 		path: '/tlogin',
 		component: () => import('@/views/tlogin/login.vue'),
+	},
+	{
+		name: 'classManagement',
+		path: '/classManagement',
+		component: () => import('@/views/classManagement/index.vue'),
+	},
+	{
+		name: 'announcementManagement',
+		path: '/announcementManagement',
+		component: () => import('@/views/announcementManagement/index.vue'),
 	}
 ]
 /**

+ 9 - 1
src/router/whiteList.js

@@ -1,4 +1,4 @@
- 
+
 const constRouters = [
 	{
 		path: '/findpwd'
@@ -134,6 +134,14 @@ const constRouters = [
 		path: '/tlogin',
 		component: () => import('@/views/tlogin/login.vue')
 	},
+	{
+		path: '/classManagement',
+		component: () => import('@/views/classManagement/index.vue')
+	},
+	{
+		path: '/announcementManagement',
+		component: () => import('@/views/announcementManagement/index.vue')
+	},
 ]
 /**
  * 路由白名单(数组形式)

+ 150 - 0
src/views/announcementManagement/components/DialogView.vue

@@ -0,0 +1,150 @@
+<template>
+	<a-modal v-model:visible="visible" title="上传" @ok="handleOk">
+		<a-form
+			:model="formState"
+			:rules="rules"
+			ref="formRef"
+			layout="horizontal"
+			:label-col="{ span: 7 }"
+			:wrapper-col="{ span: 12 }"
+		>
+			<a-form-item label="公告标题" name="title">
+				<a-input v-model:value="formState.title" placeholder="输入公告标题"/>
+			</a-form-item>
+
+			<a-form-item label="公告内容" name="content">
+				<a-textarea v-model:value="formState.content" placeholder="输入公告内容"
+							:auto-size="{ minRows: 5, maxRows: 8 }"/>
+			</a-form-item>
+
+		</a-form>
+	</a-modal>
+</template>
+<script setup>
+import {reactive, ref} from 'vue'
+import resourceAuditApi from '@/api/resourceAudit.js'
+
+const collegeMajorOptions = ref([]) //院系
+const majorIdName = ref([]) //院系回显
+const majorOptions = ref([]) //专业
+const formRef = ref() //专业
+const mode = ref('add') //专业
+import {addItem, detail, editItem} from '@/api/notice'
+
+const visible = ref(false)
+const emit = defineEmits([ "handleAddItem" ])
+const formState = reactive({
+	noticeId : undefined,
+	title: undefined,
+	content: undefined,
+})
+const rules = {
+	title: [{required: true, message: '请输入标题', trigger: 'blur'}],
+	content: [{required: true, message: '请输入内容', trigger: 'blur'}],
+}
+
+watch(
+	() => visible.value,
+	(newVal, oldVal) => {
+		if (newVal == false && formRef.value) {
+			formRef.value.resetFields()
+		}
+	},
+	{deep: true, immediate: true}
+)
+const open = () => {
+
+	visible.value = true
+	mode.value = 'add'
+}
+const edit = (item) => {
+	visible.value = true
+	mode.value = 'edit'
+	console.log('编辑内容',item)
+
+
+	detail({noticeId : item.noticeId}).then((res)=>{
+		if(res.code ==200){
+			formState.noticeId = item.noticeId
+			formState.content = res.data.content
+			formState.title = res.data.title
+		}
+	})
+
+}
+const handleOk = (e) => {
+	formRef.value.validate().then(() => {
+		let json = JSON.parse(JSON.stringify(formState))
+
+
+		if (mode.value == 'add') {
+			addItem(json).then((res) => {
+					if(res.code == 200){
+						emit("handleAddItem")
+						visible.value = false
+					}
+			})
+		}
+		if (mode.value == 'edit') {
+			editItem(json).then((res) => {
+				if(res.code == 200){
+					emit("handleAddItem")
+					visible.value = false
+				}
+			})
+		}
+	})
+	// console.logckPoint.value = false
+}
+const getOrgTreeSelector = () => {
+	resourceAuditApi
+		.orgList()
+		.then((res) => {
+			console.log(res.data, '获取学院')
+			collegeMajorOptions.value = res.data
+		})
+		.catch((err) => {
+			console.log(err)
+		})
+}
+const changeCollegeMajor = (value, selectedOptions) => {
+	console.log('Selected:', value, selectedOptions)
+	if (!value) {
+		formState.collegeTwoId = ''
+		// majorIdName.value = ''
+		return false
+	}
+	formState.majorId = undefined
+	// majorIdName.value = selectedOptions.map((it) => it.name).join('/')
+	// formState.collegeId = value[0] || null
+	// formState.collegeTwoId = value[1] || null
+	// formState.collegeThreeId = value[2] || null
+	// if (selectedOptions.length) {
+	// 获取选中的最后一级
+	// const lastSelected = selectedOptions[selectedOptions.length - 1]
+	// formState.selectedCollegeMajor = {
+	// 	id: lastSelected.id,
+	// 	name: lastSelected.name,
+	// 	fullPath: selectedOptions.map((opt) => opt.name).join(' / ')
+	// }
+	console.log(formState.collegeTwoId, '最后一级id')
+	getCollegeMajor(formState.collegeTwoId)
+	// }
+}
+const getCollegeMajor = (id) => {
+	resourceAuditApi
+		.zyselect({collegeId: id})
+		.then((res) => {
+			console.log(res.data, '专业下拉数据')
+			majorOptions.value = res.data
+		})
+		.catch((err) => {
+			console.log(err)
+		})
+}
+onMounted(() => {
+	// getOrgTreeSelector()
+})
+
+defineExpose({open,edit})
+</script>

+ 223 - 0
src/views/announcementManagement/components/ListView.vue

@@ -0,0 +1,223 @@
+<template>
+	<a-table
+		ref="table"
+		:columns="columns"
+		:data-source="dataSources"
+		:row-key="(record) => record.courseId"
+		bordered
+		:expand-row-by-click="true"
+		:pagination="false"
+		size="small"
+	>
+		<template #bodyCell="{ column, text, record }">
+			<template v-if="column.dataIndex === 'content'">
+				<a-popover title="详细内容"
+						   trigger="hover"
+				>
+					<template #content>
+						{{ text }}
+					</template>
+					<template v-if="text.length > 10">
+						<span >{{ text.slice(0, 10) }}...</span>
+					</template>
+				</a-popover>
+				<template v-if="text.length <= 10">
+					<span >{{ text }}</span>
+				</template>
+			</template>
+
+			<template v-if="column.dataIndex === 'action'">
+				<a-button size="small" @click="handleDetail(record)" style="margin-right: 5px">详情</a-button>
+				<a-button size="small" @click="handleEdit(record)" style="margin-right: 5px">编辑</a-button>
+				<a-popover v-model:visible="popoverVisibles[record.collegeId]" title="确定删除?" trigger="click">
+					<template #content>
+						<a-button style="margin-right: 10px" type="primary" @click="handleShelf(record,1)">确定
+						</a-button>
+						<a-button @click="()=>{	popoverVisibles[record.collegeId] = false}">取消</a-button>
+					</template>
+					<!--					<a-button size="small" style="margin-right: 5px">选择</a-button>-->
+					<a-button size="small" @click="handleDelete(record)" style="margin-right: 5px">删除</a-button>
+				</a-popover>
+			</template>
+		</template>
+	</a-table>
+	<div style="display: flex; width: 100%; justify-content: flex-end; margin-top: 10px">
+		<a-pagination
+			v-model:current="pagination.current"
+			v-model:pageSize="pagination.size"
+			:total="total"
+			show-less-items
+			@change="handlerChange"
+		/>
+	</div>
+</template>
+
+<script setup>
+import tool from '@/utils/tool'
+import {ref, onMounted} from 'vue'
+import {EyeOutlined, EditOutlined, SnippetsOutlined, DeleteOutlined} from '@ant-design/icons-vue'
+import {list} from '@/api/notice'
+import {useRouter} from 'vue-router'
+import collegeApi from '@/api/college'
+import {updateCourseStatus} from '@/api/course/courseDetail'
+
+const router = useRouter()
+
+const emit = defineEmits(['handleEdit'])
+//发布按钮状态
+const releaseVisible = ref(false)
+const loading = ref(false) // 列表loading
+const dataSources = ref([])
+const popoverVisible = ref({})
+const popoverVisibles = ref({})
+const formState = ref({
+	name: '',
+	loacl: ''
+}) // 列表loading
+const columns = [
+	{
+		title: '公告标题',
+		dataIndex: 'title',
+		sorter: true,
+		width: '15%'
+	},
+	{
+		title: '内容',
+		dataIndex: 'content',
+		sorter: true,
+		width: '15%'
+	},
+	{
+		title: '发布时间',
+		dataIndex: 'createTime',
+		sorter: true,
+		width: '12%'
+	},
+	{
+		title: '操作',
+		dataIndex: 'action',
+		sorter: true,
+		width: '10%'
+	}
+]
+// tool.formatTimestamp()
+
+const formatTimestamp = (time) => {
+	return tool.formatTimestamp(time)
+}
+const total = ref(0)
+const pagination = ref({
+	size: 10,
+	current: 1,
+})
+const onChangeCurrent = (current) => {
+	router.push({
+		path: '/' + current
+	})
+}
+const handlerChange = (page, pageSize) => {
+	console.log('分页参数', page, pageSize)
+	// pagination.value.size = pageSize
+	// pagination.value.current = page
+
+	getList()
+}
+const handleDetail = (record) => {
+	console.log('查看详情', record)
+	router.push({
+		path: '/portal/courseDetails',
+		query: {
+			id: record.courseId
+		}
+	})
+	// 在这里添加查看详情的逻辑
+}
+
+// 编辑按钮点击事件
+const handleEdit = (record) => {
+	console.log('编辑记录', record)
+	// 在这里添加编辑记录的逻辑
+
+	emit('handleEdit', record)
+}
+
+// 上架按钮点击事件
+const handleShelf = (record,num) => {
+	console.log('上架记录', record)
+	popoverVisible.value[record.collegeId] = false
+	// 在这里添加上架记录的逻辑
+	// {
+	// 	"courseId": "1948183431150227458",
+	// 	"putawayStatus": 1
+	// }
+	// updateCourseStatus({courseId : record.courseId,putawayStatus : num}).then((res)=>{
+	// 	getList()
+	// })
+
+}
+
+// 删除按钮点击事件
+const handleDelete = (record) => {
+	console.log('删除记录', record)
+	// 在这里添加删除记录的逻辑
+}
+const getList = () => {
+	console.log('获取列表 getList')
+
+	list({...pagination.value}).then((data) => {
+		if (data.code == 200) {
+			console.log('获取列表 新数组', data.data.records)
+			dataSources.value = []
+			dataSources.value = data.data.records
+			console.log('获取列表 最新数组', dataSources.value)
+			pagination.value.current = data.data.current
+			pagination.value.size = data.data.size
+			total.value = data.data.total
+		}
+		// data.records
+	})
+}
+const setList = (search) => {
+	console.log('获取列表 setList',search)
+	// courseName: '',
+	// 	collegeId: '',
+	// 	majorId: '',
+	// 	courseType: '',
+	// 	loacl: []
+	formState.value = search
+	pagination.value.current = 1
+	list({...pagination.value, ...formState.value}).then((data) => {
+		if (data.code == 200) {
+			dataSources.value = data.data.records
+			pagination.value.current = data.data.current
+			pagination.value.size = data.data.size
+			total.value = data.data.total
+		}
+		// data.records
+	})
+}
+
+// 重置按钮点击事件
+onMounted(() => {
+	// getListData()
+	getList()
+})
+
+
+// watch(
+// 	() => dataSources.value,
+// 	(newVal, oldVal) => {
+// 		console.log('数据源变化了 ', ' 新的 ',newVal, '  旧的 ',oldVal)
+// 	},
+// 	{ deep: true, immediate: true }
+// )
+defineExpose({
+	setList,getList
+})
+</script>
+
+<style scoped>
+.desc p {
+	margin-bottom: 1em;
+}
+</style>

+ 165 - 0
src/views/announcementManagement/components/QueryView.vue

@@ -0,0 +1,165 @@
+<template>
+	<div style="display: flex; justify-content: space-between; align-items: center">
+		<div>
+			<a-form layout="inline" :model="formState">
+				<a-form-item label="" style="width: 40%">
+					<a-input v-model:value="formState.title" placeholder="请输入课程名称" allowClear />
+				</a-form-item>
+				<a-form-item label="" style="width: 50%">
+					<a-range-picker 	v-model:value="formState.time" allowClear />
+				</a-form-item>
+			</a-form>
+		</div>
+		<div>
+			<a-button type="primary" @click="handleSearch">
+				<template #icon><SearchOutlined /></template>
+				查询
+			</a-button>
+			<a-button style="margin-left: 10px" @click="handleReset">
+				<template #icon><ReloadOutlined /></template>
+				重置
+			</a-button>
+		</div>
+	</div>
+</template>
+
+<script setup>
+	import { ref, onMounted } from 'vue'
+	import { SearchOutlined, ReloadOutlined } from '@ant-design/icons-vue'
+	import { useRouter } from 'vue-router'
+	import collegeApi from '@/api/college'
+	import resourceAuditApi from '@/api/resourceAudit.js'
+	import tool from '@/utils/tool'
+	const emit = defineEmits([])
+	const router = useRouter()
+	const collegeMajorOptions = ref([]) //院系
+	//发布按钮状态
+	const releaseVisible = ref(false)
+	const loading = ref(false) // 列表loading
+	const COURSE_TYPE = tool.dictTypeList('COURSE_TYPE')
+	const formState = ref({
+		title: undefined,
+		time : [],
+		loacl: []
+	}) // 列表loading
+
+	const options = ref([
+		// {
+		// 	value: 'zhejiang',
+		// 	label: 'Zhejiang',
+		// 	isLeaf: false
+		// },
+		// {
+		// 	value: 'jiangsu',
+		// 	label: 'Jiangsu',
+		// 	isLeaf: false
+		// }
+	])
+
+	// 搜索值
+	const searchValue = ref('')
+
+	const pagination = reactive({
+		pageSize: 10,
+		pageNum: 1,
+		total: 0
+	})
+	const onChangeCurrent = (current) => {
+		router.push({
+			path: '/' + current
+		})
+	}
+	const publishedData = ref()
+	//发布确定
+
+	// 上传资源模态框
+	const uploadModalVisible = ref(false)
+	//院系组织查询
+	// const getOrgTreeSelector = () => {
+	// 	resourceAuditApi
+	// 		.orgList()
+	// 		.then((res) => {
+	// 			console.log(res.data, '获取学院')
+	// 			collegeMajorOptions.value = res.data
+	// 		})
+	// 		.catch((err) => {
+	// 			console.log(err)
+	// 		})
+	// }
+	const loadData = (selectedOptions) => {
+		const targetOption = selectedOptions[selectedOptions.length - 1]
+		targetOption.loading = true
+
+		// load options lazily
+		setTimeout(() => {
+			targetOption.loading = false
+			targetOption.children = [
+				{
+					label: `${targetOption.label} Dynamic 1`,
+					value: 'dynamic1'
+				},
+				{
+					label: `${targetOption.label} Dynamic 2`,
+					value: 'dynamic2'
+				}
+			]
+			options.value = [...options.value]
+		}, 1000)
+	}
+	const getList = () => {
+		// collegeApi.treeAll().then((data) => {
+		// 	options.value = data
+		// })
+
+		// resourceAuditApi
+		// 	.orgList()
+		// 	.then((res) => {
+		// 		collegeMajorOptions.value = res.data
+		// 	})
+		// 	.catch((err) => {
+		// 		console.log(err)
+		// 	})
+	}
+	const handleSearch = () => {
+		console.log('执行查询操作', formState.value,COURSE_TYPE)
+		// 在这里添加查询逻辑
+
+		let newJson =  JSON.parse(JSON.stringify(formState.value))
+		console.log('执行查询操作123   ', newJson.loacl.length)
+
+		if(newJson.time.length == 2){
+		 let beginTime =	tool.formatTimesYearMonthDay(newJson.time[0])
+		let endTime=	tool.formatTimesYearMonthDay(newJson.time[1])
+			newJson.beginTime = beginTime
+			newJson.endTime = endTime
+			newJson.time= undefined
+		}
+
+		emit('handlerSearch', newJson)
+	}
+
+	// 重置按钮点击事件
+	const handleReset = () => {
+		formState.value = {
+			courseName: undefined,
+			collegeId: undefined,
+			majorId: undefined,
+			courseType: undefined,
+			time : [],
+			loacl: []
+			// 其他需要重置的字段
+		}
+		emit('handlerSearch', formState.value)
+	}
+	onMounted(() => {
+		// getListData()
+
+		getList()
+	})
+</script>
+
+<style scoped>
+	.desc p {
+		margin-bottom: 1em;
+	}
+</style>

+ 89 - 0
src/views/announcementManagement/index.vue

@@ -0,0 +1,89 @@
+<template>
+	<div style="overflow-y: auto">
+		<a-layout>
+			<Header @onChangeCurrent="onChangeCurrent" />
+			<div style="width: 71%; margin-left: 10%">
+				<QueryView style="margin-top: 10px" @handlerSearch="handlerSearch"></QueryView>
+				<!-- 新建课程按钮 -->
+				<a-button style="margin-top: 10px" type="primary" @click="handleNewCourse">
+					<template #icon>
+						<PlusOutlined />
+					</template>
+					新建
+				</a-button>
+				<div style="height: 10px"></div>
+				<ListView ref="listViewRef" style="margin-top: 10px" @handleEdit="handleEdit"></ListView>
+			</div>
+		</a-layout>
+		<Footer />
+		<DialogView ref="dialogViewRef"  @handleAddItem="handleAddItem"></DialogView>
+	</div>
+</template>
+
+<script setup>
+	import { ref, onMounted } from 'vue'
+	import { PlusOutlined } from '@ant-design/icons-vue'
+	import tool from '@/utils/tool'
+	import Header from '@/views/portal/components/Header.vue'
+	import Footer from '@/views/portal/components/Footer.vue'
+	import QueryView from './components/QueryView.vue'
+	import ListView from './components/ListView.vue'
+	import DialogView from './components/DialogView.vue'
+	import { useRouter } from 'vue-router'
+	const router = useRouter()
+	//发布按钮状态
+	const releaseVisible = ref(false)
+	const loading = ref(false) // 列表loading
+
+	const isState = ref(0) // 列表loading
+	const listViewRef = ref(null)
+	const dialogViewRef = ref(null)
+
+	// 搜索值
+	const searchValue = ref('')
+	const open = ref(false)
+
+	const handleNewCourse = () => {
+		// 在这里添加新建课程的逻辑
+		dialogViewRef.value.open()
+	}
+	const handleAddItem = () => {
+		console.log('要去刷新',listViewRef.value)
+		// 在这里添加新建课程的逻辑
+		listViewRef.value.getList()
+	}
+	const handlerSearch = (data) => {
+		console.log('新建课程')
+		// 在这里添加新建课程的逻辑
+		listViewRef.value.setList(data)
+	}
+	const handleEdit = (item) => {
+		dialogViewRef.value.edit(item)
+	}
+
+	const pagination = reactive({
+		pageSize: 10,
+		pageNum: 1,
+		total: 0
+	})
+	const onChangeCurrent = (current) => {
+		router.push({
+			path: '/' + current
+		})
+	}
+	const publishedData = ref()
+	//发布确定
+
+	// 上传资源模态框
+	const uploadModalVisible = ref(false)
+
+	onMounted(() => {
+		// getListData()
+	})
+</script>
+
+<style scoped>
+	.desc p {
+		margin-bottom: 1em;
+	}
+</style>

+ 170 - 0
src/views/classManagement/components/DialogView.vue

@@ -0,0 +1,170 @@
+<template>
+		<a-modal v-model:visible="visible" title="上传" @ok="handleOk">
+			<a-form
+				:model="formState"
+				:rules="rules"
+				ref="formRef"
+				layout="horizontal"
+				:label-col="{ span: 7 }"
+				:wrapper-col="{ span: 12 }"
+			>
+				<a-form-item label="班级名称" name="gradesName">
+					<a-input v-model:value="formState.gradesName" placeholder="输入班级名称" />
+				</a-form-item>
+
+				<a-form-item label="院系" name="collegeId">
+					<a-select
+						v-model:value="formState.collegeId"
+						:fieldNames="{ label: 'name', value: 'id' }"
+						:options="collegeMajorOptions"
+						placeholder="请选择院系"
+						@change="changeCollegeMajor"
+					/>
+					<!--			<a-cascader-->
+					<!--				v-model:value="majorIdName"-->
+					<!--				:options="collegeMajorOptions"-->
+					<!--				:fieldNames="{ label: 'name', value: 'id' }"-->
+					<!--				placeholder="请选择院系"-->
+					<!--				changeOnSelect-->
+					<!--				@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>
+
+
+			</a-form>
+		</a-modal>
+</template>
+<script setup>
+import {reactive, ref} from 'vue'
+	import resourceAuditApi from '@/api/resourceAudit.js'
+	const collegeMajorOptions = ref([]) //院系
+	const majorIdName = ref([]) //院系回显
+	const majorOptions = ref([]) //专业
+	const formRef = ref() //专业
+	const mode = ref('add') //专业
+	import {addItem,detail,editItem} from '@/api/grades'
+	const visible = ref(false)
+const emit = defineEmits([ "handleAddItem" ])
+	const formState = reactive({
+		gradesName: undefined,
+		collegeId: undefined,
+		majorId: undefined,
+	})
+	const rules = {
+		gradesName: [{ required: true, message: '请输入教室名称', trigger: 'blur' }],
+		collegeId: [{ required: true, message: '请选择院系', trigger: 'change' }],
+		majorId: [{ required: true, message: '请选择专业', trigger: 'change' }],
+	}
+
+watch(
+	() => visible.value,
+	(newVal, oldVal) => {
+		if (newVal == false && formRef.value) {
+			formRef.value.resetFields()
+		}
+	},
+	{ deep: true, immediate: true }
+)
+	const open = () => {
+
+		visible.value = true
+		mode.value = 'add'
+	}
+const edit = (item) => {
+	visible.value = true
+	mode.value = 'edit'
+	console.log('编辑内容',item)
+
+
+	detail({gradesId : item.gradesId}).then((res)=>{
+		if(res.code ==200){
+			formState.gradesId = item.gradesId
+			formState.gradesName = res.data.gradesName
+			formState.collegeId = res.data.collegeId
+			formState.majorId = res.data.majorId+""
+
+			changeCollegeMajor(formState.collegeId)
+		}
+	})
+
+}
+	const handleOk = (e) => {
+		formRef.value.validate().then(()=>{
+			let json = JSON.parse(JSON.stringify(formState))
+
+
+				if (mode.value =='add'){
+					addItem(json).then((res)=>{
+						emit("handleAddItem")
+						visible.value = false
+					})
+				}
+			if (mode.value =='edit'){
+				editItem(json).then((res)=>{
+					emit("handleAddItem")
+					visible.value = false
+				})
+			}
+		})
+		// console.logckPoint.value = false
+	}
+	const getOrgTreeSelector = () => {
+		resourceAuditApi
+			.orgList()
+			.then((res) => {
+				console.log(res.data, '获取学院')
+				collegeMajorOptions.value = res.data
+			})
+			.catch((err) => {
+				console.log(err)
+			})
+	}
+const changeCollegeMajor = (value, selectedOptions) => {
+	console.log('Selected:', value, selectedOptions)
+	if (!value) {
+		formState.collegeId = undefined
+		// majorIdName.value = ''
+		return false
+	}
+	// formState.majorId = undefined
+	// majorIdName.value = selectedOptions.map((it) => it.name).join('/')
+	// formState.collegeId = value[0] || null
+	// formState.collegeTwoId = value[1] || null
+	// formState.collegeThreeId = value[2] || null
+	// if (selectedOptions.length) {
+	// 获取选中的最后一级
+	// const lastSelected = selectedOptions[selectedOptions.length - 1]
+	// formState.selectedCollegeMajor = {
+	// 	id: lastSelected.id,
+	// 	name: lastSelected.name,
+	// 	fullPath: selectedOptions.map((opt) => opt.name).join(' / ')
+	// }
+	console.log(formState.collegeTwoId, '最后一级id')
+	getCollegeMajor(formState.collegeId)
+	// }
+}
+const getCollegeMajor = (id) => {
+	resourceAuditApi
+		.zyselect({ collegeId: id })
+		.then((res) => {
+			console.log(res.data, '专业下拉数据',formState)
+			majorOptions.value = res.data
+		})
+		.catch((err) => {
+			console.log(err)
+		})
+}
+	onMounted( ()=>{
+		getOrgTreeSelector()
+	})
+
+	defineExpose({ open ,edit})
+</script>

+ 217 - 0
src/views/classManagement/components/ListView.vue

@@ -0,0 +1,217 @@
+<template>
+	<a-table
+		ref="table"
+		:columns="columns"
+		:data-source="dataSources"
+		:row-key="(record) => record.courseId"
+		bordered
+		:expand-row-by-click="true"
+		:pagination="false"
+		size="small"
+	>
+		<template #bodyCell="{ column, text, record }">
+<!--			<template v-if="column.dataIndex === 'publishTime'">{{ formatTimestamp(text) }}</template>-->
+			<template v-if="column.dataIndex === 'action'">
+				<a-button size="small" @click="handleDetail(record)" style="margin-right: 5px">详情</a-button>
+				<a-button size="small" @click="handleEdit(record)" style="margin-right: 5px">编辑</a-button>
+				<a-popover v-model:visible="popoverVisibles[record.collegeId]" title="确定删除?" trigger="click">
+					<template #content>
+						<a-button style="margin-right: 10px" type="primary" @click="handleShelf(record,1)">确定
+						</a-button>
+						<a-button @click="()=>{	popoverVisibles[record.collegeId] = false}">取消</a-button>
+					</template>
+					<!--					<a-button size="small" style="margin-right: 5px">选择</a-button>-->
+					<a-button size="small" @click="handleDelete(record)" style="margin-right: 5px">删除</a-button>
+				</a-popover>
+
+
+
+			</template>
+		</template>
+	</a-table>
+	<div style="display: flex; width: 100%; justify-content: flex-end; margin-top: 10px">
+		<a-pagination
+			v-model:current="pagination.current"
+			v-model:pageSize="pagination.size"
+			:total="total"
+			show-less-items
+			@change="handlerChange"
+		/>
+	</div>
+</template>
+
+<script setup>
+import tool from '@/utils/tool'
+import {ref, onMounted} from 'vue'
+import {EyeOutlined, EditOutlined, SnippetsOutlined, DeleteOutlined} from '@ant-design/icons-vue'
+import {list} from '@/api/grades'
+import {useRouter} from 'vue-router'
+import collegeApi from '@/api/college'
+import {updateCourseStatus} from '@/api/course/courseDetail'
+
+const router = useRouter()
+
+const emit = defineEmits(['handleEdit'])
+//发布按钮状态
+const releaseVisible = ref(false)
+const loading = ref(false) // 列表loading
+const dataSources = ref([])
+const popoverVisible = ref({})
+const popoverVisibles = ref({})
+const formState = ref({
+	name: '',
+	loacl: ''
+}) // 列表loading
+const columns = [
+	{
+		title: '班级名称',
+		dataIndex: 'gradesName',
+		sorter: true,
+		width: '15%'
+	},
+	{
+		title: '学院',
+		dataIndex: 'collegeName',
+		sorter: true,
+		width: '10%'
+	},
+	{
+		title: '专业',
+		dataIndex: 'majoreName',
+		sorter: true,
+		width: '15%'
+	},
+	{
+		title: '发布时间',
+		dataIndex: 'createTime',
+		sorter: true,
+		width: '12%'
+	},
+	{
+		title: '操作',
+		dataIndex: 'action',
+		sorter: true,
+		width: '10%'
+	}
+]
+// tool.formatTimestamp()
+
+const formatTimestamp = (time) => {
+	return tool.formatTimestamp(time)
+}
+const total = ref(0)
+const pagination = ref({
+	size: 10,
+	current: 1,
+})
+const onChangeCurrent = (current) => {
+	router.push({
+		path: '/' + current
+	})
+}
+const handlerChange = (page, pageSize) => {
+	console.log('分页参数', page, pageSize)
+	// pagination.value.size = pageSize
+	// pagination.value.current = page
+
+	getList()
+}
+const handleDetail = (record) => {
+	console.log('查看详情', record)
+	router.push({
+		path: '/portal/courseDetails',
+		query: {
+			id: record.courseId
+		}
+	})
+	// 在这里添加查看详情的逻辑
+}
+
+// 编辑按钮点击事件
+const handleEdit = (record) => {
+	console.log('编辑记录', record)
+	// 在这里添加编辑记录的逻辑
+
+	emit('handleEdit', record)
+}
+
+// 上架按钮点击事件
+const handleShelf = (record,num) => {
+	console.log('上架记录', record)
+	popoverVisible.value[record.collegeId] = false
+	// 在这里添加上架记录的逻辑
+	// {
+	// 	"courseId": "1948183431150227458",
+	// 	"putawayStatus": 1
+	// }
+	// updateCourseStatus({courseId : record.courseId,putawayStatus : num}).then((res)=>{
+	// 	getList()
+	// })
+
+}
+
+// 删除按钮点击事件
+const handleDelete = (record) => {
+	console.log('删除记录', record)
+	// 在这里添加删除记录的逻辑
+}
+const getList = () => {
+	console.log('获取列表 getList')
+
+	list({...pagination.value}).then((data) => {
+		if (data.code == 200) {
+			console.log('获取列表 新数组', data.data.records)
+			dataSources.value = []
+			dataSources.value = data.data.records
+			console.log('获取列表 最新数组', dataSources.value)
+			pagination.value.current = data.data.current
+			pagination.value.size = data.data.size
+			total.value = data.data.total
+		}
+		// data.records
+	})
+}
+const setList = (search) => {
+	console.log('获取列表 setList',search)
+	// courseName: '',
+	// 	collegeId: '',
+	// 	majorId: '',
+	// 	courseType: '',
+	// 	loacl: []
+	formState.value = search
+	pagination.value.current = 1
+	list({...pagination.value, ...formState.value}).then((data) => {
+		if (data.code == 200) {
+			dataSources.value = data.data.records
+			pagination.value.current = data.data.current
+			pagination.value.size = data.data.size
+			total.value = data.data.total
+		}
+		// data.records
+	})
+}
+
+// 重置按钮点击事件
+onMounted(() => {
+	// getListData()
+	getList()
+})
+
+
+// watch(
+// 	() => dataSources.value,
+// 	(newVal, oldVal) => {
+// 		console.log('数据源变化了 ', ' 新的 ',newVal, '  旧的 ',oldVal)
+// 	},
+// 	{ deep: true, immediate: true }
+// )
+defineExpose({
+	setList,getList
+})
+</script>
+
+<style scoped>
+.desc p {
+	margin-bottom: 1em;
+}
+</style>

+ 208 - 0
src/views/classManagement/components/QueryView.vue

@@ -0,0 +1,208 @@
+<template>
+	<div style="display: flex; justify-content: space-between; align-items: center">
+		<div>
+			<a-form layout="inline" :model="formState">
+				<a-form-item label="" style="width: 300px">
+					<a-input v-model:value="formState.gradesName" placeholder="请输入班级名称" allowClear />
+				</a-form-item>
+				<a-form-item label="" style="width: 300px">
+<!--					<a-cascader-->
+<!--						v-model:value="formState.loacl"-->
+<!--						:options="options"-->
+<!--						placeholder="选择院校"-->
+<!--						change-on-select-->
+<!--						allowClear-->
+<!--						:field-names="{ label: 'name', value: 'id', children: 'children' }"-->
+<!--					/>-->
+					<a-select
+						v-model:value="formState.collegeId"
+						:fieldNames="{ label: 'name', value: 'id' }"
+						:options="collegeMajorOptions"
+						placeholder="请选择院系"
+						allowClear
+					/>
+				</a-form-item>
+<!--				<a-form-item label="" style="width: 20%">-->
+<!--&lt;!&ndash;					<a-input v-model:value="formState.type" placeholder="选择课程类型" allowClear />&ndash;&gt;-->
+<!--					<a-select-->
+<!--						ref="select"-->
+<!--						placeholder="选择课程类型"-->
+<!--						v-model:value="formState.courseType"-->
+<!--						:fieldNames="{ label: 'dictLabel', value: 'dictValue' }"-->
+<!--						:options="COURSE_TYPE"-->
+<!--						allowClear-->
+<!--					></a-select>-->
+<!--				</a-form-item>-->
+<!--				<a-form-item label="" style="width: 30%">-->
+<!--					<a-range-picker 	v-model:value="formState.time" allowClear />-->
+<!--				</a-form-item>-->
+			</a-form>
+		</div>
+		<div>
+			<a-button type="primary" @click="handleSearch">
+				<template #icon><SearchOutlined /></template>
+				查询
+			</a-button>
+			<a-button style="margin-left: 10px" @click="handleReset">
+				<template #icon><ReloadOutlined /></template>
+				重置
+			</a-button>
+		</div>
+	</div>
+</template>
+
+<script setup>
+	import { ref, onMounted } from 'vue'
+	import { SearchOutlined, ReloadOutlined } from '@ant-design/icons-vue'
+	import { useRouter } from 'vue-router'
+	import collegeApi from '@/api/college'
+	import resourceAuditApi from '@/api/resourceAudit.js'
+	import tool from '@/utils/tool'
+	const emit = defineEmits([])
+	const router = useRouter()
+	const collegeMajorOptions = ref([]) //院系
+	//发布按钮状态
+	const releaseVisible = ref(false)
+	const loading = ref(false) // 列表loading
+	const COURSE_TYPE = tool.dictTypeList('COURSE_TYPE')
+	const formState = ref({
+		gradesName: undefined,
+		collegeId: undefined,
+		majorId: undefined,
+		courseType: undefined,
+		time : [],
+		loacl: []
+	}) // 列表loading
+
+	const options = ref([
+		// {
+		// 	value: 'zhejiang',
+		// 	label: 'Zhejiang',
+		// 	isLeaf: false
+		// },
+		// {
+		// 	value: 'jiangsu',
+		// 	label: 'Jiangsu',
+		// 	isLeaf: false
+		// }
+	])
+
+	// 搜索值
+	const searchValue = ref('')
+
+	const pagination = reactive({
+		pageSize: 10,
+		pageNum: 1,
+		total: 0
+	})
+	const onChangeCurrent = (current) => {
+		router.push({
+			path: '/' + current
+		})
+	}
+	const publishedData = ref()
+	//发布确定
+
+	// 上传资源模态框
+	const uploadModalVisible = ref(false)
+	//院系组织查询
+	const getOrgTreeSelector = () => {
+		resourceAuditApi
+			.orgList()
+			.then((res) => {
+				console.log(res.data, '获取学院')
+				collegeMajorOptions.value = res.data
+			})
+			.catch((err) => {
+				console.log(err)
+			})
+	}
+	const loadData = (selectedOptions) => {
+		const targetOption = selectedOptions[selectedOptions.length - 1]
+		targetOption.loading = true
+
+		// load options lazily
+		setTimeout(() => {
+			targetOption.loading = false
+			targetOption.children = [
+				{
+					label: `${targetOption.label} Dynamic 1`,
+					value: 'dynamic1'
+				},
+				{
+					label: `${targetOption.label} Dynamic 2`,
+					value: 'dynamic2'
+				}
+			]
+			options.value = [...options.value]
+		}, 1000)
+	}
+	const getList = () => {
+		// collegeApi.treeAll().then((data) => {
+		// 	options.value = data
+		// })
+
+		resourceAuditApi
+			.orgList()
+			.then((res) => {
+				collegeMajorOptions.value = res.data
+			})
+			.catch((err) => {
+				console.log(err)
+			})
+	}
+	const handleSearch = () => {
+		console.log('执行查询操作', formState.value,COURSE_TYPE)
+		// 在这里添加查询逻辑
+
+		let newJson =  JSON.parse(JSON.stringify(formState.value))
+		console.log('执行查询操作123   ', newJson.loacl.length)
+		for (let i = 0; i < newJson.loacl.length; i++) {
+			let item = newJson.loacl[i]
+			if(i == 0){
+				newJson.collegeId = item
+			}
+			if(i == 1){
+				newJson.collegeTwoId = item
+			}
+			if(i == 2){
+				newJson.collegeThreeId = item
+			}
+		}
+		newJson.loacl = undefined
+		if(newJson.time.length == 2){
+		 let beginTime =	tool.formatTimesYearMonthDay(newJson.time[0])
+		let endTime=	tool.formatTimesYearMonthDay(newJson.time[1])
+			newJson.beginTime = beginTime
+			newJson.endTime = endTime
+			newJson.time= undefined
+		}
+
+		emit('handlerSearch', newJson)
+	}
+
+	// 重置按钮点击事件
+	const handleReset = () => {
+		formState.value = {
+			courseName: undefined,
+			collegeId: undefined,
+			majorId: undefined,
+			courseType: undefined,
+			time : [],
+			loacl: []
+			// 其他需要重置的字段
+		}
+		emit('handlerSearch', formState.value)
+	}
+	onMounted(() => {
+		// getListData()
+
+		getList()
+	})
+</script>
+
+<style scoped>
+	.desc p {
+		margin-bottom: 1em;
+	}
+</style>

+ 105 - 0
src/views/classManagement/index.vue

@@ -0,0 +1,105 @@
+<template>
+	<div style="overflow-y: auto">
+		<a-layout>
+			<Header @onChangeCurrent="onChangeCurrent" />
+			<div style="width: 71%; margin-left: 10%">
+				<QueryView style="margin-top: 10px" @handlerSearch="handlerSearch"></QueryView>
+				<!-- 新建课程按钮 -->
+				<a-button style="margin-top: 10px" type="primary" @click="handleNewCourse">
+					<template #icon>
+						<PlusOutlined />
+					</template>
+					新建
+				</a-button>
+				<div style="height: 10px"></div>
+				<ListView ref="listViewRef" style="margin-top: 10px" @handleEdit="handleEdit"></ListView>
+			</div>
+		</a-layout>
+		<Footer />
+		<DialogView ref="dialogViewRef" @handleAddItem="handleAddItem"></DialogView>
+	</div>
+</template>
+
+<script setup>
+	import { ref, onMounted } from 'vue'
+	import { PlusOutlined } from '@ant-design/icons-vue'
+	import tool from '@/utils/tool'
+	import Header from '@/views/portal/components/Header.vue'
+	import Footer from '@/views/portal/components/Footer.vue'
+	import QueryView from './components/QueryView.vue'
+	import ListView from './components/ListView.vue'
+	import DialogView from './components/DialogView.vue'
+	import { useRouter } from 'vue-router'
+	const router = useRouter()
+	//发布按钮状态
+	const releaseVisible = ref(false)
+	const loading = ref(false) // 列表loading
+
+	const isState = ref(0) // 列表loading
+	const listViewRef = ref(null)
+	const dialogViewRef = ref(null)
+
+	// 搜索值
+	const searchValue = ref('')
+	const open = ref(false)
+
+	const handleNewCourse = () => {
+		console.log('新建课程111')
+		// 在这里添加新建课程的逻辑
+		dialogViewRef.value.open()
+
+		// router.push({
+		// 	path: '/portal/courseAdd'
+		// })
+	}
+	const handleAddItem = () => {
+		console.log('新建课程111')
+		// 在这里添加新建课程的逻辑
+		listViewRef.value.getList()
+
+		// router.push({
+		// 	path: '/portal/courseAdd'
+		// })
+	}
+	const handlerSearch = (data) => {
+		console.log('新建课程')
+		// 在这里添加新建课程的逻辑
+		listViewRef.value.setList(data)
+	}
+	const handleEdit = (item) => {
+		// router.push({
+		// 	path: '/portal/courseAdd',
+		// 	query: {
+		// 		id: item.courseId
+		// 	}
+		// })
+
+		dialogViewRef.value.edit(item)
+	}
+
+	const pagination = reactive({
+		pageSize: 10,
+		pageNum: 1,
+		total: 0
+	})
+	const onChangeCurrent = (current) => {
+		router.push({
+			path: '/' + current
+		})
+	}
+	const publishedData = ref()
+	//发布确定
+
+	// 上传资源模态框
+	const uploadModalVisible = ref(false)
+
+	onMounted(() => {
+		// getListData()
+	})
+</script>
+
+<style scoped>
+	.desc p {
+		margin-bottom: 1em;
+	}
+</style>

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

@@ -63,7 +63,7 @@
 					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/personalResources">个人资源</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: 10px; margin-right: 10px" key="portal/courseManagement">问答管理</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: 10px; margin-right: 10px" key="classManagement">班级管理</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: 10px; margin-right: 10px" key="portal/courseManagement">问卷管理</a-menu-item>
 					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/courseManagement">试题管理</a-menu-item>
@@ -71,7 +71,7 @@
 					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/courseManagement">个人中心</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: 10px; margin-right: 10px" key="portal/courseManagement">站内信</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: 10px; margin-right: 10px" key="announcementManagement">课程公告发布</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: 10px; margin-right: 10px" key="portal/courseManagement">密码找回</a-menu-item>