Browse Source

权限接口调试完成,用户管理批量导入照片判断是否全部导入

hzj18279462576@163.com 2 years ago
parent
commit
df15577469

+ 1 - 29
src/layout/index.vue

@@ -15,6 +15,7 @@
 <script setup>
 import { ref, reactive, onBeforeMount, onMounted, watch } from "vue";
 import Navbar from "./sidebar/Navbar.vue";
+import { ElMessage, ElMessageBox } from "element-plus";
 import SidevarItem from "./sidebar/SidevarItem.vue";
 import { useStore } from "vuex";
 import axios from "axios";
@@ -38,35 +39,6 @@ const tableData = reactive({
 
 onBeforeMount(async () => {
   api.value = store.state.user.api;
-
-  const formDatas = new FormData();
-  formDatas.append("userId", 722);
-  let resData = await axios({
-    method: "post",
-    url: api.value + "/wanzai/api/smartAuthorGroup/queryUserAuthor",
-    headers: {
-      token: sessionStorage.getItem("token"),
-      user_head: sessionStorage.getItem("userhead"),
-    },
-    data: formDatas,
-  });
-  console.log(resData, "查看当前用户权限");
-  if (resData.data.code == 200) {
-    let roleList = resData.data.data[0].treAuthor;
-    roleList.forEach((item) => {
-      let list = item.route.split("/");
-      item.routeName = list[2];
-    });
-    sessionStorage.setItem("roleList", JSON.stringify(roleList));
-    store.commit("ROLELIST", "");
-  } else {
-    ElMessage({
-      type: "error",
-      showClose: true,
-      message: resData.data.message,
-      center: true,
-    });
-  }
 });
 </script>
 

+ 147 - 91
src/layout/sidebar/SidevarItem.vue

@@ -212,20 +212,28 @@
 </template>
 
 <script setup>
-import { ref, onBeforeMount, onMounted, watch, reactive } from "vue";
+import {
+  ref,
+  onBeforeMount,
+  onMounted,
+  onUnmounted,
+  watch,
+  reactive,
+  nextTick,
+} from "vue";
 import { useStore } from "vuex";
-
+import { ElMessage, ElMessageBox } from "element-plus";
 import { useRouter } from "vue-router";
-
+import axios from "axios";
 const store = useStore();
 const router = useRouter();
 
+const api = ref();
 const menuClose = ref(false);
 const activeIndex = ref(1);
 const acitveItems = reactive({ list: [] });
 const roles = ref();
 const roleList = ref();
-
 watch(
   () => store.state.user.collapse,
   (newValue, oldValue) => {
@@ -252,7 +260,7 @@ const handleSelect = (key, keyPath) => {
   // store.commit("indexUp", key);
   // activeIndex.value = key;
   // sessionStorage.setItem("sidevarItem", key);
-  console.log(key, keyPath);
+  // console.log(key, keyPath);
 
   router.push({
     path: `${key}`,
@@ -267,98 +275,146 @@ const handleSelect = (key, keyPath) => {
   //   });
   // }
 };
-onBeforeMount(() => {
-  activeIndex.value = sessionStorage.getItem("sidevarItem");
-  roleList.value = JSON.parse(sessionStorage.getItem("roleList"));
-  let classArr = [];
-  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 == "teacher" || item.routeName == "student") {
-      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 },
+const roleListData = async () => {};
+const roleListChange = async () => {
+  const formDatas = new FormData();
+  nextTick(async () => {
+    formDatas.append("userId", "");
+    let resData = await axios({
+      method: "post",
+      url: api.value + "/wanzai/api/smartAuthorGroup/queryUserAuthor",
+      headers: {
+        token: sessionStorage.getItem("token"),
+        user_head: sessionStorage.getItem("userhead"),
+      },
+      data: formDatas,
+    });
+    // console.log(resData, "查看当前用户权限");
+    if (resData.data.code == 200) {
+      let roleList = resData.data.data[0].treAuthor;
+      roleList.value = resData.data.data[0].treAuthor;
+      roleList.forEach((item) => {
+        let list = item.route.split("/");
+        item.routeName = list[2];
       });
+      sessionStorage.setItem("roleList", JSON.stringify(roleList));
+      store.commit("ROLELIST", "");
+      console.log("能监听到", roleList.value);
+      {
+        let classArr = [];
+        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 == "teacher" ||
+            item.routeName == "student"
+          ) {
+            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 },
+            });
+          }
+        });
+        // console.log(classArr, "年级管理");
+        // console.log(evaluateArr, "综合素质评价");
+        // console.log(dataExchangeArr, "数据交换");
+        // console.log(systemArr, "系统设置");
+
+        if (classArr.length != 0) {
+          // arr.push({
+          //   name: "classGrade",
+          //   meta: { isAuth: true, title: "年级管理" },
+          //   children: classArr,
+          // });
+          arr.splice(3, 0, {
+            name: "classGrade",
+            meta: { isAuth: true, title: "年级管理" },
+            children: classArr,
+          });
+        }
+        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,
+          });
+        }
+        roles.value = arr;
+        // roles.value = store.state.user.roles;
+        // console.log(roles.value, "1111111111111111111111111111111");
+      }
     } else {
-      arr.push({
-        name: item.routeName,
-        meta: { isAuth: true, title: item.name },
+      ElMessage({
+        type: "error",
+        showClose: true,
+        message: resData.data.message,
+        center: true,
       });
     }
   });
-  console.log(classArr, "年级管理");
-  console.log(evaluateArr, "综合素质评价");
-  console.log(dataExchangeArr, "数据交换");
-  console.log(systemArr, "系统设置");
+};
+onBeforeMount(() => {
+  activeIndex.value = sessionStorage.getItem("sidevarItem");
+  api.value = store.state.user.api;
+  roleListChange();
+});
+onMounted(() => {
+  window.addEventListener("storage", roleListChange);
+});
 
-  if (classArr.length != 0) {
-    // arr.push({
-    //   name: "classGrade",
-    //   meta: { isAuth: true, title: "年级管理" },
-    //   children: classArr,
-    // });
-    arr.splice(3, 0, {
-      name: "classGrade",
-      meta: { isAuth: true, title: "年级管理" },
-      children: classArr,
-    });
-  }
-  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,
-    });
-  }
-  roles.value = arr;
-  // roles.value = store.state.user.roles;
-  console.log(roles.value);
+onUnmounted(() => {
+  window.removeEventListener("storage", roleListChange);
 });
 </script>
 

+ 30 - 26
src/router/index.js

@@ -23,12 +23,12 @@ const routes = [
     name: "wanzai",
     component: Layout,
     children: [
-      // {
-      //   path: "home",
-      //   name: "home",
-      //   meta: { isAuth: true, title: "系统首页" },
-      //   component: () => import("@/views/home/home.vue"),
-      // },
+      {
+        path: "home",
+        name: "home",
+        meta: { isAuth: true, title: "系统首页" },
+        component: () => import("@/views/home/home.vue"),
+      },
       // {
       //   path: "user",
       //   name: "user",
@@ -168,30 +168,34 @@ const router = createRouter({
 router.beforeEach(async (to, from, next) => {
   NProgress.start(); // 进度条开始
 
-  let userhead = "1B0430E15102ADC65C43E475AC697D9A";
-  let token =
-    "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MTMyMzQ2NDQsImNhcmRObyI6IjAwMDAwMSIsImlhdCI6MTcxMzE0ODI0NH0.jxuGCqDkqzRa3poVNQq5aoSrKGDCZauXFLVKrB4M87s";
-  sessionStorage.setItem("token", token);
-  sessionStorage.setItem("userhead", userhead);
+  // let userhead = "1B0430E15102ADC65C43E475AC697D9A";
+  // let token =
+  //   "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MTMyMzQ2NDQsImNhcmRObyI6IjAwMDAwMSIsImlhdCI6MTcxMzE0ODI0NH0.jxuGCqDkqzRa3poVNQq5aoSrKGDCZauXFLVKrB4M87s";
+  // sessionStorage.setItem("token", token);
+  // sessionStorage.setItem("userhead", userhead);
 
   let hasRoutes = store.state.user.hasRoutes;
-  if (
-    sessionStorage.getItem("token") &&
-    sessionStorage.getItem("userhead") 
-  ) {
-    if (!hasRoutes) {
-      store.commit("ROLELIST", "");
-      store.commit("SET_ROUTES_STATE", true);
-      next({ ...to, replace: true });
-    } else {
-      console.log("当前无权限信息");
-    }
-    next();
-  } else {
-    if (to.path == "/login") {
+  if(to.path == "/wanzai/home"){
+    next()
+  }else{
+    if (
+      sessionStorage.getItem("token") &&
+      sessionStorage.getItem("userhead") 
+    ) {
+      if (!hasRoutes) {
+        store.commit("ROLELIST", "");
+        store.commit("SET_ROUTES_STATE", true);
+        next({ ...to, replace: true });
+      } else {
+        console.log("当前无权限信息");
+      }
       next();
     } else {
-      next(`/login`);
+      if (to.path == "/login") {
+        next();
+      } else {
+        next(`/login`);
+      }
     }
   }
   // next();

+ 1 - 2
src/store/modules/user.js

@@ -304,7 +304,6 @@ const mutations = {
   ROLELIST: async (state, value) => {
     let roleList = JSON.parse(sessionStorage.getItem("roleList"));
     console.log(roleList);
-
     if (roleList) {
       router.addRoute({
         path: "/wanzai",
@@ -326,7 +325,7 @@ const mutations = {
       });
       router.addRoute("wanzai",  {
         path: '/:pathMatch(.*)*',
-        name: 'NotFound',
+        name: 'notFound',
         component: () => import("@/views/notFound/notFound.vue")
       })
     }

+ 1 - 1
src/utils/request.js

@@ -1,7 +1,7 @@
 import axios from "axios";
 const service = axios.create({
     baseURL: import.meta.env.VITE_BASE_API, //接口统一域名
-    timeout: 6000, //设置超时
+    timeout: 10000, //设置超时
    
 });
 

+ 60 - 40
src/views/home/home.vue

@@ -1107,54 +1107,74 @@ onMounted(async () => {
     resizeChart();
   });
 
-  // if (
-  //   router.currentRoute.value.query.userhead &&
-  //   router.currentRoute.value.query.token
-  // ) {
-  //   let userhead = router.currentRoute.value.query.userhead;
-  //   let token = router.currentRoute.value.query.token;
-  //   sessionStorage.setItem("token", JSON.stringify(token));
-  //   sessionStorage.setItem("userhead", JSON.stringify(userhead));
-  //   const formDatas = new FormData();
-  //   formDatas.append("userId", 722);
-  //   let resData = await axios({
-  //     method: "post",
-  //     url: api.value + "/wanzai/api/smartAuthorGroup/queryUserAuthor",
-  //     headers: {
-  //       token: sessionStorage.getItem("token"),
-  //       user_head: sessionStorage.getItem("userhead"),
-  //     },
-  //     data: formDatas,
-  //   });
-  //   console.log(resData, "查看当前用户权限");
-  //   if (resData.data.code == 200) {
-  //     let roleList = resData.data.data[0].treAuthor;
-  //     sessionStorage.setItem("roleList", JSON.stringify(roleList));
-  //     store.commit("ROLELIST", "");
-  //   } else {
-  //     ElMessage({
-  //       type: "error",
-  //       showClose: true,
-  //       message: resData.data.message,
-  //       center: true,
-  //     });
-  //   }
-  // }
+  if (
+    router.currentRoute.value.query.userhead &&
+    router.currentRoute.value.query.token
+  ) {
+    let userhead = router.currentRoute.value.query.userhead;
+    let token = router.currentRoute.value.query.token;
+    sessionStorage.setItem("token", token);
+    sessionStorage.setItem("userhead", userhead);
+    console.log(userhead, "userhead");
+    console.log(token, "token");
+    const formDatas = new FormData();
+    formDatas.append("userId", "");
+    let resData = await axios({
+      method: "post",
+      url: api.value + "/wanzai/api/smartAuthorGroup/queryUserAuthor",
+      headers: {
+        token: sessionStorage.getItem("token"),
+        user_head: sessionStorage.getItem("userhead"),
+      },
+      data: formDatas,
+    });
+    console.log(resData, "查看当前用户权限");
+    if (resData.data.code == 200) {
+      let roleList = resData.data.data[0].treAuthor;
+      sessionStorage.setItem("roleList", JSON.stringify(roleList));
+      // store.commit("ROLELIST", "");
+      let flag = roleList.some((item) => {
+        return item.route == "/wanzai/home";
+      });
+      let address = roleList[0].route;
+      console.log(flag, address);
+      if (!flag) {
+        router.push({
+          path: `${address}`,
+        });
+      }
+    } else {
+      ElMessage({
+        type: "error",
+        showClose: true,
+        message: resData.data.message,
+        center: true,
+      });
+    }
+  }
 
   // let userhead = "1B0430E15102ADC65C43E475AC697D9A";
   // let token =
   //   "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MTMyMzQ2NDQsImNhcmRObyI6IjAwMDAwMSIsImlhdCI6MTcxMzE0ODI0NH0.jxuGCqDkqzRa3poVNQq5aoSrKGDCZauXFLVKrB4M87s";
   // sessionStorage.setItem("token", JSON.stringify(token));
   // sessionStorage.setItem("userhead", JSON.stringify(userhead));
-
-  
 });
 onUnmounted(() => {
-  echarts1.value.dispose();
-  echarts2.value.dispose();
-  echarts3.value.dispose();
-  echarts4.value.dispose();
-  echarts5.value.dispose();
+  if (echarts1.value) {
+    echarts1.value.dispose();
+  }
+  if (echarts2.value) {
+    echarts2.value.dispose();
+  }
+  if (echarts3.value) {
+    echarts3.value.dispose();
+  }
+  if (echarts4.value) {
+    echarts4.value.dispose();
+  }
+  if (echarts5.value) {
+    echarts5.value.dispose();
+  }
 });
 </script>
 

+ 14 - 4
src/views/notFound/notFound.vue

@@ -1,7 +1,5 @@
 <template>
-  <div class="content-box">
-   
-  </div>
+  <div class="content-box">页面找不到,请刷新页面</div>
 </template>
 
 <script setup>
@@ -17,7 +15,19 @@ const store = useStore();
 const router = useRouter();
 
 onBeforeMount(() => {
-  router.push({ path: `/wanzai/NotFound` });
+  // router.push({ path: `/wanzai/NotFound` });
+  let roleList = JSON.parse(sessionStorage.getItem("roleList"));
+  let flag = roleList.some((item) => {
+    return item.route == "/wanzai/home";
+  });
+  let address = roleList[0].route;
+  console.log(flag, address);
+  if (!flag) {
+    router.push({
+      path: `${address}`,
+    });
+    location.reload();
+  }
 });
 onUnmounted(() => {
   // document.removeEventListener("keyup", Enters);

+ 34 - 1
src/views/roles/roles.vue

@@ -415,7 +415,7 @@
               show-checkbox
               node-key="id"
               ref="treListTree"
-              :default-checked-keys="[1]"
+              :default-checked-keys="[]"
               :props="{
                 label: id,
                 children: childrenAddMemberClick,
@@ -1646,6 +1646,8 @@ const affirmTreList = async () => {
     treListVisible.value = false;
     // getUserAuthList(); // 所有用户权限数据
     allRolesData();
+    updataRoles()
+    location.reload();
     ElMessage({
       type: "success",
       showClose: true,
@@ -1676,6 +1678,37 @@ const handleCloseRoles = (row) => {
   console.log(menuList.value, "菜单权限");
   affirmTreList();
 };
+// 删除菜单更新界面
+const updataRoles=async ()=>{
+  const formDatas = new FormData();
+  formDatas.append("userId", 722);
+  let resData = await axios({
+    method: "post",
+    url: api.value + "/wanzai/api/smartAuthorGroup/queryUserAuthor",
+    headers: {
+      token: sessionStorage.getItem("token"),
+      user_head: sessionStorage.getItem("userhead"),
+    },
+    data: formDatas,
+  });
+  console.log(resData, "查看当前用户权限");
+  if (resData.data.code == 200) {
+    let roleList = resData.data.data[0].treAuthor;
+    roleList.forEach((item) => {
+      let list = item.route.split("/");
+      item.routeName = list[2];
+    });
+    sessionStorage.setItem("roleList", JSON.stringify(roleList));
+    store.commit("ROLELIST", "");
+  } else {
+    ElMessage({
+      type: "error",
+      showClose: true,
+      message: resData.data.message,
+      center: true,
+    });
+  }
+}
 
 // 表格斑马纹颜色修改
 const tableRowClassName = ({ row, rowIndex }) => {

+ 21 - 3
src/views/student/student.vue

@@ -293,7 +293,7 @@
           <el-form-item label="考试类型 :" prop="type">
             <el-select
               v-model="assessRuleForm.type"
-              placeholder="请选择考试类型"
+              placeholder="请先选择考核年级"
               multiple
               style="width: 400px"
             >
@@ -731,7 +731,23 @@ const assessType = async (value) => {
   //   "考试类型下拉数据"
   // );
   console.log(examType, "考试类型下拉数据");
-  examTypeData.value = JSON.parse(eds.decryptDes(examType.data.data));
+  if (examType.data.code == 200) {
+    examTypeData.value = JSON.parse(eds.decryptDes(examType.data.data));
+    // ElMessage({
+    //   type: "success",
+    //   showClose: true,
+    //   message: examType.data.message,
+    //   center: true,
+    // });
+  } else {
+    ElMessage({
+      type: "error",
+      showClose: true,
+      message: examType.data.message,
+      center: true,
+    });
+  }
+ 
 };
 
 // 搜索功能
@@ -1033,6 +1049,8 @@ const cancelAssess = () => {
 const criterionEditClick = async (row) => {
   criterionVisible.value = true;
   criterionTitle.value = "编辑评分项";
+  console.log(row);
+  
   let id = "";
   gradeData.value.forEach((item) => {
     if (item.name == row.grade) {
@@ -1042,8 +1060,8 @@ const criterionEditClick = async (row) => {
   assessType(id);
   assessRuleForm.grade = row.grade;
   assessRuleForm.term = row.term;
-  assessRuleForm.type = row.examType.split(",");
   assessRuleForm.id = row.id;
+  assessRuleForm.type = row.examType.split(",");
   // 编辑时的等级表格数据
   let formData = new FormData();
   formData.append("id", row.id);

+ 28 - 17
src/views/user/user.vue

@@ -16,7 +16,6 @@
       <el-tree
         :data="dataSource"
         node-key="id"
-        default-expand-all
         :expand-on-click-node="false"
       >
         <template #default="{ node, data }">
@@ -24,7 +23,7 @@
             <div class="title" @click="nodeClick(node, data)">
               <img src="@/assets/images/folder.png" alt="" />
               <!-- <img src="@/assets/images/document.png" alt="" /> -->
-              <span :class="data.id == departmentId ? 'nodeClick' : ''">{{
+              <span :class="data.id == treeNodeId ? 'nodeClick' : ''">{{
                 data.name
               }}</span>
             </div>
@@ -232,7 +231,7 @@
               <img src="@/assets/images/basicInfo.png" alt="" />
               <span>基本信息</span>
             </div>
-            <el-form-item label="学号 :" prop="serialNumber">
+            <el-form-item label="学号 :" :prop="addMemberRuleForm.identity == 1? '': 'serialNumber'">
               <el-input
                 :disabled="addMemberTitle == '编辑成员' ? true : false"
                 v-model="addMemberRuleForm.serialNumber"
@@ -290,7 +289,7 @@
                 
               </el-tooltip> -->
             </el-form-item>
-            <el-form-item label="身份证号 :" prop="icCard">
+            <el-form-item label="身份证号 :" :prop="addMemberRuleForm.identity == 1? '': 'icCard'">
               <el-input
                 v-model="addMemberRuleForm.icCard"
                 placeholder="请输入身份证号"
@@ -325,7 +324,7 @@
                 clearable
               />
             </el-form-item>
-            <el-form-item label="人脸照片 :" prop="facePhoto">
+            <el-form-item label="人脸照片 :" :prop="addMemberRuleForm.identity == 1 ? '' : 'facePhoto'">
               <div class="facePhoto">
                 <div v-if="addMemberRuleForm.facePhoto">
                   <img
@@ -407,7 +406,8 @@
             <el-form-item
               v-if="addMemberRuleForm.identity != 3"
               label="时间组 :"
-              prop="timeGroupId"
+              :prop="
+                addMemberRuleForm.identity == 1? '': 'timeGroupId'"
             >
               <el-select
                 v-model="addMemberRuleForm.timeGroupId"
@@ -602,8 +602,6 @@
         <div class="form">
           <div
             class="imgUpload"
-            v-loading="allImgShow"
-            element-loading-text="导入中..."
           >
             <el-upload
               style="width: 500px"
@@ -632,6 +630,8 @@
             </template> -->
             </el-upload>
             <el-upload
+            v-loading="imgLoading"
+            element-loading-text="图片导入中..."
               style="width: 500px"
               class="img-upload-demo"
               drag
@@ -666,10 +666,12 @@
           /> -->
           <div class="startImport">
             <el-button
+           
               type="primary"
               color="rgba(0, 97, 255, 1)"
               @click="bulkImport"
               plain
+              :disabled="allImgShow"
               >开始导入</el-button
             >
             <span
@@ -1343,7 +1345,7 @@ const timeGroupList = ref(); // 时间组下拉数据
 
 const conteactListData = ref(); // 联系人下拉数据
 const conteactListCurrentPage = ref(1); // 联系人下拉当前页数
-const conteactListPageCount = ref(30); // 联系人下拉一页数据条数
+const conteactListPageCount = ref(50); // 联系人下拉一页数据条数
 const conteactListTotalPage = ref(); // 联系人总共多少页,判断滚动到底是否还要加载
 const conteactListInput = ref(); // 联系人下拉框中的搜索字段
 const conteactLoading = ref(false); // 联系人下拉框搜索时加载
@@ -1449,8 +1451,8 @@ const addBatch_pageSize = ref(7);
 const addBatch_total = ref(8); // 当前总数
 const upload2 = ref(); // ref 导入文件ref
 const allImgUpload = ref(); // ref 导入图片ref
-const allImgNum = ref(0); // 导入图片的数量
-const allImgShow = ref(false); // 导入时的加载
+const allImgShow = ref(true) // 导入时判断图片和文件是否都有
+const imgLoading=ref(false)// 导入时判断图片全部导入成功
 const upload2File = ref(); // 批量导入的文件
 const uploadImgList = ref(); // 批量导入的图片列表
 
@@ -2281,6 +2283,7 @@ const addBatchClick = () => {
   addBatchShow.value = true;
   homeShow.value = false;
   delRecordShow.value = false;
+  allImgShow.value=true // 将开始导入按钮禁用
   nextTick(() => {
     const Ele = document.querySelector(".img-upload-demo .el-upload__input");
     Ele["webkitdirectory"] = true;
@@ -2292,6 +2295,7 @@ const addBatchConcel = () => {
   delRecordShow.value = false;
   upload2File.value = "";
   uploadImgList.value = "";
+  allImgShow.value=true
   allImgUpload.value.clearFiles();
   upload2.value.clearFiles();
 };
@@ -2488,6 +2492,7 @@ const handleChangeImgUpload = async (file, fileLists) => {
   uploadImgList.value = "";
   // allImgUpload.value.clearFiles();
 };
+let timer;
 // 可以获取图片参数
 const handleUploadImgUpload = async (file) => {
   // console.log(file, "22222222");
@@ -2516,20 +2521,30 @@ const handleUploadImgUpload = async (file) => {
         console.error(err);
       } else {
         // console.log(data, "图片获取成功");
-
         uploadImgList.value =
           uploadImgList.value + "," + "https://" + data.Location;
         // 成功
+        successAllImg()
       }
     }
   );
 };
-
+const successAllImg=()=>{
+  imgLoading.value=true
+  allImgShow.value=true
+  clearTimeout(timer);
+  timer =setInterval(()=>{
+    imgLoading.value=false
+    allImgShow.value=false
+  },1000)
+}
 // 文件上传成功时的钩子
 const handleSuccessImgUpload = (response, uploadFile, uploadFiles) => {
   // console.log(response,uploadFile,uploadFiles,"上传成功");
   console.log(uploadFiles.length, "上传成功");
+  // successAllImg()
 };
+
 // 重置按钮 重置上传文件
 const resetImport = () => {
   upload2File.value = "";
@@ -2539,10 +2554,8 @@ const resetImport = () => {
 };
 // 批量导入按钮
 const bulkImport = async () => {
-  allImgShow.value = true;
   if (upload2File.value && uploadImgList.value) {
   } else {
-    allImgShow.value = false;
     ElMessage({
       type: "warning",
       showClose: true,
@@ -2575,7 +2588,6 @@ const bulkImport = async () => {
     uploadImgList.value = "";
     allImgUpload.value.clearFiles();
     upload2.value.clearFiles();
-    allImgShow.value = false;
     ElMessage({
       type: "success",
       showClose: true,
@@ -2583,7 +2595,6 @@ const bulkImport = async () => {
       center: true,
     });
   } else {
-    allImgShow.value = false;
     ElMessage({
       type: "error",
       showClose: true,