王辉 1 月之前
父節點
當前提交
f9d4fd96d9
共有 4 個文件被更改,包括 51 次插入35 次删除
  1. 4 3
      .env.development
  2. 7 30
      src/views/classManagement/components/DialogView.vue
  3. 40 2
      src/views/courseAdd/components/courseInfo.vue
  4. 0 0
      stats.html

+ 4 - 3
.env.development

@@ -5,14 +5,15 @@ NODE_ENV = development
 VITE_TITLE = 飞行学院
 
 # 接口地址
-VITE_API_BASEURL = http://192.168.207.179:9003
+VITE_API_BASEURL = http://127.0.0.1:9003
+#VITE_API_BASEURL = http://192.168.1.245:9003
 # VITE_API_BASEURL = http://192.168.31.81:19003
-VITE_FILEURL = http://192.168.207.179:10005/education/
+VITE_FILEURL = http://192.168.1.245:10005/education/
 # VITE_API_BASEURL = http://192.168.31.14:9003
 # VITE_API_BASEURL = http://192.168.31.6:9003
 
 # 本地端口
-VITE_PORT = 9000
+VITE_PORT = 9001
 
 # 开启设置抽屉
 VITE_SET_DRAWER = true

+ 7 - 30
src/views/classManagement/components/DialogView.vue

@@ -20,14 +20,6 @@
 						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
@@ -151,31 +143,16 @@ const edit = (item) => {
 				console.log(err)
 			})
 	}
-const changeCollegeMajor = (value, selectedOptions) => {
-	console.log('Selected:', value, selectedOptions)
+const changeCollegeMajor = (value) => {
+	console.log('Selected college ID:', value)
+	// 清空之前选择的专业
 	formState.majorId = undefined
-	if (!value) {
+	majorOptions.value = []
 
-		formState.collegeId = undefined
-		// majorIdName.value = ''
-		return false
+	if (value) {
+		// 调用接口查询该单位下的专业
+		getCollegeMajor(value)
 	}
-	// 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

+ 40 - 2
src/views/courseAdd/components/courseInfo.vue

@@ -14,9 +14,24 @@
 			<a-select
 				v-model:value="formState.teacherId"
 				:fieldNames="{ label: 'name', value: 'id' }"
-				:options="teacherOptions"
+				:options="filteredTeacherOptions"
 				placeholder="请选择授课教师"
-			/>
+				show-search
+				:filter-option="false"
+				@search="handleTeacherSearch"
+				:loading="teacherLoading"
+				allow-clear
+				style="width: 100%"
+			>
+				<template #suffixIcon>
+					<SearchOutlined v-if="!teacherLoading" />
+					<LoadingOutlined v-else />
+				</template>
+				<template #notFoundContent>
+					<div v-if="teacherLoading">搜索中...</div>
+					<div v-else>暂无数据</div>
+				</template>
+			</a-select>
 		</a-form-item>
 
 		<a-form-item label="课程分类" name="courseType">
@@ -198,6 +213,7 @@
 	}
 	//获取教师人员
 	const getlecturerListSelector = () => {
+		teacherLoading.value = true
 		courseCenterApi
 			.lecturerList({eduIdentity : 1})
 			.then((res) => {
@@ -207,6 +223,28 @@
 			.catch((err) => {
 				console.log(err)
 			})
+			.finally(() => {
+				teacherLoading.value = false
+			})
+	}
+	const teacherLoading = ref(false)
+	const teacherSearchKeyword = ref('')
+
+	// 计算过滤后的教师选项
+	const filteredTeacherOptions = computed(() => {
+		if (!teacherSearchKeyword.value) {
+			return teacherOptions.value
+		}
+		const keyword = teacherSearchKeyword.value.toLowerCase()
+		return teacherOptions.value.filter(teacher =>
+			teacher.name && teacher.name.toLowerCase().includes(keyword)
+		)
+	})
+
+	// 教师搜索处理
+	const handleTeacherSearch = (value) => {
+		teacherSearchKeyword.value = value
+		console.log('搜索教师:', value)
 	}
 	//院系组织查询
 	const getOrgTreeSelector = () => {

文件差異過大導致無法顯示
+ 0 - 0
stats.html


部分文件因文件數量過多而無法顯示