Browse Source

开课开通

于添 6 months ago
parent
commit
e7ae30d028

+ 2 - 1
.env.development

@@ -7,7 +7,8 @@ VITE_TITLE = 飞行学院
 # 接口地址
 #VITE_API_BASEURL = http://192.168.31.15:9003
 #VITE_API_BASEURL = http://192.168.31.80:19003
-VITE_API_BASEURL = http://192.168.1.245:9003
+VITE_API_BASEURL = http://192.168.31.80:9003
+#VITE_API_BASEURL = http://192.168.1.245:9003
 VITE_FILEURL = http://192.168.1.245:10005/education/
 # VITE_API_BASEURL = http://192.168.31.14:9003
 # VITE_API_BASEURL = http://192.168.31.6:9003

+ 1 - 2
src/api/courseOpen/index.js

@@ -1,4 +1,3 @@
-import { baseRequest } from '@/utils/request'
 import {moduleRequest} from "@/utils/reSourceRequest";
 
 const request = moduleRequest(`/api/webapp/`)
@@ -12,4 +11,4 @@ export const editItem = (p) => request('disk/courseopen/edit', p, 'post')
 export const detail = (p) => request('disk/courseopen/detail', p, 'get')
 //收藏增加
 //资源列表 排除没权限得条目
-export const del = (p) => request('disk/courseopen/delete', p, 'post')
+export const deletess = (p) => request('disk/courseopen/delete', p, 'post')

+ 10 - 5
src/views/classManagement/components/ListView.vue

@@ -14,14 +14,14 @@
 			<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">
+				<a-popover v-model:visible="popoverVisibles[record.gradesId]" title="确定删除?" trigger="click">
 					<template #content>
-						<a-button style="margin-right: 10px" type="primary" @click="handleShelf(record,1)">确定
+						<a-button style="margin-right: 10px" type="primary" @click="handleDelete(record)">确定
 						</a-button>
-						<a-button @click="()=>{	popoverVisibles[record.collegeId] = false}">取消</a-button>
+						<a-button @click="()=>{	popoverVisibles[record.gradesId] = 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-button size="small"  style="margin-right: 5px">删除</a-button>
 				</a-popover>
 
 
@@ -44,7 +44,7 @@
 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 {list,courceDownList} from '@/api/grades'
 import {useRouter} from 'vue-router'
 import collegeApi from '@/api/college'
 import {updateCourseStatus} from '@/api/course/courseDetail'
@@ -153,6 +153,11 @@ const handleShelf = (record,num) => {
 // 删除按钮点击事件
 const handleDelete = (record) => {
 	console.log('删除记录', record)
+	popoverVisibles.value[record.gradesId] = false
+
+	courceDownList([{gradesId :record.gradesId} ]).then((res)=>{
+		getList()
+	})
 	// 在这里添加删除记录的逻辑
 }
 const getList = () => {

+ 67 - 11
src/views/courseOpen/components/DialogView.vue

@@ -8,7 +8,7 @@
 				:label-col="{ span: 7 }"
 				:wrapper-col="{ span: 12 }"
 			>
-				<a-form-item label="教室名称" name="room">
+				<a-form-item label="班级名称" name="room">
 					<a-input v-model:value="formState.room" placeholder="输入教室名称" />
 				</a-form-item>
 
@@ -35,7 +35,7 @@
 				<a-form-item label="课程" name="courseId">
 					<a-select
 						v-model:value="formState.courseId"
-						:fieldNames="{ label: 'courseName', value: 'courseName' }"
+						:fieldNames="{ label: 'courseName', value: 'courseId' }"
 						:options="courseinfoAllListOptions"
 						placeholder="请选择课程"
 						@change="changeCollegeMajor"
@@ -52,6 +52,43 @@
 					/>
 				</a-form-item>
 
+
+				<a-form-item label="开始节次" name="startPeriod">
+					<a-input v-model:value="formState.startPeriod" placeholder="输入开始节次" />
+				</a-form-item>
+				<a-form-item label="结束节次" name="endPeriod">
+					<a-input v-model:value="formState.endPeriod" placeholder="输入结束节次" />
+				</a-form-item>
+
+
+				<a-form-item label="上课周期" name="scheduleTime">
+					<a-select
+						v-model:value="formState.scheduleTime"
+						:fieldNames="{ label: 'label', value: 'value' }"
+						:options="COURSE_OPEN_SCHEDULE_TIME_Options"
+						placeholder="请选择上课周期"
+						@change="changeCollegeMajor"
+					/>
+				</a-form-item>
+				<a-form-item label="单双周" name="weekType">
+					<a-select
+						v-model:value="formState.weekType"
+						:fieldNames="{ label: 'label', value: 'value' }"
+						:options="COURSE_OPEN_WEEK_TYPE_Options"
+						placeholder="请选择单双周"
+						@change="changeCollegeMajor"
+					/>
+				</a-form-item>
+				<a-form-item label="状态" name="status">
+					<a-select
+						v-model:value="formState.status"
+						:fieldNames="{ label: 'label', value: 'value' }"
+						:options="COURSE_OPEN_STATUS_Options"
+						placeholder="请选择状态"
+						@change="changeCollegeMajor"
+					/>
+				</a-form-item>
+
 			</a-form>
 		</a-modal>
 </template>
@@ -69,19 +106,29 @@ import {reactive, ref} from 'vue'
 	const gradesQueryListOptions = ref([]) //专业
 	const courseinfoAllListOptions = ref([]) //专业
 
+const COURSE_OPEN_SCHEDULE_TIME_Options = tool.dictList('COURSE_OPEN_SCHEDULE_TIME')
+const COURSE_OPEN_WEEK_TYPE_Options = tool.dictList('COURSE_OPEN_WEEK_TYPE')
+	const COURSE_OPEN_STATUS_Options = tool.dictList('COURSE_OPEN_STATUS')
 
 	const formRef = ref() //专业
 	const mode = ref('add') //专业
 	const title = ref('添加') //专业
-	import {addItem,detail,editItem} from '@/api/grades'
+	import {addItem,detail,editItem} from '@/api/courseopen'
+import tool from "@/utils/tool";
 	const visible = ref(false)
 const emit = defineEmits([ "handleAddItem" ])
-	const formState = reactive({
+const formState = ref({
+		id : undefined,
 		room: undefined,
 		teacherId: undefined,
 		gradesId: undefined,
 		courseId: undefined,
 		semesterId: undefined,
+		startPeriod : undefined,
+		endPeriod : undefined,
+		scheduleTime : undefined,
+		weekType : undefined,
+		status : undefined,
 	})
 	const rules = {
 		room: [{ required: true, message: '请输入教室名称', trigger: 'blur' }],
@@ -89,6 +136,11 @@ const emit = defineEmits([ "handleAddItem" ])
 		gradesId: [{ required: true, message: '请选择班级', trigger: 'change' }],
 		courseId: [{ required: true, message: '请选择课程', trigger: 'change' }],
 		semesterId: [{ required: true, message: '请选择学期', trigger: 'change' }],
+		startPeriod: [{ required: true, message: '请输入开始节次', trigger: 'blur' }],
+		endPeriod: [{ required: true, message: '请输入结束节次', trigger: 'blur' }],
+		scheduleTime: [{ required: true, message: '请选择上课周期', trigger: 'change' }],
+		weekType: [{ required: true, message: '请选择单双周', trigger: 'change' }],
+		status: [{ required: true, message: '请选择状态', trigger: 'change' }],
 	}
 
 watch(
@@ -113,14 +165,15 @@ const edit = (item) => {
 	console.log('编辑内容',item)
 
 
-	detail({gradesId : item.gradesId}).then((res)=>{
+	detail({id : item.id}).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+""
+			formState.id = item.id
+			formState.value = {...res.data}
+			formState.value.gradesId = Number(formState.value.gradesId)
+			// formState.value.semesterId = Number(formState.value.semesterId)
 
-			changeCollegeMajor(formState.collegeId)
+			console.log('会先对象',formState.value)
+			// changeCollegeMajor(formState.collegeId)
 		}
 	})
 
@@ -206,6 +259,8 @@ const getCollegeMajor = (id) => {
 		getOrgTreeSelector()
 		// getSemesterSelector()
 		getPullDara()
+
+		console.log("都什么呢",COURSE_OPEN_SCHEDULE_TIME_Options)
 	})
 const getPullDara = () => {
 	downList()
@@ -218,8 +273,9 @@ const getPullDara = () => {
 		})
 	userAllList()
 		.then((res) => {
-			console.log(res.data, '专业下拉数据',formState)
+
 			userAllListOptions.value = res.data
+			console.log(res.data, '老师数据',userAllListOptions.value)
 		})
 		.catch((err) => {
 			console.log(err)

+ 50 - 20
src/views/courseOpen/components/ListView.vue

@@ -12,16 +12,16 @@
 		<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="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">
+				<a-popover v-model:visible="popoverVisibles[record.id]" title="确定删除?" trigger="click">
 					<template #content>
-						<a-button style="margin-right: 10px" type="primary" @click="handleShelf(record,1)">确定
+						<a-button style="margin-right: 10px" type="primary" @click="handleDelete(record)">确定
 						</a-button>
-						<a-button @click="()=>{	popoverVisibles[record.collegeId] = false}">取消</a-button>
+						<a-button @click="()=>{	popoverVisibles[record.id] = 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-button size="small" style="margin-right: 5px">删除</a-button>
 				</a-popover>
 
 
@@ -43,7 +43,7 @@
 <script setup>
 import tool from '@/utils/tool'
 import {ref, onMounted} from 'vue'
-import {list} from '@/api/courseopen'
+import {list,deletess} from '@/api/courseopen/index.js'
 import {useRouter} from 'vue-router'
 
 const router = useRouter()
@@ -60,35 +60,61 @@ const formState = ref({
 	loacl: ''
 }) // 列表loading
 const columns = [
+	{
+		title: '班级',
+		dataIndex: 'room',
+		width: '12%'
+	},
 	{
 		title: '班级名称',
-		dataIndex: 'gradesName',
-		sorter: true,
+		dataIndex: 'gradesIdName',
 		width: '12%'
 	},
 	{
-		title: '学院',
-		dataIndex: 'collegeName',
-		sorter: true,
+		title: '学期',
+		dataIndex: 'semesterIdName',
 		width: '10%'
 	},
 	{
-		title: '专业',
-		dataIndex: 'majoreName',
-		sorter: true,
-		width: '8%'
+		title: '开始节次',
+		dataIndex: 'startPeriod',
+		width: '10%'
+	},
+	{
+		title: '结束节次',
+		dataIndex: 'endPeriod',
+		width: '10%'
+	},
+	{
+		title: '上课周期',
+		dataIndex: 'scheduleTimeName',
+		width: '10%'
 	},
 	{
-		title: '发布时间',
-		dataIndex: 'createTime',
-		sorter: true,
+		title: '单双周',
+		dataIndex: 'weekTypeName',
 		width: '10%'
 	},
+	{
+		title: '老师',
+		dataIndex: 'teacherIdName',
+		width: '8%'
+	},
+	{
+		title: '状态',
+		dataIndex: 'statusName',
+		width: '8%'
+	},
+	// {
+	// 	title: '发布时间',
+	// 	dataIndex: 'createTime',
+	// 	sorter: true,
+	// 	width: '10%'
+	// },
 	{
 		title: '操作',
 		dataIndex: 'action',
-		sorter: true,
-		width: '10%'
+		width: '12%'
 	}
 ]
 // tool.formatTimestamp()
@@ -150,6 +176,10 @@ const handleShelf = (record,num) => {
 // 删除按钮点击事件
 const handleDelete = (record) => {
 	console.log('删除记录', record)
+	popoverVisibles[record.id] = false
+	deletess([{id : record.id}]).then((res)=>{
+		getList()
+	})
 	// 在这里添加删除记录的逻辑
 }
 const getList = () => {

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

@@ -58,7 +58,7 @@
 <!--					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="portal/courseManagement">站内信</a-menu-item>-->
 					<a-menu-item style="margin-left: 1px; margin-right: 1px" key="announcementManagement">课程公告发布</a-menu-item>
 					<a-menu-item style="margin-left: 1px; margin-right: 1px" key="resourceConversionLog">资源转换</a-menu-item>
-<!--					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="courseOpen">课程开课</a-menu-item>-->
+					<a-menu-item style="margin-left: 10px; margin-right: 10px" key="courseOpen">课程开课</a-menu-item>
 				</a-menu>
 			</div>
 

+ 2 - 1
vite.config.js

@@ -42,7 +42,8 @@ export default defineConfig(({ command, mode }) => {
 			port: envConfig.VITE_PORT,
 			proxy: {
 				'/api': {
-					target: 'http://192.168.1.245:9003',
+					// target: 'http://192.168.1.245:9003',
+					target: 'http://192.168.31.80:9003',
 					// target: 'http://192.168.31.15:9003',
 					// target: 'http://192.168.31.15:9003',
 					ws: false,