eli-video-interview 1.6.0 → 1.6.2
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/modules/ai-report-v3/Root.js +13 -15
- package/esm/modules/ai-report-v3/components/SectionTabs/SectionTabs.js +29 -13
- package/esm/modules/ai-report-v3/useAiReportVersion.js +1 -1
- package/lib/modules/ai-report-v3/Root.js +13 -15
- package/lib/modules/ai-report-v3/components/SectionTabs/SectionTabs.js +29 -13
- package/lib/modules/ai-report-v3/useAiReportVersion.js +1 -1
- package/package.json +2 -2
|
@@ -14,7 +14,6 @@ import AIEvaluate from './components/AIEvaluate';
|
|
|
14
14
|
import CapabilityTable from './components/CapabilityTable/CapabilityTable';
|
|
15
15
|
import { FormReport } from './components/Form';
|
|
16
16
|
import NotFinish from './components/NotFinish';
|
|
17
|
-
import SectionTabs from './components/SectionTabs/SectionTabs';
|
|
18
17
|
import V3Header from './components/V3Header/V3Header';
|
|
19
18
|
import VideoQuestion from './components/VideoQuestion';
|
|
20
19
|
import { COMPLETED_STATUS, INTERVIEW_STATUS } from "../../enum/ai-report";
|
|
@@ -25,7 +24,7 @@ import { Box, Button, Typography } from 'fbm-ui';
|
|
|
25
24
|
import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
|
26
25
|
var NO_ANSWER = INTERVIEW_STATUS.NO_ANSWER;
|
|
27
26
|
var AiReportRoot = forwardRef(function (props, ref) {
|
|
28
|
-
var token = props.token, v3AssetBase = props.v3AssetBase, customScore = props.customScore, reminderSent = props.reminderSent, operableButtons = props.operableButtons, onLoad = props.onLoad,
|
|
27
|
+
var token = props.token, v3AssetBase = props.v3AssetBase, customScore = props.customScore, reminderSent = props.reminderSent, operableButtons = props.operableButtons, onLoad = props.onLoad, onSendReminderClick = props.onSendReminderClick, fetchFormResult = props.fetchFormResult, fetchCandidateInfo = props.fetchCandidateInfo, isExportPdf = props.isExportPdf;
|
|
29
28
|
var firstLoad = useRef(true);
|
|
30
29
|
var _a = useAiReportStore(), updateState = _a.updateState, updateReportResult = _a.updateReportResult, reportResult = _a.reportResult, interviewCheat = _a.interviewCheat;
|
|
31
30
|
var _b = (reportResult || {}).collection, collection = _b === void 0 ? [] : _b;
|
|
@@ -73,18 +72,18 @@ var AiReportRoot = forwardRef(function (props, ref) {
|
|
|
73
72
|
if (status === NO_ANSWER) {
|
|
74
73
|
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 ? '已提醒' : '发送提醒' })) }))] }))] })));
|
|
75
74
|
}
|
|
76
|
-
return (
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
75
|
+
return (_jsx(Box, __assign({ sx: { background: '#F7F8FA', minHeight: 618, px: 3 } }, { children: _jsx(Box, __assign({ sx: {
|
|
76
|
+
py: 2,
|
|
77
|
+
} }, { children: _jsxs(Box, __assign({ sx: {
|
|
78
|
+
maxWidth: 1342,
|
|
79
|
+
mx: 'auto',
|
|
80
|
+
backgroundColor: '#fff',
|
|
81
|
+
border: '1px solid rgba(0,0,0,0.06)',
|
|
82
|
+
boxShadow: '0 6px 24px rgba(0,0,0,0.10)',
|
|
83
|
+
borderRadius: 2,
|
|
84
|
+
overflow: 'hidden',
|
|
85
|
+
pb: 3,
|
|
86
|
+
} }, { children: [hasRisk && (_jsx(Box, __assign({ id: "report-risk-alert" }, { children: _jsx(NotFinish, {}) }))), _jsx(V3Header, { v3AssetBase: v3AssetBase, status: status, customScore: customScore, onRefreshSuccess: handleRefreshSuccess, fetchCandidateInfo: fetchCandidateInfo }), _jsxs(Box, __assign({ sx: { mx: 2, mt: 1.5 } }, { children: [((collection === null || collection === void 0 ? void 0 : collection.length) > 0 || !!(reportResult === null || reportResult === void 0 ? void 0 : reportResult.workplaceEvaluation)) && (_jsx(AIEvaluate, {})), _jsx(CapabilityTable, {}), fetchFormResult && _jsx(FormReport, { fetchFormResult: fetchFormResult }), _jsx(VideoQuestion, { isExportPdf: isExportPdf })] }))] })) })) })));
|
|
88
87
|
}, [
|
|
89
88
|
loading,
|
|
90
89
|
status,
|
|
@@ -95,7 +94,6 @@ var AiReportRoot = forwardRef(function (props, ref) {
|
|
|
95
94
|
customScore,
|
|
96
95
|
handleRefreshSuccess,
|
|
97
96
|
fetchCandidateInfo,
|
|
98
|
-
fetchReportUrl,
|
|
99
97
|
fetchFormResult,
|
|
100
98
|
isExportPdf,
|
|
101
99
|
]);
|
|
@@ -35,6 +35,16 @@ var sections = [
|
|
|
35
35
|
{ id: 'report-evaluate', name: '综合评价' },
|
|
36
36
|
{ id: 'report-question', name: '答题解析' },
|
|
37
37
|
];
|
|
38
|
+
var findScrollParent = function (node) {
|
|
39
|
+
var el = node;
|
|
40
|
+
while (el && el !== document.body) {
|
|
41
|
+
var s = getComputedStyle(el);
|
|
42
|
+
if (/(auto|scroll)/.test(s.overflowY) && el.scrollHeight > el.clientHeight)
|
|
43
|
+
return el;
|
|
44
|
+
el = el.parentElement;
|
|
45
|
+
}
|
|
46
|
+
return window;
|
|
47
|
+
};
|
|
38
48
|
var SectionTabs = function (_a) {
|
|
39
49
|
var _b = _a.hasRisk, hasRisk = _b === void 0 ? true : _b, _c = _a.operableButtons, operableButtons = _c === void 0 ? [] : _c, onExportReportClick = _a.onExportReportClick, fetchReportUrl = _a.fetchReportUrl;
|
|
40
50
|
var _d = __read(useState('report-header'), 2), active = _d[0], setActive = _d[1];
|
|
@@ -51,20 +61,10 @@ var SectionTabs = function (_a) {
|
|
|
51
61
|
.catch(function () { return undefined; });
|
|
52
62
|
}, [fetchReportUrl]);
|
|
53
63
|
useEffect(function () {
|
|
54
|
-
var getScrollParent = function (node) {
|
|
55
|
-
var el = node;
|
|
56
|
-
while (el && el !== document.body) {
|
|
57
|
-
var s = getComputedStyle(el);
|
|
58
|
-
if (/(auto|scroll)/.test(s.overflowY) && el.scrollHeight > el.clientHeight)
|
|
59
|
-
return el;
|
|
60
|
-
el = el.parentElement;
|
|
61
|
-
}
|
|
62
|
-
return window;
|
|
63
|
-
};
|
|
64
64
|
var root = rootRef.current;
|
|
65
65
|
if (!root)
|
|
66
66
|
return;
|
|
67
|
-
var scrollParent =
|
|
67
|
+
var scrollParent = findScrollParent(root);
|
|
68
68
|
var ids = sections.map(function (s) { return s.id; });
|
|
69
69
|
var onScroll = function () {
|
|
70
70
|
var tabHeight = root.offsetHeight || 48;
|
|
@@ -83,12 +83,28 @@ var SectionTabs = function (_a) {
|
|
|
83
83
|
onScroll();
|
|
84
84
|
return function () { return scrollParent.removeEventListener('scroll', onScroll); };
|
|
85
85
|
}, []);
|
|
86
|
-
var
|
|
86
|
+
var scrollToSection = function (id) {
|
|
87
87
|
var _a;
|
|
88
|
+
var el = document.getElementById(id);
|
|
89
|
+
if (!el)
|
|
90
|
+
return;
|
|
91
|
+
var tabHeight = ((_a = rootRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) || 48;
|
|
92
|
+
var container = findScrollParent(el);
|
|
93
|
+
if (container === window) {
|
|
94
|
+
var top_1 = el.getBoundingClientRect().top + (window.scrollY || document.documentElement.scrollTop) - tabHeight;
|
|
95
|
+
window.scrollTo({ top: top_1, behavior: 'smooth' });
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
var c = container;
|
|
99
|
+
var top_2 = el.getBoundingClientRect().top - c.getBoundingClientRect().top + c.scrollTop - tabHeight;
|
|
100
|
+
c.scrollTo({ top: top_2, behavior: 'smooth' });
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
var handleClick = function (id) {
|
|
88
104
|
if (id === 'report-risk' && !hasRisk)
|
|
89
105
|
return;
|
|
90
106
|
setActive(id);
|
|
91
|
-
(
|
|
107
|
+
scrollToSection(id);
|
|
92
108
|
};
|
|
93
109
|
return (_jsx(Box, __assign({ ref: rootRef, sx: {
|
|
94
110
|
position: 'sticky',
|
|
@@ -19,7 +19,6 @@ var AIEvaluate_1 = __importDefault(require("./components/AIEvaluate"));
|
|
|
19
19
|
var CapabilityTable_1 = __importDefault(require("./components/CapabilityTable/CapabilityTable"));
|
|
20
20
|
var Form_1 = require("./components/Form");
|
|
21
21
|
var NotFinish_1 = __importDefault(require("./components/NotFinish"));
|
|
22
|
-
var SectionTabs_1 = __importDefault(require("./components/SectionTabs/SectionTabs"));
|
|
23
22
|
var V3Header_1 = __importDefault(require("./components/V3Header/V3Header"));
|
|
24
23
|
var VideoQuestion_1 = __importDefault(require("./components/VideoQuestion"));
|
|
25
24
|
var ai_report_1 = require("../../enum/ai-report");
|
|
@@ -30,7 +29,7 @@ var fbm_ui_1 = require("fbm-ui");
|
|
|
30
29
|
var react_1 = require("react");
|
|
31
30
|
var NO_ANSWER = ai_report_1.INTERVIEW_STATUS.NO_ANSWER;
|
|
32
31
|
var AiReportRoot = (0, react_1.forwardRef)(function (props, ref) {
|
|
33
|
-
var token = props.token, v3AssetBase = props.v3AssetBase, customScore = props.customScore, reminderSent = props.reminderSent, operableButtons = props.operableButtons, onLoad = props.onLoad,
|
|
32
|
+
var token = props.token, v3AssetBase = props.v3AssetBase, customScore = props.customScore, reminderSent = props.reminderSent, operableButtons = props.operableButtons, onLoad = props.onLoad, onSendReminderClick = props.onSendReminderClick, fetchFormResult = props.fetchFormResult, fetchCandidateInfo = props.fetchCandidateInfo, isExportPdf = props.isExportPdf;
|
|
34
33
|
var firstLoad = (0, react_1.useRef)(true);
|
|
35
34
|
var _a = (0, global_store_1.useAiReportStore)(), updateState = _a.updateState, updateReportResult = _a.updateReportResult, reportResult = _a.reportResult, interviewCheat = _a.interviewCheat;
|
|
36
35
|
var _b = (reportResult || {}).collection, collection = _b === void 0 ? [] : _b;
|
|
@@ -78,18 +77,18 @@ var AiReportRoot = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
78
77
|
if (status === NO_ANSWER) {
|
|
79
78
|
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 ? '已提醒' : '发送提醒' })) }))] }))] })));
|
|
80
79
|
}
|
|
81
|
-
return ((0, jsx_runtime_1.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
80
|
+
return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ sx: { background: '#F7F8FA', minHeight: 618, px: 3 } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ sx: {
|
|
81
|
+
py: 2,
|
|
82
|
+
} }, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ sx: {
|
|
83
|
+
maxWidth: 1342,
|
|
84
|
+
mx: 'auto',
|
|
85
|
+
backgroundColor: '#fff',
|
|
86
|
+
border: '1px solid rgba(0,0,0,0.06)',
|
|
87
|
+
boxShadow: '0 6px 24px rgba(0,0,0,0.10)',
|
|
88
|
+
borderRadius: 2,
|
|
89
|
+
overflow: 'hidden',
|
|
90
|
+
pb: 3,
|
|
91
|
+
} }, { children: [hasRisk && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ id: "report-risk-alert" }, { children: (0, jsx_runtime_1.jsx)(NotFinish_1.default, {}) }))), (0, jsx_runtime_1.jsx)(V3Header_1.default, { v3AssetBase: v3AssetBase, status: status, customScore: customScore, onRefreshSuccess: handleRefreshSuccess, fetchCandidateInfo: fetchCandidateInfo }), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ sx: { mx: 2, mt: 1.5 } }, { children: [((collection === null || collection === void 0 ? void 0 : collection.length) > 0 || !!(reportResult === null || reportResult === void 0 ? void 0 : reportResult.workplaceEvaluation)) && ((0, jsx_runtime_1.jsx)(AIEvaluate_1.default, {})), (0, jsx_runtime_1.jsx)(CapabilityTable_1.default, {}), fetchFormResult && (0, jsx_runtime_1.jsx)(Form_1.FormReport, { fetchFormResult: fetchFormResult }), (0, jsx_runtime_1.jsx)(VideoQuestion_1.default, { isExportPdf: isExportPdf })] }))] })) })) })));
|
|
93
92
|
}, [
|
|
94
93
|
loading,
|
|
95
94
|
status,
|
|
@@ -100,7 +99,6 @@ var AiReportRoot = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
100
99
|
customScore,
|
|
101
100
|
handleRefreshSuccess,
|
|
102
101
|
fetchCandidateInfo,
|
|
103
|
-
fetchReportUrl,
|
|
104
102
|
fetchFormResult,
|
|
105
103
|
isExportPdf,
|
|
106
104
|
]);
|
|
@@ -37,6 +37,16 @@ var sections = [
|
|
|
37
37
|
{ id: 'report-evaluate', name: '综合评价' },
|
|
38
38
|
{ id: 'report-question', name: '答题解析' },
|
|
39
39
|
];
|
|
40
|
+
var findScrollParent = function (node) {
|
|
41
|
+
var el = node;
|
|
42
|
+
while (el && el !== document.body) {
|
|
43
|
+
var s = getComputedStyle(el);
|
|
44
|
+
if (/(auto|scroll)/.test(s.overflowY) && el.scrollHeight > el.clientHeight)
|
|
45
|
+
return el;
|
|
46
|
+
el = el.parentElement;
|
|
47
|
+
}
|
|
48
|
+
return window;
|
|
49
|
+
};
|
|
40
50
|
var SectionTabs = function (_a) {
|
|
41
51
|
var _b = _a.hasRisk, hasRisk = _b === void 0 ? true : _b, _c = _a.operableButtons, operableButtons = _c === void 0 ? [] : _c, onExportReportClick = _a.onExportReportClick, fetchReportUrl = _a.fetchReportUrl;
|
|
42
52
|
var _d = __read((0, react_1.useState)('report-header'), 2), active = _d[0], setActive = _d[1];
|
|
@@ -53,20 +63,10 @@ var SectionTabs = function (_a) {
|
|
|
53
63
|
.catch(function () { return undefined; });
|
|
54
64
|
}, [fetchReportUrl]);
|
|
55
65
|
(0, react_1.useEffect)(function () {
|
|
56
|
-
var getScrollParent = function (node) {
|
|
57
|
-
var el = node;
|
|
58
|
-
while (el && el !== document.body) {
|
|
59
|
-
var s = getComputedStyle(el);
|
|
60
|
-
if (/(auto|scroll)/.test(s.overflowY) && el.scrollHeight > el.clientHeight)
|
|
61
|
-
return el;
|
|
62
|
-
el = el.parentElement;
|
|
63
|
-
}
|
|
64
|
-
return window;
|
|
65
|
-
};
|
|
66
66
|
var root = rootRef.current;
|
|
67
67
|
if (!root)
|
|
68
68
|
return;
|
|
69
|
-
var scrollParent =
|
|
69
|
+
var scrollParent = findScrollParent(root);
|
|
70
70
|
var ids = sections.map(function (s) { return s.id; });
|
|
71
71
|
var onScroll = function () {
|
|
72
72
|
var tabHeight = root.offsetHeight || 48;
|
|
@@ -85,12 +85,28 @@ var SectionTabs = function (_a) {
|
|
|
85
85
|
onScroll();
|
|
86
86
|
return function () { return scrollParent.removeEventListener('scroll', onScroll); };
|
|
87
87
|
}, []);
|
|
88
|
-
var
|
|
88
|
+
var scrollToSection = function (id) {
|
|
89
89
|
var _a;
|
|
90
|
+
var el = document.getElementById(id);
|
|
91
|
+
if (!el)
|
|
92
|
+
return;
|
|
93
|
+
var tabHeight = ((_a = rootRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) || 48;
|
|
94
|
+
var container = findScrollParent(el);
|
|
95
|
+
if (container === window) {
|
|
96
|
+
var top_1 = el.getBoundingClientRect().top + (window.scrollY || document.documentElement.scrollTop) - tabHeight;
|
|
97
|
+
window.scrollTo({ top: top_1, behavior: 'smooth' });
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
var c = container;
|
|
101
|
+
var top_2 = el.getBoundingClientRect().top - c.getBoundingClientRect().top + c.scrollTop - tabHeight;
|
|
102
|
+
c.scrollTo({ top: top_2, behavior: 'smooth' });
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
var handleClick = function (id) {
|
|
90
106
|
if (id === 'report-risk' && !hasRisk)
|
|
91
107
|
return;
|
|
92
108
|
setActive(id);
|
|
93
|
-
(
|
|
109
|
+
scrollToSection(id);
|
|
94
110
|
};
|
|
95
111
|
return ((0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ ref: rootRef, sx: {
|
|
96
112
|
position: 'sticky',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eli-video-interview",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "鳄梨科技 AI视频面试 React SDK",
|
|
5
5
|
"author": "鳄梨科技",
|
|
6
6
|
"license": "MIT",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"type": "git",
|
|
67
67
|
"url": "https://jihulab.com/elihr/elifront/open/lerna-avocado-sdk.git"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "abb7c6d5688fd331fda7376b82cc9d1c93f4f3f5"
|
|
70
70
|
}
|