Bläddra i källkod

feat: 新增课程开放管理功能模块

- 添加课程开放管理页面及组件
- 实现课程列表展示、查询、新增、编辑功能
- 添加学期管理API接口
- 修复学期页面表格操作栏样式问题
- 修正开始时间字段拼写错误(starTime->startTime)
tanshanming 6 månader sedan
förälder
incheckning
b5e873999e

+ 13 - 0
src/api/courseOpen/index.js

@@ -0,0 +1,13 @@
+import { moduleRequest } from '@/utils/reSourceRequest'
+
+const request = moduleRequest(`/api/webapp/`)
+
+export const list = (p) => request('disk/courseopen/page', p, 'get')
+// 进入详情之后增加观看次数
+export const addItem = (p) => request('disk/courseopen/add', p, 'post')
+export const editItem = (p) => request('disk/courseopen/edit', p, 'post')
+//详情
+export const detail = (p) => request('disk/courseopen/detail', p, 'get')
+//收藏增加
+//资源列表 排除没权限得条目
+export const deletess = (p) => request('disk/courseopen/delete', p, 'post')

+ 13 - 0
src/api/semester/index.js

@@ -0,0 +1,13 @@
+import { baseRequest } from '@/utils/request'
+import {moduleRequest} from "@/utils/reSourceRequest";
+
+const request = moduleRequest(`/api/webapp/`)
+//学期下拉列表
+export let downList = (p) => request('disk/semester/downList', p, 'get')
+export let userAllList = (p) => request('bus/user/allList', p, 'get')
+export let gradesQueryList = (p) => request('disk/grades/allList', p, 'get')
+export let courseinfoAllList = (p) => request('disk/courseinfo/allList', p, 'get')
+
+// 上课时间周期,调用字典列表接口(/dev/dict/list),传入parentDictValue=COURSE_OPEN_WEEK_TYPE,返回数据中dictLabel是值,dictValue是键
+//单双周支持,调用字典列表接口(/dev/dict/list),传入parentDictValue=COURSE_OPEN_SCHEDULE_TIME,返回数据中dictLabel是值,dictValue是键
+//状态,调用字典列表接口(/dev/dict/list),传入parentDictValue=COURSE_OPEN_STATUS,返回数据中dictLabel是值,dictValue是键

+ 352 - 0
src/views/courseOpen/components/DialogView.vue

@@ -0,0 +1,352 @@
+<template>
+	<a-modal v-model:visible="visible" :title="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="room">
+				<a-input v-model:value="formState.room" placeholder="输入教室名称" />
+			</a-form-item>
+
+			<a-form-item label="老师" name="teacherId">
+				<a-select
+					v-model:value="formState.teacherId"
+					:fieldNames="{ label: 'name', value: 'id' }"
+					:options="userAllListOptions"
+					placeholder="请选择老师"
+					@change="changeCollegeMajor"
+				/>
+			</a-form-item>
+
+			<a-form-item label="班级" name="gradesId">
+				<a-select
+					v-model:value="formState.gradesId"
+					:fieldNames="{ label: 'gradesName', value: 'gradesId' }"
+					:options="gradesQueryListOptions"
+					placeholder="请选择班级"
+					@change="changeCollegeMajor"
+				/>
+			</a-form-item>
+
+			<a-form-item label="课程" name="courseId">
+				<a-select
+					v-model:value="formState.courseId"
+					:fieldNames="{ label: 'courseName', value: 'courseId' }"
+					:options="courseinfoAllListOptions"
+					placeholder="请选择课程"
+					@change="changeCollegeMajor"
+				/>
+			</a-form-item>
+
+			<a-form-item label="学期" name="semesterId">
+				<a-select
+					v-model:value="formState.semesterId"
+					:fieldNames="{ label: 'name', value: 'id' }"
+					:options="downListOptions"
+					placeholder="请选择学期"
+					@change="changeCollegeMajor"
+				/>
+			</a-form-item>
+
+			<a-form-item label="开始节次" name="startPeriod">
+				<!--					<a-input v-model:value="formState.startPeriod" placeholder="输入开始节次" />-->
+				<a-input-number
+					v-model:value="formState.startPeriod"
+					:min="1"
+					:max="100"
+					placeholder="输入开始节次"
+					style="width: 100%"
+				/>
+			</a-form-item>
+			<a-form-item label="结束节次" name="endPeriod">
+				<!--					<a-input v-model:value="formState.endPeriod" placeholder="输入结束节次" />-->
+				<a-input-number
+					v-model:value="formState.endPeriod"
+					:min="1"
+					:max="100"
+					placeholder="输入结束节次"
+					style="width: 100%"
+				/>
+			</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>
+<script setup>
+	import { reactive, ref } from 'vue'
+	import resourceAuditApi from '@/api/resourceAudit.js'
+	import { downList, userAllList, gradesQueryList, courseinfoAllList } from '@/api/semester/index.js'
+	const collegeMajorOptions = ref([]) //院系
+	const majorIdName = ref([]) //院系回显
+	const majorOptions = ref([]) //专业
+	const semesterOptions = ref([]) //专业
+
+	const downListOptions = ref([]) //专业
+	const userAllListOptions = ref([]) //专业
+	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/courseopen'
+	import tool from '@/utils/tool'
+	import { message } from 'ant-design-vue'
+	const visible = ref(false)
+
+	const startPeriodTag = ref(false)
+	const endPeriodTag = ref(false)
+
+	const emit = defineEmits(['handleAddItem'])
+
+	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' }],
+		teacherId: [{ required: true, message: '请选择老师', trigger: 'change' }],
+		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(
+		() => visible.value,
+		(newVal, oldVal) => {
+			if (newVal == false && formRef.value) {
+				formRef.value.resetFields()
+			}
+		},
+		{ deep: true, immediate: true }
+	)
+	watch(
+		() => formState.value.startPeriod,
+		(newVal, oldVal) => {
+			if (Number(formState.value.endPeriod)) {
+				if (newVal > formState.value.endPeriod) {
+					message.error('开始节次不能大于结束节次')
+					startPeriodTag.value = true
+				} else {
+					startPeriodTag.value = false
+				}
+			}
+		},
+		{ deep: true, immediate: true }
+	)
+	watch(
+		() => formState.value.endPeriod,
+		(newVal, oldVal) => {
+			if (Number(formState.value.startPeriod)) {
+				if (newVal < formState.value.startPeriod) {
+					message.error('结束节次不能小于开始节次')
+					endPeriodTag.value = true
+				} else {
+					endPeriodTag.value = false
+				}
+			}
+		},
+		{ deep: true, immediate: true }
+	)
+
+	const open = () => {
+		visible.value = true
+		mode.value = 'add'
+		title.value = '添加'
+		startPeriodTag.value = false
+		endPeriodTag.value = false
+	}
+	const edit = (item) => {
+		visible.value = true
+		mode.value = 'edit'
+		title.value = '修改'
+		console.log('编辑内容', item)
+
+		startPeriodTag.value = false
+		endPeriodTag.value = false
+		detail({ id: item.id }).then((res) => {
+			if (res.code == 200) {
+				formState.value.id = item.id
+				formState.value = { id: item.id, ...res.data }
+				formState.value.gradesId = Number(formState.value.gradesId)
+				// formState.value.semesterId = Number(formState.value.semesterId)
+
+				console.log('会先对象', formState.value)
+				// changeCollegeMajor(formState.collegeId)
+			}
+		})
+	}
+	const handleOk = (e) => {
+		if (startPeriodTag.value == false && endPeriodTag.value == false) {
+			formRef.value.validate().then(() => {
+				let json = JSON.parse(JSON.stringify(formState.value))
+
+				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
+					})
+				}
+			})
+		} else {
+			message.error('开始节次或结束节次数据不正确')
+		}
+
+		// console.logckPoint.value = false
+	}
+	const getOrgTreeSelector = () => {
+		resourceAuditApi
+			.orgList()
+			.then((res) => {
+				console.log(res.data, '获取学院')
+				collegeMajorOptions.value = res.data
+			})
+			.catch((err) => {
+				console.log(err)
+			})
+	}
+	const getSemesterSelector = () => {
+		console.log('对象内容')
+		downList()
+			.then((res) => {
+				console.log(res.data, '获取学期')
+				semesterOptions.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()
+		// getSemesterSelector()
+		getPullDara()
+
+		console.log('都什么呢', COURSE_OPEN_SCHEDULE_TIME_Options)
+	})
+	const getPullDara = () => {
+		downList()
+			.then((res) => {
+				console.log(res.data, '专业下拉数据', formState)
+				downListOptions.value = res.data
+			})
+			.catch((err) => {
+				console.log(err)
+			})
+		userAllList()
+			.then((res) => {
+				userAllListOptions.value = res.data
+				console.log(res.data, '老师数据', userAllListOptions.value)
+			})
+			.catch((err) => {
+				console.log(err)
+			})
+		gradesQueryList()
+			.then((res) => {
+				console.log(res.data, '专业下拉数据', formState)
+				gradesQueryListOptions.value = res.data
+			})
+			.catch((err) => {
+				console.log(err)
+			})
+		courseinfoAllList()
+			.then((res) => {
+				console.log(res.data, '专业下拉数据', formState)
+				courseinfoAllListOptions.value = res.data
+			})
+			.catch((err) => {
+				console.log(err)
+			})
+	}
+
+	defineExpose({ open, edit })
+</script>

+ 238 - 0
src/views/courseOpen/components/ListView.vue

@@ -0,0 +1,238 @@
+<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, 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.id]" title="确定删除?" trigger="click">
+					<template #content>
+						<a-button style="margin-right: 10px" type="primary" @click="handleDelete(record)">确定 </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" 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 { list, deletess } from '@/api/courseOpen/index.js'
+	import { useRouter } from 'vue-router'
+
+	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: 'room'
+		},
+		{
+			title: '班级名称',
+			dataIndex: 'gradesIdName'
+		},
+		{
+			title: '学期',
+			dataIndex: 'semesterIdName'
+		},
+		{
+			title: '开始节次',
+			dataIndex: 'startPeriod'
+		},
+		{
+			title: '结束节次',
+			dataIndex: 'endPeriod'
+		},
+		{
+			title: '上课周期',
+			dataIndex: 'scheduleTimeName'
+		},
+		{
+			title: '单双周',
+			dataIndex: 'weekTypeName'
+		},
+		{
+			title: '老师',
+			dataIndex: 'teacherIdName'
+		},
+		{
+			title: '状态',
+			dataIndex: 'statusName'
+		},
+		// {
+		// 	title: '发布时间',
+		// 	dataIndex: 'createTime',
+		// 	sorter: true,
+		// 	width: '10%'
+		// },
+		{
+			title: '操作',
+			dataIndex: 'action',
+			width: '130px',
+			align: 'center'
+		}
+	]
+	// 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)
+		popoverVisibles[record.id] = false
+		deletess([{ id: record.id }]).then((res) => {
+			getList()
+		})
+		// 在这里添加删除记录的逻辑
+	}
+	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/courseOpen/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">-->
+				<!--&lt;!&ndash;					<a-cascader&ndash;&gt;-->
+				<!--&lt;!&ndash;						v-model:value="formState.loacl"&ndash;&gt;-->
+				<!--&lt;!&ndash;						:options="options"&ndash;&gt;-->
+				<!--&lt;!&ndash;						placeholder="选择院校"&ndash;&gt;-->
+				<!--&lt;!&ndash;						change-on-select&ndash;&gt;-->
+				<!--&lt;!&ndash;						allowClear&ndash;&gt;-->
+				<!--&lt;!&ndash;						:field-names="{ label: 'name', value: 'id', children: 'children' }"&ndash;&gt;-->
+				<!--&lt;!&ndash;					/>&ndash;&gt;-->
+				<!--					<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>

+ 88 - 0
src/views/courseOpen/index.vue

@@ -0,0 +1,88 @@
+<template>
+	<div class="courseOpen">
+		<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>
+	<DialogView ref="dialogViewRef" @handleAddItem="handleAddItem"></DialogView>
+</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)
+	}
+	//发布确定
+
+	// 上传资源模态框
+
+	onMounted(() => {
+		// getListData()
+	})
+</script>
+
+<style scoped>
+	.courseOpen {
+		background: #fff;
+		padding: 20px;
+		border-radius: 5px;
+	}
+</style>

+ 2 - 2
src/views/semester/index.vue

@@ -10,7 +10,7 @@
 			:tool-config="toolConfig"
 			:row-selection="options.rowSelection"
 		>
-			<template #operator class="table-operator">
+			<template #operator>
 				<a-space>
 					<a-button type="primary" @click="formRef.onOpen()">
 						<template #icon><plus-outlined /></template>
@@ -52,7 +52,7 @@
 		},
 		{
 			title: '开始时间',
-			dataIndex: 'starTime'
+			dataIndex: 'startTime'
 		},
 		{
 			title: '学期名称',

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 146 - 0
stats.html


Vissa filer visades inte eftersom för många filer har ändrats