Commit b82ddf70 authored by Mr.Tang's avatar Mr.Tang

DOM渲染错误bug修复

parent 776b2b1a
......@@ -124,11 +124,10 @@
</div>
</div>
<el-alert
v-if="birthdayPersonCount > 0"
v-if="showBirthdayAlert"
type="info"
show-icon
:class="'custom-blue-bg'"
v-hasRole="['hr']"
>
<template #default>
<span class="custom-blue-text">今日要过生日的人数: {{ birthdayPersonCount }}</span>
......@@ -137,11 +136,10 @@
</el-alert>
<!-- 季度提醒 -->
<el-alert
v-if="currentQuarterBirthCount > 0"
v-if="showSeasonCardAlert"
type="info"
show-icon
class="custom-orange-bg"
v-hasRole="['hr']"
>
<template #default>
<span class="custom-blue-text">
......@@ -386,6 +384,16 @@ const data = reactive({
const { queryParams, form, rules } = toRefs(data);
const userStore = useUserStore();
const showBirthdayAlert = computed(() => {
// 同时满足角色权限和业务条件
return userStore.roles[0] === 'hr' && birthdayPersonCount.value > 0;
});
const showSeasonCardAlert = computed(() => {
// 同时满足角色权限和业务条件
return userStore.roles[0] === 'hr' && currentQuarterBirthCount.value > 0;
});
// 获取当前日期
const today = new Date();
......@@ -710,6 +718,7 @@ function handleExport() {
onMounted(() => {
const userStore = useUserStore();
userStore.getInfo(); // 确保用户信息已加载
console.log("用户信息:", userStore.getInfo());
const currentUserId = userStore.id; // 获取当前用户的 id
console.log("当前用户 ID:", currentUserId);
getList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment