Kaynağa Gözat

我的收藏

东方国信-蔡芳 8 ay önce
ebeveyn
işleme
461a398e1f

+ 10 - 0
src/api/college/index.js

@@ -0,0 +1,10 @@
+import { baseRequest } from '@/utils/request'
+
+const request = (url, ...arg) => baseRequest(`/api/webapp/disk/college/` + url, ...arg)
+
+export default {
+	// 获取major分页
+	tree(data) {
+		return request('tree', data, 'get')
+	}
+}

+ 35 - 8
src/views/resourceCenter/components/ComplexChoices.vue

@@ -11,8 +11,8 @@
 					<MyRadioButtonOffOut
 						v-for="(item, index) in selectedDepts"
 						:key="index"
-						:value="item"
-						:label="item"
+						:value="index"
+						:label="item.name"
 						:index="index"
 					></MyRadioButtonOffOut>
 				</MyRadioButtonGroup>
@@ -21,8 +21,8 @@
 					<MyRadioButton
 						v-for="(item, index) in selectedDeptBigs"
 						:key="index"
-						:value="item"
-						:label="item"
+						:value="index"
+						:label="item.name"
 						:index="index"
 					></MyRadioButton>
 				</MyRadioButtonGroup>
@@ -31,8 +31,8 @@
 					<MyRadioButton
 						v-for="(item, index) in selectedDeptSmails"
 						:key="index"
-						:value="item"
-						:label="item"
+						:value="index"
+						:label="item.name"
 						:index="index"
 					></MyRadioButton>
 				</MyRadioButtonGroup>
@@ -125,7 +125,8 @@
 	import MyRadioButtonGroup from '../components/MyRadioButtonGroup.vue'
 	import MyRadioButton from '../components/MyRadioButton.vue'
 	import MyRadioButtonOffOut from '../components/MyRadioButtonOffOut.vue'
-
+	import collegeApi from '@/api/college'
+	import orgApi from '@/api/resourceType/resourceType'
 	const selectedDept = ref('')
 	const selectedDeptBig = ref('')
 	const selectedDeptSmail = ref('')
@@ -155,6 +156,15 @@
 		'服务保障中心',
 		'教学评价办公室'
 	])
+
+	const selectedDeptBigsList= ref([
+
+	])
+
+	const selectedDeptSmailsList= ref([
+
+	])
+
 	const selectedDeptSmails = ref([
 		'三级架构a',
 		'三级架构b',
@@ -190,11 +200,14 @@
 	const selectedFormats = ref(['全部', 'ppt', 'word', 'excel', 'pdf', 'mp4', 'zip', 'rar'])
 
 	const handleSelectedDept = (e) => {
+		selectedDeptBigs.value=selectedDeptBigsList.value[e]
 		Big.value.setClean(selectedDeptBigs.value[0])
 		Smail.value.setClean(selectedDeptSmails.value[0])
+
 		updateSelectedTags()
 	}
 	const handleSelectedCourses = (e) => {
+		selectedDeptSmails.value=selectedDeptSmailsList.value[e]
 		updateSelectedTags()
 	}
 	// 处理课程类型选择变化
@@ -252,18 +265,32 @@
 		updateSelectedTags()
 	}
 	const handleClean = () => {
+
 		selectedTags.value = []
 		selectedDept.value = '不限'
 		selectedCourse.value = '全部'
 		selectedType.value = '全部'
 		selectedFormat.value = '全部'
-
+		selectedDeptBigs.value=[]
 		Dept.value.setClean('不限')
 		Big.value.setClean(selectedDeptBigs.value[0])
 		Smail.value.setClean(selectedDeptSmails.value[0])
 		Course.value.setClean('全部')
 		Type.value.setClean('全部')
 		Format.value.setClean('全部')
+
+		collegeApi.tree().then((data) => {
+			selectedDepts.value=data;
+			selectedDepts.value.forEach((item)=>{
+				selectedDeptBigsList.value.push(item.children);
+				item.children.forEach((item)=>{
+					selectedDeptSmailsList.value.push(item.children);
+				})
+			})
+			handleSelectedDept(0);
+		})
+
+
 		updateSelectedTags()
 	}