eli-video-interview 1.2.42-alpha.2 → 1.2.42-alpha.21
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 +4 -3
- package/esm/components/Charts/ReportPie.js +1 -1
- package/esm/components/Charts/const.js +6 -6
- package/esm/components/ScoreBigBall/index.js +1 -1
- package/esm/modules/ai-report/interface.d.ts +5 -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.js +28 -15
- package/esm/modules/ai-report-v2/components/AIEvaluate/Evaluate.js +15 -1
- package/esm/modules/ai-report-v2/components/AIEvaluate/Graph.js +12 -10
- package/esm/modules/ai-report-v2/components/AIEvaluate/index.js +2 -2
- package/esm/modules/ai-report-v2/components/Candidate/Candidate.js +14 -3
- 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 +21 -9
- package/esm/modules/ai-report-v2/components/Form/Forms.d.ts +3 -3
- package/esm/modules/ai-report-v2/components/Form/Forms.js +4 -4
- 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/ReportHeader/ReportHeader.d.ts +6 -2
- package/esm/modules/ai-report-v2/components/ReportHeader/ReportHeader.js +32 -11
- package/esm/modules/ai-report-v2/components/VideoQuestion/Abilities.js +1 -1
- package/esm/modules/ai-report-v2/components/VideoQuestion/QuestionItem.js +24 -18
- package/esm/modules/ai-report-v2/components/VideoQuestion/ScoreSlider.js +1 -1
- package/esm/modules/ai-report-v2/components/VideoQuestion/index.d.ts +6 -3
- package/esm/modules/ai-report-v2/components/VideoQuestion/index.js +5 -3
- 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/styled.d.ts +2 -1
- package/esm/modules/ai-report-v2/components/styled.js +28 -5
- package/esm/modules/ai-report-v2/interface.d.ts +9 -2
- package/esm/modules/ai-report-v2/useAiReport.d.ts +5 -1
- 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 +1 -0
- package/esm/services/ai-report.js +1 -0
- package/lib/components/AiHeaderTitle/index.js +3 -2
- package/lib/components/Charts/ReportPie.js +1 -1
- package/lib/components/Charts/const.js +6 -6
- package/lib/components/ScoreBigBall/index.js +1 -1
- package/lib/modules/ai-report/interface.d.ts +5 -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.js +28 -15
- package/lib/modules/ai-report-v2/components/AIEvaluate/Evaluate.js +15 -1
- package/lib/modules/ai-report-v2/components/AIEvaluate/Graph.js +12 -10
- package/lib/modules/ai-report-v2/components/AIEvaluate/index.js +2 -2
- package/lib/modules/ai-report-v2/components/Candidate/Candidate.js +12 -1
- 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 +21 -9
- package/lib/modules/ai-report-v2/components/Form/Forms.d.ts +3 -3
- package/lib/modules/ai-report-v2/components/Form/Forms.js +4 -4
- 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/ReportHeader/ReportHeader.d.ts +6 -2
- package/lib/modules/ai-report-v2/components/ReportHeader/ReportHeader.js +32 -11
- package/lib/modules/ai-report-v2/components/VideoQuestion/Abilities.js +1 -1
- package/lib/modules/ai-report-v2/components/VideoQuestion/QuestionItem.js +22 -16
- package/lib/modules/ai-report-v2/components/VideoQuestion/ScoreSlider.js +1 -1
- package/lib/modules/ai-report-v2/components/VideoQuestion/index.d.ts +6 -3
- package/lib/modules/ai-report-v2/components/VideoQuestion/index.js +5 -3
- 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/styled.d.ts +2 -1
- package/lib/modules/ai-report-v2/components/styled.js +29 -6
- package/lib/modules/ai-report-v2/interface.d.ts +9 -2
- package/lib/modules/ai-report-v2/useAiReport.d.ts +5 -1
- 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 +1 -0
- package/lib/services/ai-report.js +3 -1
- package/package.json +1 -1
|
@@ -24,15 +24,15 @@ var ai_report_2 = require("../../services/ai-report");
|
|
|
24
24
|
var global_store_1 = require("../../store/ai-report/global-store");
|
|
25
25
|
var ahooks_1 = require("ahooks");
|
|
26
26
|
var fbm_ui_1 = require("fbm-ui");
|
|
27
|
+
var mui_1 = require("fbm-ui/lib/mui");
|
|
27
28
|
var react_1 = require("react");
|
|
28
|
-
var NO_ANSWER = ai_report_1.INTERVIEW_STATUS.NO_ANSWER
|
|
29
|
+
var NO_ANSWER = ai_report_1.INTERVIEW_STATUS.NO_ANSWER;
|
|
29
30
|
var AiReportRoot = (0, react_1.forwardRef)(function (props, ref) {
|
|
30
|
-
var token = props.token, customScore = props.customScore, reminderSent = props.reminderSent, operableButtons = props.operableButtons, onLoad = props.onLoad, onSendReminderClick = props.onSendReminderClick,
|
|
31
|
+
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;
|
|
31
32
|
var firstLoad = (0, react_1.useRef)(true);
|
|
32
|
-
// @ts-ignore
|
|
33
33
|
var _a = (0, global_store_1.useAiReportStore)(), updateState = _a.updateState, updateReportResult = _a.updateReportResult, reportResult = _a.reportResult;
|
|
34
|
-
|
|
35
|
-
var
|
|
34
|
+
var _b = (reportResult || {}).collection, collection = _b === void 0 ? [] : _b;
|
|
35
|
+
var _c = (0, ahooks_1.useRequest)(function () { return (0, ai_report_2.PostAiInterviewResult)([token]); }, {
|
|
36
36
|
manual: true,
|
|
37
37
|
onSuccess: function (_a) {
|
|
38
38
|
var list = _a.data.list;
|
|
@@ -50,7 +50,7 @@ var AiReportRoot = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
50
50
|
onLoad === null || onLoad === void 0 ? void 0 : onLoad(__assign({ pageStepIndexes: pageStepIndexes_1 }, result));
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
|
-
}), data =
|
|
53
|
+
}), data = _c.data, loading = _c.loading, postAiInterviewResult = _c.run;
|
|
54
54
|
var status = (data === null || data === void 0 ? void 0 : data.data.list[0].status) || NO_ANSWER;
|
|
55
55
|
var handleRefreshSuccess = (0, react_1.useCallback)(function () {
|
|
56
56
|
postAiInterviewResult();
|
|
@@ -66,21 +66,34 @@ var AiReportRoot = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
66
66
|
(0, react_1.useEffect)(function () {
|
|
67
67
|
updateState(props);
|
|
68
68
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
69
|
-
}, [props]);
|
|
69
|
+
}, [JSON.stringify(props)]);
|
|
70
70
|
var aiReportResult = (0, react_1.useMemo)(function () {
|
|
71
71
|
if (status === NO_ANSWER) {
|
|
72
72
|
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ width: "100%", display: "flex", alignItems: "center", justifyContent: "center", flexDirection: "column", style: { marginTop: '149px' } }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, { children: (0, jsx_runtime_1.jsx)("img", { src: "//webcdn.fbmms.cn/web/saas/asset/image/CandidateInfoEmpty.png", alt: "", style: { width: '140px', height: '140px' } }) }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ mt: 2 }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.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')) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ style: { marginTop: '2px' } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.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" })) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ mt: 2 }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ size: "large", variant: "outlined", color: "primary", disabled: reminderSent, onClick: onSendReminderClick }, { children: reminderSent ? '已提醒' : '发送提醒' })) }))] }))] })));
|
|
73
73
|
}
|
|
74
74
|
else {
|
|
75
|
-
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ pb: 3, sx: {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, { children: [(0, jsx_runtime_1.jsx)(NotFinish_1.default, {}), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ pb: 3, sx: {
|
|
76
|
+
background: '#F0F9FF',
|
|
77
|
+
backgroundImage: "url('//webcdn.fbmms.cn/assets/9kTa/pmsfSOeFx_7jhhsV9f_ta')",
|
|
78
|
+
backgroundSize: 'contain',
|
|
79
|
+
backgroundRepeat: 'no-repeat',
|
|
80
|
+
backgroundPosition: 'center top',
|
|
81
|
+
paddingTop: (collection === null || collection === void 0 ? void 0 : collection.length) > 0 ? 0 : 3,
|
|
82
|
+
} }, { children: [(collection === null || collection === void 0 ? void 0 : collection.length) > 0 && ((0, jsx_runtime_1.jsx)(ReportHeader_1.default, { customScore: customScore, onRefreshSuccess: handleRefreshSuccess, fetchCandidateInfo: fetchCandidateInfo, status: status, fetchReportUrl: fetchReportUrl })), (0, jsx_runtime_1.jsx)(Form_1.FormReport, { fetchFormResult: fetchFormResult }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Paper, __assign({ variant: "outlined", sx: { zIndex: 1, position: 'relative', mx: 2, borderRadius: 4 } }, { children: (0, jsx_runtime_1.jsx)(VideoQuestion_1.default, { isExportPdf: isExportPdf }) }))] }))] }));
|
|
82
83
|
}
|
|
83
|
-
}, [
|
|
84
|
+
}, [
|
|
85
|
+
status,
|
|
86
|
+
operableButtons,
|
|
87
|
+
reminderSent,
|
|
88
|
+
onSendReminderClick,
|
|
89
|
+
collection === null || collection === void 0 ? void 0 : collection.length,
|
|
90
|
+
customScore,
|
|
91
|
+
handleRefreshSuccess,
|
|
92
|
+
fetchCandidateInfo,
|
|
93
|
+
fetchReportUrl,
|
|
94
|
+
fetchFormResult,
|
|
95
|
+
isExportPdf,
|
|
96
|
+
]);
|
|
84
97
|
return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ loading: firstLoad.current && loading, sx: { width: '100%', minHeight: '618px', height: '100%', margin: '0 auto', overflow: 'auto' } }, { children: aiReportResult })));
|
|
85
98
|
});
|
|
86
99
|
AiReportRoot.displayName = 'AiReportRoot';
|
|
@@ -76,7 +76,21 @@ var Evaluate = function (_a) {
|
|
|
76
76
|
boxShadow: ' 0px 2px 6px 0px rgba(91,108,95,0.15)',
|
|
77
77
|
padding: '8px 24px',
|
|
78
78
|
borderRadius: 1.5,
|
|
79
|
-
} }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", alignItems: "center", justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsx)(
|
|
79
|
+
} }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", alignItems: "center", justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ sx: {
|
|
80
|
+
position: 'relative',
|
|
81
|
+
'&:after': {
|
|
82
|
+
position: 'absolute',
|
|
83
|
+
width: 'calc(100% - 2px)',
|
|
84
|
+
background: ' linear-gradient( 90deg, #FFE5A9 0%, #FFB300 100%)',
|
|
85
|
+
left: -3,
|
|
86
|
+
bottom: 2,
|
|
87
|
+
height: 5,
|
|
88
|
+
content: '""',
|
|
89
|
+
color: 'rgba(0, 0, 0, 0.54)',
|
|
90
|
+
display: 'inline-block',
|
|
91
|
+
margin: '0 4px',
|
|
92
|
+
},
|
|
93
|
+
} }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ fontWeight: "medium", zIndex: 1, sx: { position: 'relative', zIndex: 1 } }, { children: title })) })), canEdit && ((0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ onClick: handleModeChange }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.EditIcon, {}) })))] })), internalMode === 'edit' && ((0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ width: 1, pr: 2 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.FormItem, { sx: { height: 'auto', pr: 0 }, multiline: true, rows: 3.5, required: true, name: "name", placeholder: "", value: content, onChange: handleChange }), (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ boxSizing: "border-box", mr: 2, mt: 1, spacing: 1, direction: "row", width: 1, justifyContent: "flex-end" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ size: "medium", variant: "text", color: "secondary", onClick: function () {
|
|
80
94
|
handleModeChange();
|
|
81
95
|
// setContent(evaluations?.join('\n'));
|
|
82
96
|
} }, { children: "\u53D6\u6D88" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ size: "medium", onClick: handleSubmit }, { children: "\u4FDD\u5B58" }))] }))] }))), internalMode === 'show' && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "textSecondary", sx: { whiteSpace: 'pre-wrap' } }, { children: content })))] })));
|
|
@@ -85,7 +85,6 @@ function isInPath(x, y, tx, ty, ctx) {
|
|
|
85
85
|
var drawTop = function (layout, ctx) {
|
|
86
86
|
// 设置全局样式
|
|
87
87
|
var leftLableWidth = layout.leftLableWidth, height = layout.height, topLableHeight = layout.topLableHeight;
|
|
88
|
-
ctx.font = '16px sans-serif';
|
|
89
88
|
var offset = leftLableWidth;
|
|
90
89
|
levelOrder.forEach(function (level, i) {
|
|
91
90
|
var _a = levelConf[level], width = _a.width, gradient = _a.gradient, label = _a.label, fontColor = _a.fontColor;
|
|
@@ -99,17 +98,16 @@ var drawTop = function (layout, ctx) {
|
|
|
99
98
|
var labelWidth = measureTextWidth(ctx, label);
|
|
100
99
|
ctx.fillStyle = fontColor;
|
|
101
100
|
ctx.fillText(label, offset + width / 2 - labelWidth / 2, 18);
|
|
102
|
-
console.log(offset);
|
|
103
101
|
// 绘制垂直虚线
|
|
104
|
-
drawVerticalDashedLine(ctx, offset - 1, 0, height + topLableHeight -
|
|
102
|
+
drawVerticalDashedLine(ctx, offset - 1, 0, height + topLableHeight - 54, 2, 2);
|
|
105
103
|
// 绘制分数文本
|
|
106
104
|
ctx.fillStyle = '#4CAF50';
|
|
107
|
-
ctx.fillText("".concat(levelOrderScore[i]), offset - (i === 0 ?
|
|
105
|
+
ctx.fillText("".concat(levelOrderScore[i]), offset - (i === 0 ? 5 : 9), height + topLableHeight - 40);
|
|
108
106
|
offset += width + 1;
|
|
109
107
|
// 绘制结束的虚线和文本 '100'
|
|
110
108
|
if (i === levelOrder.length - 1) {
|
|
111
|
-
drawVerticalDashedLine(ctx, offset - 2, 0, height + topLableHeight -
|
|
112
|
-
ctx.fillText('100', offset - 2 -
|
|
109
|
+
drawVerticalDashedLine(ctx, offset - 2, 0, height + topLableHeight - 54, 2, 2);
|
|
110
|
+
ctx.fillText('100', offset - 2 - 10, height + topLableHeight - 40);
|
|
113
111
|
}
|
|
114
112
|
});
|
|
115
113
|
};
|
|
@@ -170,12 +168,14 @@ var drawScore = function (layout, ctx, config, rect, score) {
|
|
|
170
168
|
var borderRadius = 12;
|
|
171
169
|
drawRoundedRect(rect.x, rect.y, rect.width, rect.height, borderRadius, true, false, ctx);
|
|
172
170
|
ctx.fillStyle = score < 10 ? '#0D67FF' : '#fff';
|
|
173
|
-
ctx
|
|
171
|
+
var scoreWidth = measureTextWidth(ctx, "".concat(score));
|
|
172
|
+
ctx.fillText("".concat(score), layout.leftLableWidth + rect.width + (score < 10 ? 4 : -scoreWidth - 4), rect.y + 18);
|
|
174
173
|
};
|
|
175
174
|
var draw = function (layout, dimensions, pathRef, ctx) {
|
|
175
|
+
ctx.font = '16px sans-serif';
|
|
176
176
|
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
|
|
177
|
-
drawTop(layout, ctx);
|
|
178
177
|
dimensions.forEach(function (v, i) {
|
|
178
|
+
var _a;
|
|
179
179
|
var config = getLevel(v.score);
|
|
180
180
|
// 绘制圆角矩形
|
|
181
181
|
var borderRadius = 12;
|
|
@@ -186,20 +186,22 @@ var draw = function (layout, dimensions, pathRef, ctx) {
|
|
|
186
186
|
drawRoundedRect(x, y, MAX_WIDTH, MAX_HEIGHT, borderRadius, true, false, ctx);
|
|
187
187
|
var endPointY = 65 + layout.itemSpacing * i;
|
|
188
188
|
drawLable(v.name, 10, endPointY, ctx);
|
|
189
|
+
var score = (_a = v.score) !== null && _a !== void 0 ? _a : (v.score < 4 ? 4 : v.score);
|
|
189
190
|
drawScore(layout, ctx, config, {
|
|
190
191
|
x: layout.leftLableWidth,
|
|
191
192
|
y: y,
|
|
192
|
-
width: MAX_WIDTH * (
|
|
193
|
+
width: MAX_WIDTH * (score / 100),
|
|
193
194
|
height: MAX_HEIGHT,
|
|
194
195
|
}, v.score);
|
|
195
196
|
});
|
|
197
|
+
drawTop(layout, ctx);
|
|
196
198
|
};
|
|
197
199
|
var Graph = function (_a) {
|
|
198
200
|
var _b = _a.items, items = _b === void 0 ? [] : _b;
|
|
199
201
|
var ref = (0, react_1.useRef)(null);
|
|
200
202
|
var pathRef = (0, react_1.useRef)([]);
|
|
201
203
|
var _c = __read((0, react_1.useState)(), 2), ctx = _c[0], setCtx = _c[1];
|
|
202
|
-
var height = (0, react_1.useMemo)(function () { return 36 * items.length +
|
|
204
|
+
var height = (0, react_1.useMemo)(function () { return 36 * items.length + 50 + 35; }, [items]);
|
|
203
205
|
(0, react_1.useEffect)(function () {
|
|
204
206
|
if (items.length === 0)
|
|
205
207
|
return;
|
|
@@ -25,10 +25,10 @@ var Index = function () {
|
|
|
25
25
|
var _b = (reportResult || {}).collection, collection = _b === void 0 ? [] : _b;
|
|
26
26
|
var items = collection.map(function (item) { return ({
|
|
27
27
|
name: item.name,
|
|
28
|
-
score: item.
|
|
28
|
+
score: item.avgScore,
|
|
29
29
|
}); });
|
|
30
30
|
if (!showAiDimension)
|
|
31
31
|
return null;
|
|
32
|
-
return ((0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ id: "report-evaluate", px: 2,
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ id: "report-evaluate", px: 2, width: 1 }, { children: (0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ component: mui_1.Paper, elevation: 0, bgcolor: "transparent", mb: 2, pb: 2 }, { children: (0, jsx_runtime_1.jsxs)(mui_1.Stack, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", alignItems: "center", justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ mt: 2, flex: 1 }, { children: (0, jsx_runtime_1.jsx)(Graph_1.default, { items: items }) })), (0, jsx_runtime_1.jsx)(Report_1.default, {})] })), (reportResult === null || reportResult === void 0 ? void 0 : reportResult.workplaceEvaluation) && ((0, jsx_runtime_1.jsx)(Evaluate_1.default, { token: "", canEdit: canEditAiDimension, evaluations: reportResult === null || reportResult === void 0 ? void 0 : reportResult.workplaceEvaluation, title: "\u7EFC\u5408\u8BC4\u4EF7", field: "evaluations", mode: "show" }))] }) })) })));
|
|
33
33
|
};
|
|
34
34
|
exports.default = Index;
|
|
@@ -29,11 +29,16 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
30
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
31
31
|
var styled_1 = require("../styled");
|
|
32
|
+
var global_store_1 = require("../../../../store/ai-report/global-store");
|
|
33
|
+
var utils_1 = require("../../../../utils/utils");
|
|
32
34
|
var fbm_ui_1 = require("fbm-ui");
|
|
33
35
|
var mui_1 = require("fbm-ui/lib/mui");
|
|
34
36
|
var react_1 = require("react");
|
|
35
37
|
var Form = function (_a) {
|
|
36
38
|
var fetchCandidateInfo = _a.fetchCandidateInfo;
|
|
39
|
+
var reportResult = (0, global_store_1.useAiReportStore)(function (store) { return [store.reportResult]; }).reportResult;
|
|
40
|
+
var steps = (reportResult || {}).steps;
|
|
41
|
+
var duration = (0, react_1.useMemo)(function () { return (0, utils_1.getSecondToTime)((steps === null || steps === void 0 ? void 0 : steps.reduce(function (acc, cur) { return acc + cur.answer.media.durationTime; }, 0)) || 0); }, [steps]);
|
|
37
42
|
var _b = __read((0, react_1.useState)({ name: '', mobile: '', processName: '', positionName: '', avatar: '', tags: [] }), 2), data = _b[0], setData = _b[1];
|
|
38
43
|
(0, react_1.useEffect)(function () {
|
|
39
44
|
if (fetchCandidateInfo) {
|
|
@@ -41,6 +46,12 @@ var Form = function (_a) {
|
|
|
41
46
|
}
|
|
42
47
|
}, [fetchCandidateInfo]);
|
|
43
48
|
var name = data.name, mobile = data.mobile, positionName = data.positionName, avatar = data.avatar, tags = data.tags;
|
|
44
|
-
return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row" }, { children: [(0, jsx_runtime_1.jsx)(styled_1.ReportAvatar, { sx: { mx: 3 }, avatar: avatar }), (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ spacing: 1 }, { children: [(0, jsx_runtime_1.jsx)(styled_1.DinTypography, __assign({ sx: { fontSize: 18 } }, { children: positionName })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body1" }, { children: [name, " ", mobile] })), (0, jsx_runtime_1.jsx)(
|
|
49
|
+
return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", minHeight: 221, mt: 13.25 }, { children: [(0, jsx_runtime_1.jsx)(styled_1.ReportAvatar, { sx: { mx: 3 }, avatar: avatar }), (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ spacing: 1 }, { children: [(0, jsx_runtime_1.jsx)(styled_1.DinTypography, __assign({ sx: { fontSize: 18 } }, { children: positionName })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body1" }, { children: [name, " ", mobile] })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ sx: {
|
|
50
|
+
display: 'flex',
|
|
51
|
+
flexWrap: 'wrap',
|
|
52
|
+
gap: '8px',
|
|
53
|
+
alignItems: 'flex-start',
|
|
54
|
+
width: '450px',
|
|
55
|
+
} }, { children: tags === null || tags === void 0 ? void 0 : tags.map(function (tag) { return ((0, jsx_runtime_1.jsx)(styled_1.ReportTag, { children: tag.name }, tag.token)); }) })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, { children: ["\u9762\u8BD5\u65F6\u957F\uFF1A", duration] })] }))] })));
|
|
45
56
|
};
|
|
46
57
|
exports.default = (0, react_1.memo)(Form);
|
|
@@ -47,6 +47,6 @@ var Form = function () {
|
|
|
47
47
|
setText('');
|
|
48
48
|
}
|
|
49
49
|
}, [score, reportRank, scoreRankIntervals, progress]);
|
|
50
|
-
return ((0, jsx_runtime_1.jsx)(styled_1.Podium, { children: (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", position: "relative", bottom: -128, left: 88 }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ spacing: 1, direction: "row", justifyContent: "center", width: 300 }, { children: [(0, jsx_runtime_1.jsx)(
|
|
50
|
+
return ((0, jsx_runtime_1.jsx)(styled_1.Podium, { children: (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", position: "relative", bottom: -128, left: 88, spacing: 1.5 }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ spacing: 1, direction: "row", justifyContent: "center", width: 300 }, { children: [(0, jsx_runtime_1.jsx)(styled_1.DinTypography, __assign({ sx: { fontSize: 100, fontWeight: 'bold', lineHeight: 1 }, color: "inherit" }, { children: score })), (0, jsx_runtime_1.jsx)(styled_1.DinTypography, __assign({ variant: "h5", color: "inherit", sx: { fontSize: 30, fontWeight: 'bold', alignSelf: 'flex-end' } }, { children: "\u5206" }))] })), (reportRank === null || reportRank === void 0 ? void 0 : reportRank.total) !== 0 && ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ spacing: 1, mt: 6.25 }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ color: "inherit", fontWeight: 500 }, { children: [text, "\u00A0"] })), (0, jsx_runtime_1.jsx)(styled_1.BeatProgressBar, { children: (0, jsx_runtime_1.jsx)("div", { className: "progress-bar-fill", style: { width: "".concat(progress, "%") } }) })] })))] })) }));
|
|
51
51
|
};
|
|
52
52
|
exports.default = Form;
|
|
@@ -17,10 +17,10 @@ var _a;
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.QUESTION_TYPE = void 0;
|
|
19
19
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
20
|
+
var styled_1 = require("../styled");
|
|
20
21
|
var Nps_1 = __importDefault(require("./Nps"));
|
|
21
22
|
var react_photo_view_1 = require("../../../../components/react-photo-view");
|
|
22
23
|
var dayjs_1 = __importDefault(require("dayjs"));
|
|
23
|
-
var fbm_icons_1 = require("fbm-icons");
|
|
24
24
|
var fbm_ui_1 = require("fbm-ui");
|
|
25
25
|
var mui_1 = require("fbm-ui/lib/mui");
|
|
26
26
|
var QUESTION_TYPE;
|
|
@@ -35,8 +35,8 @@ var QUESTION_TYPE;
|
|
|
35
35
|
QUESTION_TYPE[QUESTION_TYPE["NPS"] = 9] = "NPS";
|
|
36
36
|
})(QUESTION_TYPE = exports.QUESTION_TYPE || (exports.QUESTION_TYPE = {}));
|
|
37
37
|
var Image = function (answer) {
|
|
38
|
-
var _a, _b;
|
|
39
|
-
return ((0, jsx_runtime_1.jsx)(react_photo_view_1.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 ((0, jsx_runtime_1.jsx)(react_photo_view_1.PhotoView, __assign({ src: url }, { children: (0, jsx_runtime_1.jsx)("img", { src: url, alt: url, width: 48, height: 32 }) }), url)); }) })));
|
|
38
|
+
var _a, _b, _c;
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)(react_photo_view_1.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 ((0, jsx_runtime_1.jsx)(react_photo_view_1.PhotoView, __assign({ src: url }, { children: (0, jsx_runtime_1.jsx)("img", { src: url, alt: url, width: 48, height: 32 }) }), url)); }) })));
|
|
40
40
|
};
|
|
41
41
|
var fillBlanks = function (answer) { var _a, _b; return (0, jsx_runtime_1.jsx)(fbm_ui_1.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(',') })); };
|
|
42
42
|
var Choice = function (answer) {
|
|
@@ -52,7 +52,12 @@ var template = (_a = {},
|
|
|
52
52
|
_a[QUESTION_TYPE.RADIO] = Choice,
|
|
53
53
|
_a[QUESTION_TYPE.CHECKBOX] = Choice,
|
|
54
54
|
_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; },
|
|
55
|
-
_a[QUESTION_TYPE.TIME] = function (answer) {
|
|
55
|
+
_a[QUESTION_TYPE.TIME] = function (answer) {
|
|
56
|
+
var _a, _b, _c;
|
|
57
|
+
return ((_a = answer === null || answer === void 0 ? void 0 : answer.formAnswer) === null || _a === void 0 ? void 0 : _a.dateTime) &&
|
|
58
|
+
!isNaN((_b = answer === null || answer === void 0 ? void 0 : answer.formAnswer) === null || _b === void 0 ? void 0 : _b.dateTime) &&
|
|
59
|
+
(0, dayjs_1.default)(Number((_c = answer === null || answer === void 0 ? void 0 : answer.formAnswer) === null || _c === void 0 ? void 0 : _c.dateTime) * 1000).format('YYYY年MM月DD日');
|
|
60
|
+
},
|
|
56
61
|
_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; },
|
|
57
62
|
_a[QUESTION_TYPE.FILL_BLANKS] = fillBlanks,
|
|
58
63
|
_a[QUESTION_TYPE.NPS] = Nps_1.default,
|
|
@@ -60,16 +65,23 @@ var template = (_a = {},
|
|
|
60
65
|
_a);
|
|
61
66
|
var Form = function (_a) {
|
|
62
67
|
var answers = _a.answers, _b = _a.customProcessName, customProcessName = _b === void 0 ? '资料收集' : _b;
|
|
63
|
-
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ component: fbm_ui_1.Paper, m: 3, pt: 2 }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.
|
|
68
|
+
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ component: fbm_ui_1.Paper, m: 3, pt: 2 }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", sx: {
|
|
69
|
+
height: 40,
|
|
64
70
|
pl: 3,
|
|
71
|
+
pr: 4,
|
|
65
72
|
color: '#009D56',
|
|
66
73
|
background: 'url(//webcdn.fbmms.cn/assets/yt-b/yf2BqqIlr8Xtb8N2o44t1) no-repeat center center',
|
|
67
74
|
backgroundSize: 'contain',
|
|
68
|
-
width:
|
|
75
|
+
width: 'fit-content',
|
|
76
|
+
overflow: 'hidden',
|
|
69
77
|
mb: 2,
|
|
70
|
-
display: 'flex',
|
|
71
78
|
alignItems: 'center',
|
|
72
|
-
} }, { children: [(0, jsx_runtime_1.jsx)(
|
|
79
|
+
} }, { children: [(0, jsx_runtime_1.jsx)("img", { className: "MuiSvgIcon-root", src: "//webcdn.fbmms.cn/assets/Vj2m/QMPCkdJ4uQYCS0ovOtKJ5", alt: "", width: 20, height: 20 }), (0, jsx_runtime_1.jsx)(styled_1.DinTypography, __assign({ variant: "h6", sx: {
|
|
80
|
+
ml: 1,
|
|
81
|
+
color: '#009D56',
|
|
82
|
+
lineHeight: '24px',
|
|
83
|
+
width: 'auto',
|
|
84
|
+
} }, { children: customProcessName }))] })), (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ p: 3, pt: 0 }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", sx: {
|
|
73
85
|
background: '#E5FDE6',
|
|
74
86
|
color: '#009D56',
|
|
75
87
|
borderRadius: 20,
|
|
@@ -83,7 +95,7 @@ var Form = function (_a) {
|
|
|
83
95
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", sx: {
|
|
84
96
|
py: 1,
|
|
85
97
|
px: 2,
|
|
86
|
-
} }, { children: [(0, jsx_runtime_1.
|
|
98
|
+
} }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", sx: { width: 52 } }, { children: index + 1 })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", flex: 1, mr: 7 }, { children: answer.formTypeKey })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", flex: 1 }, { children: (_a = template[answer.formTypeId]) === null || _a === void 0 ? void 0 : _a.call(template, answer) }))] }), index), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, { sx: { background: '#fff', height: 2, mx: 1 } })] }));
|
|
87
99
|
}) }))] }))] })));
|
|
88
100
|
};
|
|
89
101
|
exports.default = Form;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FormReports } from './interface';
|
|
3
3
|
export interface FormsProps {
|
|
4
|
-
|
|
4
|
+
fetchFormResult: () => Promise<FormReports>;
|
|
5
5
|
}
|
|
6
|
-
declare const Forms: ({
|
|
7
|
-
|
|
6
|
+
declare const Forms: ({ fetchFormResult }: {
|
|
7
|
+
fetchFormResult: any;
|
|
8
8
|
}) => JSX.Element;
|
|
9
9
|
export default Forms;
|
|
@@ -34,17 +34,17 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
34
34
|
var Form_1 = __importDefault(require("./Form"));
|
|
35
35
|
var react_1 = require("react");
|
|
36
36
|
var Forms = function (_a) {
|
|
37
|
-
var
|
|
37
|
+
var fetchFormResult = _a.fetchFormResult;
|
|
38
38
|
var _b = __read((0, react_1.useState)([]), 2), data = _b[0], setData = _b[1];
|
|
39
39
|
(0, react_1.useEffect)(function () {
|
|
40
|
-
if (
|
|
41
|
-
|
|
40
|
+
if (fetchFormResult) {
|
|
41
|
+
fetchFormResult()
|
|
42
42
|
.then(function (res) {
|
|
43
43
|
setData(res);
|
|
44
44
|
})
|
|
45
45
|
.catch(console);
|
|
46
46
|
}
|
|
47
|
-
}, [
|
|
47
|
+
}, [fetchFormResult]);
|
|
48
48
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: data.map(function (item, index) { return ((0, jsx_runtime_1.jsx)(Form_1.default, __assign({}, item), index)); }) }));
|
|
49
49
|
};
|
|
50
50
|
exports.default = Forms;
|
|
@@ -48,6 +48,8 @@ var Nps = function (_a) {
|
|
|
48
48
|
var fromScore = (from === null || from === void 0 ? void 0 : from.score) || 0;
|
|
49
49
|
var toScore = (to === null || to === void 0 ? void 0 : to.score) || 0;
|
|
50
50
|
var npsData = __spreadArray([], __read(Array.from(new Array(toScore + 1 - fromScore).keys())), false).map(function (i) { return i + fromScore; });
|
|
51
|
+
if (!answer)
|
|
52
|
+
return null;
|
|
51
53
|
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ display: "flex" }, { children: typeof answer === 'string' &&
|
|
52
54
|
npsData.map(function (value) {
|
|
53
55
|
var isSelect = value <= Number(answer);
|
|
@@ -1,13 +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
|
+
status: number;
|
|
4
5
|
customScore?: number;
|
|
5
6
|
onRefreshSuccess: () => void;
|
|
6
7
|
fetchCandidateInfo: () => Promise<CandidateInfo>;
|
|
8
|
+
fetchReportUrl: () => Promise<AiReportUrl>;
|
|
7
9
|
}
|
|
8
|
-
declare const ReportHeader: ({ customScore, onRefreshSuccess, fetchCandidateInfo }: {
|
|
10
|
+
declare const ReportHeader: ({ customScore, onRefreshSuccess, fetchCandidateInfo, status, fetchReportUrl }: {
|
|
9
11
|
customScore: any;
|
|
10
12
|
onRefreshSuccess: any;
|
|
11
13
|
fetchCandidateInfo: any;
|
|
14
|
+
status: any;
|
|
15
|
+
fetchReportUrl: any;
|
|
12
16
|
}) => JSX.Element;
|
|
13
17
|
export default ReportHeader;
|
|
@@ -34,7 +34,8 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
34
34
|
var AIEvaluate_1 = __importDefault(require("../AIEvaluate"));
|
|
35
35
|
var Candidate_1 = require("../Candidate");
|
|
36
36
|
var styled_1 = require("../styled");
|
|
37
|
-
var ai_report_1 = require("../../../../
|
|
37
|
+
var ai_report_1 = require("../../../../enum/ai-report");
|
|
38
|
+
var ai_report_2 = require("../../../../services/ai-report");
|
|
38
39
|
var global_store_1 = require("../../../../store/ai-report/global-store");
|
|
39
40
|
var utils_1 = require("../../../../utils/utils");
|
|
40
41
|
var ahooks_1 = require("ahooks");
|
|
@@ -44,22 +45,23 @@ var fbm_ui_1 = require("fbm-ui");
|
|
|
44
45
|
var mui_1 = require("fbm-ui/lib/mui");
|
|
45
46
|
var react_1 = require("react");
|
|
46
47
|
var ReportHeader = function (_a) {
|
|
47
|
-
var customScore = _a.customScore, onRefreshSuccess = _a.onRefreshSuccess, fetchCandidateInfo = _a.fetchCandidateInfo;
|
|
48
|
+
var customScore = _a.customScore, onRefreshSuccess = _a.onRefreshSuccess, fetchCandidateInfo = _a.fetchCandidateInfo, status = _a.status, fetchReportUrl = _a.fetchReportUrl;
|
|
48
49
|
var _b = __read((0, react_1.useState)(false), 2), openRefresh = _b[0], setOpenRefresh = _b[1];
|
|
49
|
-
var _c = (0,
|
|
50
|
+
var _c = __read((0, react_1.useState)(null), 2), reportUrl = _c[0], setReportUrl = _c[1];
|
|
51
|
+
var _d = (0, global_store_1.useAiReportStore)(function (store) { return [
|
|
50
52
|
store.token,
|
|
51
53
|
store.reportResult,
|
|
52
54
|
store.operableButtons,
|
|
53
|
-
]; }), token =
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var
|
|
55
|
+
]; }), token = _d.token, reportResult = _d.reportResult, operableButtons = _d.operableButtons, onExportReportClick = _d.onExportReportClick;
|
|
56
|
+
var _e = reportResult || {}, score = _e.score, createTime = _e.createTime, model = _e.model;
|
|
57
|
+
var _f = __read((0, react_1.useState)(score || 0), 2), feScore = _f[0], setScore = _f[1];
|
|
58
|
+
var _g = (0, ahooks_1.useRequest)(function () { return (0, ai_report_2.PostAiInterviewRefresh)(token); }, {
|
|
57
59
|
manual: true,
|
|
58
60
|
onSuccess: function () {
|
|
59
61
|
onRefreshSuccess();
|
|
60
62
|
fbm_ui_1.Message.success('刷新成功');
|
|
61
63
|
},
|
|
62
|
-
}), run =
|
|
64
|
+
}), run = _g.run, loading = _g.loading;
|
|
63
65
|
var level = (0, react_1.useMemo)(function () {
|
|
64
66
|
if (feScore >= 80)
|
|
65
67
|
return 'high';
|
|
@@ -67,6 +69,16 @@ var ReportHeader = function (_a) {
|
|
|
67
69
|
return 'middle';
|
|
68
70
|
return 'low';
|
|
69
71
|
}, [feScore]);
|
|
72
|
+
(0, react_1.useEffect)(function () {
|
|
73
|
+
if (!fetchReportUrl)
|
|
74
|
+
return;
|
|
75
|
+
fetchReportUrl()
|
|
76
|
+
.then(function (_a) {
|
|
77
|
+
var url = _a.url;
|
|
78
|
+
setReportUrl(url);
|
|
79
|
+
})
|
|
80
|
+
.catch(function () { return fbm_ui_1.Message.error('获取报告链接失败'); });
|
|
81
|
+
}, [fetchReportUrl]);
|
|
70
82
|
var content = ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ padding: 2 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body1", color: "secondary" }, { children: "\u5237\u65B0\u540E\u5C06\u6309\u6700\u65B0\u7B97\u5206\u89C4\u5219\u8BA1\u7B97\uFF0C\u662F\u5426\u786E\u8BA4\u5237\u65B0" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ paddingTop: 1, textAlign: "right" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ loading: loading, onClick: run }, { children: "\u5237\u65B0" })) }))] })));
|
|
71
83
|
(0, react_1.useEffect)(function () {
|
|
72
84
|
if (typeof customScore === 'number' && customScore > -1) {
|
|
@@ -78,10 +90,19 @@ var ReportHeader = function (_a) {
|
|
|
78
90
|
if (!loading)
|
|
79
91
|
setOpenRefresh(false);
|
|
80
92
|
}, [loading, customScore, score]);
|
|
81
|
-
return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, { children: [model === 'pro' && (0, jsx_runtime_1.jsx)(styled_1.ReportBadge, {}), (0, jsx_runtime_1.jsx)(styled_1.ReportLabel, { level:
|
|
93
|
+
return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ position: "relative" }, { children: [model === 'pro' && (0, jsx_runtime_1.jsx)(styled_1.ReportBadge, {}), (0, jsx_runtime_1.jsx)(styled_1.ReportLabel, { level: status === ai_report_1.INTERVIEW_STATUS.COMPLETED ? level : 'calculation' }), (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", alignItems: "center", justifyContent: "space-between", sx: {
|
|
94
|
+
width: 'calc(100% - 180px)',
|
|
95
|
+
position: 'absolute',
|
|
96
|
+
top: 0,
|
|
97
|
+
zIndex: 2,
|
|
98
|
+
} }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", alignItems: "center", pl: 3, py: 3 }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "caption", sx: {
|
|
82
99
|
color: 'rgba(74, 74, 74, 0.86)',
|
|
83
|
-
} }, { children: ["\u62A5\u544A\u751F\u6210\u65F6\u95F4\uFF1A", (0, dayjs_1.default)(createTime && createTime * 1000).format('YYYY-MM-DD HH:mm')] })), (operableButtons === null || operableButtons === void 0 ? void 0 : operableButtons.includes('refresh')) && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Popover, __assign({ open: openRefresh, content: content, onClickAway: function () { return setOpenRefresh(false); } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({
|
|
100
|
+
} }, { children: ["\u62A5\u544A\u751F\u6210\u65F6\u95F4\uFF1A", (0, dayjs_1.default)(createTime && createTime * 1000).format('YYYY-MM-DD HH:mm')] })), (operableButtons === null || operableButtons === void 0 ? void 0 : operableButtons.includes('refresh')) && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Popover, __assign({ open: openRefresh, content: content, onClickAway: function () { return setOpenRefresh(false); } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ onClick: function () { return setOpenRefresh(true); } }, { children: (0, jsx_runtime_1.jsx)(fbm_icons_1.RefreshIcon, { sx: {
|
|
84
101
|
color: '#009908',
|
|
85
|
-
} }) })) })))] })), (0, jsx_runtime_1.jsx)(
|
|
102
|
+
} }) })) })))] })), (0, jsx_runtime_1.jsx)(styled_1.DinTypography, __assign({ variant: "h5", textAlign: "center", color: "#009D56", sx: { alignSelf: 'center' } }, { children: "AI \u9762\u8BD5\u62A5\u544A" })), (operableButtons === null || operableButtons === void 0 ? void 0 : operableButtons.includes('export')) ? ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ endIcon: (0, jsx_runtime_1.jsx)(fbm_icons_1.ShareIcon, {}), variant: "text", onClick: onExportReportClick, sx: { borderRadius: 18, border: '1px solid #4caf50' } }, { children: "\u5BFC\u51FA\u62A5\u544A" }))) : reportUrl ? ((0, jsx_runtime_1.jsx)("a", __assign({ href: reportUrl, title: "\u67E5\u770B\u5728\u7EBF\u62A5\u544A" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ endIcon: (0, jsx_runtime_1.jsx)(fbm_icons_1.ShareIcon, {}), variant: "text", sx: { borderRadius: 18, border: '1px solid #4caf50' } }, { children: "\u67E5\u770B\u5728\u7EBF\u62A5\u544A" })) }))) : ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, {}))] })), (0, jsx_runtime_1.jsxs)(mui_1.Stack, { children: [fetchCandidateInfo && status === ai_report_1.INTERVIEW_STATUS.COMPLETED && (0, jsx_runtime_1.jsx)(Candidate_1.CandidateReport, { fetchCandidateInfo: fetchCandidateInfo }), !fetchCandidateInfo && status === ai_report_1.INTERVIEW_STATUS.COMPLETED && (0, jsx_runtime_1.jsx)(Candidate_1.PodiumReport, { score: (0, utils_1.formatScore)(feScore || 0) }), status !== ai_report_1.INTERVIEW_STATUS.COMPLETED && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, { sx: {
|
|
103
|
+
position: 'relative',
|
|
104
|
+
width: 541,
|
|
105
|
+
height: 342,
|
|
106
|
+
} }))] }), status === ai_report_1.INTERVIEW_STATUS.COMPLETED && ((0, jsx_runtime_1.jsx)(mui_1.Stack, __assign({ width: 1, direction: "row" }, { children: (0, jsx_runtime_1.jsx)(AIEvaluate_1.default, {}) })))] })));
|
|
86
107
|
};
|
|
87
108
|
exports.default = ReportHeader;
|
|
@@ -41,7 +41,7 @@ var Abilities = function (_a) {
|
|
|
41
41
|
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ mt: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "secondary", mb: 1 }, { children: "\u5206\u503C\u8BA1\u7B97\u89C4\u5219\uFF1A\u7EFC\u5408\u8BC4\u5206=AI\u8BC4\u5206*\u5355\u9898\u6743\u91CD" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ mt: 3 }, { children: steps &&
|
|
42
42
|
steps[stepIndex].scoreInfo.abilities.map(function (_a, index) {
|
|
43
43
|
var name = _a.name, originScore = _a.originScore, finalScore = _a.finalScore;
|
|
44
|
-
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2" }, { children: name })), (0, jsx_runtime_1.jsx)(ScoreSlider_1.default, { width:
|
|
44
|
+
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2" }, { children: name })), (0, jsx_runtime_1.jsx)(ScoreSlider_1.default, { width: 604, disabledScore: disabledScore, isShowLabel: true, originScore: originScore, finalScore: finalScore, valueLabelDisplay: "".concat(disabledScore ? 'off' : 'auto'), onChangeCommitted: function (score) { return handleChangeCommitted(score, index, 'ability'); } })] }, name));
|
|
45
45
|
}) }))] })));
|
|
46
46
|
};
|
|
47
47
|
exports.default = Abilities;
|
|
@@ -41,7 +41,6 @@ var styled_2 = require("./styled");
|
|
|
41
41
|
var Workplaces_1 = __importDefault(require("./Workplaces"));
|
|
42
42
|
var ai_question_1 = require("../../../../enum/ai-question");
|
|
43
43
|
var ai_report_1 = require("../../../../enum/ai-report");
|
|
44
|
-
var FormatQuote_1 = __importDefault(require("@mui/icons-material/FormatQuote"));
|
|
45
44
|
var global_store_1 = require("../../../../store/ai-report/global-store");
|
|
46
45
|
var utils_1 = require("../../../../utils/utils");
|
|
47
46
|
var fbm_ui_1 = require("fbm-ui");
|
|
@@ -51,14 +50,18 @@ var immutability_helper_1 = __importDefault(require("immutability-helper"));
|
|
|
51
50
|
var react_2 = require("react");
|
|
52
51
|
var STEP_NO_ANSWER = ai_report_1.INTERVIEW_STEP_STATUS.STEP_NO_ANSWER, STEP_COMPLETED = ai_report_1.INTERVIEW_STEP_STATUS.STEP_COMPLETED, STEP_FAILED = ai_report_1.INTERVIEW_STEP_STATUS.STEP_FAILED, STEP_IN_CALCULATION = ai_report_1.INTERVIEW_STEP_STATUS.STEP_IN_CALCULATION;
|
|
53
52
|
var QuestionItem = function (props) {
|
|
54
|
-
var token = props.token, reviewImgs = props.reviewImgs, followupQuestions = props.followupQuestions, index = props.index, status = props.status, _a = props.answer, analysisResult = _a.analysisResult, videoUrl = _a.videoUrl, _b = props.question, desc = _b.desc, type = _b.type, options = _b.options, aiShowType = _b.aiShowType, _c = props.scoreInfo, score = _c.score, weight = _c.weight, originScore = _c.originScore, finalScore = _c.finalScore, abilities = _c.abilities, workplaceEvaluation = _c.workplaceEvaluation;
|
|
53
|
+
var token = props.token, reviewImgs = props.reviewImgs, followupQuestions = props.followupQuestions, index = props.index, status = props.status, _a = props.answer, analysisResult = _a.analysisResult, videoUrl = _a.videoUrl, _b = props.question, desc = _b.desc, type = _b.type, options = _b.options, aiShowType = _b.aiShowType, _c = props.scoreInfo, score = _c.score, weight = _c.weight, originScore = _c.originScore, finalScore = _c.finalScore, abilities = _c.abilities, workplaceEvaluation = _c.workplaceEvaluation, workplaceName = _c.workplaceName, isExportPdf = props.isExportPdf;
|
|
55
54
|
var _d = __read((0, react_2.useState)(false), 2), showAbilities = _d[0], setShowAbilities = _d[1];
|
|
56
|
-
var _e = (0, global_store_1.useAiReportStore)(function (store) { return [
|
|
55
|
+
var _e = (0, global_store_1.useAiReportStore)(function (store) { return [
|
|
56
|
+
store.reportResult,
|
|
57
|
+
store.stepToken,
|
|
58
|
+
store.operableButtons,
|
|
59
|
+
store.showAbilitiesDetails,
|
|
60
|
+
]; }), reportResult = _e.reportResult, operableButtons = _e.operableButtons, showAbilitiesDetails = _e.showAbilitiesDetails, updateReportResult = _e.updateReportResult, onScoreChange = _e.onScoreChange;
|
|
57
61
|
var steps = (reportResult || {}).steps;
|
|
58
62
|
var isAbilities = operableButtons === null || operableButtons === void 0 ? void 0 : operableButtons.includes('abilities');
|
|
59
63
|
var isExistWeight = Number(weight) > 0;
|
|
60
64
|
var isShowAbilitiesButton = abilities.length > 0 && isAbilities && !showAbilitiesDetails;
|
|
61
|
-
var isShowWeight = abilities.length === 0 || showAbilities || !isAbilities || showAbilitiesDetails;
|
|
62
65
|
var isShowAbilitiesDetails = abilities.length > 0 && (showAbilities || showAbilitiesDetails);
|
|
63
66
|
var isSingleChoice = aiShowType === ai_question_1.ADD_QUESTION_TYPE.SINGLECHIOCE;
|
|
64
67
|
var comprehensiveScore = (0, react_2.useMemo)(function () {
|
|
@@ -103,20 +106,23 @@ var QuestionItem = function (props) {
|
|
|
103
106
|
score: score,
|
|
104
107
|
});
|
|
105
108
|
}, [index, reportResult, steps, updateReportResult, onScoreChange, isSingleChoice]);
|
|
106
|
-
var handleClickItem = (0, react_2.useCallback)(function (e) {
|
|
107
|
-
e.stopPropagation();
|
|
108
|
-
if (videoUrl) {
|
|
109
|
-
updateState({ stepToken: token });
|
|
110
|
-
onStepChange === null || onStepChange === void 0 ? void 0 : onStepChange(token);
|
|
111
|
-
}
|
|
112
|
-
}, [token, videoUrl, onStepChange, updateState]);
|
|
113
109
|
return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ sx: {
|
|
114
110
|
padding: '16px 24px',
|
|
115
111
|
mt: 2,
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
112
|
+
} }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", justifyContent: "space-between", spacing: 4 }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ flex: 1 }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", alignItems: "center", spacing: 0.5 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", sx: {
|
|
113
|
+
backgroundColor: ThemeProvider_1.theme.palette.primary.main,
|
|
114
|
+
color: '#fff',
|
|
115
|
+
fontSize: 16,
|
|
116
|
+
borderRadius: '4px 4px 4px 4px',
|
|
117
|
+
lineHeight: '16px',
|
|
118
|
+
alignSelf: 'flex-start',
|
|
119
|
+
py: 0.25,
|
|
120
|
+
px: 0.5,
|
|
121
|
+
minWidth: 12,
|
|
122
|
+
} }, { children: index + 1 })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", color: ThemeProvider_1.theme.palette.primary.main }, { children: desc }))] })), (0, jsx_runtime_1.jsxs)(styled_2.QuestionDesc, { children: [(0, jsx_runtime_1.jsx)(BodyImages_1.default, { reviewImgs: reviewImgs }), (0, jsx_runtime_1.jsx)("img", { className: "MuiSvgIcon-root", src: "//webcdn.fbmms.cn/assets/OYDO/1-c2bdx4v1upzLDJ4Ko-c", alt: "", width: 18, height: 11 }), status === STEP_IN_CALCULATION ? ((0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "secondary" }, { children: "\u89C6\u9891\u5904\u7406\u4E2D\uFF0C\u8BF7\u7A0D\u5019" }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isSingleChoice && (0, jsx_runtime_1.jsx)(SingleChoice_1.default, { options: options || [], selected: (analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.selected) || [] }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, { variant: "caption", color: "secondary", dangerouslySetInnerHTML: { __html: renderText } }), type === ai_question_1.QUESTION_TYPE.COLOR_BLINDNESS && (analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.img) && ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsx)("img", { style: { width: 100, height: 100 }, src: analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.img, alt: "" }), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "secondary", ml: 1 }, { children: ["\u56DE\u7B54\uFF1A", analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.answer] }))] }))] }))] }), followupQuestions === null || followupQuestions === void 0 ? void 0 : followupQuestions.map(function (v) {
|
|
123
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ mt: 1, fontSize: 14, color: ThemeProvider_1.theme.palette.primary.main }, { children: "\u8FFD\u95EE\uFF1A".concat(v === null || v === void 0 ? void 0 : v.desc) })), (0, jsx_runtime_1.jsxs)(styled_2.QuestionDesc, { children: [(0, jsx_runtime_1.jsx)("img", { className: "MuiSvgIcon-root", src: "//webcdn.fbmms.cn/assets/OYDO/1-c2bdx4v1upzLDJ4Ko-c", alt: "", width: 18, height: 11 }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "secondary", ml: 1 }, { children: v === null || v === void 0 ? void 0 : v.answer }))] })] }));
|
|
124
|
+
})] })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ position: "relative" }, { children: [(0, jsx_runtime_1.jsx)(styled_1.Video, { src: videoUrl, controls: true }), isExportPdf && (0, jsx_runtime_1.jsx)(styled_1.ExportButton, __assign({ href: videoUrl }, { children: "\u67E5\u770B\u89C6\u9891" }))] }))] })), isExistWeight && status !== STEP_COMPLETED && ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ width: "100%", display: "flex", alignItems: "center", mt: 2 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ flex: "1 0", display: "flex", alignItems: "center", pl: 2 }, { children: workplaceName && ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", alignItems: "center", spacing: 0.5, mb: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ sx: { color: '#4CAF50' }, variant: "body2", fontWeight: "medium" }, { children: "\u8003\u6838\u70B9\uFF1A" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2" }, { children: workplaceName }))] }))) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ width: 150, textAlign: "right" }, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body1", fontSize: 16, fontWeight: 500, noWrap: true }, { children: ["\u7EFC\u5408\u8BC4\u5206\uFF1A", comprehensiveScore, "\u5206"] })) }))] }))), isExistWeight && status === STEP_COMPLETED && ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ mt: 3, spacing: 1, component: mui_1.Paper, variant: "outlined", sx: { border: '1px solid #9BCC9B', background: '#F7FFF7' }, p: 2 }, { children: [workplaceName && ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", alignItems: "center", spacing: 0.5, mb: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ sx: { color: '#4CAF50' }, variant: "body2", fontWeight: "medium" }, { children: "\u8003\u6838\u70B9\uFF1A" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2" }, { children: workplaceName }))] }))), isExistWeight && status === STEP_COMPLETED && ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ mt: 2, display: "flex" }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body2", mr: 4 }, { children: ["\u8BC4\u5206\uFF1A", finalScore.toFixed(0), "\u5206"] })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body2" }, { children: ["\u5355\u9898\u6743\u91CD\uFF1A", weight, "%"] }))] }))), isExistWeight && ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ width: "100%", display: "flex", alignItems: "center", mt: 2 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ flex: "1 0", display: "flex", alignItems: "center" }, { children: status === STEP_COMPLETED && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ScoreSlider_1.default, { valueLabelDisplay: "".concat(isSingleChoice ? 'off' : 'auto'), originScore: originScore, disabledScore: isSingleChoice, finalScore: finalScore, isShowScoreRank: true, onChangeCommitted: handleChangeCommitted }), isShowAbilitiesButton && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "text", style: { whiteSpace: 'nowrap' }, onClick: function () { return setShowAbilities(!showAbilities); } }, { children: showAbilities ? '收起' : '详情' })))] })) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ width: 150, textAlign: "right" }, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body1", fontSize: 16, fontWeight: 500, noWrap: true }, { children: ["\u7EFC\u5408\u8BC4\u5206\uFF1A", comprehensiveScore, "\u5206"] })) }))] }))), isShowAbilitiesDetails && (0, jsx_runtime_1.jsx)(Abilities_1.default, { stepIndex: index, disabledScore: isSingleChoice }), abilities.map(function (v) { return ((0, react_1.createElement)(Workplaces_1.default, __assign({}, v, { key: v.token }))); }), workplaceEvaluation && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", fontWeight: 700, sx: { color: '#4caf50' } }, { children: "AI\u8BC4\u4EF7" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, { variant: "caption", sx: {
|
|
125
|
+
color: '#424242',
|
|
126
|
+
}, dangerouslySetInnerHTML: { __html: workplaceEvaluation } })] }))] })))] }), token));
|
|
121
127
|
};
|
|
122
128
|
exports.default = QuestionItem;
|