fix(工作台): 修复工作台首页人员概览初始化全部bug&无数据暗黑插图替换

This commit is contained in:
xinxin.wu 2024-12-24 15:30:48 +08:00 committed by Craftsman
parent 60dda091f5
commit f8651b2287
5 changed files with 66 additions and 5 deletions

View File

@ -0,0 +1,41 @@
<svg width="98" height="98" viewBox="0 0 98 98" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_144_18236)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M26.1077 26.1602C23.8392 26.1602 22 27.986 22 30.238V37.0337H22.0568C22.0193 37.2558 22 37.4827 22 37.7144V92.0823C22 94.3343 23.8392 96.1602 26.1077 96.1602H80.9852C82.9175 96.1602 84.5886 94.8229 84.9997 92.9478L96.9044 38.5799C97.4618 36.0386 95.5114 33.6365 92.891 33.6365H62.39C60.5 33.6365 58.9667 32.1155 58.9667 30.238C58.9667 27.986 57.1275 26.1602 54.859 26.1602H26.1077Z" fill="#2E313D"/>
<path d="M80.5911 38.5225H15.4694C13.0861 38.5225 11.1533 40.4552 11.1533 42.8385V92.9655C11.1533 95.3488 13.0861 97.2804 15.4694 97.2804H80.5911C82.9744 97.2804 84.9072 95.3488 84.9072 92.9655V42.8385C84.9072 40.4552 82.9744 38.5225 80.5911 38.5225Z" fill="#434552" stroke="url(#paint0_linear_144_18236)" stroke-width="4.096"/>
<path d="M3.82743 48.0811H69.335C71.0629 48.0811 72.5762 49.2397 73.028 50.9077L84.3944 92.9658C85.0523 95.397 83.2202 97.7887 80.7027 97.7887H15.1939C13.466 97.7887 11.9527 96.63 11.5009 94.962L0.134464 52.904C-0.522169 50.4727 1.30873 48.0811 3.82743 48.0811Z" fill="#242633" stroke="url(#paint1_linear_144_18236)" stroke-width="4.096"/>
<path d="M29.7174 31.2319C29.7174 32.3558 28.8055 33.2677 27.6816 33.2677C26.5576 33.2677 25.647 32.3558 25.647 31.2319C25.647 30.1091 26.5576 29.1973 27.6816 29.1973C28.8055 29.1973 29.7174 30.1091 29.7174 31.2319Z" fill="#54293A"/>
<path d="M36.4996 31.2319C36.4996 32.3558 35.5889 33.2677 34.465 33.2677C33.3411 33.2677 32.4292 32.3558 32.4292 31.2319C32.4292 30.1091 33.3411 29.1973 34.465 29.1973C35.5889 29.1973 36.4996 30.1091 36.4996 31.2319Z" fill="#59472A"/>
<path d="M43.2801 31.2319C43.2801 32.3558 42.3695 33.2677 41.2455 33.2677C40.1216 33.2677 39.2109 32.3558 39.2109 31.2319C39.2109 30.1091 40.1216 29.1973 41.2455 29.1973C42.3695 29.1973 43.2801 30.1091 43.2801 31.2319Z" fill="#1E5146"/>
<path d="M29.299 64.0168C29.1612 63.19 29.7999 62.4375 30.6375 62.4375H37.3835C38.0474 62.4375 38.6129 62.9168 38.722 63.571L39.6266 68.9978C39.7644 69.8246 39.127 70.5771 38.2882 70.5771H31.5421C30.8783 70.5771 30.3127 70.0978 30.2037 69.4436L29.299 64.0168Z" fill="#2E313D"/>
<path d="M31.3357 74.8715C31.1979 74.0435 31.8354 73.291 32.6741 73.291H39.4202C40.0828 73.291 40.6496 73.7703 40.7574 74.4245L41.6621 79.8514C41.7999 80.6781 41.1624 81.4318 40.3237 81.4318H33.5776C32.915 81.4318 32.3482 80.9525 32.2404 80.2983L31.3357 74.8715Z" fill="#2E313D"/>
<path d="M42.8679 64.0168C42.7301 63.19 43.3676 62.4375 44.2063 62.4375H50.9524C51.615 62.4375 52.1818 62.9168 52.2908 63.571L53.1955 68.9978C53.3321 69.8246 52.6947 70.5771 51.8571 70.5771H45.111C44.4472 70.5771 43.8816 70.0978 43.7726 69.4436L42.8679 64.0168Z" fill="#5F2D7A"/>
<path d="M44.8997 74.8715C44.7619 74.0435 45.3993 73.291 46.2381 73.291H52.9842C53.648 73.291 54.2135 73.7703 54.3226 74.4245L55.2272 79.8514C55.365 80.6781 54.7276 81.4318 53.8888 81.4318H47.1428C46.4789 81.4318 45.9134 80.9525 45.8043 80.2983L44.8997 74.8715Z" fill="#2E313D"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M95.3836 6.98926C95.3836 6.98926 96.2403 8.87288 96.722 10.5193C97.3906 12.8031 96.8562 15.3997 96.7388 15.4248C96.0977 15.565 93.9217 12.5035 93.9565 10.7074C93.9864 9.09216 95.3836 6.98926 95.3836 6.98926Z" fill="#5B5E6A"/>
<g filter="url(#filter0_d_144_18236)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M64.9492 13.0931C64.9492 13.0931 77.6637 10.0784 82.0924 0C83.9568 0.413392 87.2376 2.05018 95.2131 6.81796C96.3274 7.48299 93.9693 10.6883 93.9693 10.6883C93.9693 10.6883 97.6826 13.9331 96.7696 15.2296C91.4973 22.7246 87.2819 25.4469 82.4303 25.6243C74.9054 23.7814 64.9492 13.0931 64.9492 13.0931Z" fill="#2E313D"/>
</g>
<path fill-rule="evenodd" clip-rule="evenodd" d="M38.8564 33.6826C41.2852 38.6122 39.2327 45.0359 35.8081 50.2147C40.2919 51.1194 48.1643 51.8826 54.3508 51.915C54.6444 51.9162 55.4568 51.5543 55.7324 51.5208C57.4027 51.3123 57.9467 49.8888 58.4452 49.3579C60.1347 45.9837 62.0063 43.3488 62.131 39.3035C62.1957 37.2294 62.0675 35.5183 61.8721 34.8269C59.2852 33.5712 54.485 35.0965 38.8564 33.6826Z" fill="#4E2B66"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M55.7301 47.9892C56.8672 48.9921 56.0141 51.8738 53.8872 51.9349C56.1459 51.8475 57.3202 50.9632 58.1529 50.0933C58.9869 49.2245 62.9027 45.1865 61.8555 34.8457C62.3803 43.6072 60.4511 47.9975 55.7301 47.9892Z" fill="#702F8F"/>
</g>
<defs>
<filter id="filter0_d_144_18236" x="64.9492" y="0" width="31.9648" height="218.109" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="192.484"/>
<feColorMatrix type="matrix" values="0 0 0 0 0.470588 0 0 0 0 0.219608 0 0 0 0 0.529412 0 0 0 0.3 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_144_18236"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_144_18236" result="shape"/>
</filter>
<linearGradient id="paint0_linear_144_18236" x1="47.8136" y1="42.2777" x2="76.7706" y2="103.627" gradientUnits="userSpaceOnUse">
<stop stop-color="#3C404F"/>
<stop offset="1" stop-color="#242633"/>
</linearGradient>
<linearGradient id="paint1_linear_144_18236" x1="28.918" y1="47.9389" x2="27.5" y2="104.16" gradientUnits="userSpaceOnUse">
<stop stop-color="#2E313D"/>
<stop offset="1" stop-color="#242633"/>
</linearGradient>
<clipPath id="clip0_144_18236">
<rect width="97.0521" height="97.7887" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -1,7 +1,7 @@
<template> <template>
<MsCard v-if="props.allScreen" simple :special-height="36"> <MsCard v-if="props.allScreen" simple :special-height="36">
<div class="flex h-full w-full flex-col items-center justify-center"> <div class="flex h-full w-full flex-col items-center justify-center">
<div class="no-config-svg"></div> <div :class="`no-config-svg no-config-svg-${appStore.isDarkTheme ? 'dark' : 'bright'}`"></div>
<div class="flex items-center"> <div class="flex items-center">
{{ {{
appStore.projectList.length appStore.projectList.length
@ -79,9 +79,14 @@
margin: 0 auto 24px; margin: 0 auto 24px;
width: 100px; width: 100px;
height: 104px; height: 104px;
background: url('@/assets/svg/config-work.svg');
background-size: cover; background-size: cover;
} }
.no-config-svg-bright {
background: url('@/assets/svg/config-work.svg');
}
.no-config-svg-dark {
background: url('@/assets/svg/config-work-dark.svg');
}
.no-card { .no-card {
@apply flex h-full w-full flex-col items-center justify-center gap-4; @apply flex h-full w-full flex-col items-center justify-center gap-4;
.no-card-svg-bright { .no-card-svg-bright {

View File

@ -145,7 +145,9 @@
key: item.value, key: item.value,
projectIds: defaultAllProjectType.includes(item.value) ? [] : [appStore.currentProjectId], projectIds: defaultAllProjectType.includes(item.value) ? [] : [appStore.currentProjectId],
handleUsers: [], handleUsers: [],
selectAll: !![WorkCardEnum.PROJECT_VIEW, WorkCardEnum.CREATE_BY_ME].includes(item.value), selectAll: [WorkCardEnum.PROJECT_VIEW, WorkCardEnum.CREATE_BY_ME, WorkCardEnum.PROJECT_MEMBER_VIEW].includes(
item.value
),
planId: '', planId: '',
groupId: '', groupId: '',
}; };

View File

@ -83,6 +83,10 @@
required: true, required: true,
}); });
const innerSelectAll = defineModel<boolean>('selectAll', {
required: true,
});
const projectId = ref<string>(innerProjectIds.value[0]); const projectId = ref<string>(innerProjectIds.value[0]);
const timeForm = inject<Ref<TimeFormParams>>( const timeForm = inject<Ref<TimeFormParams>>(
@ -142,10 +146,12 @@
await getMemberOptions(); await getMemberOptions();
if (setAll) { if (setAll) {
innerHandleUsers.value = [...memberOptions.value.map((e) => e.value)]; innerHandleUsers.value = [...memberOptions.value.map((e) => e.value)];
innerSelectAll.value = true;
} else { } else {
innerHandleUsers.value = innerHandleUsers.value.filter((id: string) => innerHandleUsers.value = innerHandleUsers.value.filter((id: string) =>
memberOptions.value.some((member) => member.value === id) memberOptions.value.some((member) => member.value === id)
); );
innerSelectAll.value = false;
} }
} }
await nextTick(); await nextTick();
@ -167,6 +173,7 @@
function popupVisibleChange(val: boolean) { function popupVisibleChange(val: boolean) {
if (!val) { if (!val) {
nextTick(() => { nextTick(() => {
innerSelectAll.value = innerHandleUsers.value.length === memberOptions.value.length;
initOverViewMemberDetail(); initOverViewMemberDetail();
emit('change'); emit('change');
}); });
@ -209,12 +216,16 @@
watch( watch(
() => props.refreshKey, () => props.refreshKey,
(refreshKey) => { (refreshKey) => {
if (props.item.selectAll && !innerHandleUsers.value.length) {
handleProjectChange(false, innerSelectAll.value);
} else {
handleProjectChange(!!refreshKey); handleProjectChange(!!refreshKey);
} }
}
); );
onMounted(() => { onMounted(() => {
handleProjectChange(false); handleProjectChange(false, props.item.selectAll);
}); });
onBeforeUnmount(() => { onBeforeUnmount(() => {

View File

@ -66,6 +66,7 @@
v-else-if="item.key === WorkCardEnum.PROJECT_MEMBER_VIEW" v-else-if="item.key === WorkCardEnum.PROJECT_MEMBER_VIEW"
v-model:projectIds="item.projectIds" v-model:projectIds="item.projectIds"
v-model:handleUsers="item.handleUsers" v-model:handleUsers="item.handleUsers"
v-model:selectAll="item.selectAll"
:item="item" :item="item"
:refresh-key="refreshKey" :refresh-key="refreshKey"
@change="changeHandler" @change="changeHandler"
@ -327,6 +328,7 @@
// //
async function handleRefresh() { async function handleRefresh() {
appStore.initProjectList();
await initDefaultList(); await initDefaultList();
refreshKey.value = Date.now(); refreshKey.value = Date.now();
} }