eli-video-interview 1.5.0 → 1.6.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 (243) hide show
  1. package/esm/components/Charts/ReportPie.js +2 -2
  2. package/esm/index.d.ts +2 -0
  3. package/esm/index.js +2 -0
  4. package/esm/modules/ai-report/components/AIEvaluate/index.js +1 -1
  5. package/esm/modules/ai-report/interface.d.ts +28 -0
  6. package/esm/modules/ai-report-v3/Root.d.ts +4 -0
  7. package/esm/modules/ai-report-v3/Root.js +110 -0
  8. package/esm/modules/ai-report-v3/components/AIEvaluate/Evaluate.d.ts +11 -0
  9. package/esm/modules/ai-report-v3/components/AIEvaluate/Evaluate.js +79 -0
  10. package/esm/modules/ai-report-v3/components/AIEvaluate/Graph.d.ts +22 -0
  11. package/esm/modules/ai-report-v3/components/AIEvaluate/Graph.js +272 -0
  12. package/esm/modules/ai-report-v3/components/AIEvaluate/index.d.ts +3 -0
  13. package/esm/modules/ai-report-v3/components/AIEvaluate/index.js +32 -0
  14. package/esm/modules/ai-report-v3/components/Candidate/Candidate.d.ts +7 -0
  15. package/esm/modules/ai-report-v3/components/Candidate/Candidate.js +55 -0
  16. package/esm/modules/ai-report-v3/components/Candidate/Interface.d.ts +16 -0
  17. package/esm/modules/ai-report-v3/components/Candidate/Interface.js +1 -0
  18. package/esm/modules/ai-report-v3/components/Candidate/Podium.d.ts +6 -0
  19. package/esm/modules/ai-report-v3/components/Candidate/Podium.js +50 -0
  20. package/esm/modules/ai-report-v3/components/Candidate/index.d.ts +2 -0
  21. package/esm/modules/ai-report-v3/components/Candidate/index.js +2 -0
  22. package/esm/modules/ai-report-v3/components/CapabilityTable/CapabilityTable.d.ts +3 -0
  23. package/esm/modules/ai-report-v3/components/CapabilityTable/CapabilityTable.js +62 -0
  24. package/esm/modules/ai-report-v3/components/CheatRisk/CheatRisk.d.ts +3 -0
  25. package/esm/modules/ai-report-v3/components/CheatRisk/CheatRisk.js +42 -0
  26. package/esm/modules/ai-report-v3/components/Form/Form.d.ts +23 -0
  27. package/esm/modules/ai-report-v3/components/Form/Form.js +67 -0
  28. package/esm/modules/ai-report-v3/components/Form/Forms.d.ts +9 -0
  29. package/esm/modules/ai-report-v3/components/Form/Forms.js +45 -0
  30. package/esm/modules/ai-report-v3/components/Form/Nps.d.ts +6 -0
  31. package/esm/modules/ai-report-v3/components/Form/Nps.js +57 -0
  32. package/esm/modules/ai-report-v3/components/Form/index.d.ts +1 -0
  33. package/esm/modules/ai-report-v3/components/Form/index.js +1 -0
  34. package/esm/modules/ai-report-v3/components/Form/interface.d.ts +57 -0
  35. package/esm/modules/ai-report-v3/components/Form/interface.js +1 -0
  36. package/esm/modules/ai-report-v3/components/MenuAnchor/index.d.ts +4 -0
  37. package/esm/modules/ai-report-v3/components/MenuAnchor/index.js +130 -0
  38. package/esm/modules/ai-report-v3/components/ModuleTitle.d.ts +5 -0
  39. package/esm/modules/ai-report-v3/components/ModuleTitle.js +24 -0
  40. package/esm/modules/ai-report-v3/components/NotFinish/index.d.ts +3 -0
  41. package/esm/modules/ai-report-v3/components/NotFinish/index.js +32 -0
  42. package/esm/modules/ai-report-v3/components/RankingRange/Item.d.ts +4 -0
  43. package/esm/modules/ai-report-v3/components/RankingRange/Item.js +46 -0
  44. package/esm/modules/ai-report-v3/components/RankingRange/index.d.ts +4 -0
  45. package/esm/modules/ai-report-v3/components/RankingRange/index.js +187 -0
  46. package/esm/modules/ai-report-v3/components/RankingRange/interface.d.ts +26 -0
  47. package/esm/modules/ai-report-v3/components/RankingRange/interface.js +1 -0
  48. package/esm/modules/ai-report-v3/components/RankingRange/styled.d.ts +7 -0
  49. package/esm/modules/ai-report-v3/components/RankingRange/styled.js +11 -0
  50. package/esm/modules/ai-report-v3/components/ReportHeader/ReportHeader.d.ts +17 -0
  51. package/esm/modules/ai-report-v3/components/ReportHeader/ReportHeader.js +105 -0
  52. package/esm/modules/ai-report-v3/components/ScoreReport/Bar.d.ts +6 -0
  53. package/esm/modules/ai-report-v3/components/ScoreReport/Bar.js +68 -0
  54. package/esm/modules/ai-report-v3/components/ScoreReport/Failed.d.ts +4 -0
  55. package/esm/modules/ai-report-v3/components/ScoreReport/Failed.js +33 -0
  56. package/esm/modules/ai-report-v3/components/ScoreReport/RecommendIcon.d.ts +3 -0
  57. package/esm/modules/ai-report-v3/components/ScoreReport/RecommendIcon.js +17 -0
  58. package/esm/modules/ai-report-v3/components/ScoreReport/Report.d.ts +3 -0
  59. package/esm/modules/ai-report-v3/components/ScoreReport/Report.js +22 -0
  60. package/esm/modules/ai-report-v3/components/ScoreReport/Score.d.ts +4 -0
  61. package/esm/modules/ai-report-v3/components/ScoreReport/Score.js +83 -0
  62. package/esm/modules/ai-report-v3/components/ScoreReport/ScoreLegend.d.ts +4 -0
  63. package/esm/modules/ai-report-v3/components/ScoreReport/ScoreLegend.js +33 -0
  64. package/esm/modules/ai-report-v3/components/ScoreReport/Tips.d.ts +3 -0
  65. package/esm/modules/ai-report-v3/components/ScoreReport/Tips.js +18 -0
  66. package/esm/modules/ai-report-v3/components/ScoreReport/index.d.ts +4 -0
  67. package/esm/modules/ai-report-v3/components/ScoreReport/index.js +39 -0
  68. package/esm/modules/ai-report-v3/components/ScoreReport/interface.d.ts +20 -0
  69. package/esm/modules/ai-report-v3/components/ScoreReport/interface.js +1 -0
  70. package/esm/modules/ai-report-v3/components/ScoreReport/styled.d.ts +22 -0
  71. package/esm/modules/ai-report-v3/components/ScoreReport/styled.js +21 -0
  72. package/esm/modules/ai-report-v3/components/SectionTabs/SectionTabs.d.ts +11 -0
  73. package/esm/modules/ai-report-v3/components/SectionTabs/SectionTabs.js +114 -0
  74. package/esm/modules/ai-report-v3/components/Suggestion/Suggestion.d.ts +4 -0
  75. package/esm/modules/ai-report-v3/components/Suggestion/Suggestion.js +31 -0
  76. package/esm/modules/ai-report-v3/components/Suggestion/index.d.ts +3 -0
  77. package/esm/modules/ai-report-v3/components/Suggestion/index.js +27 -0
  78. package/esm/modules/ai-report-v3/components/V3Header/V3Header.d.ts +11 -0
  79. package/esm/modules/ai-report-v3/components/V3Header/V3Header.js +154 -0
  80. package/esm/modules/ai-report-v3/components/VideoQuestion/Abilities.d.ts +4 -0
  81. package/esm/modules/ai-report-v3/components/VideoQuestion/Abilities.js +42 -0
  82. package/esm/modules/ai-report-v3/components/VideoQuestion/BodyImages.d.ts +7 -0
  83. package/esm/modules/ai-report-v3/components/VideoQuestion/BodyImages.js +56 -0
  84. package/esm/modules/ai-report-v3/components/VideoQuestion/Evaluate.d.ts +11 -0
  85. package/esm/modules/ai-report-v3/components/VideoQuestion/Evaluate.js +79 -0
  86. package/esm/modules/ai-report-v3/components/VideoQuestion/QuestionItem.d.ts +4 -0
  87. package/esm/modules/ai-report-v3/components/VideoQuestion/QuestionItem.js +145 -0
  88. package/esm/modules/ai-report-v3/components/VideoQuestion/ScoreSlider.d.ts +4 -0
  89. package/esm/modules/ai-report-v3/components/VideoQuestion/ScoreSlider.js +47 -0
  90. package/esm/modules/ai-report-v3/components/VideoQuestion/SingleChoice.d.ts +8 -0
  91. package/esm/modules/ai-report-v3/components/VideoQuestion/SingleChoice.js +31 -0
  92. package/esm/modules/ai-report-v3/components/VideoQuestion/Workplaces.d.ts +10 -0
  93. package/esm/modules/ai-report-v3/components/VideoQuestion/Workplaces.js +91 -0
  94. package/esm/modules/ai-report-v3/components/VideoQuestion/index.d.ts +6 -0
  95. package/esm/modules/ai-report-v3/components/VideoQuestion/index.js +24 -0
  96. package/esm/modules/ai-report-v3/components/VideoQuestion/interface.d.ts +17 -0
  97. package/esm/modules/ai-report-v3/components/VideoQuestion/interface.js +1 -0
  98. package/esm/modules/ai-report-v3/components/VideoQuestion/styled.d.ts +72 -0
  99. package/esm/modules/ai-report-v3/components/VideoQuestion/styled.js +93 -0
  100. package/esm/modules/ai-report-v3/components/WorkPlaces/ScoreSlider.d.ts +4 -0
  101. package/esm/modules/ai-report-v3/components/WorkPlaces/ScoreSlider.js +24 -0
  102. package/esm/modules/ai-report-v3/components/WorkPlaces/WorkPlace.d.ts +12 -0
  103. package/esm/modules/ai-report-v3/components/WorkPlaces/WorkPlace.js +72 -0
  104. package/esm/modules/ai-report-v3/components/WorkPlaces/index.d.ts +3 -0
  105. package/esm/modules/ai-report-v3/components/WorkPlaces/index.js +70 -0
  106. package/esm/modules/ai-report-v3/components/WorkPlaces/interface.d.ts +7 -0
  107. package/esm/modules/ai-report-v3/components/WorkPlaces/interface.js +1 -0
  108. package/esm/modules/ai-report-v3/components/WorkPlaces/styled.d.ts +62 -0
  109. package/esm/modules/ai-report-v3/components/WorkPlaces/styled.js +27 -0
  110. package/esm/modules/ai-report-v3/components/styled.d.ts +42 -0
  111. package/esm/modules/ai-report-v3/components/styled.js +140 -0
  112. package/esm/modules/ai-report-v3/index.d.ts +4 -0
  113. package/esm/modules/ai-report-v3/index.js +20 -0
  114. package/esm/modules/ai-report-v3/interface.d.ts +257 -0
  115. package/esm/modules/ai-report-v3/interface.js +1 -0
  116. package/esm/modules/ai-report-v3/useAiReport.d.ts +37 -0
  117. package/esm/modules/ai-report-v3/useAiReport.js +18 -0
  118. package/esm/modules/ai-report-v3/useAiReportVersion.d.ts +5 -0
  119. package/esm/modules/ai-report-v3/useAiReportVersion.js +45 -0
  120. package/esm/modules/ai-report-v3/utils.d.ts +1 -0
  121. package/esm/modules/ai-report-v3/utils.js +1 -0
  122. package/lib/components/Charts/ReportPie.js +2 -2
  123. package/lib/index.d.ts +2 -0
  124. package/lib/index.js +5 -1
  125. package/lib/modules/ai-report/components/AIEvaluate/index.js +1 -1
  126. package/lib/modules/ai-report/interface.d.ts +28 -0
  127. package/lib/modules/ai-report-v3/Root.d.ts +4 -0
  128. package/lib/modules/ai-report-v3/Root.js +115 -0
  129. package/lib/modules/ai-report-v3/components/AIEvaluate/Evaluate.d.ts +11 -0
  130. package/lib/modules/ai-report-v3/components/AIEvaluate/Evaluate.js +81 -0
  131. package/lib/modules/ai-report-v3/components/AIEvaluate/Graph.d.ts +22 -0
  132. package/lib/modules/ai-report-v3/components/AIEvaluate/Graph.js +276 -0
  133. package/lib/modules/ai-report-v3/components/AIEvaluate/index.d.ts +3 -0
  134. package/lib/modules/ai-report-v3/components/AIEvaluate/index.js +37 -0
  135. package/lib/modules/ai-report-v3/components/Candidate/Candidate.d.ts +7 -0
  136. package/lib/modules/ai-report-v3/components/Candidate/Candidate.js +57 -0
  137. package/lib/modules/ai-report-v3/components/Candidate/Interface.d.ts +16 -0
  138. package/lib/modules/ai-report-v3/components/Candidate/Interface.js +2 -0
  139. package/lib/modules/ai-report-v3/components/Candidate/Podium.d.ts +6 -0
  140. package/lib/modules/ai-report-v3/components/Candidate/Podium.js +52 -0
  141. package/lib/modules/ai-report-v3/components/Candidate/index.d.ts +2 -0
  142. package/lib/modules/ai-report-v3/components/Candidate/index.js +10 -0
  143. package/lib/modules/ai-report-v3/components/CapabilityTable/CapabilityTable.d.ts +3 -0
  144. package/lib/modules/ai-report-v3/components/CapabilityTable/CapabilityTable.js +64 -0
  145. package/lib/modules/ai-report-v3/components/CheatRisk/CheatRisk.d.ts +3 -0
  146. package/lib/modules/ai-report-v3/components/CheatRisk/CheatRisk.js +44 -0
  147. package/lib/modules/ai-report-v3/components/Form/Form.d.ts +23 -0
  148. package/lib/modules/ai-report-v3/components/Form/Form.js +73 -0
  149. package/lib/modules/ai-report-v3/components/Form/Forms.d.ts +9 -0
  150. package/lib/modules/ai-report-v3/components/Form/Forms.js +50 -0
  151. package/lib/modules/ai-report-v3/components/Form/Nps.d.ts +6 -0
  152. package/lib/modules/ai-report-v3/components/Form/Nps.js +59 -0
  153. package/lib/modules/ai-report-v3/components/Form/index.d.ts +1 -0
  154. package/lib/modules/ai-report-v3/components/Form/index.js +8 -0
  155. package/lib/modules/ai-report-v3/components/Form/interface.d.ts +57 -0
  156. package/lib/modules/ai-report-v3/components/Form/interface.js +2 -0
  157. package/lib/modules/ai-report-v3/components/MenuAnchor/index.d.ts +4 -0
  158. package/lib/modules/ai-report-v3/components/MenuAnchor/index.js +132 -0
  159. package/lib/modules/ai-report-v3/components/ModuleTitle.d.ts +5 -0
  160. package/lib/modules/ai-report-v3/components/ModuleTitle.js +28 -0
  161. package/lib/modules/ai-report-v3/components/NotFinish/index.d.ts +3 -0
  162. package/lib/modules/ai-report-v3/components/NotFinish/index.js +34 -0
  163. package/lib/modules/ai-report-v3/components/RankingRange/Item.d.ts +4 -0
  164. package/lib/modules/ai-report-v3/components/RankingRange/Item.js +48 -0
  165. package/lib/modules/ai-report-v3/components/RankingRange/index.d.ts +4 -0
  166. package/lib/modules/ai-report-v3/components/RankingRange/index.js +192 -0
  167. package/lib/modules/ai-report-v3/components/RankingRange/interface.d.ts +26 -0
  168. package/lib/modules/ai-report-v3/components/RankingRange/interface.js +2 -0
  169. package/lib/modules/ai-report-v3/components/RankingRange/styled.d.ts +7 -0
  170. package/lib/modules/ai-report-v3/components/RankingRange/styled.js +14 -0
  171. package/lib/modules/ai-report-v3/components/ReportHeader/ReportHeader.d.ts +17 -0
  172. package/lib/modules/ai-report-v3/components/ReportHeader/ReportHeader.js +110 -0
  173. package/lib/modules/ai-report-v3/components/ScoreReport/Bar.d.ts +6 -0
  174. package/lib/modules/ai-report-v3/components/ScoreReport/Bar.js +70 -0
  175. package/lib/modules/ai-report-v3/components/ScoreReport/Failed.d.ts +4 -0
  176. package/lib/modules/ai-report-v3/components/ScoreReport/Failed.js +34 -0
  177. package/lib/modules/ai-report-v3/components/ScoreReport/RecommendIcon.d.ts +3 -0
  178. package/lib/modules/ai-report-v3/components/ScoreReport/RecommendIcon.js +22 -0
  179. package/lib/modules/ai-report-v3/components/ScoreReport/Report.d.ts +3 -0
  180. package/lib/modules/ai-report-v3/components/ScoreReport/Report.js +27 -0
  181. package/lib/modules/ai-report-v3/components/ScoreReport/Score.d.ts +4 -0
  182. package/lib/modules/ai-report-v3/components/ScoreReport/Score.js +86 -0
  183. package/lib/modules/ai-report-v3/components/ScoreReport/ScoreLegend.d.ts +4 -0
  184. package/lib/modules/ai-report-v3/components/ScoreReport/ScoreLegend.js +35 -0
  185. package/lib/modules/ai-report-v3/components/ScoreReport/Tips.d.ts +3 -0
  186. package/lib/modules/ai-report-v3/components/ScoreReport/Tips.js +20 -0
  187. package/lib/modules/ai-report-v3/components/ScoreReport/index.d.ts +4 -0
  188. package/lib/modules/ai-report-v3/components/ScoreReport/index.js +44 -0
  189. package/lib/modules/ai-report-v3/components/ScoreReport/interface.d.ts +20 -0
  190. package/lib/modules/ai-report-v3/components/ScoreReport/interface.js +2 -0
  191. package/lib/modules/ai-report-v3/components/ScoreReport/styled.d.ts +22 -0
  192. package/lib/modules/ai-report-v3/components/ScoreReport/styled.js +24 -0
  193. package/lib/modules/ai-report-v3/components/SectionTabs/SectionTabs.d.ts +11 -0
  194. package/lib/modules/ai-report-v3/components/SectionTabs/SectionTabs.js +116 -0
  195. package/lib/modules/ai-report-v3/components/Suggestion/Suggestion.d.ts +4 -0
  196. package/lib/modules/ai-report-v3/components/Suggestion/Suggestion.js +33 -0
  197. package/lib/modules/ai-report-v3/components/Suggestion/index.d.ts +3 -0
  198. package/lib/modules/ai-report-v3/components/Suggestion/index.js +32 -0
  199. package/lib/modules/ai-report-v3/components/V3Header/V3Header.d.ts +11 -0
  200. package/lib/modules/ai-report-v3/components/V3Header/V3Header.js +159 -0
  201. package/lib/modules/ai-report-v3/components/VideoQuestion/Abilities.d.ts +4 -0
  202. package/lib/modules/ai-report-v3/components/VideoQuestion/Abilities.js +47 -0
  203. package/lib/modules/ai-report-v3/components/VideoQuestion/BodyImages.d.ts +7 -0
  204. package/lib/modules/ai-report-v3/components/VideoQuestion/BodyImages.js +61 -0
  205. package/lib/modules/ai-report-v3/components/VideoQuestion/Evaluate.d.ts +11 -0
  206. package/lib/modules/ai-report-v3/components/VideoQuestion/Evaluate.js +81 -0
  207. package/lib/modules/ai-report-v3/components/VideoQuestion/QuestionItem.d.ts +4 -0
  208. package/lib/modules/ai-report-v3/components/VideoQuestion/QuestionItem.js +150 -0
  209. package/lib/modules/ai-report-v3/components/VideoQuestion/ScoreSlider.d.ts +4 -0
  210. package/lib/modules/ai-report-v3/components/VideoQuestion/ScoreSlider.js +49 -0
  211. package/lib/modules/ai-report-v3/components/VideoQuestion/SingleChoice.d.ts +8 -0
  212. package/lib/modules/ai-report-v3/components/VideoQuestion/SingleChoice.js +33 -0
  213. package/lib/modules/ai-report-v3/components/VideoQuestion/Workplaces.d.ts +10 -0
  214. package/lib/modules/ai-report-v3/components/VideoQuestion/Workplaces.js +93 -0
  215. package/lib/modules/ai-report-v3/components/VideoQuestion/index.d.ts +6 -0
  216. package/lib/modules/ai-report-v3/components/VideoQuestion/index.js +29 -0
  217. package/lib/modules/ai-report-v3/components/VideoQuestion/interface.d.ts +17 -0
  218. package/lib/modules/ai-report-v3/components/VideoQuestion/interface.js +2 -0
  219. package/lib/modules/ai-report-v3/components/VideoQuestion/styled.d.ts +72 -0
  220. package/lib/modules/ai-report-v3/components/VideoQuestion/styled.js +96 -0
  221. package/lib/modules/ai-report-v3/components/WorkPlaces/ScoreSlider.d.ts +4 -0
  222. package/lib/modules/ai-report-v3/components/WorkPlaces/ScoreSlider.js +26 -0
  223. package/lib/modules/ai-report-v3/components/WorkPlaces/WorkPlace.d.ts +12 -0
  224. package/lib/modules/ai-report-v3/components/WorkPlaces/WorkPlace.js +74 -0
  225. package/lib/modules/ai-report-v3/components/WorkPlaces/index.d.ts +3 -0
  226. package/lib/modules/ai-report-v3/components/WorkPlaces/index.js +75 -0
  227. package/lib/modules/ai-report-v3/components/WorkPlaces/interface.d.ts +7 -0
  228. package/lib/modules/ai-report-v3/components/WorkPlaces/interface.js +2 -0
  229. package/lib/modules/ai-report-v3/components/WorkPlaces/styled.d.ts +62 -0
  230. package/lib/modules/ai-report-v3/components/WorkPlaces/styled.js +30 -0
  231. package/lib/modules/ai-report-v3/components/styled.d.ts +42 -0
  232. package/lib/modules/ai-report-v3/components/styled.js +146 -0
  233. package/lib/modules/ai-report-v3/index.d.ts +4 -0
  234. package/lib/modules/ai-report-v3/index.js +25 -0
  235. package/lib/modules/ai-report-v3/interface.d.ts +257 -0
  236. package/lib/modules/ai-report-v3/interface.js +2 -0
  237. package/lib/modules/ai-report-v3/useAiReport.d.ts +37 -0
  238. package/lib/modules/ai-report-v3/useAiReport.js +25 -0
  239. package/lib/modules/ai-report-v3/useAiReportVersion.d.ts +5 -0
  240. package/lib/modules/ai-report-v3/useAiReportVersion.js +49 -0
  241. package/lib/modules/ai-report-v3/utils.d.ts +1 -0
  242. package/lib/modules/ai-report-v3/utils.js +5 -0
  243. package/package.json +2 -2
@@ -120,8 +120,8 @@ var ReportPie = function (props) {
120
120
  itemStyle: {
121
121
  color: function (_a) {
122
122
  var _b;
123
- var level = _a.data.level;
124
- return (_b = const_1.levelMapping[level]) === null || _b === void 0 ? void 0 : _b.itemColor;
123
+ var _c = _a.data, avgScore = _c.avgScore, level = _c.level;
124
+ return (_b = const_1.levelMapping[avgScore != null ? getLevel(avgScore) : level]) === null || _b === void 0 ? void 0 : _b.itemColor;
125
125
  },
126
126
  shadowBlur: 4,
127
127
  shadowColor: 'rgba(0, 0, 0, 0.16)',
package/lib/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export { default as AiQuestion } from './modules/ai-question';
2
2
  export { default as AiReport } from './modules/ai-report';
3
3
  export { default as AiReportV2 } from './modules/ai-report-v2';
4
+ export { default as AiReportV3 } from './modules/ai-report-v3';
4
5
  export { default as AiTemplate } from './modules/ai-template';
5
6
  export { default as AiAbility } from './modules/ai-ability';
6
7
  export { default as AiAbilitySelect } from './modules/ai-ability-select';
@@ -8,4 +9,5 @@ export { default as VideoPreview } from './components/VideoPreview';
8
9
  export { useAiQuestion } from './modules/ai-question/useAiQuestion';
9
10
  export { useAiReport } from './modules/ai-report/useAiReport';
10
11
  export { useAiReportV2 } from './modules/ai-report-v2/useAiReport';
12
+ export { useAiReportV3 } from './modules/ai-report-v3/useAiReport';
11
13
  export { avocadoVideoInterview } from './utils/config';
package/lib/index.js CHANGED
@@ -3,13 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.avocadoVideoInterview = exports.useAiReportV2 = exports.useAiReport = exports.useAiQuestion = exports.VideoPreview = exports.AiAbilitySelect = exports.AiAbility = exports.AiTemplate = exports.AiReportV2 = exports.AiReport = exports.AiQuestion = void 0;
6
+ exports.avocadoVideoInterview = exports.useAiReportV3 = exports.useAiReportV2 = exports.useAiReport = exports.useAiQuestion = exports.VideoPreview = exports.AiAbilitySelect = exports.AiAbility = exports.AiTemplate = exports.AiReportV3 = exports.AiReportV2 = exports.AiReport = exports.AiQuestion = void 0;
7
7
  var ai_question_1 = require("./modules/ai-question");
8
8
  Object.defineProperty(exports, "AiQuestion", { enumerable: true, get: function () { return __importDefault(ai_question_1).default; } });
9
9
  var ai_report_1 = require("./modules/ai-report");
10
10
  Object.defineProperty(exports, "AiReport", { enumerable: true, get: function () { return __importDefault(ai_report_1).default; } });
11
11
  var ai_report_v2_1 = require("./modules/ai-report-v2");
12
12
  Object.defineProperty(exports, "AiReportV2", { enumerable: true, get: function () { return __importDefault(ai_report_v2_1).default; } });
13
+ var ai_report_v3_1 = require("./modules/ai-report-v3");
14
+ Object.defineProperty(exports, "AiReportV3", { enumerable: true, get: function () { return __importDefault(ai_report_v3_1).default; } });
13
15
  var ai_template_1 = require("./modules/ai-template");
14
16
  Object.defineProperty(exports, "AiTemplate", { enumerable: true, get: function () { return __importDefault(ai_template_1).default; } });
15
17
  var ai_ability_1 = require("./modules/ai-ability");
@@ -24,5 +26,7 @@ var useAiReport_1 = require("./modules/ai-report/useAiReport");
24
26
  Object.defineProperty(exports, "useAiReport", { enumerable: true, get: function () { return useAiReport_1.useAiReport; } });
25
27
  var useAiReport_2 = require("./modules/ai-report-v2/useAiReport");
26
28
  Object.defineProperty(exports, "useAiReportV2", { enumerable: true, get: function () { return useAiReport_2.useAiReportV2; } });
29
+ var useAiReport_3 = require("./modules/ai-report-v3/useAiReport");
30
+ Object.defineProperty(exports, "useAiReportV3", { enumerable: true, get: function () { return useAiReport_3.useAiReportV3; } });
27
31
  var config_1 = require("./utils/config");
28
32
  Object.defineProperty(exports, "avocadoVideoInterview", { enumerable: true, get: function () { return config_1.avocadoVideoInterview; } });
@@ -51,7 +51,7 @@ var Index = function () {
51
51
  // }, [expand]);
52
52
  if (!showAiDimension || ((_a = reportResult === null || reportResult === void 0 ? void 0 : reportResult.evaluations) === null || _a === void 0 ? void 0 : _a.length) === 0)
53
53
  return null;
54
- return ((0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ id: "report-evaluate", px: 2, mt: 2 }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", height: 56, alignItems: "center", spacing: 1, marginBottom: 1 }, { children: [(0, jsx_runtime_1.jsx)(AiHeaderTitle_1.default, { name: "AI\u57FA\u7840\u80FD\u529B" }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: (0, jsx_runtime_1.jsxs)("span", { children: ["\u7ED3\u679C\u8BF4\u660E\uFF1A", (0, jsx_runtime_1.jsx)("br", {}), "AI\u57FA\u7840\u80FD\u529B\u4ECE\u8BED\u901F\u3001\u666E\u901A\u8BDD\u3001\u8BED\u8A00\u6D41\u7545\u5EA6\u3001\u8981\u70B9\u5206\u6790\u5339\u914D\u5EA6\u3001\u8BED\u8A00\u4E30\u5BCC\u5EA6\u3001\u5F62\u8C61\u516D\u4E2A\u7EF4\u5EA6\u5BF9\u5019\u9009\u4EBA\u5728\u9762\u8BD5\u4E2D\u7684\u56DE\u7B54\u8868\u73B0\u8FDB\u884C\u8BC4\u4EF7\uFF0C\u6BCF\u4E2A\u7EF4\u5EA6\u5206\u4E3A\u4E09\u4E2A\u6863\uFF0C\u5206\u522B\u4E3A\uFF1A\u524D30%\u4EE3\u8868\u4F18\u79C0\u3001\u4E2D\u95F430%~70%\u4EE3\u8868\u9002\u4E2D\u3001\u540E30%\u4EE3\u8868\u6B20\u4F73\u3002", (0, jsx_runtime_1.jsx)("br", {}), "\u6BCF\u4E2A\u80FD\u529B\u7684\u4E09\u6863\u7684\u5206\u6570\u503C\u4F9D\u636E\u5168\u56FD\u5927\u6570\u636E\u7EDF\u8BA1\u800C\u5B9A\u3002\u6839\u636E\u5019\u9009\u4EBA\u5F53\u524DAI\u89C6\u9891\u6B65\u9AA4\u4E0B\u7684\u6BCF\u4E2A\u80FD\u529B\u7684\u5E73\u5747\u5206\u6765\u786E\u5B9A\u6BCF\u4E2A\u80FD\u529B\u7684\u8BC4\u4EF7\u3002\u76F8\u540C\u7684\u5F97\u5206\uFF0C\u6210\u7EE9\u5148\u51FA\u7684\u6392\u540D\u9760\u524D\u3002"] }) }, { children: (0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ display: "flex", alignItems: "center" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.InfoOutlineIcon, { sx: { fontSize: '16px' } }) })) }))] })), (0, jsx_runtime_1.jsxs)(mui_1.Collapse, __assign({ in: expand }, { children: [(_b = reportResult === null || reportResult === void 0 ? void 0 : reportResult.evaluations) === null || _b === void 0 ? void 0 : _b.map(function (v) {
54
+ return ((0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ id: "report-ai-dimension", px: 2, mt: 2 }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", height: 56, alignItems: "center", spacing: 1, marginBottom: 1 }, { children: [(0, jsx_runtime_1.jsx)(AiHeaderTitle_1.default, { name: "AI\u57FA\u7840\u80FD\u529B" }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: (0, jsx_runtime_1.jsxs)("span", { children: ["\u7ED3\u679C\u8BF4\u660E\uFF1A", (0, jsx_runtime_1.jsx)("br", {}), "AI\u57FA\u7840\u80FD\u529B\u4ECE\u8BED\u901F\u3001\u666E\u901A\u8BDD\u3001\u8BED\u8A00\u6D41\u7545\u5EA6\u3001\u8981\u70B9\u5206\u6790\u5339\u914D\u5EA6\u3001\u8BED\u8A00\u4E30\u5BCC\u5EA6\u3001\u5F62\u8C61\u516D\u4E2A\u7EF4\u5EA6\u5BF9\u5019\u9009\u4EBA\u5728\u9762\u8BD5\u4E2D\u7684\u56DE\u7B54\u8868\u73B0\u8FDB\u884C\u8BC4\u4EF7\uFF0C\u6BCF\u4E2A\u7EF4\u5EA6\u5206\u4E3A\u4E09\u4E2A\u6863\uFF0C\u5206\u522B\u4E3A\uFF1A\u524D30%\u4EE3\u8868\u4F18\u79C0\u3001\u4E2D\u95F430%~70%\u4EE3\u8868\u9002\u4E2D\u3001\u540E30%\u4EE3\u8868\u6B20\u4F73\u3002", (0, jsx_runtime_1.jsx)("br", {}), "\u6BCF\u4E2A\u80FD\u529B\u7684\u4E09\u6863\u7684\u5206\u6570\u503C\u4F9D\u636E\u5168\u56FD\u5927\u6570\u636E\u7EDF\u8BA1\u800C\u5B9A\u3002\u6839\u636E\u5019\u9009\u4EBA\u5F53\u524DAI\u89C6\u9891\u6B65\u9AA4\u4E0B\u7684\u6BCF\u4E2A\u80FD\u529B\u7684\u5E73\u5747\u5206\u6765\u786E\u5B9A\u6BCF\u4E2A\u80FD\u529B\u7684\u8BC4\u4EF7\u3002\u76F8\u540C\u7684\u5F97\u5206\uFF0C\u6210\u7EE9\u5148\u51FA\u7684\u6392\u540D\u9760\u524D\u3002"] }) }, { children: (0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ display: "flex", alignItems: "center" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.InfoOutlineIcon, { sx: { fontSize: '16px' } }) })) }))] })), (0, jsx_runtime_1.jsxs)(mui_1.Collapse, __assign({ in: expand }, { children: [(_b = reportResult === null || reportResult === void 0 ? void 0 : reportResult.evaluations) === null || _b === void 0 ? void 0 : _b.map(function (v) {
55
55
  var _a;
56
56
  var c = customInterviewDimRankMap === null || customInterviewDimRankMap === void 0 ? void 0 : customInterviewDimRankMap[v.evaluationToken];
57
57
  var rank = (0, utils_1.rankPercent)((c === null || c === void 0 ? void 0 : c.rank) || (v === null || v === void 0 ? void 0 : v.rank), (c === null || c === void 0 ? void 0 : c.total) || (v === null || v === void 0 ? void 0 : v.total));
@@ -115,10 +115,36 @@ export interface FollowupQuestion {
115
115
  desc: string;
116
116
  answer: string;
117
117
  }
118
+ export interface ReportQuestionCollection {
119
+ token: string;
120
+ name: string;
121
+ tag?: string;
122
+ type?: number;
123
+ isWorkplace?: boolean;
124
+ define?: string;
125
+ keyPoints?: string[];
126
+ interviewQuestions?: string[];
127
+ }
128
+ export interface ReportTag {
129
+ token: string;
130
+ name: string;
131
+ sentiment?: number;
132
+ type?: number;
133
+ color?: number;
134
+ }
135
+ export interface AiCandidateInfo {
136
+ name: string;
137
+ mobile: string;
138
+ processName: string;
139
+ positionName: string;
140
+ avatar: string;
141
+ tags?: ReportTag[];
142
+ }
118
143
  export interface AiInterviewReportStep {
119
144
  token: string;
120
145
  status: number;
121
146
  question: Question;
147
+ questionCollection?: ReportQuestionCollection;
122
148
  answer: Answer;
123
149
  scoreInfo: ScoreInfo;
124
150
  aiEvaluation: AiEvaluation;
@@ -137,6 +163,8 @@ export interface SummaryText {
137
163
  export interface AiInterviewReportList {
138
164
  orderToken: string;
139
165
  aiModel: AiModel;
166
+ candidateInfo?: AiCandidateInfo;
167
+ tags?: ReportTag[];
140
168
  collection: Collection[];
141
169
  faceUrl: string;
142
170
  faceAnalysis: FaceAnalysis;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { AiReportProps, AiReportRef } from './interface';
3
+ declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<AiReportProps & import("react").RefAttributes<AiReportRef>>>;
4
+ export default _default;
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ var jsx_runtime_1 = require("react/jsx-runtime");
18
+ var AIEvaluate_1 = __importDefault(require("./components/AIEvaluate"));
19
+ var CapabilityTable_1 = __importDefault(require("./components/CapabilityTable/CapabilityTable"));
20
+ var Form_1 = require("./components/Form");
21
+ var NotFinish_1 = __importDefault(require("./components/NotFinish"));
22
+ var SectionTabs_1 = __importDefault(require("./components/SectionTabs/SectionTabs"));
23
+ var V3Header_1 = __importDefault(require("./components/V3Header/V3Header"));
24
+ var VideoQuestion_1 = __importDefault(require("./components/VideoQuestion"));
25
+ var ai_report_1 = require("../../enum/ai-report");
26
+ var ai_report_2 = require("../../services/ai-report");
27
+ var global_store_1 = require("../../store/ai-report/global-store");
28
+ var ahooks_1 = require("ahooks");
29
+ var fbm_ui_1 = require("fbm-ui");
30
+ var react_1 = require("react");
31
+ var NO_ANSWER = ai_report_1.INTERVIEW_STATUS.NO_ANSWER;
32
+ 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, onExportReportClick = props.onExportReportClick, onSendReminderClick = props.onSendReminderClick, fetchFormResult = props.fetchFormResult, fetchCandidateInfo = props.fetchCandidateInfo, fetchReportUrl = props.fetchReportUrl, isExportPdf = props.isExportPdf;
34
+ var firstLoad = (0, react_1.useRef)(true);
35
+ var _a = (0, global_store_1.useAiReportStore)(), updateState = _a.updateState, updateReportResult = _a.updateReportResult, reportResult = _a.reportResult, interviewCheat = _a.interviewCheat;
36
+ var _b = (reportResult || {}).collection, collection = _b === void 0 ? [] : _b;
37
+ var _c = reportResult || {}, _d = _c.completedStatus, completedStatus = _d === void 0 ? ai_report_1.COMPLETED_STATUS.NOT_START : _d, _e = _c.screenSwitchCount, screenSwitchCount = _e === void 0 ? 0 : _e;
38
+ var hasRisk = completedStatus === ai_report_1.COMPLETED_STATUS.NOT_COMPLETED || !!(interviewCheat === null || interviewCheat === void 0 ? void 0 : interviewCheat.isCheat) || screenSwitchCount > 0;
39
+ var _f = (0, ahooks_1.useRequest)(function () { return (0, ai_report_2.PostAiInterviewResult)([token]); }, {
40
+ manual: true,
41
+ onSuccess: function (_a) {
42
+ var list = _a.data.list;
43
+ var result = list[0];
44
+ updateReportResult(result);
45
+ if (firstLoad.current) {
46
+ var pageStepIndexes_1 = [];
47
+ result.steps.forEach(function (_a, index) {
48
+ var videoUrl = _a.answer.videoUrl;
49
+ if (videoUrl) {
50
+ pageStepIndexes_1.push(index);
51
+ }
52
+ });
53
+ firstLoad.current = false;
54
+ onLoad === null || onLoad === void 0 ? void 0 : onLoad(__assign({ pageStepIndexes: pageStepIndexes_1 }, result));
55
+ }
56
+ },
57
+ }), data = _f.data, loading = _f.loading, postAiInterviewResult = _f.run;
58
+ var status = (data === null || data === void 0 ? void 0 : data.data.list[0].status) || NO_ANSWER;
59
+ var handleRefreshSuccess = (0, react_1.useCallback)(function () {
60
+ postAiInterviewResult();
61
+ }, [postAiInterviewResult]);
62
+ (0, react_1.useImperativeHandle)(ref, function () { return ({
63
+ handleRefresh: function () { return postAiInterviewResult(); },
64
+ }); });
65
+ (0, react_1.useEffect)(function () {
66
+ firstLoad.current = true;
67
+ postAiInterviewResult();
68
+ // eslint-disable-next-line react-hooks/exhaustive-deps
69
+ }, [token]);
70
+ (0, react_1.useEffect)(function () {
71
+ updateState(props);
72
+ // eslint-disable-next-line react-hooks/exhaustive-deps
73
+ }, [JSON.stringify(props)]);
74
+ var content = (0, react_1.useMemo)(function () {
75
+ if (loading) {
76
+ 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: "\u62A5\u544A\u52A0\u8F7D\u4E2D\uFF0C\u8BF7\u7A0D\u540E" })) }))] })));
77
+ }
78
+ if (status === NO_ANSWER) {
79
+ 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
+ }
81
+ return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ sx: { background: '#F7F8FA', minHeight: 618, px: 3 } }, { children: [(0, jsx_runtime_1.jsx)(SectionTabs_1.default, { hasRisk: hasRisk, operableButtons: operableButtons, onExportReportClick: onExportReportClick, fetchReportUrl: fetchReportUrl }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ sx: {
82
+ py: 2,
83
+ } }, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ sx: {
84
+ maxWidth: 1342,
85
+ mx: 'auto',
86
+ backgroundColor: '#fff',
87
+ border: '1px solid rgba(0,0,0,0.06)',
88
+ boxShadow: '0 6px 24px rgba(0,0,0,0.10)',
89
+ borderRadius: 2,
90
+ overflow: 'hidden',
91
+ pb: 3,
92
+ } }, { 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
+ }, [
94
+ loading,
95
+ status,
96
+ operableButtons,
97
+ reminderSent,
98
+ onSendReminderClick,
99
+ collection,
100
+ customScore,
101
+ handleRefreshSuccess,
102
+ fetchCandidateInfo,
103
+ fetchReportUrl,
104
+ fetchFormResult,
105
+ isExportPdf,
106
+ ]);
107
+ return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ loading: firstLoad.current && loading, sx: {
108
+ width: '100%',
109
+ minHeight: 618,
110
+ background: '#F7F8FA',
111
+ fontFamily: '"Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif',
112
+ } }, { children: content })));
113
+ });
114
+ AiReportRoot.displayName = 'AiReportRoot';
115
+ exports.default = (0, react_1.memo)(AiReportRoot);
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ declare type Mode = 'edit' | 'show';
3
+ interface EvaluateProps {
4
+ title: string;
5
+ evaluation: string;
6
+ mode?: Mode;
7
+ canEdit?: boolean;
8
+ orderToken: string;
9
+ }
10
+ declare const Evaluate: React.FC<EvaluateProps>;
11
+ export default Evaluate;
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __read = (this && this.__read) || function (o, n) {
14
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
15
+ if (!m) return o;
16
+ var i = m.call(o), r, ar = [], e;
17
+ try {
18
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
19
+ }
20
+ catch (error) { e = { error: error }; }
21
+ finally {
22
+ try {
23
+ if (r && !r.done && (m = i["return"])) m.call(i);
24
+ }
25
+ finally { if (e) throw e.error; }
26
+ }
27
+ return ar;
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ var jsx_runtime_1 = require("react/jsx-runtime");
31
+ var ai_report_1 = require("../../../../services/ai-report");
32
+ var fbm_ui_1 = require("fbm-ui");
33
+ var mui_1 = require("fbm-ui/lib/mui");
34
+ var react_1 = require("react");
35
+ var ModuleTitle_1 = require("../ModuleTitle");
36
+ var Evaluate = function (_a) {
37
+ var title = _a.title, evaluation = _a.evaluation, orderToken = _a.orderToken, _b = _a.mode, mode = _b === void 0 ? 'show' : _b, _c = _a.canEdit, canEdit = _c === void 0 ? 'false' : _c;
38
+ var _d = __read((0, react_1.useState)(evaluation), 2), content = _d[0], setContent = _d[1];
39
+ var _e = __read((0, react_1.useState)('show'), 2), internalMode = _e[0], setInternalMode = _e[1];
40
+ var handleChange = (0, react_1.useCallback)(function (e) {
41
+ var value = e.target.value;
42
+ setContent(value);
43
+ }, []);
44
+ var handleModeChange = (0, react_1.useCallback)(function () {
45
+ setInternalMode(internalMode === 'show' ? 'edit' : 'show');
46
+ }, [internalMode]);
47
+ var isValidate = (0, react_1.useMemo)(function () {
48
+ return content.trim().length > 0;
49
+ }, [content]);
50
+ var handleSubmit = (0, react_1.useCallback)(function () {
51
+ if (!isValidate)
52
+ return;
53
+ (0, fbm_ui_1.confirm)({
54
+ header: null,
55
+ content: '确认将评价内容修改吗?该动作无法被撤销。',
56
+ okText: '修改',
57
+ okProps: {
58
+ color: 'error',
59
+ variant: 'contained',
60
+ },
61
+ onOk: function (_a) {
62
+ var onClose = _a.onClose;
63
+ var data = {
64
+ orderToken: orderToken,
65
+ manualEvaluation: content,
66
+ };
67
+ (0, ai_report_1.PostInterviewEvaluation)(data).then(handleModeChange).then(onClose).catch(console.error);
68
+ },
69
+ });
70
+ }, [isValidate, orderToken, content, handleModeChange]);
71
+ (0, react_1.useEffect)(function () {
72
+ setInternalMode(mode);
73
+ }, [mode]);
74
+ return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ sx: {
75
+ mt: 3,
76
+ } }, { children: [(0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ mb: 1, position: "relative" }, { children: (0, jsx_runtime_1.jsx)(ModuleTitle_1.ModuleTitle, { title: title, action: canEdit ? ((0, jsx_runtime_1.jsx)("img", { onClick: handleModeChange, src: "https://webcdn.fbmms.cn/assets/pWED/KpgryvNScI7XZdjNBgTNC", alt: "", style: { width: 24, height: 24, cursor: 'pointer' } })) : undefined }) })), 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, error: !isValidate }), (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 () {
77
+ handleModeChange();
78
+ setContent(evaluation);
79
+ } }, { 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)(mui_1.Box, __assign({ sx: { border: '1px solid #EBFCF7', borderRadius: 2, padding: '12px 16px', background: '#fff' } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "textSecondary", sx: { whiteSpace: 'pre-wrap', fontSize: 14, lineHeight: 1.8 } }, { children: content })) })))] })));
80
+ };
81
+ exports.default = Evaluate;
@@ -0,0 +1,22 @@
1
+ /// <reference types="react" />
2
+ interface Dimension {
3
+ name: string;
4
+ score: number;
5
+ }
6
+ export declare function getLevel(score: any): {
7
+ label: string;
8
+ width: number;
9
+ fontColor: string;
10
+ color: number[];
11
+ gradient: string[];
12
+ scoreGradient: string[];
13
+ backgroundColor: string;
14
+ shadowColor: string;
15
+ endScore: number;
16
+ pointColor: string[];
17
+ };
18
+ interface GraphProps {
19
+ items: Array<Dimension>;
20
+ }
21
+ declare const _default: import("react").NamedExoticComponent<GraphProps>;
22
+ export default _default;
@@ -0,0 +1,276 @@
1
+ "use strict";
2
+ var __read = (this && this.__read) || function (o, n) {
3
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
4
+ if (!m) return o;
5
+ var i = m.call(o), r, ar = [], e;
6
+ try {
7
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
8
+ }
9
+ catch (error) { e = { error: error }; }
10
+ finally {
11
+ try {
12
+ if (r && !r.done && (m = i["return"])) m.call(i);
13
+ }
14
+ finally { if (e) throw e.error; }
15
+ }
16
+ return ar;
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.getLevel = void 0;
20
+ var jsx_runtime_1 = require("react/jsx-runtime");
21
+ var react_1 = require("react");
22
+ function setupCanvas(canvas) {
23
+ var dpr = window.devicePixelRatio || 1;
24
+ var rect = canvas.getBoundingClientRect();
25
+ canvas.width = rect.width * dpr;
26
+ canvas.height = rect.height * dpr;
27
+ var ctx = canvas.getContext('2d');
28
+ ctx.scale(dpr, dpr);
29
+ return ctx;
30
+ }
31
+ // interface GradeColor {
32
+ // Bad: Array<number>;
33
+ // Good: Array<number>;
34
+ // Best: Array<number>;
35
+ // }
36
+ var MAX_WIDTH = 315;
37
+ var MAX_HEIGHT = 24;
38
+ var levelOrder = ['Bad', 'Good', 'Best'];
39
+ var levelOrderScore = [0, 60, 80, 100];
40
+ var levelConf = {
41
+ Bad: {
42
+ label: '欠佳',
43
+ width: (MAX_WIDTH * 0.6) | 0,
44
+ fontColor: '#0D67FF',
45
+ color: [229, 115, 115],
46
+ gradient: ['#629CFF', 'rgba(75,141,255,0.08)'],
47
+ scoreGradient: ['#4B87F0', '#D2E2FF'],
48
+ backgroundColor: 'rgba(98,156,255,0.15)',
49
+ shadowColor: 'rgba(98, 156, 255, 0.40)',
50
+ endScore: 60,
51
+ pointColor: ['RGB(229, 115, 115)', 'RGB(255, 67, 102)'],
52
+ },
53
+ Good: {
54
+ label: '适中',
55
+ width: (MAX_WIDTH * 0.2) | 0,
56
+ fontColor: '#00A276',
57
+ color: [255, 183, 77],
58
+ gradient: ['#00D99D', '#CBFFF1'],
59
+ scoreGradient: ['#0ACB96', '#65FFD4'],
60
+ backgroundColor: 'rgba(0,217,157,0.15)',
61
+ shadowColor: 'rgba(0, 217, 157, 0.40)',
62
+ endScore: 80,
63
+ pointColor: ['RGB(255, 183, 77)', 'RGB(255, 152, 0)'],
64
+ },
65
+ Best: {
66
+ label: '优秀',
67
+ width: (MAX_WIDTH * 0.2) | 0,
68
+ fontColor: '#DF8500',
69
+ color: [0, 217, 157],
70
+ gradient: ['#FF9903', 'rgba(255,218,165,0.29)'],
71
+ scoreGradient: ['#FF9903', '#FFDF9D'],
72
+ shadowColor: 'rgba(255, 153, 3, 0.40)',
73
+ backgroundColor: 'rgba(255,183,77,0.15)',
74
+ endScore: 100,
75
+ pointColor: ['RGB(0, 217, 157)', 'RGB(0, 176, 127)'],
76
+ },
77
+ };
78
+ var tipEl = document.createElement('div');
79
+ var measureTextWidth = function (ctx, text) {
80
+ var width = ctx.measureText(text).width;
81
+ return width;
82
+ };
83
+ function isInPath(x, y, rect, ctx) {
84
+ var dpr = window.devicePixelRatio || 1;
85
+ ctx.beginPath();
86
+ ctx.rect(0, rect.y / dpr, rect.width / dpr, rect.height / dpr);
87
+ var ret = ctx.isPointInPath(x, y);
88
+ ctx.closePath();
89
+ return ret;
90
+ }
91
+ var drawTop = function (layout, ctx) {
92
+ // 设置全局样式
93
+ var leftLableWidth = layout.leftLableWidth, height = layout.height;
94
+ var offset = leftLableWidth;
95
+ var lineEndY = height - 40; // 虚线结束位置,距离底部40px
96
+ var scoreTextY = height - 25; // 分数文字的Y位置,距离底部25px
97
+ levelOrder.forEach(function (level, i) {
98
+ var _a = levelConf[level], width = _a.width, gradient = _a.gradient, label = _a.label, fontColor = _a.fontColor;
99
+ // 绘制渐变背景
100
+ var gradientFill = ctx.createLinearGradient(0, 0, 0, 25);
101
+ gradientFill.addColorStop(0, gradient[0]);
102
+ gradientFill.addColorStop(1, gradient[1]);
103
+ ctx.fillStyle = gradientFill;
104
+ ctx.fillRect(offset, 0, width, 25);
105
+ // 绘制标签文本
106
+ var labelWidth = measureTextWidth(ctx, label);
107
+ ctx.fillStyle = fontColor;
108
+ ctx.fillText(label, offset + width / 2 - labelWidth / 2, 18);
109
+ // 绘制垂直虚线
110
+ drawVerticalDashedLine(ctx, offset - 1, 0, lineEndY, 2, 2);
111
+ // 绘制分数文本
112
+ ctx.fillStyle = '#4CAF50';
113
+ ctx.fillText("".concat(levelOrderScore[i]), offset - (i === 0 ? 5 : 9), scoreTextY);
114
+ offset += width + 1;
115
+ // 绘制结束的虚线和文本 '100'
116
+ if (i === levelOrder.length - 1) {
117
+ drawVerticalDashedLine(ctx, offset - 2, 0, lineEndY, 2, 2);
118
+ ctx.fillText('100', offset - 2 - 24, scoreTextY);
119
+ }
120
+ });
121
+ };
122
+ var truncateString = function (str) { return (str.length > 7 ? "".concat(str.slice(0, 6), "...") : str); };
123
+ var drawLable = function (lable, x, y, ctx) {
124
+ ctx.fillStyle = 'rgba(0, 0, 0, 0.55)';
125
+ ctx.fillText(truncateString(lable), x, y + 5);
126
+ };
127
+ function drawVerticalDashedLine(ctx, x, startY, endY, dashLength, gapLength) {
128
+ if (dashLength === void 0) { dashLength = 2; }
129
+ if (gapLength === void 0) { gapLength = 1; }
130
+ ctx.lineWidth = 1;
131
+ ctx.strokeStyle = 'rgba(76, 175, 80, 0.30)';
132
+ ctx.beginPath();
133
+ ctx.setLineDash([dashLength, gapLength]);
134
+ ctx.moveTo(x, startY);
135
+ ctx.lineTo(x, endY);
136
+ ctx.stroke();
137
+ ctx.setLineDash([]); // 重置为实线
138
+ }
139
+ var drawRoundedRect = function (x, y, width, height, r, fill, stroke, ctx) {
140
+ ctx.save();
141
+ ctx.beginPath();
142
+ ctx.moveTo(x + r, y);
143
+ ctx.arcTo(x + width, y, x + width, y + r, r);
144
+ ctx.arcTo(x + width, y + height, x + width - r, y + height, r);
145
+ ctx.arcTo(x, y + height, x, y + height - r, r);
146
+ ctx.arcTo(x, y, x + r, y, r);
147
+ if (fill) {
148
+ ctx.fill();
149
+ }
150
+ if (stroke) {
151
+ ctx.stroke();
152
+ }
153
+ ctx.restore();
154
+ };
155
+ function getLevel(score) {
156
+ if (score < 60) {
157
+ return levelConf.Bad;
158
+ }
159
+ else if (score < 80) {
160
+ return levelConf.Good;
161
+ }
162
+ else {
163
+ return levelConf.Best;
164
+ }
165
+ }
166
+ exports.getLevel = getLevel;
167
+ var drawScore = function (layout, ctx, config, rect, score) {
168
+ var gradient = ctx.createLinearGradient(layout.leftLableWidth + rect.width, 30, layout.leftLableWidth, 30);
169
+ gradient.addColorStop(0, config.scoreGradient[0]);
170
+ gradient.addColorStop(1, config.scoreGradient[1]);
171
+ ctx.fillStyle = gradient;
172
+ // // 设置阴影
173
+ ctx.shadowOffsetX = 0;
174
+ ctx.shadowOffsetY = 4;
175
+ ctx.shadowBlur = 6;
176
+ // ctx.shadowColor = config.shadowColor;
177
+ // 绘制圆角矩形
178
+ var borderRadius = 12;
179
+ drawRoundedRect(rect.x, rect.y, rect.width, rect.height, borderRadius, true, false, ctx);
180
+ ctx.fillStyle = score < 10 ? '#0D67FF' : '#fff';
181
+ var scoreWidth = measureTextWidth(ctx, "".concat(score));
182
+ ctx.fillText("".concat(score), layout.leftLableWidth + rect.width + (score < 10 ? 4 : -scoreWidth - 4), rect.y + 18);
183
+ };
184
+ var draw = function (layout, dimensions, pathRef, ctx) {
185
+ ctx.font = '14px sans-serif';
186
+ ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
187
+ dimensions.forEach(function (v, i) {
188
+ var config = getLevel(v.score);
189
+ // 绘制圆角矩形
190
+ var borderRadius = 12;
191
+ var x = layout.leftLableWidth;
192
+ var y = 50 + layout.itemSpacing * i;
193
+ // 设置背景颜色
194
+ ctx.fillStyle = config.backgroundColor;
195
+ drawRoundedRect(x, y, MAX_WIDTH, MAX_HEIGHT, borderRadius, true, false, ctx);
196
+ var endPointY = 50 + 15 + layout.itemSpacing * i; // 50是顶部偏移,15是文字相对矩形的偏移
197
+ drawLable(v.name, 0, endPointY, ctx);
198
+ pathRef.push({ x: 0, y: y, width: layout.leftLableWidth, height: 22, tips: "".concat(v.name, ": ").concat(v.score) });
199
+ var score = v.score === 0 ? 0 : Math.max(v.score, 4);
200
+ drawScore(layout, ctx, config, {
201
+ x: layout.leftLableWidth,
202
+ y: y,
203
+ width: MAX_WIDTH * (score / 100),
204
+ height: MAX_HEIGHT,
205
+ }, v.score);
206
+ });
207
+ drawTop(layout, ctx);
208
+ };
209
+ var Graph = function (_a) {
210
+ var _b = _a.items, items = _b === void 0 ? [] : _b;
211
+ var ref = (0, react_1.useRef)(null);
212
+ var pathRef = (0, react_1.useRef)([]);
213
+ var _c = __read((0, react_1.useState)(), 2), ctx = _c[0], setCtx = _c[1];
214
+ // 统一间距配置
215
+ var ITEM_SPACING = 40;
216
+ var TOP_OFFSET = 50;
217
+ var BOTTOM_SPACING = 20; // 最后一个item与虚线之间的间距
218
+ var SCORE_AREA_HEIGHT = 40; // 分数区域的高度
219
+ var height = (0, react_1.useMemo)(function () {
220
+ if (items.length === 0)
221
+ return 0;
222
+ return TOP_OFFSET + (items.length - 1) * ITEM_SPACING + MAX_HEIGHT + BOTTOM_SPACING + SCORE_AREA_HEIGHT;
223
+ }, [items]);
224
+ (0, react_1.useEffect)(function () {
225
+ if (items.length === 0)
226
+ return;
227
+ var currentCtx = setupCanvas(ref.current);
228
+ setCtx(currentCtx);
229
+ tipEl.style.background = 'rgba(0,0,0,.7)';
230
+ tipEl.style.color = '#fff';
231
+ tipEl.style.borderRadius = '2px';
232
+ tipEl.style.padding = '2px 5px';
233
+ tipEl.style.position = 'absolute';
234
+ tipEl.style.zIndex = '9999';
235
+ tipEl.style.fontSize = '12px';
236
+ tipEl.style.display = 'none';
237
+ document.body.appendChild(tipEl);
238
+ // Clean up the tooltip element when items change
239
+ return function () {
240
+ if (tipEl.parentNode) {
241
+ tipEl.parentNode.removeChild(tipEl);
242
+ }
243
+ };
244
+ }, [ref, items]);
245
+ (0, react_1.useEffect)(function () {
246
+ if (ctx) {
247
+ var layout = {
248
+ leftLableWidth: 140,
249
+ topLableHeight: 40,
250
+ itemSpacing: ITEM_SPACING,
251
+ height: height,
252
+ };
253
+ pathRef.current = [];
254
+ draw(layout, items, pathRef.current, ctx);
255
+ }
256
+ }, [ctx, items, height, ITEM_SPACING]);
257
+ // useEffect(() => {
258
+ // console.log(pathRef);
259
+ // }, [pathRef]);
260
+ var handleMouseMove = (0, react_1.useCallback)(function (e) {
261
+ if (ctx) {
262
+ var p = pathRef.current.find(function (p) { return isInPath(e.nativeEvent.offsetX, e.nativeEvent.offsetY, p, ctx); });
263
+ if (p) {
264
+ tipEl.style.left = e.pageX + 10 + 'px';
265
+ tipEl.style.top = e.pageY + 10 + 'px';
266
+ tipEl.innerHTML = p.tips;
267
+ tipEl.style.display = 'block';
268
+ }
269
+ else {
270
+ tipEl.style.display = 'none';
271
+ }
272
+ }
273
+ }, [ctx, pathRef]);
274
+ return (0, jsx_runtime_1.jsx)("canvas", { ref: ref, onMouseOut: function () { return (tipEl.style.display = 'none'); }, onMouseMove: handleMouseMove, style: { width: 460, height: height } });
275
+ };
276
+ exports.default = (0, react_1.memo)(Graph);
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: import("react").MemoExoticComponent<() => JSX.Element | null>;
3
+ export default _default;