eli-video-interview 1.5.0 → 1.6.1

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 +130 -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 +132 -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 +1 -1
@@ -115,8 +115,8 @@ var ReportPie = function (props) {
115
115
  itemStyle: {
116
116
  color: function (_a) {
117
117
  var _b;
118
- var level = _a.data.level;
119
- return (_b = levelMapping[level]) === null || _b === void 0 ? void 0 : _b.itemColor;
118
+ var _c = _a.data, avgScore = _c.avgScore, level = _c.level;
119
+ return (_b = levelMapping[avgScore != null ? getLevel(avgScore) : level]) === null || _b === void 0 ? void 0 : _b.itemColor;
120
120
  },
121
121
  shadowBlur: 4,
122
122
  shadowColor: 'rgba(0, 0, 0, 0.16)',
package/esm/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/esm/index.js 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';
@@ -46,7 +46,7 @@ var Index = function () {
46
46
  // }, [expand]);
47
47
  if (!showAiDimension || ((_a = reportResult === null || reportResult === void 0 ? void 0 : reportResult.evaluations) === null || _a === void 0 ? void 0 : _a.length) === 0)
48
48
  return null;
49
- return (_jsxs(Box, __assign({ id: "report-evaluate", px: 2, mt: 2 }, { children: [_jsxs(Stack, __assign({ direction: "row", height: 56, alignItems: "center", spacing: 1, marginBottom: 1 }, { children: [_jsx(AiHeaderTitle, { name: "AI\u57FA\u7840\u80FD\u529B" }), _jsx(Tooltip, __assign({ title: _jsxs("span", { children: ["\u7ED3\u679C\u8BF4\u660E\uFF1A", _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", _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: _jsx(Box, __assign({ display: "flex", alignItems: "center" }, { children: _jsx(InfoOutlineIcon, { sx: { fontSize: '16px' } }) })) }))] })), _jsxs(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) {
49
+ return (_jsxs(Box, __assign({ id: "report-ai-dimension", px: 2, mt: 2 }, { children: [_jsxs(Stack, __assign({ direction: "row", height: 56, alignItems: "center", spacing: 1, marginBottom: 1 }, { children: [_jsx(AiHeaderTitle, { name: "AI\u57FA\u7840\u80FD\u529B" }), _jsx(Tooltip, __assign({ title: _jsxs("span", { children: ["\u7ED3\u679C\u8BF4\u660E\uFF1A", _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", _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: _jsx(Box, __assign({ display: "flex", alignItems: "center" }, { children: _jsx(InfoOutlineIcon, { sx: { fontSize: '16px' } }) })) }))] })), _jsxs(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) {
50
50
  var _a;
51
51
  var c = customInterviewDimRankMap === null || customInterviewDimRankMap === void 0 ? void 0 : customInterviewDimRankMap[v.evaluationToken];
52
52
  var rank = 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,110 @@
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
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
+ import AIEvaluate from './components/AIEvaluate';
14
+ import CapabilityTable from './components/CapabilityTable/CapabilityTable';
15
+ import { FormReport } from './components/Form';
16
+ import NotFinish from './components/NotFinish';
17
+ import SectionTabs from './components/SectionTabs/SectionTabs';
18
+ import V3Header from './components/V3Header/V3Header';
19
+ import VideoQuestion from './components/VideoQuestion';
20
+ import { COMPLETED_STATUS, INTERVIEW_STATUS } from "../../enum/ai-report";
21
+ import { PostAiInterviewResult } from "../../services/ai-report";
22
+ import { useAiReportStore } from "../../store/ai-report/global-store";
23
+ import { useRequest } from 'ahooks';
24
+ import { Box, Button, Typography } from 'fbm-ui';
25
+ import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
26
+ var NO_ANSWER = INTERVIEW_STATUS.NO_ANSWER;
27
+ var AiReportRoot = forwardRef(function (props, ref) {
28
+ var token = props.token, v3AssetBase = props.v3AssetBase, customScore = props.customScore, reminderSent = props.reminderSent, operableButtons = props.operableButtons, onLoad = props.onLoad, onExportReportClick = props.onExportReportClick, onSendReminderClick = props.onSendReminderClick, fetchFormResult = props.fetchFormResult, fetchCandidateInfo = props.fetchCandidateInfo, fetchReportUrl = props.fetchReportUrl, isExportPdf = props.isExportPdf;
29
+ var firstLoad = useRef(true);
30
+ var _a = useAiReportStore(), updateState = _a.updateState, updateReportResult = _a.updateReportResult, reportResult = _a.reportResult, interviewCheat = _a.interviewCheat;
31
+ var _b = (reportResult || {}).collection, collection = _b === void 0 ? [] : _b;
32
+ var _c = reportResult || {}, _d = _c.completedStatus, completedStatus = _d === void 0 ? COMPLETED_STATUS.NOT_START : _d, _e = _c.screenSwitchCount, screenSwitchCount = _e === void 0 ? 0 : _e;
33
+ var hasRisk = completedStatus === COMPLETED_STATUS.NOT_COMPLETED || !!(interviewCheat === null || interviewCheat === void 0 ? void 0 : interviewCheat.isCheat) || screenSwitchCount > 0;
34
+ var _f = useRequest(function () { return PostAiInterviewResult([token]); }, {
35
+ manual: true,
36
+ onSuccess: function (_a) {
37
+ var list = _a.data.list;
38
+ var result = list[0];
39
+ updateReportResult(result);
40
+ if (firstLoad.current) {
41
+ var pageStepIndexes_1 = [];
42
+ result.steps.forEach(function (_a, index) {
43
+ var videoUrl = _a.answer.videoUrl;
44
+ if (videoUrl) {
45
+ pageStepIndexes_1.push(index);
46
+ }
47
+ });
48
+ firstLoad.current = false;
49
+ onLoad === null || onLoad === void 0 ? void 0 : onLoad(__assign({ pageStepIndexes: pageStepIndexes_1 }, result));
50
+ }
51
+ },
52
+ }), data = _f.data, loading = _f.loading, postAiInterviewResult = _f.run;
53
+ var status = (data === null || data === void 0 ? void 0 : data.data.list[0].status) || NO_ANSWER;
54
+ var handleRefreshSuccess = useCallback(function () {
55
+ postAiInterviewResult();
56
+ }, [postAiInterviewResult]);
57
+ useImperativeHandle(ref, function () { return ({
58
+ handleRefresh: function () { return postAiInterviewResult(); },
59
+ }); });
60
+ useEffect(function () {
61
+ firstLoad.current = true;
62
+ postAiInterviewResult();
63
+ // eslint-disable-next-line react-hooks/exhaustive-deps
64
+ }, [token]);
65
+ useEffect(function () {
66
+ updateState(props);
67
+ // eslint-disable-next-line react-hooks/exhaustive-deps
68
+ }, [JSON.stringify(props)]);
69
+ var content = useMemo(function () {
70
+ if (loading) {
71
+ return (_jsxs(Box, __assign({ width: "100%", display: "flex", alignItems: "center", justifyContent: "center", flexDirection: "column", style: { marginTop: '149px' } }, { children: [_jsx(Box, { children: _jsx("img", { src: "//webcdn.fbmms.cn/web/saas/asset/image/CandidateInfoEmpty.png", alt: "", style: { width: '140px', height: '140px' } }) }), _jsx(Box, __assign({ mt: 2 }, { children: _jsx(Typography, __assign({ variant: "body1", color: "textPrimary", style: { fontWeight: '500' } }, { children: "\u62A5\u544A\u52A0\u8F7D\u4E2D\uFF0C\u8BF7\u7A0D\u540E" })) }))] })));
72
+ }
73
+ if (status === NO_ANSWER) {
74
+ return (_jsxs(Box, __assign({ width: "100%", display: "flex", alignItems: "center", justifyContent: "center", flexDirection: "column", style: { marginTop: '149px' } }, { children: [_jsx(Box, { children: _jsx("img", { src: "//webcdn.fbmms.cn/web/saas/asset/image/CandidateInfoEmpty.png", alt: "", style: { width: '140px', height: '140px' } }) }), _jsx(Box, __assign({ mt: 2 }, { children: _jsx(Typography, __assign({ variant: "body1", color: "textPrimary", style: { fontWeight: '500' } }, { children: "\u8BE5\u5019\u9009\u4EBA\u5C1A\u672A\u5F00\u59CB\u9762\u8BD5" })) })), (operableButtons === null || operableButtons === void 0 ? void 0 : operableButtons.includes('sendReminder')) && (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ style: { marginTop: '2px' } }, { children: _jsx(Typography, __assign({ variant: "body2", color: "textSecondary" }, { children: "\u82E5\u957F\u65F6\u95F4\u672A\u5F00\u59CB\uFF0C\u5EFA\u8BAE\u4F60\u7ED9\u5019\u9009\u4EBA\u53D1\u9001\u77ED\u4FE1\u63D0\u9192" })) })), _jsx(Box, __assign({ mt: 2 }, { children: _jsx(Button, __assign({ size: "large", variant: "outlined", color: "primary", disabled: reminderSent, onClick: onSendReminderClick }, { children: reminderSent ? '已提醒' : '发送提醒' })) }))] }))] })));
75
+ }
76
+ return (_jsxs(Box, __assign({ sx: { background: '#F7F8FA', minHeight: 618, px: 3 } }, { children: [_jsx(SectionTabs, { hasRisk: hasRisk, operableButtons: operableButtons, onExportReportClick: onExportReportClick, fetchReportUrl: fetchReportUrl }), _jsx(Box, __assign({ sx: {
77
+ py: 2,
78
+ } }, { children: _jsxs(Box, __assign({ sx: {
79
+ maxWidth: 1342,
80
+ mx: 'auto',
81
+ backgroundColor: '#fff',
82
+ border: '1px solid rgba(0,0,0,0.06)',
83
+ boxShadow: '0 6px 24px rgba(0,0,0,0.10)',
84
+ borderRadius: 2,
85
+ overflow: 'hidden',
86
+ pb: 3,
87
+ } }, { children: [hasRisk && (_jsx(Box, __assign({ id: "report-risk-alert" }, { children: _jsx(NotFinish, {}) }))), _jsx(V3Header, { v3AssetBase: v3AssetBase, status: status, customScore: customScore, onRefreshSuccess: handleRefreshSuccess, fetchCandidateInfo: fetchCandidateInfo }), _jsxs(Box, __assign({ sx: { mx: 2, mt: 1.5 } }, { children: [((collection === null || collection === void 0 ? void 0 : collection.length) > 0 || !!(reportResult === null || reportResult === void 0 ? void 0 : reportResult.workplaceEvaluation)) && (_jsx(AIEvaluate, {})), _jsx(CapabilityTable, {}), fetchFormResult && _jsx(FormReport, { fetchFormResult: fetchFormResult }), _jsx(VideoQuestion, { isExportPdf: isExportPdf })] }))] })) }))] })));
88
+ }, [
89
+ loading,
90
+ status,
91
+ operableButtons,
92
+ reminderSent,
93
+ onSendReminderClick,
94
+ collection,
95
+ customScore,
96
+ handleRefreshSuccess,
97
+ fetchCandidateInfo,
98
+ fetchReportUrl,
99
+ fetchFormResult,
100
+ isExportPdf,
101
+ ]);
102
+ return (_jsx(Box, __assign({ loading: firstLoad.current && loading, sx: {
103
+ width: '100%',
104
+ minHeight: 618,
105
+ background: '#F7F8FA',
106
+ fontFamily: '"Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif',
107
+ } }, { children: content })));
108
+ });
109
+ AiReportRoot.displayName = 'AiReportRoot';
110
+ export default 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,79 @@
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 __read = (this && this.__read) || function (o, n) {
13
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
14
+ if (!m) return o;
15
+ var i = m.call(o), r, ar = [], e;
16
+ try {
17
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
18
+ }
19
+ catch (error) { e = { error: error }; }
20
+ finally {
21
+ try {
22
+ if (r && !r.done && (m = i["return"])) m.call(i);
23
+ }
24
+ finally { if (e) throw e.error; }
25
+ }
26
+ return ar;
27
+ };
28
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
29
+ import { PostInterviewEvaluation } from "../../../../services/ai-report";
30
+ import { Button, confirm, FormItem, Typography } from 'fbm-ui';
31
+ import { Box, Stack } from 'fbm-ui/lib/mui';
32
+ import { useCallback, useEffect, useMemo, useState } from 'react';
33
+ import { ModuleTitle } from '../ModuleTitle';
34
+ var Evaluate = function (_a) {
35
+ 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;
36
+ var _d = __read(useState(evaluation), 2), content = _d[0], setContent = _d[1];
37
+ var _e = __read(useState('show'), 2), internalMode = _e[0], setInternalMode = _e[1];
38
+ var handleChange = useCallback(function (e) {
39
+ var value = e.target.value;
40
+ setContent(value);
41
+ }, []);
42
+ var handleModeChange = useCallback(function () {
43
+ setInternalMode(internalMode === 'show' ? 'edit' : 'show');
44
+ }, [internalMode]);
45
+ var isValidate = useMemo(function () {
46
+ return content.trim().length > 0;
47
+ }, [content]);
48
+ var handleSubmit = useCallback(function () {
49
+ if (!isValidate)
50
+ return;
51
+ confirm({
52
+ header: null,
53
+ content: '确认将评价内容修改吗?该动作无法被撤销。',
54
+ okText: '修改',
55
+ okProps: {
56
+ color: 'error',
57
+ variant: 'contained',
58
+ },
59
+ onOk: function (_a) {
60
+ var onClose = _a.onClose;
61
+ var data = {
62
+ orderToken: orderToken,
63
+ manualEvaluation: content,
64
+ };
65
+ PostInterviewEvaluation(data).then(handleModeChange).then(onClose).catch(console.error);
66
+ },
67
+ });
68
+ }, [isValidate, orderToken, content, handleModeChange]);
69
+ useEffect(function () {
70
+ setInternalMode(mode);
71
+ }, [mode]);
72
+ return (_jsxs(Stack, __assign({ sx: {
73
+ mt: 3,
74
+ } }, { children: [_jsx(Box, __assign({ mb: 1, position: "relative" }, { children: _jsx(ModuleTitle, { title: title, action: canEdit ? (_jsx("img", { onClick: handleModeChange, src: "https://webcdn.fbmms.cn/assets/pWED/KpgryvNScI7XZdjNBgTNC", alt: "", style: { width: 24, height: 24, cursor: 'pointer' } })) : undefined }) })), internalMode === 'edit' && (_jsxs(Box, __assign({ width: 1, pr: 2 }, { children: [_jsx(FormItem, { sx: { height: 'auto', pr: 0 }, multiline: true, rows: 3.5, required: true, name: "name", placeholder: "", value: content, onChange: handleChange, error: !isValidate }), _jsxs(Stack, __assign({ boxSizing: "border-box", mr: 2, mt: 1, spacing: 1, direction: "row", width: 1, justifyContent: "flex-end" }, { children: [_jsx(Button, __assign({ size: "medium", variant: "text", color: "secondary", onClick: function () {
75
+ handleModeChange();
76
+ setContent(evaluation);
77
+ } }, { children: "\u53D6\u6D88" })), _jsx(Button, __assign({ size: "medium", onClick: handleSubmit }, { children: "\u4FDD\u5B58" }))] }))] }))), internalMode === 'show' && (_jsx(Box, __assign({ sx: { border: '1px solid #EBFCF7', borderRadius: 2, padding: '12px 16px', background: '#fff' } }, { children: _jsx(Typography, __assign({ variant: "body2", color: "textSecondary", sx: { whiteSpace: 'pre-wrap', fontSize: 14, lineHeight: 1.8 } }, { children: content })) })))] })));
78
+ };
79
+ export 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,272 @@
1
+ var __read = (this && this.__read) || function (o, n) {
2
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
3
+ if (!m) return o;
4
+ var i = m.call(o), r, ar = [], e;
5
+ try {
6
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
7
+ }
8
+ catch (error) { e = { error: error }; }
9
+ finally {
10
+ try {
11
+ if (r && !r.done && (m = i["return"])) m.call(i);
12
+ }
13
+ finally { if (e) throw e.error; }
14
+ }
15
+ return ar;
16
+ };
17
+ import { jsx as _jsx } from "react/jsx-runtime";
18
+ import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
19
+ function setupCanvas(canvas) {
20
+ var dpr = window.devicePixelRatio || 1;
21
+ var rect = canvas.getBoundingClientRect();
22
+ canvas.width = rect.width * dpr;
23
+ canvas.height = rect.height * dpr;
24
+ var ctx = canvas.getContext('2d');
25
+ ctx.scale(dpr, dpr);
26
+ return ctx;
27
+ }
28
+ // interface GradeColor {
29
+ // Bad: Array<number>;
30
+ // Good: Array<number>;
31
+ // Best: Array<number>;
32
+ // }
33
+ var MAX_WIDTH = 315;
34
+ var MAX_HEIGHT = 24;
35
+ var levelOrder = ['Bad', 'Good', 'Best'];
36
+ var levelOrderScore = [0, 60, 80, 100];
37
+ var levelConf = {
38
+ Bad: {
39
+ label: '欠佳',
40
+ width: (MAX_WIDTH * 0.6) | 0,
41
+ fontColor: '#0D67FF',
42
+ color: [229, 115, 115],
43
+ gradient: ['#629CFF', 'rgba(75,141,255,0.08)'],
44
+ scoreGradient: ['#4B87F0', '#D2E2FF'],
45
+ backgroundColor: 'rgba(98,156,255,0.15)',
46
+ shadowColor: 'rgba(98, 156, 255, 0.40)',
47
+ endScore: 60,
48
+ pointColor: ['RGB(229, 115, 115)', 'RGB(255, 67, 102)'],
49
+ },
50
+ Good: {
51
+ label: '适中',
52
+ width: (MAX_WIDTH * 0.2) | 0,
53
+ fontColor: '#00A276',
54
+ color: [255, 183, 77],
55
+ gradient: ['#00D99D', '#CBFFF1'],
56
+ scoreGradient: ['#0ACB96', '#65FFD4'],
57
+ backgroundColor: 'rgba(0,217,157,0.15)',
58
+ shadowColor: 'rgba(0, 217, 157, 0.40)',
59
+ endScore: 80,
60
+ pointColor: ['RGB(255, 183, 77)', 'RGB(255, 152, 0)'],
61
+ },
62
+ Best: {
63
+ label: '优秀',
64
+ width: (MAX_WIDTH * 0.2) | 0,
65
+ fontColor: '#DF8500',
66
+ color: [0, 217, 157],
67
+ gradient: ['#FF9903', 'rgba(255,218,165,0.29)'],
68
+ scoreGradient: ['#FF9903', '#FFDF9D'],
69
+ shadowColor: 'rgba(255, 153, 3, 0.40)',
70
+ backgroundColor: 'rgba(255,183,77,0.15)',
71
+ endScore: 100,
72
+ pointColor: ['RGB(0, 217, 157)', 'RGB(0, 176, 127)'],
73
+ },
74
+ };
75
+ var tipEl = document.createElement('div');
76
+ var measureTextWidth = function (ctx, text) {
77
+ var width = ctx.measureText(text).width;
78
+ return width;
79
+ };
80
+ function isInPath(x, y, rect, ctx) {
81
+ var dpr = window.devicePixelRatio || 1;
82
+ ctx.beginPath();
83
+ ctx.rect(0, rect.y / dpr, rect.width / dpr, rect.height / dpr);
84
+ var ret = ctx.isPointInPath(x, y);
85
+ ctx.closePath();
86
+ return ret;
87
+ }
88
+ var drawTop = function (layout, ctx) {
89
+ // 设置全局样式
90
+ var leftLableWidth = layout.leftLableWidth, height = layout.height;
91
+ var offset = leftLableWidth;
92
+ var lineEndY = height - 40; // 虚线结束位置,距离底部40px
93
+ var scoreTextY = height - 25; // 分数文字的Y位置,距离底部25px
94
+ levelOrder.forEach(function (level, i) {
95
+ var _a = levelConf[level], width = _a.width, gradient = _a.gradient, label = _a.label, fontColor = _a.fontColor;
96
+ // 绘制渐变背景
97
+ var gradientFill = ctx.createLinearGradient(0, 0, 0, 25);
98
+ gradientFill.addColorStop(0, gradient[0]);
99
+ gradientFill.addColorStop(1, gradient[1]);
100
+ ctx.fillStyle = gradientFill;
101
+ ctx.fillRect(offset, 0, width, 25);
102
+ // 绘制标签文本
103
+ var labelWidth = measureTextWidth(ctx, label);
104
+ ctx.fillStyle = fontColor;
105
+ ctx.fillText(label, offset + width / 2 - labelWidth / 2, 18);
106
+ // 绘制垂直虚线
107
+ drawVerticalDashedLine(ctx, offset - 1, 0, lineEndY, 2, 2);
108
+ // 绘制分数文本
109
+ ctx.fillStyle = '#4CAF50';
110
+ ctx.fillText("".concat(levelOrderScore[i]), offset - (i === 0 ? 5 : 9), scoreTextY);
111
+ offset += width + 1;
112
+ // 绘制结束的虚线和文本 '100'
113
+ if (i === levelOrder.length - 1) {
114
+ drawVerticalDashedLine(ctx, offset - 2, 0, lineEndY, 2, 2);
115
+ ctx.fillText('100', offset - 2 - 24, scoreTextY);
116
+ }
117
+ });
118
+ };
119
+ var truncateString = function (str) { return (str.length > 7 ? "".concat(str.slice(0, 6), "...") : str); };
120
+ var drawLable = function (lable, x, y, ctx) {
121
+ ctx.fillStyle = 'rgba(0, 0, 0, 0.55)';
122
+ ctx.fillText(truncateString(lable), x, y + 5);
123
+ };
124
+ function drawVerticalDashedLine(ctx, x, startY, endY, dashLength, gapLength) {
125
+ if (dashLength === void 0) { dashLength = 2; }
126
+ if (gapLength === void 0) { gapLength = 1; }
127
+ ctx.lineWidth = 1;
128
+ ctx.strokeStyle = 'rgba(76, 175, 80, 0.30)';
129
+ ctx.beginPath();
130
+ ctx.setLineDash([dashLength, gapLength]);
131
+ ctx.moveTo(x, startY);
132
+ ctx.lineTo(x, endY);
133
+ ctx.stroke();
134
+ ctx.setLineDash([]); // 重置为实线
135
+ }
136
+ var drawRoundedRect = function (x, y, width, height, r, fill, stroke, ctx) {
137
+ ctx.save();
138
+ ctx.beginPath();
139
+ ctx.moveTo(x + r, y);
140
+ ctx.arcTo(x + width, y, x + width, y + r, r);
141
+ ctx.arcTo(x + width, y + height, x + width - r, y + height, r);
142
+ ctx.arcTo(x, y + height, x, y + height - r, r);
143
+ ctx.arcTo(x, y, x + r, y, r);
144
+ if (fill) {
145
+ ctx.fill();
146
+ }
147
+ if (stroke) {
148
+ ctx.stroke();
149
+ }
150
+ ctx.restore();
151
+ };
152
+ export function getLevel(score) {
153
+ if (score < 60) {
154
+ return levelConf.Bad;
155
+ }
156
+ else if (score < 80) {
157
+ return levelConf.Good;
158
+ }
159
+ else {
160
+ return levelConf.Best;
161
+ }
162
+ }
163
+ var drawScore = function (layout, ctx, config, rect, score) {
164
+ var gradient = ctx.createLinearGradient(layout.leftLableWidth + rect.width, 30, layout.leftLableWidth, 30);
165
+ gradient.addColorStop(0, config.scoreGradient[0]);
166
+ gradient.addColorStop(1, config.scoreGradient[1]);
167
+ ctx.fillStyle = gradient;
168
+ // // 设置阴影
169
+ ctx.shadowOffsetX = 0;
170
+ ctx.shadowOffsetY = 4;
171
+ ctx.shadowBlur = 6;
172
+ // ctx.shadowColor = config.shadowColor;
173
+ // 绘制圆角矩形
174
+ var borderRadius = 12;
175
+ drawRoundedRect(rect.x, rect.y, rect.width, rect.height, borderRadius, true, false, ctx);
176
+ ctx.fillStyle = score < 10 ? '#0D67FF' : '#fff';
177
+ var scoreWidth = measureTextWidth(ctx, "".concat(score));
178
+ ctx.fillText("".concat(score), layout.leftLableWidth + rect.width + (score < 10 ? 4 : -scoreWidth - 4), rect.y + 18);
179
+ };
180
+ var draw = function (layout, dimensions, pathRef, ctx) {
181
+ ctx.font = '14px sans-serif';
182
+ ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
183
+ dimensions.forEach(function (v, i) {
184
+ var config = getLevel(v.score);
185
+ // 绘制圆角矩形
186
+ var borderRadius = 12;
187
+ var x = layout.leftLableWidth;
188
+ var y = 50 + layout.itemSpacing * i;
189
+ // 设置背景颜色
190
+ ctx.fillStyle = config.backgroundColor;
191
+ drawRoundedRect(x, y, MAX_WIDTH, MAX_HEIGHT, borderRadius, true, false, ctx);
192
+ var endPointY = 50 + 15 + layout.itemSpacing * i; // 50是顶部偏移,15是文字相对矩形的偏移
193
+ drawLable(v.name, 0, endPointY, ctx);
194
+ pathRef.push({ x: 0, y: y, width: layout.leftLableWidth, height: 22, tips: "".concat(v.name, ": ").concat(v.score) });
195
+ var score = v.score === 0 ? 0 : Math.max(v.score, 4);
196
+ drawScore(layout, ctx, config, {
197
+ x: layout.leftLableWidth,
198
+ y: y,
199
+ width: MAX_WIDTH * (score / 100),
200
+ height: MAX_HEIGHT,
201
+ }, v.score);
202
+ });
203
+ drawTop(layout, ctx);
204
+ };
205
+ var Graph = function (_a) {
206
+ var _b = _a.items, items = _b === void 0 ? [] : _b;
207
+ var ref = useRef(null);
208
+ var pathRef = useRef([]);
209
+ var _c = __read(useState(), 2), ctx = _c[0], setCtx = _c[1];
210
+ // 统一间距配置
211
+ var ITEM_SPACING = 40;
212
+ var TOP_OFFSET = 50;
213
+ var BOTTOM_SPACING = 20; // 最后一个item与虚线之间的间距
214
+ var SCORE_AREA_HEIGHT = 40; // 分数区域的高度
215
+ var height = useMemo(function () {
216
+ if (items.length === 0)
217
+ return 0;
218
+ return TOP_OFFSET + (items.length - 1) * ITEM_SPACING + MAX_HEIGHT + BOTTOM_SPACING + SCORE_AREA_HEIGHT;
219
+ }, [items]);
220
+ useEffect(function () {
221
+ if (items.length === 0)
222
+ return;
223
+ var currentCtx = setupCanvas(ref.current);
224
+ setCtx(currentCtx);
225
+ tipEl.style.background = 'rgba(0,0,0,.7)';
226
+ tipEl.style.color = '#fff';
227
+ tipEl.style.borderRadius = '2px';
228
+ tipEl.style.padding = '2px 5px';
229
+ tipEl.style.position = 'absolute';
230
+ tipEl.style.zIndex = '9999';
231
+ tipEl.style.fontSize = '12px';
232
+ tipEl.style.display = 'none';
233
+ document.body.appendChild(tipEl);
234
+ // Clean up the tooltip element when items change
235
+ return function () {
236
+ if (tipEl.parentNode) {
237
+ tipEl.parentNode.removeChild(tipEl);
238
+ }
239
+ };
240
+ }, [ref, items]);
241
+ useEffect(function () {
242
+ if (ctx) {
243
+ var layout = {
244
+ leftLableWidth: 140,
245
+ topLableHeight: 40,
246
+ itemSpacing: ITEM_SPACING,
247
+ height: height,
248
+ };
249
+ pathRef.current = [];
250
+ draw(layout, items, pathRef.current, ctx);
251
+ }
252
+ }, [ctx, items, height, ITEM_SPACING]);
253
+ // useEffect(() => {
254
+ // console.log(pathRef);
255
+ // }, [pathRef]);
256
+ var handleMouseMove = useCallback(function (e) {
257
+ if (ctx) {
258
+ var p = pathRef.current.find(function (p) { return isInPath(e.nativeEvent.offsetX, e.nativeEvent.offsetY, p, ctx); });
259
+ if (p) {
260
+ tipEl.style.left = e.pageX + 10 + 'px';
261
+ tipEl.style.top = e.pageY + 10 + 'px';
262
+ tipEl.innerHTML = p.tips;
263
+ tipEl.style.display = 'block';
264
+ }
265
+ else {
266
+ tipEl.style.display = 'none';
267
+ }
268
+ }
269
+ }, [ctx, pathRef]);
270
+ return _jsx("canvas", { ref: ref, onMouseOut: function () { return (tipEl.style.display = 'none'); }, onMouseMove: handleMouseMove, style: { width: 460, height: height } });
271
+ };
272
+ export default memo(Graph);
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const _default: import("react").MemoExoticComponent<() => JSX.Element | null>;
3
+ export default _default;
@@ -0,0 +1,32 @@
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
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import Report from '../ScoreReport/Report';
14
+ import Evaluate from './Evaluate';
15
+ import Graph from './Graph';
16
+ import { useAiReportStore } from "../../../../store/ai-report/global-store";
17
+ import { Box, Paper, Stack } from 'fbm-ui/lib/mui';
18
+ import { memo, useMemo } from 'react';
19
+ var Index = function () {
20
+ var _a = useAiReportStore(function (store) { return [store.reportResult, store.operableButtons]; }), reportResult = _a.reportResult, showAiDimension = _a.showAiDimension, canEditAiDimension = _a.canEditAiDimension;
21
+ var _b = reportResult || {}, _c = _b.collection, collection = _c === void 0 ? [] : _c, _d = _b.workplaceEvaluation, workplaceEvaluation = _d === void 0 ? '' : _d, _e = _b.orderToken, orderToken = _e === void 0 ? '' : _e;
22
+ var items = useMemo(function () {
23
+ return collection.map(function (item) { return ({
24
+ name: item.name,
25
+ score: item.avgScore,
26
+ }); });
27
+ }, [collection]);
28
+ if (!showAiDimension)
29
+ return null;
30
+ return (_jsx(Box, __assign({ id: "report-evaluate", sx: { px: 2, mt: 3 } }, { children: _jsx(Box, __assign({ component: Paper, elevation: 0, bgcolor: "transparent", mb: 3 }, { children: _jsxs(Stack, { children: [workplaceEvaluation && (_jsx(Evaluate, { orderToken: orderToken, canEdit: canEditAiDimension, evaluation: workplaceEvaluation, title: "\u7EFC\u5408\u8BC4\u4EF7", mode: "show" })), collection.length > 0 && (_jsxs(Stack, __assign({ direction: "row", alignItems: "center", justifyContent: "space-between" }, { children: [_jsx(Box, __assign({ mt: 2, flex: 1 }, { children: _jsx(Graph, { items: items }) })), _jsx(Report, {})] })))] }) })) })));
31
+ };
32
+ export default memo(Index);
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { CandidateInfo } from './Interface';
3
+ interface FormProps {
4
+ fetchCandidateInfo: () => Promise<CandidateInfo>;
5
+ }
6
+ declare const _default: import("react").NamedExoticComponent<FormProps>;
7
+ export default _default;