diff --git a/src/api/modules/index.ts b/src/api/modules/index.ts index d4b30d6..502d2db 100644 --- a/src/api/modules/index.ts +++ b/src/api/modules/index.ts @@ -10,6 +10,12 @@ const indexUrl= { 'rightBottom':'/bigscreen/rightBottom',//右下 'rightCenter':'/bigscreen/ranking',// 报警排名 'consultationTrend':'/bigscreen/consultationTrend',// 咨询人数趋势图 + 'teacherConsultStats':'/bigscreen/teacherConsultStats',// 教师咨询数据统计 + 'studentDistribution':'/bigscreen/studentDistribution',// 学生用户属考生分布统计 + 'highSchoolRanking':'/bigscreen/highSchoolRanking',// 用户量属高中排行 + 'averageDuration':'/bigscreen/averageDuration',// 平均时长趋势 + 'majorRanking':'/bigscreen/majorRanking',// 用户量属专业排行 + 'commonQuestions':'/bigscreen/commonQuestions',// 常见咨询问题 } export default indexUrl @@ -54,6 +60,37 @@ export const rightBottom=(param:any={})=>{ return GET(indexUrl.rightBottom,param) } +/**咨询人数趋势图 */ export const consultationTrend=(param:any={})=>{ return GET(indexUrl.consultationTrend,param) +} + +/**教师咨询数据统计 */ +export const teacherConsultStats=(param:any={})=>{ + return GET(indexUrl.teacherConsultStats,param) +} + +/**学生用户属考生分布统计 */ +export const studentDistribution=(param:any={})=>{ + return GET(indexUrl.studentDistribution,param) +} + +/**用户量属高中排行 */ +export const highSchoolRanking=(param:any={})=>{ + return GET(indexUrl.highSchoolRanking,param) +} + +/**平均时长趋势 */ +export const averageDuration=(param:any={})=>{ + return GET(indexUrl.averageDuration,param) +} + +/**用户量属专业排行 */ +export const majorRanking=(param:any={})=>{ + return GET(indexUrl.majorRanking,param) +} + +/**常见咨询问题 */ +export const commonQuestions=(param:any={})=>{ + return GET(indexUrl.commonQuestions,param) } \ No newline at end of file diff --git a/src/assets/css/main.scss b/src/assets/css/main.scss index a2b6318..3b923a9 100644 --- a/src/assets/css/main.scss +++ b/src/assets/css/main.scss @@ -12,6 +12,14 @@ html,body{ src: url(../font/YouSheBiaoTiHei-2.ttf); } +@font-face { + font-family: 'DS-Digital'; + src: url('../font/DS-DIGI-1.ttf') format('truetype'); + font-weight: normal; + font-style: normal; + font-display: swap; +} + html .el-message { --yh-bg-color-container:#242424; --yh-shadow-3: 0 16px 24px rgba(0, 0, 0, .14), 0 6px 30px rgba(0, 0, 0, 12%), 0 8px 10px rgba(0, 0, 0, 20%); diff --git a/src/assets/font/DS-DIGI-1.ttf b/src/assets/font/DS-DIGI-1.ttf new file mode 100644 index 0000000..0925877 Binary files /dev/null and b/src/assets/font/DS-DIGI-1.ttf differ diff --git a/src/assets/img/zheke/留言数.png b/src/assets/img/zheke/ai-stats4.png similarity index 100% rename from src/assets/img/zheke/留言数.png rename to src/assets/img/zheke/ai-stats4.png diff --git a/src/components/item-wrap/item-wrap.vue b/src/components/item-wrap/item-wrap.vue index 50923c9..a625e67 100644 --- a/src/components/item-wrap/item-wrap.vue +++ b/src/components/item-wrap/item-wrap.vue @@ -12,15 +12,17 @@ const props = withDefaults( \ No newline at end of file diff --git a/src/views/index/CenterTop.vue b/src/views/index/CenterTop.vue new file mode 100644 index 0000000..59a28ec --- /dev/null +++ b/src/views/index/CenterTop.vue @@ -0,0 +1,100 @@ + + + + + \ No newline at end of file diff --git a/src/views/index/LeftBottom.vue b/src/views/index/LeftBottom.vue new file mode 100644 index 0000000..302bf0c --- /dev/null +++ b/src/views/index/LeftBottom.vue @@ -0,0 +1,155 @@ + + + + + \ No newline at end of file diff --git a/src/views/index/LeftCenter.vue b/src/views/index/LeftCenter.vue new file mode 100644 index 0000000..dfee453 --- /dev/null +++ b/src/views/index/LeftCenter.vue @@ -0,0 +1,237 @@ + + + + + \ No newline at end of file diff --git a/src/views/index/LeftTop.vue b/src/views/index/LeftTop.vue new file mode 100644 index 0000000..8cb1cdd --- /dev/null +++ b/src/views/index/LeftTop.vue @@ -0,0 +1,112 @@ + + + + + \ No newline at end of file diff --git a/src/views/index/RightCenter.vue b/src/views/index/RightCenter.vue new file mode 100644 index 0000000..674a4cc --- /dev/null +++ b/src/views/index/RightCenter.vue @@ -0,0 +1,158 @@ + + + + + \ No newline at end of file diff --git a/src/views/index/RightTop.vue b/src/views/index/RightTop.vue new file mode 100644 index 0000000..6bde41b --- /dev/null +++ b/src/views/index/RightTop.vue @@ -0,0 +1,178 @@ + + + + + \ No newline at end of file diff --git a/src/views/index/average-duration.vue b/src/views/index/average-duration.vue new file mode 100644 index 0000000..c75719a --- /dev/null +++ b/src/views/index/average-duration.vue @@ -0,0 +1,218 @@ + + + + + \ No newline at end of file diff --git a/src/views/index/common-questions.vue b/src/views/index/common-questions.vue new file mode 100644 index 0000000..52f2c31 --- /dev/null +++ b/src/views/index/common-questions.vue @@ -0,0 +1,143 @@ + + + + + \ No newline at end of file diff --git a/src/views/index/components/CenterBottom.vue b/src/views/index/components/CenterBottom.vue new file mode 100644 index 0000000..e771694 --- /dev/null +++ b/src/views/index/components/CenterBottom.vue @@ -0,0 +1,119 @@ + + + + + \ No newline at end of file diff --git a/src/views/index/components/CenterTop.vue b/src/views/index/components/CenterTop.vue new file mode 100644 index 0000000..59a28ec --- /dev/null +++ b/src/views/index/components/CenterTop.vue @@ -0,0 +1,100 @@ + + + + + \ No newline at end of file diff --git a/src/views/index/components/ConsultationCard.vue b/src/views/index/components/ConsultationCard.vue new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/src/views/index/components/ConsultationCard.vue @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/views/index/components/LeftBottom.vue b/src/views/index/components/LeftBottom.vue new file mode 100644 index 0000000..302bf0c --- /dev/null +++ b/src/views/index/components/LeftBottom.vue @@ -0,0 +1,155 @@ + + + + + \ No newline at end of file diff --git a/src/views/index/components/LeftCenter.vue b/src/views/index/components/LeftCenter.vue new file mode 100644 index 0000000..0632e4c --- /dev/null +++ b/src/views/index/components/LeftCenter.vue @@ -0,0 +1,188 @@ + + + + + \ No newline at end of file diff --git a/src/views/index/components/LeftTop.vue b/src/views/index/components/LeftTop.vue new file mode 100644 index 0000000..691f9a1 --- /dev/null +++ b/src/views/index/components/LeftTop.vue @@ -0,0 +1,132 @@ + + + + + \ No newline at end of file diff --git a/src/views/index/components/RightBottom.vue b/src/views/index/components/RightBottom.vue new file mode 100644 index 0000000..e771694 --- /dev/null +++ b/src/views/index/components/RightBottom.vue @@ -0,0 +1,119 @@ + + + + + \ No newline at end of file diff --git a/src/views/index/components/RightCenter.vue b/src/views/index/components/RightCenter.vue new file mode 100644 index 0000000..674a4cc --- /dev/null +++ b/src/views/index/components/RightCenter.vue @@ -0,0 +1,158 @@ + + + + + \ No newline at end of file diff --git a/src/views/index/components/RightTop.vue b/src/views/index/components/RightTop.vue new file mode 100644 index 0000000..6bde41b --- /dev/null +++ b/src/views/index/components/RightTop.vue @@ -0,0 +1,178 @@ + + + + + \ No newline at end of file diff --git a/src/views/index/content-header.vue b/src/views/index/content-header.vue index 18f8369..ec61ea4 100644 --- a/src/views/index/content-header.vue +++ b/src/views/index/content-header.vue @@ -24,20 +24,20 @@ const formattedConsultCount = computed(() => formatNumber(consultCount.value)); // 筛选选项 const consultTypeOptions = [ - { value: 'all', label: '全部类型' }, - { value: 'academic', label: '学业咨询' }, - { value: 'career', label: '就业咨询' }, - { value: 'personal', label: '个人发展' }, - { value: 'other', label: '其他咨询' } + { value: "all", label: "全部类型" }, + { value: "academic", label: "学业咨询" }, + { value: "career", label: "就业咨询" }, + { value: "personal", label: "个人发展" }, + { value: "other", label: "其他咨询" }, ]; const selectedConsultType = ref(consultTypeOptions[0].value); const timeRangeOptions = [ - { value: '1week', label: '近一周' }, - { value: '1month', label: '近一月' }, - { value: '3months', label: '近三月' }, - { value: 'halfyear', label: '近半年' }, - { value: '1year', label: '近一年' } + { value: "1week", label: "近一周" }, + { value: "1month", label: "近一月" }, + { value: "3months", label: "近三月" }, + { value: "halfyear", label: "近半年" }, + { value: "1year", label: "近一年" }, ]; const selectedTimeRange = ref(timeRangeOptions[0].value); @@ -53,28 +53,28 @@ const dateRange = ref<[Date, Date]>(getDefaultDateRange() as [Date, Date]); // 咨询人数趋势图 const option = ref({}); const getData = () => { - // 可以添加筛选参数 - const params = { - consultType: selectedConsultType.value, - timeRange: selectedTimeRange.value, - dateRange: dateRange.value - }; - - consultationTrend().then((res)=> { - if(res.success) { - setOptions(res.data) - } else { - ElMessage({ - message: res.msg, - type: "warning", - }); - } - }) -} + // 可以添加筛选参数 + const params = { + consultType: selectedConsultType.value, + timeRange: selectedTimeRange.value, + dateRange: dateRange.value, + }; + + consultationTrend().then((res) => { + if (res.success) { + setOptions(res.data); + } else { + ElMessage({ + message: res.msg, + type: "warning", + }); + } + }); +}; // 监听筛选条件变化 const handleFilterChange = () => { - getData(); + getData(); }; // 监听筛选条件变化 @@ -82,125 +82,124 @@ watch(selectedConsultType, handleFilterChange); watch(selectedTimeRange, handleFilterChange); watch(dateRange, handleFilterChange); -const setOptions = async (newData:any) => { - option.value = { - grid: { - top: '15%', - left: '3%', - right: '4%', - bottom: '3%', - containLabel: true +const setOptions = async (newData: any) => { + option.value = { + grid: { + top: "15%", + left: "3%", + right: "4%", + bottom: "3%", + containLabel: true, + }, + backgroundColor: "#ffffff", + tooltip: { + trigger: "axis", + axisPointer: { + type: "line", + lineStyle: { + color: "#4B96FF", + width: 1, }, - backgroundColor: '#ffffff', - tooltip: { - trigger: 'axis', - axisPointer: { - type: 'line', - lineStyle: { - color: '#4B96FF', - width: 1 - } - }, - backgroundColor: 'rgba(255, 255, 255, 0.9)', - borderColor: '#F1F1F1', - borderWidth: 1, - padding: [8, 10], - textStyle: { - color: '#666' - }, - formatter: function(params: any) { - const data = params[0]; - return `${data.name}
${data.value}`; - } + }, + backgroundColor: "rgba(255, 255, 255, 0.9)", + borderColor: "#F1F1F1", + borderWidth: 1, + padding: [8, 10], + textStyle: { + color: "#666", + }, + formatter: function (params: any) { + const data = params[0]; + return `${data.name}
${data.value}`; + }, + }, + xAxis: { + type: "category", + boundaryGap: false, + data: newData.dateList, + axisLine: { + lineStyle: { + color: "#E0E0E0", }, - xAxis: { - type: 'category', - boundaryGap: false, - data: newData.dateList, - axisLine: { - lineStyle: { - color: '#E0E0E0' - } - }, - axisLabel: { - color: '#999999', - formatter: function(value: string) { - return value.replace('2023-', ''); - } - } + }, + axisLabel: { + color: "#999999", + formatter: function (value: string) { + return value.replace("2023-", ""); }, - yAxis: { - type: 'value', - max: 900, - min: 0, - interval: 300, - splitNumber: 3, - axisLine: { - show: false - }, - axisTick: { - show: false - }, - splitLine: { - lineStyle: { - type: 'dashed', - color: '#E0E0E0' - } - }, - axisLabel: { - color: '#999999', - formatter: '{value}' - } + }, + }, + yAxis: { + type: "value", + max: 900, + min: 0, + interval: 300, + splitNumber: 3, + axisLine: { + show: false, + }, + axisTick: { + show: false, + }, + splitLine: { + lineStyle: { + type: "dashed", + color: "#E0E0E0", }, - series: [ - { - type: 'line', - data: newData.valueList, - smooth: true, - symbol: 'circle', - symbolSize: 8, - showSymbol: function(idx: number) { - // 只在特定位置显示圆点,例如第三个点 - return idx === 2; - }, - itemStyle: { - color: '#fff', - borderColor: '#4B96FF', - borderWidth: 2 - }, - lineStyle: { - color: '#4B96FF', - width: 3 - }, - areaStyle: { - color: { - type: 'linear', - x: 0, - y: 0, - x2: 0, - y2: 1, - colorStops: [ - { - offset: 0, - color: 'rgba(75, 150, 255, 0.3)' - }, - { - offset: 1, - color: 'rgba(75, 150, 255, 0.1)' - } - ] - } - } - } - ] - } -} + }, + axisLabel: { + color: "#999999", + formatter: "{value}", + }, + }, + series: [ + { + type: "line", + data: newData.valueList, + smooth: true, + symbol: "circle", + symbolSize: 8, + showSymbol: function (idx: number) { + // 只在特定位置显示圆点,例如第三个点 + return idx === 2; + }, + itemStyle: { + color: "#fff", + borderColor: "#4B96FF", + borderWidth: 2, + }, + lineStyle: { + color: "#4B96FF", + width: 3, + }, + areaStyle: { + color: { + type: "linear", + x: 0, + y: 0, + x2: 0, + y2: 1, + colorStops: [ + { + offset: 0, + color: "rgba(75, 150, 255, 0.3)", + }, + { + offset: 1, + color: "rgba(75, 150, 255, 0.1)", + }, + ], + }, + }, + }, + ], + }; +}; // 组件挂载时获取数据 onMounted(() => { - getData(); + getData(); }); -