于添 5 mesi fa
parent
commit
2dce184524

+ 54 - 17
src/api/statisticalAnalysis/analysisLearningBehaviors.js

@@ -3,7 +3,7 @@ import { moduleRequest } from '@/utils/request'
 import Mock from 'mockjs'
 
 const request = moduleRequest(`/api/webapp/`)
-
+import ForEach from "lodash-es/forEach";
 // Mock 数据配置
 Mock.setup({
 	timeout: '200-600'
@@ -229,18 +229,18 @@ const studentsData = [
 ]
 
 // Mock 接口定义
-Mock.mock(/\/api\/webapp\/analysis\/colleges/, 'get', {
-	code: 200,
-	message: '获取成功',
-	data: [
-		{ id: '', name: '全部学院' },
-		{ id: 'computer', name: '计算机学院' },
-		{ id: 'business', name: '商学院' },
-		{ id: 'art', name: '艺术学院' },
-		{ id: 'science', name: '理学院' },
-		{ id: 'engineering', name: '工程学院' }
-	]
-})
+// Mock.mock(/\/api\/webapp\/analysis\/colleges/, 'get', {
+// 	code: 200,
+// 	message: '获取成功',
+// 	data: [
+// 		{ id: '', name: '全部学院' },
+// 		{ id: 'computer', name: '计算机学院' },
+// 		{ id: 'business', name: '商学院' },
+// 		{ id: 'art', name: '艺术学院' },
+// 		{ id: 'science', name: '理学院' },
+// 		{ id: 'engineering', name: '工程学院' }
+// 	]
+// })
 
 Mock.mock(/\/api\/webapp\/analysis\/college-stats/, 'get', (options) => {
 	const params = new URLSearchParams(options.url.split('?')[1])
@@ -482,12 +482,47 @@ Mock.mock(/\/api\/webapp\/analysis\/search-students/, 'get', (options) => {
 })
 
 // API 函数导出
-export const getCollegeList = () => {
-	return request('analysis/colleges', '', 'get')
+export const getCollegeList = async (params) => {
+	let res = await request('disk/studyBehavior/collegeCourseDetailProgress', params, 'get')
+	console.log('什么呢1233', res)
+	let list = []
+	ForEach(res.records,(item) => {
+		list.push({id : item.collegeId , name : item.collegeIdName})
+	})
+
+
+	let json = {
+		code: 200,
+		data: list
+	}
+	// {
+	// 	"RESOURCE_TOTAL": 34,  总资源数
+	// 	"TOTAL_STORAGE_SIZE": 20480, 总存储空间
+	// 	"COLLECT_TOTAL": 9, 总收藏数
+	// 	"WATCH_TOTAL": 471, 总观看数
+	// 	"storageSize": 1726487824,
+	// 	"totalStorageSize": 21474836480
+	// }
+	// totalResources: '0',
+	// totalStorage: '0 TB',
+	// totalCapacity: '10 TB',
+	// usageRate: '0%',
+	// totalViews: '0',
+	// totalFavorites: '0'
+	// 真实接口调用:
+	// return request('/resource-library/summary', params, 'get')
+	console.log('什么呢', json)
+	return list
+	// return request('analysis/colleges', '', 'get')
 }
 
-export const getCollegeStats = (params) => {
-	return request('analysis/college-stats', params, 'get')
+export const getCollegeStats = async (params) => {
+	let res = await request('disk/studyBehavior/courseVisitProgress', params, 'get')
+	console.log('courseVisitProgress', res)
+	let json = {
+		code: 200,
+	}
+	return json
 }
 
 export const getLoginTimeDistribution = (params) => {
@@ -503,5 +538,7 @@ export const getCollegeCourseDetails = (params) => {
 }
 
 export const searchStudents = (params) => {
+
+
 	return request('analysis/search-students', params, 'get')
 }

+ 3 - 3
src/views/statisticalAnalysis/analysisLearningBehaviors/index.vue

@@ -418,7 +418,7 @@
 	// 更新学院数据
 	const updateCollegeData = async () => {
 		try {
-			// 获取学院统计数据
+			// 获取学院统计数据 船锚
 			const statsResponse = await getCollegeStats({
 				collegeId: collegeFilters.collegeId,
 				timeRange: collegeFilters.timeRange
@@ -698,9 +698,9 @@
 			// 获取学院列表
 			const colleges = await getCollegeList()
 			collegeList.value = colleges
-
+			collegeFilters.collegeId = colleges.length > 0 ? colleges[0].id : undefined
 			// 获取初始学员数据
-			await searchStudent()
+			// await searchStudent()
 
 			// 获取学院数据
 			await updateCollegeData()