eli-video-interview 1.2.19 → 1.2.20

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.
@@ -18,14 +18,15 @@ 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, Typography, Button } from 'fbm-ui';
22
- import { forwardRef, useEffect, useCallback, useRef, useImperativeHandle, useMemo, memo } from 'react';
21
+ import { Box, Button, Typography } from 'fbm-ui';
22
+ import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
23
23
  var NO_ANSWER = INTERVIEW_STATUS.NO_ANSWER;
24
24
  var AiReportRoot = forwardRef(function (props, ref) {
25
25
  var token = props.token, reminderSent = props.reminderSent, operableButtons = props.operableButtons, onLoad = props.onLoad, onSendReminderClick = props.onSendReminderClick;
26
26
  var firstLoad = useRef(true);
27
- var _a = useAiReportStore(), updateState = _a.updateState, updateReportResult = _a.updateReportResult;
28
- var _b = useRequest(function () { return PostAiInterviewResult([token]); }, {
27
+ var _a = useAiReportStore(), updateState = _a.updateState, updateReportResult = _a.updateReportResult, reportResult = _a.reportResult;
28
+ var _b = (reportResult || {}).collection, collection = _b === void 0 ? [] : _b;
29
+ var _c = useRequest(function () { return PostAiInterviewResult([token]); }, {
29
30
  manual: true,
30
31
  onSuccess: function (_a) {
31
32
  var list = _a.data.list;
@@ -43,7 +44,7 @@ var AiReportRoot = forwardRef(function (props, ref) {
43
44
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(__assign({ pageStepIndexes: pageStepIndexes_1 }, result));
44
45
  }
45
46
  },
46
- }), data = _b.data, loading = _b.loading, postAiInterviewResult = _b.run;
47
+ }), data = _c.data, loading = _c.loading, postAiInterviewResult = _c.run;
47
48
  var status = (data === null || data === void 0 ? void 0 : data.data.list[0].status) || NO_ANSWER;
48
49
  var handleRefreshSuccess = useCallback(function () {
49
50
  postAiInterviewResult();
@@ -65,9 +66,9 @@ var AiReportRoot = forwardRef(function (props, ref) {
65
66
  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 ? '已提醒' : '发送提醒' })) }))] }))] })));
66
67
  }
67
68
  else {
68
- return (_jsxs(Box, { children: [_jsx(NotFinish, {}), _jsx(ScoreReport, { onRefreshSuccess: handleRefreshSuccess }), _jsx(AIEvaluate, {}), _jsx(VideoQuestion, {})] }));
69
+ return (_jsxs(Box, { children: [_jsx(NotFinish, {}), (collection === null || collection === void 0 ? void 0 : collection.length) > 0 && _jsx(ScoreReport, { onRefreshSuccess: handleRefreshSuccess }), (collection === null || collection === void 0 ? void 0 : collection.length) > 0 && _jsx(AIEvaluate, {}), _jsx(VideoQuestion, {})] }));
69
70
  }
70
- }, [handleRefreshSuccess, onSendReminderClick, reminderSent, status, operableButtons]);
71
+ }, [handleRefreshSuccess, onSendReminderClick, reminderSent, status, operableButtons, collection]);
71
72
  return (_jsx(Box, __assign({ loading: firstLoad.current && loading, sx: { width: '100%', minHeight: '584px', height: '100%', margin: '0 auto', overflow: 'auto' } }, { children: aiReportResult })));
72
73
  });
73
74
  AiReportRoot.displayName = 'AiReportRoot';
@@ -29,8 +29,9 @@ var NO_ANSWER = ai_report_1.INTERVIEW_STATUS.NO_ANSWER;
29
29
  var AiReportRoot = (0, react_1.forwardRef)(function (props, ref) {
30
30
  var token = props.token, reminderSent = props.reminderSent, operableButtons = props.operableButtons, onLoad = props.onLoad, onSendReminderClick = props.onSendReminderClick;
31
31
  var firstLoad = (0, react_1.useRef)(true);
32
- var _a = (0, global_store_1.useAiReportStore)(), updateState = _a.updateState, updateReportResult = _a.updateReportResult;
33
- var _b = (0, ahooks_1.useRequest)(function () { return (0, ai_report_2.PostAiInterviewResult)([token]); }, {
32
+ var _a = (0, global_store_1.useAiReportStore)(), updateState = _a.updateState, updateReportResult = _a.updateReportResult, reportResult = _a.reportResult;
33
+ var _b = (reportResult || {}).collection, collection = _b === void 0 ? [] : _b;
34
+ var _c = (0, ahooks_1.useRequest)(function () { return (0, ai_report_2.PostAiInterviewResult)([token]); }, {
34
35
  manual: true,
35
36
  onSuccess: function (_a) {
36
37
  var list = _a.data.list;
@@ -48,7 +49,7 @@ var AiReportRoot = (0, react_1.forwardRef)(function (props, ref) {
48
49
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(__assign({ pageStepIndexes: pageStepIndexes_1 }, result));
49
50
  }
50
51
  },
51
- }), data = _b.data, loading = _b.loading, postAiInterviewResult = _b.run;
52
+ }), data = _c.data, loading = _c.loading, postAiInterviewResult = _c.run;
52
53
  var status = (data === null || data === void 0 ? void 0 : data.data.list[0].status) || NO_ANSWER;
53
54
  var handleRefreshSuccess = (0, react_1.useCallback)(function () {
54
55
  postAiInterviewResult();
@@ -70,9 +71,9 @@ var AiReportRoot = (0, react_1.forwardRef)(function (props, ref) {
70
71
  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 ? '已提醒' : '发送提醒' })) }))] }))] })));
71
72
  }
72
73
  else {
73
- return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsx)(NotFinish_1.default, {}), (0, jsx_runtime_1.jsx)(ScoreReport_1.default, { onRefreshSuccess: handleRefreshSuccess }), (0, jsx_runtime_1.jsx)(AIEvaluate_1.default, {}), (0, jsx_runtime_1.jsx)(VideoQuestion_1.default, {})] }));
74
+ return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsx)(NotFinish_1.default, {}), (collection === null || collection === void 0 ? void 0 : collection.length) > 0 && (0, jsx_runtime_1.jsx)(ScoreReport_1.default, { onRefreshSuccess: handleRefreshSuccess }), (collection === null || collection === void 0 ? void 0 : collection.length) > 0 && (0, jsx_runtime_1.jsx)(AIEvaluate_1.default, {}), (0, jsx_runtime_1.jsx)(VideoQuestion_1.default, {})] }));
74
75
  }
75
- }, [handleRefreshSuccess, onSendReminderClick, reminderSent, status, operableButtons]);
76
+ }, [handleRefreshSuccess, onSendReminderClick, reminderSent, status, operableButtons, collection]);
76
77
  return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ loading: firstLoad.current && loading, sx: { width: '100%', minHeight: '584px', height: '100%', margin: '0 auto', overflow: 'auto' } }, { children: aiReportResult })));
77
78
  });
78
79
  AiReportRoot.displayName = 'AiReportRoot';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eli-video-interview",
3
- "version": "1.2.19",
3
+ "version": "1.2.20",
4
4
  "description": "鳄梨科技 AI视频面试 React SDK",
5
5
  "author": "鳄梨科技",
6
6
  "license": "MIT",