xiaoxin před 2 roky
rodič
revize
caa3be2855

+ 12 - 0
package-lock.json

@@ -8,6 +8,7 @@
       "name": "wanzai",
       "name": "wanzai",
       "version": "0.0.0",
       "version": "0.0.0",
       "dependencies": {
       "dependencies": {
+        "@easydarwin/easywasmplayer": "^4.0.13",
         "axios": "^1.6.7",
         "axios": "^1.6.7",
         "countup.js": "^2.8.0",
         "countup.js": "^2.8.0",
         "crypto-js": "^4.2.0",
         "crypto-js": "^4.2.0",
@@ -83,6 +84,12 @@
         "node": ">=10"
         "node": ">=10"
       }
       }
     },
     },
+    "node_modules/@easydarwin/easywasmplayer": {
+      "version": "4.0.13",
+      "resolved": "https://registry.npmmirror.com/@easydarwin/easywasmplayer/-/easywasmplayer-4.0.13.tgz",
+      "integrity": "sha512-yvVlFZgmrydMxAEeA1IHWHgt4T91TGLOHhgCOSLkI1iHddPl7wEw2U7+0E+TcKNHaPf5/FqF/4JR4+W+kRr2HA==",
+      "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."
+    },
     "node_modules/@element-plus/icons-vue": {
     "node_modules/@element-plus/icons-vue": {
       "version": "2.3.1",
       "version": "2.3.1",
       "resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz",
       "resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz",
@@ -2088,6 +2095,11 @@
       "resolved": "https://registry.npmmirror.com/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz",
       "resolved": "https://registry.npmmirror.com/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz",
       "integrity": "sha512-SITSV6aIXsuVNV3f3O0f2n/cgyEDWoSqtZMYiAmcsYHydcKrOz3gUxB/iXd/Qf08+IZX4KpgNbvUdMBmWz+kcA=="
       "integrity": "sha512-SITSV6aIXsuVNV3f3O0f2n/cgyEDWoSqtZMYiAmcsYHydcKrOz3gUxB/iXd/Qf08+IZX4KpgNbvUdMBmWz+kcA=="
     },
     },
+    "@easydarwin/easywasmplayer": {
+      "version": "4.0.13",
+      "resolved": "https://registry.npmmirror.com/@easydarwin/easywasmplayer/-/easywasmplayer-4.0.13.tgz",
+      "integrity": "sha512-yvVlFZgmrydMxAEeA1IHWHgt4T91TGLOHhgCOSLkI1iHddPl7wEw2U7+0E+TcKNHaPf5/FqF/4JR4+W+kRr2HA=="
+    },
     "@element-plus/icons-vue": {
     "@element-plus/icons-vue": {
       "version": "2.3.1",
       "version": "2.3.1",
       "resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz",
       "resolved": "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz",

+ 1 - 0
package.json

@@ -11,6 +11,7 @@
     "type-check": "vue-tsc --build --force"
     "type-check": "vue-tsc --build --force"
   },
   },
   "dependencies": {
   "dependencies": {
+    "@easydarwin/easywasmplayer": "^4.0.13",
     "axios": "^1.6.7",
     "axios": "^1.6.7",
     "countup.js": "^2.8.0",
     "countup.js": "^2.8.0",
     "crypto-js": "^4.2.0",
     "crypto-js": "^4.2.0",

+ 3 - 2
src/api/token/index.ts

@@ -3,8 +3,9 @@ import request from "@/utils/request";
 //token相关的请求地址
 //token相关的请求地址
 enum API {
 enum API {
   // 验证token是否正确的接口
   // 验证token是否正确的接口
-  TOKEN_URL = "/wanzai/api/driver/getClassTj",
+  TOKEN_URL = "/wanzai/api/wechat/checkToken",
 }
 }
 
 
 // 验证token是否正确的接口
 // 验证token是否正确的接口
-export const reqVerifyToken = (data: any) => request.get(API.TOKEN_URL, data);
+export const reqVerifyToken = (params: any) =>
+  request.get(API.TOKEN_URL, { params });

+ 14 - 0
src/api/user/index.ts

@@ -21,6 +21,12 @@ enum API {
 
 
   // 获取教师战力值排行榜数据 接口地址
   // 获取教师战力值排行榜数据 接口地址
   RANKINGLIST = "/wanzai/api/smartEvaluateTeacher/rankingList",
   RANKINGLIST = "/wanzai/api/smartEvaluateTeacher/rankingList",
+
+  // 学生考勤统计
+  STUDENTCHECKIN = "/wanzai/api/smartAttendance/studentHistoricalAttendance",
+
+  // 考勤记录列表数据
+  CHECKLIST = "/wanzai/api/smartAttendance/classHistoricalAttendance",
 }
 }
 
 
 // 获取用户汇总数据
 // 获取用户汇总数据
@@ -58,3 +64,11 @@ export const reqGetEvaluateData = (data: any) =>
 // 获取教师战力值排行榜数据
 // 获取教师战力值排行榜数据
 export const reqGetRankingList = (data: any) =>
 export const reqGetRankingList = (data: any) =>
   request.get(API.RANKINGLIST, { params: data });
   request.get(API.RANKINGLIST, { params: data });
+
+// 学生考勤统计
+export const reqGetStudentCheckin = (params: any) =>
+  request.get(API.STUDENTCHECKIN, { params });
+
+// 考勤记录列表数据
+export const reqGetCheckList = (params: any) =>
+  request.get(API.CHECKLIST, { params });

+ 35 - 0
src/api/video/index.ts

@@ -0,0 +1,35 @@
+import request from "@/utils/request";
+
+enum API {
+  // 登录获取监控权限
+  VIDEOLOGIN_URL = "/av_ja/videoAdmin/login",
+
+  // 获取监控列表数组
+  VIDEOLIST_URL = "/av_ja/videoSpot/list",
+
+  // 监控拉流
+  VIDEOPULL_URL = "/av_ja/stream/addStreamSource",
+}
+
+//登录获取监控权限
+export const reqVideoLogin = (data: any) =>
+  request.post(API.VIDEOLOGIN_URL, data, { headers: { type: "local" } });
+
+//获取监控列表数组
+export const reqVideoList = (params: any) =>
+  request.get(API.VIDEOLIST_URL, {
+    params,
+    headers: {
+      type: "local",
+      admin_token: localStorage.getItem("admin_token"),
+    },
+  });
+
+//监控拉流
+export const reqVideoPull = (data: any) =>
+  request.post(API.VIDEOPULL_URL, data, {
+    headers: {
+      type: "local",
+      admin_token: localStorage.getItem("admin_token"),
+    },
+  });

binární
src/assets/images/1.png


+ 13 - 0
src/components/energy/energyLeft.vue

@@ -151,6 +151,9 @@ const chartData2 = ref<any>([]);
 // 探学楼数据
 // 探学楼数据
 const chartData3 = ref<any>([]);
 const chartData3 = ref<any>([]);
 
 
+// 探真楼数据
+const chartData4 = ref<any>([]);
+
 // 默认选中按钮
 // 默认选中按钮
 const currentIndex = ref("水");
 const currentIndex = ref("水");
 
 
@@ -225,6 +228,8 @@ const getChartData = async () => {
           chartData2.value.push(item.num);
           chartData2.value.push(item.num);
         } else if (item.name === "探学楼") {
         } else if (item.name === "探学楼") {
           chartData3.value.push(item.num);
           chartData3.value.push(item.num);
+        } else if (item.name === "探真楼") {
+          chartData4.value.push(item.num);
         }
         }
       });
       });
     });
     });
@@ -348,6 +353,14 @@ const initBarChart = () => {
         },
         },
         data: chartData3.value,
         data: chartData3.value,
       },
       },
+      {
+        name: placeList.value[3],
+        type: "bar",
+        emphasis: {
+          focus: "series",
+        },
+        data: chartData4.value,
+      },
     ],
     ],
   };
   };
   myBarChart.setOption(options);
   myBarChart.setOption(options);

+ 29 - 13
src/components/energy/energyRight.vue

@@ -76,31 +76,39 @@
       <div class="sub_title">用水量实时监测</div>
       <div class="sub_title">用水量实时监测</div>
 
 
       <div class="form_water form">
       <div class="form_water form">
-        <el-table :data="tableDataWater">
+        <el-table :data="tableDataWater" height="240">
           <el-table-column
           <el-table-column
             prop="build"
             prop="build"
             label="楼栋"
             label="楼栋"
             align="center"
             align="center"
-            width="110"
+            width="60"
             show-overflow-tooltip
             show-overflow-tooltip
           />
           />
           <el-table-column
           <el-table-column
-            prop="meterId"
+            prop="address"
+            label="位置"
+            align="center"
+            width="60"
+            show-overflow-tooltip
+          />
+          <el-table-column
+            prop="meterNo"
             label="编号"
             label="编号"
             align="center"
             align="center"
             width="50"
             width="50"
+            show-overflow-tooltip
           />
           />
           <el-table-column
           <el-table-column
             prop="num"
             prop="num"
-            label="用水量(m³)"
+            label="用水量(m³)"
             align="center"
             align="center"
-            width="110"
+            width="80"
           />
           />
           <el-table-column
           <el-table-column
             prop="createTime"
             prop="createTime"
             label="通讯时间"
             label="通讯时间"
             align="center"
             align="center"
-            width="132"
+            show-overflow-tooltip
           />
           />
         </el-table>
         </el-table>
       </div>
       </div>
@@ -108,31 +116,39 @@
       <div class="sub_title">用电量实时监测</div>
       <div class="sub_title">用电量实时监测</div>
 
 
       <div class="form_ele form">
       <div class="form_ele form">
-        <el-table :data="tableDataEle">
+        <el-table :data="tableDataEle" height="240">
           <el-table-column
           <el-table-column
             prop="build"
             prop="build"
             label="楼栋"
             label="楼栋"
             align="center"
             align="center"
-            width="110"
+            width="60"
             show-overflow-tooltip
             show-overflow-tooltip
           />
           />
           <el-table-column
           <el-table-column
-            prop="meterId"
+            prop="address"
+            label="位置"
+            align="center"
+            width="60"
+            show-overflow-tooltip
+          />
+          <el-table-column
+            prop="meterNo"
             label="编号"
             label="编号"
             align="center"
             align="center"
             width="50"
             width="50"
+            show-overflow-tooltip
           />
           />
           <el-table-column
           <el-table-column
             prop="num"
             prop="num"
-            label="用电量(kw.h)"
+            label="用电量(kw.h)"
             align="center"
             align="center"
-            width="110"
+            width="80"
           />
           />
           <el-table-column
           <el-table-column
             prop="createTime"
             prop="createTime"
             label="通讯时间"
             label="通讯时间"
             align="center"
             align="center"
-            width="132"
+            show-overflow-tooltip
           />
           />
         </el-table>
         </el-table>
       </div>
       </div>
@@ -416,6 +432,6 @@ const getCountUpNum = () => {
 
 
 // 动画滚动
 // 动画滚动
 ::v-deep(.el-scrollbar__view) {
 ::v-deep(.el-scrollbar__view) {
-  animation: run 12s linear infinite;
+  // animation: run 12s linear infinite;
 }
 }
 </style>
 </style>

+ 32 - 3
src/components/school/schoolRight.vue

@@ -32,7 +32,7 @@
       </div>
       </div>
       <div class="sub_title">预警推送</div>
       <div class="sub_title">预警推送</div>
       <div class="form">
       <div class="form">
-        <el-table :data="tableData">
+        <el-table :data="tableData" height="280">
           <el-table-column label="序号" align="center" width="40">
           <el-table-column label="序号" align="center" width="40">
             <template #default="scope">
             <template #default="scope">
               <div class="order">{{ scope.$index + 1 }}</div>
               <div class="order">{{ scope.$index + 1 }}</div>
@@ -94,9 +94,14 @@ import { ref, onMounted } from "vue";
 import { useRouter } from "vue-router";
 import { useRouter } from "vue-router";
 import { countUpNum } from "@/utils/countUpNum";
 import { countUpNum } from "@/utils/countUpNum";
 import { reqGetSmartWarning } from "@/api/school/index";
 import { reqGetSmartWarning } from "@/api/school/index";
+// @ts-ignore
+import { reqVideoLogin } from "@/api/video/index";
+// @ts-ignore
+import WasmPlayer from "@easydarwin/easywasmplayer";
+import axios from "axios";
 
 
 // 监控摄像头数据
 // 监控摄像头数据
-const deviceNum = ref(100);
+const deviceNum = ref(150);
 // 报警器数据
 // 报警器数据
 const deviceNum2 = ref(150);
 const deviceNum2 = ref(150);
 // 消防设施数据
 // 消防设施数据
@@ -125,6 +130,9 @@ onMounted(() => {
 
 
   // 获取预警推送信息
   // 获取预警推送信息
   getSmartWarning();
   getSmartWarning();
+
+  // 登录获取监控权限
+  getVideoLogin();
 });
 });
 
 
 // 获取预警推送信息
 // 获取预警推送信息
@@ -139,6 +147,27 @@ const getSmartWarning = async () => {
   }
   }
 };
 };
 
 
+// 登录获取监控权限
+const getVideoLogin = async () => {
+  console.log(111);
+
+  // const res = await reqVideoLogin({
+  //   username: "admin",
+  //   password: "admin.123456",
+  // });
+  // console.log(res);
+
+  const res = await axios({
+    url: "http://172.16.7.203:8083/av_ja/videoAdmin/login",
+    method: "post",
+    data: {
+      username: "admin",
+      password: "admin.123456",
+    },
+  });
+  console.log(res);
+};
+
 // 查看更多按钮回调
 // 查看更多按钮回调
 const handleCheckMore = () => {
 const handleCheckMore = () => {
   router.push("/more");
   router.push("/more");
@@ -312,6 +341,6 @@ const getCountUpNum = () => {
 
 
 // 动画滚动
 // 动画滚动
 ::v-deep(.el-scrollbar__view) {
 ::v-deep(.el-scrollbar__view) {
-  animation: run 12s linear infinite;
+  // animation: run 12s linear infinite;
 }
 }
 </style>
 </style>

+ 14 - 0
src/components/student/studentCenter.vue

@@ -32,7 +32,9 @@
             <!-- 详细信息区域 -->
             <!-- 详细信息区域 -->
             <div class="detail">
             <div class="detail">
               <div class="detail_img">
               <div class="detail_img">
+                <img v-if="item.type === '打卡'" src="@/assets/images/1.png" />
                 <el-image
                 <el-image
+                  v-else
                   style="width: 38px; height: 45px"
                   style="width: 38px; height: 45px"
                   :src="item.image"
                   :src="item.image"
                   :preview-src-list="[item.image]"
                   :preview-src-list="[item.image]"
@@ -350,6 +352,12 @@ const initRaChart = () => {
               margin-right: 4px;
               margin-right: 4px;
               width: 38px;
               width: 38px;
               height: 45px;
               height: 45px;
+
+              img {
+                width: 30px;
+                height: 30px;
+                object-fit: contain;
+              }
             }
             }
 
 
             .detail_address {
             .detail_address {
@@ -442,6 +450,12 @@ const initRaChart = () => {
               margin-right: 4px;
               margin-right: 4px;
               width: 38px;
               width: 38px;
               height: 45px;
               height: 45px;
+
+              img {
+                width: 30px;
+                height: 30px;
+                object-fit: contain;
+              }
             }
             }
 
 
             .detail_address {
             .detail_address {

+ 11 - 11
src/components/student/studentLeft.vue

@@ -34,24 +34,24 @@
         <div class="msg_change">
         <div class="msg_change">
           <div
           <div
             class="change_box"
             class="change_box"
-            :class="currentTimeRang === 1 ? 'active' : ''"
-            @click="changeTimeRang(1)"
-          >
-            本学期
-          </div>
-          <div
-            class="change_box"
             :class="currentTimeRang === 3 ? 'active' : ''"
             :class="currentTimeRang === 3 ? 'active' : ''"
             @click="changeTimeRang(3)"
             @click="changeTimeRang(3)"
           >
           >
-            本周
+            近7天
           </div>
           </div>
           <div
           <div
             class="change_box"
             class="change_box"
             :class="currentTimeRang === 2 ? 'active' : ''"
             :class="currentTimeRang === 2 ? 'active' : ''"
             @click="changeTimeRang(2)"
             @click="changeTimeRang(2)"
           >
           >
-            本月
+            近30天
+          </div>
+          <div
+            class="change_box"
+            :class="currentTimeRang === 1 ? 'active' : ''"
+            @click="changeTimeRang(1)"
+          >
+            本学期
           </div>
           </div>
         </div>
         </div>
 
 
@@ -122,8 +122,8 @@ let myPieChart: any;
 // 图表DOM元素
 // 图表DOM元素
 const pieChart = ref();
 const pieChart = ref();
 
 
-// 切换考勤统计时间 1本学期 2本月 3本周
-const currentTimeRang = ref(1);
+// 切换考勤统计时间 1本学期 2近30天 3近7天
+const currentTimeRang = ref(3);
 
 
 // 图表数据
 // 图表数据
 const chartData = ref([
 const chartData = ref([

+ 1 - 1
src/components/student/studentRight.vue

@@ -165,7 +165,7 @@ const getEvaluateData = async () => {
   // console.log(res);
   // console.log(res);
   if ((res as any).code == 200) {
   if ((res as any).code == 200) {
     const result = JSON.parse(decryptDes(res.data));
     const result = JSON.parse(decryptDes(res.data));
-    console.log(result);
+    // console.log(result);
   }
   }
 };
 };
 
 

+ 208 - 168
src/components/user/userLeft.vue

@@ -17,38 +17,39 @@
         >
         >
           学生考勤
           学生考勤
         </div>
         </div>
-        <div
+        <!-- <div
           class="button"
           class="button"
           :class="currentIndex === 1 ? 'active' : ''"
           :class="currentIndex === 1 ? 'active' : ''"
           @click="handleChange(1)"
           @click="handleChange(1)"
         >
         >
           教师考勤
           教师考勤
-        </div>
+        </div> -->
       </div>
       </div>
+
       <!-- 考勤统计区域 -->
       <!-- 考勤统计区域 -->
       <div class="sub_title">考勤统计</div>
       <div class="sub_title">考勤统计</div>
       <div class="stat_msg">
       <div class="stat_msg">
         <div class="msg_change">
         <div class="msg_change">
           <div
           <div
             class="change_box"
             class="change_box"
-            :class="currentTimeRang === 0 ? 'active' : ''"
-            @click="changeTimeRang(0)"
+            :class="currentTimeRang === 3 ? 'active' : ''"
+            @click="changeTimeRang(3)"
           >
           >
-            本学期
+            近7天
           </div>
           </div>
           <div
           <div
             class="change_box"
             class="change_box"
-            :class="currentTimeRang === 1 ? 'active' : ''"
-            @click="changeTimeRang(1)"
+            :class="currentTimeRang === 2 ? 'active' : ''"
+            @click="changeTimeRang(2)"
           >
           >
-            本周
+            近30天
           </div>
           </div>
           <div
           <div
             class="change_box"
             class="change_box"
-            :class="currentTimeRang === 2 ? 'active' : ''"
-            @click="changeTimeRang(2)"
+            :class="currentTimeRang === 1 ? 'active' : ''"
+            @click="changeTimeRang(1)"
           >
           >
-            本
+            本学期
           </div>
           </div>
         </div>
         </div>
 
 
@@ -82,14 +83,43 @@
         <!-- 搜索框区域 -->
         <!-- 搜索框区域 -->
         <div class="record_search">
         <div class="record_search">
           <div class="search_input">
           <div class="search_input">
-            <input type="text" placeholder="请输入部门查询" />
+            <input
+              type="text"
+              placeholder="请输入部门查询"
+              v-model="keyWord"
+              @keyup.enter="handleSerch"
+            />
           </div>
           </div>
           <div class="search_btn" @click="handleSerch">查询</div>
           <div class="search_btn" @click="handleSerch">查询</div>
         </div>
         </div>
 
 
         <!-- 筛选框区域 -->
         <!-- 筛选框区域 -->
         <div class="record_select">
         <div class="record_select">
-          时间
+          <div class="select_change">
+            <div
+              class="select_box"
+              :class="currentTimeRang_check === 3 ? 'active' : ''"
+              @click="changeTimeRang_check(3)"
+            >
+              近7天
+            </div>
+            <div
+              class="select_box"
+              :class="currentTimeRang_check === 2 ? 'active' : ''"
+              @click="changeTimeRang_check(2)"
+            >
+              近30天
+            </div>
+            <div
+              class="select_box"
+              :class="currentTimeRang_check === 1 ? 'active' : ''"
+              @click="changeTimeRang_check(1)"
+            >
+              本学期
+            </div>
+          </div>
+
+          <!-- 时间
           <el-select
           <el-select
             v-model="valueTime"
             v-model="valueTime"
             placeholder="请选择时间"
             placeholder="请选择时间"
@@ -114,50 +144,41 @@
               :label="item.label"
               :label="item.label"
               :value="item.value"
               :value="item.value"
             />
             />
-          </el-select>
+          </el-select> -->
         </div>
         </div>
 
 
         <!-- 表格区域 -->
         <!-- 表格区域 -->
         <div class="record_form form">
         <div class="record_form form">
           <el-table :data="tableData">
           <el-table :data="tableData">
+            <el-table-column prop="className" label="部门" align="center" />
+
             <el-table-column
             <el-table-column
-              prop="class"
-              label="部门"
-              align="center"
-              width="60"
-            />
-            <el-table-column
-              prop="type"
-              label="考勤类别"
-              align="center"
-              width="60"
-            />
-            <el-table-column
-              prop="leave"
+              prop="askForLeave"
               label="请假"
               label="请假"
               align="center"
               align="center"
               width="50"
               width="50"
             />
             />
+
+            <el-table-column label="超时打卡" align="center" width="60">
+              <template #default="{ row }">
+                {{ row.clockOut ? row.clockOut : 0 }}
+              </template>
+            </el-table-column>
+
             <el-table-column
             <el-table-column
-              prop="timeout"
-              label="超时打卡"
-              align="center"
-              width="60"
-            />
-            <el-table-column
-              prop="late"
+              prop="beLate"
               label="迟到"
               label="迟到"
               align="center"
               align="center"
               width="50"
               width="50"
             />
             />
             <el-table-column
             <el-table-column
-              prop="not"
+              prop="notClockingIn"
               label="未打卡"
               label="未打卡"
               align="center"
               align="center"
               width="60"
               width="60"
             />
             />
             <el-table-column
             <el-table-column
-              prop="normal"
+              prop="punctuality"
               label="正常"
               label="正常"
               align="center"
               align="center"
               width="62"
               width="62"
@@ -171,10 +192,11 @@
             v-model:current-page="currentPage"
             v-model:current-page="currentPage"
             v-model:page-size="pageSize"
             v-model:page-size="pageSize"
             layout="prev, pager, next, jumper"
             layout="prev, pager, next, jumper"
-            :total="1000"
+            :total="total"
             :pager-count="5"
             :pager-count="5"
             small
             small
             background
             background
+            hide-on-single-page
             @current-change="handleCurrentChange"
             @current-change="handleCurrentChange"
           />
           />
         </div>
         </div>
@@ -186,12 +208,20 @@
 <script setup lang="ts">
 <script setup lang="ts">
 import { ref, onMounted } from "vue";
 import { ref, onMounted } from "vue";
 import { countUpNum } from "@/utils/countUpNum";
 import { countUpNum } from "@/utils/countUpNum";
-
-const statValue = ref(50);
-const statValue2 = ref(50);
-const statValue3 = ref(50);
-const statValue4 = ref(50);
-const statValue5 = ref(50);
+import { reqGetStudentCheckin, reqGetCheckList } from "@/api/user/index";
+// 引入解密函数
+import { decryptDes } from "@/utils/des";
+
+// 正常
+const statValue = ref(0);
+// 请假
+const statValue2 = ref(0);
+// 迟到
+const statValue3 = ref(0);
+// 超时打卡
+const statValue4 = ref(0);
+// 未打卡
+const statValue5 = ref(0);
 
 
 const statDom = ref();
 const statDom = ref();
 const statDom2 = ref();
 const statDom2 = ref();
@@ -201,163 +231,146 @@ const statDom5 = ref();
 
 
 // 切换学生教师考勤 0学生 1教师
 // 切换学生教师考勤 0学生 1教师
 const currentIndex = ref(0);
 const currentIndex = ref(0);
-// 切换考勤统计时间 0本学期 1本周 2本月
-const currentTimeRang = ref(0);
+
+// 切换考勤统计时间 1本学期 3近7天 2近30天
+const currentTimeRang = ref(3);
+
+// 切换考勤记录时间 1本学期 3近7天 2近30天
+const currentTimeRang_check = ref(3);
+
+// 搜索框绑定数据
+const keyWord = ref("");
+
 // 分页器当前页
 // 分页器当前页
 const currentPage = ref(1);
 const currentPage = ref(1);
 // 每页多少条
 // 每页多少条
 const pageSize = ref(8);
 const pageSize = ref(8);
+// 总条数
+const total = ref(0);
 // 时间筛选框绑定数据
 // 时间筛选框绑定数据
-const valueTime = ref("");
+// const valueTime = ref("");
 // 类别筛选框绑定数据
 // 类别筛选框绑定数据
-const valueType = ref("");
+// const valueType = ref("");
 // 类别筛选框绑定数组
 // 类别筛选框绑定数组
-const optionsType = [
-  {
-    value: "0",
-    label: "全部",
-  },
-  {
-    value: "1",
-    label: "请假",
-  },
-  {
-    value: "2",
-    label: "迟到",
-  },
-  {
-    value: "3",
-    label: "超时打卡",
-  },
-];
+// const optionsType = [
+//   {
+//     value: "0",
+//     label: "全部",
+//   },
+//   {
+//     value: "1",
+//     label: "请假",
+//   },
+//   {
+//     value: "2",
+//     label: "迟到",
+//   },
+//   {
+//     value: "3",
+//     label: "超时打卡",
+//   },
+// ];
 // 时间筛选框绑定数组
 // 时间筛选框绑定数组
-const optionsTime = [
-  {
-    value: "0",
-    label: "今日",
-  },
-  {
-    value: "1",
-    label: "本周",
-  },
-  {
-    value: "2",
-    label: "本月",
-  },
-];
+// const optionsTime = [
+//   {
+//     value: "0",
+//     label: "今日",
+//   },
+//   {
+//     value: "1",
+//     label: "本周",
+//   },
+//   {
+//     value: "2",
+//     label: "本月",
+//   },
+// ];
 
 
 // 考勤记录表格数据
 // 考勤记录表格数据
-const tableData = [
-  {
-    class: "七(15)班",
-    type: "123",
-    leave: "13",
-    timeout: "45",
-    late: "123",
-    not: "41",
-    normal: "246",
-  },
-  {
-    class: "七(5)班",
-    type: "123",
-    leave: "13",
-    timeout: "45",
-    late: "123",
-    not: "41",
-    normal: "246",
-  },
-  {
-    class: "七(5)班",
-    type: "123",
-    leave: "13",
-    timeout: "45",
-    late: "123",
-    not: "41",
-    normal: "246",
-  },
-  {
-    class: "七(5)班",
-    type: "123",
-    leave: "13",
-    timeout: "45",
-    late: "123",
-    not: "41",
-    normal: "246",
-  },
-  {
-    class: "七(5)班",
-    type: "123",
-    leave: "13",
-    timeout: "45",
-    late: "123",
-    not: "41",
-    normal: "246",
-  },
-  {
-    class: "七(5)班",
-    type: "123",
-    leave: "13",
-    timeout: "45",
-    late: "123",
-    not: "41",
-    normal: "246",
-  },
-  {
-    class: "七(5)班",
-    type: "123",
-    leave: "13",
-    timeout: "45",
-    late: "123",
-    not: "41",
-    normal: "246",
-  },
-  {
-    class: "七(5)班",
-    type: "123",
-    leave: "13",
-    timeout: "45",
-    late: "123",
-    not: "41",
-    normal: "246",
-  },
-];
+const tableData = ref<any>([]);
 
 
 onMounted(() => {
 onMounted(() => {
-  getCountUpNum();
+  // 学生考勤统计
+  getStudentCheckin();
+  // 考勤记录列表数据
+  getCheckList();
 });
 });
 
 
+// 学生考勤统计
+const getStudentCheckin = async () => {
+  const res = await reqGetStudentCheckin({
+    dateTime: currentTimeRang.value,
+  });
+  // console.log(res);
+  if ((res as any).code == 200) {
+    const result = JSON.parse(decryptDes(res.data));
+    // console.log(result);
+
+    statValue.value = result.punctuality;
+    statValue2.value = result.askForLeave;
+    statValue3.value = result.beLate;
+    statValue4.value = result.clockOut;
+    statValue5.value = result.notClockingIn;
+
+    // 让数字跳动
+    getCountUpNum();
+  }
+};
+
+// 考勤记录列表数据
+const getCheckList = async () => {
+  const res = await reqGetCheckList({
+    dateTime: currentTimeRang_check.value,
+    currentPage: currentPage.value,
+    pageCount: pageSize.value,
+    className: keyWord.value,
+  });
+  // console.log(res);
+  if ((res as any).code == 200) {
+    const result = JSON.parse(decryptDes(res.data));
+    // console.log(result);
+    tableData.value = result.records;
+    total.value = result.total;
+  }
+};
+
 // 学生教师考勤切换按钮回调
 // 学生教师考勤切换按钮回调
 const handleChange = (value: number) => {
 const handleChange = (value: number) => {
   if (currentIndex.value !== value) {
   if (currentIndex.value !== value) {
-    if (value === 0) {
-      currentIndex.value = 0;
-    } else if (value === 1) {
-      currentIndex.value = 1;
-    }
+    currentIndex.value = value;
   }
   }
 };
 };
 
 
 // 考勤统计切换时间范围按钮回调
 // 考勤统计切换时间范围按钮回调
 const changeTimeRang = (value: number) => {
 const changeTimeRang = (value: number) => {
   if (currentTimeRang.value !== value) {
   if (currentTimeRang.value !== value) {
-    if (value === 0) {
-      currentTimeRang.value = 0;
-    } else if (value === 1) {
-      currentTimeRang.value = 1;
-    } else if (value === 2) {
-      currentTimeRang.value = 2;
-    }
+    currentTimeRang.value = value;
+    getStudentCheckin();
+  }
+};
+
+// 考勤记录切换时间范围按钮回调
+const changeTimeRang_check = (value: number) => {
+  if (currentTimeRang_check.value !== value) {
+    currentTimeRang_check.value = value;
+    tableData.value = [];
+    currentPage.value = 1;
+    getCheckList();
   }
   }
 };
 };
 
 
 // 改变分页器当前页时的回调
 // 改变分页器当前页时的回调
 const handleCurrentChange = (value: number) => {
 const handleCurrentChange = (value: number) => {
-  console.log(value);
+  tableData.value = [];
+  currentPage.value = value;
+  getCheckList();
 };
 };
 
 
 // 查询按钮回调
 // 查询按钮回调
 const handleSerch = () => {
 const handleSerch = () => {
-  console.log(111);
+  tableData.value = [];
+  currentPage.value = 1;
+  getCheckList();
 };
 };
 
 
 const getCountUpNum = () => {
 const getCountUpNum = () => {
@@ -549,6 +562,33 @@ const getCountUpNum = () => {
         margin-top: 20px;
         margin-top: 20px;
         height: 32px;
         height: 32px;
         font-size: 14px;
         font-size: 14px;
+
+        .select_change {
+          display: flex;
+          justify-content: space-between;
+          margin: 22px 0 22px 195px;
+          padding: 2px;
+          width: 200px;
+          height: 32px;
+          font-size: 14px;
+          border-radius: 2px;
+          border: 1px solid #9c9c9c;
+
+          .select_box {
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            width: 61px;
+            border-radius: 2px;
+            background-color: rgba(114, 151, 179, 0.3);
+            cursor: pointer;
+          }
+
+          .active {
+            border: 1px solid #70b7fa;
+            background-color: rgba(114, 151, 179, 1);
+          }
+        }
       }
       }
 
 
       .record_form {
       .record_form {

+ 6 - 6
src/components/user/userRight.vue

@@ -49,7 +49,7 @@
         </el-table>
         </el-table>
       </div>
       </div>
       <!-- 教师汇总区域 -->
       <!-- 教师汇总区域 -->
-      <div class="sub_title">
+      <!-- <div class="sub_title">
         <div>
         <div>
           教师汇总
           教师汇总
           <span
           <span
@@ -58,9 +58,9 @@
           >
           >
         </div>
         </div>
         <div class="more" @click="handleClickMore(1)">查看更多 ></div>
         <div class="more" @click="handleClickMore(1)">查看更多 ></div>
-      </div>
+      </div> -->
       <!-- 教师汇总表格区域 -->
       <!-- 教师汇总表格区域 -->
-      <div class="teacher form">
+      <!-- <div class="teacher form">
         <el-table :data="tableDataTeacher">
         <el-table :data="tableDataTeacher">
           <el-table-column
           <el-table-column
             prop="name"
             prop="name"
@@ -82,7 +82,7 @@
             </template>
             </template>
           </el-table-column>
           </el-table-column>
         </el-table>
         </el-table>
-      </div>
+      </div> -->
     </div>
     </div>
 
 
     <!-- 查看更多弹窗区域 -->
     <!-- 查看更多弹窗区域 -->
@@ -202,7 +202,7 @@ onMounted(() => {
 const getStudentInfo = async () => {
 const getStudentInfo = async () => {
   const res = await reqGetUserInfo({
   const res = await reqGetUserInfo({
     currentPage: 1,
     currentPage: 1,
-    pageCount: 8,
+    pageCount: 18,
     identityId: 2,
     identityId: 2,
   });
   });
   // console.log(res);
   // console.log(res);
@@ -355,7 +355,7 @@ const clickPopCheck = (row: any) => {
 
 
     .student {
     .student {
       margin: 22px 0;
       margin: 22px 0;
-      height: 360px;
+      height: 800px;
       overflow: hidden;
       overflow: hidden;
 
 
       .check {
       .check {

+ 10 - 3
src/router/index.ts

@@ -1,4 +1,6 @@
 import { createRouter, createWebHistory } from "vue-router";
 import { createRouter, createWebHistory } from "vue-router";
+//@ts-ignore
+import { handleVerifyToken } from "@/utils/verifyToken.ts";
 
 
 const router = createRouter({
 const router = createRouter({
   history: createWebHistory(import.meta.env.BASE_URL),
   history: createWebHistory(import.meta.env.BASE_URL),
@@ -52,16 +54,21 @@ const router = createRouter({
 const whiteList = ["/", "/404"];
 const whiteList = ["/", "/404"];
 
 
 // 路由全局前置守卫
 // 路由全局前置守卫
-router.beforeEach((to, from, next) => {
+router.beforeEach(async (to, from, next) => {
   // 判断是否为白名单页面
   // 判断是否为白名单页面
   if (whiteList.includes(to.path)) {
   if (whiteList.includes(to.path)) {
     // 白名单页面直接放行
     // 白名单页面直接放行
     next();
     next();
   } else {
   } else {
-    const token = localStorage.getItem("WANZAI-TOKEN");
+    const token = sessionStorage.getItem("WANZAI-TOKEN");
     // console.log(token);
     // console.log(token);
     if (token) {
     if (token) {
-      next();
+      let flag = await handleVerifyToken(token);
+      if (flag) {
+        next();
+      } else {
+        next("/404");
+      }
     } else {
     } else {
       next("/404");
       next("/404");
     }
     }

+ 2 - 0
src/utils/countUpNum.js

@@ -6,6 +6,8 @@ export const countUpNum = (dom, value, decimalPlaces = 0, durations = 2) => {
     decimalPlaces,
     decimalPlaces,
     // 持续时间
     // 持续时间
     durations,
     durations,
+    // 是否显示千位分隔符
+    useGrouping: false,
   };
   };
   new CountUp(dom, value, options).start();
   new CountUp(dom, value, options).start();
 };
 };

+ 9 - 1
src/utils/request.ts

@@ -11,6 +11,12 @@ let request = axios.create({
 
 
 //请求拦截器
 //请求拦截器
 request.interceptors.request.use((config) => {
 request.interceptors.request.use((config) => {
+  let token = sessionStorage.getItem("WANZAI-TOKEN");
+  if (token) {
+    config.headers.token = token;
+    config.headers.user_head = 1;
+  }
+
   //获取用户相关的小仓库:获取仓库内部token,登录成功以后携带给服务器
   //获取用户相关的小仓库:获取仓库内部token,登录成功以后携带给服务器
   // const userStore = useUserStore()
   // const userStore = useUserStore()
   // if (userStore.token) {
   // if (userStore.token) {
@@ -27,9 +33,11 @@ request.interceptors.response.use(
     return response.data;
     return response.data;
   },
   },
   (error) => {
   (error) => {
+    // console.log(error);
+
     //处理网络错误
     //处理网络错误
     let msg = "";
     let msg = "";
-    let status = error.response.status;
+    let status = error.response.status || "";
     switch (status) {
     switch (status) {
       case 401:
       case 401:
         msg = "token过期";
         msg = "token过期";

+ 8 - 3
src/utils/verifyToken.ts

@@ -1,8 +1,13 @@
 import { reqVerifyToken } from "@/api/token/index";
 import { reqVerifyToken } from "@/api/token/index";
 
 
 export const handleVerifyToken = async (value: string) => {
 export const handleVerifyToken = async (value: string) => {
-  const res = await reqVerifyToken(value);
+  const res = await reqVerifyToken({
+    token: value,
+  });
   // console.log(res);
   // console.log(res);
-
-  return 1;
+  if ((res as any).code == 200) {
+    return true;
+  } else {
+    return false;
+  }
 };
 };

+ 19 - 6
src/views/school.vue

@@ -25,15 +25,18 @@ const $router = useRouter();
 const isShow = ref(false);
 const isShow = ref(false);
 
 
 onMounted(() => {
 onMounted(() => {
-  // 获取token
-  getToken();
+  let token = sessionStorage.getItem("WANZAI-TOKEN");
 
 
-  // let a = handleVerifyToken("123");
-  // console.log(a);
+  if (token) {
+    handleVerify(token);
+  } else {
+    // 获取token
+    getToken();
+  }
 });
 });
 
 
 // 获取token
 // 获取token
-const getToken = () => {
+const getToken = async () => {
   let token = getQueryString("token");
   let token = getQueryString("token");
   // console.log(token);
   // console.log(token);
 
 
@@ -41,8 +44,18 @@ const getToken = () => {
   if (!token) {
   if (!token) {
     $router.push("404");
     $router.push("404");
   } else {
   } else {
-    localStorage.setItem("WANZAI-TOKEN", token);
+    handleVerify(token);
+  }
+};
+
+const handleVerify = async (token: string) => {
+  let flag = await handleVerifyToken(token);
+  // console.log(flag);
+  if (flag) {
+    sessionStorage.setItem("WANZAI-TOKEN", token);
     isShow.value = true;
     isShow.value = true;
+  } else {
+    $router.push("404");
   }
   }
 };
 };
 </script>
 </script>