eli-video-interview 1.4.7 → 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.
- package/esm/components/Charts/ReportPie.js +2 -2
- package/esm/index.d.ts +2 -0
- package/esm/index.js +2 -0
- package/esm/modules/ai-question/Root.js +13 -13
- package/esm/modules/ai-question/components/AiAssessmentCriteria/const.d.ts +4 -0
- package/esm/modules/ai-question/components/AiAssessmentCriteria/const.js +4 -0
- package/esm/modules/ai-question/components/AiAssessmentCriteria/index.js +2 -5
- package/esm/modules/ai-question/components/QuestionUpdate/AudioUploader.d.ts +6 -0
- package/esm/modules/ai-question/components/QuestionUpdate/AudioUploader.js +74 -0
- package/esm/modules/ai-question/components/QuestionUpdate/Form.js +16 -5
- package/esm/modules/ai-question/components/QuestionUpdate/const.js +1 -1
- package/esm/modules/ai-question/components/QuestionUpdate/interface.d.ts +3 -1
- package/esm/modules/ai-report/components/AIEvaluate/index.js +1 -1
- package/esm/modules/ai-report/interface.d.ts +28 -0
- package/esm/modules/ai-report-v3/Root.d.ts +4 -0
- package/esm/modules/ai-report-v3/Root.js +110 -0
- package/esm/modules/ai-report-v3/components/AIEvaluate/Evaluate.d.ts +11 -0
- package/esm/modules/ai-report-v3/components/AIEvaluate/Evaluate.js +79 -0
- package/esm/modules/ai-report-v3/components/AIEvaluate/Graph.d.ts +22 -0
- package/esm/modules/ai-report-v3/components/AIEvaluate/Graph.js +272 -0
- package/esm/modules/ai-report-v3/components/AIEvaluate/index.d.ts +3 -0
- package/esm/modules/ai-report-v3/components/AIEvaluate/index.js +32 -0
- package/esm/modules/ai-report-v3/components/Candidate/Candidate.d.ts +7 -0
- package/esm/modules/ai-report-v3/components/Candidate/Candidate.js +55 -0
- package/esm/modules/ai-report-v3/components/Candidate/Interface.d.ts +16 -0
- package/esm/modules/ai-report-v3/components/Candidate/Interface.js +1 -0
- package/esm/modules/ai-report-v3/components/Candidate/Podium.d.ts +6 -0
- package/esm/modules/ai-report-v3/components/Candidate/Podium.js +50 -0
- package/esm/modules/ai-report-v3/components/Candidate/index.d.ts +2 -0
- package/esm/modules/ai-report-v3/components/Candidate/index.js +2 -0
- package/esm/modules/ai-report-v3/components/CapabilityTable/CapabilityTable.d.ts +3 -0
- package/esm/modules/ai-report-v3/components/CapabilityTable/CapabilityTable.js +62 -0
- package/esm/modules/ai-report-v3/components/CheatRisk/CheatRisk.d.ts +3 -0
- package/esm/modules/ai-report-v3/components/CheatRisk/CheatRisk.js +42 -0
- package/esm/modules/ai-report-v3/components/Form/Form.d.ts +23 -0
- package/esm/modules/ai-report-v3/components/Form/Form.js +67 -0
- package/esm/modules/ai-report-v3/components/Form/Forms.d.ts +9 -0
- package/esm/modules/ai-report-v3/components/Form/Forms.js +45 -0
- package/esm/modules/ai-report-v3/components/Form/Nps.d.ts +6 -0
- package/esm/modules/ai-report-v3/components/Form/Nps.js +57 -0
- package/esm/modules/ai-report-v3/components/Form/index.d.ts +1 -0
- package/esm/modules/ai-report-v3/components/Form/index.js +1 -0
- package/esm/modules/ai-report-v3/components/Form/interface.d.ts +57 -0
- package/esm/modules/ai-report-v3/components/Form/interface.js +1 -0
- package/esm/modules/ai-report-v3/components/MenuAnchor/index.d.ts +4 -0
- package/esm/modules/ai-report-v3/components/MenuAnchor/index.js +130 -0
- package/esm/modules/ai-report-v3/components/ModuleTitle.d.ts +5 -0
- package/esm/modules/ai-report-v3/components/ModuleTitle.js +24 -0
- package/esm/modules/ai-report-v3/components/NotFinish/index.d.ts +3 -0
- package/esm/modules/ai-report-v3/components/NotFinish/index.js +32 -0
- package/esm/modules/ai-report-v3/components/RankingRange/Item.d.ts +4 -0
- package/esm/modules/ai-report-v3/components/RankingRange/Item.js +46 -0
- package/esm/modules/ai-report-v3/components/RankingRange/index.d.ts +4 -0
- package/esm/modules/ai-report-v3/components/RankingRange/index.js +187 -0
- package/esm/modules/ai-report-v3/components/RankingRange/interface.d.ts +26 -0
- package/esm/modules/ai-report-v3/components/RankingRange/interface.js +1 -0
- package/esm/modules/ai-report-v3/components/RankingRange/styled.d.ts +7 -0
- package/esm/modules/ai-report-v3/components/RankingRange/styled.js +11 -0
- package/esm/modules/ai-report-v3/components/ReportHeader/ReportHeader.d.ts +17 -0
- package/esm/modules/ai-report-v3/components/ReportHeader/ReportHeader.js +105 -0
- package/esm/modules/ai-report-v3/components/ScoreReport/Bar.d.ts +6 -0
- package/esm/modules/ai-report-v3/components/ScoreReport/Bar.js +68 -0
- package/esm/modules/ai-report-v3/components/ScoreReport/Failed.d.ts +4 -0
- package/esm/modules/ai-report-v3/components/ScoreReport/Failed.js +33 -0
- package/esm/modules/ai-report-v3/components/ScoreReport/RecommendIcon.d.ts +3 -0
- package/esm/modules/ai-report-v3/components/ScoreReport/RecommendIcon.js +17 -0
- package/esm/modules/ai-report-v3/components/ScoreReport/Report.d.ts +3 -0
- package/esm/modules/ai-report-v3/components/ScoreReport/Report.js +22 -0
- package/esm/modules/ai-report-v3/components/ScoreReport/Score.d.ts +4 -0
- package/esm/modules/ai-report-v3/components/ScoreReport/Score.js +83 -0
- package/esm/modules/ai-report-v3/components/ScoreReport/ScoreLegend.d.ts +4 -0
- package/esm/modules/ai-report-v3/components/ScoreReport/ScoreLegend.js +33 -0
- package/esm/modules/ai-report-v3/components/ScoreReport/Tips.d.ts +3 -0
- package/esm/modules/ai-report-v3/components/ScoreReport/Tips.js +18 -0
- package/esm/modules/ai-report-v3/components/ScoreReport/index.d.ts +4 -0
- package/esm/modules/ai-report-v3/components/ScoreReport/index.js +39 -0
- package/esm/modules/ai-report-v3/components/ScoreReport/interface.d.ts +20 -0
- package/esm/modules/ai-report-v3/components/ScoreReport/interface.js +1 -0
- package/esm/modules/ai-report-v3/components/ScoreReport/styled.d.ts +22 -0
- package/esm/modules/ai-report-v3/components/ScoreReport/styled.js +21 -0
- package/esm/modules/ai-report-v3/components/SectionTabs/SectionTabs.d.ts +11 -0
- package/esm/modules/ai-report-v3/components/SectionTabs/SectionTabs.js +114 -0
- package/esm/modules/ai-report-v3/components/Suggestion/Suggestion.d.ts +4 -0
- package/esm/modules/ai-report-v3/components/Suggestion/Suggestion.js +31 -0
- package/esm/modules/ai-report-v3/components/Suggestion/index.d.ts +3 -0
- package/esm/modules/ai-report-v3/components/Suggestion/index.js +27 -0
- package/esm/modules/ai-report-v3/components/V3Header/V3Header.d.ts +11 -0
- package/esm/modules/ai-report-v3/components/V3Header/V3Header.js +154 -0
- package/esm/modules/ai-report-v3/components/VideoQuestion/Abilities.d.ts +4 -0
- package/esm/modules/ai-report-v3/components/VideoQuestion/Abilities.js +42 -0
- package/esm/modules/ai-report-v3/components/VideoQuestion/BodyImages.d.ts +7 -0
- package/esm/modules/ai-report-v3/components/VideoQuestion/BodyImages.js +56 -0
- package/esm/modules/ai-report-v3/components/VideoQuestion/Evaluate.d.ts +11 -0
- package/esm/modules/ai-report-v3/components/VideoQuestion/Evaluate.js +79 -0
- package/esm/modules/ai-report-v3/components/VideoQuestion/QuestionItem.d.ts +4 -0
- package/esm/modules/ai-report-v3/components/VideoQuestion/QuestionItem.js +145 -0
- package/esm/modules/ai-report-v3/components/VideoQuestion/ScoreSlider.d.ts +4 -0
- package/esm/modules/ai-report-v3/components/VideoQuestion/ScoreSlider.js +47 -0
- package/esm/modules/ai-report-v3/components/VideoQuestion/SingleChoice.d.ts +8 -0
- package/esm/modules/ai-report-v3/components/VideoQuestion/SingleChoice.js +31 -0
- package/esm/modules/ai-report-v3/components/VideoQuestion/Workplaces.d.ts +10 -0
- package/esm/modules/ai-report-v3/components/VideoQuestion/Workplaces.js +91 -0
- package/esm/modules/ai-report-v3/components/VideoQuestion/index.d.ts +6 -0
- package/esm/modules/ai-report-v3/components/VideoQuestion/index.js +24 -0
- package/esm/modules/ai-report-v3/components/VideoQuestion/interface.d.ts +17 -0
- package/esm/modules/ai-report-v3/components/VideoQuestion/interface.js +1 -0
- package/esm/modules/ai-report-v3/components/VideoQuestion/styled.d.ts +72 -0
- package/esm/modules/ai-report-v3/components/VideoQuestion/styled.js +93 -0
- package/esm/modules/ai-report-v3/components/WorkPlaces/ScoreSlider.d.ts +4 -0
- package/esm/modules/ai-report-v3/components/WorkPlaces/ScoreSlider.js +24 -0
- package/esm/modules/ai-report-v3/components/WorkPlaces/WorkPlace.d.ts +12 -0
- package/esm/modules/ai-report-v3/components/WorkPlaces/WorkPlace.js +72 -0
- package/esm/modules/ai-report-v3/components/WorkPlaces/index.d.ts +3 -0
- package/esm/modules/ai-report-v3/components/WorkPlaces/index.js +70 -0
- package/esm/modules/ai-report-v3/components/WorkPlaces/interface.d.ts +7 -0
- package/esm/modules/ai-report-v3/components/WorkPlaces/interface.js +1 -0
- package/esm/modules/ai-report-v3/components/WorkPlaces/styled.d.ts +62 -0
- package/esm/modules/ai-report-v3/components/WorkPlaces/styled.js +27 -0
- package/esm/modules/ai-report-v3/components/styled.d.ts +42 -0
- package/esm/modules/ai-report-v3/components/styled.js +140 -0
- package/esm/modules/ai-report-v3/index.d.ts +4 -0
- package/esm/modules/ai-report-v3/index.js +20 -0
- package/esm/modules/ai-report-v3/interface.d.ts +257 -0
- package/esm/modules/ai-report-v3/interface.js +1 -0
- package/esm/modules/ai-report-v3/useAiReport.d.ts +37 -0
- package/esm/modules/ai-report-v3/useAiReport.js +18 -0
- package/esm/modules/ai-report-v3/useAiReportVersion.d.ts +5 -0
- package/esm/modules/ai-report-v3/useAiReportVersion.js +45 -0
- package/esm/modules/ai-report-v3/utils.d.ts +1 -0
- package/esm/modules/ai-report-v3/utils.js +1 -0
- package/lib/components/Charts/ReportPie.js +2 -2
- package/lib/index.d.ts +2 -0
- package/lib/index.js +5 -1
- package/lib/modules/ai-question/Root.js +13 -13
- package/lib/modules/ai-question/components/AiAssessmentCriteria/const.d.ts +4 -0
- package/lib/modules/ai-question/components/AiAssessmentCriteria/const.js +5 -1
- package/lib/modules/ai-question/components/AiAssessmentCriteria/index.js +1 -4
- package/lib/modules/ai-question/components/QuestionUpdate/AudioUploader.d.ts +6 -0
- package/lib/modules/ai-question/components/QuestionUpdate/AudioUploader.js +76 -0
- package/lib/modules/ai-question/components/QuestionUpdate/Form.js +18 -7
- package/lib/modules/ai-question/components/QuestionUpdate/const.js +1 -1
- package/lib/modules/ai-question/components/QuestionUpdate/interface.d.ts +3 -1
- package/lib/modules/ai-report/components/AIEvaluate/index.js +1 -1
- package/lib/modules/ai-report/interface.d.ts +28 -0
- package/lib/modules/ai-report-v3/Root.d.ts +4 -0
- package/lib/modules/ai-report-v3/Root.js +115 -0
- package/lib/modules/ai-report-v3/components/AIEvaluate/Evaluate.d.ts +11 -0
- package/lib/modules/ai-report-v3/components/AIEvaluate/Evaluate.js +81 -0
- package/lib/modules/ai-report-v3/components/AIEvaluate/Graph.d.ts +22 -0
- package/lib/modules/ai-report-v3/components/AIEvaluate/Graph.js +276 -0
- package/lib/modules/ai-report-v3/components/AIEvaluate/index.d.ts +3 -0
- package/lib/modules/ai-report-v3/components/AIEvaluate/index.js +37 -0
- package/lib/modules/ai-report-v3/components/Candidate/Candidate.d.ts +7 -0
- package/lib/modules/ai-report-v3/components/Candidate/Candidate.js +57 -0
- package/lib/modules/ai-report-v3/components/Candidate/Interface.d.ts +16 -0
- package/lib/modules/ai-report-v3/components/Candidate/Interface.js +2 -0
- package/lib/modules/ai-report-v3/components/Candidate/Podium.d.ts +6 -0
- package/lib/modules/ai-report-v3/components/Candidate/Podium.js +52 -0
- package/lib/modules/ai-report-v3/components/Candidate/index.d.ts +2 -0
- package/lib/modules/ai-report-v3/components/Candidate/index.js +10 -0
- package/lib/modules/ai-report-v3/components/CapabilityTable/CapabilityTable.d.ts +3 -0
- package/lib/modules/ai-report-v3/components/CapabilityTable/CapabilityTable.js +64 -0
- package/lib/modules/ai-report-v3/components/CheatRisk/CheatRisk.d.ts +3 -0
- package/lib/modules/ai-report-v3/components/CheatRisk/CheatRisk.js +44 -0
- package/lib/modules/ai-report-v3/components/Form/Form.d.ts +23 -0
- package/lib/modules/ai-report-v3/components/Form/Form.js +73 -0
- package/lib/modules/ai-report-v3/components/Form/Forms.d.ts +9 -0
- package/lib/modules/ai-report-v3/components/Form/Forms.js +50 -0
- package/lib/modules/ai-report-v3/components/Form/Nps.d.ts +6 -0
- package/lib/modules/ai-report-v3/components/Form/Nps.js +59 -0
- package/lib/modules/ai-report-v3/components/Form/index.d.ts +1 -0
- package/lib/modules/ai-report-v3/components/Form/index.js +8 -0
- package/lib/modules/ai-report-v3/components/Form/interface.d.ts +57 -0
- package/lib/modules/ai-report-v3/components/Form/interface.js +2 -0
- package/lib/modules/ai-report-v3/components/MenuAnchor/index.d.ts +4 -0
- package/lib/modules/ai-report-v3/components/MenuAnchor/index.js +132 -0
- package/lib/modules/ai-report-v3/components/ModuleTitle.d.ts +5 -0
- package/lib/modules/ai-report-v3/components/ModuleTitle.js +28 -0
- package/lib/modules/ai-report-v3/components/NotFinish/index.d.ts +3 -0
- package/lib/modules/ai-report-v3/components/NotFinish/index.js +34 -0
- package/lib/modules/ai-report-v3/components/RankingRange/Item.d.ts +4 -0
- package/lib/modules/ai-report-v3/components/RankingRange/Item.js +48 -0
- package/lib/modules/ai-report-v3/components/RankingRange/index.d.ts +4 -0
- package/lib/modules/ai-report-v3/components/RankingRange/index.js +192 -0
- package/lib/modules/ai-report-v3/components/RankingRange/interface.d.ts +26 -0
- package/lib/modules/ai-report-v3/components/RankingRange/interface.js +2 -0
- package/lib/modules/ai-report-v3/components/RankingRange/styled.d.ts +7 -0
- package/lib/modules/ai-report-v3/components/RankingRange/styled.js +14 -0
- package/lib/modules/ai-report-v3/components/ReportHeader/ReportHeader.d.ts +17 -0
- package/lib/modules/ai-report-v3/components/ReportHeader/ReportHeader.js +110 -0
- package/lib/modules/ai-report-v3/components/ScoreReport/Bar.d.ts +6 -0
- package/lib/modules/ai-report-v3/components/ScoreReport/Bar.js +70 -0
- package/lib/modules/ai-report-v3/components/ScoreReport/Failed.d.ts +4 -0
- package/lib/modules/ai-report-v3/components/ScoreReport/Failed.js +34 -0
- package/lib/modules/ai-report-v3/components/ScoreReport/RecommendIcon.d.ts +3 -0
- package/lib/modules/ai-report-v3/components/ScoreReport/RecommendIcon.js +22 -0
- package/lib/modules/ai-report-v3/components/ScoreReport/Report.d.ts +3 -0
- package/lib/modules/ai-report-v3/components/ScoreReport/Report.js +27 -0
- package/lib/modules/ai-report-v3/components/ScoreReport/Score.d.ts +4 -0
- package/lib/modules/ai-report-v3/components/ScoreReport/Score.js +86 -0
- package/lib/modules/ai-report-v3/components/ScoreReport/ScoreLegend.d.ts +4 -0
- package/lib/modules/ai-report-v3/components/ScoreReport/ScoreLegend.js +35 -0
- package/lib/modules/ai-report-v3/components/ScoreReport/Tips.d.ts +3 -0
- package/lib/modules/ai-report-v3/components/ScoreReport/Tips.js +20 -0
- package/lib/modules/ai-report-v3/components/ScoreReport/index.d.ts +4 -0
- package/lib/modules/ai-report-v3/components/ScoreReport/index.js +44 -0
- package/lib/modules/ai-report-v3/components/ScoreReport/interface.d.ts +20 -0
- package/lib/modules/ai-report-v3/components/ScoreReport/interface.js +2 -0
- package/lib/modules/ai-report-v3/components/ScoreReport/styled.d.ts +22 -0
- package/lib/modules/ai-report-v3/components/ScoreReport/styled.js +24 -0
- package/lib/modules/ai-report-v3/components/SectionTabs/SectionTabs.d.ts +11 -0
- package/lib/modules/ai-report-v3/components/SectionTabs/SectionTabs.js +116 -0
- package/lib/modules/ai-report-v3/components/Suggestion/Suggestion.d.ts +4 -0
- package/lib/modules/ai-report-v3/components/Suggestion/Suggestion.js +33 -0
- package/lib/modules/ai-report-v3/components/Suggestion/index.d.ts +3 -0
- package/lib/modules/ai-report-v3/components/Suggestion/index.js +32 -0
- package/lib/modules/ai-report-v3/components/V3Header/V3Header.d.ts +11 -0
- package/lib/modules/ai-report-v3/components/V3Header/V3Header.js +159 -0
- package/lib/modules/ai-report-v3/components/VideoQuestion/Abilities.d.ts +4 -0
- package/lib/modules/ai-report-v3/components/VideoQuestion/Abilities.js +47 -0
- package/lib/modules/ai-report-v3/components/VideoQuestion/BodyImages.d.ts +7 -0
- package/lib/modules/ai-report-v3/components/VideoQuestion/BodyImages.js +61 -0
- package/lib/modules/ai-report-v3/components/VideoQuestion/Evaluate.d.ts +11 -0
- package/lib/modules/ai-report-v3/components/VideoQuestion/Evaluate.js +81 -0
- package/lib/modules/ai-report-v3/components/VideoQuestion/QuestionItem.d.ts +4 -0
- package/lib/modules/ai-report-v3/components/VideoQuestion/QuestionItem.js +150 -0
- package/lib/modules/ai-report-v3/components/VideoQuestion/ScoreSlider.d.ts +4 -0
- package/lib/modules/ai-report-v3/components/VideoQuestion/ScoreSlider.js +49 -0
- package/lib/modules/ai-report-v3/components/VideoQuestion/SingleChoice.d.ts +8 -0
- package/lib/modules/ai-report-v3/components/VideoQuestion/SingleChoice.js +33 -0
- package/lib/modules/ai-report-v3/components/VideoQuestion/Workplaces.d.ts +10 -0
- package/lib/modules/ai-report-v3/components/VideoQuestion/Workplaces.js +93 -0
- package/lib/modules/ai-report-v3/components/VideoQuestion/index.d.ts +6 -0
- package/lib/modules/ai-report-v3/components/VideoQuestion/index.js +29 -0
- package/lib/modules/ai-report-v3/components/VideoQuestion/interface.d.ts +17 -0
- package/lib/modules/ai-report-v3/components/VideoQuestion/interface.js +2 -0
- package/lib/modules/ai-report-v3/components/VideoQuestion/styled.d.ts +72 -0
- package/lib/modules/ai-report-v3/components/VideoQuestion/styled.js +96 -0
- package/lib/modules/ai-report-v3/components/WorkPlaces/ScoreSlider.d.ts +4 -0
- package/lib/modules/ai-report-v3/components/WorkPlaces/ScoreSlider.js +26 -0
- package/lib/modules/ai-report-v3/components/WorkPlaces/WorkPlace.d.ts +12 -0
- package/lib/modules/ai-report-v3/components/WorkPlaces/WorkPlace.js +74 -0
- package/lib/modules/ai-report-v3/components/WorkPlaces/index.d.ts +3 -0
- package/lib/modules/ai-report-v3/components/WorkPlaces/index.js +75 -0
- package/lib/modules/ai-report-v3/components/WorkPlaces/interface.d.ts +7 -0
- package/lib/modules/ai-report-v3/components/WorkPlaces/interface.js +2 -0
- package/lib/modules/ai-report-v3/components/WorkPlaces/styled.d.ts +62 -0
- package/lib/modules/ai-report-v3/components/WorkPlaces/styled.js +30 -0
- package/lib/modules/ai-report-v3/components/styled.d.ts +42 -0
- package/lib/modules/ai-report-v3/components/styled.js +146 -0
- package/lib/modules/ai-report-v3/index.d.ts +4 -0
- package/lib/modules/ai-report-v3/index.js +25 -0
- package/lib/modules/ai-report-v3/interface.d.ts +257 -0
- package/lib/modules/ai-report-v3/interface.js +2 -0
- package/lib/modules/ai-report-v3/useAiReport.d.ts +37 -0
- package/lib/modules/ai-report-v3/useAiReport.js +25 -0
- package/lib/modules/ai-report-v3/useAiReportVersion.d.ts +5 -0
- package/lib/modules/ai-report-v3/useAiReportVersion.js +49 -0
- package/lib/modules/ai-report-v3/utils.d.ts +1 -0
- package/lib/modules/ai-report-v3/utils.js +5 -0
- package/package.json +5 -5
|
@@ -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,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,55 @@
|
|
|
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 { DinTypography, ReportAvatar, ReportTag } from '../styled';
|
|
30
|
+
import { useAiReportStore } from "../../../../store/ai-report/global-store";
|
|
31
|
+
import { getSecondToTime } from "../../../../utils/utils";
|
|
32
|
+
import { Box, Message, Typography } from 'fbm-ui';
|
|
33
|
+
import { Stack } from 'fbm-ui/lib/mui';
|
|
34
|
+
import { memo, useEffect, useMemo, useState } from 'react';
|
|
35
|
+
var Form = function (_a) {
|
|
36
|
+
var fetchCandidateInfo = _a.fetchCandidateInfo;
|
|
37
|
+
var reportResult = useAiReportStore(function (store) { return [store.reportResult]; }).reportResult;
|
|
38
|
+
var steps = (reportResult || {}).steps;
|
|
39
|
+
var duration = useMemo(function () { return getSecondToTime((steps === null || steps === void 0 ? void 0 : steps.reduce(function (acc, cur) { return acc + cur.answer.media.durationTime; }, 0)) || 0); }, [steps]);
|
|
40
|
+
var _b = __read(useState({ name: '', mobile: '', processName: '', positionName: '', avatar: '', tags: [] }), 2), data = _b[0], setData = _b[1];
|
|
41
|
+
useEffect(function () {
|
|
42
|
+
if (fetchCandidateInfo) {
|
|
43
|
+
fetchCandidateInfo().then(setData).catch(Message.error);
|
|
44
|
+
}
|
|
45
|
+
}, [fetchCandidateInfo]);
|
|
46
|
+
var name = data.name, mobile = data.mobile, positionName = data.positionName, avatar = data.avatar, tags = data.tags;
|
|
47
|
+
return (_jsxs(Stack, __assign({ direction: "row", minHeight: 221, mt: 13.25 }, { children: [_jsx(ReportAvatar, { sx: { mx: 3 }, avatar: avatar }), _jsxs(Stack, __assign({ spacing: 1 }, { children: [_jsx(DinTypography, __assign({ sx: { fontSize: 18 } }, { children: positionName })), _jsxs(Typography, __assign({ variant: "body1" }, { children: [name, " ", mobile] })), _jsx(Box, __assign({ sx: {
|
|
48
|
+
display: 'flex',
|
|
49
|
+
flexWrap: 'wrap',
|
|
50
|
+
gap: '8px',
|
|
51
|
+
alignItems: 'flex-start',
|
|
52
|
+
width: '450px',
|
|
53
|
+
} }, { children: tags === null || tags === void 0 ? void 0 : tags.map(function (tag) { return (_jsx(ReportTag, { children: tag.name }, tag.token)); }) })), _jsxs(Typography, { children: ["\u9762\u8BD5\u65F6\u957F\uFF1A", duration] })] }))] })));
|
|
54
|
+
};
|
|
55
|
+
export default memo(Form);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface CandidateInfo {
|
|
2
|
+
avatar: string;
|
|
3
|
+
name: string;
|
|
4
|
+
mobile: string;
|
|
5
|
+
processName: string;
|
|
6
|
+
positionName: string;
|
|
7
|
+
tags: Tag[];
|
|
8
|
+
}
|
|
9
|
+
interface Tag {
|
|
10
|
+
name: string;
|
|
11
|
+
token: string;
|
|
12
|
+
}
|
|
13
|
+
export interface AiReportUrl {
|
|
14
|
+
url: string;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
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 { rankPercent } from '../../utils';
|
|
30
|
+
import { BeatProgressBar, DinTypography, Podium } from '../styled';
|
|
31
|
+
import { useAiReportStore } from "../../../../store/ai-report/global-store";
|
|
32
|
+
import { Typography } from 'fbm-ui';
|
|
33
|
+
import { Stack } from 'fbm-ui/lib/mui';
|
|
34
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
35
|
+
var Form = function () {
|
|
36
|
+
var _a = __read(useState(''), 2), text = _a[0], setText = _a[1];
|
|
37
|
+
var _b = useAiReportStore(function (store) { return [store.reportResult, store.scoreRankIntervals]; }), reportResult = _b.reportResult, scoreRankIntervals = _b.scoreRankIntervals, reportRank = _b.reportRank;
|
|
38
|
+
var _c = (reportResult || {}).score, score = _c === void 0 ? 0 : _c;
|
|
39
|
+
var progress = useMemo(function () { return rankPercent((reportRank === null || reportRank === void 0 ? void 0 : reportRank.rank) || 0, (reportRank === null || reportRank === void 0 ? void 0 : reportRank.total) || 0); }, [reportRank]);
|
|
40
|
+
useEffect(function () {
|
|
41
|
+
if (reportRank === null || reportRank === void 0 ? void 0 : reportRank.total) {
|
|
42
|
+
setText("\u51FB\u8D25\u4E86".concat(progress.toFixed(0), "%\u5019\u9009\u4EBA"));
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
setText('');
|
|
46
|
+
}
|
|
47
|
+
}, [score, reportRank, scoreRankIntervals, progress]);
|
|
48
|
+
return (_jsx(Podium, { children: _jsxs(Stack, __assign({ direction: "row", position: "relative", bottom: -146, left: 88, spacing: 1.5 }, { children: [_jsxs(Stack, __assign({ spacing: 1, direction: "row", justifyContent: "center", width: 300 }, { children: [_jsx(DinTypography, __assign({ sx: { fontSize: 100, fontWeight: 'bold', lineHeight: 1 }, color: "inherit" }, { children: score })), _jsx(DinTypography, __assign({ variant: "h5", color: "inherit", sx: { fontSize: 30, fontWeight: 'bold', alignSelf: 'flex-end', mb: '12px !important' } }, { children: "\u5206" }))] })), (reportRank === null || reportRank === void 0 ? void 0 : reportRank.total) !== 0 && (_jsxs(Stack, __assign({ spacing: 1, mt: 6.25 }, { children: [_jsxs(Typography, __assign({ color: "inherit", fontWeight: 500, mt: 5 }, { children: [text, "\u00A0"] })), _jsx(BeatProgressBar, { children: _jsx("div", { className: "progress-bar-fill", style: { width: "".concat(progress, "%") } }) })] })))] })) }));
|
|
49
|
+
};
|
|
50
|
+
export default Form;
|
|
@@ -0,0 +1,62 @@
|
|
|
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 { Box, Stack } from 'fbm-ui/lib/mui';
|
|
14
|
+
import { Typography } from 'fbm-ui';
|
|
15
|
+
import { useMemo } from 'react';
|
|
16
|
+
import { useAiReportStore } from "../../../../store/ai-report/global-store";
|
|
17
|
+
import { formatScore } from "../../../../utils/utils";
|
|
18
|
+
var HeaderCell = function (_a) {
|
|
19
|
+
var children = _a.children, _b = _a.width, width = _b === void 0 ? 'auto' : _b;
|
|
20
|
+
return (_jsx(Box, __assign({ width: width, flexShrink: 0, py: 1, px: 1.5, bgcolor: "#EBFCF7" }, { children: _jsx(Typography, __assign({ variant: "body2", fontWeight: 700, sx: { color: '#00996B', fontSize: 13, lineHeight: '20px' } }, { children: children })) })));
|
|
21
|
+
};
|
|
22
|
+
var CapabilityTable = function () {
|
|
23
|
+
var reportResult = useAiReportStore(function (store) { return [store.reportResult]; }).reportResult;
|
|
24
|
+
var steps = (reportResult || {}).steps || [];
|
|
25
|
+
var rows = useMemo(function () {
|
|
26
|
+
return steps
|
|
27
|
+
.map(function (step, index) {
|
|
28
|
+
var _a, _b, _c, _d, _e, _f;
|
|
29
|
+
var name = ((_a = step.questionCollection) === null || _a === void 0 ? void 0 : _a.name) || ((_b = step.scoreInfo) === null || _b === void 0 ? void 0 : _b.workplaceName) || '';
|
|
30
|
+
return {
|
|
31
|
+
index: index,
|
|
32
|
+
step: step,
|
|
33
|
+
name: name,
|
|
34
|
+
collectionToken: ((_c = step.questionCollection) === null || _c === void 0 ? void 0 : _c.token) || '',
|
|
35
|
+
keyPoints: ((_d = step.questionCollection) === null || _d === void 0 ? void 0 : _d.keyPoints) || [],
|
|
36
|
+
evaluation: ((_e = step.scoreInfo) === null || _e === void 0 ? void 0 : _e.workplaceEvaluation) || '',
|
|
37
|
+
finalScore: (_f = step.scoreInfo) === null || _f === void 0 ? void 0 : _f.finalScore,
|
|
38
|
+
followupCount: (step.followupQuestions || []).length,
|
|
39
|
+
};
|
|
40
|
+
})
|
|
41
|
+
.filter(function (row) { return row.name || row.evaluation; });
|
|
42
|
+
}, [steps]);
|
|
43
|
+
var groupCounts = useMemo(function () {
|
|
44
|
+
var map = {};
|
|
45
|
+
rows.forEach(function (row) {
|
|
46
|
+
if (!row.collectionToken)
|
|
47
|
+
return;
|
|
48
|
+
map[row.collectionToken] = map[row.collectionToken] || { main: 0, followups: 0 };
|
|
49
|
+
map[row.collectionToken].main += 1;
|
|
50
|
+
map[row.collectionToken].followups += row.followupCount;
|
|
51
|
+
});
|
|
52
|
+
return map;
|
|
53
|
+
}, [rows]);
|
|
54
|
+
if (rows.length === 0)
|
|
55
|
+
return null;
|
|
56
|
+
return (_jsx(Box, __assign({ id: "report-capability", px: 2, mt: 3 }, { children: _jsxs(Box, __assign({ mt: 0.5, border: "1px solid #E7F4EC", borderRadius: 2, overflow: "hidden" }, { children: [_jsxs(Stack, __assign({ direction: "row" }, { children: [_jsx(HeaderCell, __assign({ width: "160px" }, { children: "\u80DC\u4EFB\u529B" })), _jsx(Box, __assign({ flex: "1", minWidth: 0 }, { children: _jsx(HeaderCell, { children: "\u5C97\u4F4D\u91CD\u70B9\u8003\u5BDF" }) })), _jsx(Box, __assign({ flex: "1", minWidth: 0 }, { children: _jsx(HeaderCell, { children: "\u9762\u8BD5\u8BC4\u4EF7" }) })), _jsx(HeaderCell, __assign({ width: "90px" }, { children: "\u5F97\u5206" }))] })), rows.map(function (row) {
|
|
57
|
+
var count = row.collectionToken ? groupCounts[row.collectionToken] : undefined;
|
|
58
|
+
var score = typeof row.finalScore === 'number' && row.finalScore > 0 ? "".concat(formatScore(row.finalScore), "\u5206") : '-';
|
|
59
|
+
return (_jsx(Box, __assign({ borderTop: "1px solid #F0F6F2" }, { children: _jsxs(Stack, __assign({ direction: "row", alignItems: "stretch" }, { children: [_jsxs(Box, __assign({ width: "160px", flexShrink: 0, p: 1.5 }, { children: [_jsx(Typography, __assign({ variant: "body2", fontWeight: 500, sx: { color: 'rgba(0,0,0,0.6)', fontSize: 14 } }, { children: row.name })), count && (_jsx(Box, __assign({ sx: { display: 'inline-flex', alignItems: 'center', bgcolor: '#E8F3FF', color: '#007CFD', borderRadius: '999px', px: 1, py: 0.25, mt: 0.5 } }, { children: _jsxs(Typography, __assign({ variant: "caption", sx: { color: '#007CFD', fontSize: 12, lineHeight: 1 } }, { children: [count.main, "\u4E3B\u95EE\u9898+", count.followups, "\u8FFD\u95EE"] })) })))] })), _jsx(Box, __assign({ flex: "1", minWidth: 0, p: 1.5 }, { children: (row.keyPoints.length > 0 ? row.keyPoints : ['-']).map(function (point, i) { return (_jsx(Typography, __assign({ variant: "body2", sx: { color: 'rgba(0,0,0,0.6)', fontSize: 13 }, display: "block" }, { children: point }), i)); }) })), _jsx(Box, __assign({ flex: "1", minWidth: 0, p: 1.5 }, { children: row.evaluation ? (_jsx(Typography, __assign({ variant: "body2", sx: { color: 'rgba(0,0,0,0.6)', fontSize: 13 } }, { children: row.evaluation }))) : (_jsx(Typography, __assign({ variant: "body2", color: "rgba(0,0,0,0.26)" }, { children: "-" }))) })), _jsx(Box, __assign({ width: "90px", flexShrink: 0, p: 1.5, textAlign: "right" }, { children: _jsx(Typography, __assign({ variant: "body2", fontWeight: 700, sx: { color: '#03BA4C' } }, { children: score })) }))] })) }), row.step.token));
|
|
60
|
+
})] })) })));
|
|
61
|
+
};
|
|
62
|
+
export default CapabilityTable;
|
|
@@ -0,0 +1,42 @@
|
|
|
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 { Box, Stack } from 'fbm-ui/lib/mui';
|
|
30
|
+
import { Typography } from 'fbm-ui';
|
|
31
|
+
import { useState } from 'react';
|
|
32
|
+
// 作弊风险模块:产品逻辑未确认前仅保留样式与收起交互,不渲染任何未确认数据。
|
|
33
|
+
var CheatRisk = function () {
|
|
34
|
+
var _a = __read(useState(true), 2), open = _a[0], setOpen = _a[1];
|
|
35
|
+
return (_jsxs(Box, __assign({ id: "report-risk", px: 2, mt: 3 }, { children: [_jsxs(Stack, __assign({ direction: "row", alignItems: "center", spacing: 1 }, { children: [_jsx(Box, { sx: {
|
|
36
|
+
width: 16,
|
|
37
|
+
height: 16,
|
|
38
|
+
borderRadius: '50%',
|
|
39
|
+
background: 'linear-gradient(158deg, #5EE2B8 2.38%, #41C446 97.38%)',
|
|
40
|
+
} }), _jsx(Typography, __assign({ variant: "subtitle1", fontWeight: "bold", sx: { fontSize: 16 } }, { children: "\u4F5C\u5F0A\u98CE\u9669" })), _jsx(Box, { flex: 1 }), _jsx(Typography, __assign({ variant: "body2", sx: { cursor: 'pointer', color: '#00996B', userSelect: 'none' }, onClick: function () { return setOpen(!open); } }, { children: open ? '收起' : '展开' }))] })), open && (_jsx(Box, __assign({ mt: 1.5, border: "1px solid #E7F4EC", borderRadius: 2, p: 3, textAlign: "center" }, { children: _jsx(Typography, __assign({ variant: "body2", color: "rgba(0,0,0,0.26)" }, { children: "\u4F5C\u5F0A\u98CE\u9669\u8BC4\u4F30 / \u9632\u4F5C\u5F0A\u68C0\u6D4B\u660E\u7EC6\uFF1A\u5F85\u4EA7\u54C1\u786E\u8BA4\u6570\u636E\u4E0E\u4EA4\u4E92\u540E\u63A5\u5165" })) })))] })));
|
|
41
|
+
};
|
|
42
|
+
export default CheatRisk;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export declare enum QUESTION_TYPE {
|
|
3
|
+
IMAGE_UPLOAD = 1,
|
|
4
|
+
ESSAY_QUESTION = 2,
|
|
5
|
+
RADIO = 3,
|
|
6
|
+
CHECKBOX = 3.2,
|
|
7
|
+
TIME = 4,
|
|
8
|
+
SCHOOL = 7,
|
|
9
|
+
FILL_BLANKS = 8,
|
|
10
|
+
NPS = 9
|
|
11
|
+
}
|
|
12
|
+
export interface Answer {
|
|
13
|
+
formTypeId: number;
|
|
14
|
+
formTypeKey: string;
|
|
15
|
+
formAnswer: any;
|
|
16
|
+
formItemOption: any;
|
|
17
|
+
}
|
|
18
|
+
interface FormProps {
|
|
19
|
+
answers: Answer[];
|
|
20
|
+
customProcessName?: string;
|
|
21
|
+
}
|
|
22
|
+
declare const Form: FC<FormProps>;
|
|
23
|
+
export default Form;
|