Prechádzať zdrojové kódy

新增统计报表界面,一些界面接口调整

hzj18279462576@163.com 1 rok pred
rodič
commit
b0add4852c

BIN
src/assets/jinghui.png


+ 455 - 152
src/layout/sidebar/SidevarItem.vue

@@ -132,7 +132,7 @@
           <span>{{ item.meta.title }}</span>
         </el-menu-item>
         <!-- 在校统计 -->
-        <el-menu-item
+        <!-- <el-menu-item
           :index="`/wanzai/${item.name}`"
           v-if="item.name == 'statistic'"
         >
@@ -143,7 +143,29 @@
           ></svg-icon>
           <svg-icon v-else iconName="statistic" class="iconClass"></svg-icon>
           <span>{{ item.meta.title }}</span>
-        </el-menu-item>
+        </el-menu-item> -->
+
+        <!-- 在校统计 -->
+        <el-sub-menu :index="item.name" v-if="item.name == 'statistics'">
+          <template #title>
+            <svg-icon
+              v-if="
+                activeIndex == '/wanzai/statistic' ||
+                activeIndex == '/wanzai/statement'
+              "
+              iconName="statistic_s"
+              class="iconClass"
+            ></svg-icon>
+            <svg-icon v-else iconName="statistic" class="iconClass"></svg-icon>
+            <span>{{ item.meta.title }}</span>
+          </template>
+          <el-menu-item v-for="i in item.children" :index="`/wanzai/${i.name}`">
+            <template #title>
+              <span>{{ i.meta.title }}</span>
+            </template>
+          </el-menu-item>
+        </el-sub-menu>
+
         <!-- 访客预约 -->
         <el-menu-item
           :index="`/wanzai/${item.name}`"
@@ -340,195 +362,476 @@ const roleListChange = async () => {
       sessionStorage.setItem("roleList", JSON.stringify(roleList));
       store.commit("ROLELIST", "");
       console.log("能监听到", roleList.value);
+      // {
+      //   let classArr = [];
+      //   let trackArr = [];
+      //   let evaluateArr = [];
+      //   let dataExchangeArr = [];
+      //   let systemArr = [];
+      //   let arr = [];
+      //   roleList.value.forEach((item) => {
+      //     if (
+      //       item.routeName == "class" ||
+      //       item.routeName == "grades" ||
+      //       item.routeName == "post" ||
+      //       item.routeName == "subject" ||
+      //       item.routeName == "semester" ||
+      //       item.routeName == "exam"
+      //     ) {
+      //       classArr.push({
+      //         name: item.routeName,
+      //         meta: { isAuth: true, title: item.name },
+      //       });
+      //     } else if (
+      //       item.routeName == "trackSearch" ||
+      //       item.routeName == "trafficRecord" ||
+      //       item.routeName == "attendanceRecord" ||
+      //       item.routeName == "faceRecord"
+      //     ) {
+      //       trackArr.push({
+      //         name: item.routeName,
+      //         meta: { isAuth: true, title: item.name },
+      //       });
+      //     } else if (
+      //       item.routeName == "teacher" ||
+      //       item.routeName == "student" ||
+      //       item.routeName == "grade"
+      //     ) {
+      //       evaluateArr.push({
+      //         name: item.routeName,
+      //         meta: { isAuth: true, title: item.name },
+      //       });
+      //     } else if (
+      //       item.routeName == "source" ||
+      //       item.routeName == "task" ||
+      //       item.routeName == "log"
+      //     ) {
+      //       dataExchangeArr.push({
+      //         name: item.routeName,
+      //         meta: { isAuth: true, title: item.name },
+      //       });
+      //     } else if (
+      //       item.routeName == "info" ||
+      //       item.routeName == "screenShot" ||
+      //       item.routeName == "roles"
+      //     ) {
+      //       systemArr.push({
+      //         name: item.routeName,
+      //         meta: { isAuth: true, title: item.name },
+      //       });
+      //     } else {
+      //       arr.push({
+      //         name: item.routeName,
+      //         meta: { isAuth: true, title: item.name },
+      //       });
+      //     }
+      //   });
+
+      //   if (classArr.length != 0) {
+      //     // arr.splice(3, 0, {
+      //     //   name: "classGrade",
+      //     //   meta: { isAuth: true, title: "年级管理" },
+      //     //   children: classArr,
+      //     // });
+      //     arr.push({
+      //       name: "classGrade",
+      //       meta: { isAuth: true, title: "类型管理" },
+      //       children: classArr,
+      //     });
+      //   }
+      //   if (trackArr.length != 0) {
+      //     // arr.splice(9, 0, {
+      //     //   name: "track",
+      //     //   meta: { isAuth: true, title: "轨迹管理" },
+      //     //   children: trackArr,
+      //     // });
+      //     arr.push({
+      //       name: "track",
+      //       meta: { isAuth: true, title: "轨迹管理" },
+      //       children: trackArr,
+      //     });
+      //   }
+      //   if (evaluateArr.length != 0) {
+      //     arr.push({
+      //       name: "evaluate",
+      //       meta: { isAuth: true, title: "综合素质评价" },
+      //       children: evaluateArr,
+      //     });
+      //   }
+      //   if (dataExchangeArr.length != 0) {
+      //     arr.push({
+      //       name: "dataExchange",
+      //       meta: { isAuth: true, title: "数据交换" },
+      //       children: dataExchangeArr,
+      //     });
+      //   }
+      //   if (systemArr.length != 0) {
+      //     arr.push({
+      //       name: "system",
+      //       meta: { isAuth: true, title: "系统设置" },
+      //       children: systemArr,
+      //     });
+      //   }
+      //   let roleArr = [];
+      //   for (let i = 0; i <= 13; i++) {
+      //     let obj = {
+      //       name: "",
+      //       mate: {},
+      //     };
+      //     roleArr.push(obj);
+      //   }
+      //   arr.forEach((i, index) => {
+      //     // console.log(i);
+      //     // 首页
+      //     if (i.name == "systemHome") {
+      //       // roleArr.push(i);
+      //       roleArr[0] = i;
+      //     }
+      //     // 用户管理
+      //     if (i.name == "user") {
+      //       // roleArr.push(i);
+      //       roleArr[1] = i;
+      //     }
+      //     // 身份管理
+      //     if (i.name == "identity") {
+      //       // roleArr.push(i);
+      //       roleArr[2] = i;
+      //     }
+      //     // 年级管理
+      //     if (i.name == "classGrade") {
+      //       // roleArr.push(i);
+      //       roleArr[3] = i;
+      //     }
+      //     // 应用管理
+      //     if (i.name == "apply") {
+      //       // roleArr.push(i);
+      //       roleArr[4] = i;
+      //     }
+      //     // 能耗管理
+      //     if (i.name == "energy") {
+      //       // roleArr.push(i);
+      //       roleArr[5] = i;
+      //     }
+      //     // 请假管理
+      //     if (i.name == "leave") {
+      //       // roleArr.push(i);
+      //       roleArr[6] = i;
+      //     }
+      //     // 在校统计
+      //     if (i.name == "statistic") {
+      //       // roleArr.push(i);
+      //       roleArr[7] = i;
+      //     }
+      //     // 访客预约
+      //     if (i.name == "caller") {
+      //       // roleArr.push(i);
+      //       roleArr[8] = i;
+      //     }
+      //     // 校园安全
+      //     if (i.name == "safety") {
+      //       // roleArr.push(i);
+      //       roleArr[9] = i;
+      //     }
+      //     // 轨迹管理
+      //     if (i.name == "track") {
+      //       // roleArr.push(i);
+      //       roleArr[10] = i;
+      //     }
+      //     // 综合素质评价
+      //     if (i.name == "evaluate") {
+      //       // roleArr.push(i);
+      //       roleArr[11] = i;
+      //     }
+      //     // 数据交换
+      //     if (i.name == "dataExchange") {
+      //       // roleArr.push(i);
+      //       roleArr[12] = i;
+      //     }
+      //     // 系统设置
+      //     if (i.name == "system") {
+      //       // roleArr.push(i);
+      //       roleArr[13] = i;
+      //     }
+      //   });
+      //   console.log(roleArr, "排序后的菜单栏");
+      //   roles.value = roleArr;
+      // }
       {
-        let classArr = [];
-        let trackArr = [];
-        let evaluateArr = [];
-        let dataExchangeArr = [];
-        let systemArr = [];
-        let arr = [];
-        roleList.value.forEach((item) => {
-          if (
-            item.routeName == "class" ||
-            item.routeName == "grades" ||
-            item.routeName == "post" ||
-            item.routeName == "subject" ||
-            item.routeName == "semester" ||
-            item.routeName == "exam"
-          ) {
-            classArr.push({
-              name: item.routeName,
-              meta: { isAuth: true, title: item.name },
+        let roleArr = [];
+        roleList.value.forEach((i) => {
+          // 系统首页
+          if (i.routeName == "systemHome") {
+            roleArr.push({
+              name: "systemHome",
+              meta: { isAuth: true, title: "系统首页"},
+            });
+          }
+          // 用户管理
+          else if (i.routeName == "user") {
+            roleArr.push({
+              name: "user",
+              meta: { isAuth: true, title: "用户管理", sign: "user" },
+            });
+          }
+          // 身份管理
+          else if (i.routeName == "identity") {
+            roleArr.push({
+              name: "identity",
+              meta: { isAuth: true, title: "身份管理", sign: "identity" },
             });
-          } else if (
-            item.routeName == "trackSearch" ||
-            item.routeName == "trafficRecord" ||
-            item.routeName == "attendanceRecord" ||
-            item.routeName == "faceRecord"
+          }
+          // 类型管理
+          else if (
+            i.routeName == "class" ||
+            i.routeName == "grades" ||
+            i.routeName == "post" ||
+            i.routeName == "subject" ||
+            i.routeName == "semester" ||
+            i.routeName == "exam"
           ) {
-            trackArr.push({
-              name: item.routeName,
-              meta: { isAuth: true, title: item.name },
+            let flag = roleArr.some((item) => {
+              return item.name == "classGrade";
             });
-          } else if (
-            item.routeName == "teacher" ||
-            item.routeName == "student" ||
-            item.routeName == "grade"
+            if (!flag) {
+              roleArr.push({
+                name: "classGrade",
+                meta: { isAuth: true, title: "类型管理" },
+                children: [],
+              });
+            }
+          }
+          // 应用管理
+          else if (i.routeName == "apply") {
+            roleArr.push({
+              name: "apply",
+              meta: { isAuth: true, title: "应用管理", sign: "apply" },
+            });
+          }
+          // 能耗管理
+          else if (i.routeName == "energy") {
+            roleArr.push({
+              name: "energy",
+              meta: { isAuth: true, title: "能耗管理", sign: "energy" },
+            });
+          }
+          // 请假管理
+          else if (i.routeName == "leave") {
+            roleArr.push({
+              name: "leave",
+              meta: { isAuth: true, title: "请假管理", sign: "leave" },
+            });
+          }
+          // 在校统计
+          else if (i.routeName == "statistic" || i.routeName == "statement") {
+            let flag = roleArr.some((item) => {
+              return item.name == "statistics";
+            });
+            if (!flag) {
+              roleArr.push({
+                name: "statistics",
+                meta: { isAuth: true, title: "在校统计" },
+                children: [],
+              });
+            }
+          }
+          // 访客预约
+          else if (i.routeName == "caller") {
+            roleArr.push({
+              name: "caller",
+              meta: { isAuth: true, title: "访客预约", sign: "caller" },
+            });
+          }
+          // 校园安全
+          else if (i.routeName == "safety") {
+            roleArr.push({
+              name: "safety",
+              meta: { isAuth: true, title: "校园安全", sign: "safety" },
+            });
+          }
+          // 轨迹管理
+          else if (
+            i.routeName == "trackSearch" ||
+            i.routeName == "trafficRecord" ||
+            i.routeName == "attendanceRecord" ||
+            i.routeName == "faceRecord"
           ) {
-            evaluateArr.push({
-              name: item.routeName,
-              meta: { isAuth: true, title: item.name },
+            let flag = roleArr.some((item) => {
+              return item.name == "track";
             });
-          } else if (
-            item.routeName == "source" ||
-            item.routeName == "task" ||
-            item.routeName == "log"
+            if (!flag) {
+              roleArr.push({
+                name: "track",
+                meta: { isAuth: true, title: "轨迹管理" },
+                children: [],
+              });
+            }
+          }
+          // 综合素质评价
+          else if (
+            i.routeName == "teacher" ||
+            i.routeName == "student" ||
+            i.routeName == "grade"
           ) {
-            dataExchangeArr.push({
-              name: item.routeName,
-              meta: { isAuth: true, title: item.name },
+            let flag = roleArr.some((item) => {
+              return item.name == "evaluate";
             });
-          } else if (
-            item.routeName == "info" ||
-            item.routeName == "screenShot" ||
-            item.routeName == "roles"
+            if (!flag) {
+              roleArr.push({
+                name: "evaluate",
+                meta: { isAuth: true, title: "综合素质评价" },
+                children: [],
+              });
+            }
+          }
+          // 数据交换
+          else if (
+            i.routeName == "source" ||
+            i.routeName == "task" ||
+            i.routeName == "log"
           ) {
-            systemArr.push({
-              name: item.routeName,
-              meta: { isAuth: true, title: item.name },
+            let flag = roleArr.some((item) => {
+              return item.name == "dataExchange";
             });
-          } else {
-            arr.push({
-              name: item.routeName,
-              meta: { isAuth: true, title: item.name },
+            if (!flag) {
+              roleArr.push({
+                name: "dataExchange",
+                meta: { isAuth: true, title: "数据交换" },
+                children: [],
+              });
+            }
+          }
+          // 系统设置
+          else if (
+            i.routeName == "info" ||
+            i.routeName == "screenShot" ||
+            i.routeName == "roles"
+          ) {
+            let flag = roleArr.some((item) => {
+              return item.name == "system";
             });
+            if (!flag) {
+              roleArr.push({
+                name: "system",
+                meta: { isAuth: true, title: "系统设置" },
+                children: [],
+              });
+            }
           }
         });
-
-        if (classArr.length != 0) {
-          // arr.splice(3, 0, {
-          //   name: "classGrade",
-          //   meta: { isAuth: true, title: "年级管理" },
-          //   children: classArr,
-          // });
-          arr.push({
-            name: "classGrade",
-            meta: { isAuth: true, title: "类型管理" },
-            children: classArr,
-          });
-        }
-        if (trackArr.length != 0) {
-          // arr.splice(9, 0, {
-          //   name: "track",
-          //   meta: { isAuth: true, title: "轨迹管理" },
-          //   children: trackArr,
-          // });
-          arr.push({
-            name: "track",
-            meta: { isAuth: true, title: "轨迹管理" },
-            children: trackArr,
-          });
-        }
-        if (evaluateArr.length != 0) {
-          arr.push({
-            name: "evaluate",
-            meta: { isAuth: true, title: "综合素质评价" },
-            children: evaluateArr,
-          });
-        }
-        if (dataExchangeArr.length != 0) {
-          arr.push({
-            name: "dataExchange",
-            meta: { isAuth: true, title: "数据交换" },
-            children: dataExchangeArr,
-          });
-        }
-        if (systemArr.length != 0) {
-          arr.push({
-            name: "system",
-            meta: { isAuth: true, title: "系统设置" },
-            children: systemArr,
-          });
-        }
-        let roleArr = [];
-        for (let i = 0; i <= 13; i++) {
-          let obj = {
-            name: "",
-            mate: {},
-          };
-          roleArr.push(obj);
-        }
-        arr.forEach((i, index) => {
-          // console.log(i);
+        roleList.value.forEach((i, index) => {
           // 首页
-          if (i.name == "systemHome") {
-            // roleArr.push(i);
-            roleArr[0] = i;
+          if (i.routeName == "systemHome") {
           }
           // 用户管理
-          if (i.name == "user") {
-            // roleArr.push(i);
-            roleArr[1] = i;
+          if (i.routeName == "user") {
           }
           // 身份管理
-          if (i.name == "identity") {
-            // roleArr.push(i);
-            roleArr[2] = i;
+          if (i.routeName == "identity") {
           }
-          // 年级管理
-          if (i.name == "classGrade") {
-            // roleArr.push(i);
-            roleArr[3] = i;
+          // 类型管理
+          if (
+            i.routeName == "class" ||
+            i.routeName == "grades" ||
+            i.routeName == "post" ||
+            i.routeName == "subject" ||
+            i.routeName == "semester" ||
+            i.routeName == "exam"
+          ) {
+            roleArr.forEach((item) => {
+              if (item.name == "classGrade") {
+                item.children.push({
+                  name: i.routeName,
+                  meta: { isAuth: true, title: i.name },
+                });
+              }
+            });
           }
           // 应用管理
-          if (i.name == "apply") {
-            // roleArr.push(i);
-            roleArr[4] = i;
+          if (i.routeName == "apply") {
           }
           // 能耗管理
-          if (i.name == "energy") {
-            // roleArr.push(i);
-            roleArr[5] = i;
+          if (i.routeName == "energy") {
           }
           // 请假管理
-          if (i.name == "leave") {
-            // roleArr.push(i);
-            roleArr[6] = i;
+          if (i.routeName == "leave") {
           }
           // 在校统计
-          if (i.name == "statistic") {
-            // roleArr.push(i);
-            roleArr[7] = i;
+          if (i.routeName == "statistic" || i.routeName == "statement") {
+            roleArr.forEach((item) => {
+              if (item.name == "statistics") {
+                item.children.push({
+                  name: i.routeName,
+                  meta: { isAuth: true, title: i.name },
+                });
+              }
+            });
           }
           // 访客预约
-          if (i.name == "caller") {
-            // roleArr.push(i);
-            roleArr[8] = i;
+          if (i.routeName == "caller") {
           }
           // 校园安全
-          if (i.name == "safety") {
-            // roleArr.push(i);
-            roleArr[9] = i;
+          if (i.routeName == "safety") {
           }
           // 轨迹管理
-          if (i.name == "track") {
-            // roleArr.push(i);
-            roleArr[10] = i;
+          if (
+            i.routeName == "trackSearch" ||
+            i.routeName == "trafficRecord" ||
+            i.routeName == "attendanceRecord" ||
+            i.routeName == "faceRecord"
+          ) {
+            roleArr.forEach((item) => {
+              if (item.name == "track") {
+                item.children.push({
+                  name: i.routeName,
+                  meta: { isAuth: true, title: i.name },
+                });
+              }
+            });
           }
           // 综合素质评价
-          if (i.name == "evaluate") {
-            // roleArr.push(i);
-            roleArr[11] = i;
+          if (
+            i.routeName == "teacher" ||
+            i.routeName == "student" ||
+            i.routeName == "grade"
+          ) {
+            roleArr.forEach((item) => {
+              if (item.name == "evaluate") {
+                item.children.push({
+                  name: i.routeName,
+                  meta: { isAuth: true, title: i.name },
+                });
+              }
+            });
           }
           // 数据交换
-          if (i.name == "dataExchange") {
-            // roleArr.push(i);
-            roleArr[12] = i;
+          if (
+            i.routeName == "source" ||
+            i.routeName == "task" ||
+            i.routeName == "log"
+          ) {
+            roleArr.forEach((item) => {
+              if (item.name == "dataExchange") {
+                item.children.push({
+                  name: i.routeName,
+                  meta: { isAuth: true, title: i.name },
+                });
+              }
+            });
           }
           // 系统设置
-          if (i.name == "system") {
-            // roleArr.push(i);
-            roleArr[13] = i;
+          if (
+            i.routeName == "info" ||
+            i.routeName == "screenShot" ||
+            i.routeName == "roles"
+          ) {
+            roleArr.forEach((item) => {
+              if (item.name == "system") {
+                item.children.push({
+                  name: i.routeName,
+                  meta: { isAuth: true, title: i.name },
+                });
+              }
+            });
           }
         });
         console.log(roleArr, "排序后的菜单栏");

+ 4 - 5
src/router/index.js

@@ -17,7 +17,6 @@ const routes = [
     path: "/",
     redirect: "/login",
   },
-
   {
     path: "/wanzai",
     name: "wanzai",
@@ -30,10 +29,10 @@ const routes = [
         component: () => import("@/views/home/home.vue"),
       },
       // {
-      //   path: "user",
-      //   name: "user",
-      //   meta: { isAuth: true, title: "用户管理" },
-      //   component: () => import("@/views/user/user.vue"),
+      //   path: "statement",
+      //   name: "statement",
+      //   meta: { isAuth: true, title: "统计报表" },
+      //   component: () => import("@/views/statement/statement.vue"),
       // },
       // {
       //   path: "identity",

+ 4 - 0
src/store/modules/user.js

@@ -295,6 +295,10 @@ const state = {
       },
     ],
   },
+
+  classId:'',// 统计报表中 跳转 在线统计 所传参数
+  gradeId:'',// 统计报表中 跳转 在线统计 所传参数
+  dateTime:'',// 统计报表中 跳转 在线统计 所传参数
 };
 
 // 修改变量(state不能直接赋值修改,只能通过mutations)

+ 11 - 6
src/views/apply/apply.vue

@@ -133,8 +133,8 @@
             >
               <el-option label="管理后台" value="管理后台" />
               <el-option label="移动端H5" value="移动端H5" />
-              <el-option label="小程序" value="小程序" />
-              <el-option label="其他小程序" value="其他小程序" />
+              <el-option label="默认小程序" value="默认小程序" />
+              <el-option label="自建小程序" value="自建小程序" />
             </el-select>
           </el-form-item>
           <el-form-item label="logo图标 :" prop="logoUrl">
@@ -192,7 +192,7 @@
           </el-form-item>
           <el-form-item
             v-if="
-              editRuleForm.type == '小程序' || editRuleForm.type == '其他小程序'
+              editRuleForm.type == '默认小程序' || editRuleForm.type == '自建小程序'
             "
             label="APPID :"
             prop="appid"
@@ -202,12 +202,13 @@
               placeholder="请输入APPID"
               clearable
               style="width: 500px"
+              :disabled="editRuleForm.id?true:false"
             />
           </el-form-item>
           <el-form-item
             v-if="
-              editRuleForm.type == '小程序' ||
-              editRuleForm.type == '其他小程序' ||
+              editRuleForm.type == '默认小程序' ||
+              editRuleForm.type == '自建小程序' ||
               editRuleForm.type == '移动端H5'
             "
             :label="editRuleForm.type == '移动端H5' ? '应用链接' : '路径'"
@@ -218,6 +219,7 @@
               placeholder="请输入路径"
               clearable
               style="width: 500px"
+              :disabled="editRuleForm.id?true:false"
             />
           </el-form-item>
           <el-form-item label="应用简介 :" prop="content">
@@ -333,7 +335,7 @@ const editRuleForm = reactive({
   content: "", // 应用简介
   switch: 2, // 是否置顶
 
-  appId: "", //
+  appid: "", //
   route: "", // 路径
 
   id: "",
@@ -545,6 +547,7 @@ const confirmEdit = (formEl) => {
 const typeSel = () => {
   editRuleForm.applyLink = "";
   editRuleForm.route = "";
+  editRuleForm.appid=""
   editRuleForm.switch = 2;
   // editRuleForm.id = "";
 };
@@ -674,6 +677,8 @@ const handleExceed = (files) => {
 
 //编辑按钮  (-------------------------------------------)
 const editClick = async (row) => {
+  console.log(row,'编辑');
+  
   titleDialog.value = "编辑应用";
   editVisible.value = true;
   editRuleForm.name = row.name;

+ 1 - 1
src/views/energy/energy.vue

@@ -152,7 +152,7 @@
               <el-table-column align="center" prop="buildAddress" label="楼栋" />
               <el-table-column align="center" prop="address" label="位置" />
               <el-table-column align="center" prop="meterPower" :label="table2Type==0?'水(吨)':'电(度)'" />
-              <el-table-column align="center" prop="meterNo" label="表号" />
+              <el-table-column align="center" prop="meterNo" width="130" label="表号" />
               <el-table-column align="center" prop="createTime" width="190" label="通讯时间" />
             </el-table>
             <!-- 分页组件 -->

+ 6 - 3
src/views/login/index.vue

@@ -54,14 +54,16 @@
       </div>
     </div>
     <div class="footer">
+      <img src="@/assets/jinghui.png" alt="">
+      &nbsp;
       <a
         target="_blank"
         href="https://beian.mps.gov.cn/#/query/webSearch?recordcode=36010602000314"
         >赣公网安备36010602000314号</a
-      >&nbsp;&nbsp;&nbsp;&nbsp;
+      >&nbsp;&nbsp;&nbsp;
       <a
         target="_blank"
-        href="https://beian.mps.gov.cn/#/query/webSearch?recordcode=36010602000314"
+        href="https://beian.miit.gov.cn/"
         >赣ICP备17015482号-4</a
       >
     </div>
@@ -471,7 +473,7 @@ onUnmounted(() => {
 
   .content {
     width: 100%;
-    height: calc(100% - 130px);
+    height: calc(100% - 140px);
     // margin-top: 40px;
     display: flex;
     // justify-content: space-between;
@@ -749,6 +751,7 @@ onUnmounted(() => {
     font-size: 12px;
     a {
       color: #000;
+      font-size: 14px;
       text-decoration: none;
     }
   }

+ 777 - 0
src/views/statement/statement.vue

@@ -0,0 +1,777 @@
+<template>
+  <div class="content-box">
+    <div class="left">
+      <!-- <el-icon :size="23" class="camera"><VideoCameraFilled /></el-icon> -->
+      <span class="cameratxt">统计报表</span>
+    </div>
+    <div class="middle">
+      <div class="filter">
+        <!-- 时间 -->
+        <div class="condition">
+          <span class="title">日期 : </span>
+          <el-date-picker
+            v-model="searchInput.createTime"
+            type="datetime"
+            format="YYYY-MM-DD HH:mm:ss"
+            value-format="YYYY-MM-DD HH:mm:ss"
+            :prefix-icon="Calendar"
+            placeholder="请选择日期"
+            @change="searchBtn"
+            :clearable="false"
+          />
+          <el-button
+            type="primary"
+            class="import"
+            color="rgba(0, 97, 255, 1)"
+            plain
+            @click="importExcel"
+            >导出</el-button
+          >
+        </div>
+      </div>
+    </div>
+    <div class="scrollId" v-loading="loading">
+      <div class="datalist" v-for="i in resDatas">
+        <p>{{ i.gradeName }}</p>
+        <div class="item">
+          <table border="0">
+            <tr>
+              <td>{{ i.gradeName }}</td>
+              <td v-for="j in i.vos">
+                {{ j.className }}
+              </td>
+            </tr>
+            <tr>
+              <td>未监听</td>
+              <td v-for="j in i.vos">{{ j.abnormal }}</td>
+            </tr>
+            <tr>
+              <td>监听</td>
+              <td v-for="j in i.vos">{{ j.normal }}</td>
+            </tr>
+            <tr>
+              <td>请假</td>
+              <td v-for="j in i.vos">{{ j.ack }}</td>
+            </tr>
+          </table>
+        </div>
+      </div>
+
+      <!-- 分页组件 -->
+      <!-- <div class="pageSize">
+        <span></span>
+        <el-pagination
+          background
+          :current-page="currentPage"
+          :page-sizes="[10, 20, 50, 100]"
+          :page-size="pageSize"
+          layout="sizes,total, prev, pager, next, jumper, slot"
+          :total="total"
+          @update:page-size="handleSizeChange"
+          @update:current-page="handleCurrentChange"
+        />
+      </div> -->
+
+      <!-- 推送人设置 -->
+      <el-dialog
+        class="infoDialog"
+        v-model="infoVisible"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        :title="infoTitle"
+        align-center
+        width="650"
+        :before-close="infoCancel"
+      >
+        <div class="abnormal" v-if="statisticType == 1">
+          <div class="title">
+            <div class="square"></div>
+            <span class="studentInfo">学生信息</span>
+          </div>
+          <div class="infoCont">
+            <div v-viewer>
+              <img :src="abnormalData.student.headImage" alt="" />
+            </div>
+            <div class="phone">
+              <p>{{ abnormalData.student.name }}</p>
+              <span>学号:{{ abnormalData.student.cardNo }}</span>
+            </div>
+          </div>
+          <div class="title">
+            <div class="square"></div>
+            <span class="studentInfo">家长信息</span>
+          </div>
+          <div class="patriarchCont">
+            <span class="patriarch" v-for="i in abnormalData.patriarch"
+              >关系:{{ i.ship }}&nbsp;&nbsp; 姓名:{{ i.name }}&nbsp;&nbsp;
+              电话:{{ i.phone }}</span
+            >
+          </div>
+        </div>
+        <div class="trackInfo" v-if="statisticType == 2">
+          <el-timeline style="max-width: 600px">
+            <el-timeline-item
+              v-for="i in infoTable.list"
+              center
+              color="rgba(30, 125, 251, 1)"
+              :timestamp="`${i.type} ( ${i.dateTime} )`"
+              placement="top"
+            >
+              <el-card>
+                <h4>{{ i.location }}</h4>
+                <p>{{ i.name }}</p>
+                <div v-viewer v-if="i.image">
+                  <img :src="i.image" alt="" />
+                </div>
+              </el-card>
+            </el-timeline-item>
+          </el-timeline>
+        </div>
+        <div class="leaveInfo" v-if="statisticType == 3">
+          <div class="name"><span>请假人姓名:</span>{{ leaveData.name }}</div>
+          <div class="name"><span>学号:</span>{{ leaveData.cardNo }}</div>
+          <div class="name">
+            <span>请假时间:</span>{{ leaveData.leaveTime }}
+          </div>
+          <div class="name"><span>请假说明:</span>{{ leaveData.reason }}</div>
+          <div class="name">
+            <span>创建时间:</span>{{ leaveData.createTiem }}
+          </div>
+        </div>
+        <!-- <div class="options">
+          <el-button
+            color="rgba(41, 109, 227, 1)"
+            class="queding"
+            type="primary"
+            @click="editConfirm"
+          >
+            确认
+          </el-button>
+          <el-button @click="editCancel">取消</el-button>
+        </div> -->
+      </el-dialog>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import {
+  ref,
+  reactive,
+  watch,
+  nextTick,
+  onBeforeMount,
+  onUnmounted,
+} from "vue";
+import { useRouter } from "vue-router";
+import { ElMessage, ElMessageBox } from "element-plus";
+import { Calendar } from "@element-plus/icons-vue";
+import vidiconsApi from "@/api/vidicons.js";
+import { dayjs } from "element-plus";
+import eds from "@/utils/eds.js";
+import lodash from "lodash";
+import axios from "axios";
+import { useStore } from "vuex";
+const store = useStore();
+const api = ref("");
+const router = useRouter();
+// 表格数据
+const loading = ref(false);
+const classId = ref(); // 获取所管理的班级的id(0是所有班级)
+const resDatas = ref();
+const tableData = reactive({
+  list: [],
+});
+
+const searchInput = reactive({
+  createTime: dayjs().format("YYYY-MM-DD 00:00:00"), // 时间
+}); // 搜索按钮数据
+
+const currentPage = ref(1); // 当前页
+const pageSize = ref(20);
+const total = ref(3); // 当前总数
+
+// 获取成绩分页数据 (----------------------------------------------------------------)
+const getList = async () => {
+  loading.value = true;
+  let data = {
+    dateTime: searchInput.createTime, // 用户名称
+  };
+  let res = await axios({
+    method: "get",
+    url: api.value + "/wanzai/api/smartUser/statisticsStatementManag",
+    headers: {
+      token: sessionStorage.getItem("token"),
+      user_head: sessionStorage.getItem("userhead"),
+    },
+    params: data,
+  });
+  console.log(res, "在校统计数据");
+  // console.log(res, JSON.parse(eds.decryptDes(res.data.data)).list, "在校统计数据");
+  if (res.data.code == 200) {
+    // let resData = JSON.parse(eds.decryptDes(res.data.data)).list;
+    let resData = res.data.data.list;
+    resDatas.value = resData;
+    loading.value = false;
+  } else {
+    loading.value = false;
+    ElMessage({
+      type: "error",
+      showClose: true,
+      message: res.data.message,
+      center: true,
+    });
+  }
+};
+
+// 搜索功能
+const searchBtn = lodash.debounce(async () => {
+  getList();
+}, 300);
+// 跳转到在校统计页面
+const linkStatic = (row) => {
+  console.log(row);
+  store.state.user.classId=row.classId
+  store.state.user.gradeId=row.gradeId
+  store.state.user.dateTime=searchInput.createTime
+  router.push({
+    path: '/wanzai/statistic',
+  })
+};
+
+// 分页
+const subsectionCurrentChange = (value) => {
+  // console.log(value);
+  subsectionPage.value = value;
+};
+
+//导出功能 (-----------------------------------------------------------------)
+const importExcel = async () => {
+  let data = {
+    dateTime: searchInput.createTime,
+  };
+  let res = await axios({
+    method: "get",
+    url: api.value + "/wanzai/api/smartUser/statisticsStatementManagExport",
+    headers: {
+      token: sessionStorage.getItem("token"),
+      user_head: sessionStorage.getItem("userhead"),
+    },
+    params: data,
+    responseType: "blob",
+  });
+  console.log(res, "导出用户");
+  if (res.status == 200) {
+    let name = `统计报表`;
+    var content = res.data;
+    var datas = new Blob([content]);
+    var downloadUrl = window.URL.createObjectURL(datas);
+    var anchor = document.createElement("a");
+    anchor.href = downloadUrl;
+    anchor.download = name + ".xlsx";
+    anchor.click();
+    window.URL.revokeObjectURL(datas);
+    ElMessage({
+      type: "success",
+      showClose: true,
+      message: "导出成功",
+      center: true,
+    });
+  } else {
+    ElMessage({
+      type: "error",
+      showClose: true,
+      message: "导出失败",
+      center: true,
+    });
+  }
+};
+
+// 表格斑马纹颜色修改
+const tableRowClassName = ({ row, rowIndex }) => {
+  // if (rowIndex % 2 === 0) {
+  //   return "even";
+  // } else if (rowIndex % 2 !== 0) {
+  //   return "odd";
+  // }
+  // return "";
+};
+// 分页
+const handleCurrentChange = (value) => {
+  // console.log(value);
+  currentPage.value = value;
+  getList();
+};
+
+onBeforeMount(async () => {
+  api.value = store.state.user.api;
+  searchInput.createTime = dayjs().format("YYYY-MM-DD HH:mm:ss");
+  getList();
+});
+onUnmounted(() => {
+  // document.removeEventListener("keyup", Enters);
+});
+</script>
+
+<style scoped lang="scss">
+.content-box {
+  min-width: 500px;
+  width: calc(100vw - 260px);
+  height: calc(100vh - 105px);
+  margin: 20px auto;
+  background-color: #fff;
+  color: #fff;
+  display: flex;
+  flex-direction: column;
+  box-shadow: 0px 3px 10px rgba(0, 97, 255, 0.2);
+
+  .left {
+    // width: calc(100wh - 40px);
+    display: flex;
+    align-items: center;
+    height: 60px;
+    margin: 0 30px;
+    border-bottom: 1px solid #ccc;
+    color: rgb(0, 0, 0);
+    font-size: 18px;
+    font-weight: 600;
+
+    span {
+      height: 60px;
+      display: block;
+      line-height: 60px;
+      margin-right: 20px;
+    }
+
+    .is_active {
+      color: rgba(111, 182, 184, 1);
+    }
+  }
+  .scrollId {
+    overflow: auto;
+    // flex: 1;
+    height: calc(100% - 120px);
+  }
+  .middle {
+    width: calc(100% - 60px);
+    margin: 0 auto;
+
+    color: #000;
+
+    // border-bottom: 1px solid rgb(231, 231, 231);
+    .filter {
+      display: flex;
+      flex-wrap: wrap;
+      align-items: center;
+      margin: 0;
+
+      .search {
+        color: #fff;
+      }
+
+      .condition {
+        display: flex;
+        align-items: center;
+        margin: 15px 20px 0 0;
+
+        :deep(.el-input .el-input__inner) {
+          font-size: 14px;
+        }
+        .title {
+          padding: 0 25px 0 0;
+        }
+        .import {
+          margin: 0 0 0 20px;
+        }
+      }
+    }
+  }
+
+  .datalist {
+    width: calc(100% - 60px);
+    margin: 0 auto;
+    p {
+      font-size: 22px;
+      font-weight: 600;
+      color: #000;
+      margin: 15px 0;
+    }
+    .item {
+      width: calc(100%);
+      overflow: auto;
+      table {
+        border-collapse: collapse;
+        color: #000;
+        tr {
+          display: flex;
+          td {
+            display: inline-block;
+            width: 100px;
+            height: 40px;
+            text-align: center;
+            line-height: 40px;
+            border-top: 1px solid #e3e3e3;
+            border-left: 1px solid #e3e3e3;
+          }
+          td:last-child {
+            border-right: 1px solid #e3e3e3;
+          }
+        }
+        tr:first-child {
+          background-color: rgba(240, 243, 247, 1);
+          td {
+            // cursor: pointer;
+          }
+        }
+        tr:last-child {
+          border-bottom: 1px solid #e3e3e3;
+        }
+      }
+      &::-webkit-scrollbar-track {
+        background-color: #daeeff;
+      }
+
+      &::-webkit-scrollbar {
+        background-color: #0888f8;
+        height: 4px;
+        width: 4px;
+      }
+
+      &::-webkit-scrollbar-thumb {
+        background: #57b2ff;
+        border-radius: 4px;
+        height: 3px;
+        width: 4px;
+      }
+    }
+    .el-table--fit {
+      height: 160px;
+
+      :deep(.el-table__header-wrapper) {
+        background-color: #000;
+        font-size: 14px;
+        tr {
+          th {
+            height: 39px;
+            border: none;
+            background-color: rgba(240, 243, 247, 1);
+            border-top: 1px solid #e3e3e3;
+            border-left: 1px solid #e3e3e3;
+          }
+          th:last-child {
+            border-right: 1px solid #e3e3e3;
+          }
+        }
+      }
+
+      :deep(.el-table__row) {
+        height: 40px;
+        font-size: 14px;
+        // color: #000;
+        td:last-child {
+          border-right: 1px solid #e3e3e3;
+        }
+        &:hover {
+          td {
+            background-color: transparent;
+          }
+        }
+      }
+
+      :deep(.el-table__row td) {
+        padding: 0;
+        border: none;
+        border-top: 1px solid #e3e3e3;
+        border-left: 1px solid #e3e3e3;
+        .normal {
+          background-color: rgba(139, 195, 74, 1);
+          color: #fff;
+          padding: 4px;
+        }
+      }
+
+      .el-button--primary {
+        margin-left: 5px;
+      }
+
+      :deep(.el-table__body .even) {
+        background-color: #fff;
+      }
+
+      :deep(.el-table__body .odd) {
+        background-color: rgba(240, 243, 247, 1);
+      }
+    }
+  }
+
+  :deep(.infoDialog) {
+    //   height: 420px;
+    border-radius: 11px;
+    .el-dialog__header {
+      border-radius: 11px 11px 0 0;
+      background: rgba(237, 241, 245, 1);
+      font-weight: 600;
+      margin: 0;
+      .el-dialog__headerbtn {
+        outline: none;
+      }
+    }
+    .el-dialog__body {
+      padding: 0 30px;
+      height: 500px;
+      .abnormal {
+        width: 100%;
+        height: calc(100%);
+        .title {
+          display: flex;
+          align-items: center;
+          margin: 15px 0;
+          .square {
+            width: 16px;
+            height: 16px;
+            background: rgba(52, 100, 255, 1);
+          }
+          .studentInfo {
+            font-size: 16px;
+            font-weight: 600;
+            margin-left: 10px;
+            color: rgba(0, 0, 0, 1);
+          }
+        }
+        .infoCont {
+          display: flex;
+          align-items: center;
+          margin: 10px 0 20px 0;
+          img {
+            width: 50px;
+            height: 50px;
+            border-radius: 50%;
+            margin-right: 20px;
+          }
+          .phone {
+            p {
+              font-size: 18px;
+              font-weight: 500;
+              color: rgba(0, 0, 0, 1);
+              margin: 0;
+              padding-bottom: 10px;
+            }
+            span {
+              font-size: 14px;
+              font-weight: 400;
+              color: rgba(102, 102, 102, 1);
+            }
+          }
+          .patriarch {
+            font-size: 16px;
+            color: rgba(0, 0, 0, 1);
+          }
+        }
+        .patriarchCont {
+          display: flex;
+          flex-direction: column;
+          margin: 15px 0 20px 0;
+          .patriarch {
+            margin-bottom: 5px;
+            font-size: 15px;
+          }
+        }
+      }
+      .trackInfo {
+        width: 100%;
+        height: calc(100%);
+        display: flex;
+        align-items: center;
+        justify-content: center;
+
+        .el-timeline {
+          height: calc(100% - 30px);
+          overflow: auto;
+          padding-left: 5px;
+          padding-right: 25px;
+          width: 505px !important;
+          // 整个滚动条
+          &::-webkit-scrollbar-track {
+            background-color: rgb(219, 219, 219);
+            border-radius: 4px;
+          }
+          // 滚动条的滚动区域(轨道)
+          &::-webkit-scrollbar {
+            background-color: #088afd;
+            height: 3px;
+            width: 4px;
+            border-radius: 4px;
+          }
+          // 滚动条的可拖拽部分(滑块)
+          &::-webkit-scrollbar-thumb {
+            background: rgba(30, 125, 251, 1);
+            border-radius: 4px;
+          }
+          .el-timeline-item__tail {
+            border-left: 2px dashed rgba(173, 173, 173, 1);
+          }
+          h4 {
+            margin: 0 0 10px 0;
+            color: rgba(255, 255, 255, 0.6);
+          }
+          .el-timeline-item__wrapper {
+            .el-timeline-item__timestamp {
+              color: #000;
+              font-size: 16px;
+              font-weight: 600;
+            }
+            h4 {
+              color: rgba(0, 0, 0, 1);
+              font-size: 14px;
+            }
+            p {
+              color: rgba(0, 0, 0, 1);
+              font-size: 14px;
+            }
+            img {
+              width: 100px;
+            }
+          }
+          .el-card {
+            background-color: transparent;
+            border: none;
+            .el-card__body {
+              padding: 10px;
+            }
+          }
+        }
+      }
+      .leaveInfo {
+        font-size: 16px;
+        color: #000;
+        .name {
+          margin: 10px 0 15px 0;
+          span {
+            display: inline-block;
+            width: 100px;
+          }
+        }
+      }
+      .options {
+        margin: 160px 20px 20px 0;
+        width: 100%;
+        display: flex;
+        flex-direction: row-reverse;
+        .queding {
+          color: #fff;
+          margin-left: 15px;
+        }
+      }
+    }
+  }
+
+  .pageSize {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    height: 60px;
+    margin: 0 30px;
+
+    span {
+      color: #000;
+    }
+
+    .el-pagination {
+      // width: 1600px;
+      :deep(.el-pagination__total) {
+        color: #000;
+      }
+
+      :deep(.el-pagination__goto) {
+        color: #000;
+      }
+
+      :deep(.el-pagination__classifier) {
+        color: #000;
+      }
+
+      :deep(.el-input__wrapper) {
+        border: 1px solid rgba(0, 0, 0, 1);
+        border-radius: 5px;
+        box-shadow: none;
+      }
+
+      :deep(.el-pager li) {
+        margin: 0 5px;
+        border: 1px solid rgba(0, 0, 0, 1);
+        border-radius: 5px;
+        background-color: transparent;
+      }
+
+      :deep(.el-pager li.is-active) {
+        // background-color: rgba(0, 97, 255, 0.8);
+        border: 1px solid rgba(0, 97, 255, 1);
+        color: rgba(0, 97, 255, 1);
+      }
+
+      :deep(.btn-prev) {
+        margin-right: 5px;
+        border: 1px solid rgba(0, 0, 0, 1);
+        border-radius: 5px;
+        background-color: transparent;
+      }
+
+      :deep(.btn-next) {
+        margin-left: 5px;
+        border: 1px solid rgba(0, 0, 0, 1);
+        border-radius: 5px;
+        background-color: transparent;
+      }
+    }
+  }
+
+  .bgImg {
+    position: absolute;
+    left: 0;
+    top: 0;
+    z-index: 99999999;
+    width: 100%;
+    height: 100%;
+    background-color: rgba(255, 255, 255, 0.8);
+    :deep(.el-carousel__arrow) {
+      display: none;
+    }
+    // border-radius: 50px;
+    :deep(.el-carousel__container) {
+      width: 100%;
+      height: calc(100vh);
+
+      .el-carousel__item {
+        display: flex;
+        justify-content: center;
+
+        img {
+          height: 100%;
+        }
+      }
+    }
+  }
+}
+
+.el-input {
+  width: 192px;
+}
+</style>
+<style lang="scss">
+//添加成员 联系人下拉框样式
+.gradeSelect {
+  // border: 1px solid red;
+  .el-select-dropdown__wrap {
+    height: 200px;
+    // border: 1px solid red;
+  }
+}
+.el-popper {
+  .addStudentMore {
+    text-align: center;
+  }
+}
+.viewer-container {
+  z-index: 99999 !important;
+}
+</style>

+ 117 - 94
src/views/statistic/statistic.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="content-box" v-loading="loading">
+  <div class="content-box">
     <div class="left">
       <!-- <el-icon :size="23" class="camera"><VideoCameraFilled /></el-icon> -->
       <span class="cameratxt">在校统计</span>
@@ -133,12 +133,14 @@
       class="demo-tabs"
       @tab-change="statisticTypeClick"
     >
-      <el-tab-pane :label="`未监听(${abnormalNum})`" :name="1">异常</el-tab-pane>
+      <el-tab-pane :label="`未监听(${abnormalNum})`" :name="1"
+        >异常</el-tab-pane
+      >
       <el-tab-pane :label="`监听(${normalNum})`" :name="2">正常</el-tab-pane>
       <el-tab-pane :label="`请假(${ackNum})`" :name="3">请假</el-tab-pane>
     </el-tabs>
     <div class="scrollId">
-      <div class="footer">
+      <div class="footer" v-loading="loading">
         <el-table
           :row-class-name="tableRowClassName"
           :data="tableData.list"
@@ -167,7 +169,7 @@
           </el-table-column>
         </el-table>
       </div>
-     
+
       <!-- 分页组件 -->
       <!-- <div class="pageSize">
         <span></span>
@@ -213,7 +215,10 @@
             <span class="studentInfo">家长信息</span>
           </div>
           <div class="patriarchCont">
-            <span class="patriarch" v-for="i in abnormalData.patriarch">关系:{{ i.ship }}&nbsp;&nbsp;  姓名:{{ i.name }}&nbsp;&nbsp; 电话:{{ i.phone }}</span>
+            <span class="patriarch" v-for="i in abnormalData.patriarch"
+              >关系:{{ i.ship }}&nbsp;&nbsp; 姓名:{{ i.name }}&nbsp;&nbsp;
+              电话:{{ i.phone }}</span
+            >
           </div>
         </div>
         <div class="trackInfo" v-if="statisticType == 2">
@@ -236,21 +241,15 @@
           </el-timeline>
         </div>
         <div class="leaveInfo" v-if="statisticType == 3">
-            <div class="name">
-                 <span>请假人姓名:</span>{{ leaveData.name }}
-            </div>
-            <div class="name">
-                 <span>学号:</span>{{ leaveData.cardNo }}
-            </div>
-            <div class="name">
-                 <span>请假时间:</span>{{ leaveData.leaveTime }}
-            </div>
-            <div class="name">
-                 <span>请假说明:</span>{{ leaveData.reason }}
-            </div>
-            <div class="name">
-                 <span>创建时间:</span>{{ leaveData.createTiem }}
-            </div>
+          <div class="name"><span>请假人姓名:</span>{{ leaveData.name }}</div>
+          <div class="name"><span>学号:</span>{{ leaveData.cardNo }}</div>
+          <div class="name">
+            <span>请假时间:</span>{{ leaveData.leaveTime }}
+          </div>
+          <div class="name"><span>请假说明:</span>{{ leaveData.reason }}</div>
+          <div class="name">
+            <span>创建时间:</span>{{ leaveData.createTiem }}
+          </div>
         </div>
         <!-- <div class="options">
           <el-button
@@ -300,9 +299,9 @@ const classsData = ref(); //班级下拉数据
 
 const statisticType = ref(1); // 切换类型 (1:异常,2:正常,3:请假 )
 
-const abnormalNum=ref(5)
-const normalNum=ref(5)
-const ackNum=ref(2)
+const abnormalNum = ref(5);
+const normalNum = ref(5);
+const ackNum = ref(2);
 
 const searchInput = reactive({
   keyWord: "",
@@ -318,18 +317,18 @@ const total = ref(5); // 当前总数
 // 推送人设置
 const infoVisible = ref(false);
 const infoTitle = ref("请假详情");
-const abnormalData=reactive({
-    patriarch:'',
-    student:''
-}) // 异常详情数据
-const infoTable = reactive({ list: [] });// 正常详情数据
-const leaveData=reactive({
-    name:'',
-    cardNo:'',
-    leaveTime:'',
-    reason:'',
-    createTiem:''
-})// 请假详情数据
+const abnormalData = reactive({
+  patriarch: "",
+  student: "",
+}); // 异常详情数据
+const infoTable = reactive({ list: [] }); // 正常详情数据
+const leaveData = reactive({
+  name: "",
+  cardNo: "",
+  leaveTime: "",
+  reason: "",
+  createTiem: "",
+}); // 请假详情数据
 
 // 年级数据下拉
 const adminClassDataList = async () => {
@@ -349,13 +348,13 @@ const adminClassDataList = async () => {
       JSON.parse(eds.decryptDes(grade.data.data)),
       "年级下拉数据"
     );
-    let resData=JSON.parse(eds.decryptDes(grade.data.data))
+    let resData = JSON.parse(eds.decryptDes(grade.data.data));
     gradeData.value = resData;
     searchInput.grade = resData[0].id;
-    adminClassInfoList(searchInput.grade).then(()=>{
-        searchInput.class = classsData.value[0].id;
-        getList();
-    })
+    adminClassInfoList(searchInput.grade).then(() => {
+      searchInput.class = classsData.value[0].id;
+      getList();
+    });
   } else {
     let grade = await axios({
       method: "get",
@@ -395,10 +394,10 @@ const adminClassDataList = async () => {
 const gradeChange = (value) => {
   console.log(value);
   if (value) {
-    adminClassInfoList(value).then(()=>{
-        searchInput.class = classsData.value[0].id;
-        getList();
-    })
+    adminClassInfoList(value).then(() => {
+      searchInput.class = classsData.value[0].id;
+      getList();
+    });
   } else {
     classsData.value = [];
     searchInput.class = "";
@@ -457,11 +456,11 @@ const getList = async () => {
   });
   console.log(res, JSON.parse(eds.decryptDes(res.data.data)), "在校统计数据");
   if (res.data.code == 200) {
-    let resData=JSON.parse(eds.decryptDes(res.data.data))
-    tableData.list =resData.data;
-    abnormalNum.value=resData.abnormal
-    normalNum.value=resData.normal
-    ackNum.value=resData.ack
+    let resData = JSON.parse(eds.decryptDes(res.data.data));
+    tableData.list = resData.data;
+    abnormalNum.value = resData.abnormal;
+    normalNum.value = resData.normal;
+    ackNum.value = resData.ack;
     loading.value = false;
   } else {
     loading.value = false;
@@ -494,7 +493,7 @@ const subsectionCurrentChange = (value) => {
 const infoClick = async (row) => {
   infoVisible.value = true;
   if (statisticType.value == 1) {
-    infoTitle.value='异常详情'
+    infoTitle.value = "未监听详情";
     let data = {
       userId: row.userId,
     };
@@ -510,9 +509,9 @@ const infoClick = async (row) => {
     console.log(res, "异常详情");
     if (res.data.code == 200) {
       console.log(res, JSON.parse(eds.decryptDes(res.data.data)), "异常详情");
-        let resData = JSON.parse(eds.decryptDes(res.data.data));
-        abnormalData.patriarch=resData.patriarch
-        abnormalData.student=resData.student
+      let resData = JSON.parse(eds.decryptDes(res.data.data));
+      abnormalData.patriarch = resData.patriarch;
+      abnormalData.student = resData.student;
     } else {
       ElMessage({
         type: "error",
@@ -523,7 +522,7 @@ const infoClick = async (row) => {
     }
   }
   if (statisticType.value == 2) {
-    infoTitle.value='正常详情'
+    infoTitle.value = "正常详情";
     let data = {
       id: row.userId,
     };
@@ -555,9 +554,9 @@ const infoClick = async (row) => {
     }
   }
   if (statisticType.value == 3) {
-    infoTitle.value='请假详情'
+    infoTitle.value = "请假详情";
     let data = {
-        userId: row.userId,
+      userId: row.userId,
     };
     if (searchInput.createTime) {
       data.dateTime = searchInput.createTime;
@@ -573,12 +572,17 @@ const infoClick = async (row) => {
     });
     if (res.data.code == 200) {
       console.log(res, JSON.parse(eds.decryptDes(res.data.data)), "请假详情");
-      let resData= JSON.parse(eds.decryptDes(res.data.data));
-      leaveData.name =resData[0].name
-      leaveData.cardNo =resData[0].cardNo
-      leaveData.leaveTime =dayjs(resData[0].startTime).format('YYYY/MM/DD HH:mm:ss') +' - '+dayjs(resData[0].endTime).format('YYYY/MM/DD HH:mm:ss')
-      leaveData.reason =resData[0].reason
-      leaveData.createTiem =dayjs(resData[0].createTime).format('YYYY/MM/DD HH:mm:ss')
+      let resData = JSON.parse(eds.decryptDes(res.data.data));
+      leaveData.name = resData[0].name;
+      leaveData.cardNo = resData[0].cardNo;
+      leaveData.leaveTime =
+        dayjs(resData[0].startTime).format("YYYY/MM/DD HH:mm:ss") +
+        " - " +
+        dayjs(resData[0].endTime).format("YYYY/MM/DD HH:mm:ss");
+      leaveData.reason = resData[0].reason;
+      leaveData.createTiem = dayjs(resData[0].createTime).format(
+        "YYYY/MM/DD HH:mm:ss"
+      );
     } else {
       ElMessage({
         type: "error",
@@ -591,7 +595,7 @@ const infoClick = async (row) => {
 };
 const infoCancel = () => {
   infoVisible.value = false;
-  infoTable.list=[]
+  infoTable.list = [];
 };
 
 //导出功能 (-----------------------------------------------------------------)
@@ -683,17 +687,17 @@ const getAdminId = async () => {
       userHead: sessionStorage.getItem("userhead"),
     },
   });
-  // console.log(
-  //   res,
-  //   JSON.parse(eds.decryptDes(res.data.data)),
-  //   "获取所管理的班级的id(0是所有班级)"
-  // );
+  console.log(
+    res,
+    JSON.parse(eds.decryptDes(res.data.data)),
+    "获取所管理的班级的id(0是所有班级)"
+  );
   if (res.data.code == 200) {
     let classIds = JSON.parse(eds.decryptDes(res.data.data)).schoolClass;
     classId.value = classIds;
     adminClassDataList();
   } else {
-    if(res.data.message=='登录凭证已过期,请重新登录'){
+    if (res.data.message == "登录凭证已过期,请重新登录") {
       sessionStorage.removeItem("token");
       sessionStorage.removeItem("userhead");
       sessionStorage.removeItem("roleList");
@@ -714,10 +718,29 @@ const getAdminId = async () => {
 onBeforeMount(async () => {
   api.value = store.state.user.api;
   // getList();
+  if(store.state.user.gradeId){
+    searchInput.grade=store.state.user.gradeId
+  }
+  if(store.state.user.classId){
+    searchInput.class=store.state.user.classId
+  }
+  if(store.state.user.dateTime){
+    searchInput.createTime=store.state.user.dateTime
+  }
   getAdminId();
+  console.log(
+    store.state.user.classId,
+    store.state.user.gradeId,
+    store.state.user.dateTime,
+    '所传过来的参数'
+  );
+  
 });
 onUnmounted(() => {
   // document.removeEventListener("keyup", Enters);
+  store.state.user.classId=""
+  store.state.user.gradeId=""
+  store.state.user.dateTime=""
 });
 </script>
 
@@ -983,9 +1006,9 @@ onUnmounted(() => {
         width: 100%;
         height: calc(100%);
         .title {
-            display: flex;
-            align-items: center;
-            margin: 15px 0;
+          display: flex;
+          align-items: center;
+          margin: 15px 0;
           .square {
             width: 16px;
             height: 16px;
@@ -999,14 +1022,14 @@ onUnmounted(() => {
           }
         }
         .infoCont {
-            display: flex;
-            align-items: center;
-            margin:10px 0 20px 0;
+          display: flex;
+          align-items: center;
+          margin: 10px 0 20px 0;
           img {
             width: 50px;
             height: 50px;
             border-radius: 50%;
-            margin-right:20px;
+            margin-right: 20px;
           }
           .phone {
             p {
@@ -1027,14 +1050,14 @@ onUnmounted(() => {
             color: rgba(0, 0, 0, 1);
           }
         }
-        .patriarchCont{
-            display: flex;
-            flex-direction: column;
-            margin:15px 0 20px 0;
-            .patriarch{
-                margin-bottom: 5px;
-                font-size: 15px;
-            }
+        .patriarchCont {
+          display: flex;
+          flex-direction: column;
+          margin: 15px 0 20px 0;
+          .patriarch {
+            margin-bottom: 5px;
+            font-size: 15px;
+          }
         }
       }
       .trackInfo {
@@ -1081,11 +1104,11 @@ onUnmounted(() => {
               font-weight: 600;
             }
             h4 {
-              color: rgba(0, 0, 0,1);
+              color: rgba(0, 0, 0, 1);
               font-size: 14px;
             }
             p {
-              color: rgba(0, 0, 0,1);
+              color: rgba(0, 0, 0, 1);
               font-size: 14px;
             }
             img {
@@ -1101,15 +1124,15 @@ onUnmounted(() => {
           }
         }
       }
-      .leaveInfo{
+      .leaveInfo {
         font-size: 16px;
         color: #000;
-        .name{
-            margin:10px 0 15px 0;
-            span{
-                display: inline-block;
-                width: 100px;
-            }
+        .name {
+          margin: 10px 0 15px 0;
+          span {
+            display: inline-block;
+            width: 100px;
+          }
         }
       }
       .options {
@@ -1231,7 +1254,7 @@ onUnmounted(() => {
     text-align: center;
   }
 }
-.viewer-container{
+.viewer-container {
   z-index: 99999 !important;
 }
 </style>

+ 25 - 3
src/views/systemHome/systemHome.vue

@@ -296,6 +296,7 @@ import axios from "axios";
 import eds from "@/utils/eds.js";
 import { RSAdecrypt } from "@/utils/rsa.js";
 import { useStore } from "vuex";
+import { useTransition } from '@vueuse/core'
 const store = useStore();
 const api = ref("");
 const router = useRouter();
@@ -326,6 +327,7 @@ const greetTeaData = ref();
 const semesterData = ref();
 // 资源大数据
 // const echarts6 = ref();
+const nowTerm=ref() // 当前学期
 
 const getList = async () => {
   applyList();
@@ -333,8 +335,9 @@ const getList = async () => {
   cartogram2();
   doorForbidClick();
   behaviorClick();
-  greetTeaClick();
-  // resourceClick();
+  nowTerms().then(res=>{
+    greetTeaClick();
+  })
   let res = await axios({
     method: "get",
     url: api.value + "/wanzai/api/login/queryReduce",
@@ -1269,9 +1272,28 @@ const semesterList = async () => {
   );
   semesterData.value = JSON.parse(eds.decryptDes(semester.data.data));
 };
+
+// 获取当前学期
+const nowTerms = async () => {
+  let semester = await axios({
+    method: "get",
+    url: api.value + "/wanzai/api/smartSemester/getNowSmartSemester",
+    headers: {
+      token: sessionStorage.getItem("token"),
+      user_head: sessionStorage.getItem("userhead"),
+    },
+    // params: data,
+  });
+  console.log(
+    semester,
+    JSON.parse(eds.decryptDes(semester.data.data)),
+    "当前学期数据"
+  );
+  searchInput.termId = JSON.parse(eds.decryptDes(semester.data.data)).id;
+};
+
 onMounted(async () => {
   api.value = store.state.user.api;
-
   window.addEventListener("resize", () => {
     resizeChart();
   });

+ 98 - 26
src/views/teacher/teacher.vue

@@ -309,6 +309,7 @@
               </el-select> -->
             </div>
             <el-table
+              ref="teacher"
               :row-class-name="tableRowClassName"
               :data="rankData"
               :header-cell-style="{
@@ -319,17 +320,35 @@
             >
               <el-table-column
                 align="center"
-                type="index"
+                prop="number"
                 width="100"
                 label="排名"
-              />
-              <el-table-column align="center" prop="name" label="姓名" />
+              >
+                <template #default="{ row, $index }">
+                  <div class="number" :class="rankInd == $index?'active':''">
+                    {{ row.number }}
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column align="center" prop="name" label="姓名">
+                <template #default="{ row, $index }">
+                  <div class="number" :class="rankInd == $index?'active':''">
+                    {{ row.name }}
+                  </div>
+                </template>
+              </el-table-column>
               <!-- <el-table-column align="center" prop="status" label="教学学科" /> -->
               <el-table-column
                 align="center"
                 prop="totalScore"
                 label="最终得分"
-              />
+              >
+                <template #default="{ row, $index }">
+                  <div class="number" :class="rankInd == $index?'active':''">
+                    {{ row.totalScore }}
+                  </div>
+                </template>
+              </el-table-column>
             </el-table>
           </div>
         </div>
@@ -694,7 +713,7 @@ const semesterList = async () => {
   if (semester.data.code == 200) {
     semesterData.value = JSON.parse(eds.decryptDes(semester.data.data));
   } else {
-    if(res.data.message=='登录凭证已过期,请重新登录'){
+    if (res.data.message == "登录凭证已过期,请重新登录") {
       router.push({
         path: `/login`,
       });
@@ -806,12 +825,13 @@ const teacherComparison = reactive({
 const rankCurrentPage = ref(1); // 当前页
 const rankPageSize = ref(100);
 const rankInput = ref("全部"); // 搜索
+const rankInd = ref(); // 排行榜对比ref
 const rankData = ref(); // 排行榜对比
 const scoreEcharts = ref(); // 评分对比统计图
 
 // 查看教师
 const getList = async () => {
-  loading.value=true
+  loading.value = true;
   if (pageIndex.value == 1) {
     let params = {
       currentPage: currentPage.value,
@@ -856,7 +876,7 @@ const getList = async () => {
       tableData.list = data.list;
       console.log(tableData.list);
       total.value = data.totalCount;
-      loading.value=false
+      loading.value = false;
       // ElMessage({
       //   type: "success",
       //   showClose: true,
@@ -864,12 +884,12 @@ const getList = async () => {
       //   center: true,
       // });
     } else {
-      loading.value=false
-      if(res.data.message=='登录凭证已过期,请重新登录'){
+      loading.value = false;
+      if (res.data.message == "登录凭证已过期,请重新登录") {
         sessionStorage.removeItem("token");
-      sessionStorage.removeItem("userhead");
-      sessionStorage.removeItem("roleList");
-      sessionStorage.removeItem("message");
+        sessionStorage.removeItem("userhead");
+        sessionStorage.removeItem("roleList");
+        sessionStorage.removeItem("message");
         router.push({
           path: `/login`,
         });
@@ -898,7 +918,7 @@ const getList = async () => {
       teacherList.value = JSON.parse(
         eds.decryptDes(res.data.data)
       ).simpleScoreList.simpleScoreDetailList;
-      loading.value=false
+      loading.value = false;
       // ElMessage({
       //   type: "success",
       //   showClose: true,
@@ -906,7 +926,7 @@ const getList = async () => {
       //   center: true,
       // });
     } else {
-      loading.value=false
+      loading.value = false;
       ElMessage({
         type: "error",
         showClose: true,
@@ -983,24 +1003,42 @@ const updateClick = async () => {
 };
 // 评分排行榜
 const rankSel = async () => {
-  let formDatass = new FormData();
-  formDatass.append("currentPage", rankCurrentPage.value);
-  formDatass.append("pageCount", rankPageSize.value);
-  if (rankInput.value != "全部") {
-    formDatass.append("scoreItem", rankInput.value);
-  }
+  // let formDatass = new FormData();
+  // formDatass.append("currentPage", rankCurrentPage.value);
+  // formDatass.append("pageCount", rankPageSize.value);
+  // if (rankInput.value != "全部") {
+  //   formDatass.append("scoreItem", rankInput.value);
+  // }
+  let data = {
+    id: teacherRowInfo.value.id,
+  };
   let resss = await axios({
-    method: "post",
+    method: "get",
     url: api.value + "/wanzai/api/smartEvaluateTeacher/getScoreRank",
     headers: {
       token: sessionStorage.getItem("token"),
       user_head: sessionStorage.getItem("userhead"),
     },
-    data: formDatass,
+    params: data,
   });
   console.log(resss, JSON.parse(eds.decryptDes(resss.data.data)), "评分排行榜");
   if (resss.data.code == 200) {
-    rankData.value = JSON.parse(eds.decryptDes(resss.data.data)).list;
+    let resData = JSON.parse(eds.decryptDes(resss.data.data));
+    // nextTick(() => {
+    //   const tableBodyWrapper = teacher.value.bodyWrapper;
+    //   console.log(tableBodyWrapper);
+    //   const trElements = tableBodyWrapper.querySelectorAll("tr");
+    //   console.log(trElements); // 这里你可以获取到tr元素
+    // });
+
+    resData.forEach((i,index) => {
+      if (teacherRowInfo.value.userId == i.userId) {
+        rankInd.value = index;
+      }
+    });
+    console.log(rankInd.value);
+    
+    rankData.value = resData;
   } else {
     ElMessage({
       type: "error",
@@ -1790,7 +1828,7 @@ const secondaryItemClick = (row) => {
   addItemRuleForm.term = semesterName.value;
   addItemRuleForm.termId = semestertermId.value;
   console.log(semestertermId.value);
-  
+
   addItemRuleForm.id = row.id;
   addItemRuleForm.subitem = "";
   addItemRuleForm.score = "";
@@ -2256,7 +2294,7 @@ onUnmounted(() => {
           }
 
           .el-table--fit {
-            height: 240px;
+            height: 250px;
             :deep(.el-table__header-wrapper) {
               font-size: 14px;
               .cell {
@@ -2270,10 +2308,25 @@ onUnmounted(() => {
               color: #000;
               td {
                 padding: 0;
+                .cell {
+                  padding: 0;
+                  .number {
+                    width: 100%;
+                    height: 40px;
+                    display: flex;
+                    align-items: center;
+                    justify-content: center;
+                  }
+                }
+              }
+              .active{
+                font-size: 17px;
+                background-color: #4d90ff;
+                color: #fff;
               }
               &:hover {
                 td {
-                  background-color: rgba(223, 236, 254, 0.6);
+                  background-color: transparent;
                 }
               }
               &:nth-child(1) {
@@ -2294,6 +2347,25 @@ onUnmounted(() => {
                   font-weight: 600;
                 }
               }
+              // &:nth-child(5) {
+              //   font-size: 17px;
+              //   background-color: #4d90ff;
+              //   color: #fff;
+              //   td:nth-child(1) {
+              //     border-left: 1px solid #0061ff;
+              //     border-top: 1px solid #0061ff;
+              //     border-bottom: 1px solid #0061ff;
+              //   }
+              //   td:nth-child(2) {
+              //     border-top: 1px solid #0061ff;
+              //     border-bottom: 1px solid #0061ff;
+              //   }
+              //   td:nth-child(3) {
+              //     border-right: 1px solid #0061ff;
+              //     border-top: 1px solid #0061ff;
+              //     border-bottom: 1px solid #0061ff;
+              //   }
+              // }
             }
           }
         }

+ 1 - 1
src/views/user/user.vue

@@ -470,7 +470,7 @@
             <el-form-item
               label="任课班级 :"
               prop="teachingClass"
-              v-if="addMemberRuleForm.identity == 3"
+              v-if="addMemberRuleForm.identity == 3 && addMemberRuleForm.duty == 1"
             >
               <el-cascader
                 style="width: 500px"