diff --git a/src/assets/img/zheke/center_top0.png b/src/assets/img/zheke/center_top0.png new file mode 100644 index 0000000..9ba3744 Binary files /dev/null and b/src/assets/img/zheke/center_top0.png differ diff --git a/src/components/chart/chart.vue b/src/components/chart/chart.vue index 528371f..d14da2a 100644 --- a/src/components/chart/chart.vue +++ b/src/components/chart/chart.vue @@ -29,13 +29,20 @@ const resize = () => { const init = (max: any, value: any) => { chartMax.value = max ? max : 0; chartValues.value = value ? value : 0; + // chartMax.value = 50 + // chartValues.value = 5 chartRate.value = 0 + if (chartMax && chartValues) { chartRate.value = (chartValues.value / chartMax.value * 100).toFixed(1) } if (chartRate.value === "100.0") { chartRate.value = "100"; // 如果百分比等于100,则更新为整数形式 } + if (isNaN(chartRate.value)) { + chartRate.value = "0"; + } + console.log('打印', chartValues.value, chartMax.value); let option = { title: { @@ -111,18 +118,19 @@ const init = (max: any, value: any) => { }, { type: 'bar', - data: [{ name: "预报到填写总数", value: chartMax.value }], - startAngle: 0, + // data: [{ name: "预报到填写总数", value: chartMax.value }], + data: { name: "预报到填写总数", value: chartMax.value }, z: 1, + // silent: true, coordinateSystem: 'polar', barMaxWidth: 35, roundCap: 1, color: '#00214d', barGap: '-100%', }, - { + /* { type: 'bar', - data: [{ name: "预报到填写总数", value: chartMax.value }], + data: [1], z: 0, silent: true, coordinateSystem: 'polar', @@ -130,7 +138,7 @@ const init = (max: any, value: any) => { roundCap: true, color: '#00214d', barGap: '-100%', - }, + }, */ ], } myChart.value.setOption(option); diff --git a/src/components/chart/pieChart.vue b/src/components/chart/pieChart.vue index f4decde..1ea164c 100644 --- a/src/components/chart/pieChart.vue +++ b/src/components/chart/pieChart.vue @@ -102,7 +102,7 @@ const init=(max, value) =>{ } ]) }, - { + /* { type: 'bar', data: [{ name: "新生总人数", value: chartMax.value }], startAngle: 0, @@ -112,12 +112,12 @@ const init=(max, value) =>{ roundCap: 1, color: '#00214d', barGap: '-100%', - }, + }, */ { type: 'bar', data: [{ name: "新生总人数", value: chartMax.value }], z: 0, - silent: true, + // silent: true, coordinateSystem: 'polar', barMaxWidth: 35, roundCap: true, diff --git a/src/stores/data/data.ts b/src/stores/data/data.ts index ca9adf5..3003643 100644 --- a/src/stores/data/data.ts +++ b/src/stores/data/data.ts @@ -11,72 +11,104 @@ import { defineStore } from "pinia"; // import { storeToRefs } from 'pinia'; export const useDataStore = defineStore("data", () => { - const allData:Ref = ref({ + const allData: Ref = ref({ degreeDto: [], - forecast:{}, - forecastFill:{}, - nationStudent:[], - payDto:{}, - provinceDto:[], - rankingDto:[], - sexDto:{}, - today:{}, - totalDto:{} + forecast: {}, + forecastFill: {}, + nationStudent: [], + payDto: {}, + provinceDto: [], + rankingDto: [], + sexDto: {}, + today: {}, + totalDto: {}, }); - const degreeDto=computed(() => allData.value.degreeDto); - const forecast=computed(() => allData.value.forecast); - const forecastFill=computed(() => allData.value.forecastFill); - const nationStudent=computed(() => allData.value.nationStudent); - const payDto=computed(() => allData.value.payDto); - const provinceDto=computed(() => allData.value.provinceDto); - const rankingDto=computed(() => allData.value.rankingDto); - const sexDto=computed(()=> allData.value.sexDto); - const today=computed(() => allData.value.today); - const totalDto=computed(() => allData.value.totalDto); + const degreeDto = computed(() => allData.value.degreeDto); + const forecast = computed(() => allData.value.forecast); + const forecastFill = computed(() => allData.value.forecastFill); + const nationStudent = computed(() => allData.value.nationStudent); + const payDto = computed(() => allData.value.payDto); + const provinceDto = computed(() => allData.value.provinceDto); + const rankingDto = computed(() => allData.value.rankingDto); + const sexDto = computed(() => allData.value.sexDto); + const today = computed(() => allData.value.today); + const totalDto = computed(() => allData.value.totalDto); // 当日预报到报到率 const forecastRate = computed(() => { - forecast.value.reported / forecast.value.total - }); + forecast.value.reported / forecast.value.total; + }); // 当日预报到总人数报到率 const totalRate = computed(() => { - totalDto.value.reportNumber / totalDto.value.totalNumber + totalDto.value.reportNumber / totalDto.value.totalNumber; }); // 选中的学院id - const collageId = ref() + const collageId = ref(); // 切换选中的学院 - const setCollageId = (data:any)=>{ - collageId.value = data - } + const setCollageId = (data: any) => { + collageId.value = data; + }; // 学院对应的专业报到人数 - const professionRank = ref() - const setProfessionRank = (data:any) => { + const professionRank = ref(); + const setProfessionRank = (data: any) => { professionRank.value = data; }; - const setData = (data:any) => { + const setData = (data: any) => { allData.value = data; }; // 本科缴费人数 - const bkPay= ref() - const setBkPay = (data:any) => { - console.log('data',data); - + const bkPay = ref(); + const setBkPay = (data: any) => { + console.log("data", data); + bkPay.value = data; }; // 专科缴费人数 - const zkPay= ref() - const setZkPay = (data:any) => { + const zkPay = ref(); + const setZkPay = (data: any) => { zkPay.value = data; }; // 专升本缴费人数 - const zsbPay= ref() - const setZsbPay = (data:any) => { + const zsbPay = ref(); + const setZsbPay = (data: any) => { zsbPay.value = data; }; + // 缴费总人数 + const totalPay = ref(); + const setTotalPay = (data: any) => { + totalPay.value = data; + }; - return { allData,degreeDto,forecast,forecastFill,nationStudent,payDto,provinceDto,rankingDto,sexDto,today,totalDto,setData,bkPay,zkPay,zsbPay,setBkPay,setZkPay,setZsbPay,setCollageId,collageId,professionRank,setProfessionRank,forecastRate,totalRate}; + return { + allData, + degreeDto, + forecast, + forecastFill, + nationStudent, + payDto, + provinceDto, + rankingDto, + sexDto, + today, + totalDto, + setData, + bkPay, + zkPay, + zsbPay, + setBkPay, + setZkPay, + setZsbPay, + setCollageId, + collageId, + professionRank, + setProfessionRank, + forecastRate, + totalRate, + totalPay, + setTotalPay + }; }); diff --git a/src/views/header.vue b/src/views/header.vue index 5bc22f7..0c0e063 100644 --- a/src/views/header.vue +++ b/src/views/header.vue @@ -1,19 +1,22 @@ @@ -21,7 +13,7 @@ const { today, forecastRate,totalRate } = storeToRefs(dataStore)
- +
{{ computDate }}迎新人数
@@ -29,23 +21,35 @@ const { today, forecastRate,totalRate } = storeToRefs(dataStore)
-
-
{{ computDate }}预报到人数
-
{{ today.forecastStuden ?? '0' }}
-
-
-
{{ computDate }}预报到报到率
-
{{ forecastRate ?? '0' }}%
+
+
+ +
+
+
{{ computDate }}预报到人数
+
{{ today.forecastStuden ?? '0' }}
+
-
预报到总人数报到率
-
{{totalRate ?? '0'}}%
+
{{ computDate }}预报到报到率
+
{{ forecastRate ?? '0' }}%
+ + +
diff --git a/src/views/index/index.vue b/src/views/index/index.vue index 5a89c0c..ee6e0c0 100644 --- a/src/views/index/index.vue +++ b/src/views/index/index.vue @@ -120,7 +120,7 @@ const getAdminPCIndex = () => { }; // 缴费人数-- 本科 专科 专升本 -const payData = () => { +/* const payData = () => { let params: any = [{ "EducationalLevel": 3, "Year": years.value, @@ -155,6 +155,31 @@ const payData = () => { } }); +} */ +/* + 缴费人数---根据批次去区分 +*/ +const payData = () => { + let params: any = { + "EducationalLevel": 3, + "Year": years.value, + "Month": months.value || void 0, + "Day": days.value || void 0, + } + WeekPay(params).then((res: any) => { + const bk = res.data.todayPayDto.batchTodayPays?.find((item: any) => item.name === "统招本科"); + const zk = res.data.todayPayDto.batchTodayPays?.find((item: any) => item.name === "统招专科"); + const zsb = res.data.todayPayDto.batchTodayPays?.find((item: any) => item.name === "统招专升本"); + dataStore.setBkPay(bk) + dataStore.setZkPay(zk) + dataStore.setZsbPay(zsb) + dataStore.setTotalPay(res.data.todayPayDto.batchTodayPays?.payNum) + setTimeout(() => { + if (rightCenterRef) { + rightCenterRef.value.getData() + } + }); + }) } const timer: any = ref(null) const startTimer = () => { diff --git a/src/views/index/right-center.vue b/src/views/index/right-center.vue index 5210cc3..3fcf995 100644 --- a/src/views/index/right-center.vue +++ b/src/views/index/right-center.vue @@ -6,7 +6,7 @@ const timeStore = useTimeStore() const { nowTitle } = storeToRefs(timeStore) const dataStore = useDataStore() -const { bkPay, zkPay, zsbPay } = storeToRefs(dataStore) +const { bkPay, zkPay, zsbPay,totalPay } = storeToRefs(dataStore) const activeTab = ref(0); const tabs = ref([ { title: '本科', value: 0, dateList: ['05-30', '05-31', '06-01', '06-02', '06-03', "06-04"], numList: [0, 0, 0, 0, 0, 0] }, @@ -183,13 +183,18 @@ defineExpose({getData})

{{ nowTitle }}缴费总人数

-

{{ bkPay?.todayPayDto?.payNum }}

+ +

{{ totalPay??'0' }}

{{ tab.title }}

-

{{ bkPay?.todayPayDto?.bkPayNum }}

+ +

{{ bkPay?.num }}

+

{{ zkPay?.num }}

+

{{ zsbPay?.num }}

+