Browse Source

修改校园安全推送人设置bug,权限管理分组bug,教师新增更新按钮,轨迹管理根据是否为班主任获取学生数据

hzj18279462576@163.com 2 years ago
parent
commit
e1cb99a2e6

BIN
src/assets/man.png


BIN
src/assets/trackImg.jpg


+ 1 - 1
src/layout/sidebar/SidevarItem.vue

@@ -311,7 +311,7 @@ const roleListChange = async () => {
       },
       data: formDatas,
     });
-    // console.log(resData, "查看当前用户权限");
+    console.log(resData, "查看当前用户权限");
     if (resData.data.code == 200) {
       let roleList = resData.data.data[0].treAuthor;
       roleList.value = resData.data.data[0].treAuthor;

+ 1 - 8
src/router/index.js

@@ -182,14 +182,7 @@ router.beforeEach(async (to, from, next) => {
 
   let hasRoutes = store.state.user.hasRoutes;
   if(to.path == "/wanzai/home"){
-    if (
-      sessionStorage.getItem("token") &&
-      sessionStorage.getItem("userhead") 
-    ) {
-      next()
-    }else{
-      next(`/login`);
-    }
+    next()
   }else{
     if (
       sessionStorage.getItem("token") &&

+ 116 - 11
src/views/roles/roles.vue

@@ -742,15 +742,18 @@ const getAllDataList = async () => {
     params: data,
   });
   console.log(res, JSON.parse(eds.decryptDes(res.data.data)), "树形权限数据");
-  console.log(res, "树形权限数据");
+  // console.log(res, "树形权限数据");
   if (res.data.code == 200) {
     let data = JSON.parse(eds.decryptDes(res.data.data));
     // let data = res.data.data;
     dataSource.value = data;
-    if(sessionStorage.getItem('authorGroupParentId') && sessionStorage.getItem('authorGroupId')){
-      authorGroupParentId.value = sessionStorage.getItem('authorGroupParentId');
-      authorGroupId.value = sessionStorage.getItem('authorGroupId');
-    }else{
+    if (
+      sessionStorage.getItem("authorGroupParentId") &&
+      sessionStorage.getItem("authorGroupId")
+    ) {
+      authorGroupParentId.value = sessionStorage.getItem("authorGroupParentId");
+      authorGroupId.value = sessionStorage.getItem("authorGroupId");
+    } else {
       authorGroupParentId.value = data[0].parentId;
       authorGroupId.value = data[0].id;
     }
@@ -847,8 +850,8 @@ const allRolesData = async () => {
 // 点击树状结构每一个节点触发的回调
 const handleNodeClick = async (data) => {
   headerValue.value = data.name;
-  sessionStorage.setItem('authorGroupParentId',data.parentId);
-  sessionStorage.setItem('authorGroupId', data.id);
+  sessionStorage.setItem("authorGroupParentId", data.parentId);
+  sessionStorage.setItem("authorGroupId", data.id);
   authorGroupParentId.value = data.parentId;
   authorGroupId.value = data.id;
   getUserAuthList(); // 所有用户权限数据
@@ -922,7 +925,58 @@ const confirmAddGroup = async (formEl) => {
         //   "新建下级管理员"
         // );
         if (res.data.code == 200) {
-          getAllDataList();
+          // getAllDataList();
+          let data = {
+            authorGroupId: 0,
+            // managerId: sessionStorage.getItem("token"),
+          };
+          let res = await axios({
+            method: "post",
+            url:
+              api.value + "/wanzai/api/smartAuthorGroup/querySmartAuthorGroup",
+            headers: {
+              token: sessionStorage.getItem("token"),
+              user_head: sessionStorage.getItem("userhead"),
+            },
+            params: data,
+          });
+          console.log(
+            res,
+            JSON.parse(eds.decryptDes(res.data.data)),
+            "树形权限数据"
+          );
+          // console.log(res, "树形权限数据");
+          if (res.data.code == 200) {
+            let data = JSON.parse(eds.decryptDes(res.data.data));
+            // let data = res.data.data;
+            dataSource.value = data;
+            if (
+              sessionStorage.getItem("authorGroupParentId") &&
+              sessionStorage.getItem("authorGroupId")
+            ) {
+              authorGroupParentId.value = sessionStorage.getItem(
+                "authorGroupParentId"
+              );
+              authorGroupId.value = sessionStorage.getItem("authorGroupId");
+            } else {
+              authorGroupParentId.value = data[0].parentId;
+              authorGroupId.value = data[0].id;
+            }
+
+            // tagList.value = JSON.parse(data[0].userId).data; // 管理人员
+            // menuList.value = JSON.parse(data[0].applyId).data; //菜单权限
+            // appList.value = JSON.parse(data[0].applyId).data; //应用权限
+            // console.log(tagList.value, menuList.value, appList.value);
+            getUserAuthList(); // 所有用户权限数据
+            allRolesData(); // 查看权限组编辑数据
+          } else {
+            ElMessage({
+              type: "error",
+              showClose: true,
+              message: res.data.message,
+              center: true,
+            });
+          }
           addGroupVisible.value = false;
           ElMessage({
             type: "success",
@@ -961,7 +1015,58 @@ const confirmAddGroup = async (formEl) => {
         //   "新建下级管理员"
         // );
         if (res.data.code == 200) {
-          getAllDataList();
+          // getAllDataList();
+          let data = {
+            authorGroupId: 0,
+            // managerId: sessionStorage.getItem("token"),
+          };
+          let res = await axios({
+            method: "post",
+            url:
+              api.value + "/wanzai/api/smartAuthorGroup/querySmartAuthorGroup",
+            headers: {
+              token: sessionStorage.getItem("token"),
+              user_head: sessionStorage.getItem("userhead"),
+            },
+            params: data,
+          });
+          console.log(
+            res,
+            JSON.parse(eds.decryptDes(res.data.data)),
+            "树形权限数据"
+          );
+          // console.log(res, "树形权限数据");
+          if (res.data.code == 200) {
+            let data = JSON.parse(eds.decryptDes(res.data.data));
+            // let data = res.data.data;
+            dataSource.value = data;
+            if (
+              sessionStorage.getItem("authorGroupParentId") &&
+              sessionStorage.getItem("authorGroupId")
+            ) {
+              authorGroupParentId.value = sessionStorage.getItem(
+                "authorGroupParentId"
+              );
+              authorGroupId.value = sessionStorage.getItem("authorGroupId");
+            } else {
+              authorGroupParentId.value = data[0].parentId;
+              authorGroupId.value = data[0].id;
+            }
+
+            // tagList.value = JSON.parse(data[0].userId).data; // 管理人员
+            // menuList.value = JSON.parse(data[0].applyId).data; //菜单权限
+            // appList.value = JSON.parse(data[0].applyId).data; //应用权限
+            // console.log(tagList.value, menuList.value, appList.value);
+            getUserAuthList(); // 所有用户权限数据
+            allRolesData(); // 查看权限组编辑数据
+          } else {
+            ElMessage({
+              type: "error",
+              showClose: true,
+              message: res.data.message,
+              center: true,
+            });
+          }
           addGroupVisible.value = false;
           ElMessage({
             type: "success",
@@ -1523,8 +1628,8 @@ const affirmAddManager = async () => {
       addManagerLiCount.value = [];
       selManagerData.value = [];
       departmentId.value = "";
-      selManagerInput.value=""
-      selManagertotalPage.value=0
+      selManagerInput.value = "";
+      selManagertotalPage.value = 0;
       ElMessage({
         type: "success",
         showClose: true,

+ 35 - 5
src/views/safety/safety.vue

@@ -779,12 +779,42 @@ const affirmPushSet = async () => {
       });
     }
   } else {
-    ElMessage({
-      type: "warning",
-      showClose: true,
-      message: "推送人不能为空",
-      center: true,
+    // ElMessage({
+    //   type: "warning",
+    //   showClose: true,
+    //   message: "推送人不能为空",
+    //   center: true,
+    // });
+    let data = { ids: [0] };
+    pushSetLiCount.value.forEach((item) => {
+      data.ids.push(item.id);
+    });
+    let res = await axios({
+      method: "post",
+      url: api.value + "/wanzai/api/smartWarning/warningSavePush",
+      headers: {
+        token: sessionStorage.getItem("token"),
+        user_head: sessionStorage.getItem("userhead"),
+      },
+      data: data,
     });
+    console.log(res, "确认推送");
+    if (res.data.code == 200) {
+      pushSetVisible.value = false;
+      ElMessage({
+        type: "success",
+        showClose: true,
+        message: res.data.message,
+        center: true,
+      });
+    } else {
+      ElMessage({
+        type: "error",
+        showClose: true,
+        message: res.data.message,
+        center: true,
+      });
+    }
   }
 };
 

+ 32 - 4
src/views/teacher/teacher.vue

@@ -110,13 +110,13 @@
             @click="scoringItemsClick"
             >评分项管理</el-button
           >
-          <!-- <el-button
+          <el-button
               type="primary"
               color="rgba(0, 97, 255, 1)"
-              @click="importExcel"
+              @click="updateClick"
               plain
-              >导出</el-button
-            > -->
+              >更新</el-button
+            >
         </div>
       </div>
       <div class="scroll">
@@ -929,6 +929,34 @@ const getList = async () => {
     rankSel(); //评分排行榜
   }
 };
+// 更新按钮
+const updateClick=async () => {
+    let res = await axios({
+      method: "get",
+      url: api.value + "/wanzai/api/smartSemester/pullSemesterTeacher",
+      headers: {
+        token: sessionStorage.getItem("token"),
+        user_head: sessionStorage.getItem("userhead"),
+      },
+    });
+    console.log(res, "教师分页");
+    if (res.data.code == 200) {
+      getList()
+      ElMessage({
+        type: "success",
+        showClose: true,
+        message: res.data.message,
+        center: true,
+      });
+    } else {
+      ElMessage({
+        type: "error",
+        showClose: true,
+        message: res.data.message,
+        center: true,
+      });
+    }
+};
 // 评分排行榜
 const rankSel = async () => {
   let formDatass = new FormData();

+ 76 - 193
src/views/trackSearch/trackSearch.vue

@@ -80,69 +80,70 @@
           <!-- 绘制地铁线路 -->
           <path
             id="biking-road"
-            d="M468,454 L568,346 L894,405 L870,265 L830,593 L621,261"
-            stroke="#009900"
+            d="M582,372 L652,402 L650,562 L760,233 L832,407 L810,590"
+            stroke="#409EFF"
             stroke-width="3"
             fill="none"
           />
           <!-- 绘制站点 -->
           <circle
-            cx="468"
-            cy="454"
-            r="8"
+            cx="582"
+            cy="372"
+            r="6"
             fill="white"
-            stroke="#009900"
+            stroke="#409EFF"
             stroke-width="2"
           />
           <circle
-            cx="568"
-            cy="346"
-            r="8"
+            cx="652"
+            cy="402"
+            r="6"
             fill="white"
-            stroke="#009900"
+            stroke="#409EFF"
             stroke-width="2"
           />
           <circle
-            cx="894"
-            cy="405"
-            r="8"
+            cx="650"
+            cy="562"
+            r="6"
             fill="white"
-            stroke="#009900"
+            stroke="#409EFF"
             stroke-width="2"
           />
           <circle
-            cx="870"
-            cy="265"
-            r="8"
+            cx="760"
+            cy="233"
+            r="6"
             fill="white"
-            stroke="#009900"
+            stroke="#409EFF"
             stroke-width="2"
           />
           <circle
-            cx="830"
-            cy="593"
-            r="8"
+            cx="832"
+            cy="407"
+            r="6"
             fill="white"
-            stroke="#009900"
+            stroke="#409EFF"
             stroke-width="2"
           />
           <circle
-            cx="621"
-            cy="261"
-            r="8"
+            cx="810"
+            cy="590"
+            r="6"
             fill="white"
-            stroke="#009900"
+            stroke="#409EFF"
             stroke-width="2"
           />
 
-          <text x="452" y="434" fill="#fff">探理楼</text>
+          <!-- <text x="452" y="434" fill="#fff">探理楼</text>
           <text x="544" y="326" fill="#fff">探问楼</text>
           <text x="870" y="385" fill="#fff">探真楼</text>
           <text x="845" y="245" fill="#fff">探学楼</text>
           <text x="800" y="573" fill="#fff">学校大门</text>
-          <text x="561" y="241" fill="#fff">地下停车场出口</text>
+          <text x="561" y="241" fill="#fff">地下停车场出口</text> -->
         </svg>
-        <svg
+        <img id="circle" style="width: 24px;height: 24px;" src="@/assets/man.png" alt="">
+        <!-- <svg
           t="1685007462176"
           class="icon"
           viewBox="0 0 1024 1024"
@@ -158,123 +159,12 @@
             fill="#ff3000"
             p-id="5616"
           ></path>
-        </svg>
+        </svg> -->
       </div>
-      <!-- 家长访客配置 -->
-      <el-dialog
-        class="patriarchDialog"
-        v-model="patriarchVisible"
-        :close-on-click-modal="false"
-        :close-on-press-escape="false"
-        title="家长访客配置"
-        align-center
-        width="650"
-        :before-close="patriarchCancel"
-      >
-        <el-form
-          ref="patriarchRef"
-          :model="patriarchRuleForm"
-          :rules="patriarchRules"
-          label-width="90px"
-          class="demo-ruleForm"
-          :size="formSize"
-          label-position="left"
-          status-icon
-        >
-          <el-form-item label="年级 :" prop="grade">
-            <el-select
-              v-model="patriarchRuleForm.grade"
-              placeholder="请选择年级"
-              style="width: 500px"
-              clearable
-            >
-              <el-option v-for="i in gradeData" :label="i.name" :value="i.id" />
-            </el-select>
-          </el-form-item>
-          <el-form-item label="班级 :" prop="class">
-            <el-select
-              v-model="patriarchRuleForm.class"
-              placeholder="请选择班级"
-              style="width: 500px"
-              clearable
-            >
-              <el-option v-for="i in classData" :label="i.name" :value="i.id" />
-            </el-select>
-          </el-form-item>
-          <p class="title">小程序设置</p>
-          <el-form-item label="" prop="app1">
-            <el-radio-group v-model="patriarchRuleForm.app1">
-              <el-radio :value="3">需要审核</el-radio>
-              <el-radio :value="6">不需要审核</el-radio>
-            </el-radio-group>
-          </el-form-item>
-          <el-form-item label="" prop="app2">
-            <el-radio-group v-model="patriarchRuleForm.app2">
-              <el-radio :value="3">需要推送</el-radio>
-              <el-radio :value="6">不需要推送</el-radio>
-            </el-radio-group>
-          </el-form-item>
-          <el-form-item label="" prop="app3">
-            <el-radio-group v-model="patriarchRuleForm.app3">
-              <el-radio :value="3">需要注销</el-radio>
-              <el-radio :value="6">不需要注销</el-radio>
-            </el-radio-group>
-          </el-form-item>
-          <p class="title">大屏审批设置</p>
-          <el-form-item label="" prop="large1">
-            <el-radio-group v-model="patriarchRuleForm.large1">
-              <el-radio :value="3">需要审核</el-radio>
-              <el-radio :value="6">不需要审核</el-radio>
-            </el-radio-group>
-          </el-form-item>
-          <el-form-item label="" prop="large2">
-            <el-radio-group v-model="patriarchRuleForm.large2">
-              <el-radio :value="3">需要推送</el-radio>
-              <el-radio :value="6">不需要推送</el-radio>
-            </el-radio-group>
-          </el-form-item>
-          <el-form-item label="" prop="large3">
-            <el-radio-group v-model="patriarchRuleForm.large3">
-              <el-radio :value="3">需要注销</el-radio>
-              <el-radio :value="6">不需要注销</el-radio>
-            </el-radio-group>
-          </el-form-item>
-          <p class="title">是否和门禁车闸联动</p>
-          <el-form-item label="" prop="entrance">
-            <el-radio-group v-model="patriarchRuleForm.entrance">
-              <el-radio :value="3">是</el-radio>
-              <el-radio :value="6">否</el-radio>
-            </el-radio-group>
-          </el-form-item>
-        </el-form>
-        <div class="options">
-          <el-button
-            color="rgba(41, 109, 227, 1)"
-            class="queding"
-            type="primary"
-            @click="patriarchConfirm(patriarchMRef)"
-          >
-            确认
-          </el-button>
-          <el-button @click="patriarchCancel">取消</el-button>
-        </div>
-      </el-dialog>
+     
     </div>
   </div>
-  <div class="bgImg" v-if="bgImg">
-    <el-carousel
-      @click="bgImg = false"
-      ref="bgImgs"
-      indicator-position
-      arrow="always"
-      :autoplay="false"
-      trigger
-    >
-      <el-carousel-item>
-        <img :src="showImg" alt="" />
-      </el-carousel-item>
-    </el-carousel>
-  </div>
+ 
 </template>
 
 <script setup>
@@ -303,21 +193,20 @@ const loading = ref(false);
 const tableData = reactive({
   list: [],
 });
-
+const classId=ref() // 获取所管理的班级的id(0是所有班级)
 const searchInput = reactive({
   keyWord: "",
-  createTime: "", // 创建时间
+  createTime: [], // 创建时间
 }); // 搜索按钮数据
 const keyWord = ref();
 
+
 const gradeData = ref([{ name: "刘晓晓-七年级-学生", id: 1 }]); // 下拉学生数据
 const currentPage = ref(1); // 当前页
 const pageCount = ref(100);
 const total = ref(5); // 当前总数
 const totalPage = ref(100); // 总页数
 
-const bgImg = ref(false);
-const showImg = ref("");
 
 // 预约记录分页数据
 const getList = async () => {
@@ -364,6 +253,9 @@ const gradeList = async () => {
     pageCount: pageCount.value,
     keyWord: keyWord.value,
   };
+  if(classId.value!=0){
+    data.schoolClass=classId.value
+  }
   let res = await axios({
     method: "get",
     url: api.value + "/wanzai/api/smartUser/getPage",
@@ -374,8 +266,11 @@ const gradeList = async () => {
     params: data,
   });
   console.log(res, JSON.parse(eds.decryptDes(res.data.data)), "用户下拉数据");
-  gradeData.value = JSON.parse(eds.decryptDes(res.data.data)).records;
-  totalPage.value = JSON.parse(eds.decryptDes(res.data.data)).pages;
+  let dataList=JSON.parse(eds.decryptDes(res.data.data))
+  gradeData.value = dataList.records;
+  totalPage.value = dataList.pages;
+  searchInput.keyWord=gradeData.value[0].id
+  getList();
 };
 // 联系人下拉框搜索时加载
 const keyWordMethod = (query) => {
@@ -415,19 +310,43 @@ const addGradeMore = async () => {
     console.log("数据全部加载完成");
   }
 };
-// 查看图片
-const imgClick = (row) => {
-  bgImg.value = true;
-  showImg.value = row;
-};
+
+// 判断为班主任 还是 超级管理员
+const getAdminId=async ()=>{
+  // 获取所管理的班级的id(0是所有班级)
+  let res = await axios({
+    method: "get",
+    url: api.value + "/wanzai/api/smartAuthorGroup/getClassById",
+    headers: {
+      token: sessionStorage.getItem("token"),
+      user_head: sessionStorage.getItem("userhead"),
+    },
+    params:{
+      userHead:sessionStorage.getItem("userhead")
+    },
+  });
+  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
+    gradeList()
+  } 
+}
+
 const xy = (event) => {
   console.log("X:" + event.offsetX);
   console.log("Y:" + event.offsetY);
 };
+
+
 onBeforeMount(async () => {
   api.value = store.state.user.api;
-  getList();
-  gradeList();
+  let dateEnd=dayjs().format('YYYY-MM-DD')
+  let dateStart=dayjs(dateEnd).subtract(7, 'day').format('YYYY-MM-DD')
+  searchInput.createTime=[dateStart,dateEnd]
+  console.log(dateStart,dateEnd);
+  getAdminId();
+
   nextTick(() => {
     gsap.registerPlugin(MotionPathPlugin);
     // bikingRoad.animation = "dash 10s linear forwards";
@@ -619,48 +538,12 @@ onUnmounted(() => {
       background: url("@/assets/trackImg.jpg");
       background-repeat: no-repeat; //是否平铺
       background-position: 70% 50%; //设置背景图像的起始位置
-      background-size: 120% 140%; //规定背景图像的尺寸
+      background-size: 100% 100%; //规定背景图像的尺寸
       svg {
         // border: 3px solid rgba(255, 255, 255, 1);
       }
     }
   }
-  // 家长访客配置
-  :deep(.patriarchDialog) {
-    //   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: 20px 30px;
-      .el-form {
-        .title {
-          color: #000;
-          font-weight: 800;
-        }
-        .el-form-item__content {
-          margin-left: 0 !important;
-        }
-      }
-      .options {
-        margin: 30px 20px 20px 0;
-        width: 100%;
-        display: flex;
-        flex-direction: row-reverse;
-        .queding {
-          color: #fff;
-          margin-left: 15px;
-        }
-      }
-    }
-  }
 
   .pageSize {
     display: flex;