|
@@ -1,63 +1,42 @@
|
|
|
<script setup lang="ts">
|
|
|
-// defineOptions({
|
|
|
-// // eslint-disable-next-line vue/no-reserved-component-names
|
|
|
-// name: "Dashboard",
|
|
|
-// inheritAttrs: false,
|
|
|
-// });
|
|
|
-import SvgIcon from "@/components/SvgIcon/index.vue";
|
|
|
-import BarChart from "./components/BarChart.vue";
|
|
|
-import PieChart from "./components/PieChart.vue";
|
|
|
-import RadarChart from "./components/RadarChart.vue";
|
|
|
-import { useTransition, TransitionPresets } from "@vueuse/core";
|
|
|
-import {getClassList, getSchoolList} from "@/api/school";
|
|
|
-import {ClassList} from "@/api/school/types";
|
|
|
-
|
|
|
-const duration = 5000;
|
|
|
+import DataCard from "@/views/dashboard/components/DataCard.vue";
|
|
|
+import ExampleDialog from "@/views/dashboard/components/ExampleDialog.vue";
|
|
|
+import LiquidChart from "@/views/dashboard/components/liquidChart.vue";
|
|
|
+import CircleChart from "@/views/dashboard/components/CircleChart.vue";
|
|
|
+defineOptions({
|
|
|
+ // eslint-disable-next-line vue/no-reserved-component-names
|
|
|
+ name: "Dashboard",
|
|
|
+ inheritAttrs: false,
|
|
|
+});
|
|
|
+import { getClassList, getSchoolList } from "@/api/school";
|
|
|
+import { ClassList } from "@/api/school/types";
|
|
|
+import { watch } from "vue";
|
|
|
+import { useUserStore } from "@/store/modules/user";
|
|
|
+const userStore = useUserStore();
|
|
|
+watch(
|
|
|
+ () => userStore.schoolId,
|
|
|
+ (newValue, oldValue) => {
|
|
|
+ console.log("userStore.schoolId", newValue, oldValue);
|
|
|
+ // 学校切换后重新加载数据
|
|
|
+ }
|
|
|
+);
|
|
|
/**
|
|
|
* 数据卡片
|
|
|
*/
|
|
|
// 全部班级
|
|
|
const classCount = ref(0);
|
|
|
-const classCountOutput = useTransition(classCount, {
|
|
|
- duration: duration,
|
|
|
- transition: TransitionPresets.easeOutExpo,
|
|
|
-});
|
|
|
-classCount.value = 2000;
|
|
|
-
|
|
|
// 全部教师
|
|
|
const teacherCount = ref(0);
|
|
|
-const teacherCountOutput = useTransition(teacherCount, {
|
|
|
- duration: duration,
|
|
|
- transition: TransitionPresets.easeOutExpo,
|
|
|
-});
|
|
|
-teacherCount.value = 2000;
|
|
|
-
|
|
|
// 全部学生
|
|
|
const studentCount = ref(0);
|
|
|
-const studentCountOutput = useTransition(studentCount, {
|
|
|
- duration: duration,
|
|
|
- transition: TransitionPresets.easeOutExpo,
|
|
|
-});
|
|
|
-studentCount.value = 2000;
|
|
|
-
|
|
|
// 设备套数
|
|
|
const equipmentCount = ref(0);
|
|
|
-const equipmentCountOutput = useTransition(equipmentCount, {
|
|
|
- duration: duration,
|
|
|
- transition: TransitionPresets.easeOutExpo,
|
|
|
-});
|
|
|
-equipmentCount.value = 2000;
|
|
|
-
|
|
|
// 累计训练次数
|
|
|
const trainingCount = ref(0);
|
|
|
-const trainingCountOutput = useTransition(trainingCount, {
|
|
|
- duration: duration,
|
|
|
- transition: TransitionPresets.easeOutExpo,
|
|
|
-});
|
|
|
-trainingCount.value = 2000;
|
|
|
/**
|
|
|
* 班级数据
|
|
|
*/
|
|
|
+// 班级编号
|
|
|
let classNumber = ref(0);
|
|
|
const classData = ref<ClassList[]>([]);
|
|
|
// function queryClassList() {
|
|
@@ -65,126 +44,112 @@ const classData = ref<ClassList[]>([]);
|
|
|
// classData.value = data;
|
|
|
// });
|
|
|
// }
|
|
|
+watch(
|
|
|
+ () => classNumber,
|
|
|
+ (newValue, oldValue) => {
|
|
|
+ console.log("userStore.schoolId", newValue, oldValue);
|
|
|
+ // 班级切换后重新加载班级数据
|
|
|
+ }
|
|
|
+);
|
|
|
onMounted(() => {
|
|
|
- //queryClassList();
|
|
|
+ //queryClassList();
|
|
|
});
|
|
|
+// 优秀教学效果示例
|
|
|
+const dialogVisible = ref(false);
|
|
|
+// 学员专注力平均值整体对比分析
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
<div class="dashboard-container">
|
|
|
<!-- 数据卡片 -->
|
|
|
- <el-row :gutter="40" class="mb-4">
|
|
|
- <el-col :xs="24" :sm="8" :lg="5" class="mb-4">
|
|
|
- <div class="data-box">
|
|
|
- <div class="text-[#40c9c6] hover:!text-white hover:bg-[#40c9c6] p-3 rounded">
|
|
|
- <svg-icon icon-class="uv" size="3em" />
|
|
|
- </div>
|
|
|
- <div class="flex flex-col space-y-3">
|
|
|
- <div class="text-[var(--el-text-color-secondary)]">全部班级</div>
|
|
|
- <div class="text-lg">{{ Math.round(classCountOutput) }}</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- <el-col :xs="24" :sm="8" :lg="5" class="mb-4">
|
|
|
- <div class="data-box">
|
|
|
- <div class="text-[#40c9c6] hover:!text-white hover:bg-[#40c9c6] p-3 rounded">
|
|
|
- <svg-icon icon-class="uv" size="3em" />
|
|
|
- </div>
|
|
|
- <div class="flex flex-col space-y-3">
|
|
|
- <div class="text-[var(--el-text-color-secondary)]">全部教师</div>
|
|
|
- <div class="text-lg">{{ Math.round(teacherCountOutput) }}</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- <el-col :xs="24" :sm="8" :lg="5" class="mb-4">
|
|
|
- <div class="data-box">
|
|
|
- <div class="text-[#40c9c6] hover:!text-white hover:bg-[#40c9c6] p-3 rounded">
|
|
|
- <svg-icon icon-class="uv" size="3em" />
|
|
|
- </div>
|
|
|
- <div class="flex flex-col space-y-3">
|
|
|
- <div class="text-[var(--el-text-color-secondary)]">全部学生</div>
|
|
|
- <div class="text-lg">{{ Math.round(studentCountOutput) }}</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- <el-col :xs="24" :sm="8" :lg="5" class="mb-4">
|
|
|
- <div class="data-box">
|
|
|
- <div
|
|
|
- class="text-[#36a3f7] hover:!text-white hover:bg-[#36a3f7] p-3 rounded"
|
|
|
- >
|
|
|
- <svg-icon icon-class="message" size="3em" />
|
|
|
- </div>
|
|
|
- <div class="flex flex-col space-y-3">
|
|
|
- <div class="text-[var(--el-text-color-secondary)]">设备套数</div>
|
|
|
- <div class="text-lg">
|
|
|
- {{ Math.round(equipmentCountOutput) }}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <DataCard
|
|
|
+ :classes="classCount"
|
|
|
+ :teachers="teacherCount"
|
|
|
+ :students="studentCount"
|
|
|
+ :equipments="equipmentCount"
|
|
|
+ :trainings="trainingCount"
|
|
|
+ />
|
|
|
+
|
|
|
+ <!-- 班级选择 及 案例展示 -->
|
|
|
+ <el-row class="row-bg" justify="space-between">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-select v-model="classNumber" class="m-2" placeholder="全部班级">
|
|
|
+ <el-option
|
|
|
+ v-for="item in classData"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</el-col>
|
|
|
- <el-col :xs="24" :sm="8" :lg="5" class="mb-4">
|
|
|
- <div class="data-box">
|
|
|
- <div
|
|
|
- class="text-[#f4516c] hover:!text-white hover:bg-[#f4516c] p-3 rounded"
|
|
|
- >
|
|
|
- <svg-icon icon-class="money" size="3em" />
|
|
|
- </div>
|
|
|
- <div class="flex flex-col space-y-3">
|
|
|
- <div class="text-[var(--el-text-color-secondary)]">累计训练次数</div>
|
|
|
- <div class="text-lg">
|
|
|
- {{ Math.round(trainingCountOutput) }}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-button text @click="dialogVisible = true"
|
|
|
+ >优秀教学效果示例</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <!-- 班级选择 及 案例展示 -->
|
|
|
- <el-row class="row-bg" justify="space-between">
|
|
|
- <el-col :span="12">
|
|
|
- <el-select v-model="classNumber" class="m-2" placeholder="全部班级">
|
|
|
- <el-option
|
|
|
- v-for="item in classData"
|
|
|
- :key="item.id"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-link href="#" type="primary">优秀教学效果示例</el-link>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
|
|
|
<!-- Echarts 图表 -->
|
|
|
<el-row :gutter="40">
|
|
|
- <el-col :sm="24" :lg="8" class="mb-4">
|
|
|
- <BarChart
|
|
|
- id="barChart"
|
|
|
- height="400px"
|
|
|
- width="100%"
|
|
|
+ <el-col :sm="24" :lg="6" class="mb-4">
|
|
|
+ <LiquidChart
|
|
|
+ id="liquidChart1"
|
|
|
+ data="37.5"
|
|
|
+ height="200px"
|
|
|
+ width="200px"
|
|
|
+ color="#56a2ff"
|
|
|
+ bg-color="#e6edf9"
|
|
|
class="bg-[var(--el-bg-color-overlay)]"
|
|
|
/>
|
|
|
</el-col>
|
|
|
-
|
|
|
- <el-col :xs="24" :sm="12" :lg="8" class="mb-4">
|
|
|
- <PieChart
|
|
|
- id="pieChart"
|
|
|
- height="400px"
|
|
|
- width="100%"
|
|
|
+ <el-col :sm="24" :lg="6" class="mb-4">
|
|
|
+ <LiquidChart
|
|
|
+ id="liquidChart2"
|
|
|
+ data="57.6"
|
|
|
+ height="200px"
|
|
|
+ width="200px"
|
|
|
+ color="#646bfa"
|
|
|
+ bg-color="#e6e8f9"
|
|
|
class="bg-[var(--el-bg-color-overlay)]"
|
|
|
/>
|
|
|
</el-col>
|
|
|
-
|
|
|
- <el-col :xs="24" :sm="12" :lg="8" class="mb-4">
|
|
|
- <RadarChart
|
|
|
- id="radarChart"
|
|
|
- height="400px"
|
|
|
- width="100%"
|
|
|
+ <el-col :sm="24" :lg="6" class="mb-4">
|
|
|
+ <CircleChart
|
|
|
+ id="circleChart1"
|
|
|
+ data="37.5"
|
|
|
+ height="200px"
|
|
|
+ width="200px"
|
|
|
+ color="#56a2ff"
|
|
|
+ bg-color="#e6edf9"
|
|
|
+ class="bg-[var(--el-bg-color-overlay)]"
|
|
|
+ />
|
|
|
+ </el-col>
|
|
|
+ <el-col :sm="24" :lg="6" class="mb-4">
|
|
|
+ <CircleChart
|
|
|
+ id="circleChart2"
|
|
|
+ data="57.6"
|
|
|
+ height="200px"
|
|
|
+ width="200px"
|
|
|
+ color="#646bfa"
|
|
|
+ bg-color="#e6e8f9"
|
|
|
class="bg-[var(--el-bg-color-overlay)]"
|
|
|
/>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+
|
|
|
+ <!-- 优秀教学效果示例弹出层 -->
|
|
|
+ <el-dialog
|
|
|
+ v-model="dialogVisible"
|
|
|
+ title="学员每次训练专注力评分均值整体变化曲线"
|
|
|
+ center
|
|
|
+ >
|
|
|
+ <ExampleDialog />
|
|
|
+ <template #footer>
|
|
|
+ <span class="dialog-footer">
|
|
|
+ <el-button @click="dialogVisible = false">关闭</el-button>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -192,34 +157,5 @@ onMounted(() => {
|
|
|
.dashboard-container {
|
|
|
position: relative;
|
|
|
padding: 24px;
|
|
|
-
|
|
|
- .user-avatar {
|
|
|
- width: 40px;
|
|
|
- height: 40px;
|
|
|
- border-radius: 50%;
|
|
|
- }
|
|
|
-
|
|
|
- @media only screen and (min-width: 1200px){
|
|
|
- .el-col-lg-5 {
|
|
|
- display: block;
|
|
|
- max-width: 20%;
|
|
|
- flex: 0 0 20%;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .data-box {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- padding: 20px;
|
|
|
- font-weight: bold;
|
|
|
- color: var(--el-text-color-regular);
|
|
|
- background: var(--el-bg-color-overlay);
|
|
|
- border-color: var(--el-border-color);
|
|
|
- box-shadow: var(--el-box-shadow-dark);
|
|
|
- }
|
|
|
-
|
|
|
- .svg-icon {
|
|
|
- fill: currentcolor !important;
|
|
|
- }
|
|
|
}
|
|
|
</style>
|