eli-video-interview 1.2.42-alpha.9 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/components/AiHeaderTitle/index.js +2 -10
- package/esm/components/AiHeaderTitleV2/index.d.ts +4 -0
- package/esm/components/AiHeaderTitleV2/index.js +39 -0
- package/esm/components/AiHeaderTitleV2/interface.d.ts +4 -0
- package/esm/components/AiHeaderTitleV2/interface.js +1 -0
- package/esm/components/Charts/ReportPie.js +13 -3
- package/esm/components/Charts/const.js +3 -3
- package/esm/components/ScoreBigBall/index.js +1 -1
- package/esm/constants/ai-question.d.ts +1 -1
- package/esm/constants/ai-question.js +3 -3
- package/esm/enum/ai-question.d.ts +11 -1
- package/esm/enum/ai-question.js +10 -0
- package/esm/modules/ai-ability/components/AbilityFormItem/index.js +11 -46
- package/esm/modules/ai-ability/components/AddAbility/index.js +2 -20
- package/esm/modules/ai-ability/components/UpdateAbility/index.js +6 -37
- package/esm/modules/ai-ability-select/Root.js +4 -2
- package/esm/modules/ai-ability-select/components/AiAbilityItem/AiAbilityDetail.d.ts +2 -2
- package/esm/modules/ai-ability-select/components/AiAbilityItem/AiAbilityDetail.js +2 -1
- package/esm/modules/ai-ability-select/components/AiAbilityItem/index.d.ts +2 -2
- package/esm/modules/ai-ability-select/components/AiAbilityItem/index.js +4 -4
- package/esm/modules/ai-ability-select/components/AiAbilityList/index.js +14 -2
- package/esm/modules/ai-ability-select/interface.d.ts +1 -0
- package/esm/modules/ai-question/Root.js +14 -14
- package/esm/modules/ai-question/components/AiAnalysis/AnalysisItem.js +13 -4
- package/esm/modules/ai-question/components/AiAssessmentCriteria/const.d.ts +43 -0
- package/esm/modules/ai-question/components/AiAssessmentCriteria/const.js +45 -2
- package/esm/modules/ai-question/components/AiAssessmentCriteria/index.js +39 -42
- package/esm/modules/ai-question/components/AiAssessmentCriteria/interface.d.ts +1 -0
- package/esm/modules/ai-question/components/BaseAccordion/index.js +4 -4
- package/esm/modules/ai-question/components/BaseAccordion/interface.d.ts +3 -0
- package/esm/modules/ai-question/components/BootVideo/index.js +12 -5
- package/esm/modules/ai-question/components/QuestionImport/index.js +2 -2
- package/esm/modules/ai-question/components/QuestionModel/Item.js +3 -3
- package/esm/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +6 -2
- package/esm/modules/ai-question/components/QuestionTemplate/index.js +1 -1
- package/esm/modules/ai-question/components/QuestionUpdate/AudioUploader.d.ts +6 -0
- package/esm/modules/ai-question/components/QuestionUpdate/AudioUploader.js +74 -0
- package/esm/modules/ai-question/components/QuestionUpdate/Form.js +19 -7
- package/esm/modules/ai-question/components/QuestionUpdate/RandomQuestion.js +13 -3
- package/esm/modules/ai-question/components/QuestionUpdate/VideoVoice.js +2 -2
- package/esm/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.d.ts +2 -1
- package/esm/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.js +4 -4
- package/esm/modules/ai-question/components/QuestionUpdate/const.js +3 -1
- package/esm/modules/ai-question/components/QuestionUpdate/index.js +3 -2
- package/esm/modules/ai-question/components/QuestionUpdate/interface.d.ts +6 -1
- package/esm/modules/ai-report/Root.js +6 -3
- package/esm/modules/ai-report/components/VideoQuestion/Video.d.ts +27 -0
- package/esm/modules/ai-report/components/VideoQuestion/Video.js +208 -0
- package/esm/modules/ai-report/interface.d.ts +2 -0
- package/esm/modules/ai-report/useAiReport.d.ts +2 -0
- package/esm/modules/ai-report/useAiReport.js +3 -1
- package/esm/modules/ai-report-v2/Root.d.ts +2 -2
- package/esm/modules/ai-report-v2/Root.js +18 -11
- package/esm/modules/ai-report-v2/components/AIEvaluate/Evaluate.d.ts +2 -4
- package/esm/modules/ai-report-v2/components/AIEvaluate/Evaluate.js +20 -20
- package/esm/modules/ai-report-v2/components/AIEvaluate/Graph.d.ts +13 -0
- package/esm/modules/ai-report-v2/components/AIEvaluate/Graph.js +86 -24
- package/esm/modules/ai-report-v2/components/AIEvaluate/index.d.ts +2 -2
- package/esm/modules/ai-report-v2/components/AIEvaluate/index.js +11 -7
- package/esm/modules/ai-report-v2/components/Candidate/Interface.d.ts +3 -0
- package/esm/modules/ai-report-v2/components/Candidate/Podium.js +2 -2
- package/esm/modules/ai-report-v2/components/Form/Form.js +34 -13
- package/esm/modules/ai-report-v2/components/Form/Nps.d.ts +1 -1
- package/esm/modules/ai-report-v2/components/Form/Nps.js +2 -0
- package/esm/modules/ai-report-v2/components/NotFinish/index.js +13 -5
- package/esm/modules/ai-report-v2/components/ReportHeader/ReportHeader.d.ts +4 -2
- package/esm/modules/ai-report-v2/components/ReportHeader/ReportHeader.js +28 -10
- package/esm/modules/ai-report-v2/components/Suggestion/index.js +1 -1
- package/esm/modules/ai-report-v2/components/VideoQuestion/Evaluate.d.ts +11 -0
- package/esm/modules/ai-report-v2/components/VideoQuestion/Evaluate.js +79 -0
- package/esm/modules/ai-report-v2/components/VideoQuestion/QuestionItem.js +49 -32
- package/esm/modules/ai-report-v2/components/VideoQuestion/Workplaces.d.ts +9 -5
- package/esm/modules/ai-report-v2/components/VideoQuestion/Workplaces.js +71 -6
- package/esm/modules/ai-report-v2/components/VideoQuestion/index.d.ts +6 -3
- package/esm/modules/ai-report-v2/components/VideoQuestion/index.js +6 -4
- package/esm/modules/ai-report-v2/components/VideoQuestion/interface.d.ts +1 -0
- package/esm/modules/ai-report-v2/components/VideoQuestion/styled.js +2 -2
- package/esm/modules/ai-report-v2/components/WorkPlaces/index.js +1 -1
- package/esm/modules/ai-report-v2/components/styled.d.ts +4 -1
- package/esm/modules/ai-report-v2/components/styled.js +14 -3
- package/esm/modules/ai-report-v2/interface.d.ts +4 -1
- package/esm/modules/ai-report-v2/useAiReport.d.ts +4 -0
- package/esm/modules/ai-report-v2/useAiReport.js +3 -1
- package/esm/modules/ai-report-v2/useAiReportVersion.d.ts +5 -0
- package/esm/modules/ai-report-v2/useAiReportVersion.js +37 -0
- package/esm/services/ai-report.d.ts +10 -0
- package/esm/services/ai-report.js +2 -0
- package/esm/store/ai-question/ai-analysis-store.d.ts +3 -1
- package/esm/store/ai-question/ai-analysis-store.js +26 -1
- package/esm/store/ai-report/global-store.d.ts +3 -0
- package/lib/components/AiHeaderTitle/index.js +1 -9
- package/lib/components/AiHeaderTitleV2/index.d.ts +4 -0
- package/lib/components/AiHeaderTitleV2/index.js +41 -0
- package/lib/components/AiHeaderTitleV2/interface.d.ts +4 -0
- package/lib/components/AiHeaderTitleV2/interface.js +2 -0
- package/lib/components/Charts/ReportPie.js +13 -3
- package/lib/components/Charts/const.js +3 -3
- package/lib/components/ScoreBigBall/index.js +1 -1
- package/lib/constants/ai-question.d.ts +1 -1
- package/lib/constants/ai-question.js +3 -3
- package/lib/enum/ai-question.d.ts +11 -1
- package/lib/enum/ai-question.js +10 -0
- package/lib/modules/ai-ability/components/AbilityFormItem/index.js +13 -45
- package/lib/modules/ai-ability/components/AddAbility/index.js +2 -20
- package/lib/modules/ai-ability/components/UpdateAbility/index.js +6 -37
- package/lib/modules/ai-ability-select/Root.js +4 -2
- package/lib/modules/ai-ability-select/components/AiAbilityItem/AiAbilityDetail.d.ts +2 -2
- package/lib/modules/ai-ability-select/components/AiAbilityItem/AiAbilityDetail.js +2 -1
- package/lib/modules/ai-ability-select/components/AiAbilityItem/index.d.ts +2 -2
- package/lib/modules/ai-ability-select/components/AiAbilityItem/index.js +4 -4
- package/lib/modules/ai-ability-select/components/AiAbilityList/index.js +14 -2
- package/lib/modules/ai-ability-select/interface.d.ts +1 -0
- package/lib/modules/ai-question/Root.js +14 -14
- package/lib/modules/ai-question/components/AiAnalysis/AnalysisItem.js +12 -3
- package/lib/modules/ai-question/components/AiAssessmentCriteria/const.d.ts +43 -0
- package/lib/modules/ai-question/components/AiAssessmentCriteria/const.js +46 -3
- package/lib/modules/ai-question/components/AiAssessmentCriteria/index.js +36 -39
- package/lib/modules/ai-question/components/AiAssessmentCriteria/interface.d.ts +1 -0
- package/lib/modules/ai-question/components/BaseAccordion/index.js +4 -4
- package/lib/modules/ai-question/components/BaseAccordion/interface.d.ts +3 -0
- package/lib/modules/ai-question/components/BootVideo/index.js +12 -5
- package/lib/modules/ai-question/components/QuestionImport/index.js +2 -2
- package/lib/modules/ai-question/components/QuestionModel/Item.js +3 -3
- package/lib/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +5 -1
- package/lib/modules/ai-question/components/QuestionTemplate/index.js +1 -1
- package/lib/modules/ai-question/components/QuestionUpdate/AudioUploader.d.ts +6 -0
- package/lib/modules/ai-question/components/QuestionUpdate/AudioUploader.js +76 -0
- package/lib/modules/ai-question/components/QuestionUpdate/Form.js +20 -8
- package/lib/modules/ai-question/components/QuestionUpdate/RandomQuestion.js +12 -2
- package/lib/modules/ai-question/components/QuestionUpdate/VideoVoice.js +2 -2
- package/lib/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.d.ts +2 -1
- package/lib/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.js +4 -4
- package/lib/modules/ai-question/components/QuestionUpdate/const.js +3 -1
- package/lib/modules/ai-question/components/QuestionUpdate/index.js +3 -2
- package/lib/modules/ai-question/components/QuestionUpdate/interface.d.ts +6 -1
- package/lib/modules/ai-report/Root.js +6 -3
- package/lib/modules/ai-report/components/VideoQuestion/Video.d.ts +27 -0
- package/lib/modules/ai-report/components/VideoQuestion/Video.js +213 -0
- package/lib/modules/ai-report/interface.d.ts +2 -0
- package/lib/modules/ai-report/useAiReport.d.ts +2 -0
- package/lib/modules/ai-report/useAiReport.js +6 -1
- package/lib/modules/ai-report-v2/Root.d.ts +2 -2
- package/lib/modules/ai-report-v2/Root.js +16 -9
- package/lib/modules/ai-report-v2/components/AIEvaluate/Evaluate.d.ts +2 -4
- package/lib/modules/ai-report-v2/components/AIEvaluate/Evaluate.js +17 -17
- package/lib/modules/ai-report-v2/components/AIEvaluate/Graph.d.ts +13 -0
- package/lib/modules/ai-report-v2/components/AIEvaluate/Graph.js +88 -23
- package/lib/modules/ai-report-v2/components/AIEvaluate/index.d.ts +2 -2
- package/lib/modules/ai-report-v2/components/AIEvaluate/index.js +11 -7
- package/lib/modules/ai-report-v2/components/Candidate/Interface.d.ts +3 -0
- package/lib/modules/ai-report-v2/components/Candidate/Podium.js +1 -1
- package/lib/modules/ai-report-v2/components/Form/Form.js +34 -13
- package/lib/modules/ai-report-v2/components/Form/Nps.d.ts +1 -1
- package/lib/modules/ai-report-v2/components/Form/Nps.js +2 -0
- package/lib/modules/ai-report-v2/components/NotFinish/index.js +12 -4
- package/lib/modules/ai-report-v2/components/ReportHeader/ReportHeader.d.ts +4 -2
- package/lib/modules/ai-report-v2/components/ReportHeader/ReportHeader.js +27 -9
- package/lib/modules/ai-report-v2/components/Suggestion/index.js +2 -2
- package/lib/modules/ai-report-v2/components/VideoQuestion/Evaluate.d.ts +11 -0
- package/lib/modules/ai-report-v2/components/VideoQuestion/Evaluate.js +81 -0
- package/lib/modules/ai-report-v2/components/VideoQuestion/QuestionItem.js +46 -29
- package/lib/modules/ai-report-v2/components/VideoQuestion/Workplaces.d.ts +9 -5
- package/lib/modules/ai-report-v2/components/VideoQuestion/Workplaces.js +69 -4
- package/lib/modules/ai-report-v2/components/VideoQuestion/index.d.ts +6 -3
- package/lib/modules/ai-report-v2/components/VideoQuestion/index.js +6 -4
- package/lib/modules/ai-report-v2/components/VideoQuestion/interface.d.ts +1 -0
- package/lib/modules/ai-report-v2/components/VideoQuestion/styled.js +2 -2
- package/lib/modules/ai-report-v2/components/WorkPlaces/index.js +2 -2
- package/lib/modules/ai-report-v2/components/styled.d.ts +4 -1
- package/lib/modules/ai-report-v2/components/styled.js +18 -4
- package/lib/modules/ai-report-v2/interface.d.ts +4 -1
- package/lib/modules/ai-report-v2/useAiReport.d.ts +4 -0
- package/lib/modules/ai-report-v2/useAiReport.js +6 -1
- package/lib/modules/ai-report-v2/useAiReportVersion.d.ts +5 -0
- package/lib/modules/ai-report-v2/useAiReportVersion.js +41 -0
- package/lib/services/ai-report.d.ts +10 -0
- package/lib/services/ai-report.js +5 -1
- package/lib/store/ai-question/ai-analysis-store.d.ts +3 -1
- package/lib/store/ai-question/ai-analysis-store.js +26 -1
- package/lib/store/ai-report/global-store.d.ts +3 -0
- package/package.json +4 -2
|
@@ -9,7 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx,
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
13
|
import { FormReport } from './components/Form';
|
|
14
14
|
import NotFinish from './components/NotFinish';
|
|
15
15
|
import ReportHeader from './components/ReportHeader/ReportHeader';
|
|
@@ -18,11 +18,12 @@ import { INTERVIEW_STATUS } from "../../enum/ai-report";
|
|
|
18
18
|
import { PostAiInterviewResult } from "../../services/ai-report";
|
|
19
19
|
import { useAiReportStore } from "../../store/ai-report/global-store";
|
|
20
20
|
import { useRequest } from 'ahooks';
|
|
21
|
-
import { Box, Button,
|
|
21
|
+
import { Box, Button, Typography } from 'fbm-ui';
|
|
22
|
+
import { Stack } from 'fbm-ui/lib/mui';
|
|
22
23
|
import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
|
23
24
|
var NO_ANSWER = INTERVIEW_STATUS.NO_ANSWER;
|
|
24
25
|
var AiReportRoot = forwardRef(function (props, ref) {
|
|
25
|
-
var token = props.token, customScore = props.customScore, reminderSent = props.reminderSent, operableButtons = props.operableButtons, onLoad = props.onLoad, onSendReminderClick = props.onSendReminderClick, fetchFormResult = props.fetchFormResult, fetchCandidateInfo = props.fetchCandidateInfo;
|
|
26
|
+
var token = props.token, customScore = props.customScore, reminderSent = props.reminderSent, operableButtons = props.operableButtons, onLoad = props.onLoad, onSendReminderClick = props.onSendReminderClick, fetchFormResult = props.fetchFormResult, fetchCandidateInfo = props.fetchCandidateInfo, fetchReportUrl = props.fetchReportUrl, isExportPdf = props.isExportPdf;
|
|
26
27
|
var firstLoad = useRef(true);
|
|
27
28
|
var _a = useAiReportStore(), updateState = _a.updateState, updateReportResult = _a.updateReportResult, reportResult = _a.reportResult;
|
|
28
29
|
var _b = (reportResult || {}).collection, collection = _b === void 0 ? [] : _b;
|
|
@@ -62,20 +63,24 @@ var AiReportRoot = forwardRef(function (props, ref) {
|
|
|
62
63
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
63
64
|
}, [JSON.stringify(props)]);
|
|
64
65
|
var aiReportResult = useMemo(function () {
|
|
66
|
+
if (loading) {
|
|
67
|
+
return (_jsxs(Box, __assign({ width: "100%", display: "flex", alignItems: "center", justifyContent: "center", flexDirection: "column", style: { marginTop: '149px' } }, { children: [_jsx(Box, { children: _jsx("img", { src: "//webcdn.fbmms.cn/web/saas/asset/image/CandidateInfoEmpty.png", alt: "", style: { width: '140px', height: '140px' } }) }), _jsx(Box, __assign({ mt: 2 }, { children: _jsx(Typography, __assign({ variant: "body1", color: "textPrimary", style: { fontWeight: '500' } }, { children: "\u62A5\u544A\u52A0\u8F7D\u4E2D\uFF0C\u8BF7\u7A0D\u540E" })) }))] })));
|
|
68
|
+
}
|
|
65
69
|
if (status === NO_ANSWER) {
|
|
66
70
|
return (_jsxs(Box, __assign({ width: "100%", display: "flex", alignItems: "center", justifyContent: "center", flexDirection: "column", style: { marginTop: '149px' } }, { children: [_jsx(Box, { children: _jsx("img", { src: "//webcdn.fbmms.cn/web/saas/asset/image/CandidateInfoEmpty.png", alt: "", style: { width: '140px', height: '140px' } }) }), _jsx(Box, __assign({ mt: 2 }, { children: _jsx(Typography, __assign({ variant: "body1", color: "textPrimary", style: { fontWeight: '500' } }, { children: "\u8BE5\u5019\u9009\u4EBA\u5C1A\u672A\u5F00\u59CB\u9762\u8BD5" })) })), (operableButtons === null || operableButtons === void 0 ? void 0 : operableButtons.includes('sendReminder')) && (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ style: { marginTop: '2px' } }, { children: _jsx(Typography, __assign({ variant: "body2", color: "textSecondary" }, { children: "\u82E5\u957F\u65F6\u95F4\u672A\u5F00\u59CB\uFF0C\u5EFA\u8BAE\u4F60\u7ED9\u5019\u9009\u4EBA\u53D1\u9001\u77ED\u4FE1\u63D0\u9192" })) })), _jsx(Box, __assign({ mt: 2 }, { children: _jsx(Button, __assign({ size: "large", variant: "outlined", color: "primary", disabled: reminderSent, onClick: onSendReminderClick }, { children: reminderSent ? '已提醒' : '发送提醒' })) }))] }))] })));
|
|
67
71
|
}
|
|
68
72
|
else {
|
|
69
|
-
return (_jsxs(Box, __assign({ pb: 3, sx: {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
return (_jsxs(Stack, { children: [_jsx(NotFinish, {}), _jsxs(Box, __assign({ pb: 3, sx: {
|
|
74
|
+
background: '#F0F9FF',
|
|
75
|
+
backgroundImage: "url('//webcdn.fbmms.cn/assets/9kTa/pmsfSOeFx_7jhhsV9f_ta')",
|
|
76
|
+
backgroundSize: 'contain',
|
|
77
|
+
backgroundRepeat: 'no-repeat',
|
|
78
|
+
backgroundPosition: 'center top',
|
|
79
|
+
paddingTop: (collection === null || collection === void 0 ? void 0 : collection.length) > 0 ? 0 : 3,
|
|
80
|
+
} }, { children: [(collection === null || collection === void 0 ? void 0 : collection.length) > 0 && (_jsx(ReportHeader, { customScore: customScore, onRefreshSuccess: handleRefreshSuccess, fetchCandidateInfo: fetchCandidateInfo, status: status, fetchReportUrl: fetchReportUrl })), _jsx(FormReport, { fetchFormResult: fetchFormResult }), _jsx(Box, __assign({ sx: { zIndex: 1, position: 'relative', mx: 2, borderRadius: 4, border: '2px solid #FFFFFF', pb: 1 } }, { children: _jsx(VideoQuestion, { isExportPdf: isExportPdf }) }))] }))] }));
|
|
77
81
|
}
|
|
78
82
|
}, [
|
|
83
|
+
loading,
|
|
79
84
|
status,
|
|
80
85
|
operableButtons,
|
|
81
86
|
reminderSent,
|
|
@@ -84,7 +89,9 @@ var AiReportRoot = forwardRef(function (props, ref) {
|
|
|
84
89
|
customScore,
|
|
85
90
|
handleRefreshSuccess,
|
|
86
91
|
fetchCandidateInfo,
|
|
92
|
+
fetchReportUrl,
|
|
87
93
|
fetchFormResult,
|
|
94
|
+
isExportPdf,
|
|
88
95
|
]);
|
|
89
96
|
return (_jsx(Box, __assign({ loading: firstLoad.current && loading, sx: { width: '100%', minHeight: '618px', height: '100%', margin: '0 auto', overflow: 'auto' } }, { children: aiReportResult })));
|
|
90
97
|
});
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
declare type Mode = 'edit' | 'show';
|
|
3
|
-
declare type Field = 'evaluations' | 'suggestions';
|
|
4
3
|
interface EvaluateProps {
|
|
5
4
|
title: string;
|
|
6
|
-
|
|
7
|
-
field: Field;
|
|
8
|
-
evaluations: string;
|
|
5
|
+
evaluation: string;
|
|
9
6
|
mode?: Mode;
|
|
10
7
|
canEdit?: boolean;
|
|
8
|
+
orderToken: string;
|
|
11
9
|
}
|
|
12
10
|
declare const Evaluate: React.FC<EvaluateProps>;
|
|
13
11
|
export default Evaluate;
|
|
@@ -26,13 +26,13 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
26
26
|
return ar;
|
|
27
27
|
};
|
|
28
28
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
|
-
import {
|
|
30
|
-
import { Button, confirm,
|
|
29
|
+
import { PostInterviewEvaluation } from "../../../../services/ai-report";
|
|
30
|
+
import { Button, confirm, FormItem, Typography } from 'fbm-ui';
|
|
31
31
|
import { Box, Stack } from 'fbm-ui/lib/mui';
|
|
32
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
32
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
33
33
|
var Evaluate = function (_a) {
|
|
34
|
-
var title = _a.title,
|
|
35
|
-
var _d = __read(useState(
|
|
34
|
+
var title = _a.title, evaluation = _a.evaluation, orderToken = _a.orderToken, _b = _a.mode, mode = _b === void 0 ? 'show' : _b, _c = _a.canEdit, canEdit = _c === void 0 ? 'false' : _c;
|
|
35
|
+
var _d = __read(useState(evaluation), 2), content = _d[0], setContent = _d[1];
|
|
36
36
|
var _e = __read(useState('show'), 2), internalMode = _e[0], setInternalMode = _e[1];
|
|
37
37
|
var handleChange = useCallback(function (e) {
|
|
38
38
|
var value = e.target.value;
|
|
@@ -41,7 +41,12 @@ var Evaluate = function (_a) {
|
|
|
41
41
|
var handleModeChange = useCallback(function () {
|
|
42
42
|
setInternalMode(internalMode === 'show' ? 'edit' : 'show');
|
|
43
43
|
}, [internalMode]);
|
|
44
|
+
var isValidate = useMemo(function () {
|
|
45
|
+
return content.trim().length > 0;
|
|
46
|
+
}, [content]);
|
|
44
47
|
var handleSubmit = useCallback(function () {
|
|
48
|
+
if (!isValidate)
|
|
49
|
+
return;
|
|
45
50
|
confirm({
|
|
46
51
|
header: null,
|
|
47
52
|
content: '确认将评价内容修改吗?该动作无法被撤销。',
|
|
@@ -52,19 +57,14 @@ var Evaluate = function (_a) {
|
|
|
52
57
|
},
|
|
53
58
|
onOk: function (_a) {
|
|
54
59
|
var onClose = _a.onClose;
|
|
55
|
-
var data =
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
: {
|
|
61
|
-
evaluationToken: token,
|
|
62
|
-
manualSuggestions: [content],
|
|
63
|
-
};
|
|
64
|
-
PostAiInterviewEvaluation(data).then(handleModeChange).then(onClose).catch(console.log);
|
|
60
|
+
var data = {
|
|
61
|
+
orderToken: orderToken,
|
|
62
|
+
manualEvaluation: content,
|
|
63
|
+
};
|
|
64
|
+
PostInterviewEvaluation(data).then(handleModeChange).then(onClose).catch(console.error);
|
|
65
65
|
},
|
|
66
66
|
});
|
|
67
|
-
}, [
|
|
67
|
+
}, [isValidate, orderToken, content, handleModeChange]);
|
|
68
68
|
useEffect(function () {
|
|
69
69
|
setInternalMode(mode);
|
|
70
70
|
}, [mode]);
|
|
@@ -73,8 +73,8 @@ var Evaluate = function (_a) {
|
|
|
73
73
|
background: '#FFFBE8',
|
|
74
74
|
boxShadow: ' 0px 2px 6px 0px rgba(91,108,95,0.15)',
|
|
75
75
|
padding: '8px 24px',
|
|
76
|
-
borderRadius:
|
|
77
|
-
} }, { children: [_jsxs(Stack, __assign({ direction: "row", alignItems: "center", justifyContent: "space-between" }, { children: [_jsx(Box, __assign({ sx: {
|
|
76
|
+
borderRadius: 3,
|
|
77
|
+
} }, { children: [_jsxs(Stack, __assign({ direction: "row", alignItems: "center", justifyContent: "space-between", height: 36, mb: 1, position: "relative" }, { children: [_jsx(Box, __assign({ sx: {
|
|
78
78
|
position: 'relative',
|
|
79
79
|
'&:after': {
|
|
80
80
|
position: 'absolute',
|
|
@@ -88,9 +88,9 @@ var Evaluate = function (_a) {
|
|
|
88
88
|
display: 'inline-block',
|
|
89
89
|
margin: '0 4px',
|
|
90
90
|
},
|
|
91
|
-
} }, { children: _jsx(Typography, __assign({
|
|
91
|
+
} }, { children: _jsx(Typography, __assign({ fontWeight: "medium", zIndex: 1, sx: { position: 'relative', zIndex: 1 } }, { children: title })) })), canEdit && (_jsx("img", { onClick: handleModeChange, src: "https://webcdn.fbmms.cn/assets/pWED/KpgryvNScI7XZdjNBgTNC", alt: "", style: { width: 36, height: 36, position: 'absolute', top: -8, right: -24, cursor: 'pointer' } }))] })), internalMode === 'edit' && (_jsxs(Box, __assign({ width: 1, pr: 2 }, { children: [_jsx(FormItem, { sx: { height: 'auto', pr: 0 }, multiline: true, rows: 3.5, required: true, name: "name", placeholder: "", value: content, onChange: handleChange, error: !isValidate }), _jsxs(Stack, __assign({ boxSizing: "border-box", mr: 2, mt: 1, spacing: 1, direction: "row", width: 1, justifyContent: "flex-end" }, { children: [_jsx(Button, __assign({ size: "medium", variant: "text", color: "secondary", onClick: function () {
|
|
92
92
|
handleModeChange();
|
|
93
|
-
|
|
93
|
+
setContent(evaluation);
|
|
94
94
|
} }, { children: "\u53D6\u6D88" })), _jsx(Button, __assign({ size: "medium", onClick: handleSubmit }, { children: "\u4FDD\u5B58" }))] }))] }))), internalMode === 'show' && (_jsx(Typography, __assign({ variant: "body2", color: "textSecondary", sx: { whiteSpace: 'pre-wrap' } }, { children: content })))] })));
|
|
95
95
|
};
|
|
96
96
|
export default Evaluate;
|
|
@@ -3,8 +3,21 @@ interface Dimension {
|
|
|
3
3
|
name: string;
|
|
4
4
|
score: number;
|
|
5
5
|
}
|
|
6
|
+
export declare function getLevel(score: any): {
|
|
7
|
+
label: string;
|
|
8
|
+
width: number;
|
|
9
|
+
fontColor: string;
|
|
10
|
+
color: number[];
|
|
11
|
+
gradient: string[];
|
|
12
|
+
scoreGradient: string[];
|
|
13
|
+
backgroundColor: string;
|
|
14
|
+
shadowColor: string;
|
|
15
|
+
endScore: number;
|
|
16
|
+
pointColor: string[];
|
|
17
|
+
};
|
|
6
18
|
interface GraphProps {
|
|
7
19
|
items: Array<Dimension>;
|
|
8
20
|
}
|
|
21
|
+
export declare function hookCanvasContext(ctx: any): void;
|
|
9
22
|
declare const _default: import("react").NamedExoticComponent<GraphProps>;
|
|
10
23
|
export default _default;
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __values = (this && this.__values) || function(o) {
|
|
2
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
3
|
+
if (m) return m.call(o);
|
|
4
|
+
if (o && typeof o.length === "number") return {
|
|
5
|
+
next: function () {
|
|
6
|
+
if (o && i >= o.length) o = void 0;
|
|
7
|
+
return { value: o && o[i++], done: !o };
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
11
|
+
};
|
|
1
12
|
var __read = (this && this.__read) || function (o, n) {
|
|
2
13
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
3
14
|
if (!m) return o;
|
|
@@ -25,6 +36,11 @@ function setupCanvas(canvas) {
|
|
|
25
36
|
ctx.scale(dpr, dpr);
|
|
26
37
|
return ctx;
|
|
27
38
|
}
|
|
39
|
+
// interface GradeColor {
|
|
40
|
+
// Bad: Array<number>;
|
|
41
|
+
// Good: Array<number>;
|
|
42
|
+
// Best: Array<number>;
|
|
43
|
+
// }
|
|
28
44
|
var MAX_WIDTH = 315;
|
|
29
45
|
var MAX_HEIGHT = 24;
|
|
30
46
|
var levelOrder = ['Bad', 'Good', 'Best'];
|
|
@@ -72,18 +88,20 @@ var measureTextWidth = function (ctx, text) {
|
|
|
72
88
|
var width = ctx.measureText(text).width;
|
|
73
89
|
return width;
|
|
74
90
|
};
|
|
75
|
-
function isInPath(x, y,
|
|
91
|
+
function isInPath(x, y, rect, ctx) {
|
|
76
92
|
var dpr = window.devicePixelRatio || 1;
|
|
77
93
|
ctx.beginPath();
|
|
78
|
-
ctx.
|
|
94
|
+
ctx.rect(0, rect.y / dpr, rect.width / dpr, rect.height / dpr);
|
|
79
95
|
var ret = ctx.isPointInPath(x, y);
|
|
80
96
|
ctx.closePath();
|
|
81
97
|
return ret;
|
|
82
98
|
}
|
|
83
99
|
var drawTop = function (layout, ctx) {
|
|
84
100
|
// 设置全局样式
|
|
85
|
-
var leftLableWidth = layout.leftLableWidth, height = layout.height
|
|
101
|
+
var leftLableWidth = layout.leftLableWidth, height = layout.height;
|
|
86
102
|
var offset = leftLableWidth;
|
|
103
|
+
var lineEndY = height - 40; // 虚线结束位置,距离底部40px
|
|
104
|
+
var scoreTextY = height - 25; // 分数文字的Y位置,距离底部25px
|
|
87
105
|
levelOrder.forEach(function (level, i) {
|
|
88
106
|
var _a = levelConf[level], width = _a.width, gradient = _a.gradient, label = _a.label, fontColor = _a.fontColor;
|
|
89
107
|
// 绘制渐变背景
|
|
@@ -97,21 +115,22 @@ var drawTop = function (layout, ctx) {
|
|
|
97
115
|
ctx.fillStyle = fontColor;
|
|
98
116
|
ctx.fillText(label, offset + width / 2 - labelWidth / 2, 18);
|
|
99
117
|
// 绘制垂直虚线
|
|
100
|
-
drawVerticalDashedLine(ctx, offset - 1, 0,
|
|
118
|
+
drawVerticalDashedLine(ctx, offset - 1, 0, lineEndY, 2, 2);
|
|
101
119
|
// 绘制分数文本
|
|
102
120
|
ctx.fillStyle = '#4CAF50';
|
|
103
|
-
ctx.fillText("".concat(levelOrderScore[i]), offset - (i === 0 ? 5 : 9),
|
|
121
|
+
ctx.fillText("".concat(levelOrderScore[i]), offset - (i === 0 ? 5 : 9), scoreTextY);
|
|
104
122
|
offset += width + 1;
|
|
105
123
|
// 绘制结束的虚线和文本 '100'
|
|
106
124
|
if (i === levelOrder.length - 1) {
|
|
107
|
-
drawVerticalDashedLine(ctx, offset - 2, 0,
|
|
108
|
-
ctx.fillText('100', offset - 2 -
|
|
125
|
+
drawVerticalDashedLine(ctx, offset - 2, 0, lineEndY, 2, 2);
|
|
126
|
+
ctx.fillText('100', offset - 2 - 24, scoreTextY);
|
|
109
127
|
}
|
|
110
128
|
});
|
|
111
129
|
};
|
|
130
|
+
var truncateString = function (str) { return (str.length > 7 ? "".concat(str.slice(0, 6), "...") : str); };
|
|
112
131
|
var drawLable = function (lable, x, y, ctx) {
|
|
113
132
|
ctx.fillStyle = 'rgba(66, 66, 66, 0.86)';
|
|
114
|
-
ctx.fillText(lable, x, y + 5);
|
|
133
|
+
ctx.fillText(truncateString(lable), x, y + 5);
|
|
115
134
|
};
|
|
116
135
|
function drawVerticalDashedLine(ctx, x, startY, endY, dashLength, gapLength) {
|
|
117
136
|
if (dashLength === void 0) { dashLength = 2; }
|
|
@@ -141,7 +160,7 @@ var drawRoundedRect = function (x, y, width, height, r, fill, stroke, ctx) {
|
|
|
141
160
|
}
|
|
142
161
|
ctx.restore();
|
|
143
162
|
};
|
|
144
|
-
function getLevel(score) {
|
|
163
|
+
export function getLevel(score) {
|
|
145
164
|
if (score < 60) {
|
|
146
165
|
return levelConf.Bad;
|
|
147
166
|
}
|
|
@@ -167,25 +186,24 @@ var drawScore = function (layout, ctx, config, rect, score) {
|
|
|
167
186
|
drawRoundedRect(rect.x, rect.y, rect.width, rect.height, borderRadius, true, false, ctx);
|
|
168
187
|
ctx.fillStyle = score < 10 ? '#0D67FF' : '#fff';
|
|
169
188
|
var scoreWidth = measureTextWidth(ctx, "".concat(score));
|
|
170
|
-
console.log(scoreWidth);
|
|
171
189
|
ctx.fillText("".concat(score), layout.leftLableWidth + rect.width + (score < 10 ? 4 : -scoreWidth - 4), rect.y + 18);
|
|
172
190
|
};
|
|
173
191
|
var draw = function (layout, dimensions, pathRef, ctx) {
|
|
174
192
|
ctx.font = '16px sans-serif';
|
|
175
193
|
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
|
|
176
194
|
dimensions.forEach(function (v, i) {
|
|
177
|
-
var _a;
|
|
178
195
|
var config = getLevel(v.score);
|
|
179
196
|
// 绘制圆角矩形
|
|
180
197
|
var borderRadius = 12;
|
|
181
198
|
var x = layout.leftLableWidth;
|
|
182
|
-
var y = 50 +
|
|
199
|
+
var y = 50 + layout.itemSpacing * i;
|
|
183
200
|
// 设置背景颜色
|
|
184
201
|
ctx.fillStyle = config.backgroundColor;
|
|
185
202
|
drawRoundedRect(x, y, MAX_WIDTH, MAX_HEIGHT, borderRadius, true, false, ctx);
|
|
186
|
-
var endPointY =
|
|
187
|
-
drawLable(v.name,
|
|
188
|
-
|
|
203
|
+
var endPointY = 50 + 15 + layout.itemSpacing * i; // 50是顶部偏移,15是文字相对矩形的偏移
|
|
204
|
+
drawLable(v.name, 0, endPointY, ctx);
|
|
205
|
+
pathRef.push({ x: 0, y: y, width: layout.leftLableWidth, height: 22, tips: "".concat(v.name, ": ").concat(v.score) });
|
|
206
|
+
var score = v.score === 0 ? 0 : Math.max(v.score, 4);
|
|
189
207
|
drawScore(layout, ctx, config, {
|
|
190
208
|
x: layout.leftLableWidth,
|
|
191
209
|
y: y,
|
|
@@ -195,17 +213,54 @@ var draw = function (layout, dimensions, pathRef, ctx) {
|
|
|
195
213
|
});
|
|
196
214
|
drawTop(layout, ctx);
|
|
197
215
|
};
|
|
216
|
+
export function hookCanvasContext(ctx) {
|
|
217
|
+
var e_1, _a;
|
|
218
|
+
var methods = Object.getOwnPropertyNames(Object.getPrototypeOf(ctx)).filter(function (k) { return typeof ctx[k] === 'function'; });
|
|
219
|
+
var _loop_1 = function (method) {
|
|
220
|
+
var original = ctx[method];
|
|
221
|
+
ctx[method] = function () {
|
|
222
|
+
var args = [];
|
|
223
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
224
|
+
args[_i] = arguments[_i];
|
|
225
|
+
}
|
|
226
|
+
console.log("[Canvas2D] ".concat(method, "(").concat(args.map(function (a) { return JSON.stringify(a); }).join(', '), ")"));
|
|
227
|
+
return original.apply(this, args);
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
try {
|
|
231
|
+
for (var methods_1 = __values(methods), methods_1_1 = methods_1.next(); !methods_1_1.done; methods_1_1 = methods_1.next()) {
|
|
232
|
+
var method = methods_1_1.value;
|
|
233
|
+
_loop_1(method);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
237
|
+
finally {
|
|
238
|
+
try {
|
|
239
|
+
if (methods_1_1 && !methods_1_1.done && (_a = methods_1.return)) _a.call(methods_1);
|
|
240
|
+
}
|
|
241
|
+
finally { if (e_1) throw e_1.error; }
|
|
242
|
+
}
|
|
243
|
+
}
|
|
198
244
|
var Graph = function (_a) {
|
|
199
245
|
var _b = _a.items, items = _b === void 0 ? [] : _b;
|
|
200
246
|
var ref = useRef(null);
|
|
201
247
|
var pathRef = useRef([]);
|
|
202
248
|
var _c = __read(useState(), 2), ctx = _c[0], setCtx = _c[1];
|
|
203
|
-
|
|
204
|
-
|
|
249
|
+
// 统一间距配置
|
|
250
|
+
var ITEM_SPACING = 40;
|
|
251
|
+
var TOP_OFFSET = 50;
|
|
252
|
+
var BOTTOM_SPACING = 20; // 最后一个item与虚线之间的间距
|
|
253
|
+
var SCORE_AREA_HEIGHT = 40; // 分数区域的高度
|
|
254
|
+
var height = useMemo(function () {
|
|
255
|
+
if (items.length === 0)
|
|
256
|
+
return 0;
|
|
257
|
+
return TOP_OFFSET + (items.length - 1) * ITEM_SPACING + MAX_HEIGHT + BOTTOM_SPACING + SCORE_AREA_HEIGHT;
|
|
258
|
+
}, [items]);
|
|
205
259
|
useEffect(function () {
|
|
206
260
|
if (items.length === 0)
|
|
207
261
|
return;
|
|
208
262
|
var currentCtx = setupCanvas(ref.current);
|
|
263
|
+
// hookCanvasContext(currentCtx);
|
|
209
264
|
setCtx(currentCtx);
|
|
210
265
|
tipEl.style.background = 'rgba(0,0,0,.7)';
|
|
211
266
|
tipEl.style.color = '#fff';
|
|
@@ -216,24 +271,31 @@ var Graph = function (_a) {
|
|
|
216
271
|
tipEl.style.fontSize = '12px';
|
|
217
272
|
tipEl.style.display = 'none';
|
|
218
273
|
document.body.appendChild(tipEl);
|
|
274
|
+
// Clean up the tooltip element when items change
|
|
275
|
+
return function () {
|
|
276
|
+
if (tipEl.parentNode) {
|
|
277
|
+
tipEl.parentNode.removeChild(tipEl);
|
|
278
|
+
}
|
|
279
|
+
};
|
|
219
280
|
}, [ref, items]);
|
|
220
281
|
useEffect(function () {
|
|
221
282
|
if (ctx) {
|
|
222
283
|
var layout = {
|
|
223
|
-
leftLableWidth:
|
|
284
|
+
leftLableWidth: 140,
|
|
224
285
|
topLableHeight: 40,
|
|
225
|
-
itemSpacing:
|
|
286
|
+
itemSpacing: ITEM_SPACING,
|
|
226
287
|
height: height,
|
|
227
288
|
};
|
|
289
|
+
pathRef.current = [];
|
|
228
290
|
draw(layout, items, pathRef.current, ctx);
|
|
229
291
|
}
|
|
230
|
-
}, [ctx, items, height]);
|
|
231
|
-
useEffect(
|
|
232
|
-
|
|
233
|
-
}, [pathRef]);
|
|
292
|
+
}, [ctx, items, height, ITEM_SPACING]);
|
|
293
|
+
// useEffect(() => {
|
|
294
|
+
// console.log(pathRef);
|
|
295
|
+
// }, [pathRef]);
|
|
234
296
|
var handleMouseMove = useCallback(function (e) {
|
|
235
297
|
if (ctx) {
|
|
236
|
-
var p = pathRef.current.find(function (p) { return isInPath(e.nativeEvent.offsetX, e.nativeEvent.offsetY, p
|
|
298
|
+
var p = pathRef.current.find(function (p) { return isInPath(e.nativeEvent.offsetX, e.nativeEvent.offsetY, p, ctx); });
|
|
237
299
|
if (p) {
|
|
238
300
|
tipEl.style.left = e.pageX + 10 + 'px';
|
|
239
301
|
tipEl.style.top = e.pageY + 10 + 'px';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
2
|
+
declare const _default: import("react").MemoExoticComponent<() => JSX.Element | null>;
|
|
3
|
+
export default _default;
|
|
@@ -15,15 +15,19 @@ import Evaluate from './Evaluate';
|
|
|
15
15
|
import Graph from './Graph';
|
|
16
16
|
import { useAiReportStore } from "../../../../store/ai-report/global-store";
|
|
17
17
|
import { Box, Paper, Stack } from 'fbm-ui/lib/mui';
|
|
18
|
+
import { memo, useMemo } from 'react';
|
|
18
19
|
var Index = function () {
|
|
19
20
|
var _a = useAiReportStore(function (store) { return [store.reportResult, store.operableButtons]; }), reportResult = _a.reportResult, showAiDimension = _a.showAiDimension, canEditAiDimension = _a.canEditAiDimension;
|
|
20
|
-
var _b =
|
|
21
|
-
var items =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
var _b = reportResult || {}, _c = _b.collection, collection = _c === void 0 ? [] : _c, _d = _b.workplaceEvaluation, workplaceEvaluation = _d === void 0 ? '' : _d, _e = _b.orderToken, orderToken = _e === void 0 ? '' : _e;
|
|
22
|
+
var items = useMemo(function () {
|
|
23
|
+
return collection.map(function (item) { return ({
|
|
24
|
+
name: item.name,
|
|
25
|
+
score: item.avgScore,
|
|
26
|
+
}); });
|
|
27
|
+
}, [collection]);
|
|
28
|
+
console.log('reportResult', reportResult, workplaceEvaluation);
|
|
25
29
|
if (!showAiDimension)
|
|
26
30
|
return null;
|
|
27
|
-
return (_jsx(Box, __assign({ id: "report-evaluate", px: 2, width: 1 }, { children: _jsx(Box, __assign({ component: Paper, elevation: 0, bgcolor: "transparent", mb:
|
|
31
|
+
return (_jsx(Box, __assign({ id: "report-evaluate", px: 2, width: 1 }, { children: _jsx(Box, __assign({ component: Paper, elevation: 0, bgcolor: "transparent", mb: 3 }, { children: _jsxs(Stack, { children: [_jsxs(Stack, __assign({ direction: "row", alignItems: "center", justifyContent: "space-between" }, { children: [_jsx(Box, __assign({ mt: 2, flex: 1 }, { children: _jsx(Graph, { items: items }) })), _jsx(Report, {})] })), workplaceEvaluation && (_jsx(Evaluate, { orderToken: orderToken, canEdit: canEditAiDimension, evaluation: workplaceEvaluation, title: "\u7EFC\u5408\u8BC4\u4EF7", mode: "show" }))] }) })) })));
|
|
28
32
|
};
|
|
29
|
-
export default Index;
|
|
33
|
+
export default memo(Index);
|
|
@@ -27,7 +27,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
27
27
|
};
|
|
28
28
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
29
|
import { rankPercent } from '../../utils';
|
|
30
|
-
import { BeatProgressBar, Podium } from '../styled';
|
|
30
|
+
import { BeatProgressBar, DinTypography, Podium } from '../styled';
|
|
31
31
|
import { useAiReportStore } from "../../../../store/ai-report/global-store";
|
|
32
32
|
import { Typography } from 'fbm-ui';
|
|
33
33
|
import { Stack } from 'fbm-ui/lib/mui';
|
|
@@ -45,6 +45,6 @@ var Form = function () {
|
|
|
45
45
|
setText('');
|
|
46
46
|
}
|
|
47
47
|
}, [score, reportRank, scoreRankIntervals, progress]);
|
|
48
|
-
return (_jsx(Podium, { children: _jsxs(Stack, __assign({ direction: "row", position: "relative", bottom: -
|
|
48
|
+
return (_jsx(Podium, { children: _jsxs(Stack, __assign({ direction: "row", position: "relative", bottom: -146, left: 88, spacing: 1.5 }, { children: [_jsxs(Stack, __assign({ spacing: 1, direction: "row", justifyContent: "center", width: 300 }, { children: [_jsx(DinTypography, __assign({ sx: { fontSize: 100, fontWeight: 'bold', lineHeight: 1 }, color: "inherit" }, { children: score })), _jsx(DinTypography, __assign({ variant: "h5", color: "inherit", sx: { fontSize: 30, fontWeight: 'bold', alignSelf: 'flex-end', mb: '12px !important' } }, { children: "\u5206" }))] })), (reportRank === null || reportRank === void 0 ? void 0 : reportRank.total) !== 0 && (_jsxs(Stack, __assign({ spacing: 1, mt: 6.25 }, { children: [_jsxs(Typography, __assign({ color: "inherit", fontWeight: 500, mt: 5 }, { children: [text, "\u00A0"] })), _jsx(BeatProgressBar, { children: _jsx("div", { className: "progress-bar-fill", style: { width: "".concat(progress, "%") } }) })] })))] })) }));
|
|
49
49
|
};
|
|
50
50
|
export default Form;
|
|
@@ -15,7 +15,6 @@ import { DinTypography } from '../styled';
|
|
|
15
15
|
import Nps from './Nps';
|
|
16
16
|
import { PhotoProvider, PhotoView } from "../../../../components/react-photo-view";
|
|
17
17
|
import dayjs from 'dayjs';
|
|
18
|
-
import { EditIcon } from 'fbm-icons';
|
|
19
18
|
import { Box, Paper, Typography } from 'fbm-ui';
|
|
20
19
|
import { Stack } from 'fbm-ui/lib/mui';
|
|
21
20
|
export var QUESTION_TYPE;
|
|
@@ -30,8 +29,8 @@ export var QUESTION_TYPE;
|
|
|
30
29
|
QUESTION_TYPE[QUESTION_TYPE["NPS"] = 9] = "NPS";
|
|
31
30
|
})(QUESTION_TYPE || (QUESTION_TYPE = {}));
|
|
32
31
|
var Image = function (answer) {
|
|
33
|
-
var _a, _b;
|
|
34
|
-
return (_jsx(PhotoProvider, __assign({ maskOpacity: 0.5 }, { children: (_b = (_a = answer.formAnswer) === null || _a === void 0 ? void 0 : _a.files) === null || _b === void 0 ? void 0 : _b.map(function (url) { return (_jsx(PhotoView, __assign({ src: url }, { children: _jsx("img", { src: url, alt: url, width: 48, height: 32 }) }), url)); }) })));
|
|
32
|
+
var _a, _b, _c;
|
|
33
|
+
return (_jsx(PhotoProvider, __assign({ maskOpacity: 0.5 }, { children: (_c = (_b = (_a = answer.formAnswer) === null || _a === void 0 ? void 0 : _a.files) === null || _b === void 0 ? void 0 : _b.filter(function (v) { return v; })) === null || _c === void 0 ? void 0 : _c.map(function (url) { return (_jsx(PhotoView, __assign({ src: url }, { children: _jsx("img", { src: url, alt: url, width: 48, height: 32 }) }), url)); }) })));
|
|
35
34
|
};
|
|
36
35
|
var fillBlanks = function (answer) { var _a, _b; return _jsx(Typography, __assign({ variant: "body2" }, { children: (_b = (_a = answer === null || answer === void 0 ? void 0 : answer.formAnswer) === null || _a === void 0 ? void 0 : _a.answer) === null || _b === void 0 ? void 0 : _b.join(',') })); };
|
|
37
36
|
var Choice = function (answer) {
|
|
@@ -47,7 +46,12 @@ var template = (_a = {},
|
|
|
47
46
|
_a[QUESTION_TYPE.RADIO] = Choice,
|
|
48
47
|
_a[QUESTION_TYPE.CHECKBOX] = Choice,
|
|
49
48
|
_a[QUESTION_TYPE.ESSAY_QUESTION] = function (answer) { var _a; return (_a = answer === null || answer === void 0 ? void 0 : answer.formAnswer) === null || _a === void 0 ? void 0 : _a.answer; },
|
|
50
|
-
_a[QUESTION_TYPE.TIME] = function (answer) {
|
|
49
|
+
_a[QUESTION_TYPE.TIME] = function (answer) {
|
|
50
|
+
var _a, _b, _c;
|
|
51
|
+
return ((_a = answer === null || answer === void 0 ? void 0 : answer.formAnswer) === null || _a === void 0 ? void 0 : _a.dateTime) &&
|
|
52
|
+
!isNaN((_b = answer === null || answer === void 0 ? void 0 : answer.formAnswer) === null || _b === void 0 ? void 0 : _b.dateTime) &&
|
|
53
|
+
dayjs(Number((_c = answer === null || answer === void 0 ? void 0 : answer.formAnswer) === null || _c === void 0 ? void 0 : _c.dateTime) * 1000).format('YYYY年MM月DD日');
|
|
54
|
+
},
|
|
51
55
|
_a[QUESTION_TYPE.SCHOOL] = function (answer) { var _a; return (_a = answer === null || answer === void 0 ? void 0 : answer.formAnswer) === null || _a === void 0 ? void 0 : _a.answer; },
|
|
52
56
|
_a[QUESTION_TYPE.FILL_BLANKS] = fillBlanks,
|
|
53
57
|
_a[QUESTION_TYPE.NPS] = Nps,
|
|
@@ -55,16 +59,33 @@ var template = (_a = {},
|
|
|
55
59
|
_a);
|
|
56
60
|
var Form = function (_a) {
|
|
57
61
|
var answers = _a.answers, _b = _a.customProcessName, customProcessName = _b === void 0 ? '资料收集' : _b;
|
|
58
|
-
return (_jsxs(Box, __assign({ component: Paper, m: 3,
|
|
59
|
-
|
|
62
|
+
return (_jsxs(Box, __assign({ component: Paper, m: 3, borderRadius: 3 }, { children: [_jsxs(Box, __assign({ display: "flex", sx: {
|
|
63
|
+
left: -12,
|
|
64
|
+
top: -8,
|
|
65
|
+
height: 48,
|
|
66
|
+
position: 'relative',
|
|
60
67
|
color: '#009D56',
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
width:
|
|
64
|
-
mb: 2,
|
|
65
|
-
display: 'flex',
|
|
68
|
+
borderRadius: '8px 0px 8px 8px',
|
|
69
|
+
background: 'linear-gradient( 360deg, #98F79C 0%, #C2FCC4 100%)',
|
|
70
|
+
width: 'fit-content',
|
|
66
71
|
alignItems: 'center',
|
|
67
|
-
|
|
72
|
+
'&:after': {
|
|
73
|
+
content: "''",
|
|
74
|
+
position: 'absolute',
|
|
75
|
+
top: 0,
|
|
76
|
+
right: -5,
|
|
77
|
+
width: 0,
|
|
78
|
+
height: 0,
|
|
79
|
+
borderTop: '8px solid transparent',
|
|
80
|
+
borderLeft: '5px solid #6CD970',
|
|
81
|
+
},
|
|
82
|
+
} }, { children: [_jsx("img", { className: "MuiSvgIcon-root", src: "//webcdn.fbmms.cn/assets/5ex_/K7bDo1Qy6FdGVUIrXQksl", alt: "", width: 20, height: 20, style: { marginLeft: 16 } }), _jsx(DinTypography, __assign({ variant: "h6", sx: {
|
|
83
|
+
ml: 1,
|
|
84
|
+
color: '#009D56',
|
|
85
|
+
lineHeight: '24px',
|
|
86
|
+
width: 'auto',
|
|
87
|
+
marginRight: 4,
|
|
88
|
+
} }, { children: customProcessName }))] })), _jsxs(Stack, __assign({ p: 3, pt: 2 }, { children: [_jsxs(Stack, __assign({ direction: "row", sx: {
|
|
68
89
|
background: '#E5FDE6',
|
|
69
90
|
color: '#009D56',
|
|
70
91
|
borderRadius: 20,
|
|
@@ -78,7 +99,7 @@ var Form = function (_a) {
|
|
|
78
99
|
return (_jsxs(_Fragment, { children: [_jsxs(Stack, __assign({ direction: "row", sx: {
|
|
79
100
|
py: 1,
|
|
80
101
|
px: 2,
|
|
81
|
-
} }, { children: [
|
|
102
|
+
} }, { children: [_jsx(Typography, __assign({ variant: "body2", sx: { width: 52 } }, { children: index + 1 })), _jsx(Typography, __assign({ variant: "body2", flex: 1, mr: 7 }, { children: answer.formTypeKey })), _jsx(Typography, __assign({ variant: "body2", flex: 1 }, { children: (_a = template[answer.formTypeId]) === null || _a === void 0 ? void 0 : _a.call(template, answer) }))] }), index), _jsx(Box, { sx: { background: '#fff', height: 2, mx: 1 } })] }));
|
|
82
103
|
}) }))] }))] })));
|
|
83
104
|
};
|
|
84
105
|
export default Form;
|
|
@@ -46,6 +46,8 @@ var Nps = function (_a) {
|
|
|
46
46
|
var fromScore = (from === null || from === void 0 ? void 0 : from.score) || 0;
|
|
47
47
|
var toScore = (to === null || to === void 0 ? void 0 : to.score) || 0;
|
|
48
48
|
var npsData = __spreadArray([], __read(Array.from(new Array(toScore + 1 - fromScore).keys())), false).map(function (i) { return i + fromScore; });
|
|
49
|
+
if (!answer)
|
|
50
|
+
return null;
|
|
49
51
|
return (_jsxs(Box, { children: [_jsx(Box, __assign({ display: "flex" }, { children: typeof answer === 'string' &&
|
|
50
52
|
npsData.map(function (value) {
|
|
51
53
|
var isSelect = value <= Number(answer);
|
|
@@ -9,17 +9,25 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { COMPLETED_STATUS } from "../../../../enum/ai-report";
|
|
14
14
|
import { useAiReportStore } from "../../../../store/ai-report/global-store";
|
|
15
15
|
import { Alert, Box, Typography } from 'fbm-ui';
|
|
16
|
+
var PrintScreen = function (_a) {
|
|
17
|
+
var screenSwitchCount = _a.screenSwitchCount;
|
|
18
|
+
if (screenSwitchCount > 0) {
|
|
19
|
+
return (_jsx(Box, __assign({ mb: 2 }, { children: _jsx(Alert, __assign({ type: "warning" }, { children: _jsxs(Typography, __assign({ variant: "body2", color: "textSecondary" }, { children: ["\u8BE5\u5019\u9009\u4EBA\u9762\u8BD5\u671F\u95F4\u622A\u5F55\u5C4F\u6216\u5207\u6362\u9875\u9762 ", screenSwitchCount, " \u6B21\u3002"] })) })) })));
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
};
|
|
16
23
|
var NotFinish = function () {
|
|
17
24
|
var _a = useAiReportStore(function (store) { return [store.reportResult, store.interviewCheat]; }), reportResult = _a.reportResult, interviewCheat = _a.interviewCheat;
|
|
18
|
-
var _b =
|
|
19
|
-
var
|
|
25
|
+
var _b = reportResult || {}, _c = _b.completedStatus, completedStatus = _c === void 0 ? 1 : _c, _d = _b.screenSwitchCount, screenSwitchCount = _d === void 0 ? 0 : _d;
|
|
26
|
+
var _e = interviewCheat || {}, isCheat = _e.isCheat, info = _e.info;
|
|
27
|
+
console.log('screenSwitchCount', screenSwitchCount);
|
|
20
28
|
if (completedStatus === COMPLETED_STATUS.NOT_COMPLETED || isCheat) {
|
|
21
|
-
return (
|
|
29
|
+
return (_jsxs(Box, __assign({ mb: 2 }, { children: [_jsx(PrintScreen, { screenSwitchCount: screenSwitchCount }), _jsx(Alert, __assign({ type: isCheat ? 'error' : 'warning' }, { children: _jsx(Typography, __assign({ variant: "body2", color: "textSecondary" }, { children: info || '该候选人尚未回答完所有题目,建议提醒候选人完成面试' })) }))] })));
|
|
22
30
|
}
|
|
23
|
-
return
|
|
31
|
+
return _jsx(PrintScreen, { screenSwitchCount: screenSwitchCount });
|
|
24
32
|
};
|
|
25
33
|
export default NotFinish;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { CandidateInfo } from '../Candidate/Interface';
|
|
2
|
+
import { AiReportUrl, CandidateInfo } from '../Candidate/Interface';
|
|
3
3
|
export interface ReportHeaderProps {
|
|
4
4
|
status: number;
|
|
5
5
|
customScore?: number;
|
|
6
6
|
onRefreshSuccess: () => void;
|
|
7
7
|
fetchCandidateInfo: () => Promise<CandidateInfo>;
|
|
8
|
+
fetchReportUrl: () => Promise<AiReportUrl>;
|
|
8
9
|
}
|
|
9
|
-
declare const ReportHeader: ({ customScore, onRefreshSuccess, fetchCandidateInfo, status }: {
|
|
10
|
+
declare const ReportHeader: ({ customScore, onRefreshSuccess, fetchCandidateInfo, status, fetchReportUrl }: {
|
|
10
11
|
customScore: any;
|
|
11
12
|
onRefreshSuccess: any;
|
|
12
13
|
fetchCandidateInfo: any;
|
|
13
14
|
status: any;
|
|
15
|
+
fetchReportUrl: any;
|
|
14
16
|
}) => JSX.Element;
|
|
15
17
|
export default ReportHeader;
|