eli-video-interview 1.1.3 → 1.1.6
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-question/components/QuestionModel/Item.js +2 -4
- package/esm/modules/ai-question/components/QuestionModel/List.js +9 -1
- package/esm/modules/ai-question/components/QuestionModel/interface.d.ts +1 -0
- package/esm/modules/ai-report/components/VideoQuestion/QuestionItem.js +6 -7
- package/esm/modules/ai-report/interface.d.ts +1 -0
- package/esm/modules/ai-report/useAiReport.d.ts +1 -0
- package/esm/store/ai-question/question-model-store.js +21 -17
- package/esm/store/ai-report/global-store.d.ts +3 -0
- package/lib/modules/ai-question/components/QuestionModel/Item.js +2 -4
- package/lib/modules/ai-question/components/QuestionModel/List.js +9 -1
- package/lib/modules/ai-question/components/QuestionModel/interface.d.ts +1 -0
- package/lib/modules/ai-report/components/VideoQuestion/QuestionItem.js +6 -7
- package/lib/modules/ai-report/interface.d.ts +1 -0
- package/lib/modules/ai-report/useAiReport.d.ts +1 -0
- package/lib/store/ai-question/question-model-store.js +20 -16
- package/lib/store/ai-report/global-store.d.ts +3 -0
- package/package.json +1 -1
|
@@ -29,10 +29,8 @@ import { useUpdateQuestionStore } from "../../../../store/ai-question/question-u
|
|
|
29
29
|
import { getSecondToTime } from "../../../../utils/utils";
|
|
30
30
|
import { TEST_TYPE_READONLY, DISABLED_REPEAT_TYPE, IS_AI_ANALYSIS } from "../../../../constants/ai-question";
|
|
31
31
|
var QuestionModelListItem = function (props) {
|
|
32
|
-
var index = props.index, steps = props.steps, step = __rest(props, ["index", "steps"]);
|
|
32
|
+
var index = props.index, disabledWeight = props.disabledWeight, steps = props.steps, step = __rest(props, ["index", "disabledWeight", "steps"]);
|
|
33
33
|
var token = step.token, name = step.name, desc = step.desc, duration = step.duration, weight = step.weight, type = step.type, aiShowType = step.aiShowType, answerStatus = step.answerStatus, category = step.category;
|
|
34
|
-
var aiTypeList = steps.filter(function (step) { return IS_AI_ANALYSIS(step); });
|
|
35
|
-
var lastAiTestToken = aiTypeList.length ? aiTypeList[aiTypeList.length - 1].token : '';
|
|
36
34
|
var isAiAnalysis = IS_AI_ANALYSIS(step);
|
|
37
35
|
var _a = useQuestionModelStore(), editModel = _a.editModel, removeModel = _a.removeModel, updateModelWeight = _a.updateModelWeight;
|
|
38
36
|
var updateQuestionState = useUpdateQuestionStore().updateQuestionState;
|
|
@@ -69,6 +67,6 @@ var QuestionModelListItem = function (props) {
|
|
|
69
67
|
console.log(answerStatus);
|
|
70
68
|
editModel(__assign(__assign({}, step), { answerStatus: answerStatus === 2 ? 1 : 2 }), index);
|
|
71
69
|
}, [editModel, answerStatus, step, index]);
|
|
72
|
-
return (_jsxs(Paper, __assign({ variant: "outlined", sx: { display: 'block', mt: 2 } }, { children: [_jsxs(Box, __assign({ display: "flex", borderBottom: "1px solid rgba(0, 0, 0, 0.08)" }, { children: [_jsx(Box, __assign({ width: 40, display: "flex", alignItems: "center", justifyContent: "center", sx: { cursor: 'move' } }, { children: _jsx(DragIndicatorIcon, { className: "dragHandle" }) })), _jsxs(Box, __assign({ flex: "1 0", padding: "16px 0" }, { children: [_jsxs(Box, __assign({ display: "flex", justifyContent: "space-between" }, { children: [_jsxs(Box, __assign({ flex: "1 0", display: "flex", alignItems: "center" }, { children: [_jsx(Typography, __assign({ variant: "subtitle1" }, { children: name })), category === null || category === void 0 ? void 0 : category.map(function (label) { return label && _jsx(Chip, { color: "default", label: label, size: "medium", sx: { ml: 1 } }, label); }), _jsx(Typography, __assign({ sx: { ml: 2 }, variant: "body2", color: "secondary" }, { children: getSecondToTime(Number(duration)) }))] })), _jsxs(Box, __assign({ width: 62, mr: 1, textAlign: "right" }, { children: [!TEST_TYPE_READONLY.includes(type) && (_jsx(IconButton, __assign({ size: "small", onClick: handleEdit }, { children: _jsx(EditIcon, {}) }))), _jsx(IconButton, __assign({ size: "small", onClick: handleRemove }, { children: _jsx(DeleteIcon, {}) }))] }))] })), _jsxs(Box, __assign({ mt: 1, display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: [_jsx(Typography, __assign({ variant: "body2", color: "secondary" }, { children: desc })), !DISABLED_REPEAT_TYPE.includes(type) && (_jsx(FormGroup, __assign({ sx: { flexShrink: 0, ml: 2 } }, { children: _jsx(FormControlLabel, { control: _jsx(Switch, { size: "small", checked: answerStatus === 1 }), label: _jsx(Typography, __assign({ fontSize: 12, lineHeight: 1.5, color: "rgba(0, 0, 0, 0.56)" }, { children: "\u5141\u8BB8\u91CD\u590D\u7B54\u9898" })), onChange: handleAnswerStatus }) })))] }))] }))] })), isAiAnalysis && (_jsxs(Box, __assign({ display: "flex", alignItems: "center", padding: "3px 0 3px 40px" }, { children: [_jsx(Typography, __assign({ variant: "body2" }, { children: "\u6743\u91CD\u5360\u6BD4\uFF1A" })), _jsx(Input, { sx: { width: 82 }, size: "small", value: weight, endAdornment: "%", disabled:
|
|
70
|
+
return (_jsxs(Paper, __assign({ variant: "outlined", sx: { display: 'block', mt: 2 } }, { children: [_jsxs(Box, __assign({ display: "flex", borderBottom: "1px solid rgba(0, 0, 0, 0.08)" }, { children: [_jsx(Box, __assign({ width: 40, display: "flex", alignItems: "center", justifyContent: "center", sx: { cursor: 'move' } }, { children: _jsx(DragIndicatorIcon, { className: "dragHandle" }) })), _jsxs(Box, __assign({ flex: "1 0", padding: "16px 0" }, { children: [_jsxs(Box, __assign({ display: "flex", justifyContent: "space-between" }, { children: [_jsxs(Box, __assign({ flex: "1 0", display: "flex", alignItems: "center" }, { children: [_jsx(Typography, __assign({ variant: "subtitle1" }, { children: name })), category === null || category === void 0 ? void 0 : category.map(function (label) { return label && _jsx(Chip, { color: "default", label: label, size: "medium", sx: { ml: 1 } }, label); }), _jsx(Typography, __assign({ sx: { ml: 2 }, variant: "body2", color: "secondary" }, { children: getSecondToTime(Number(duration)) }))] })), _jsxs(Box, __assign({ width: 62, mr: 1, textAlign: "right" }, { children: [!TEST_TYPE_READONLY.includes(type) && (_jsx(IconButton, __assign({ size: "small", onClick: handleEdit }, { children: _jsx(EditIcon, {}) }))), _jsx(IconButton, __assign({ size: "small", onClick: handleRemove }, { children: _jsx(DeleteIcon, {}) }))] }))] })), _jsxs(Box, __assign({ mt: 1, display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: [_jsx(Typography, __assign({ variant: "body2", color: "secondary" }, { children: desc })), !DISABLED_REPEAT_TYPE.includes(type) && (_jsx(FormGroup, __assign({ sx: { flexShrink: 0, ml: 2 } }, { children: _jsx(FormControlLabel, { control: _jsx(Switch, { size: "small", checked: answerStatus === 1 }), label: _jsx(Typography, __assign({ fontSize: 12, lineHeight: 1.5, color: "rgba(0, 0, 0, 0.56)" }, { children: "\u5141\u8BB8\u91CD\u590D\u7B54\u9898" })), onChange: handleAnswerStatus }) })))] }))] }))] })), isAiAnalysis && (_jsxs(Box, __assign({ display: "flex", alignItems: "center", padding: "3px 0 3px 40px" }, { children: [_jsx(Typography, __assign({ variant: "body2" }, { children: "\u6743\u91CD\u5360\u6BD4\uFF1A" })), _jsx(Input, { sx: { width: 82 }, size: "small", value: weight, endAdornment: "%", disabled: disabledWeight, onChange: handleWeightChange, onBlur: handleWeightBlur })] })))] })));
|
|
73
71
|
};
|
|
74
72
|
export default memo(QuestionModelListItem);
|
|
@@ -15,12 +15,18 @@ import { Box, Empty } from 'fbm-ui';
|
|
|
15
15
|
import Sortable from 'sortablejs';
|
|
16
16
|
import { arrayMoveImmutable } from 'array-move';
|
|
17
17
|
import { useQuestionModelStore } from "../../../../store/ai-question/question-model-store";
|
|
18
|
+
import { IS_AI_ANALYSIS } from "../../../../constants/ai-question";
|
|
18
19
|
import QuestionModelListItem from './Item';
|
|
19
20
|
var QuestionModelList = function () {
|
|
20
21
|
var ref = useRef();
|
|
21
22
|
var sortable = useRef();
|
|
22
23
|
var _a = useQuestionModelStore(), questionModelData = _a.questionModelData, updateModel = _a.updateModel;
|
|
23
24
|
var _b = (questionModelData || {}).steps, steps = _b === void 0 ? [] : _b;
|
|
25
|
+
var lastAiTestIndex = 0;
|
|
26
|
+
steps.forEach(function (step, i) {
|
|
27
|
+
if (IS_AI_ANALYSIS(step))
|
|
28
|
+
lastAiTestIndex = i;
|
|
29
|
+
});
|
|
24
30
|
useEffect(function () {
|
|
25
31
|
if (steps) {
|
|
26
32
|
sortable.current && sortable.current.destroy();
|
|
@@ -34,6 +40,8 @@ var QuestionModelList = function () {
|
|
|
34
40
|
});
|
|
35
41
|
}
|
|
36
42
|
}, [questionModelData, updateModel, steps]);
|
|
37
|
-
return (_jsx(Box, __assign({ width: "100%", sx: steps.length > 0 ? {} : { height: 'calc(100% - 100px)', display: 'flex', alignItems: 'center', justifyContent: 'center' }, ref: ref }, { children: steps.length > 0 ? (steps.map(function (item, index) {
|
|
43
|
+
return (_jsx(Box, __assign({ width: "100%", sx: steps.length > 0 ? {} : { height: 'calc(100% - 100px)', display: 'flex', alignItems: 'center', justifyContent: 'center' }, ref: ref }, { children: steps.length > 0 ? (steps.map(function (item, index) {
|
|
44
|
+
return (_jsx(QuestionModelListItem, __assign({ steps: steps, index: index, disabledWeight: index === lastAiTestIndex }, item), item.uniqueId || item.token));
|
|
45
|
+
})) : (_jsx(Empty, { desc: "\u6682\u65E0\u6570\u636E" })) })));
|
|
38
46
|
};
|
|
39
47
|
export default QuestionModelList;
|
|
@@ -27,14 +27,13 @@ var STEP_NO_ANSWER = INTERVIEW_STEP_STATUS.STEP_NO_ANSWER, STEP_COMPLETED = INTE
|
|
|
27
27
|
var QuestionItem = function (props) {
|
|
28
28
|
var token = props.token, index = props.index, status = props.status, _a = props.answer, analysisResult = _a.analysisResult, videoUrl = _a.videoUrl, _b = props.question, name = _b.name, type = _b.type, _c = props.scoreInfo, score = _c.score, weight = _c.weight, originScore = _c.originScore, finalScore = _c.finalScore, abilities = _c.abilities;
|
|
29
29
|
var _d = useState(false), showAbilities = _d[0], setShowAbilities = _d[1];
|
|
30
|
-
var _e = useAiReportStore(function (store) { return [
|
|
31
|
-
store.reportResult,
|
|
32
|
-
store.stepToken,
|
|
33
|
-
store.operableButtons,
|
|
34
|
-
]; }), reportResult = _e.reportResult, stepToken = _e.stepToken, operableButtons = _e.operableButtons, updateState = _e.updateState, updateReportResult = _e.updateReportResult, onScoreChange = _e.onScoreChange, onStepChange = _e.onStepChange;
|
|
30
|
+
var _e = useAiReportStore(function (store) { return [store.reportResult, store.stepToken, store.operableButtons, store.showAbilitiesDetails]; }), reportResult = _e.reportResult, stepToken = _e.stepToken, operableButtons = _e.operableButtons, showAbilitiesDetails = _e.showAbilitiesDetails, updateState = _e.updateState, updateReportResult = _e.updateReportResult, onScoreChange = _e.onScoreChange, onStepChange = _e.onStepChange;
|
|
35
31
|
var steps = (reportResult || {}).steps;
|
|
36
|
-
var
|
|
32
|
+
var isAbilities = operableButtons === null || operableButtons === void 0 ? void 0 : operableButtons.includes('abilities');
|
|
37
33
|
var isExistWeight = weight > 0;
|
|
34
|
+
var isShowAbilitiesButton = abilities.length > 0 && isAbilities && !showAbilitiesDetails;
|
|
35
|
+
var isShowWeight = abilities.length === 0 || showAbilities || !isAbilities || showAbilitiesDetails;
|
|
36
|
+
var isShowAbilitiesDetails = abilities.length > 0 && (showAbilities || showAbilitiesDetails);
|
|
38
37
|
var comprehensiveScore = useMemo(function () {
|
|
39
38
|
if (status === STEP_COMPLETED) {
|
|
40
39
|
return (_jsx(Typography, __assign({ variant: "caption", color: theme.palette.primary.main, fontSize: 16, fontWeight: 500 }, { children: formatScore(score) })));
|
|
@@ -84,6 +83,6 @@ var QuestionItem = function (props) {
|
|
|
84
83
|
mt: 2,
|
|
85
84
|
cursor: videoUrl ? 'pointer' : 'inherit',
|
|
86
85
|
borderColor: token === stepToken ? theme.palette.primary.main : '',
|
|
87
|
-
}, variant: "outlined", onClick: handleClickItem }, { children: [_jsxs(Typography, __assign({ fontSize: 14, color: token === stepToken ? theme.palette.primary.main : theme.palette.text.primary }, { children: [index + 1, ".", name] })), _jsxs(QuestionDesc, { children: [_jsx(FormatQuoteIcon, {}), status === STEP_IN_CALCULATION ? (_jsx(Typography, __assign({ variant: "caption", color: "secondary" }, { children: "\u89C6\u9891\u5904\u7406\u4E2D\uFF0C\u8BF7\u7A0D\u5019" }))) : (_jsxs(_Fragment, { children: [_jsx(Typography, { variant: "caption", color: "secondary", dangerouslySetInnerHTML: { __html: renderText } }), type === QUESTION_TYPE.COLOR_BLINDNESS && (analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.img) && (_jsxs(Box, { children: [_jsx("img", { style: { width: 100, height: 100 }, src: analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.img, alt: "" }), _jsxs(Typography, __assign({ variant: "caption", color: "secondary", ml: 1 }, { children: ["\u56DE\u7B54\uFF1A", analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.answer] }))] }))] }))] }), isExistWeight && status === STEP_COMPLETED && (_jsxs(Box, __assign({ mt: 2, display: "flex" }, { children: [_jsxs(Typography, __assign({ variant: "body2", mr: 4 }, { children: ["\u8BC4\u5206\uFF1A", finalScore.toFixed(0), "\u5206"] })),
|
|
86
|
+
}, variant: "outlined", onClick: handleClickItem }, { children: [_jsxs(Typography, __assign({ fontSize: 14, color: token === stepToken ? theme.palette.primary.main : theme.palette.text.primary }, { children: [index + 1, ".", name] })), _jsxs(QuestionDesc, { children: [_jsx(FormatQuoteIcon, {}), status === STEP_IN_CALCULATION ? (_jsx(Typography, __assign({ variant: "caption", color: "secondary" }, { children: "\u89C6\u9891\u5904\u7406\u4E2D\uFF0C\u8BF7\u7A0D\u5019" }))) : (_jsxs(_Fragment, { children: [_jsx(Typography, { variant: "caption", color: "secondary", dangerouslySetInnerHTML: { __html: renderText } }), type === QUESTION_TYPE.COLOR_BLINDNESS && (analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.img) && (_jsxs(Box, { children: [_jsx("img", { style: { width: 100, height: 100 }, src: analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.img, alt: "" }), _jsxs(Typography, __assign({ variant: "caption", color: "secondary", ml: 1 }, { children: ["\u56DE\u7B54\uFF1A", analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.answer] }))] }))] }))] }), isExistWeight && status === STEP_COMPLETED && (_jsxs(Box, __assign({ mt: 2, display: "flex" }, { children: [_jsxs(Typography, __assign({ variant: "body2", mr: 4 }, { children: ["\u8BC4\u5206\uFF1A", finalScore.toFixed(0), "\u5206"] })), isShowWeight && _jsxs(Typography, __assign({ variant: "body2" }, { children: ["\u5355\u9898\u6743\u91CD\uFF1A", weight, "%"] }))] }))), isExistWeight && (_jsxs(Box, __assign({ width: "100%", display: "flex", alignItems: "center", mt: 2 }, { children: [_jsx(Box, __assign({ flex: "1 0", display: "flex", alignItems: "center" }, { children: status === STEP_COMPLETED && (_jsxs(_Fragment, { children: [_jsx(ScoreSlider, { originScore: originScore, finalScore: finalScore, isShowScoreRank: true, onChangeCommitted: handleChangeCommitted }), isShowAbilitiesButton && (_jsx(Button, __assign({ variant: "text", onClick: function () { return setShowAbilities(!showAbilities); } }, { children: showAbilities ? '收起' : '详情' })))] })) })), _jsx(Box, __assign({ width: 150, textAlign: "right" }, { children: _jsxs(Typography, __assign({ variant: "body1", fontSize: 16, fontWeight: 500 }, { children: ["\u7EFC\u5408\u8BC4\u5206\uFF1A", comprehensiveScore] })) }))] }))), isShowAbilitiesDetails && _jsx(Abilities, { stepIndex: index })] }), token));
|
|
88
87
|
};
|
|
89
88
|
export default QuestionItem;
|
|
@@ -98,6 +98,7 @@ export interface AiReportProps {
|
|
|
98
98
|
scoreRankIntervals?: ScoreRankInterval[];
|
|
99
99
|
disabledScore?: boolean;
|
|
100
100
|
reminderSent?: boolean;
|
|
101
|
+
showAbilitiesDetails?: boolean;
|
|
101
102
|
operableButtons?: Array<'export' | 'refresh' | 'scoreRank' | 'abilities' | 'sendReminder'>;
|
|
102
103
|
stepToken?: string;
|
|
103
104
|
interviewCheat?: InterviewCheat;
|
|
@@ -6,6 +6,7 @@ export declare const useAiReport: (props: AiReportProps) => {
|
|
|
6
6
|
scoreRankIntervals?: import("./components/RankingRange/interface").ScoreRankInterval[] | undefined;
|
|
7
7
|
disabledScore?: boolean | undefined;
|
|
8
8
|
reminderSent?: boolean | undefined;
|
|
9
|
+
showAbilitiesDetails?: boolean | undefined;
|
|
9
10
|
operableButtons?: ("export" | "refresh" | "scoreRank" | "abilities" | "sendReminder")[] | undefined;
|
|
10
11
|
stepToken?: string | undefined;
|
|
11
12
|
interviewCheat?: import("./interface").InterviewCheat | undefined;
|
|
@@ -14,7 +14,7 @@ import { useState, useCallback } from 'react';
|
|
|
14
14
|
import { createGlobalStore } from 'hox';
|
|
15
15
|
import update from 'immutability-helper';
|
|
16
16
|
import { IS_AI_ANALYSIS } from "../../constants/ai-question";
|
|
17
|
-
import { formatNumberDecimal, computeDecimalValue, uniqueId
|
|
17
|
+
import { formatNumberDecimal, computeDecimalValue, uniqueId } from "../../utils/utils";
|
|
18
18
|
export var useQuestionModelStore = (_a = createGlobalStore(function () {
|
|
19
19
|
var _a = useState(), questionModelData = _a[0], updateModel = _a[1];
|
|
20
20
|
var _b = (questionModelData || {}).steps, steps = _b === void 0 ? [] : _b;
|
|
@@ -23,9 +23,16 @@ export var useQuestionModelStore = (_a = createGlobalStore(function () {
|
|
|
23
23
|
* @param steps 模型数据
|
|
24
24
|
*/
|
|
25
25
|
var computeWeight = useCallback(function (steps) {
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
var
|
|
26
|
+
var lastAiTestIndex = 0;
|
|
27
|
+
// AI评分题
|
|
28
|
+
var aiTypeList = steps.filter(function (step, index) {
|
|
29
|
+
if (IS_AI_ANALYSIS(step)) {
|
|
30
|
+
lastAiTestIndex = index;
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
return false;
|
|
34
|
+
});
|
|
35
|
+
var aiTypeListLength = aiTypeList.length;
|
|
29
36
|
var weightList = aiTypeList.filter(function (_a) {
|
|
30
37
|
var isNotCompute = _a.isNotCompute;
|
|
31
38
|
return !isNotCompute;
|
|
@@ -34,25 +41,22 @@ export var useQuestionModelStore = (_a = createGlobalStore(function () {
|
|
|
34
41
|
return Math.floor(Number(weight));
|
|
35
42
|
});
|
|
36
43
|
var weightsLen = Array.from(new Set(weightList)).length; // 权重值分组数量
|
|
37
|
-
var lastAiTestToken = aiTypeList.length ? aiTypeList[aiTypeList.length - 1].token : '';
|
|
38
44
|
var beforeTotalWeight = aiTypeList
|
|
39
|
-
.map(function (_a) {
|
|
40
|
-
var
|
|
41
|
-
return (
|
|
45
|
+
.map(function (_a, index) {
|
|
46
|
+
var weight = _a.weight;
|
|
47
|
+
return (index !== aiTypeListLength - 1 ? Number(weight) : 0);
|
|
42
48
|
})
|
|
43
49
|
.reduce(function (pv, i) { return pv + i; }, 0);
|
|
44
50
|
var totalDuration = 0;
|
|
45
|
-
var getWeight = function (_a) {
|
|
46
|
-
var
|
|
51
|
+
var getWeight = function (_a, i) {
|
|
52
|
+
var weight = _a.weight;
|
|
47
53
|
if (weightsLen <= 1) {
|
|
48
|
-
var averageWeight = 100 /
|
|
49
|
-
var disableWeight = 100 - Math.floor(averageWeight * (
|
|
50
|
-
return
|
|
51
|
-
? computeDecimalValue(disableWeight.toString())
|
|
52
|
-
: computeDecimalValue(averageWeight.toString());
|
|
54
|
+
var averageWeight = 100 / aiTypeListLength;
|
|
55
|
+
var disableWeight = 100 - Math.floor(averageWeight * (aiTypeListLength - 1) * 100) / 100;
|
|
56
|
+
return i === lastAiTestIndex ? computeDecimalValue(disableWeight.toString()) : computeDecimalValue(averageWeight.toString());
|
|
53
57
|
}
|
|
54
58
|
else {
|
|
55
|
-
return
|
|
59
|
+
return i !== lastAiTestIndex ? weight : computeDecimalValue((100 - beforeTotalWeight).toString());
|
|
56
60
|
}
|
|
57
61
|
};
|
|
58
62
|
var $splice = steps.map(function (step, i) {
|
|
@@ -61,7 +65,7 @@ export var useQuestionModelStore = (_a = createGlobalStore(function () {
|
|
|
61
65
|
return [
|
|
62
66
|
i,
|
|
63
67
|
1,
|
|
64
|
-
__assign(__assign({}, step), { weight: IS_AI_ANALYSIS(step) ? getWeight(step) : 0 }),
|
|
68
|
+
__assign(__assign({}, step), { weight: IS_AI_ANALYSIS(step) ? getWeight(step, i) : 0 }),
|
|
65
69
|
];
|
|
66
70
|
});
|
|
67
71
|
updateModel(__assign(__assign({}, questionModelData), { duration: totalDuration, steps: update(steps, { $splice: $splice }) }));
|
|
@@ -8,6 +8,7 @@ export declare const useAiReportStore: (depsFn?: import("hox/es/types").DepsFn<{
|
|
|
8
8
|
scoreRankIntervals?: import("../../modules/ai-report/components/RankingRange/interface").ScoreRankInterval[] | undefined;
|
|
9
9
|
disabledScore?: boolean | undefined;
|
|
10
10
|
reminderSent?: boolean | undefined;
|
|
11
|
+
showAbilitiesDetails?: boolean | undefined;
|
|
11
12
|
operableButtons?: ("export" | "refresh" | "scoreRank" | "abilities" | "sendReminder")[] | undefined;
|
|
12
13
|
stepToken?: string | undefined;
|
|
13
14
|
interviewCheat?: import("@/modules/ai-report/interface").InterviewCheat | undefined;
|
|
@@ -26,6 +27,7 @@ export declare const useAiReportStore: (depsFn?: import("hox/es/types").DepsFn<{
|
|
|
26
27
|
scoreRankIntervals?: import("../../modules/ai-report/components/RankingRange/interface").ScoreRankInterval[] | undefined;
|
|
27
28
|
disabledScore?: boolean | undefined;
|
|
28
29
|
reminderSent?: boolean | undefined;
|
|
30
|
+
showAbilitiesDetails?: boolean | undefined;
|
|
29
31
|
operableButtons?: ("export" | "refresh" | "scoreRank" | "abilities" | "sendReminder")[] | undefined;
|
|
30
32
|
stepToken?: string | undefined;
|
|
31
33
|
interviewCheat?: import("@/modules/ai-report/interface").InterviewCheat | undefined;
|
|
@@ -44,6 +46,7 @@ export declare const useAiReportStore: (depsFn?: import("hox/es/types").DepsFn<{
|
|
|
44
46
|
scoreRankIntervals?: import("../../modules/ai-report/components/RankingRange/interface").ScoreRankInterval[] | undefined;
|
|
45
47
|
disabledScore?: boolean | undefined;
|
|
46
48
|
reminderSent?: boolean | undefined;
|
|
49
|
+
showAbilitiesDetails?: boolean | undefined;
|
|
47
50
|
operableButtons?: ("export" | "refresh" | "scoreRank" | "abilities" | "sendReminder")[] | undefined;
|
|
48
51
|
stepToken?: string | undefined;
|
|
49
52
|
interviewCheat?: import("@/modules/ai-report/interface").InterviewCheat | undefined;
|
|
@@ -31,10 +31,8 @@ var question_update_store_1 = require("../../../../store/ai-question/question-up
|
|
|
31
31
|
var utils_1 = require("../../../../utils/utils");
|
|
32
32
|
var ai_question_1 = require("../../../../constants/ai-question");
|
|
33
33
|
var QuestionModelListItem = function (props) {
|
|
34
|
-
var index = props.index, steps = props.steps, step = __rest(props, ["index", "steps"]);
|
|
34
|
+
var index = props.index, disabledWeight = props.disabledWeight, steps = props.steps, step = __rest(props, ["index", "disabledWeight", "steps"]);
|
|
35
35
|
var token = step.token, name = step.name, desc = step.desc, duration = step.duration, weight = step.weight, type = step.type, aiShowType = step.aiShowType, answerStatus = step.answerStatus, category = step.category;
|
|
36
|
-
var aiTypeList = steps.filter(function (step) { return (0, ai_question_1.IS_AI_ANALYSIS)(step); });
|
|
37
|
-
var lastAiTestToken = aiTypeList.length ? aiTypeList[aiTypeList.length - 1].token : '';
|
|
38
36
|
var isAiAnalysis = (0, ai_question_1.IS_AI_ANALYSIS)(step);
|
|
39
37
|
var _a = (0, question_model_store_1.useQuestionModelStore)(), editModel = _a.editModel, removeModel = _a.removeModel, updateModelWeight = _a.updateModelWeight;
|
|
40
38
|
var updateQuestionState = (0, question_update_store_1.useUpdateQuestionStore)().updateQuestionState;
|
|
@@ -71,6 +69,6 @@ var QuestionModelListItem = function (props) {
|
|
|
71
69
|
console.log(answerStatus);
|
|
72
70
|
editModel(__assign(__assign({}, step), { answerStatus: answerStatus === 2 ? 1 : 2 }), index);
|
|
73
71
|
}, [editModel, answerStatus, step, index]);
|
|
74
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Paper, __assign({ variant: "outlined", sx: { display: 'block', mt: 2 } }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", borderBottom: "1px solid rgba(0, 0, 0, 0.08)" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ width: 40, display: "flex", alignItems: "center", justifyContent: "center", sx: { cursor: 'move' } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.DragIndicatorIcon, { className: "dragHandle" }) })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ flex: "1 0", padding: "16px 0" }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ flex: "1 0", display: "flex", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "subtitle1" }, { children: name })), category === null || category === void 0 ? void 0 : category.map(function (label) { return label && (0, jsx_runtime_1.jsx)(fbm_ui_1.Chip, { color: "default", label: label, size: "medium", sx: { ml: 1 } }, label); }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ sx: { ml: 2 }, variant: "body2", color: "secondary" }, { children: (0, utils_1.getSecondToTime)(Number(duration)) }))] })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ width: 62, mr: 1, textAlign: "right" }, { children: [!ai_question_1.TEST_TYPE_READONLY.includes(type) && ((0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ size: "small", onClick: handleEdit }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.EditIcon, {}) }))), (0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ size: "small", onClick: handleRemove }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.DeleteIcon, {}) }))] }))] })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ mt: 1, display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "secondary" }, { children: desc })), !ai_question_1.DISABLED_REPEAT_TYPE.includes(type) && ((0, jsx_runtime_1.jsx)(material_1.FormGroup, __assign({ sx: { flexShrink: 0, ml: 2 } }, { children: (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Switch, { size: "small", checked: answerStatus === 1 }), label: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ fontSize: 12, lineHeight: 1.5, color: "rgba(0, 0, 0, 0.56)" }, { children: "\u5141\u8BB8\u91CD\u590D\u7B54\u9898" })), onChange: handleAnswerStatus }) })))] }))] }))] })), isAiAnalysis && ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", padding: "3px 0 3px 40px" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2" }, { children: "\u6743\u91CD\u5360\u6BD4\uFF1A" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Input, { sx: { width: 82 }, size: "small", value: weight, endAdornment: "%", disabled:
|
|
72
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Paper, __assign({ variant: "outlined", sx: { display: 'block', mt: 2 } }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", borderBottom: "1px solid rgba(0, 0, 0, 0.08)" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ width: 40, display: "flex", alignItems: "center", justifyContent: "center", sx: { cursor: 'move' } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.DragIndicatorIcon, { className: "dragHandle" }) })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ flex: "1 0", padding: "16px 0" }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ flex: "1 0", display: "flex", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "subtitle1" }, { children: name })), category === null || category === void 0 ? void 0 : category.map(function (label) { return label && (0, jsx_runtime_1.jsx)(fbm_ui_1.Chip, { color: "default", label: label, size: "medium", sx: { ml: 1 } }, label); }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ sx: { ml: 2 }, variant: "body2", color: "secondary" }, { children: (0, utils_1.getSecondToTime)(Number(duration)) }))] })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ width: 62, mr: 1, textAlign: "right" }, { children: [!ai_question_1.TEST_TYPE_READONLY.includes(type) && ((0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ size: "small", onClick: handleEdit }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.EditIcon, {}) }))), (0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ size: "small", onClick: handleRemove }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.DeleteIcon, {}) }))] }))] })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ mt: 1, display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "secondary" }, { children: desc })), !ai_question_1.DISABLED_REPEAT_TYPE.includes(type) && ((0, jsx_runtime_1.jsx)(material_1.FormGroup, __assign({ sx: { flexShrink: 0, ml: 2 } }, { children: (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Switch, { size: "small", checked: answerStatus === 1 }), label: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ fontSize: 12, lineHeight: 1.5, color: "rgba(0, 0, 0, 0.56)" }, { children: "\u5141\u8BB8\u91CD\u590D\u7B54\u9898" })), onChange: handleAnswerStatus }) })))] }))] }))] })), isAiAnalysis && ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", padding: "3px 0 3px 40px" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2" }, { children: "\u6743\u91CD\u5360\u6BD4\uFF1A" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Input, { sx: { width: 82 }, size: "small", value: weight, endAdornment: "%", disabled: disabledWeight, onChange: handleWeightChange, onBlur: handleWeightBlur })] })))] })));
|
|
75
73
|
};
|
|
76
74
|
exports.default = (0, react_1.memo)(QuestionModelListItem);
|
|
@@ -20,12 +20,18 @@ var fbm_ui_1 = require("fbm-ui");
|
|
|
20
20
|
var sortablejs_1 = __importDefault(require("sortablejs"));
|
|
21
21
|
var array_move_1 = require("array-move");
|
|
22
22
|
var question_model_store_1 = require("../../../../store/ai-question/question-model-store");
|
|
23
|
+
var ai_question_1 = require("../../../../constants/ai-question");
|
|
23
24
|
var Item_1 = __importDefault(require("./Item"));
|
|
24
25
|
var QuestionModelList = function () {
|
|
25
26
|
var ref = (0, react_1.useRef)();
|
|
26
27
|
var sortable = (0, react_1.useRef)();
|
|
27
28
|
var _a = (0, question_model_store_1.useQuestionModelStore)(), questionModelData = _a.questionModelData, updateModel = _a.updateModel;
|
|
28
29
|
var _b = (questionModelData || {}).steps, steps = _b === void 0 ? [] : _b;
|
|
30
|
+
var lastAiTestIndex = 0;
|
|
31
|
+
steps.forEach(function (step, i) {
|
|
32
|
+
if ((0, ai_question_1.IS_AI_ANALYSIS)(step))
|
|
33
|
+
lastAiTestIndex = i;
|
|
34
|
+
});
|
|
29
35
|
(0, react_1.useEffect)(function () {
|
|
30
36
|
if (steps) {
|
|
31
37
|
sortable.current && sortable.current.destroy();
|
|
@@ -39,6 +45,8 @@ var QuestionModelList = function () {
|
|
|
39
45
|
});
|
|
40
46
|
}
|
|
41
47
|
}, [questionModelData, updateModel, steps]);
|
|
42
|
-
return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ width: "100%", sx: steps.length > 0 ? {} : { height: 'calc(100% - 100px)', display: 'flex', alignItems: 'center', justifyContent: 'center' }, ref: ref }, { children: steps.length > 0 ? (steps.map(function (item, index) {
|
|
48
|
+
return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ width: "100%", sx: steps.length > 0 ? {} : { height: 'calc(100% - 100px)', display: 'flex', alignItems: 'center', justifyContent: 'center' }, ref: ref }, { children: steps.length > 0 ? (steps.map(function (item, index) {
|
|
49
|
+
return ((0, jsx_runtime_1.jsx)(Item_1.default, __assign({ steps: steps, index: index, disabledWeight: index === lastAiTestIndex }, item), item.uniqueId || item.token));
|
|
50
|
+
})) : ((0, jsx_runtime_1.jsx)(fbm_ui_1.Empty, { desc: "\u6682\u65E0\u6570\u636E" })) })));
|
|
43
51
|
};
|
|
44
52
|
exports.default = QuestionModelList;
|
|
@@ -32,14 +32,13 @@ var STEP_NO_ANSWER = ai_report_1.INTERVIEW_STEP_STATUS.STEP_NO_ANSWER, STEP_COMP
|
|
|
32
32
|
var QuestionItem = function (props) {
|
|
33
33
|
var token = props.token, index = props.index, status = props.status, _a = props.answer, analysisResult = _a.analysisResult, videoUrl = _a.videoUrl, _b = props.question, name = _b.name, type = _b.type, _c = props.scoreInfo, score = _c.score, weight = _c.weight, originScore = _c.originScore, finalScore = _c.finalScore, abilities = _c.abilities;
|
|
34
34
|
var _d = (0, react_1.useState)(false), showAbilities = _d[0], setShowAbilities = _d[1];
|
|
35
|
-
var _e = (0, global_store_1.useAiReportStore)(function (store) { return [
|
|
36
|
-
store.reportResult,
|
|
37
|
-
store.stepToken,
|
|
38
|
-
store.operableButtons,
|
|
39
|
-
]; }), reportResult = _e.reportResult, stepToken = _e.stepToken, operableButtons = _e.operableButtons, updateState = _e.updateState, updateReportResult = _e.updateReportResult, onScoreChange = _e.onScoreChange, onStepChange = _e.onStepChange;
|
|
35
|
+
var _e = (0, global_store_1.useAiReportStore)(function (store) { return [store.reportResult, store.stepToken, store.operableButtons, store.showAbilitiesDetails]; }), reportResult = _e.reportResult, stepToken = _e.stepToken, operableButtons = _e.operableButtons, showAbilitiesDetails = _e.showAbilitiesDetails, updateState = _e.updateState, updateReportResult = _e.updateReportResult, onScoreChange = _e.onScoreChange, onStepChange = _e.onStepChange;
|
|
40
36
|
var steps = (reportResult || {}).steps;
|
|
41
|
-
var
|
|
37
|
+
var isAbilities = operableButtons === null || operableButtons === void 0 ? void 0 : operableButtons.includes('abilities');
|
|
42
38
|
var isExistWeight = weight > 0;
|
|
39
|
+
var isShowAbilitiesButton = abilities.length > 0 && isAbilities && !showAbilitiesDetails;
|
|
40
|
+
var isShowWeight = abilities.length === 0 || showAbilities || !isAbilities || showAbilitiesDetails;
|
|
41
|
+
var isShowAbilitiesDetails = abilities.length > 0 && (showAbilities || showAbilitiesDetails);
|
|
43
42
|
var comprehensiveScore = (0, react_1.useMemo)(function () {
|
|
44
43
|
if (status === STEP_COMPLETED) {
|
|
45
44
|
return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "caption", color: ThemeProvider_1.theme.palette.primary.main, fontSize: 16, fontWeight: 500 }, { children: (0, utils_1.formatScore)(score) })));
|
|
@@ -89,6 +88,6 @@ var QuestionItem = function (props) {
|
|
|
89
88
|
mt: 2,
|
|
90
89
|
cursor: videoUrl ? 'pointer' : 'inherit',
|
|
91
90
|
borderColor: token === stepToken ? ThemeProvider_1.theme.palette.primary.main : '',
|
|
92
|
-
}, variant: "outlined", onClick: handleClickItem }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ fontSize: 14, color: token === stepToken ? ThemeProvider_1.theme.palette.primary.main : ThemeProvider_1.theme.palette.text.primary }, { children: [index + 1, ".", name] })), (0, jsx_runtime_1.jsxs)(styled_1.QuestionDesc, { children: [(0, jsx_runtime_1.jsx)(FormatQuote_1.default, {}), status === STEP_IN_CALCULATION ? ((0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "secondary" }, { children: "\u89C6\u9891\u5904\u7406\u4E2D\uFF0C\u8BF7\u7A0D\u5019" }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, { variant: "caption", color: "secondary", dangerouslySetInnerHTML: { __html: renderText } }), type === ai_question_1.QUESTION_TYPE.COLOR_BLINDNESS && (analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.img) && ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsx)("img", { style: { width: 100, height: 100 }, src: analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.img, alt: "" }), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "secondary", ml: 1 }, { children: ["\u56DE\u7B54\uFF1A", analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.answer] }))] }))] }))] }), isExistWeight && status === STEP_COMPLETED && ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ mt: 2, display: "flex" }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body2", mr: 4 }, { children: ["\u8BC4\u5206\uFF1A", finalScore.toFixed(0), "\u5206"] })),
|
|
91
|
+
}, variant: "outlined", onClick: handleClickItem }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ fontSize: 14, color: token === stepToken ? ThemeProvider_1.theme.palette.primary.main : ThemeProvider_1.theme.palette.text.primary }, { children: [index + 1, ".", name] })), (0, jsx_runtime_1.jsxs)(styled_1.QuestionDesc, { children: [(0, jsx_runtime_1.jsx)(FormatQuote_1.default, {}), status === STEP_IN_CALCULATION ? ((0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "secondary" }, { children: "\u89C6\u9891\u5904\u7406\u4E2D\uFF0C\u8BF7\u7A0D\u5019" }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, { variant: "caption", color: "secondary", dangerouslySetInnerHTML: { __html: renderText } }), type === ai_question_1.QUESTION_TYPE.COLOR_BLINDNESS && (analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.img) && ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsx)("img", { style: { width: 100, height: 100 }, src: analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.img, alt: "" }), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "secondary", ml: 1 }, { children: ["\u56DE\u7B54\uFF1A", analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.answer] }))] }))] }))] }), isExistWeight && status === STEP_COMPLETED && ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ mt: 2, display: "flex" }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body2", mr: 4 }, { children: ["\u8BC4\u5206\uFF1A", finalScore.toFixed(0), "\u5206"] })), isShowWeight && (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body2" }, { children: ["\u5355\u9898\u6743\u91CD\uFF1A", weight, "%"] }))] }))), isExistWeight && ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ width: "100%", display: "flex", alignItems: "center", mt: 2 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ flex: "1 0", display: "flex", alignItems: "center" }, { children: status === STEP_COMPLETED && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ScoreSlider_1.default, { originScore: originScore, finalScore: finalScore, isShowScoreRank: true, onChangeCommitted: handleChangeCommitted }), isShowAbilitiesButton && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "text", onClick: function () { return setShowAbilities(!showAbilities); } }, { children: showAbilities ? '收起' : '详情' })))] })) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ width: 150, textAlign: "right" }, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body1", fontSize: 16, fontWeight: 500 }, { children: ["\u7EFC\u5408\u8BC4\u5206\uFF1A", comprehensiveScore] })) }))] }))), isShowAbilitiesDetails && (0, jsx_runtime_1.jsx)(Abilities_1.default, { stepIndex: index })] }), token));
|
|
93
92
|
};
|
|
94
93
|
exports.default = QuestionItem;
|
|
@@ -98,6 +98,7 @@ export interface AiReportProps {
|
|
|
98
98
|
scoreRankIntervals?: ScoreRankInterval[];
|
|
99
99
|
disabledScore?: boolean;
|
|
100
100
|
reminderSent?: boolean;
|
|
101
|
+
showAbilitiesDetails?: boolean;
|
|
101
102
|
operableButtons?: Array<'export' | 'refresh' | 'scoreRank' | 'abilities' | 'sendReminder'>;
|
|
102
103
|
stepToken?: string;
|
|
103
104
|
interviewCheat?: InterviewCheat;
|
|
@@ -6,6 +6,7 @@ export declare const useAiReport: (props: AiReportProps) => {
|
|
|
6
6
|
scoreRankIntervals?: import("./components/RankingRange/interface").ScoreRankInterval[] | undefined;
|
|
7
7
|
disabledScore?: boolean | undefined;
|
|
8
8
|
reminderSent?: boolean | undefined;
|
|
9
|
+
showAbilitiesDetails?: boolean | undefined;
|
|
9
10
|
operableButtons?: ("export" | "refresh" | "scoreRank" | "abilities" | "sendReminder")[] | undefined;
|
|
10
11
|
stepToken?: string | undefined;
|
|
11
12
|
interviewCheat?: import("./interface").InterviewCheat | undefined;
|
|
@@ -29,9 +29,16 @@ exports.useQuestionModelStore = (_a = (0, hox_1.createGlobalStore)(function () {
|
|
|
29
29
|
* @param steps 模型数据
|
|
30
30
|
*/
|
|
31
31
|
var computeWeight = (0, react_1.useCallback)(function (steps) {
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
var
|
|
32
|
+
var lastAiTestIndex = 0;
|
|
33
|
+
// AI评分题
|
|
34
|
+
var aiTypeList = steps.filter(function (step, index) {
|
|
35
|
+
if ((0, ai_question_1.IS_AI_ANALYSIS)(step)) {
|
|
36
|
+
lastAiTestIndex = index;
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
return false;
|
|
40
|
+
});
|
|
41
|
+
var aiTypeListLength = aiTypeList.length;
|
|
35
42
|
var weightList = aiTypeList.filter(function (_a) {
|
|
36
43
|
var isNotCompute = _a.isNotCompute;
|
|
37
44
|
return !isNotCompute;
|
|
@@ -40,25 +47,22 @@ exports.useQuestionModelStore = (_a = (0, hox_1.createGlobalStore)(function () {
|
|
|
40
47
|
return Math.floor(Number(weight));
|
|
41
48
|
});
|
|
42
49
|
var weightsLen = Array.from(new Set(weightList)).length; // 权重值分组数量
|
|
43
|
-
var lastAiTestToken = aiTypeList.length ? aiTypeList[aiTypeList.length - 1].token : '';
|
|
44
50
|
var beforeTotalWeight = aiTypeList
|
|
45
|
-
.map(function (_a) {
|
|
46
|
-
var
|
|
47
|
-
return (
|
|
51
|
+
.map(function (_a, index) {
|
|
52
|
+
var weight = _a.weight;
|
|
53
|
+
return (index !== aiTypeListLength - 1 ? Number(weight) : 0);
|
|
48
54
|
})
|
|
49
55
|
.reduce(function (pv, i) { return pv + i; }, 0);
|
|
50
56
|
var totalDuration = 0;
|
|
51
|
-
var getWeight = function (_a) {
|
|
52
|
-
var
|
|
57
|
+
var getWeight = function (_a, i) {
|
|
58
|
+
var weight = _a.weight;
|
|
53
59
|
if (weightsLen <= 1) {
|
|
54
|
-
var averageWeight = 100 /
|
|
55
|
-
var disableWeight = 100 - Math.floor(averageWeight * (
|
|
56
|
-
return
|
|
57
|
-
? (0, utils_1.computeDecimalValue)(disableWeight.toString())
|
|
58
|
-
: (0, utils_1.computeDecimalValue)(averageWeight.toString());
|
|
60
|
+
var averageWeight = 100 / aiTypeListLength;
|
|
61
|
+
var disableWeight = 100 - Math.floor(averageWeight * (aiTypeListLength - 1) * 100) / 100;
|
|
62
|
+
return i === lastAiTestIndex ? (0, utils_1.computeDecimalValue)(disableWeight.toString()) : (0, utils_1.computeDecimalValue)(averageWeight.toString());
|
|
59
63
|
}
|
|
60
64
|
else {
|
|
61
|
-
return
|
|
65
|
+
return i !== lastAiTestIndex ? weight : (0, utils_1.computeDecimalValue)((100 - beforeTotalWeight).toString());
|
|
62
66
|
}
|
|
63
67
|
};
|
|
64
68
|
var $splice = steps.map(function (step, i) {
|
|
@@ -67,7 +71,7 @@ exports.useQuestionModelStore = (_a = (0, hox_1.createGlobalStore)(function () {
|
|
|
67
71
|
return [
|
|
68
72
|
i,
|
|
69
73
|
1,
|
|
70
|
-
__assign(__assign({}, step), { weight: (0, ai_question_1.IS_AI_ANALYSIS)(step) ? getWeight(step) : 0 }),
|
|
74
|
+
__assign(__assign({}, step), { weight: (0, ai_question_1.IS_AI_ANALYSIS)(step) ? getWeight(step, i) : 0 }),
|
|
71
75
|
];
|
|
72
76
|
});
|
|
73
77
|
updateModel(__assign(__assign({}, questionModelData), { duration: totalDuration, steps: (0, immutability_helper_1.default)(steps, { $splice: $splice }) }));
|
|
@@ -8,6 +8,7 @@ export declare const useAiReportStore: (depsFn?: import("hox/es/types").DepsFn<{
|
|
|
8
8
|
scoreRankIntervals?: import("../../modules/ai-report/components/RankingRange/interface").ScoreRankInterval[] | undefined;
|
|
9
9
|
disabledScore?: boolean | undefined;
|
|
10
10
|
reminderSent?: boolean | undefined;
|
|
11
|
+
showAbilitiesDetails?: boolean | undefined;
|
|
11
12
|
operableButtons?: ("export" | "refresh" | "scoreRank" | "abilities" | "sendReminder")[] | undefined;
|
|
12
13
|
stepToken?: string | undefined;
|
|
13
14
|
interviewCheat?: import("@/modules/ai-report/interface").InterviewCheat | undefined;
|
|
@@ -26,6 +27,7 @@ export declare const useAiReportStore: (depsFn?: import("hox/es/types").DepsFn<{
|
|
|
26
27
|
scoreRankIntervals?: import("../../modules/ai-report/components/RankingRange/interface").ScoreRankInterval[] | undefined;
|
|
27
28
|
disabledScore?: boolean | undefined;
|
|
28
29
|
reminderSent?: boolean | undefined;
|
|
30
|
+
showAbilitiesDetails?: boolean | undefined;
|
|
29
31
|
operableButtons?: ("export" | "refresh" | "scoreRank" | "abilities" | "sendReminder")[] | undefined;
|
|
30
32
|
stepToken?: string | undefined;
|
|
31
33
|
interviewCheat?: import("@/modules/ai-report/interface").InterviewCheat | undefined;
|
|
@@ -44,6 +46,7 @@ export declare const useAiReportStore: (depsFn?: import("hox/es/types").DepsFn<{
|
|
|
44
46
|
scoreRankIntervals?: import("../../modules/ai-report/components/RankingRange/interface").ScoreRankInterval[] | undefined;
|
|
45
47
|
disabledScore?: boolean | undefined;
|
|
46
48
|
reminderSent?: boolean | undefined;
|
|
49
|
+
showAbilitiesDetails?: boolean | undefined;
|
|
47
50
|
operableButtons?: ("export" | "refresh" | "scoreRank" | "abilities" | "sendReminder")[] | undefined;
|
|
48
51
|
stepToken?: string | undefined;
|
|
49
52
|
interviewCheat?: import("@/modules/ai-report/interface").InterviewCheat | undefined;
|