eli-video-interview 1.2.13 → 1.2.14
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/modules/ai-report/components/AIEvaluate/index.js +7 -3
- package/esm/modules/ai-report/components/ScoreReport/Bar.js +12 -6
- package/esm/modules/ai-report/interface.d.ts +11 -0
- package/esm/modules/ai-report/useAiReport.d.ts +5 -0
- package/esm/modules/ai-report/utils.d.ts +1 -0
- package/esm/modules/ai-report/utils.js +1 -0
- package/esm/store/ai-report/global-store.d.ts +15 -0
- package/esm/store/ai-report/global-store.js +2 -0
- package/lib/modules/ai-report/components/AIEvaluate/index.js +7 -3
- package/lib/modules/ai-report/components/ScoreReport/Bar.js +11 -5
- package/lib/modules/ai-report/interface.d.ts +11 -0
- package/lib/modules/ai-report/useAiReport.d.ts +5 -0
- package/lib/modules/ai-report/utils.d.ts +1 -0
- package/lib/modules/ai-report/utils.js +5 -0
- package/lib/store/ai-report/global-store.d.ts +15 -0
- package/lib/store/ai-report/global-store.js +2 -0
- package/package.json +1 -1
|
@@ -16,10 +16,13 @@ import { useAiReportStore } from "../../../../store/ai-report/global-store";
|
|
|
16
16
|
import { InfoOutlineIcon, Link, Tooltip, Typography } from 'fbm-ui';
|
|
17
17
|
import { Box, Paper, Stack, Collapse, Divider } from 'fbm-ui/lib/mui';
|
|
18
18
|
import { useCallback, useState } from 'react';
|
|
19
|
-
|
|
19
|
+
import { rankPercent } from '../../utils';
|
|
20
20
|
var Index = function () {
|
|
21
21
|
var _a;
|
|
22
|
-
var _b = useAiReportStore(function (store) { return [
|
|
22
|
+
var _b = useAiReportStore(function (store) { return [
|
|
23
|
+
store.reportResult,
|
|
24
|
+
store.operableButtons,
|
|
25
|
+
]; }), reportResult = _b.reportResult, showAiDimension = _b.showAiDimension, canEditAiDimension = _b.canEditAiDimension, customInterviewDimRankMap = _b.customInterviewDimRankMap;
|
|
23
26
|
var _c = useState(true), expand = _c[0], setExpand = _c[1];
|
|
24
27
|
var handleExpandChange = useCallback(function () {
|
|
25
28
|
setExpand(!expand);
|
|
@@ -28,7 +31,8 @@ var Index = function () {
|
|
|
28
31
|
return null;
|
|
29
32
|
return (_jsxs(Box, __assign({ component: Paper, variant: "outlined", px: 2, mt: 2 }, { children: [_jsxs(Stack, __assign({ direction: "row", height: 56, alignItems: "center", spacing: 1 }, { children: [_jsx(Typography, __assign({ variant: "body1", fontWeight: "medium", sx: { fontWeight: 500 } }, { children: "AI\u7EF4\u5EA6\u8868\u73B0" })), _jsx(Tooltip, __assign({ title: _jsxs("span", { children: ["\u7ED3\u679C\u8BF4\u660E\uFF1A", _jsx("br", {}), "AI\u7EF4\u5EA6\u8868\u73B0\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: [(_a = reportResult === null || reportResult === void 0 ? void 0 : reportResult.evaluations) === null || _a === void 0 ? void 0 : _a.map(function (v) {
|
|
30
33
|
var _a;
|
|
31
|
-
var
|
|
34
|
+
var c = customInterviewDimRankMap === null || customInterviewDimRankMap === void 0 ? void 0 : customInterviewDimRankMap[v.evaluationToken];
|
|
35
|
+
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));
|
|
32
36
|
return (_jsxs(Box, __assign({ component: Paper, elevation: 0, bgcolor: "#f9f9f9", mb: 2, pb: 2 }, { children: [_jsxs(Stack, __assign({ px: 2, pt: 2 }, { children: [_jsxs(Stack, __assign({ direction: "row", alignItems: "center", spacing: 2 }, { children: [_jsx(Typography, __assign({ variant: "h6", fontWeight: "medium", sx: { fontWeight: 500 } }, { children: v.evaluationDimensionName })), !isNaN(rank) && (_jsxs(Typography, __assign({ variant: "body2" }, { children: ["\u51FB\u8D25\u4E86", _jsxs(Typography, __assign({ variant: "body2", fontWeight: "medium", display: "inline", color: "#4caf50" }, { children: [rank.toFixed(2), "%"] })), "\u7684\u5019\u9009\u4EBA"] })))] })), _jsx(Typography, __assign({ mt: 1, mb: 2, variant: "body2", fontWeight: "medium", color: "#4caf50" }, { children: v.impressions.join('、') }))] })), _jsx(Divider, { sx: { borderColor: 'rgba(0,0,0,0.08)' } }), _jsxs(Stack, __assign({ px: 2 }, { children: [((_a = v.items) === null || _a === void 0 ? void 0 : _a.length) > 0 && (_jsx(Box, __assign({ mt: 2 }, { children: _jsx(Graph, { items: v.items }) }))), _jsxs(Stack, __assign({ spacing: 2, mt: 2 }, { children: [_jsx(Evaluate, { canEdit: canEditAiDimension, token: v.evaluationToken, evaluations: v.evaluations, title: "\u8BC4\u4EF7\u5185\u5BB9", field: "evaluations", mode: "show" }), _jsx(Evaluate, { canEdit: canEditAiDimension, token: v.evaluationToken, evaluations: v.suggestions, title: "\u63D0\u9AD8\u5EFA\u8BAE", field: "suggestions", mode: "show" })] }))] }))] }), v.evaluationToken));
|
|
33
37
|
}), _jsxs(Stack, __assign({ spacing: 1, mt: 4 }, { children: [_jsx(Typography, __assign({ variant: "body2", fontWeight: "medium", color: "textSecondary" }, { children: "\u7ED3\u679C\u8BF4\u660E" })), _jsxs(Typography, __assign({ variant: "caption", color: "rgba(0,0,0,0.26)" }, { children: ["AI\u7EF4\u5EA6\u8868\u73B0\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"] }))] }))] })), _jsx(Box, __assign({ display: "flex", justifyContent: "flex-end", alignItems: "center", mt: 1, mb: 2 }, { children: _jsx(Link, { href: "#", onClick: handleExpandChange, text: expand ? '收起' : '查看详情' }) }))] })));
|
|
34
38
|
};
|
|
@@ -9,27 +9,33 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import {
|
|
12
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { useEffect, useState } from 'react';
|
|
14
14
|
import { Box, Typography } from 'fbm-ui';
|
|
15
15
|
import { scoreRankIntervalColors } from "../../../../constants/ai-report";
|
|
16
16
|
import { useAiReportStore } from "../../../../store/ai-report/global-store";
|
|
17
|
+
import { rankPercent } from '../../utils';
|
|
17
18
|
var Bar = function () {
|
|
18
19
|
var _a = useState(1), currentRank = _a[0], setCurrentRank = _a[1];
|
|
19
20
|
var _b = useState('前0% ~ 100%'), text = _b[0], setText = _b[1];
|
|
20
|
-
var _c = useAiReportStore(function (store) { return [store.reportResult, store.scoreRankIntervals]; }), reportResult = _c.reportResult, scoreRankIntervals = _c.scoreRankIntervals;
|
|
21
|
+
var _c = useAiReportStore(function (store) { return [store.reportResult, store.scoreRankIntervals]; }), reportResult = _c.reportResult, scoreRankIntervals = _c.scoreRankIntervals, reportRank = _c.reportRank;
|
|
21
22
|
var _d = (reportResult || {}).score, score = _d === void 0 ? 0 : _d;
|
|
22
23
|
useEffect(function () {
|
|
23
24
|
var floatInterval = scoreRankIntervals === null || scoreRankIntervals === void 0 ? void 0 : scoreRankIntervals.find(function (interval) { return score >= interval.score.startScore && score <= interval.score.endScore; });
|
|
24
25
|
if (floatInterval) {
|
|
25
|
-
var rank = floatInterval.rank
|
|
26
|
+
var rank = floatInterval.rank;
|
|
26
27
|
setCurrentRank(rank);
|
|
27
|
-
|
|
28
|
+
if (reportRank === null || reportRank === void 0 ? void 0 : reportRank.total) {
|
|
29
|
+
setText("\u51FB\u8D25\u4E86".concat(rankPercent((reportRank === null || reportRank === void 0 ? void 0 : reportRank.rank) || 0, (reportRank === null || reportRank === void 0 ? void 0 : reportRank.total) || 0).toFixed(0), "%\u5019\u9009\u4EBA"));
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
setText('');
|
|
33
|
+
}
|
|
28
34
|
}
|
|
29
|
-
}, [score, scoreRankIntervals]);
|
|
35
|
+
}, [score, reportRank, scoreRankIntervals]);
|
|
30
36
|
if (!scoreRankIntervals || (scoreRankIntervals === null || scoreRankIntervals === void 0 ? void 0 : scoreRankIntervals.length) === 0)
|
|
31
37
|
return null;
|
|
32
|
-
return (_jsxs(Box, { children: [
|
|
38
|
+
return (_jsxs(Box, { children: [_jsxs(Typography, __assign({ variant: "body2", flexShrink: 0 }, { children: [text, "\u00A0"] })), _jsx(Box, __assign({ display: "flex", alignItems: "center", sx: { height: 12, mt: 0.5 } }, { children: scoreRankIntervals === null || scoreRankIntervals === void 0 ? void 0 : scoreRankIntervals.map(function (_a, index) {
|
|
33
39
|
var rank = _a.rank, _b = _a.scoreRankIntervals, startRankProportion = _b.startRankProportion, endRankProportion = _b.endRankProportion;
|
|
34
40
|
return [
|
|
35
41
|
_jsx(Box, { sx: {
|
|
@@ -104,6 +104,12 @@ export interface InterviewCheat {
|
|
|
104
104
|
isCheat: boolean;
|
|
105
105
|
info: string;
|
|
106
106
|
}
|
|
107
|
+
export interface CustomInterviewDimRank {
|
|
108
|
+
evaluationToken: string;
|
|
109
|
+
rank: number;
|
|
110
|
+
total: number;
|
|
111
|
+
}
|
|
112
|
+
export declare type CustomInterviewDimRankMap = Record<string, CustomInterviewDimRank>;
|
|
107
113
|
export interface AiReportProps {
|
|
108
114
|
token: string;
|
|
109
115
|
scoreRankIntervals?: ScoreRankInterval[];
|
|
@@ -115,6 +121,11 @@ export interface AiReportProps {
|
|
|
115
121
|
operableButtons?: Array<'export' | 'refresh' | 'scoreRank' | 'abilities' | 'sendReminder'>;
|
|
116
122
|
stepToken?: string;
|
|
117
123
|
interviewCheat?: InterviewCheat;
|
|
124
|
+
reportRank?: {
|
|
125
|
+
total: number;
|
|
126
|
+
rank: number;
|
|
127
|
+
};
|
|
128
|
+
customInterviewDimRankMap?: CustomInterviewDimRankMap;
|
|
118
129
|
onLoad?: (values: AiReportLoadedValues) => void;
|
|
119
130
|
onExportReportClick?: () => void;
|
|
120
131
|
onScoreChange?: (scoreState?: ScoreManualUpdateState) => void;
|
|
@@ -12,6 +12,11 @@ export declare const useAiReport: (props: AiReportProps) => {
|
|
|
12
12
|
operableButtons?: ("export" | "refresh" | "scoreRank" | "abilities" | "sendReminder")[] | undefined;
|
|
13
13
|
stepToken?: string | undefined;
|
|
14
14
|
interviewCheat?: import("./interface").InterviewCheat | undefined;
|
|
15
|
+
reportRank?: {
|
|
16
|
+
total: number;
|
|
17
|
+
rank: number;
|
|
18
|
+
} | undefined;
|
|
19
|
+
customInterviewDimRankMap?: import("./interface").CustomInterviewDimRankMap | undefined;
|
|
15
20
|
onLoad?: ((values: import("./interface").AiReportLoadedValues) => void) | undefined;
|
|
16
21
|
onExportReportClick?: (() => void) | undefined;
|
|
17
22
|
onScoreChange?: ((scoreState?: import("./interface").ScoreManualUpdateState | undefined) => void) | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const rankPercent: (r: number, t: number) => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var rankPercent = function (r, t) { return (1 - r / t) * 100; };
|
|
@@ -14,6 +14,11 @@ export declare const useAiReportStore: (depsFn?: import("hox/es/types").DepsFn<{
|
|
|
14
14
|
operableButtons?: ("export" | "refresh" | "scoreRank" | "abilities" | "sendReminder")[] | undefined;
|
|
15
15
|
stepToken?: string | undefined;
|
|
16
16
|
interviewCheat?: import("@/modules/ai-report/interface").InterviewCheat | undefined;
|
|
17
|
+
reportRank?: {
|
|
18
|
+
total: number;
|
|
19
|
+
rank: number;
|
|
20
|
+
} | undefined;
|
|
21
|
+
customInterviewDimRankMap?: import("@/modules/ai-report/interface").CustomInterviewDimRankMap | undefined;
|
|
17
22
|
onLoad?: ((values: import("@/modules/ai-report/interface").AiReportLoadedValues) => void) | undefined;
|
|
18
23
|
onExportReportClick?: (() => void) | undefined;
|
|
19
24
|
onScoreChange?: ((scoreState?: import("@/modules/ai-report/interface").ScoreManualUpdateState | undefined) => void) | undefined;
|
|
@@ -35,6 +40,11 @@ export declare const useAiReportStore: (depsFn?: import("hox/es/types").DepsFn<{
|
|
|
35
40
|
operableButtons?: ("export" | "refresh" | "scoreRank" | "abilities" | "sendReminder")[] | undefined;
|
|
36
41
|
stepToken?: string | undefined;
|
|
37
42
|
interviewCheat?: import("@/modules/ai-report/interface").InterviewCheat | undefined;
|
|
43
|
+
reportRank?: {
|
|
44
|
+
total: number;
|
|
45
|
+
rank: number;
|
|
46
|
+
} | undefined;
|
|
47
|
+
customInterviewDimRankMap?: import("@/modules/ai-report/interface").CustomInterviewDimRankMap | undefined;
|
|
38
48
|
onLoad?: ((values: import("@/modules/ai-report/interface").AiReportLoadedValues) => void) | undefined;
|
|
39
49
|
onExportReportClick?: (() => void) | undefined;
|
|
40
50
|
onScoreChange?: ((scoreState?: import("@/modules/ai-report/interface").ScoreManualUpdateState | undefined) => void) | undefined;
|
|
@@ -56,6 +66,11 @@ export declare const useAiReportStore: (depsFn?: import("hox/es/types").DepsFn<{
|
|
|
56
66
|
operableButtons?: ("export" | "refresh" | "scoreRank" | "abilities" | "sendReminder")[] | undefined;
|
|
57
67
|
stepToken?: string | undefined;
|
|
58
68
|
interviewCheat?: import("@/modules/ai-report/interface").InterviewCheat | undefined;
|
|
69
|
+
reportRank?: {
|
|
70
|
+
total: number;
|
|
71
|
+
rank: number;
|
|
72
|
+
} | undefined;
|
|
73
|
+
customInterviewDimRankMap?: import("@/modules/ai-report/interface").CustomInterviewDimRankMap | undefined;
|
|
59
74
|
onLoad?: ((values: import("@/modules/ai-report/interface").AiReportLoadedValues) => void) | undefined;
|
|
60
75
|
onExportReportClick?: (() => void) | undefined;
|
|
61
76
|
onScoreChange?: ((scoreState?: import("@/modules/ai-report/interface").ScoreManualUpdateState | undefined) => void) | undefined;
|
|
@@ -22,6 +22,8 @@ export var useAiReportStore = (_a = createGlobalStore(function () {
|
|
|
22
22
|
canEditAiDimension: true,
|
|
23
23
|
scoreRankIntervals: [],
|
|
24
24
|
operableButtons: [],
|
|
25
|
+
reportRank: { rank: 0, total: 0 },
|
|
26
|
+
customInterviewDimRankMap: {},
|
|
25
27
|
}), state = _a[0], updateState = _a[1];
|
|
26
28
|
var _b = useState(), reportResult = _b[0], updateReportResult = _b[1];
|
|
27
29
|
return __assign(__assign({}, state), { reportResult: reportResult, updateState: updateState, updateReportResult: updateReportResult });
|
|
@@ -21,10 +21,13 @@ var global_store_1 = require("../../../../store/ai-report/global-store");
|
|
|
21
21
|
var fbm_ui_1 = require("fbm-ui");
|
|
22
22
|
var mui_1 = require("fbm-ui/lib/mui");
|
|
23
23
|
var react_1 = require("react");
|
|
24
|
-
var
|
|
24
|
+
var utils_1 = require("../../utils");
|
|
25
25
|
var Index = function () {
|
|
26
26
|
var _a;
|
|
27
|
-
var _b = (0, global_store_1.useAiReportStore)(function (store) { return [
|
|
27
|
+
var _b = (0, global_store_1.useAiReportStore)(function (store) { return [
|
|
28
|
+
store.reportResult,
|
|
29
|
+
store.operableButtons,
|
|
30
|
+
]; }), reportResult = _b.reportResult, showAiDimension = _b.showAiDimension, canEditAiDimension = _b.canEditAiDimension, customInterviewDimRankMap = _b.customInterviewDimRankMap;
|
|
28
31
|
var _c = (0, react_1.useState)(true), expand = _c[0], setExpand = _c[1];
|
|
29
32
|
var handleExpandChange = (0, react_1.useCallback)(function () {
|
|
30
33
|
setExpand(!expand);
|
|
@@ -33,7 +36,8 @@ var Index = function () {
|
|
|
33
36
|
return null;
|
|
34
37
|
return ((0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ component: mui_1.Paper, variant: "outlined", px: 2, mt: 2 }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", height: 56, alignItems: "center", spacing: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body1", fontWeight: "medium", sx: { fontWeight: 500 } }, { children: "AI\u7EF4\u5EA6\u8868\u73B0" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: (0, jsx_runtime_1.jsxs)("span", { children: ["\u7ED3\u679C\u8BF4\u660E\uFF1A", (0, jsx_runtime_1.jsx)("br", {}), "AI\u7EF4\u5EA6\u8868\u73B0\u4ECE\u8BED\u901F\u3001\u666E\u901A\u8BDD\u3001\u8BED\u8A00\u6D41\u7545\u5EA6\u3001\u8981\u70B9\u5206\u6790\u5339\u914D\u5EA6\u3001\u8BED\u8A00\u4E30\u5BCC\u5EA6\u3001\u5F62\u8C61\u516D\u4E2A\u7EF4\u5EA6\u5BF9\u5019\u9009\u4EBA\u5728\u9762\u8BD5\u4E2D\u7684\u56DE\u7B54\u8868\u73B0\u8FDB\u884C\u8BC4\u4EF7\uFF0C\u6BCF\u4E2A\u7EF4\u5EA6\u5206\u4E3A\u4E09\u4E2A\u6863\uFF0C\u5206\u522B\u4E3A\uFF1A\u524D30%\u4EE3\u8868\u4F18\u79C0\u3001\u4E2D\u95F430%~70%\u4EE3\u8868\u9002\u4E2D\u3001\u540E30%\u4EE3\u8868\u6B20\u4F73\u3002", (0, jsx_runtime_1.jsx)("br", {}), "\u6BCF\u4E2A\u80FD\u529B\u7684\u4E09\u6863\u7684\u5206\u6570\u503C\u4F9D\u636E\u5168\u56FD\u5927\u6570\u636E\u7EDF\u8BA1\u800C\u5B9A\u3002\u6839\u636E\u5019\u9009\u4EBA\u5F53\u524DAI\u89C6\u9891\u6B65\u9AA4\u4E0B\u7684\u6BCF\u4E2A\u80FD\u529B\u7684\u5E73\u5747\u5206\u6765\u786E\u5B9A\u6BCF\u4E2A\u80FD\u529B\u7684\u8BC4\u4EF7\u3002\u76F8\u540C\u7684\u5F97\u5206\uFF0C\u6210\u7EE9\u5148\u51FA\u7684\u6392\u540D\u9760\u524D\u3002"] }) }, { children: (0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ display: "flex", alignItems: "center" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.InfoOutlineIcon, { sx: { fontSize: '16px' } }) })) }))] })), (0, jsx_runtime_1.jsxs)(mui_1.Collapse, __assign({ in: expand }, { children: [(_a = reportResult === null || reportResult === void 0 ? void 0 : reportResult.evaluations) === null || _a === void 0 ? void 0 : _a.map(function (v) {
|
|
35
38
|
var _a;
|
|
36
|
-
var
|
|
39
|
+
var c = customInterviewDimRankMap === null || customInterviewDimRankMap === void 0 ? void 0 : customInterviewDimRankMap[v.evaluationToken];
|
|
40
|
+
var rank = (0, utils_1.rankPercent)((c === null || c === void 0 ? void 0 : c.rank) || (v === null || v === void 0 ? void 0 : v.rank), (c === null || c === void 0 ? void 0 : c.total) || (v === null || v === void 0 ? void 0 : v.total));
|
|
37
41
|
return ((0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ component: mui_1.Paper, elevation: 0, bgcolor: "#f9f9f9", mb: 2, pb: 2 }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ px: 2, pt: 2 }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", alignItems: "center", spacing: 2 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "h6", fontWeight: "medium", sx: { fontWeight: 500 } }, { children: v.evaluationDimensionName })), !isNaN(rank) && ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body2" }, { children: ["\u51FB\u8D25\u4E86", (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body2", fontWeight: "medium", display: "inline", color: "#4caf50" }, { children: [rank.toFixed(2), "%"] })), "\u7684\u5019\u9009\u4EBA"] })))] })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ mt: 1, mb: 2, variant: "body2", fontWeight: "medium", color: "#4caf50" }, { children: v.impressions.join('、') }))] })), (0, jsx_runtime_1.jsx)(mui_1.Divider, { sx: { borderColor: 'rgba(0,0,0,0.08)' } }), (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ px: 2 }, { children: [((_a = v.items) === null || _a === void 0 ? void 0 : _a.length) > 0 && ((0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ mt: 2 }, { children: (0, jsx_runtime_1.jsx)(Graph_1.default, { items: v.items }) }))), (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ spacing: 2, mt: 2 }, { children: [(0, jsx_runtime_1.jsx)(Evaluate_1.default, { canEdit: canEditAiDimension, token: v.evaluationToken, evaluations: v.evaluations, title: "\u8BC4\u4EF7\u5185\u5BB9", field: "evaluations", mode: "show" }), (0, jsx_runtime_1.jsx)(Evaluate_1.default, { canEdit: canEditAiDimension, token: v.evaluationToken, evaluations: v.suggestions, title: "\u63D0\u9AD8\u5EFA\u8BAE", field: "suggestions", mode: "show" })] }))] }))] }), v.evaluationToken));
|
|
38
42
|
}), (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ spacing: 1, mt: 4 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", fontWeight: "medium", color: "textSecondary" }, { children: "\u7ED3\u679C\u8BF4\u660E" })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "rgba(0,0,0,0.26)" }, { children: ["AI\u7EF4\u5EA6\u8868\u73B0\u4ECE\u8BED\u901F\u3001\u666E\u901A\u8BDD\u3001\u8BED\u8A00\u6D41\u7545\u5EA6\u3001\u8981\u70B9\u5206\u6790\u5339\u914D\u5EA6\u3001\u8BED\u8A00\u4E30\u5BCC\u5EA6\u3001\u5F62\u8C61\u516D\u4E2A\u7EF4\u5EA6\u5BF9\u5019\u9009\u4EBA\u5728\u9762\u8BD5\u4E2D\u7684\u56DE\u7B54\u8868\u73B0\u8FDB\u884C\u8BC4\u4EF7\uFF0C\u6BCF\u4E2A\u7EF4\u5EA6\u5206\u4E3A\u4E09\u4E2A\u6863\uFF0C\u5206\u522B\u4E3A\uFF1A\u524D30%\u4EE3\u8868\u4F18\u79C0\u3001\u4E2D\u95F430%~70%\u4EE3\u8868\u9002\u4E2D\u3001\u540E30%\u4EE3\u8868\u6B20\u4F73\u3002", (0, jsx_runtime_1.jsx)("br", {}), "\u6BCF\u4E2A\u80FD\u529B\u7684\u4E09\u6863\u7684\u5206\u6570\u503C\u4F9D\u636E\u5168\u56FD\u5927\u6570\u636E\u7EDF\u8BA1\u800C\u5B9A\u3002\u6839\u636E\u5019\u9009\u4EBA\u5F53\u524DAI\u89C6\u9891\u6B65\u9AA4\u4E0B\u7684\u6BCF\u4E2A\u80FD\u529B\u7684\u5E73\u5747\u5206\u6765\u786E\u5B9A\u6BCF\u4E2A\u80FD\u529B\u7684\u8BC4\u4EF7\u3002\u76F8\u540C\u7684\u5F97\u5206\uFF0C\u6210\u7EE9\u5148\u51FA\u7684\u6392\u540D\u9760\u524D\u3002"] }))] }))] })), (0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ display: "flex", justifyContent: "flex-end", alignItems: "center", mt: 1, mb: 2 }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Link, { href: "#", onClick: handleExpandChange, text: expand ? '收起' : '查看详情' }) }))] })));
|
|
39
43
|
};
|
|
@@ -16,22 +16,28 @@ var react_1 = require("react");
|
|
|
16
16
|
var fbm_ui_1 = require("fbm-ui");
|
|
17
17
|
var ai_report_1 = require("../../../../constants/ai-report");
|
|
18
18
|
var global_store_1 = require("../../../../store/ai-report/global-store");
|
|
19
|
+
var utils_1 = require("../../utils");
|
|
19
20
|
var Bar = function () {
|
|
20
21
|
var _a = (0, react_1.useState)(1), currentRank = _a[0], setCurrentRank = _a[1];
|
|
21
22
|
var _b = (0, react_1.useState)('前0% ~ 100%'), text = _b[0], setText = _b[1];
|
|
22
|
-
var _c = (0, global_store_1.useAiReportStore)(function (store) { return [store.reportResult, store.scoreRankIntervals]; }), reportResult = _c.reportResult, scoreRankIntervals = _c.scoreRankIntervals;
|
|
23
|
+
var _c = (0, global_store_1.useAiReportStore)(function (store) { return [store.reportResult, store.scoreRankIntervals]; }), reportResult = _c.reportResult, scoreRankIntervals = _c.scoreRankIntervals, reportRank = _c.reportRank;
|
|
23
24
|
var _d = (reportResult || {}).score, score = _d === void 0 ? 0 : _d;
|
|
24
25
|
(0, react_1.useEffect)(function () {
|
|
25
26
|
var floatInterval = scoreRankIntervals === null || scoreRankIntervals === void 0 ? void 0 : scoreRankIntervals.find(function (interval) { return score >= interval.score.startScore && score <= interval.score.endScore; });
|
|
26
27
|
if (floatInterval) {
|
|
27
|
-
var rank = floatInterval.rank
|
|
28
|
+
var rank = floatInterval.rank;
|
|
28
29
|
setCurrentRank(rank);
|
|
29
|
-
|
|
30
|
+
if (reportRank === null || reportRank === void 0 ? void 0 : reportRank.total) {
|
|
31
|
+
setText("\u51FB\u8D25\u4E86".concat((0, utils_1.rankPercent)((reportRank === null || reportRank === void 0 ? void 0 : reportRank.rank) || 0, (reportRank === null || reportRank === void 0 ? void 0 : reportRank.total) || 0).toFixed(0), "%\u5019\u9009\u4EBA"));
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
setText('');
|
|
35
|
+
}
|
|
30
36
|
}
|
|
31
|
-
}, [score, scoreRankIntervals]);
|
|
37
|
+
}, [score, reportRank, scoreRankIntervals]);
|
|
32
38
|
if (!scoreRankIntervals || (scoreRankIntervals === null || scoreRankIntervals === void 0 ? void 0 : scoreRankIntervals.length) === 0)
|
|
33
39
|
return null;
|
|
34
|
-
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.
|
|
40
|
+
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body2", flexShrink: 0 }, { children: [text, "\u00A0"] })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", sx: { height: 12, mt: 0.5 } }, { children: scoreRankIntervals === null || scoreRankIntervals === void 0 ? void 0 : scoreRankIntervals.map(function (_a, index) {
|
|
35
41
|
var rank = _a.rank, _b = _a.scoreRankIntervals, startRankProportion = _b.startRankProportion, endRankProportion = _b.endRankProportion;
|
|
36
42
|
return [
|
|
37
43
|
(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, { sx: {
|
|
@@ -104,6 +104,12 @@ export interface InterviewCheat {
|
|
|
104
104
|
isCheat: boolean;
|
|
105
105
|
info: string;
|
|
106
106
|
}
|
|
107
|
+
export interface CustomInterviewDimRank {
|
|
108
|
+
evaluationToken: string;
|
|
109
|
+
rank: number;
|
|
110
|
+
total: number;
|
|
111
|
+
}
|
|
112
|
+
export declare type CustomInterviewDimRankMap = Record<string, CustomInterviewDimRank>;
|
|
107
113
|
export interface AiReportProps {
|
|
108
114
|
token: string;
|
|
109
115
|
scoreRankIntervals?: ScoreRankInterval[];
|
|
@@ -115,6 +121,11 @@ export interface AiReportProps {
|
|
|
115
121
|
operableButtons?: Array<'export' | 'refresh' | 'scoreRank' | 'abilities' | 'sendReminder'>;
|
|
116
122
|
stepToken?: string;
|
|
117
123
|
interviewCheat?: InterviewCheat;
|
|
124
|
+
reportRank?: {
|
|
125
|
+
total: number;
|
|
126
|
+
rank: number;
|
|
127
|
+
};
|
|
128
|
+
customInterviewDimRankMap?: CustomInterviewDimRankMap;
|
|
118
129
|
onLoad?: (values: AiReportLoadedValues) => void;
|
|
119
130
|
onExportReportClick?: () => void;
|
|
120
131
|
onScoreChange?: (scoreState?: ScoreManualUpdateState) => void;
|
|
@@ -12,6 +12,11 @@ export declare const useAiReport: (props: AiReportProps) => {
|
|
|
12
12
|
operableButtons?: ("export" | "refresh" | "scoreRank" | "abilities" | "sendReminder")[] | undefined;
|
|
13
13
|
stepToken?: string | undefined;
|
|
14
14
|
interviewCheat?: import("./interface").InterviewCheat | undefined;
|
|
15
|
+
reportRank?: {
|
|
16
|
+
total: number;
|
|
17
|
+
rank: number;
|
|
18
|
+
} | undefined;
|
|
19
|
+
customInterviewDimRankMap?: import("./interface").CustomInterviewDimRankMap | undefined;
|
|
15
20
|
onLoad?: ((values: import("./interface").AiReportLoadedValues) => void) | undefined;
|
|
16
21
|
onExportReportClick?: (() => void) | undefined;
|
|
17
22
|
onScoreChange?: ((scoreState?: import("./interface").ScoreManualUpdateState | undefined) => void) | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const rankPercent: (r: number, t: number) => number;
|
|
@@ -14,6 +14,11 @@ export declare const useAiReportStore: (depsFn?: import("hox/es/types").DepsFn<{
|
|
|
14
14
|
operableButtons?: ("export" | "refresh" | "scoreRank" | "abilities" | "sendReminder")[] | undefined;
|
|
15
15
|
stepToken?: string | undefined;
|
|
16
16
|
interviewCheat?: import("@/modules/ai-report/interface").InterviewCheat | undefined;
|
|
17
|
+
reportRank?: {
|
|
18
|
+
total: number;
|
|
19
|
+
rank: number;
|
|
20
|
+
} | undefined;
|
|
21
|
+
customInterviewDimRankMap?: import("@/modules/ai-report/interface").CustomInterviewDimRankMap | undefined;
|
|
17
22
|
onLoad?: ((values: import("@/modules/ai-report/interface").AiReportLoadedValues) => void) | undefined;
|
|
18
23
|
onExportReportClick?: (() => void) | undefined;
|
|
19
24
|
onScoreChange?: ((scoreState?: import("@/modules/ai-report/interface").ScoreManualUpdateState | undefined) => void) | undefined;
|
|
@@ -35,6 +40,11 @@ export declare const useAiReportStore: (depsFn?: import("hox/es/types").DepsFn<{
|
|
|
35
40
|
operableButtons?: ("export" | "refresh" | "scoreRank" | "abilities" | "sendReminder")[] | undefined;
|
|
36
41
|
stepToken?: string | undefined;
|
|
37
42
|
interviewCheat?: import("@/modules/ai-report/interface").InterviewCheat | undefined;
|
|
43
|
+
reportRank?: {
|
|
44
|
+
total: number;
|
|
45
|
+
rank: number;
|
|
46
|
+
} | undefined;
|
|
47
|
+
customInterviewDimRankMap?: import("@/modules/ai-report/interface").CustomInterviewDimRankMap | undefined;
|
|
38
48
|
onLoad?: ((values: import("@/modules/ai-report/interface").AiReportLoadedValues) => void) | undefined;
|
|
39
49
|
onExportReportClick?: (() => void) | undefined;
|
|
40
50
|
onScoreChange?: ((scoreState?: import("@/modules/ai-report/interface").ScoreManualUpdateState | undefined) => void) | undefined;
|
|
@@ -56,6 +66,11 @@ export declare const useAiReportStore: (depsFn?: import("hox/es/types").DepsFn<{
|
|
|
56
66
|
operableButtons?: ("export" | "refresh" | "scoreRank" | "abilities" | "sendReminder")[] | undefined;
|
|
57
67
|
stepToken?: string | undefined;
|
|
58
68
|
interviewCheat?: import("@/modules/ai-report/interface").InterviewCheat | undefined;
|
|
69
|
+
reportRank?: {
|
|
70
|
+
total: number;
|
|
71
|
+
rank: number;
|
|
72
|
+
} | undefined;
|
|
73
|
+
customInterviewDimRankMap?: import("@/modules/ai-report/interface").CustomInterviewDimRankMap | undefined;
|
|
59
74
|
onLoad?: ((values: import("@/modules/ai-report/interface").AiReportLoadedValues) => void) | undefined;
|
|
60
75
|
onExportReportClick?: (() => void) | undefined;
|
|
61
76
|
onScoreChange?: ((scoreState?: import("@/modules/ai-report/interface").ScoreManualUpdateState | undefined) => void) | undefined;
|
|
@@ -25,6 +25,8 @@ exports.useAiReportStore = (_a = (0, hox_1.createGlobalStore)(function () {
|
|
|
25
25
|
canEditAiDimension: true,
|
|
26
26
|
scoreRankIntervals: [],
|
|
27
27
|
operableButtons: [],
|
|
28
|
+
reportRank: { rank: 0, total: 0 },
|
|
29
|
+
customInterviewDimRankMap: {},
|
|
28
30
|
}), state = _a[0], updateState = _a[1];
|
|
29
31
|
var _b = (0, react_1.useState)(), reportResult = _b[0], updateReportResult = _b[1];
|
|
30
32
|
return __assign(__assign({}, state), { reportResult: reportResult, updateState: updateState, updateReportResult: updateReportResult });
|