|
@@ -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()
|
|
|
//进到界面开始轮询
|
|
|
})
|
|
|
//界面销毁函数
|