Quellcode durchsuchen

refactor(course): 重构课程管理相关组件和样式

- 移除固定宽度样式,使用百分比布局
- 清理调试日志和未使用的代码
- 重构课程添加和详情页面为模态框形式
- 优化表单布局和样式
- 统一事件总线处理编辑操作
- 移除冗余的Header和Footer组件
- 优化表格操作按钮布局
tanshanming vor 7 Monaten
Ursprung
Commit
7969ffaf29

+ 1 - 1
src/api/courseCenter/courseinfo.js

@@ -5,7 +5,7 @@ const request = (url, ...arg) => baseRequest(`/api/webapp/` + url, ...arg)
 export default {
 	// 获取授课教师下拉
 	lecturerList(data) {
-		return request('sys/user/allList', data, 'get')
+		return request('bus/user/allList', data, 'get')
 	},
 	// 课程信息添加
 	add(data) {

+ 1 - 0
src/api/courseinfo/index.js

@@ -8,6 +8,7 @@ const request = moduleRequest(`/api/webapp/`)
  */
 // 获取文件列表(区分文件路径)
 export const list = (p) => request('disk/courseinfo/page', p, 'get')
+export const copy = (p) => request('disk/courseinfo/copy', p, 'post')
 // 获取文件列表(区分文件类型)
 // export const getFileListByType = (p) => request('file/selectfilebyfiletype', p, 'get')
 

+ 114 - 117
src/views/announcementManagement/components/DialogView.vue

@@ -9,142 +9,139 @@
 			:wrapper-col="{ span: 12 }"
 		>
 			<a-form-item label="公告标题" name="title">
-				<a-input v-model:value="formState.title" placeholder="输入公告标题"/>
+				<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-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'
+	import { reactive, ref } from 'vue'
+	import resourceAuditApi from '@/api/resourceAudit.js'
 
-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 = () => {
+	const collegeMajorOptions = ref([]) //院系
+	const majorIdName = ref([]) //院系回显
+	const majorOptions = ref([]) //专业
+	const formRef = ref() //专业
+	const mode = ref('add') //专业
+	import { addItem, detail, editItem } from '@/api/notice'
 
-	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 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' }]
+	}
 
-}
-const handleOk = (e) => {
-	formRef.value.validate().then(() => {
-		let json = JSON.parse(JSON.stringify(formState))
+	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")
+			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) => {
+				collegeMajorOptions.value = res.data
 			})
-		}
-		if (mode.value == 'edit') {
-			editItem(json).then((res) => {
-				if(res.code == 200){
-					emit("handleAddItem")
-					visible.value = false
-				}
+			.catch((err) => {
+				console.log(err)
 			})
+	}
+	const changeCollegeMajor = (value, selectedOptions) => {
+		console.log('Selected:', value, selectedOptions)
+		if (!value) {
+			formState.collegeTwoId = ''
+			// majorIdName.value = ''
+			return 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)
+		// }
 	}
-	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()
-})
+	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})
+	defineExpose({ open, edit })
 </script>

+ 160 - 161
src/views/announcementManagement/components/ListView.vue

@@ -11,18 +11,16 @@
 	>
 		<template #bodyCell="{ column, text, record }">
 			<template v-if="column.dataIndex === 'content'">
-				<a-popover title="详细内容"
-						   trigger="hover"
-				>
+				<a-popover title="详细内容" trigger="hover">
 					<template #content>
 						{{ text }}
 					</template>
 					<template v-if="text.length > 10">
-						<span >{{ text.slice(0, 10) }}...</span>
+						<span>{{ text.slice(0, 10) }}...</span>
 					</template>
 				</a-popover>
 				<template v-if="text.length <= 10">
-					<span >{{ text }}</span>
+					<span>{{ text }}</span>
 				</template>
 			</template>
 
@@ -31,9 +29,15 @@
 				<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>
+						<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>
@@ -53,171 +57,166 @@
 </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()
+	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 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%'
+	const formatTimestamp = (time) => {
+		return tool.formatTimestamp(time)
 	}
-]
-// 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 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
 
-// 编辑按钮点击事件
-const handleEdit = (record) => {
-	console.log('编辑记录', record)
-	// 在这里添加编辑记录的逻辑
+		getList()
+	}
+	const handleDetail = (record) => {
+		console.log('查看详情', record)
+		router.push({
+			path: '/portal/courseDetails',
+			query: {
+				id: record.courseId
+			}
+		})
+		// 在这里添加查看详情的逻辑
+	}
 
-	emit('handleEdit', record)
-}
+	// 编辑按钮点击事件
+	const handleEdit = (record) => {
+		console.log('编辑记录', 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()
-	// })
+		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')
+	// 删除按钮点击事件
+	const handleDelete = (record) => {
+		console.log('删除记录', record)
+		// 在这里添加删除记录的逻辑
+	}
+	const getList = () => {
+		list({ ...pagination.value }).then((data) => {
+			if (data.code == 200) {
+				dataSources.value = []
+				dataSources.value = data.data.records
+				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
+		})
+	}
 
-	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()
 	})
-}
-
-// 重置按钮点击事件
-onMounted(() => {
-	// getListData()
-	getList()
-})
-
 
-// watch(
-// 	() => dataSources.value,
-// 	(newVal, oldVal) => {
-// 		console.log('数据源变化了 ', ' 新的 ',newVal, '  旧的 ',oldVal)
-// 	},
-// 	{ deep: true, immediate: true }
-// )
-defineExpose({
-	setList,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;
-}
+	.desc p {
+		margin-bottom: 1em;
+	}
 </style>

+ 113 - 120
src/views/classManagement/components/DialogView.vue

@@ -1,115 +1,109 @@
 <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-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>
+			<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 { 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'
+	import { addItem, detail, editItem } from '@/api/grades'
 	const visible = ref(false)
-const emit = defineEmits([ "handleAddItem" ])
+	const emit = defineEmits(['handleAddItem'])
 	const formState = reactive({
 		gradesName: undefined,
 		collegeId: undefined,
-		majorId: undefined,
+		majorId: undefined
 	})
 	const rules = {
 		gradesName: [{ required: true, message: '请输入教室名称', trigger: 'blur' }],
 		collegeId: [{ required: true, message: '请选择院系', trigger: 'change' }],
-		majorId: [{ 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 }
-)
+	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+""
+	const edit = (item) => {
+		visible.value = true
+		mode.value = 'edit'
+		console.log('编辑内容', item)
 
-			changeCollegeMajor(formState.collegeId)
-		}
-	})
+		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(()=>{
+		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")
+			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
 				})
 			}
@@ -120,51 +114,50 @@ const edit = (item) => {
 		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
+	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)
+		// }
 	}
-	// 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( ()=>{
+	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})
+	defineExpose({ open, edit })
 </script>

+ 164 - 166
src/views/classManagement/components/ListView.vue

@@ -10,22 +10,25 @@
 		size="small"
 	>
 		<template #bodyCell="{ column, text, record }">
-<!--			<template v-if="column.dataIndex === 'publishTime'">{{ formatTimestamp(text) }}</template>-->
+			<!--			<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>
+						<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>
@@ -41,177 +44,172 @@
 </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()
+	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 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%'
+	const formatTimestamp = (time) => {
+		return tool.formatTimestamp(time)
 	}
-]
-// 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 total = ref(0)
+	const pagination = ref({
+		size: 10,
+		current: 1
 	})
-}
-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 onChangeCurrent = (current) => {
+		router.push({
+			path: '/' + current
+		})
+	}
+	const handlerChange = (page, pageSize) => {
+		console.log('分页参数', page, pageSize)
+		// pagination.value.size = pageSize
+		// pagination.value.current = page
 
-// 编辑按钮点击事件
-const handleEdit = (record) => {
-	console.log('编辑记录', record)
-	// 在这里添加编辑记录的逻辑
+		getList()
+	}
+	const handleDetail = (record) => {
+		console.log('查看详情', record)
+		router.push({
+			path: '/portal/courseDetails',
+			query: {
+				id: record.courseId
+			}
+		})
+		// 在这里添加查看详情的逻辑
+	}
 
-	emit('handleEdit', record)
-}
+	// 编辑按钮点击事件
+	const handleEdit = (record) => {
+		console.log('编辑记录', 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()
-	// })
+		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')
+	// 删除按钮点击事件
+	const handleDelete = (record) => {
+		console.log('删除记录', record)
+		// 在这里添加删除记录的逻辑
+	}
+	const getList = () => {
+		list({ ...pagination.value }).then((data) => {
+			if (data.code == 200) {
+				dataSources.value = []
+				dataSources.value = data.data.records
+				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
+		})
+	}
 
-	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
+	// 重置按钮点击事件
+	onMounted(() => {
+		// getListData()
+		getList()
 	})
-}
-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
-})
+	// watch(
+	// 	() => dataSources.value,
+	// 	(newVal, oldVal) => {
+	// 		console.log('数据源变化了 ', ' 新的 ',newVal, '  旧的 ',oldVal)
+	// 	},
+	// 	{ deep: true, immediate: true }
+	// )
+	defineExpose({
+		setList,
+		getList
+	})
 </script>
 
 <style scoped>
-.desc p {
-	margin-bottom: 1em;
-}
+	.desc p {
+		margin-bottom: 1em;
+	}
 </style>

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

@@ -110,7 +110,6 @@
 		resourceAuditApi
 			.orgList()
 			.then((res) => {
-				console.log(res.data, '获取学院')
 				collegeMajorOptions.value = res.data
 			})
 			.catch((err) => {

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

@@ -44,7 +44,6 @@
 	const open = ref(false)
 
 	const handleNewCourse = () => {
-		console.log('新建课程111')
 		// 在这里添加新建课程的逻辑
 		dialogViewRef.value.open()
 
@@ -53,7 +52,6 @@
 		// })
 	}
 	const handleAddItem = () => {
-		console.log('新建课程111')
 		// 在这里添加新建课程的逻辑
 		listViewRef.value.getList()
 

+ 3 - 4
src/views/courseAdd/components/StudentDetails.vue

@@ -45,7 +45,6 @@
 			:data-source="pagedDatas"
 			:pagination="false"
 			:row-selection="rowSelection"
-			:scroll="{ x: 1000, y: 320 }"
 			bordered
 			class="student-table"
 		>
@@ -184,7 +183,7 @@
 </template>
 
 <script setup>
-	import { ref, reactive, computed, onMounted, unref} from 'vue'
+	import { ref, reactive, computed, onMounted, unref } from 'vue'
 	import { message } from 'ant-design-vue'
 	import { DownOutlined } from '@ant-design/icons-vue'
 	import { getDepartmentMembers } from '@/api/course/courseDetail'
@@ -282,7 +281,7 @@
 				console.log(changeRowKeys, 'changeRowKeyschangeRowKeys')
 				selectedRowKeys.value = changeRowKeys
 			},
-			hideDefaultSelections: true,
+			hideDefaultSelections: true
 		}
 	})
 	//添加学员确认
@@ -547,8 +546,8 @@
 <style lang="less" scoped>
 	.student-details-page {
 		background: #fff;
+		width: 100%;
 		border-radius: 12px;
-		width: 1200px;
 		margin: 0 auto;
 		padding: 32px 32px 24px 32px;
 		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.04);

+ 26 - 35
src/views/courseAdd/components/courseInfo.vue

@@ -4,8 +4,8 @@
 		:rules="rules"
 		ref="formRef"
 		layout="horizontal"
-		:label-col="{ span: 2 }"
-		:wrapper-col="{ span: 12 }"
+		:label-col="{ span: 3 }"
+		:wrapper-col="{ span: 21 }"
 	>
 		<a-form-item label="教室名称" name="courseName">
 			<a-input v-model:value="formState.courseName" placeholder="输入教室名称" />
@@ -41,14 +41,14 @@
 				placeholder="请选择专业"
 				@change="changeCollegeMajor"
 			/>
-<!--			<a-cascader-->
-<!--				v-model:value="majorIdName"-->
-<!--				:options="collegeMajorOptions"-->
-<!--				:fieldNames="{ label: 'name', value: 'id' }"-->
-<!--				placeholder="请选择院系"-->
-<!--				changeOnSelect-->
-<!--				@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
@@ -70,17 +70,9 @@
 			/>
 		</a-form-item>
 
-		<a-form-item :wrapper-col="{ offset: 5, span: 12 }">
-			<a-button
-				type="primary"
-				v-if="!courseInfoId"
-				style="margin-right: 10px"
-				@click="submit"
-				>提交</a-button
-			>
-			<a-button type="primary" v-if="courseInfoId" @click="editSub"
-				>编辑提交</a-button
-			>
+		<a-form-item :wrapper-col="{ offset: 11, span: 2 }">
+			<a-button type="primary" v-if="!courseInfoId" style="margin-right: 10px" @click="submit">提交</a-button>
+			<a-button type="primary" v-if="courseInfoId" @click="editSub">编辑提交</a-button>
 		</a-form-item>
 	</a-form>
 </template>
@@ -155,7 +147,7 @@
 				console.log(res.data, '表单添加')
 				courseInfoId.value = res.data.courseId
 				// localStorage.setItem('courseInfoId', res.data.courseId)
-				emit('nextStep',res.data.courseId)
+				emit('nextStep', res.data.courseId)
 			})
 			.catch((err) => {
 				console.log(err)
@@ -169,7 +161,7 @@
 			.edit({ ...formState, courseId: courseInfoId.value })
 			.then((res) => {
 				console.log(res.data, '表单编辑')
-				emit('nextStep',courseInfoId.value)
+				emit('nextStep', courseInfoId.value)
 			})
 			.catch((err) => {
 				console.log(err)
@@ -180,12 +172,12 @@
 		formState.coverImageId = fileId
 	}
 	const submit = () => {
-		formRef.value.validate().then(()=>{
+		formRef.value.validate().then(() => {
 			handleSubmit()
 		})
 	}
 	const editSub = () => {
-		formRef.value.validate().then(()=>{
+		formRef.value.validate().then(() => {
 			handleEdit()
 		})
 	}
@@ -210,7 +202,6 @@
 		resourceAuditApi
 			.orgList()
 			.then((res) => {
-				console.log(res.data, '获取学院')
 				collegeMajorOptions.value = res.data
 			})
 			.catch((err) => {
@@ -230,15 +221,15 @@
 		// 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 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) => {

+ 254 - 251
src/views/courseAdd/components/courseProduction/index.vue

@@ -10,42 +10,51 @@
 				<span>{{ chapter.name }}</span>
 				<!--				<a-icon type="edit" @click="editChapter(chapterIndex)" />-->
 				<div>
-					<EditOutlined style="margin-right: 20px" @click="editChapter(chapterIndex)"/>
+					<EditOutlined style="margin-right: 20px" @click="editChapter(chapterIndex)" />
 					<a-popover v-model:visible="popoverVisible[chapterIndex]" title="提示" trigger="click">
 						<template #content>
-							<a-button style="margin-right: 10px" type="primary" @click="delChapter(chapterIndex)">删除
-							</a-button>
-							<a-button @click="()=>{	popoverVisible[chapterIndex] = false}">取消</a-button>
+							<a-button style="margin-right: 10px" type="primary" @click="delChapter(chapterIndex)">删除 </a-button>
+							<a-button
+								@click="
+									() => {
+										popoverVisible[chapterIndex] = false
+									}
+								"
+								>取消</a-button
+							>
 						</template>
-						<DeleteOutlined/>
+						<DeleteOutlined />
 					</a-popover>
-
 				</div>
-
 			</div>
 
 			<!-- 添加课时按钮 -->
 			<a-button class="add-chapter-btn1" type="primary" size="small" @click="showAddLessonModal(chapterIndex)">
-				<PlusOutlined/>
+				<PlusOutlined />
 				添加课时
 			</a-button>
 			<!-- 课时列表 -->
 			<div v-for="(lesson, lessonIndex) in chapter.classHours" :key="lessonIndex" class="lesson">
 				<!-- 视频封面 -->
-				<img  src="@/assets/images/fileImg/gif.png" alt="Video Cover" class="video-cover" style="width: 140px; height: 90px"/>
+				<img
+					src="@/assets/images/fileImg/gif.png"
+					alt="Video Cover"
+					class="video-cover"
+					style="width: 140px; height: 90px"
+				/>
 				<!-- 课时信息 -->
-				<div style="display: flex; flex-direction: column; justify-content: space-between; height: 100%  ">
+				<div style="display: flex; flex-direction: column; justify-content: space-between; height: 100%">
 					<div>{{ lesson.name }}</div>
 					<div>
-<!--						<span>视频大小:{{ lesson.size }}MB</span>-->
+						<!--						<span>视频大小:{{ lesson.size }}MB</span>-->
 						<span>发布时间:{{ lesson.createTime }}</span>
 						<span>发布人:{{ lesson.createUserName }}</span>
 					</div>
 				</div>
-				<div style="display: flex;  height: 100%;  position: absolute;  right: 15px;  top: 15px">
+				<div style="display: flex; height: 100%; position: absolute; right: 15px; top: 15px">
 					<div>
-						<EditOutlined class="action-icon" @click="handleEdit(lesson)"/>
-						<DeleteOutlined class="action-icon" @click="handleDel(lesson)"/>
+						<EditOutlined class="action-icon" @click="handleEdit(lesson)" />
+						<DeleteOutlined class="action-icon" @click="handleDel(lesson)" />
 					</div>
 				</div>
 			</div>
@@ -54,293 +63,287 @@
 		<a-modal v-model:visible="modalVisible" :title="dialogTitle" @ok="handleOk" @cancel="handleCancel">
 			<a-form :model="formState">
 				<a-form-item label="章节名称">
-					<a-input v-model:value="formState.chapterName" placeholder="请输入章节名称"/>
+					<a-input v-model:value="formState.chapterName" placeholder="请输入章节名称" />
 				</a-form-item>
 			</a-form>
 		</a-modal>
 		<!-- 添加课时模态框 -->
-		<addDialog ref="addDialogRef" @ok="onAddClassHoursOk" @onAddChapter="onAddChapter"/>
+		<addDialog ref="addDialogRef" @ok="onAddClassHoursOk" @onAddChapter="onAddChapter" />
 	</div>
 </template>
 
 <script setup>
-import {ref, reactive, onMounted} from 'vue'
-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'
-
-
-const router = useRouter()
-const route = useRoute()
-const popoverVisible = ref({})
-const modeTag = ref('add')
-const dialogTitle = ref('添加章节')
-
+	import { ref, reactive, onMounted } from 'vue'
+	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'
+
+	const router = useRouter()
+	const route = useRoute()
+	const popoverVisible = ref({})
+	const modeTag = ref('add')
+	const dialogTitle = ref('添加章节')
+
+	const props = defineProps({
+		//课程id
+		courseInfoId: {
+			type: Number,
+			required: true,
+			default: null
+		}
+	})
+	// 章节数据
+	const chapters = ref([])
+	const closePopover = () => {
+		popoverVisible.value = false
+	}
+	const handleEdit = (item) => {
+		addDialogRef.value.edit(item)
+	}
+	const handleDel = (item) => {
+		console.log('删除', item)
 
-const props = defineProps({
-	//课程id
-	courseInfoId: {
-		type: Number,
-		required: true,
-		default: null
+		del([{ id: item.id }]).then(() => {
+			getList()
+		})
 	}
-})
-// 章节数据
-const chapters = ref([])
-const closePopover = () => {
-	popoverVisible.value = false
-}
-const handleEdit = (item) => {
-	addDialogRef.value.edit(item)
-}
-const handleDel = (item) => {
-	console.log('删除',item)
 
-	del([{id : item.id}]).then(()=>{
-		getList()
+	// 模态框显示状态
+	const modalVisible = ref(false)
+	const currentChapterIndex = ref(null)
+	const addDialogRef = ref(null)
+	// 表单状态
+	const formState = reactive({
+		id: '',
+		chapterName: ''
 	})
-}
+	const pagination = reactive({
+		pageSize: 10,
+		pageNum: 1,
+		total: 50,
+		showTotal: (total) => `共${total}条`
+	})
+	// 显示模态框
+	const showModal = () => {
+		dialogTitle.value = '添加章节'
+		modeTag.value = 'add'
+		modalVisible.value = true
+		formState.chapterName = ''
+	}
 
-// 模态框显示状态
-const modalVisible = ref(false)
-const currentChapterIndex = ref(null)
-const addDialogRef = ref(null)
-// 表单状态
-const formState = reactive({
-	id: '',
-	chapterName: ''
-})
-const pagination = reactive({
-	pageSize: 10,
-	pageNum: 1,
-	total: 50,
-	showTotal: (total) => `共${total}条`
-})
-// 显示模态框
-const showModal = () => {
-	dialogTitle.value = '添加章节'
-	modeTag.value = 'add'
-	modalVisible.value = true
-	formState.chapterName = ''
-}
+	// 确认按钮点击事件
+	const handleOk = () => {
+		let courseInfoId = props.courseInfoId
+		if (formState.chapterName && modeTag.value == 'add') {
+			courseProductionApi
+				.add({
+					courseId: courseInfoId,
+					name: formState.chapterName
+				})
+				.then((res) => {
+					console.log(res, '章节添加')
+					getList()
+				})
+				.catch((err) => {
+					console.log(err)
+				})
+			formState.chapterName = '' // 清空表单
+			modalVisible.value = false // 关闭模态框
+		}
+		if (formState.chapterName && modeTag.value == 'edit') {
+			courseProductionApi
+				.edit({
+					id: formState.id,
+					courseId: courseInfoId,
+					name: formState.chapterName
+				})
+				.then((res) => {
+					console.log(res, '章节添加')
+					getList()
+				})
+				.catch((err) => {
+					console.log(err)
+				})
+			formState.chapterName = '' // 清空表单
+			modalVisible.value = false // 关闭模态框
+		}
+	}
+
+	// 取消按钮点击事件
+	const handleCancel = () => {
+		formState.chapterName = '' // 清空表单
+		modalVisible.value = false // 关闭模态框
+	}
+	// 编辑章节
+	const editChapter = (chapterIndex) => {
+		// 实现编辑逻辑
+		let item = chapters.value[chapterIndex]
+		modalVisible.value = true
+		dialogTitle.value = '修改章节'
+		modeTag.value = 'edit'
+		formState.id = item.id
+		formState.chapterName = item.name
+	}
 
-// 确认按钮点击事件
-const handleOk = () => {
-	let courseInfoId = props.courseInfoId
-	if (formState.chapterName && modeTag.value == 'add') {
+	// 编辑课时
+	const editLesson = (chapterIndex, lessonIndex) => {
+		// 实现编辑逻辑
+	}
+	const delChapter = (chapterIndex) => {
+		console.log('删除', chapterIndex)
+		// 实现编辑逻辑
+		let item = chapters.value[chapterIndex]
+		popoverVisible.value[chapterIndex] = false
 
 		courseProductionApi
-			.add({
-				courseId: courseInfoId,
-				name: formState.chapterName
-			})
+			.delete([{ id: item.id }])
 			.then((res) => {
-				console.log(res, '章节添加')
+				console.log('章节列表', res)
 				getList()
 			})
 			.catch((err) => {
 				console.log(err)
 			})
-		formState.chapterName = '' // 清空表单
-		modalVisible.value = false // 关闭模态框
 	}
-	if (formState.chapterName && modeTag.value == 'edit') {
-
+	// 获取章节列表
+	const getList = () => {
 		courseProductionApi
-			.edit({
-				id: formState.id,
-				courseId: courseInfoId,
-				name: formState.chapterName
-			})
+			.allList({ courseId: props.courseInfoId })
 			.then((res) => {
-				console.log(res, '章节添加')
-				getList()
+				console.log('章节列表', res)
+				chapters.value = res.data
 			})
 			.catch((err) => {
 				console.log(err)
 			})
-		formState.chapterName = '' // 清空表单
-		modalVisible.value = false // 关闭模态框
 	}
-}
-
-// 取消按钮点击事件
-const handleCancel = () => {
-	formState.chapterName = '' // 清空表单
-	modalVisible.value = false // 关闭模态框
-}
-// 编辑章节
-const editChapter = (chapterIndex) => {
-	// 实现编辑逻辑
-	let item = chapters.value[chapterIndex]
-	modalVisible.value = true
-	dialogTitle.value = '修改章节'
-	modeTag.value = 'edit'
-	formState.id = item.id
-	formState.chapterName = item.name
-
-}
-
-// 编辑课时
-const editLesson = (chapterIndex, lessonIndex) => {
-	// 实现编辑逻辑
-}
-const delChapter = (chapterIndex) => {
-	console.log('删除', chapterIndex)
-	// 实现编辑逻辑
-	let item = chapters.value[chapterIndex]
-	popoverVisible.value[chapterIndex] = false
 
-	courseProductionApi.delete([{id: item.id}]).then((res) => {
-		console.log('章节列表', res)
+	// 删除课时
+	const deleteLesson = (chapterIndex, lessonIndex) => {
+		chapters.value[chapterIndex].lessons.splice(lessonIndex, 1)
+	}
+	// 显示课时模态框
+	const showAddLessonModal = (chapterIndex) => {
+		currentChapterIndex.value = chapterIndex
+		addDialogRef.value.open()
+		addDialogRef.value.setData(chapters.value[chapterIndex])
+		modeTag.value = 'add'
+	}
+	// 显示课时模态框
+	const onAddClassHoursOk = (data) => {
+		console.log(data, 'onAddClassHoursOk')
+		// addLessonModalVisible.value = true
+	}
+	const onAddChapter = () => {
+		getList()
+	}
+	onMounted(() => {
+		console.log('有没有id呢', props.courseInfoId)
 		getList()
 	})
-		.catch((err) => {
-			console.log(err)
-		})
-
-}
-// 获取章节列表
-const getList = () => {
-	courseProductionApi
-		.allList({courseId: props.courseInfoId})
-		.then((res) => {
-			console.log('章节列表', res)
-			chapters.value = res.data
-		})
-		.catch((err) => {
-			console.log(err)
-		})
-}
-
-// 删除课时
-const deleteLesson = (chapterIndex, lessonIndex) => {
-	chapters.value[chapterIndex].lessons.splice(lessonIndex, 1)
-}
-// 显示课时模态框
-const showAddLessonModal = (chapterIndex) => {
-	currentChapterIndex.value = chapterIndex
-	addDialogRef.value.open()
-	addDialogRef.value.setData(chapters.value[chapterIndex])
-	modeTag.value = 'add'
-
-
-}
-// 显示课时模态框
-const onAddClassHoursOk = (data) => {
-	console.log(data, 'onAddClassHoursOk')
-	// addLessonModalVisible.value = true
-}
-const onAddChapter = () => {
-	getList()
-}
-onMounted(() => {
-	console.log('有没有id呢', props.courseInfoId)
-	getList()
-})
 </script>
 
 <style scoped>
-.chapter {
-	width: 80%;
-}
+	.chapter {
+		width: 80%;
+	}
 
-.course-chapter {
-	padding: 20px;
-}
+	.course-chapter {
+		padding: 20px;
+	}
 
-.chapter-title {
-	background: #f0f0f0;
-	padding: 10px;
-	margin-bottom: 10px;
-	display: flex;
-	justify-content: space-between;
-	align-items: center;
-}
+	.chapter-title {
+		background: #f0f0f0;
+		padding: 10px;
+		margin-bottom: 10px;
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+	}
 
-.lesson {
-	width: 100%;
-	height: 120px;
-	display: flex;
-	align-items: center;
-	background: #f7f8fa;
-	border-radius: 8px;
-	margin-bottom: 16px;
-	padding: 16px 4px;
-	box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.03);
-	transition: box-shadow 0.2s;
-	position: relative;
-}
+	.lesson {
+		width: 100%;
+		height: 120px;
+		display: flex;
+		align-items: center;
+		background: #f7f8fa;
+		border-radius: 8px;
+		margin-bottom: 16px;
+		padding: 16px 4px;
+		box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.03);
+		transition: box-shadow 0.2s;
+		position: relative;
+	}
 
-.video-cover {
-	width: 100%;
-	height: 100%;
-	object-fit: cover;
-	border-radius: 4px;
-}
+	.video-cover {
+		width: 100%;
+		height: 100%;
+		object-fit: cover;
+		border-radius: 4px;
+	}
 
-.lesson-info {
-	margin-left: 10px;
-}
+	.lesson-info {
+		margin-left: 10px;
+	}
 
-.lesson-title {
-	font-weight: bold;
-	margin-bottom: 30px;
-}
+	.lesson-title {
+		font-weight: bold;
+		margin-bottom: 30px;
+	}
 
-.lesson-details {
-	display: flex;
-	flex-wrap: wrap;
-}
+	.lesson-details {
+		display: flex;
+		flex-wrap: wrap;
+	}
 
-.lesson-details span {
-	margin-right: 10px;
-}
+	.lesson-details span {
+		margin-right: 10px;
+	}
 
-/* 模态框内样式 */
-.ant-modal-content {
-	width: 400px;
-}
+	/* 模态框内样式 */
+	.ant-modal-content {
+		width: 400px;
+	}
 
-.ant-modal-body {
-	padding: 20px;
-}
+	.ant-modal-body {
+		padding: 20px;
+	}
 
-.ant-form-item-label > label {
-	font-weight: normal;
-}
+	.ant-form-item-label > label {
+		font-weight: normal;
+	}
 
-.lesson-actions {
-	display: flex;
-	align-items: center;
-}
+	.lesson-actions {
+		display: flex;
+		align-items: center;
+	}
 
-.action-icon {
-	font-size: 18px;
-	color: #347aff;
-	margin-left: 18px;
-	cursor: pointer;
-	transition: color 0.2s;
-}
+	.action-icon {
+		font-size: 18px;
+		color: #347aff;
+		margin-left: 18px;
+		cursor: pointer;
+		transition: color 0.2s;
+	}
 
-.action-icon:hover {
-	color: #1d5fd6;
-}
+	.action-icon:hover {
+		color: #1d5fd6;
+	}
 
-.add-chapter-btn {
-	background: #ffff;
-	border: 1px solid #347aff;
-	color: #347aff;
-	border-radius: 3px;
-	margin-bottom: 10px;
-}
+	.add-chapter-btn {
+		background: #ffff;
+		border: 1px solid #347aff;
+		color: #347aff;
+		border-radius: 3px;
+		margin-bottom: 10px;
+	}
 
-.add-chapter-btn1 {
-	color: #ffff;
-	border: 1px solid #347aff;
-	background: #347aff;
-	border-radius: 3px;
-	margin-bottom: 10px;
-}
+	.add-chapter-btn1 {
+		color: #ffff;
+		border: 1px solid #347aff;
+		background: #347aff;
+		border-radius: 3px;
+		margin-bottom: 10px;
+	}
 </style>

+ 28 - 25
src/views/courseAdd/index.vue

@@ -1,29 +1,25 @@
 <template>
 	<div style="overflow-y: auto">
 		<!-- <img :src="images" style="width: 100%; height: 100%" /> -->
-		<a-layout>
-			<Header @onChangeCurrent="onChangeCurrent" />
-			<div style="width: 71%; margin-left: 10%">
-				<a-tabs v-model:activeKey="activeKey" type="card">
-					<a-tab-pane key="1" tab="教室信息">
-						<courseInfo :courseInfoId="courseInfoId" @nextStep="nextStep" />
-					</a-tab-pane>
-					<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="4" tab="作业布置" :disabled="courseInfoId==null">-->
-<!--						<div>这里是作业布置的内容</div>-->
-<!--					</a-tab-pane>-->
-<!--					<a-tab-pane key="5" tab="测试布置" :disabled="courseInfoId==null">-->
-<!--						<div>这里是测试布置的内容</div>-->
-<!--					</a-tab-pane>-->
-				</a-tabs>
-			</div>
-		</a-layout>
-		<Footer />
+		<div>
+			<a-tabs v-model:activeKey="activeKey" type="card">
+				<a-tab-pane key="1" tab="教室信息">
+					<courseInfo :courseInfoId="courseInfoId" @nextStep="nextStep" />
+				</a-tab-pane>
+				<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="4" tab="作业布置" :disabled="courseInfoId==null">-->
+				<!--						<div>这里是作业布置的内容</div>-->
+				<!--					</a-tab-pane>-->
+				<!--					<a-tab-pane key="5" tab="测试布置" :disabled="courseInfoId==null">-->
+				<!--						<div>这里是测试布置的内容</div>-->
+				<!--					</a-tab-pane>-->
+			</a-tabs>
+		</div>
 	</div>
 </template>
 
@@ -38,9 +34,16 @@
 	const router = useRouter()
 	const route = useRoute()
 	const activeKey = ref('1') // 默认选中的标签页
-	const courseInfoId = ref(route.query.id || null) // 编辑课程信息id
+	// const courseInfoId = ref(route.query.id || null) // 编辑课程信息id
+	const props = defineProps({
+		courseInfoId: {
+			type: String,
+			default: null
+		}
+	})
+	const courseInfoId = ref(props.courseInfoId)
+	console.log('courseInfoId', courseInfoId.value)
 	const nextStep = (id) => {
-
 		courseInfoId.value = id
 		activeKey.value = '2'
 	}

+ 0 - 1
src/views/courseDetails/components/tab/LearningStatistics.vue

@@ -217,7 +217,6 @@
 
 <style lang="less" scoped>
 	.learning-statistics {
-		width: 1200px;
 		margin: 0 auto;
 		height: calc(100vh - 400px);
 		overflow: auto;

+ 0 - 1
src/views/courseDetails/components/tab/LessonDetails.vue

@@ -64,7 +64,6 @@
 
 <style scoped>
 	.section-list {
-		width: 1200px;
 		margin: 0 auto;
 		background: #fff;
 		border-radius: 0 0 12px 12px;

+ 0 - 1
src/views/courseDetails/components/tab/StudentDetails.vue

@@ -404,7 +404,6 @@
 	.student-details-page {
 		background: #fff;
 		border-radius: 12px;
-		width: 1200px;
 		margin: 0 auto;
 		padding: 32px 32px 24px 32px;
 		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.04);

+ 18 - 15
src/views/courseDetails/index.vue

@@ -87,10 +87,13 @@
 	import CourseAdd from '../courseAdd/index.vue'
 	import { getCourseDetail, getChapterAllList, updateCourseStatus, deleteCourse } from '@/api/course/courseDetail.js'
 	import sysConfig from '@/config/index'
-	import { useRouter, useRoute } from 'vue-router'
-
-	const router = useRouter()
-	const route = useRoute()
+	import EventBus from '@/utils/EventBus'
+	const props = defineProps({
+		courseId: {
+			type: String,
+			default: ''
+		}
+	})
 
 	const course = ref({
 		courseId: '',
@@ -122,7 +125,7 @@
 	})
 	const activeTab = ref('detail')
 	const currentPage = ref(1)
-	const courseInfoId = ref(route.query.id)
+	const courseInfoId = ref(props.courseId)
 	const pageSize = ref(10)
 	const editVisible = ref(false)
 	const addClassHoursVisible = ref(false)
@@ -136,7 +139,7 @@
 
 	onMounted(() => {
 		const params = {
-			courseId: route.query.id
+			courseId: props.courseId
 		}
 		// 获取课程基本信息
 		getCourseDetail(params).then((res) => {
@@ -154,12 +157,13 @@
 		})
 	})
 	const handleEdit = (item) => {
-		router.push({
-			path: '/portal/courseAdd',
-			query: {
-				id: item.courseId
-			}
-		})
+		// router.push({
+		// 	path: '/portal/courseAdd',
+		// 	query: {
+		// 		id: item.courseId
+		// 	}
+		// })
+		EventBus.emit('handleEdit', item)
 	}
 	function onPageChange(page) {
 		currentPage.value = page
@@ -260,11 +264,11 @@
 <style lang="less" scoped>
 	.course-detail-page {
 		background: #f7f8fa;
-		min-height: 100vh;
+		// min-height: 100vh;
+		width: 100%;
 		padding: 32px 0 0 0;
 
 		.course-info-card {
-			width: 1200px;
 			margin: 0 auto 24px auto;
 			border-radius: 12px;
 			box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.04);
@@ -360,7 +364,6 @@
 		}
 
 		.course-tabs {
-			width: 1200px;
 			margin: 0 auto 0 auto;
 			background: #fff;
 			border-radius: 12px 12px 0 0;

+ 196 - 180
src/views/courseManagement/components/ListView.vue

@@ -14,26 +14,38 @@
 			<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-button size="small" @click="handleCopy(record)" style="margin-right: 5px">复制</a-button>
 				<a-popover v-model:visible="popoverVisible[record.courseId]" title="确定下架?" trigger="click">
 					<template #content>
-						<a-button style="margin-right: 10px" type="primary" @click="handleShelf(record,0)">确定
-						</a-button>
-						<a-button @click="()=>{	popoverVisible[record.courseId] = false}">取消</a-button>
+						<a-button style="margin-right: 10px" type="primary" @click="handleShelf(record, 0)">确定 </a-button>
+						<a-button
+							@click="
+								() => {
+									popoverVisible[record.courseId] = 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-button v-if="record.putawayStatus == 1" size="small" style="margin-right: 5px">下架</a-button>
 				</a-popover>
 				<a-popover v-model:visible="popoverVisibles[record.courseId]" title="确定上架?" trigger="click">
 					<template #content>
-						<a-button style="margin-right: 10px" type="primary" @click="handleShelf(record,1)">确定
-						</a-button>
-						<a-button @click="()=>{	popoverVisibles[record.courseId] = false}">取消</a-button>
+						<a-button style="margin-right: 10px" type="primary" @click="handleShelf(record, 1)">确定 </a-button>
+						<a-button
+							@click="
+								() => {
+									popoverVisibles[record.courseId] = false
+								}
+							"
+							>取消</a-button
+						>
 					</template>
 					<!--					<a-button size="small" style="margin-right: 5px">选择</a-button>-->
-					<a-button v-if="record.putawayStatus == 0" size="small"  style="margin-right: 5px">上架</a-button>
+					<a-button v-if="record.putawayStatus == 0" size="small" style="margin-right: 5px">上架</a-button>
 				</a-popover>
 
-
 				<a-button size="small" @click="handleDelete(record)" style="margin-right: 5px">删除</a-button>
 			</template>
 		</template>
@@ -50,190 +62,194 @@
 </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/courseinfo'
-import {useRouter} from 'vue-router'
-import collegeApi from '@/api/college'
-import {updateCourseStatus} from '@/api/course/courseDetail'
+	import tool from '@/utils/tool'
+	import { ref, onMounted } from 'vue'
+	import { EyeOutlined, EditOutlined, SnippetsOutlined, DeleteOutlined } from '@ant-design/icons-vue'
+	import { list, copy } from '@/api/courseinfo'
+	import { useRouter } from 'vue-router'
+	import collegeApi from '@/api/college'
+	import { updateCourseStatus } from '@/api/course/courseDetail'
+
+	const router = useRouter()
+
+	const emit = defineEmits(['handleEdit', 'handleDetail'])
+	//发布按钮状态
+	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: 'courseName',
+			sorter: true,
+			width: '15%'
+		},
+		{
+			title: '状态',
+			dataIndex: 'putawayStatusName',
+			sorter: true,
+			width: '10%'
+		},
+		{
+			title: '院系',
+			dataIndex: 'collegeTwoIdName',
+			sorter: true,
+			width: '15%'
+		},
+		{
+			title: '课程类型',
+			dataIndex: 'courseTypeName',
+			sorter: true,
+			width: '8%'
+		},
+		{
+			title: '课时数量',
+			dataIndex: 'hourCount',
+			sorter: true,
+			width: '7%'
+		},
+		{
+			title: '发布时间',
+			dataIndex: 'publishTime',
+			sorter: true,
+			width: '12%'
+		},
+		{
+			title: '操作',
+			dataIndex: 'action',
+			sorter: true,
+			width: '20%'
+		}
+	]
+	// tool.formatTimestamp()
 
-const router = useRouter()
+	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
 
-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: 'courseName',
-		sorter: true,
-		width: '15%'
-	},
-	{
-		title: '状态',
-		dataIndex: 'putawayStatusName',
-		sorter: true,
-		width: '10%'
-	},
-	{
-		title: '院系',
-		dataIndex: 'collegeTwoIdName',
-		sorter: true,
-		width: '25%'
-	},
-	{
-		title: '课程类型',
-		dataIndex: 'courseTypeName',
-		sorter: true,
-		width: '8%'
-	},
-	{
-		title: '课时数量',
-		dataIndex: 'hourCount',
-		sorter: true,
-		width: '7%'
-	},
-	{
-		title: '发布时间',
-		dataIndex: 'publishTime',
-		sorter: true,
-		width: '12%'
-	},
-	{
-		title: '操作',
-		dataIndex: 'action',
-		sorter: true,
-		width: '20%'
+		getList()
+	}
+	const handleDetail = (record) => {
+		console.log('查看详情', record)
+		// router.push({
+		// 	path: '/portal/courseDetails',
+		// 	query: {
+		// 		id: record.courseId
+		// 	}
+		// })
+		emit('handleDetail', record)
 	}
-]
-// 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
+	// 编辑按钮点击事件
+	const handleEdit = (record) => {
+		console.log('编辑记录', record)
+		// 在这里添加编辑记录的逻辑
 
-	getList()
-}
-const handleDetail = (record) => {
-	console.log('查看详情', record)
-	router.push({
-		path: '/portal/courseDetails',
-		query: {
-			id: record.courseId
-		}
-	})
-	// 在这里添加查看详情的逻辑
-}
+		emit('handleEdit', record)
+	}
+	const handleCopy = (record) => {
+		console.log('拷贝记录', record)
+		// 在这里添加编辑记录的逻辑
+		copy({ courseId: record.courseId }).then((res) => {
+			if (res.code == 200) {
+				getList()
+			}
+		})
+		// getList()
+	}
 
-// 编辑按钮点击事件
-const handleEdit = (record) => {
-	console.log('编辑记录', record)
-	// 在这里添加编辑记录的逻辑
+	// 上架按钮点击事件
+	const handleShelf = (record, num) => {
+		console.log('上架记录', record)
+		popoverVisible.value[record.courseId] = false
+		popoverVisibles.value[record.courseId] = false
+		// 在这里添加上架记录的逻辑
+		// {
+		// 	"courseId": "1948183431150227458",
+		// 	"putawayStatus": 1
+		// }
+		updateCourseStatus({ courseId: record.courseId, putawayStatus: num }).then((res) => {
+			getList()
+		})
+	}
 
-	emit('handleEdit', record)
-}
+	// 删除按钮点击事件
+	const handleDelete = (record) => {
+		console.log('删除记录', record)
+		// 在这里添加删除记录的逻辑
+	}
+	const getList = () => {
+		list({ ...pagination.value }).then((data) => {
+			if (data.code == 200) {
+				dataSources.value = []
+				dataSources.value = data.data.records
+				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
+		})
+	}
 
-// 上架按钮点击事件
-const handleShelf = (record,num) => {
-	console.log('上架记录', record)
-	popoverVisible.value[record.courseId] = false
-	popoverVisibles.value[record.courseId] = false
-	// 在这里添加上架记录的逻辑
-	// {
-	// 	"courseId": "1948183431150227458",
-	// 	"putawayStatus": 1
-	// }
-	updateCourseStatus({courseId : record.courseId,putawayStatus : num}).then((res)=>{
+	// 重置按钮点击事件
+	onMounted(() => {
+		// getListData()
 		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
+	// watch(
+	// 	() => dataSources.value,
+	// 	(newVal, oldVal) => {
+	// 		console.log('数据源变化了 ', ' 新的 ',newVal, '  旧的 ',oldVal)
+	// 	},
+	// 	{ deep: true, immediate: true }
+	// )
+	defineExpose({
+		setList
 	})
-}
-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
-})
 </script>
 
 <style scoped>
-.desc p {
-	margin-bottom: 1em;
-}
+	.desc p {
+		margin-bottom: 1em;
+	}
 </style>

+ 0 - 1
src/views/courseManagement/components/QueryView.vue

@@ -110,7 +110,6 @@
 		resourceAuditApi
 			.orgList()
 			.then((res) => {
-				console.log(res.data, '获取学院')
 				collegeMajorOptions.value = res.data
 			})
 			.catch((err) => {

+ 59 - 43
src/views/courseManagement/index.vue

@@ -1,69 +1,78 @@
 <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 />
+	<div class="courseManagement">
+		<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"
+			@handleDetail="handleDetail"
+		></ListView>
 		<DialogView ref="dialogViewRef"></DialogView>
+		<a-modal v-model:visible="courseModalVisible" :title="courseModalTitle" width="70%" :footer="null">
+			<CourseAdd :courseInfoId="courseInfoId"></CourseAdd>
+		</a-modal>
+		<a-modal v-model:visible="courseDetailModalVisible" title="详情" width="70%">
+			<CourseDetail :courseId="courseInfoId"></CourseDetail>
+		</a-modal>
 	</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
+	import CourseAdd from '@/views/courseAdd/index.vue'
+	import CourseDetail from '@/views/courseDetails/index.vue'
+	import EventBus from '@/utils/EventBus'
 	const listViewRef = ref(null)
 	const dialogViewRef = ref(null)
+	const courseModalVisible = ref(false)
+	const courseModalTitle = ref('')
+	const courseInfoId = ref('')
+	const courseDetailModalVisible = ref(false)
 
 	// 搜索值
 	const searchValue = ref('')
 	const open = ref(false)
 
 	const handleNewCourse = () => {
-		console.log('新建课程111')
 		// 在这里添加新建课程的逻辑
 		// dialogViewRef.value.open()
 
-		router.push({
-			path: '/portal/courseAdd'
-		})
+		// router.push({
+		// 	path: '/portal/courseAdd'
+		// })
+		courseModalVisible.value = true
+		courseModalTitle.value = '新建课程'
 	}
 	const handlerSearch = (data) => {
-		console.log('新建课程')
 		// 在这里添加新建课程的逻辑
 		listViewRef.value.setList(data)
 	}
 	const handleEdit = (item) => {
-		router.push({
-			path: '/portal/courseAdd',
-			query: {
-				id: item.courseId
-			}
-		})
+		// router.push({
+		// 	path: '/portal/courseAdd',
+		// 	query: {
+		// 		id: item.courseId
+		// 	}
+		// })
+		courseModalVisible.value = true
+		courseModalTitle.value = '编辑课程'
+		courseInfoId.value = item.courseId
+	}
+	const handleDetail = (item) => {
+		courseDetailModalVisible.value = true
+		courseInfoId.value = item.courseId
 	}
 
 	const pagination = reactive({
@@ -72,22 +81,29 @@
 		total: 0
 	})
 	const onChangeCurrent = (current) => {
-		router.push({
-			path: '/' + current
-		})
+		// router.push({
+		// 	path: '/' + current
+		// })
 	}
 	const publishedData = ref()
 	//发布确定
 
 	// 上传资源模态框
 	const uploadModalVisible = ref(false)
-
+	EventBus.on('handleEdit', (data) => {
+		handleEdit(data)
+	})
 	onMounted(() => {
 		// getListData()
 	})
 </script>
 
-<style scoped>
+<style lang="less" scoped>
+	.courseManagement {
+		background: #fff;
+		padding: 24px;
+		border-radius: 8px;
+	}
 	.desc p {
 		margin-bottom: 1em;
 	}