Procházet zdrojové kódy

准备 统计分析

于添 před 6 měsíci
rodič
revize
c0be91fbd7

+ 3 - 3
.env.development

@@ -7,9 +7,9 @@ VITE_TITLE = 飞行学院
 # 接口地址
 #VITE_API_BASEURL = http://192.168.31.56:19003
 #VITE_API_BASEURL = http://192.168.31.80:19003
-#VITE_API_BASEURL = http://192.168.1.235:9003
-VITE_API_BASEURL = http://192.168.1.245:9003
-VITE_FILEURL = http://192.168.1.245:10005/education/
+VITE_API_BASEURL = http://192.168.1.213:9003
+#VITE_API_BASEURL = http://192.168.1.245:9003
+VITE_FILEURL = http://192.168.1.213:10005/education/
 #VITE_FILEURL = http://192.168.31.14:10005/education/
 
 # 本地端口

+ 7 - 7
src/api/statisticalAnalysis/statisticalAnalysisResourceLibrary.js

@@ -234,14 +234,14 @@ const generateMockData = (filters = {}) => {
 
 // API函数 - 每次调用都生成新的动态数据,传入筛选参数
 export const getSummaryData = (params = {}) => {
-	return new Promise((resolve) => {
-		setTimeout(() => {
-			const mockData = generateMockData(params)
-			resolve(mockData.summaryData)
-		}, Mock.mock('@integer(200, 500)')) // 随机延迟
-	})
+	// return new Promise((resolve) => {
+	// 	setTimeout(() => {
+	// 		const mockData = generateMockData(params)
+	// 		resolve(mockData.summaryData)
+	// 	}, Mock.mock('@integer(200, 500)')) // 随机延迟
+	// })
 	// 真实接口调用:
-	// return request('/resource-library/summary', params, 'get')
+	return request('resourceStatistic/totalStatistic', params, 'get')
 }
 
 export const getResourceTypeData = (params = {}) => {

+ 29 - 15
src/components/UpLoadBreakPoint/index.vue

@@ -1,20 +1,23 @@
 <template>
 	<div>
-		<a-upload-dragger
-			:file-list="fileList"
-			:before-upload="beforeUpload"
-			@change="handleChange"
-			:show-upload-list="false"
-			:customRequest="customRequest"
-			:multiple="false"
-			:drag="true"
-			:progress="progress"
-		>
-			<div style="padding: 40px; text-align: center">
-				<span class="text"> 点击上传或将文件拖拽至此区域上传 </span>
-				<p class="text">按住Ctrl可同时多选,支持上传PPT/excel/pdf/mp4/zip/rar,等单个文件不能超过2G</p>
-			</div>
-		</a-upload-dragger>
+		<a-spin :spinning="spinning" tip="读取中...">
+			<a-upload-dragger
+				:file-list="fileList"
+				:before-upload="beforeUpload"
+				@change="handleChange"
+				:show-upload-list="false"
+				:customRequest="customRequest"
+				:multiple="false"
+				:drag="true"
+				:progress="progress"
+			>
+				<div style="padding: 40px; text-align: center">
+					<span class="text"> 点击上传或将文件拖拽至此区域上传 </span>
+					<p class="text">按住Ctrl可同时多选,支持上传PPT/excel/pdf/mp4/zip/rar,等单个文件不能超过2G</p>
+				</div>
+			</a-upload-dragger>
+	</a-spin>
+
 
 		<!-- <div style="margin-bottom: 20px">
 			<a-button v-if="uploadFileList.length > 0" type="primary" @click="uploadFilesList">上传</a-button>
@@ -31,6 +34,11 @@
 					</div>
 					<div>
 						<div>
+							<span
+								v-if="item.percents == 0"
+								style="color: red; cursor: pointer; margin-left: 10px"
+							>读取中</span
+							>
 							<span
 								v-if="item.percents == 0 || item.percents == 100"
 								style="color: red; cursor: pointer; margin-left: 10px"
@@ -91,6 +99,7 @@
 	const uploadingTasks = ref({}) // 正在上传的任务 { md5: true }
 	//当前选中的文件
 	const currentFile = ref(null)
+	const spinning = ref(false)
 	const chunkSize = ref(5 * 1024 * 1024)
 
 	const uploadedSize = ref(0) // 已上传文件大小(字节)
@@ -639,8 +648,10 @@
 	}
 	const beforeUpload = async (file) => {
 		console.log('选择了文件', file)
+		spinning.value = true
 		if(uploadFileList.value.length >= props.uploadCount){
 			message.error('超过上传条目' + props.uploadCount + "条")
+			spinning.value = false
 			return false
 		}
 		let upFile = await handleFileChange({ raw: file })
@@ -649,8 +660,10 @@
 		const exists = uploadFileList.value.some((item) => item.md5 === upFile.md5)
 		if (exists) {
 			message.warning('该文件已存在,不再重复添加')
+			spinning.value = false
 			return false
 		}
+		spinning.value = false
 		await checkMd5List(upFile)
 		uploadFileList.value.push(upFile)
 		emit('onSuccess', uploadFileList.value)
@@ -664,6 +677,7 @@
 			message.warning('上传队列已满,将进入暂停状态')
 		}
 		await uploadSingleFile(upFile)
+		spinning.value = false
 		return false // 阻止默认上传
 	}
 	const handleChange = (info) => {

+ 1 - 0
src/views/resourceCenter/components/Correlation.vue

@@ -68,6 +68,7 @@ import EventBus from '@/utils/EventBus'
 
 const currentPage = reactive({
 	funcType: 2,
+	sortflag:1,
 	current: 1,
 	size: 6
 })

+ 4 - 0
src/views/resourceCenter/components/ResourceList.vue

@@ -98,8 +98,11 @@
 			<a-pagination
 				v-model:current="currentPage.current"
 				v-model:pageSize="currentPage.size"
+				:page-size-options="pageSizeOptions"
 				:total="total"
 				@change="onChange"
+				:show-size-changer="true"
+				:show-quick-jumper="true"
 			/>
 		</div>
 		<div style="height: 20px"></div>
@@ -119,6 +122,7 @@ const queryData = ref({})
 const total = ref(0)
 const loading = ref(false)
 const tabKey = ref(0)
+const pageSizeOptions = ref(['12', '24', '36', '48', '60']);
 const tabKeyName = ref('')
 const dateName = ref([])
 const currentPage = reactive({

+ 1 - 0
src/views/resourceCenter/components/SidebarRecommend.vue

@@ -68,6 +68,7 @@ import EventBus from '@/utils/EventBus'
 
 const currentPage = reactive({
 	funcType: 1,
+	sortflag:1,
 	current: 1,
 	size: 6
 })

+ 1 - 1
vite.config.js

@@ -41,7 +41,7 @@ export default defineConfig(({command, mode}) => {
 			port: envConfig.VITE_PORT,
 			proxy: {
 				'/api': {
-					target: 'http://192.168.1.245:19003',
+					target: 'http://192.168.1.213:19003',
 					// target: 'http://192.168.1.235:9003',
 					// target: 'http://192.168.31.15:9003',
 					// target: 'http://192.168.31.15:9003',