From 54651368795ee2393678aed7f99d019d9e501a1d Mon Sep 17 00:00:00 2001 From: Teo <2642673902@qq.com> Date: Fri, 29 Aug 2025 14:57:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=8F=AD=E7=BB=84=E9=99=90?= =?UTF-8?q?=E5=88=B6=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- src/App.vue | 2 -- src/store/modules/user.ts | 1 + src/utils/projectTeam.ts | 4 ++++ src/views/out/monthPlan/index.vue | 12 ++++++++++-- src/views/out/monthPlanAudit/index.vue | 9 ++++++++- 6 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.env.development b/.env.development index 1db4544..2439ac8 100644 --- a/.env.development +++ b/.env.development @@ -6,7 +6,7 @@ VITE_APP_ENV = 'development' # 开发环境 # 李陈杰 209 -VITE_APP_BASE_API = 'http://192.168.110.180:8899' +VITE_APP_BASE_API = 'http://192.168.110.209:8899' # 曾涛 # VITE_APP_BASE_API = 'http://192.168.110.180:8899' # 罗成 diff --git a/src/App.vue b/src/App.vue index a0780e4..8621d55 100644 --- a/src/App.vue +++ b/src/App.vue @@ -8,14 +8,12 @@ import useSettingsStore from '@/store/modules/settings'; import { handleThemeStyle } from '@/utils/theme'; import useAppStore from '@/store/modules/app'; -import { getProjectTeam } from './utils/projectTeam'; const appStore = useAppStore(); onMounted(() => { nextTick(() => { // 初始化主题样式 handleThemeStyle(useSettingsStore().theme); - getProjectTeam(); }); }); diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 086d45c..e04a9f5 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -134,6 +134,7 @@ export const useUserStore = defineStore('user', () => { roles.value = projectRole; const projectPermissions = permissionList.value.find((item) => item.projectId == selectedProject.value?.id)?.projectPermissions || []; permissions.value = projectPermissions; + getProjectTeam(); }; // 注销 diff --git a/src/utils/projectTeam.ts b/src/utils/projectTeam.ts index 1134b68..176c032 100644 --- a/src/utils/projectTeam.ts +++ b/src/utils/projectTeam.ts @@ -2,7 +2,11 @@ import $cache from '@/plugins/cache'; //获取班组列表 import { listProjectTeam } from '@/api/project/projectTeam'; import { ProjectTeamVO } from '@/api/project/projectTeam/types'; +import useUserStore from '@/store/modules/user'; export const getProjectTeam = async () => { + const isPermission = useUserStore().permissions.some((item) => item == 'project:team:list'); + if (!isPermission) return; + const { id } = $cache.local.getJSON('selectedProject'); const res = await listProjectTeam({ pageNum: 1, diff --git a/src/views/out/monthPlan/index.vue b/src/views/out/monthPlan/index.vue index e24ca17..dcaa8d1 100644 --- a/src/views/out/monthPlan/index.vue +++ b/src/views/out/monthPlan/index.vue @@ -8,7 +8,7 @@ - + @@ -113,6 +113,13 @@ import { useUserStoreHook } from '@/store/modules/user'; const userStore = useUserStoreHook(); // 从 store 中获取项目列表和当前选中的项目 const currentProject = computed(() => userStore.selectedProject); +const month = computed(() => { + const now = new Date(); + const year = now.getFullYear(); + const month = String(now.getMonth() + 1).padStart(2, '0'); // getMonth() 从0开始 + const currentMonth = `${year}-${month}`; + return currentMonth; +}); const monthPlanList = ref([]); const buttonLoading = ref(false); const loading = ref(true); @@ -152,7 +159,8 @@ const data = reactive({ planValue: undefined, completeValue: undefined, differenceValue: undefined, - planMonth: undefined, + planMonth: month.value, + valueType: undefined, planAuditStatus: undefined, completeAuditStatus: undefined, diff --git a/src/views/out/monthPlanAudit/index.vue b/src/views/out/monthPlanAudit/index.vue index b134549..28c058e 100644 --- a/src/views/out/monthPlanAudit/index.vue +++ b/src/views/out/monthPlanAudit/index.vue @@ -80,6 +80,13 @@ import { useUserStoreHook } from '@/store/modules/user'; const userStore = useUserStoreHook(); // 从 store 中获取项目列表和当前选中的项目 const currentProject = computed(() => userStore.selectedProject); +const month = computed(() => { + const now = new Date(); + const year = now.getFullYear(); + const month = String(now.getMonth() + 1).padStart(2, '0'); // getMonth() 从0开始 + const currentMonth = `${year}-${month}`; + return currentMonth; +}); const monthPlanAuditList = ref([]); const buttonLoading = ref(false); const loading = ref(true); @@ -116,7 +123,7 @@ const data = reactive>({ purchaseValue: undefined, constructionValue: undefined, totalValue: undefined, - planMonth: undefined, + planMonth: month.value, params: {} }, rules: {