Skip to content

Commit 9b996c1

Browse files
Merge pull request #104 from sym-666/master
feat: add revive
2 parents a6bfdd3 + 5ea088c commit 9b996c1

15 files changed

Lines changed: 8496 additions & 61 deletions

File tree

package-lock.json

Lines changed: 8377 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/api/_request.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ export default function request<T = object>(config: AxiosRequestConfig) {
5151
(err: AxiosError<{ msg: string }>) => {
5252
const { msg = '' } = err.response!.data!;
5353
if (msg.includes('authentication failed')) {
54-
// 非登录态跳转SSO登录
54+
// 非登录态跳转SSO登录(开发环境禁用跳转)
55+
if (import.meta.env.DEV) {
56+
Message.error(msg || i18n.global.t('request.unknowErr'));
57+
return;
58+
}
5559
window.location.href = `//${SSO_DOMAIN}/login?from=${HR_DOMAIN_FE}`;
5660
return;
5761
}

src/components/navbar/components/create-newrec-modal.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ const formData = ref({
7272
const form = ref({
7373
name: '',
7474
beginning: '',
75+
start: '',
7576
deadline: '',
7677
end: '',
7778
});

src/constants/httpMsg/recruitment/createRecruitmentMsg.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { Recruitment } from './getRecruitmentMsg';
55
export interface CreateRecruitmentRequest {
66
name: string;
77
beginning: TimeString;
8+
start: TimeString;
89
deadline: TimeString;
910
end: TimeString;
1011
}

src/constants/team.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,9 @@ export const SMSTemplate: {
140140
match: [Step.OnlineGroupInterview, Step.OnlineTeamInterview],
141141
required: ['meeting_id'],
142142
},
143-
{
144-
i18nKey: 'sms.writtenTest',
145-
match: [Step.WrittenTest],
146-
required: ['time'],
147-
},
148143
{
149144
i18nKey: 'sms.base',
150-
match: [Step.StressTest],
145+
match: [Step.WrittenTest, Step.StressTest],
151146
restI18nKey: 'sms.rest.test',
152147
required: ['time', 'place', 'next'],
153148
},

src/locale/en-US/common.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
export default {};
1+
export default {
2+
'common.operation.confirmTerminate': 'Confirm terminate delivery?',
3+
'common.operation.confirmRevive': 'Confirm revive delivery?',
4+
'common.result.reviveTodo': 'Revive delivery is not implemented yet',
5+
};

src/locale/zh-CN/common.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default {
1212
'common.operation.submitComment': '发表评论',
1313
'common.operation.switchStage': '转移阶段',
1414
'common.operation.terminate': '终止投递',
15+
'common.operation.revive': '复活投递',
1516
'common.operation.dateManagement': '日程管理',
1617
'common.operation.addDate': '添加日程',
1718
'common.operation.deleteDate': '删除日程',
@@ -29,6 +30,7 @@ export default {
2930
'common.operation.allocate': '分配',
3031
'common.operation.allocateInterviewTime': '分配面试时间',
3132
'common.operation.confirmTerminate': '确认终止投递?',
33+
'common.operation.confirmRevive': '确认复活投递?',
3234
'common.operation.confirmDeleteComment': '确认删除该评论?',
3335
'common.operation.editContent': '编辑内容',
3436
'common.operation.currentTestFileOrUrl': '当前笔试文件/链接',
@@ -51,6 +53,8 @@ export default {
5153
'common.result.sendSuccess': '发送成功',
5254
'common.result.switchStageSuccess': '转移阶段成功',
5355
'common.result.terminateSuccess': '终止投递成功',
56+
'common.result.reviveSuccess': '复活投递成功',
57+
'common.result.reviveTodo': '复活投递功能待实现',
5458
'common.result.commentNotNull': '评论与评价不能同时为空',
5559
'common.result.uploadFileSuccess': '上传文件/链接成功',
5660
'common.result.setStressTestTimeSuccess': '设置熬测时间成功',

src/locale/zh-CN/sms.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ export default {
33
'{name}你好,请于{example_time}在启明学院亮胜楼{place}参加{next},请准时到场。',
44
'sms.onlineInterview':
55
'{name}你好,欢迎参加{recruitment_name} {group}组{online_interview_type},面试将于{example_time}进行,请在PC端点击腾讯会议参加面试,会议号{meeting_id},并提前调试好摄像头和麦克风,祝你面试顺利.',
6-
'sms.writtenTest':
7-
'{name}你好,你通过了{recruitment_name} {group}组{current}审核,请进入报名系统获取笔试题,并及时完成笔试。笔试的截止时间是{time},请务必及时将答案发送至招新平台,超时视为弃权,若有特殊情况导致无法准时完成笔试题或者放弃作答请及时联系招新群{group}组管理员。',
86
'sms.base':
97
'{name}你好,你通过了{recruitment_name} {group}组{current}审核,{rest}',
108
'sms.rest.test': '请于{time}在{place}参加{next},请务必准时到场',
11-
'sms.rest.timeSelection': '请进入报名系统选择面试时间',
9+
'sms.rest.timeSelection': '请进入选手dashboard系统选择面试时间',
1210
'sms.rest.pass': '你已成功加入{group}组',
1311
'sms.reject':
1412
'{name}你好,你没有通过{recruitment_name} {group}组{current}审核,请你{rest}不要灰心,继续学习。期待与更强大的你的相遇!',

src/store/modules/recruitment/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
deleteInterview,
1313
createInterview,
1414
} from '@/api';
15-
import { set } from 'lodash';
1615
import { getWrittenTestType, setWrittenTestType } from '@/api/recruitment';
1716
import {
1817
RecruitmentState,

src/views/components/notification-modal.vue

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -249,15 +249,6 @@ const preview = computed(() => {
249249
};
250250
});
251251
252-
const notifyFormRef = ref<any>(null);
253-
254-
watch(
255-
() => formData.value.next,
256-
() => {
257-
notifyFormRef.value?.clearValidate();
258-
},
259-
);
260-
261252
const generateSMSContent = (candidate: any) => {
262253
let example_time = `{${t('common.status.waitForDistribution')}}`;
263254
if (
@@ -308,6 +299,15 @@ const generateSMSContent = (candidate: any) => {
308299
});
309300
};
310301
302+
const notifyFormRef = ref<any>(null);
303+
304+
watch(
305+
() => formData.value.next,
306+
() => {
307+
notifyFormRef.value?.clearValidate();
308+
},
309+
);
310+
311311
watch(isCustom, (val) => {
312312
if (val) {
313313
props.candidates.forEach((candidate) => {
@@ -336,27 +336,23 @@ const handleNotify = async () => {
336336
}
337337
}
338338
339-
try {
340-
const resp = await Promise.all(
341-
props.candidates.map((candidate) => {
342-
const content = isCustom.value
343-
? customContents.value[candidate.aid]
344-
: generateSMSContent(candidate);
345-
return sendSms({
346-
aid: candidate.aid,
347-
content,
348-
});
349-
}),
350-
);
351-
if (!resp.every((x) => x)) return false;
352-
Message.success(t('common.result.sendSuccess'));
353-
notifyFormRef.value?.resetFields();
354-
[formData.value.next] = nextValidSteps.value;
355-
isCustom.value = false;
356-
return true;
357-
} catch {
358-
return false;
359-
}
339+
const reqs = props.candidates.map((candidate) => {
340+
const content = isCustom.value
341+
? customContents.value[candidate.aid]
342+
: generateSMSContent(candidate);
343+
return sendSms({
344+
aid: candidate.aid,
345+
content,
346+
});
347+
});
348+
349+
const resp = await Promise.all(reqs);
350+
if (!resp.every((x) => x)) return false;
351+
Message.success(t('common.result.sendSuccess'));
352+
notifyFormRef.value?.resetFields();
353+
[formData.value.next] = nextValidSteps.value;
354+
isCustom.value = false;
355+
return true;
360356
};
361357
</script>
362358

0 commit comments

Comments
 (0)