Sfoglia il codice sorgente

修改测试完成后--跳转到测试记录页面--测试计划待测条数不更新问题

plg 3 settimane fa
parent
commit
9b07783f29
1 ha cambiato i file con 16 aggiunte e 3 eliminazioni
  1. 16 3
      src/views/PopularizationScience.vue

+ 16 - 3
src/views/PopularizationScience.vue

@@ -3,7 +3,9 @@ import CpmdHeader from '@/components/CpmdHeader.vue';
 import { onMounted, onUnmounted, ref } from 'vue'
 import { format } from 'date-fns/format';
 
-import { menuStatusStore } from '@/stores'
+import { menuStatusStore, userInfoStore } from '@/stores'
+import { userPlanApi } from '@/api/home';
+const userInfo = userInfoStore()
 const menuStatus = menuStatusStore();
 
 menuStatus.saveActiveIndex('2')
@@ -171,10 +173,21 @@ const timeFormat = () => {
 // const add0 = (m: number) => {
 //     return m < 10 ? '0' + m : m
 // }
-
+const planNumGet = async () => {
+    if (userInfo.token) {
+        let userNo = ''
+        //登录的话
+        //判断当前是否有后台管理
+
+        userNo = userInfo.userInfo.userNo;
+        //调用根据用户查询计划的API
+        let res: any = await userPlanApi(userNo)
+        userInfo.savePlanCurrentNum(res.data.length)
+    }
+}
 //刚进入页面就将高度设置为页面需要的
 onMounted(() => {
-
+    planNumGet()
     //进到界面开始轮询
 })
 //界面销毁函数