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.
Files changed (181) hide show
  1. package/esm/components/AiHeaderTitle/index.js +2 -10
  2. package/esm/components/AiHeaderTitleV2/index.d.ts +4 -0
  3. package/esm/components/AiHeaderTitleV2/index.js +39 -0
  4. package/esm/components/AiHeaderTitleV2/interface.d.ts +4 -0
  5. package/esm/components/AiHeaderTitleV2/interface.js +1 -0
  6. package/esm/components/Charts/ReportPie.js +13 -3
  7. package/esm/components/Charts/const.js +3 -3
  8. package/esm/components/ScoreBigBall/index.js +1 -1
  9. package/esm/constants/ai-question.d.ts +1 -1
  10. package/esm/constants/ai-question.js +3 -3
  11. package/esm/enum/ai-question.d.ts +11 -1
  12. package/esm/enum/ai-question.js +10 -0
  13. package/esm/modules/ai-ability/components/AbilityFormItem/index.js +11 -46
  14. package/esm/modules/ai-ability/components/AddAbility/index.js +2 -20
  15. package/esm/modules/ai-ability/components/UpdateAbility/index.js +6 -37
  16. package/esm/modules/ai-ability-select/Root.js +4 -2
  17. package/esm/modules/ai-ability-select/components/AiAbilityItem/AiAbilityDetail.d.ts +2 -2
  18. package/esm/modules/ai-ability-select/components/AiAbilityItem/AiAbilityDetail.js +2 -1
  19. package/esm/modules/ai-ability-select/components/AiAbilityItem/index.d.ts +2 -2
  20. package/esm/modules/ai-ability-select/components/AiAbilityItem/index.js +4 -4
  21. package/esm/modules/ai-ability-select/components/AiAbilityList/index.js +14 -2
  22. package/esm/modules/ai-ability-select/interface.d.ts +1 -0
  23. package/esm/modules/ai-question/Root.js +14 -14
  24. package/esm/modules/ai-question/components/AiAnalysis/AnalysisItem.js +13 -4
  25. package/esm/modules/ai-question/components/AiAssessmentCriteria/const.d.ts +43 -0
  26. package/esm/modules/ai-question/components/AiAssessmentCriteria/const.js +45 -2
  27. package/esm/modules/ai-question/components/AiAssessmentCriteria/index.js +39 -42
  28. package/esm/modules/ai-question/components/AiAssessmentCriteria/interface.d.ts +1 -0
  29. package/esm/modules/ai-question/components/BaseAccordion/index.js +4 -4
  30. package/esm/modules/ai-question/components/BaseAccordion/interface.d.ts +3 -0
  31. package/esm/modules/ai-question/components/BootVideo/index.js +12 -5
  32. package/esm/modules/ai-question/components/QuestionImport/index.js +2 -2
  33. package/esm/modules/ai-question/components/QuestionModel/Item.js +3 -3
  34. package/esm/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +6 -2
  35. package/esm/modules/ai-question/components/QuestionTemplate/index.js +1 -1
  36. package/esm/modules/ai-question/components/QuestionUpdate/AudioUploader.d.ts +6 -0
  37. package/esm/modules/ai-question/components/QuestionUpdate/AudioUploader.js +74 -0
  38. package/esm/modules/ai-question/components/QuestionUpdate/Form.js +19 -7
  39. package/esm/modules/ai-question/components/QuestionUpdate/RandomQuestion.js +13 -3
  40. package/esm/modules/ai-question/components/QuestionUpdate/VideoVoice.js +2 -2
  41. package/esm/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.d.ts +2 -1
  42. package/esm/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.js +4 -4
  43. package/esm/modules/ai-question/components/QuestionUpdate/const.js +3 -1
  44. package/esm/modules/ai-question/components/QuestionUpdate/index.js +3 -2
  45. package/esm/modules/ai-question/components/QuestionUpdate/interface.d.ts +6 -1
  46. package/esm/modules/ai-report/Root.js +6 -3
  47. package/esm/modules/ai-report/components/VideoQuestion/Video.d.ts +27 -0
  48. package/esm/modules/ai-report/components/VideoQuestion/Video.js +208 -0
  49. package/esm/modules/ai-report/interface.d.ts +2 -0
  50. package/esm/modules/ai-report/useAiReport.d.ts +2 -0
  51. package/esm/modules/ai-report/useAiReport.js +3 -1
  52. package/esm/modules/ai-report-v2/Root.d.ts +2 -2
  53. package/esm/modules/ai-report-v2/Root.js +18 -11
  54. package/esm/modules/ai-report-v2/components/AIEvaluate/Evaluate.d.ts +2 -4
  55. package/esm/modules/ai-report-v2/components/AIEvaluate/Evaluate.js +20 -20
  56. package/esm/modules/ai-report-v2/components/AIEvaluate/Graph.d.ts +13 -0
  57. package/esm/modules/ai-report-v2/components/AIEvaluate/Graph.js +86 -24
  58. package/esm/modules/ai-report-v2/components/AIEvaluate/index.d.ts +2 -2
  59. package/esm/modules/ai-report-v2/components/AIEvaluate/index.js +11 -7
  60. package/esm/modules/ai-report-v2/components/Candidate/Interface.d.ts +3 -0
  61. package/esm/modules/ai-report-v2/components/Candidate/Podium.js +2 -2
  62. package/esm/modules/ai-report-v2/components/Form/Form.js +34 -13
  63. package/esm/modules/ai-report-v2/components/Form/Nps.d.ts +1 -1
  64. package/esm/modules/ai-report-v2/components/Form/Nps.js +2 -0
  65. package/esm/modules/ai-report-v2/components/NotFinish/index.js +13 -5
  66. package/esm/modules/ai-report-v2/components/ReportHeader/ReportHeader.d.ts +4 -2
  67. package/esm/modules/ai-report-v2/components/ReportHeader/ReportHeader.js +28 -10
  68. package/esm/modules/ai-report-v2/components/Suggestion/index.js +1 -1
  69. package/esm/modules/ai-report-v2/components/VideoQuestion/Evaluate.d.ts +11 -0
  70. package/esm/modules/ai-report-v2/components/VideoQuestion/Evaluate.js +79 -0
  71. package/esm/modules/ai-report-v2/components/VideoQuestion/QuestionItem.js +49 -32
  72. package/esm/modules/ai-report-v2/components/VideoQuestion/Workplaces.d.ts +9 -5
  73. package/esm/modules/ai-report-v2/components/VideoQuestion/Workplaces.js +71 -6
  74. package/esm/modules/ai-report-v2/components/VideoQuestion/index.d.ts +6 -3
  75. package/esm/modules/ai-report-v2/components/VideoQuestion/index.js +6 -4
  76. package/esm/modules/ai-report-v2/components/VideoQuestion/interface.d.ts +1 -0
  77. package/esm/modules/ai-report-v2/components/VideoQuestion/styled.js +2 -2
  78. package/esm/modules/ai-report-v2/components/WorkPlaces/index.js +1 -1
  79. package/esm/modules/ai-report-v2/components/styled.d.ts +4 -1
  80. package/esm/modules/ai-report-v2/components/styled.js +14 -3
  81. package/esm/modules/ai-report-v2/interface.d.ts +4 -1
  82. package/esm/modules/ai-report-v2/useAiReport.d.ts +4 -0
  83. package/esm/modules/ai-report-v2/useAiReport.js +3 -1
  84. package/esm/modules/ai-report-v2/useAiReportVersion.d.ts +5 -0
  85. package/esm/modules/ai-report-v2/useAiReportVersion.js +37 -0
  86. package/esm/services/ai-report.d.ts +10 -0
  87. package/esm/services/ai-report.js +2 -0
  88. package/esm/store/ai-question/ai-analysis-store.d.ts +3 -1
  89. package/esm/store/ai-question/ai-analysis-store.js +26 -1
  90. package/esm/store/ai-report/global-store.d.ts +3 -0
  91. package/lib/components/AiHeaderTitle/index.js +1 -9
  92. package/lib/components/AiHeaderTitleV2/index.d.ts +4 -0
  93. package/lib/components/AiHeaderTitleV2/index.js +41 -0
  94. package/lib/components/AiHeaderTitleV2/interface.d.ts +4 -0
  95. package/lib/components/AiHeaderTitleV2/interface.js +2 -0
  96. package/lib/components/Charts/ReportPie.js +13 -3
  97. package/lib/components/Charts/const.js +3 -3
  98. package/lib/components/ScoreBigBall/index.js +1 -1
  99. package/lib/constants/ai-question.d.ts +1 -1
  100. package/lib/constants/ai-question.js +3 -3
  101. package/lib/enum/ai-question.d.ts +11 -1
  102. package/lib/enum/ai-question.js +10 -0
  103. package/lib/modules/ai-ability/components/AbilityFormItem/index.js +13 -45
  104. package/lib/modules/ai-ability/components/AddAbility/index.js +2 -20
  105. package/lib/modules/ai-ability/components/UpdateAbility/index.js +6 -37
  106. package/lib/modules/ai-ability-select/Root.js +4 -2
  107. package/lib/modules/ai-ability-select/components/AiAbilityItem/AiAbilityDetail.d.ts +2 -2
  108. package/lib/modules/ai-ability-select/components/AiAbilityItem/AiAbilityDetail.js +2 -1
  109. package/lib/modules/ai-ability-select/components/AiAbilityItem/index.d.ts +2 -2
  110. package/lib/modules/ai-ability-select/components/AiAbilityItem/index.js +4 -4
  111. package/lib/modules/ai-ability-select/components/AiAbilityList/index.js +14 -2
  112. package/lib/modules/ai-ability-select/interface.d.ts +1 -0
  113. package/lib/modules/ai-question/Root.js +14 -14
  114. package/lib/modules/ai-question/components/AiAnalysis/AnalysisItem.js +12 -3
  115. package/lib/modules/ai-question/components/AiAssessmentCriteria/const.d.ts +43 -0
  116. package/lib/modules/ai-question/components/AiAssessmentCriteria/const.js +46 -3
  117. package/lib/modules/ai-question/components/AiAssessmentCriteria/index.js +36 -39
  118. package/lib/modules/ai-question/components/AiAssessmentCriteria/interface.d.ts +1 -0
  119. package/lib/modules/ai-question/components/BaseAccordion/index.js +4 -4
  120. package/lib/modules/ai-question/components/BaseAccordion/interface.d.ts +3 -0
  121. package/lib/modules/ai-question/components/BootVideo/index.js +12 -5
  122. package/lib/modules/ai-question/components/QuestionImport/index.js +2 -2
  123. package/lib/modules/ai-question/components/QuestionModel/Item.js +3 -3
  124. package/lib/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +5 -1
  125. package/lib/modules/ai-question/components/QuestionTemplate/index.js +1 -1
  126. package/lib/modules/ai-question/components/QuestionUpdate/AudioUploader.d.ts +6 -0
  127. package/lib/modules/ai-question/components/QuestionUpdate/AudioUploader.js +76 -0
  128. package/lib/modules/ai-question/components/QuestionUpdate/Form.js +20 -8
  129. package/lib/modules/ai-question/components/QuestionUpdate/RandomQuestion.js +12 -2
  130. package/lib/modules/ai-question/components/QuestionUpdate/VideoVoice.js +2 -2
  131. package/lib/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.d.ts +2 -1
  132. package/lib/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.js +4 -4
  133. package/lib/modules/ai-question/components/QuestionUpdate/const.js +3 -1
  134. package/lib/modules/ai-question/components/QuestionUpdate/index.js +3 -2
  135. package/lib/modules/ai-question/components/QuestionUpdate/interface.d.ts +6 -1
  136. package/lib/modules/ai-report/Root.js +6 -3
  137. package/lib/modules/ai-report/components/VideoQuestion/Video.d.ts +27 -0
  138. package/lib/modules/ai-report/components/VideoQuestion/Video.js +213 -0
  139. package/lib/modules/ai-report/interface.d.ts +2 -0
  140. package/lib/modules/ai-report/useAiReport.d.ts +2 -0
  141. package/lib/modules/ai-report/useAiReport.js +6 -1
  142. package/lib/modules/ai-report-v2/Root.d.ts +2 -2
  143. package/lib/modules/ai-report-v2/Root.js +16 -9
  144. package/lib/modules/ai-report-v2/components/AIEvaluate/Evaluate.d.ts +2 -4
  145. package/lib/modules/ai-report-v2/components/AIEvaluate/Evaluate.js +17 -17
  146. package/lib/modules/ai-report-v2/components/AIEvaluate/Graph.d.ts +13 -0
  147. package/lib/modules/ai-report-v2/components/AIEvaluate/Graph.js +88 -23
  148. package/lib/modules/ai-report-v2/components/AIEvaluate/index.d.ts +2 -2
  149. package/lib/modules/ai-report-v2/components/AIEvaluate/index.js +11 -7
  150. package/lib/modules/ai-report-v2/components/Candidate/Interface.d.ts +3 -0
  151. package/lib/modules/ai-report-v2/components/Candidate/Podium.js +1 -1
  152. package/lib/modules/ai-report-v2/components/Form/Form.js +34 -13
  153. package/lib/modules/ai-report-v2/components/Form/Nps.d.ts +1 -1
  154. package/lib/modules/ai-report-v2/components/Form/Nps.js +2 -0
  155. package/lib/modules/ai-report-v2/components/NotFinish/index.js +12 -4
  156. package/lib/modules/ai-report-v2/components/ReportHeader/ReportHeader.d.ts +4 -2
  157. package/lib/modules/ai-report-v2/components/ReportHeader/ReportHeader.js +27 -9
  158. package/lib/modules/ai-report-v2/components/Suggestion/index.js +2 -2
  159. package/lib/modules/ai-report-v2/components/VideoQuestion/Evaluate.d.ts +11 -0
  160. package/lib/modules/ai-report-v2/components/VideoQuestion/Evaluate.js +81 -0
  161. package/lib/modules/ai-report-v2/components/VideoQuestion/QuestionItem.js +46 -29
  162. package/lib/modules/ai-report-v2/components/VideoQuestion/Workplaces.d.ts +9 -5
  163. package/lib/modules/ai-report-v2/components/VideoQuestion/Workplaces.js +69 -4
  164. package/lib/modules/ai-report-v2/components/VideoQuestion/index.d.ts +6 -3
  165. package/lib/modules/ai-report-v2/components/VideoQuestion/index.js +6 -4
  166. package/lib/modules/ai-report-v2/components/VideoQuestion/interface.d.ts +1 -0
  167. package/lib/modules/ai-report-v2/components/VideoQuestion/styled.js +2 -2
  168. package/lib/modules/ai-report-v2/components/WorkPlaces/index.js +2 -2
  169. package/lib/modules/ai-report-v2/components/styled.d.ts +4 -1
  170. package/lib/modules/ai-report-v2/components/styled.js +18 -4
  171. package/lib/modules/ai-report-v2/interface.d.ts +4 -1
  172. package/lib/modules/ai-report-v2/useAiReport.d.ts +4 -0
  173. package/lib/modules/ai-report-v2/useAiReport.js +6 -1
  174. package/lib/modules/ai-report-v2/useAiReportVersion.d.ts +5 -0
  175. package/lib/modules/ai-report-v2/useAiReportVersion.js +41 -0
  176. package/lib/services/ai-report.d.ts +10 -0
  177. package/lib/services/ai-report.js +5 -1
  178. package/lib/store/ai-question/ai-analysis-store.d.ts +3 -1
  179. package/lib/store/ai-question/ai-analysis-store.js +26 -1
  180. package/lib/store/ai-report/global-store.d.ts +3 -0
  181. package/package.json +4 -2
@@ -72,6 +72,8 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
72
72
  };
73
73
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
74
74
  import AiAnalysis from '../AiAnalysis';
75
+ import { VOICE_LANGUAGE_OPTIONS } from '../AiAssessmentCriteria/const';
76
+ import AudioUploader from './AudioUploader';
75
77
  import Chioce from './Chioce';
76
78
  import { broadcastModeOptions, durationOptions, prepareTimeOptions } from './const';
77
79
  import FllowupSetting from './FllowupSetting';
@@ -81,15 +83,17 @@ import { useAiAbilityListStore } from "../../../../store/ai-ability-select/quest
81
83
  import { useEnterpriseStore } from "../../../../store/enterprise/enterprise-store";
82
84
  import { ADD_QUESTION_TYPE } from "../../../../enum/ai-question";
83
85
  import { GetAiAbilityList } from "../../../../services/ai-ability";
86
+ import { useAiAnalysisStore } from "../../../../store/ai-question/ai-analysis-store";
84
87
  import { useRequest } from 'ahooks';
85
- import { Autocomplete, Box, CloseIcon, DeleteIcon, Form, FormItem, IconButton, Select, useForm } from 'fbm-ui';
88
+ import { Autocomplete, Box, CloseIcon, DeleteIcon, Form, FormItem, IconButton, Select, Typography, useForm } from 'fbm-ui';
86
89
  import { Paper, Stack } from 'fbm-ui/lib/mui';
87
90
  import { FieldArray } from 'formik';
88
91
  import { forwardRef, memo, useEffect, useImperativeHandle } from 'react';
89
92
  var QuestionForm = forwardRef(function (props, ref) {
90
93
  var aiShowType = props.aiShowType, initialValues = props.initialValues, values = props.values, preview = props.preview, onValuesChange = props.onValuesChange, onSubmit = props.onSubmit, onCategoryChange = props.onCategoryChange;
91
94
  var _a = useAiAbilityListStore(), aiAbilityList = _a.aiAbilityList, setSpecialAiAbilityList = _a.setSpecialAiAbilityList;
92
- var _b = useEnterpriseStore().enterprise, jobToken = _b.jobToken, thirdToken = _b.thirdToken;
95
+ var _b = useAiAnalysisStore(), analysisState = _b.analysisState, updateState = _b.updateState;
96
+ var _c = useEnterpriseStore().enterprise, jobToken = _c.jobToken, thirdToken = _c.thirdToken;
93
97
  var data = useRequest(function () { return GetAiAbilityList({ jobToken: jobToken, thirdToken: thirdToken }); }, {
94
98
  refreshDeps: [jobToken, thirdToken],
95
99
  manual: preview,
@@ -148,7 +152,7 @@ var QuestionForm = forwardRef(function (props, ref) {
148
152
  onValuesChange === null || onValuesChange === void 0 ? void 0 : onValuesChange(form.values);
149
153
  }, [form.values, onValuesChange]);
150
154
  return (_jsxs(_Fragment, { children: [_jsxs(Form, __assign({}, form, { children: [_jsx(FormItem, { required: true, disabled: preview, name: "name", label: "\u6807\u9898", placeholder: "\u6807\u9898\uFF08\u7528\u4E8E\u7CFB\u7EDF\u7BA1\u7406\uFF09", max: 15 }), _jsxs(Box, __assign({ display: "flex" }, { children: [!preview && aiShowType === ADD_QUESTION_TYPE.FREE && (_jsx(FormItem, __assign({ sx: { flex: '1 0', mr: 1 }, required: true, disabled: preview, name: "broadcastType", label: "\u64AD\u62A5\u65B9\u5F0F" }, { children: _jsx(Select, { placeholder: "\u64AD\u62A5\u65B9\u5F0F", options: broadcastModeOptions }) }))), !preview && (_jsx(FormItem, __assign({ style: { flex: '1 0' }, disabled: preview, name: "category", label: "\u8003\u5BDF\u80FD\u529B" }, { children: _jsx(Autocomplete, { placeholder: "\u8003\u5BDF\u80FD\u529B", options: aiAbilityList.map(function (_a) {
151
- var tag = _a.tag, token = _a.token, isWorkplace = _a.isWorkplace, define = _a.define, type = _a.type;
155
+ var tag = _a.tag, token = _a.token, isWorkplace = _a.isWorkplace, define = _a.define, type = _a.type, child = _a.child;
152
156
  return ({
153
157
  label: tag,
154
158
  value: tag,
@@ -158,6 +162,7 @@ var QuestionForm = forwardRef(function (props, ref) {
158
162
  token: token,
159
163
  define: define,
160
164
  isWorkplace: isWorkplace,
165
+ child: child,
161
166
  });
162
167
  }), onChange: handleCategoryChange }) })))] })), aiShowType !== ADD_QUESTION_TYPE.SINGLECHIOCE &&
163
168
  ((form === null || form === void 0 ? void 0 : form.values.broadcastType) === 1 || preview ? (_jsx(FieldArray, { name: "questions", render: function () {
@@ -186,21 +191,24 @@ var QuestionForm = forwardRef(function (props, ref) {
186
191
  }, sx: {
187
192
  flexGrow: 1,
188
193
  height: 'auto',
194
+ } }), _jsx(AudioUploader, { audioUrl: v.audioUrl, onChange: function (audioUrl) {
195
+ form.values.questions[index] = __assign(__assign({}, form.values.questions[index]), { audioUrl: audioUrl });
196
+ form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], __read(form.values.questions), false) }));
189
197
  } }), _jsx(Chioce, { index: index, item: v, onChange: function (_, options, i) {
190
198
  form.values.questions[index].options = options;
191
199
  form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], __read(form.values.questions), false) }));
192
200
  } })] }), index));
193
201
  });
194
202
  } }) })), !preview && aiShowType !== ADD_QUESTION_TYPE.LANGUAGE && (_jsx(RandomQuestion, { aiShowType: aiShowType, category: aiAbilityList === null || aiAbilityList === void 0 ? void 0 : aiAbilityList.find(function (v) { var _a; return v.name === ((_a = form.values.category) === null || _a === void 0 ? void 0 : _a.value); }), broadcastType: form.values.broadcastType, onAddCustonQuestion: function () {
195
- form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray(__spreadArray([], __read(form.values.questions), false), [{ content: '', videoUrl: '' }], false) }));
203
+ form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray(__spreadArray([], __read(form.values.questions), false), [{ content: '', videoUrl: '', videoURLWide: '', audioUrl: '' }], false) }));
196
204
  }, onAddRandomQuestion: function (qs) {
197
- form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray(__spreadArray([], __read(form.values.questions), false), __read(qs.map(function (v) { return ({ content: v, videoUrl: '' }); })), false) }));
205
+ form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray(__spreadArray([], __read(form.values.questions), false), __read(qs.map(function (v) { return ({ content: v, videoUrl: '', videoURLWide: '', audioUrl: '' }); })), false) }));
198
206
  } })), aiShowType === ADD_QUESTION_TYPE.LANGUAGE && (_jsx(FormItem, { sx: { height: 'auto', mb: 2 }, required: true, name: "readText", label: "\u6717\u8BFB\u5185\u5BB9", max: 240, InputProps: {
199
207
  rows: 3,
200
208
  multiline: true,
201
209
  placeholder: '朗读内容(候选人将根据此内容进行朗读)',
202
210
  sx: { padding: 0 },
203
- } })), _jsxs(Box, __assign({ display: "flex" }, { children: [_jsx(FormItem, __assign({ sx: { height: 64, flex: '1 0', mr: 2 }, required: true, disabled: preview, name: "prepareTime", label: "\u51C6\u5907\u65F6\u957F" }, { children: _jsx(Select, { options: prepareTimeOptions }) })), _jsx(FormItem, __assign({ sx: { height: 64, flex: '1 0' }, required: true, disabled: preview, name: "duration", label: "\u56DE\u7B54\u65F6\u957F" }, { children: _jsx(Select, { options: durationOptions }) })), _jsx(FormItem, { sx: { height: 64, flex: '1 0', ml: 2 }, name: "minResponseDuration", label: "\u6700\u5C11\u56DE\u7B54\u65F6\u957F", type: "number", disabled: preview,
211
+ } })), _jsxs(Box, __assign({ display: "flex" }, { children: [_jsx(FormItem, __assign({ sx: { height: 64, flex: '1 0', mr: 2 }, required: true, disabled: preview, name: "prepareTime", label: "\u51C6\u5907\u65F6\u957F" }, { children: _jsx(Select, { options: prepareTimeOptions }) })), _jsx(FormItem, __assign({ sx: { height: 64, flex: '1 0' }, required: true, disabled: preview, name: "duration", label: "\u56DE\u7B54\u65F6\u957F" }, { children: _jsx(Select, { options: durationOptions }) })), aiShowType !== ADD_QUESTION_TYPE.SINGLECHIOCE && (_jsx(FormItem, { sx: { height: 64, flex: '1 0', ml: 2 }, name: "minResponseDuration", label: "\u6700\u5C11\u56DE\u7B54\u65F6\u957F", type: "number", disabled: preview,
204
212
  // rules={[
205
213
  // e => {
206
214
  // if (!/^[1-9]\d*$/.test(e.value)) {
@@ -212,7 +220,11 @@ var QuestionForm = forwardRef(function (props, ref) {
212
220
  placeholder: '最少回答时长',
213
221
  sx: { padding: 0, pr: 1 },
214
222
  endAdornment: 's',
215
- }, onChange: handleMinResponseDurationChange })] }))] })), !preview && _jsx(AiAnalysis, {})] }));
223
+ }, onChange: handleMinResponseDurationChange }))] })), aiShowType === ADD_QUESTION_TYPE.SINGLECHIOCE && (_jsx(Box, __assign({ display: "flex", mt: 2, mb: 2.5 }, { children: _jsxs(Box, __assign({ sx: { width: 'calc((100% - 32px) / 3)' } }, { children: [_jsx(Typography, __assign({ variant: "body2", sx: {
224
+ color: 'rgba(0, 0, 0, 0.6)',
225
+ lineHeight: '22px',
226
+ mb: 0.5,
227
+ } }, { children: "\u9898\u76EE\u8BED\u79CD" })), _jsx(Select, { value: analysisState.voiceLanguage || 1, options: VOICE_LANGUAGE_OPTIONS, onChange: function (e) { return updateState({ voiceLanguage: Number(e.target.value) }); } })] })) })))] })), !preview && _jsx(AiAnalysis, {})] }));
216
228
  });
217
229
  QuestionForm.displayName = 'QuestionForm';
218
230
  export default memo(QuestionForm);
@@ -33,7 +33,7 @@ import { useUpdateQuestionStore } from "../../../../store/ai-question/question-u
33
33
  import { AddIcon, Box, Button, Checkbox, InfoIcon, Layout, Message, Popactions, Tooltip } from 'fbm-ui';
34
34
  import { Typography } from 'fbm-ui/lib/mui';
35
35
  import { Stack } from 'fbm-ui/lib/mui';
36
- import { useState } from 'react';
36
+ import { useCallback, useState } from 'react';
37
37
  var RandomQuestion = function (_a) {
38
38
  var _b, _c;
39
39
  var broadcastType = _a.broadcastType, onAddCustonQuestion = _a.onAddCustonQuestion, onAddRandomQuestion = _a.onAddRandomQuestion, category = _a.category, aiShowType = _a.aiShowType;
@@ -76,10 +76,20 @@ var RandomQuestion = function (_a) {
76
76
  item: __assign(__assign({}, item), { enableScoreOptimization: !item.enableScoreOptimization }),
77
77
  });
78
78
  };
79
- return (_jsxs(Layout, { children: [_jsxs(Stack, __assign({ spacing: 2, mb: 1, direction: "row", alignItems: "center", justifyContent: "space-between", mt: 0.375 }, { children: [_jsxs(Stack, __assign({ spacing: 1, direction: "row", alignItems: "center" }, { children: [_jsx(Popactions, __assign({ actions: aiShowType === ADD_QUESTION_TYPE.SINGLECHIOCE ? [actions[1]] : actions, trigger: "click", isClickAway: true, sx: { height: 1 } }, { children: _jsx(Button, __assign({ variant: "outlined", color: "inherit", icon: _jsx(AddIcon, {}) }, { children: "\u968F\u673A\u9762\u8BD5\u5185\u5BB9" })) })), _jsx(Tooltip, __assign({ title: desc, placement: "bottom-start" }, { children: _jsx(Box, __assign({ display: "flex", alignItems: "center", sx: { ml: 1, height: 48 } }, { children: _jsx(InfoIcon, { sx: { color: 'rgba(0, 0, 0, 0.26)', fontSize: 16 } }) })) }))] })), _jsxs(Stack, __assign({ spacing: 1, direction: "row", alignItems: "center", mb: 2 }, { children: [isVideoBroadcast && (_jsxs(Stack, __assign({ spacing: 1, direction: "row" }, { children: [_jsx(Checkbox, { sx: {
79
+ var handleSelfIntrosChange = useCallback(function () {
80
+ updateQuestionState({
81
+ item: __assign(__assign({}, item), { selfIntroOpt: item.selfIntroOpt ? 0 : 1 }),
82
+ });
83
+ }, [item, updateQuestionState]);
84
+ var handleIsCustomQaChange = useCallback(function () {
85
+ updateQuestionState({
86
+ item: __assign(__assign({}, item), { isCustomQa: !item.isCustomQa }),
87
+ });
88
+ }, [item, updateQuestionState]);
89
+ return (_jsxs(Layout, { children: [_jsxs(Stack, __assign({ mb: 1, justifyContent: "space-between", mt: 0.375 }, { children: [_jsxs(Stack, __assign({ spacing: 1, direction: "row", alignItems: "center" }, { children: [_jsx(Popactions, __assign({ actions: aiShowType === ADD_QUESTION_TYPE.SINGLECHIOCE ? [actions[1]] : actions, trigger: "click", isClickAway: true, sx: { height: 1 } }, { children: _jsx(Button, __assign({ variant: "outlined", color: "inherit", icon: _jsx(AddIcon, {}) }, { children: "\u968F\u673A\u9762\u8BD5\u5185\u5BB9" })) })), _jsx(Tooltip, __assign({ title: desc, placement: "bottom-start" }, { children: _jsx(Box, __assign({ display: "flex", alignItems: "center", sx: { ml: 1, height: 48 } }, { children: _jsx(InfoIcon, { sx: { color: 'rgba(0, 0, 0, 0.26)', fontSize: 16 } }) })) }))] })), _jsxs(Stack, __assign({ spacing: 1, direction: "row", alignItems: "center", mb: 2 }, { children: [isVideoBroadcast && (_jsxs(Stack, __assign({ spacing: 1, direction: "row" }, { children: [_jsx(Checkbox, { sx: {
80
90
  mr: 0,
81
91
  }, checked: ((_b = item === null || item === void 0 ? void 0 : item.videoBroadcast) === null || _b === void 0 ? void 0 : _b.videoRetry) === 1, label: _jsx(Typography, __assign({ variant: "body2" }, { children: "\u5141\u8BB8\u91CD\u590D\u542C\u9898" })), onChange: function (e, checked) { return handleVideoBroadcastChange('videoRetry', checked); } }), _jsx(Checkbox, { sx: {
82
92
  mr: 0,
83
- }, checked: ((_c = item === null || item === void 0 ? void 0 : item.videoBroadcast) === null || _c === void 0 ? void 0 : _c.videoSkip) === 1, label: _jsx(Typography, __assign({ variant: "body2" }, { children: "\u5141\u8BB8\u8DF3\u8FC7" })), onChange: function (e, checked) { return handleVideoBroadcastChange('videoSkip', checked); } })] }))), item.type === 1 && item.aiShowType === 1 && (_jsx(Checkbox, { checked: item === null || item === void 0 ? void 0 : item.enableScoreOptimization, label: _jsxs(Typography, __assign({ variant: "body2", display: "flex" }, { children: ["\u56DE\u7B54\u8FC7\u77ED\u6263\u5206", _jsx(Tooltip, __assign({ title: "\u82E5\u5B57\u6570\u5C0F\u4E8E\u7B49\u4E8E80\u65F6\uFF0C\u5BF9AI\u5206\u6570\u8FDB\u884C\u4E00\u5B9A\u7684\u51CF\u5C11\uFF0C\u6700\u5C11\n\u51CF10\u5206\uFF0C\u6700\u9AD8\u51CF40\u5206\uFF0C\u6309\u7167\u5B57\u6570\u9010\u51CF\u3002" }, { children: _jsx("span", __assign({ style: { display: 'flex', alignItems: 'center', marginLeft: '8px' } }, { children: _jsx(InfoIcon, { sx: { fontSize: 14, color: 'rgba(0, 0, 0, 0.26)' } }) })) }))] })), onChange: handleEnableScoreOptimizationStatus }))] }))] })), open && _jsx(SelectQuestion, { token: category === null || category === void 0 ? void 0 : category.token, open: open, onClose: function () { return setOpen(false); }, onOk: onAddRandomQuestion })] }));
93
+ }, checked: ((_c = item === null || item === void 0 ? void 0 : item.videoBroadcast) === null || _c === void 0 ? void 0 : _c.videoSkip) === 1, label: _jsx(Typography, __assign({ variant: "body2" }, { children: "\u5141\u8BB8\u8DF3\u8FC7" })), onChange: function (e, checked) { return handleVideoBroadcastChange('videoSkip', checked); } })] }))), questionState.aiShowType === 1 && (_jsxs(_Fragment, { children: [questionState.index < 2 && (_jsx(Checkbox, { checked: !!item.selfIntroOpt, label: _jsxs(Typography, __assign({ variant: "body2", display: "flex" }, { children: ["\u81EA\u6211\u4ECB\u7ECD", _jsx(Tooltip, __assign({ title: "\u52FE\u9009\u4E3A\u81EA\u6211\u4ECB\u7ECD\u9898\u540E,\u5C06\u5BF9\u5019\u9009\u4EBA\u56DE\u7B54\u4E2D\u7684\u59D3\u540D\u8FDB\u884C\u4FEE\u6B63\u3002" }, { children: _jsx("span", __assign({ style: { display: 'flex', alignItems: 'center', marginLeft: '8px' } }, { children: _jsx(InfoIcon, { sx: { fontSize: 14, color: 'rgba(0, 0, 0, 0.26)' } }) })) }))] })), onChange: handleSelfIntrosChange })), _jsx(Checkbox, { checked: !!item.isCustomQa, label: _jsxs(Typography, __assign({ variant: "body2", display: "flex" }, { children: ["\u5F00\u542F\u81EA\u5B9A\u4E49\u968F\u673A\u9898", _jsx(Tooltip, __assign({ title: "\u52FE\u9009\u4E4B\u540E\uFF0C\u8BE5\u9898\u7684\u9762\u8BD5\u95EE\u9898\u5C06\u4ECE\u81EA\u5B9A\u4E49\u9898\u5E93\u4E2D\u83B7\u53D6\uFF0C\u81EA\u5B9A\u4E49\u9898\u5E93\u9700\u9884\u5148\u914D\u7F6E\u3002" }, { children: _jsx("span", __assign({ style: { display: 'flex', alignItems: 'center', marginLeft: '8px' } }, { children: _jsx(InfoIcon, { sx: { fontSize: 14, color: 'rgba(0, 0, 0, 0.26)' } }) })) }))] })), onChange: handleIsCustomQaChange })] }))] }))] })), open && _jsx(SelectQuestion, { token: category === null || category === void 0 ? void 0 : category.token, open: open, onClose: function () { return setOpen(false); }, onOk: onAddRandomQuestion })] }));
84
94
  };
85
95
  export default RandomQuestion;
@@ -52,7 +52,7 @@ var VideoVoice = function () {
52
52
  var questons = __spreadArray([], __read(form.values.questions), false);
53
53
  questons[index] = __assign(__assign({}, questons[index]), { videoUrl: '' });
54
54
  form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], __read(questons), false) }));
55
- }, videoUrl: q.videoUrl })), _jsx(VideoVoiceUploader, { index: index, questions: form.values.questions, setQuestions: function (qs) {
55
+ }, videoUrl: q.videoUrl })), _jsx(VideoVoiceUploader, { lable: "\u79FB\u52A8\u7AEF", index: index, questions: form.values.questions, setQuestions: function (qs) {
56
56
  form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], __read(qs), false) }));
57
57
  } })] })), _jsxs(Box, __assign({ textAlign: "center", overflow: "hidden", height: 57, sx: {
58
58
  borderRadius: 2,
@@ -61,7 +61,7 @@ var VideoVoice = function () {
61
61
  var questons = __spreadArray([], __read(form.values.questions), false);
62
62
  questons[index] = __assign(__assign({}, questons[index]), { videoURLWide: '' });
63
63
  form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], __read(questons), false) }));
64
- }, videoUrl: q.videoURLWide })), _jsx(VideoVoiceUploader, { index: index, type: "pc", questions: form.values.questions, setQuestions: function (qs) {
64
+ }, videoUrl: q.videoURLWide })), _jsx(VideoVoiceUploader, { lable: "\u7535\u8111\u7AEF", index: index, type: "pc", questions: form.values.questions, setQuestions: function (qs) {
65
65
  form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], __read(qs), false) }));
66
66
  } })] }))] })), _jsxs(Stack, __assign({ flexGrow: 1, justifyContent: "space-between", spacing: 3 }, { children: [_jsxs(Stack, __assign({ flexGrow: 1, direction: "row", justifyContent: "space-between", spacing: 1 }, { children: [_jsx(FormItem, { required: true, name: "questions.".concat(index, ".content"), label: "\u9762\u8BD5\u5185\u5BB9", max: 300, placeholder: "\u9762\u8BD5\u5185\u5BB9\uFF08\u7CFB\u7EDF\u5C06\u6839\u636E\u6B64\u5185\u5BB9\u5411\u5019\u9009\u4EBA\u8FDB\u884C\u8BED\u97F3\u64AD\u62A5\uFF09", InputProps: {
67
67
  rows: 3,
@@ -1,8 +1,9 @@
1
1
  /// <reference types="react" />
2
- declare const VideoVoiceUploader: ({ index, questions, setQuestions, type }: {
2
+ declare const VideoVoiceUploader: ({ index, questions, setQuestions, type, lable }: {
3
3
  index: any;
4
4
  questions: any;
5
5
  setQuestions: any;
6
6
  type?: string | undefined;
7
+ lable?: string | undefined;
7
8
  }) => JSX.Element;
8
9
  export default VideoVoiceUploader;
@@ -41,8 +41,8 @@ import { useRequest } from 'ahooks';
41
41
  import { Message, Typography, Upload, UploadIcon } from 'fbm-ui';
42
42
  import { CircularProgress, Stack } from 'fbm-ui/lib/mui';
43
43
  var VideoVoiceUploader = function (_a) {
44
- var index = _a.index, questions = _a.questions, setQuestions = _a.setQuestions, _b = _a.type, type = _b === void 0 ? 'mobile' : _b;
45
- var _c = useRequest(PostCommonUpload, {
44
+ var index = _a.index, questions = _a.questions, setQuestions = _a.setQuestions, _b = _a.type, type = _b === void 0 ? 'mobile' : _b, _c = _a.lable, lable = _c === void 0 ? '上传视频' : _c;
45
+ var _d = useRequest(PostCommonUpload, {
46
46
  manual: true,
47
47
  onSuccess: function (_a) {
48
48
  var data = _a.data;
@@ -50,7 +50,7 @@ var VideoVoiceUploader = function (_a) {
50
50
  questions[index] = __assign(__assign({}, questions[index]), (type === 'mobile' ? { videoUrl: firstData.url } : { videoURLWide: firstData.url }));
51
51
  setQuestions(__spreadArray([], __read(questions), false));
52
52
  },
53
- }), loading = _c.loading, postCommonUpload = _c.run;
53
+ }), loading = _d.loading, postCommonUpload = _d.run;
54
54
  var uploadProps = {
55
55
  type: 'custom',
56
56
  showUploadList: false,
@@ -76,6 +76,6 @@ var VideoVoiceUploader = function (_a) {
76
76
  cursor: 'pointer',
77
77
  width: '100%',
78
78
  height: '100%',
79
- } }, { children: [!loading && (_jsxs(Stack, __assign({ justifyContent: "center", alignItems: "center" }, { children: [_jsx(UploadIcon, { color: "inherit" }), _jsx(Typography, __assign({ variant: "caption", color: "inherit" }, { children: "\u4E0A\u4F20\u89C6\u9891" }))] }))), loading && (_jsxs(Stack, __assign({ justifyContent: "center", alignItems: "center" }, { children: [_jsx(CircularProgress, { size: 24, color: "inherit" }), _jsx(Typography, __assign({ variant: "caption" }, { children: "\u4E0A\u4F20\u4E2D..." }))] })))] })) })));
79
+ } }, { children: [!loading && (_jsxs(Stack, __assign({ justifyContent: "center", alignItems: "center" }, { children: [_jsx(UploadIcon, { color: "inherit" }), _jsx(Typography, __assign({ variant: "caption", color: "inherit" }, { children: lable }))] }))), loading && (_jsxs(Stack, __assign({ justifyContent: "center", alignItems: "center" }, { children: [_jsx(CircularProgress, { size: 24, color: "inherit" }), _jsx(Typography, __assign({ variant: "caption" }, { children: "\u4E0A\u4F20\u4E2D..." }))] })))] })) })));
80
80
  };
81
81
  export default VideoVoiceUploader;
@@ -7,7 +7,7 @@ export var defaultQuestionParams = {
7
7
  answerStatus: 2,
8
8
  broadcastType: 1,
9
9
  desc: '',
10
- questions: [{ content: '', videoUrl: '' }],
10
+ questions: [{ content: '', videoUrl: '', videoURLWide: '', audioUrl: '' }],
11
11
  duration: 30,
12
12
  category: undefined,
13
13
  extra: {
@@ -30,6 +30,8 @@ export var defaultQuestionParams = {
30
30
  isOpenAIFollowUp: false,
31
31
  followUpMaximum: 3,
32
32
  enableScoreOptimization: false,
33
+ selfIntroOpt: 0,
34
+ isCustomQa: false,
33
35
  };
34
36
  // 播报方式
35
37
  export var broadcastModeOptions = [
@@ -133,7 +133,9 @@ var QuestionUpdate = function () {
133
133
  // 职场能力中不参与AI分析的提交时,过滤掉
134
134
  var newAiAbilities = aiAbilities
135
135
  .map(function (i) {
136
+ var _a;
136
137
  i.isNotCompute = true;
138
+ i.child = (_a = i.child) === null || _a === void 0 ? void 0 : _a.map(function (v) { return (__assign(__assign({}, v), { weight: Number(v.weight) || 0 })); });
137
139
  if (i.type === 6) {
138
140
  var extra_1 = {};
139
141
  var extraJson = JSON.parse(i.extra);
@@ -266,7 +268,6 @@ var QuestionUpdate = function () {
266
268
  else {
267
269
  curAiAbilities.unshift(CurWorkPlaceAiAbility);
268
270
  }
269
- console.log('curAiAbilities', curAiAbilities, inInit);
270
271
  updateAiAbilities(curAiAbilities, inInit);
271
272
  }, [questionCollectionList, aiAbilities, updateAiAbilities]);
272
273
  var handleCategoryChange = useCallback(function (value) {
@@ -286,7 +287,7 @@ var QuestionUpdate = function () {
286
287
  [aiAbilities, handleWorkplaceData]);
287
288
  useEffect(function () {
288
289
  if (open) {
289
- updateState({ language: item.language, aiSwitch: item.aiSwitch });
290
+ updateState({ language: item.language, aiSwitch: item.aiSwitch, voiceLanguage: item === null || item === void 0 ? void 0 : item.voiceLanguage });
290
291
  updateAiAbilities(item.aiAbilities, true);
291
292
  }
292
293
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -12,7 +12,9 @@ export interface Option {
12
12
  }
13
13
  export interface Question {
14
14
  content: string;
15
- videoUrl: string;
15
+ videoUrl?: string;
16
+ videoURLWide?: string;
17
+ audioUrl?: string;
16
18
  options?: Option[];
17
19
  followUpGoals?: string[];
18
20
  scorePoints?: string[];
@@ -37,10 +39,13 @@ export interface QuestionParams {
37
39
  aiType: number;
38
40
  weight: number | string;
39
41
  language?: number;
42
+ voiceLanguage?: number;
40
43
  aiShowType: number;
41
44
  videoBroadcast: VideoBroadcastParams;
42
45
  answerStatus: number;
43
46
  aiAbilities: BaseAiAbilityParams[];
47
+ selfIntroOpt: number;
48
+ isCustomQa: boolean;
44
49
  }
45
50
  export interface SubmitModelParams {
46
51
  name: string;
@@ -25,7 +25,7 @@ import { Box, Button, confirm, Message, Paper, Typography } from 'fbm-ui';
25
25
  import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
26
26
  var NO_ANSWER = INTERVIEW_STATUS.NO_ANSWER, FAILED = INTERVIEW_STATUS.FAILED, IN_CALCULATION = INTERVIEW_STATUS.IN_CALCULATION;
27
27
  var AiReportRoot = forwardRef(function (props, ref) {
28
- var token = props.token, customScore = props.customScore, reminderSent = props.reminderSent, operableButtons = props.operableButtons, onLoad = props.onLoad, onSendReminderClick = props.onSendReminderClick;
28
+ var token = props.token, customScore = props.customScore, reminderSent = props.reminderSent, operableButtons = props.operableButtons, onLoad = props.onLoad, onSendReminderClick = props.onSendReminderClick, reloadReportVersion = props.reloadReportVersion;
29
29
  var firstLoad = useRef(true);
30
30
  var _a = useAiReportStore(), updateState = _a.updateState, updateReportResult = _a.updateReportResult, reportResult = _a.reportResult;
31
31
  var _b = reportResult || {}, _c = _b.collection, collection = _c === void 0 ? [] : _c, _d = _b.workplaces, workplaces = _d === void 0 ? [] : _d, _e = _b.model, model = _e === void 0 ? 'standard' : _e, _f = _b.hasProVersion, hasProVersion = _f === void 0 ? false : _f, _g = _b.isSimulated, isSimulated = _g === void 0 ? false : _g;
@@ -50,8 +50,11 @@ var AiReportRoot = forwardRef(function (props, ref) {
50
50
  }), data = _h.data, loading = _h.loading, postAiInterviewResult = _h.run;
51
51
  var status = (data === null || data === void 0 ? void 0 : data.data.list[0].status) || NO_ANSWER;
52
52
  var handleRefreshSuccess = useCallback(function () {
53
- postAiInterviewResult();
54
- }, [postAiInterviewResult]);
53
+ reloadReportVersion === null || reloadReportVersion === void 0 ? void 0 : reloadReportVersion();
54
+ if (!reloadReportVersion) {
55
+ postAiInterviewResult();
56
+ }
57
+ }, [postAiInterviewResult, reloadReportVersion]);
55
58
  var handleSwitchReportModel = useCallback(function () {
56
59
  var SwithAction = function () {
57
60
  SwitchReportModel({
@@ -0,0 +1,27 @@
1
+ import { FC } from 'react';
2
+ export interface VideoProps {
3
+ /** 视频源URL */
4
+ src: string;
5
+ /** 封面图片URL */
6
+ poster?: string;
7
+ /** 视频宽度 */
8
+ width?: number | string;
9
+ /** 视频高度 */
10
+ height?: number | string;
11
+ /** 是否自动播放 */
12
+ autoPlay?: boolean;
13
+ /** 是否静音 */
14
+ muted?: boolean;
15
+ /** 是否循环播放 */
16
+ loop?: boolean;
17
+ /** 容器点击回调 */
18
+ onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
19
+ /** 播放开始回调 */
20
+ onPlay?: (event: React.SyntheticEvent<HTMLVideoElement>) => void;
21
+ /** 暂停回调 */
22
+ onPause?: (event: React.SyntheticEvent<HTMLVideoElement>) => void;
23
+ /** 播放结束回调 */
24
+ onEnded?: (event: React.SyntheticEvent<HTMLVideoElement>) => void;
25
+ }
26
+ declare const Video: FC<VideoProps>;
27
+ export default Video;
@@ -0,0 +1,208 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (_) try {
28
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
48
+ var __read = (this && this.__read) || function (o, n) {
49
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
50
+ if (!m) return o;
51
+ var i = m.call(o), r, ar = [], e;
52
+ try {
53
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
54
+ }
55
+ catch (error) { e = { error: error }; }
56
+ finally {
57
+ try {
58
+ if (r && !r.done && (m = i["return"])) m.call(i);
59
+ }
60
+ finally { if (e) throw e.error; }
61
+ }
62
+ return ar;
63
+ };
64
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
65
+ import PauseIcon from '@mui/icons-material/Pause';
66
+ import PlayArrowIcon from '@mui/icons-material/PlayArrow';
67
+ import { Box, IconButton } from 'fbm-ui';
68
+ import { styled } from 'fbm-ui';
69
+ import { useCallback, useRef, useState } from 'react';
70
+ var VideoContainer = styled(Box)(function (_a) {
71
+ var theme = _a.theme;
72
+ return ({
73
+ position: 'relative',
74
+ display: 'inline-block',
75
+ backgroundColor: '#000',
76
+ borderRadius: theme.spacing(1),
77
+ overflow: 'hidden',
78
+ cursor: 'pointer',
79
+ '&:hover .play-button': {
80
+ opacity: '0.9 !important',
81
+ transform: 'translate(-50%, -50%) scale(1.1)',
82
+ },
83
+ });
84
+ });
85
+ var StyledVideo = styled('video')({
86
+ width: '100%',
87
+ height: '100%',
88
+ display: 'block',
89
+ });
90
+ var PlayButton = styled(IconButton)(function (_a) {
91
+ var theme = _a.theme;
92
+ return ({
93
+ position: 'absolute',
94
+ top: '50%',
95
+ left: '50%',
96
+ transform: 'translate(-50%, -50%)',
97
+ backgroundColor: 'rgba(0, 0, 0, 0.7)',
98
+ color: '#fff',
99
+ width: 48,
100
+ height: 48,
101
+ transition: 'all 0.3s ease',
102
+ zIndex: 2,
103
+ '&:hover': {
104
+ backgroundColor: 'rgba(0, 0, 0, 0.8)',
105
+ },
106
+ '& .MuiSvgIcon-root': {
107
+ fontSize: 32,
108
+ },
109
+ });
110
+ });
111
+ var PosterImage = styled('img')({
112
+ position: 'absolute',
113
+ top: 0,
114
+ left: 0,
115
+ width: '100%',
116
+ height: '100%',
117
+ objectFit: 'cover',
118
+ zIndex: 1,
119
+ });
120
+ var Video = function (_a) {
121
+ var src = _a.src, poster = _a.poster, _b = _a.width, width = _b === void 0 ? '100%' : _b, _c = _a.height, height = _c === void 0 ? 240 : _c, _d = _a.autoPlay, autoPlay = _d === void 0 ? true : _d, _e = _a.muted, muted = _e === void 0 ? false : _e, _f = _a.loop, loop = _f === void 0 ? false : _f, onClick = _a.onClick, onPlay = _a.onPlay, onPause = _a.onPause, onEnded = _a.onEnded;
122
+ var videoRef = useRef(null);
123
+ var _g = __read(useState(false), 2), isPlaying = _g[0], setIsPlaying = _g[1];
124
+ var _h = __read(useState(true), 2), showPoster = _h[0], setShowPoster = _h[1];
125
+ var _j = __read(useState(false), 2), isLoading = _j[0], setIsLoading = _j[1];
126
+ var _k = __read(useState(false), 2), videoLoaded = _k[0], setVideoLoaded = _k[1]; // 控制视频是否已加载
127
+ var handlePlayClick = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
128
+ var error_1;
129
+ return __generator(this, function (_a) {
130
+ switch (_a.label) {
131
+ case 0:
132
+ setVideoLoaded(true); // 视频开始加载时设置为已加载
133
+ if (!videoRef.current)
134
+ return [2 /*return*/];
135
+ _a.label = 1;
136
+ case 1:
137
+ _a.trys.push([1, 5, , 6]);
138
+ if (!isPlaying) return [3 /*break*/, 2];
139
+ videoRef.current.pause();
140
+ return [3 /*break*/, 4];
141
+ case 2:
142
+ setIsLoading(true);
143
+ return [4 /*yield*/, videoRef.current.play()];
144
+ case 3:
145
+ _a.sent();
146
+ setShowPoster(false);
147
+ _a.label = 4;
148
+ case 4: return [3 /*break*/, 6];
149
+ case 5:
150
+ error_1 = _a.sent();
151
+ console.error('视频播放失败:', error_1);
152
+ setIsLoading(false);
153
+ return [3 /*break*/, 6];
154
+ case 6: return [2 /*return*/];
155
+ }
156
+ });
157
+ }); }, [isPlaying]);
158
+ var handlePlay = useCallback(function (event) {
159
+ setIsPlaying(true);
160
+ setIsLoading(false);
161
+ setShowPoster(false);
162
+ onPlay === null || onPlay === void 0 ? void 0 : onPlay(event);
163
+ }, [onPlay]);
164
+ var handlePause = useCallback(function (event) {
165
+ setIsPlaying(false);
166
+ onPause === null || onPause === void 0 ? void 0 : onPause(event);
167
+ }, [onPause]);
168
+ var handleEnded = useCallback(function (event) {
169
+ setIsPlaying(false);
170
+ setShowPoster(true);
171
+ onEnded === null || onEnded === void 0 ? void 0 : onEnded(event);
172
+ }, [onEnded]);
173
+ var handleContainerClick = useCallback(function (e) {
174
+ // 避免点击播放按钮时触发容器点击事件
175
+ if (e.target.closest('.play-button')) {
176
+ return;
177
+ }
178
+ e.stopPropagation();
179
+ // 如果传入了外部onClick回调,优先执行
180
+ if (onClick) {
181
+ onClick(e);
182
+ return;
183
+ }
184
+ // 默认行为:切换播放/暂停状态
185
+ handlePlayClick();
186
+ }, [onClick, handlePlayClick]);
187
+ return (_jsxs(VideoContainer, __assign({ sx: { width: width, height: height }, onClick: handleContainerClick }, { children: [videoLoaded && (_jsx(StyledVideo, { ref: videoRef, src: src, poster: poster, autoPlay: autoPlay, muted: muted, loop: loop, controls: true, onPlay: handlePlay, onPause: handlePause, onEnded: handleEnded, style: {
188
+ visibility: showPoster ? 'hidden' : 'visible',
189
+ } })), showPoster && poster && _jsx(PosterImage, { src: poster, alt: "\u89C6\u9891\u5C01\u9762" }), _jsx(PlayButton, __assign({ className: "play-button", onClick: handlePlayClick, disabled: isLoading, sx: {
190
+ opacity: showPoster || !isPlaying ? 1 : 0,
191
+ '&:hover': {
192
+ opacity: 0.9,
193
+ },
194
+ transition: 'opacity 0.3s ease',
195
+ } }, { children: isLoading ? (_jsx(Box, { sx: {
196
+ width: 24,
197
+ height: 24,
198
+ border: '2px solid rgba(255, 255, 255, 0.3)',
199
+ borderTop: '2px solid #fff',
200
+ borderRadius: '50%',
201
+ animation: 'spin 1s linear infinite',
202
+ '@keyframes spin': {
203
+ '0%': { transform: 'rotate(0deg)' },
204
+ '100%': { transform: 'rotate(360deg)' },
205
+ },
206
+ } })) : isPlaying ? (_jsx(PauseIcon, {})) : (_jsx(PlayArrowIcon, {})) }))] })));
207
+ };
208
+ export default Video;
@@ -152,6 +152,7 @@ export interface AiInterviewReportList {
152
152
  completedStatus: number;
153
153
  createTime: number;
154
154
  startTime: number;
155
+ screenSwitchCount: number;
155
156
  completeTime: number;
156
157
  hasProVersion: boolean;
157
158
  isSimulated: boolean;
@@ -199,6 +200,7 @@ export interface AiReportProps {
199
200
  rank: number;
200
201
  };
201
202
  customInterviewDimRankMap?: CustomInterviewDimRankMap;
203
+ reloadReportVersion?: () => void;
202
204
  onLoad?: (values: AiReportLoadedValues) => void;
203
205
  onExportReportClick?: () => void;
204
206
  onScoreChange?: (scoreState?: ScoreManualUpdateState) => void;
@@ -1,6 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import { AiReportProps, AiReportRef } from './interface';
3
3
  export declare const useAiReport: (props: AiReportProps) => {
4
+ version: number;
5
+ reloadReportVersion: () => void;
4
6
  handleRefresh?: (() => void) | undefined;
5
7
  token: string;
6
8
  customScore?: number | undefined;
@@ -9,8 +9,10 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ import useAiReportVersion from '../ai-report-v2/useAiReportVersion';
12
13
  import { useRef } from 'react';
13
14
  export var useAiReport = function (props) {
14
15
  var ref = useRef();
15
- return __assign(__assign({ ref: ref }, props), ref === null || ref === void 0 ? void 0 : ref.current);
16
+ var reportVersion = useAiReportVersion(props.token);
17
+ return __assign(__assign(__assign({ ref: ref }, props), ref === null || ref === void 0 ? void 0 : ref.current), reportVersion);
16
18
  };
@@ -1,4 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { AiReportProps } from './interface';
2
- import React from 'react';
3
- declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<AiReportProps & React.RefAttributes<any>>>;
3
+ declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<AiReportProps & import("react").RefAttributes<any>>>;
4
4
  export default _default;