Skip to content

feat: 为“面试日常”添加"all"查看所有分组的选项 #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/views/interview/schedule/allGroups.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const allGroups = Symbol('all');
export default allGroups;
21 changes: 15 additions & 6 deletions src/views/interview/schedule/components/schedules.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
}}</span>
<a-dropdown>
<div class="cursor-pointer text-[--color-text-1] text-base">
<span class="mr-1"> {{ currentGroup }} </span>
<span class="mr-1">
{{
currentGroup === allGroups ? allGroups.description : currentGroup
}}
</span>
<icon-down />
</div>
<template #content>
Expand All @@ -15,7 +19,7 @@
:key="item"
@click="handleGroupClick(item)"
>
{{ item }}
{{ item === allGroups ? allGroups.description : item }}
</a-doption>
</template>
</a-dropdown>
Expand Down Expand Up @@ -81,6 +85,7 @@ import router from '@/router';
import { Group } from '@/constants/team';
import { computed } from 'vue';
import { useI18n } from 'vue-i18n';
import allGroups from '../allGroups';

interface CandidateInfo {
name: string;
Expand All @@ -96,13 +101,17 @@ const props = defineProps<{

const { t } = useI18n();

const currentGroup = defineModel<Group>({
const currentGroup = defineModel<Group | typeof allGroups>({
required: true,
});

const groups = computed(() =>
Object.values(Group).filter((x) => x !== Group.Unique),
);
const groups = computed(() => {
const ret: (Group | typeof allGroups)[] = Object.values(Group).filter(
(x) => x !== Group.Unique,
);
ret.unshift(allGroups);
return ret;
});

const goManagement = () => {
router.push({ name: 'interviewMangement' });
Expand Down
10 changes: 8 additions & 2 deletions src/views/interview/schedule/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import useRecruitmentStore from '@/store/modules/recruitment';
import dayjs from 'dayjs';
import calender from './components/calendar.vue';
import schedules from './components/schedules.vue';
import allGroups from './allGroups';

// 格式化日期
const formatToday = (date: Date) => {
Expand Down Expand Up @@ -55,7 +56,7 @@ function Duration(start: Date, end: Date) {
}

provide('formatToday', formatToday);
const currentGroup = ref(Group.Web);
const currentGroup = ref<Group | typeof allGroups>(allGroups);
const selectedDate = ref<string>('2024-01-01');
const recStore = useRecruitmentStore();

Expand Down Expand Up @@ -105,7 +106,12 @@ const filteredApps = computed(() =>
step === 'GroupInterview'
? selectedDate.value === formatDate(groupStartDate)
: selectedDate.value === formatDate(teamStartDate);
const isGroup = group === currentGroup.value;
let isGroup: boolean;
if (currentGroup.value === allGroups) {
isGroup = true;
} else {
isGroup = group === currentGroup.value;
}
return isStep && isGroup && isTime;
},
),
Expand Down