diff --git a/src/api/api.ts b/src/api/api.ts index 925ab2a..8d62f92 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -1,6 +1,6 @@ /* - * @LastEditors: 张宁 - * @LastEditTime: 2024-05-23 10:32:10 + * @LastEditors: 张宁 18339727226@163.com + * @LastEditTime: 2024-05-30 09:15:55 */ import axios from "axios"; import type { AxiosRequestConfig, AxiosResponse } from "axios"; @@ -18,7 +18,7 @@ axios.interceptors.request.use( function (config: AxiosRequestConfig): any { // 在发送请求之前做些什么 传token // let token: any = getLocalStorage(StorageEnum.GB_TOKEN_STORE); - let token: any = getToken() || 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjA4ZGI3NTE5LTMxOGUtNDE0My04MDhjLWVmYTI3YmZkZWUyOCIsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vd3MvMjAwOC8wNi9pZGVudGl0eS9jbGFpbXMvcm9sZSI6IlRlYWNoZXIiLCJ1c2VyaW5mbyI6IntcIklkXCI6XCIwOGRiNzUxOS0zMThlLTQxNDMtODA4Yy1lZmEyN2JmZGVlMjhcIixcIk5hbWVcIjpcImFkbWluXCIsXCJQd2RcIjpcIlwiLFwiUGhvbmVOdW1iZXJcIjpcIjE1OTcyMTc4NDQ1XCIsXCJQZXJzb25uZWxUeXBlXCI6MSxcIlVzZXJUeXBlXCI6MCxcIlJlcG9ydGluZ1Byb2Nlc3NcIjowLFwiSGVhZFNjdWxwdHVyZVVybFwiOm51bGwsXCJTZXhcIjowLFwiVGVhY2hlckNsYXNzSWRzXCI6bnVsbCxcIklzU3VydmV5XCI6ZmFsc2UsXCJTdHVkZW50SWRcIjpcIlwiLFwiV2VsY29tZVllYXJcIjowLFwiSURDYXJkXCI6bnVsbCxcIkV4YW1pbmVlTnVtYmVyXCI6bnVsbCxcIk5vdGlmaWNhdGlvbk51bWJlclwiOm51bGwsXCJFZHVjYXRpb25hbExldmVsXCI6MCxcIlBob3RvUmV2aW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XCI6MCxcIlBob3RvUmV2aWV3U3RhdGVcIjowLFwiQ29sbGVnZU5hbWVcIjpudWxsLFwiRW5kVGltZVwiOlwiMDAwMS0wMS0wMVQwMDowMDowMFwiLFwiQWxsRGF0YVBlcm1pc3Npb25cIjowLFwiUm9sZXNcIjpudWxsLFwiUmV2aWV3ZWRTdGF0ZVwiOm51bGx9IiwibmJmIjoxNzE3MDMwNTkyLCJleHAiOjE3MTcwMzQxOTIsImlzcyI6InprSXNzdWVyIUAjJCVeJioiLCJhdWQiOiJ6a0F1ZGllbmNlIUAjJCVeJioifQ.AyTB_XsJbLCh9u3vOgbQknWCr1suOJj62LtbcRZdAUI'; if (token) { // @ts-ignore // config.headers.common[RequestEnum.GB_TOKEN_KEY] = token; diff --git a/src/api/modules/test.ts b/src/api/modules/test.ts index 2f96fd3..a5c4507 100644 --- a/src/api/modules/test.ts +++ b/src/api/modules/test.ts @@ -1,4 +1,14 @@ -import {GET,POST,FILE,FILEPOST,PUT,GETNOBASE} from "../api"; -export const testGet=(param:any={})=>{ - return GET('/api/TeacherManagement/AdminPCIndex',param) -} \ No newline at end of file +import { GET, POST, FILE, FILEPOST, PUT, GETNOBASE } from "../api"; +export const AdminPCIndex = (param: any = {}) => { + return GET("/api/TeacherManagement/AdminPCIndex", param); +}; + +//主页 今日缴费情况 +export const WeekPay = (param: any = {}) => { + return GET("/api/TeacherManagement/WeekPay", param); +}; + +// 专业报道 +export const StatisticsReportedRanking = (param: any = {}) => { + return GET("/api/TeacherManagement/StatisticsReportedRanking", param); +}; diff --git a/src/components/chart/chart.vue b/src/components/chart/chart.vue new file mode 100644 index 0000000..abffdb4 --- /dev/null +++ b/src/components/chart/chart.vue @@ -0,0 +1,136 @@ + + + + + \ No newline at end of file diff --git a/src/components/chart/pieChart.vue b/src/components/chart/pieChart.vue new file mode 100644 index 0000000..f9b4746 --- /dev/null +++ b/src/components/chart/pieChart.vue @@ -0,0 +1,137 @@ + + + + + \ No newline at end of file diff --git a/src/components/datePicker/datePicker.vue b/src/components/datePicker/datePicker.vue index 07455cf..c65a1f7 100644 --- a/src/components/datePicker/datePicker.vue +++ b/src/components/datePicker/datePicker.vue @@ -2,7 +2,7 @@ * @Author: 张宁 18339727226@163.com * @Date: 2024-05-27 14:46:17 * @LastEditors: 张宁 18339727226@163.com - * @LastEditTime: 2024-05-29 15:37:58 + * @LastEditTime: 2024-05-29 16:31:43 * @FilePath: \welcome-system-screen\src\components\datePicker\datePicker.vue * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE --> @@ -19,16 +19,16 @@
- {{ tab.content?tab.content:'' }}{{ tab.title }} + {{ tab.content ? tab.content : '' }}{{ tab.title }}
确定
- +
- +
@@ -42,7 +42,7 @@ @@ -60,7 +96,7 @@ const getDate = (val:any)=>{
- 新生报道情况 + 新生报道情况
@@ -71,8 +107,10 @@ const getDate = (val:any)=>{
- +
+
选择日期:{{ dateTitle }}
+ @@ -15,13 +25,13 @@ import { ElMessage } from "element-plus";
{{ computDate }}迎新人数
-
{{ 12404 }}
+
{{ today.nowStuden??'-' }}
{{ computDate }}预报到人数
-
{{ 12404 }}
+
{{ today.forecastStuden??'-' }}
{{ computDate }}预报到报到率
diff --git a/src/views/index/index.vue b/src/views/index/index.vue index 4a8497f..80a7b99 100644 --- a/src/views/index/index.vue +++ b/src/views/index/index.vue @@ -13,11 +13,151 @@ import RightBottomTwo from "./right-bottom-two.vue"; import { useTimeStore } from "@/stores/index"; import { storeToRefs } from "pinia"; const timeStore = useTimeStore(); + +const { nowTitle, years, months, days } = storeToRefs(timeStore); + +import { AdminPCIndex, WeekPay, StatisticsReportedRanking } from "@/api"; +import { useDataStore } from "@/stores/index"; +const dataStore = useDataStore(); +const { allData, rankingDto, collageId, professionRank } = storeToRefs(dataStore) + +const rightCenterRef = ref(null) + +const mapRef = ref(null) +const tableData = ref() const showRight = ref(true) const changeRight = () => { showRight.value = !showRight.value + if (!showRight.value && rbtwoRef) { + setTimeout(()=>{ + rbtwoRef.value.getData(professionRank.value) + + }) + } }; -const { nowTitle } = storeToRefs(timeStore); +/** + * @description: 处理map中的数据 + * @param {*} data + * @return {*} + */ +const dealMapData = (data: any) => { + tableData.value = data.provinceDto?.map((item: any) => { + return { + name: item.provinceName, + zk: item.degreesDto[0].paymentCompleted + item.degreesDto[0].nonPayment, + // zsb:item.degreesDto[1].paymentCompleted+ '/'+(item.degreesDto[1].paymentCompleted+item.degreesDto[1].nonPayment), + bk: item.degreesDto[2].paymentCompleted + item.degreesDto[2].nonPayment, + zkrate: divideAndFormat(item.degreesDto[0].paymentCompleted, item.degreesDto[0].paymentCompleted + item.degreesDto[0].nonPayment), + bkrate: divideAndFormat(item.degreesDto[2].paymentCompleted, item.degreesDto[2].paymentCompleted + item.degreesDto[2].nonPayment), + zbdrate: divideAndFormat(item.degreesDto[0].paymentCompleted + item.degreesDto[2].paymentCompleted, item.degreesDto[0].paymentCompleted + item.degreesDto[0].nonPayment + item.degreesDto[2].paymentCompleted + item.degreesDto[2].nonPayment), + num1: item.degreesDto[0].paymentCompleted, + num2: item.degreesDto[1].paymentCompleted, + num3: item.degreesDto[2].paymentCompleted, + reported: item.degreesDto[0].paymentCompleted + item.degreesDto[2].paymentCompleted, + AdmissionNum: item.degreesDto[0].paymentCompleted + item.degreesDto[0].nonPayment + item.degreesDto[2].paymentCompleted + item.degreesDto[2].nonPayment + } + }) + tableData.value?.forEach((item: any, index: any) => { + item.sort = index + 1 + item.sort = item.sort < 10 ? "0" + item.sort : item.sort; + if (item.zbdrate == '0.0%') { + item.zbdrate = '0%' + } + }) + tableData.value.sort((a: any, b: any) => { + return a.zbdrate - b.zbdrate + }) +} + +const divideAndFormat = (divisor: any, dividend: any) => { + if (dividend === 0) { + return "0.0%"; + } + + let result = (divisor / dividend) * 100; + return result.toFixed(1) + "%"; +} +const rbtwoRef = ref(null) +const getProfession = () => { + let params = { + "id": collageId.value + } + StatisticsReportedRanking(params).then(res => { + dataStore.setProfessionRank(res.data) + setTimeout(() => { + if (!showRight.value && rbtwoRef) { + rbtwoRef.value.getData(professionRank.value) + } + }) + }) + +} +watch(collageId, () => { + getProfession() + +}) + +/** + * @description: 获取页面数据 + * @return {*} + */ +const getAdminPCIndex = () => { + AdminPCIndex().then((res: any) => { + dataStore.setData(res.data); + dataStore.setCollageId(res.data.rankingDto[0].collegeId) + dealMapData(res.data) + setTimeout(() => { + if (mapRef) { + mapRef.value.getMapChart(tableData.value) + } + }); + }) +}; + +// 缴费人数-- 本科 专科 专升本 +const payData = () => { + let params: any = [{ + "EducationalLevel": 3, + "Year": years.value, + "Month": months.value, + "Day": days.value + }, { + "EducationalLevel": 4, + "Year": years.value, + "Month": months.value, + "Day": days.value + }, { + "EducationalLevel": 6, + "Year": years.value, + "Month": months.value, + "Day": days.value + }] + for (let item of params) { + WeekPay(item).then((res: any) => { + switch (item.EducationalLevel) { + case 3: + dataStore.setBkPay(res.data); + case 4: + dataStore.setZkPay(res.data); + case 6: + dataStore.setZsbPay(res.data); + } + }) + } + setTimeout(() => { + if (rightCenterRef) { + rightCenterRef.value.getData() + } + }); + +} + + +onMounted(() => { + getAdminPCIndex(); + payData(); +}); +