eli-video-interview 1.2.40-alpha.4 → 1.2.40-alpha.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.
@@ -21,7 +21,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
21
21
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
22
  import { ChoiceIcon, ChoiceItem, ChoiceItemInput, ScoreInput } from './styled';
23
23
  import { uniqueId } from "../../../../utils/utils";
24
- import { AddIcon, Box, Button, CloseIcon, DragIndicatorIcon, FormItem, IconButton } from 'fbm-ui';
24
+ import { AddIcon, Box, Button, CloseIcon, DragIndicatorIcon, FormItem, IconButton, Typography } from 'fbm-ui';
25
25
  import { FieldArray } from 'formik';
26
26
  import { useCallback, useEffect, useRef } from 'react';
27
27
  import Sortable from 'sortablejs';
@@ -90,7 +90,7 @@ var Choice = function (_a) {
90
90
  return;
91
91
  }
92
92
  onChange('options', __spreadArray([], ((item === null || item === void 0 ? void 0 : item.options) || []).map(function (v, index) { return (i === index ? __assign(__assign({}, v), { score: Number(value) }) : v); }), true), index);
93
- } }, { children: _jsx(ScoreInput, { size: "small", placeholder: "\u5206\u503C", endAdornment: "\u5206" }) }))] }, v.key || uniqueId()));
93
+ } }, { children: _jsx(ScoreInput, { size: "small", placeholder: "\u5206\u503C", endAdornment: _jsx(Typography, __assign({ variant: "caption" }, { children: "\u5206" })) }) }))] }, v.key || uniqueId()));
94
94
  });
95
95
  } })) })), _jsx(ChoiceItem, { children: _jsx(Button, __assign({ icon: _jsx(AddIcon, {}), variant: "outlined", color: "inherit", size: "small", onClick: handleOptionAdd, sx: { ml: -2 } }, { children: "\u6DFB\u52A0\u9009\u9879" })) })] })));
96
96
  };
@@ -60,6 +60,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
60
60
  import { defaultQuestionParams } from './const';
61
61
  import Form from './Form';
62
62
  import { ADD_QUESTION_TYPE_SHOW_LIST, QUESTION_TYPE_TITLE_MAP } from "../../../../constants/ai-question";
63
+ import { ADD_QUESTION_TYPE, QUESTION_TYPE } from "../../../../enum/ai-question";
63
64
  import { useQuestionCollectionListStore } from "../../../../store/ai-ability/question-ability-store";
64
65
  import ScrollDialogContent from "../../../../components/ScrollDialogContent";
65
66
  import { useAiAnalysisStore } from "../../../../store/ai-question/ai-analysis-store";
@@ -99,7 +100,12 @@ var QuestionUpdate = function () {
99
100
  var _a;
100
101
  setSwitchTypeOpen(false);
101
102
  (_a = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _a === void 0 ? void 0 : _a.setFormValues({ broadcastType: defaultQuestionParams.broadcastType });
102
- updateQuestionState({ aiShowType: type });
103
+ if (type === ADD_QUESTION_TYPE.SINGLECHIOCE) {
104
+ updateQuestionState({ aiShowType: type, item: __assign(__assign({}, item), { type: QUESTION_TYPE.SINGLECHIOCE }) });
105
+ }
106
+ else {
107
+ updateQuestionState({ aiShowType: type });
108
+ }
103
109
  } }, { children: _jsx(Typography, __assign({ variant: "body2" }, { children: title })) }), "question_type_".concat(type)));
104
110
  });
105
111
  return (_jsxs(Box, __assign({ display: "flex", alignItems: "center", height: 56 }, { children: [_jsx(Typography, __assign({ ml: 3, variant: "subtitle1" }, { children: QUESTION_TYPE_TITLE_MAP[aiShowType] })), _jsx(Popover, __assign({ open: switchTypeOpen, content: content, onClickAway: function () { return setSwitchTypeOpen(false); } }, { children: _jsx(Button, __assign({ variant: "text", size: "small", sx: { fontSize: 12, color: 'rgb(87, 107, 149)' }, onClick: function () { return setSwitchTypeOpen(true); } }, { children: "\u5207\u6362\u9898\u578B" })) }))] })));
@@ -16,7 +16,7 @@ import { Box, Typography } from 'fbm-ui';
16
16
  import update from 'immutability-helper';
17
17
  import { useCallback } from 'react';
18
18
  var Abilities = function (_a) {
19
- var stepIndex = _a.stepIndex;
19
+ var stepIndex = _a.stepIndex, disabledScore = _a.disabledScore;
20
20
  var _b = useAiReportStore(function (store) { return [store.reportResult]; }), reportResult = _b.reportResult, updateReportResult = _b.updateReportResult, onScoreChange = _b.onScoreChange;
21
21
  var steps = (reportResult || {}).steps;
22
22
  var handleChangeCommitted = useCallback(function (score, index, type) {
@@ -34,7 +34,7 @@ var Abilities = function (_a) {
34
34
  return (_jsxs(Box, __assign({ mt: 1 }, { children: [_jsx(Typography, __assign({ variant: "body2", color: "secondary", mb: 1 }, { children: "\u5206\u503C\u8BA1\u7B97\u89C4\u5219\uFF1A\u7EFC\u5408\u8BC4\u5206=AI\u8BC4\u5206*\u5355\u9898\u6743\u91CD" })), _jsx(Box, __assign({ mt: 3 }, { children: steps &&
35
35
  steps[stepIndex].scoreInfo.abilities.map(function (_a, index) {
36
36
  var name = _a.name, originScore = _a.originScore, finalScore = _a.finalScore;
37
- return (_jsxs(Box, { children: [_jsx(Typography, __assign({ variant: "body2" }, { children: name })), _jsx(ScoreSlider, { width: 420, isShowLabel: true, originScore: originScore, finalScore: finalScore, valueLabelDisplay: "auto", onChangeCommitted: function (score) { return handleChangeCommitted(score, index, 'ability'); } })] }, name));
37
+ return (_jsxs(Box, { children: [_jsx(Typography, __assign({ variant: "body2" }, { children: name })), _jsx(ScoreSlider, { width: 420, disabledScore: disabledScore, isShowLabel: true, originScore: originScore, finalScore: finalScore, valueLabelDisplay: "".concat(disabledScore ? 'off' : 'auto'), onChangeCommitted: function (score) { return handleChangeCommitted(score, index, 'ability'); } })] }, name));
38
38
  }) }))] })));
39
39
  };
40
40
  export default Abilities;
@@ -36,6 +36,7 @@ var QuestionItem = function (props) {
36
36
  var isShowAbilitiesButton = abilities.length > 0 && isAbilities && !showAbilitiesDetails;
37
37
  var isShowWeight = abilities.length === 0 || showAbilities || !isAbilities || showAbilitiesDetails;
38
38
  var isShowAbilitiesDetails = abilities.length > 0 && (showAbilities || showAbilitiesDetails);
39
+ var isSingleChoice = aiShowType === ADD_QUESTION_TYPE.SINGLECHIOCE;
39
40
  var comprehensiveScore = useMemo(function () {
40
41
  if (status === STEP_COMPLETED) {
41
42
  return (_jsx(Typography, __assign({ variant: "caption", color: theme.palette.primary.main, fontSize: 16, fontWeight: 500 }, { children: formatScore(score) })));
@@ -88,6 +89,6 @@ var QuestionItem = function (props) {
88
89
  mt: 2,
89
90
  cursor: videoUrl ? 'pointer' : 'inherit',
90
91
  borderColor: token === stepToken ? theme.palette.primary.main : '',
91
- }, variant: "outlined", onClick: handleClickItem }, { children: [_jsxs(Typography, __assign({ fontSize: 14, color: token === stepToken ? theme.palette.primary.main : theme.palette.text.primary }, { children: [index + 1, ".", desc] })), _jsxs(QuestionDesc, { children: [_jsx(BodyImages, { reviewImgs: reviewImgs }), _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: [aiShowType === ADD_QUESTION_TYPE.SINGLECHIOCE && _jsx(SingleChoice, { options: options || [], selected: (analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.selected) || [] }), _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] }))] }))] }))] }), followupQuestion && (_jsxs(_Fragment, { children: [_jsx(Typography, __assign({ mt: 1, fontSize: 14, color: token === stepToken ? theme.palette.primary.main : theme.palette.text.primary }, { children: "\u8FFD\u95EE\uFF1A".concat(followupQuestion === null || followupQuestion === void 0 ? void 0 : followupQuestion.desc) })), _jsxs(QuestionDesc, { children: [_jsx(FormatQuoteIcon, {}), _jsx(Typography, __assign({ variant: "caption", color: "secondary", ml: 1 }, { children: followupQuestion === null || followupQuestion === void 0 ? void 0 : followupQuestion.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", style: { whiteSpace: 'nowrap' }, 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));
92
+ }, variant: "outlined", onClick: handleClickItem }, { children: [_jsxs(Typography, __assign({ fontSize: 14, color: token === stepToken ? theme.palette.primary.main : theme.palette.text.primary }, { children: [index + 1, ".", desc] })), _jsxs(QuestionDesc, { children: [_jsx(BodyImages, { reviewImgs: reviewImgs }), _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: [isSingleChoice && _jsx(SingleChoice, { options: options || [], selected: (analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.selected) || [] }), _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] }))] }))] }))] }), followupQuestion && (_jsxs(_Fragment, { children: [_jsx(Typography, __assign({ mt: 1, fontSize: 14, color: token === stepToken ? theme.palette.primary.main : theme.palette.text.primary }, { children: "\u8FFD\u95EE\uFF1A".concat(followupQuestion === null || followupQuestion === void 0 ? void 0 : followupQuestion.desc) })), _jsxs(QuestionDesc, { children: [_jsx(FormatQuoteIcon, {}), _jsx(Typography, __assign({ variant: "caption", color: "secondary", ml: 1 }, { children: followupQuestion === null || followupQuestion === void 0 ? void 0 : followupQuestion.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, { valueLabelDisplay: "".concat(isSingleChoice ? 'off' : 'auto'), originScore: originScore, disabledScore: isSingleChoice, finalScore: finalScore, isShowScoreRank: true, onChangeCommitted: handleChangeCommitted }), isShowAbilitiesButton && (_jsx(Button, __assign({ variant: "text", style: { whiteSpace: 'nowrap' }, 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, disabledScore: isSingleChoice })] }), token));
92
93
  };
93
94
  export default QuestionItem;
@@ -16,13 +16,13 @@ import { useAiReportStore } from "../../../../store/ai-report/global-store";
16
16
  import { Tooltip, Typography } from 'fbm-ui';
17
17
  import { useCallback, useEffect, useState } from 'react';
18
18
  var ScoreSlider = function (props) {
19
- var _a = props.width, width = _a === void 0 ? 320 : _a, originScore = props.originScore, finalScore = props.finalScore, _b = props.valueLabelDisplay, valueLabelDisplay = _b === void 0 ? 'on' : _b, _c = props.isShowLabel, isShowLabel = _c === void 0 ? false : _c, _d = props.isShowScoreRank, isShowScoreRank = _d === void 0 ? false : _d, onChangeCommitted = props.onChangeCommitted;
19
+ var _a = props.width, width = _a === void 0 ? 320 : _a, originScore = props.originScore, finalScore = props.finalScore, _b = props.valueLabelDisplay, valueLabelDisplay = _b === void 0 ? 'on' : _b, _c = props.isShowLabel, isShowLabel = _c === void 0 ? false : _c, _d = props.isShowScoreRank, isShowScoreRank = _d === void 0 ? false : _d, onChangeCommitted = props.onChangeCommitted, _e = props.disabledScore, sliderDisabledScore = _e === void 0 ? false : _e;
20
20
  var aiScore = originScore.toFixed(0);
21
- var _e = useState(0), score = _e[0], setScore = _e[1];
21
+ var _f = useState(0), score = _f[0], setScore = _f[1];
22
22
  var disabledScore = useAiReportStore(function (store) { return [store.disabledScore, store.scoreRankIntervals]; }).disabledScore;
23
23
  var handleScoreChange = useCallback(function (e, v) {
24
- !disabledScore && setScore(v);
25
- }, [disabledScore]);
24
+ !disabledScore && !sliderDisabledScore && setScore(v);
25
+ }, [disabledScore, sliderDisabledScore]);
26
26
  useEffect(function () {
27
27
  setScore(Number(finalScore.toFixed(0)));
28
28
  }, [finalScore]);
@@ -25,7 +25,7 @@ var SingleChoice = function (_a) {
25
25
  // @ts-ignore
26
26
  FormControlLabelProps: {
27
27
  sx: { pointerEvents: 'none' },
28
- }, value: i, label: _jsxs(Stack, __assign({ color: "".concat(i === selected[0] ? '#4caf50' : 'rgba(0,0,0,.56)'), fontWeight: "".concat(i === selected[0] ? 'medium' : 'normal'), width: "100%", direction: "row", spacing: 1, alignItems: "center", justifyContent: "space-between" }, { children: [_jsx(Typography, __assign({ color: "inherit", fontWeight: "inherit", variant: "caption" }, { children: v.content })), _jsxs(Typography, __assign({ color: "inherit", fontWeight: "inherit", variant: "caption" }, { children: [v.score, "\u5206"] }))] })) }, i));
28
+ }, value: i, label: _jsxs(Stack, __assign({ color: "".concat(i === selected[0] ? '#4caf50' : 'rgba(0,0,0,.56)'), fontWeight: "".concat(i === selected[0] ? 'medium' : 'normal'), width: "100%", direction: "row", spacing: 1, alignItems: "center", justifyContent: "space-between" }, { children: [_jsx(Typography, __assign({ color: "inherit", fontWeight: "inherit", variant: "caption", flexWrap: "wrap", sx: { wordBreak: 'break-all' } }, { children: v.content })), _jsxs(Typography, __assign({ color: "inherit", fontWeight: "inherit", variant: "caption", flexShrink: 0 }, { children: [v.score, "\u5206"] }))] })) }, i));
29
29
  }) })) }));
30
30
  };
31
31
  export default SingleChoice;
@@ -4,6 +4,7 @@ export interface ScoreSliderProps extends Pick<ScoreInfo, 'originScore' | 'final
4
4
  valueLabelDisplay?: 'on' | 'off' | 'auto';
5
5
  isShowLabel?: boolean;
6
6
  isShowScoreRank?: boolean;
7
+ disabledScore?: boolean;
7
8
  onChangeCommitted: (score: number) => void;
8
9
  }
9
10
  export interface QuestionItemProps extends AiInterviewReportStep {
@@ -11,4 +12,5 @@ export interface QuestionItemProps extends AiInterviewReportStep {
11
12
  }
12
13
  export interface AbilitiesProps {
13
14
  stepIndex: number;
15
+ disabledScore?: boolean;
14
16
  }
@@ -97,7 +97,7 @@ var Choice = function (_a) {
97
97
  return;
98
98
  }
99
99
  onChange('options', __spreadArray([], ((item === null || item === void 0 ? void 0 : item.options) || []).map(function (v, index) { return (i === index ? __assign(__assign({}, v), { score: Number(value) }) : v); }), true), index);
100
- } }, { children: (0, jsx_runtime_1.jsx)(styled_1.ScoreInput, { size: "small", placeholder: "\u5206\u503C", endAdornment: "\u5206" }) }))] }, v.key || (0, utils_1.uniqueId)()));
100
+ } }, { children: (0, jsx_runtime_1.jsx)(styled_1.ScoreInput, { size: "small", placeholder: "\u5206\u503C", endAdornment: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "caption" }, { children: "\u5206" })) }) }))] }, v.key || (0, utils_1.uniqueId)()));
101
101
  });
102
102
  } })) })), (0, jsx_runtime_1.jsx)(styled_1.ChoiceItem, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ icon: (0, jsx_runtime_1.jsx)(fbm_ui_1.AddIcon, {}), variant: "outlined", color: "inherit", size: "small", onClick: handleOptionAdd, sx: { ml: -2 } }, { children: "\u6DFB\u52A0\u9009\u9879" })) })] })));
103
103
  };
@@ -65,6 +65,7 @@ var jsx_runtime_1 = require("react/jsx-runtime");
65
65
  var const_1 = require("./const");
66
66
  var Form_1 = __importDefault(require("./Form"));
67
67
  var ai_question_1 = require("../../../../constants/ai-question");
68
+ var ai_question_2 = require("../../../../enum/ai-question");
68
69
  var question_ability_store_1 = require("../../../../store/ai-ability/question-ability-store");
69
70
  var ScrollDialogContent_1 = __importDefault(require("../../../../components/ScrollDialogContent"));
70
71
  var ai_analysis_store_1 = require("../../../../store/ai-question/ai-analysis-store");
@@ -104,7 +105,12 @@ var QuestionUpdate = function () {
104
105
  var _a;
105
106
  setSwitchTypeOpen(false);
106
107
  (_a = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _a === void 0 ? void 0 : _a.setFormValues({ broadcastType: const_1.defaultQuestionParams.broadcastType });
107
- updateQuestionState({ aiShowType: type });
108
+ if (type === ai_question_2.ADD_QUESTION_TYPE.SINGLECHIOCE) {
109
+ updateQuestionState({ aiShowType: type, item: __assign(__assign({}, item), { type: ai_question_2.QUESTION_TYPE.SINGLECHIOCE }) });
110
+ }
111
+ else {
112
+ updateQuestionState({ aiShowType: type });
113
+ }
108
114
  } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2" }, { children: title })) }), "question_type_".concat(type)));
109
115
  });
110
116
  return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", height: 56 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ ml: 3, variant: "subtitle1" }, { children: ai_question_1.QUESTION_TYPE_TITLE_MAP[aiShowType] })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Popover, __assign({ open: switchTypeOpen, content: content, onClickAway: function () { return setSwitchTypeOpen(false); } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "text", size: "small", sx: { fontSize: 12, color: 'rgb(87, 107, 149)' }, onClick: function () { return setSwitchTypeOpen(true); } }, { children: "\u5207\u6362\u9898\u578B" })) }))] })));
@@ -21,7 +21,7 @@ var fbm_ui_1 = require("fbm-ui");
21
21
  var immutability_helper_1 = __importDefault(require("immutability-helper"));
22
22
  var react_1 = require("react");
23
23
  var Abilities = function (_a) {
24
- var stepIndex = _a.stepIndex;
24
+ var stepIndex = _a.stepIndex, disabledScore = _a.disabledScore;
25
25
  var _b = (0, global_store_1.useAiReportStore)(function (store) { return [store.reportResult]; }), reportResult = _b.reportResult, updateReportResult = _b.updateReportResult, onScoreChange = _b.onScoreChange;
26
26
  var steps = (reportResult || {}).steps;
27
27
  var handleChangeCommitted = (0, react_1.useCallback)(function (score, index, type) {
@@ -39,7 +39,7 @@ var Abilities = function (_a) {
39
39
  return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ mt: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "secondary", mb: 1 }, { children: "\u5206\u503C\u8BA1\u7B97\u89C4\u5219\uFF1A\u7EFC\u5408\u8BC4\u5206=AI\u8BC4\u5206*\u5355\u9898\u6743\u91CD" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ mt: 3 }, { children: steps &&
40
40
  steps[stepIndex].scoreInfo.abilities.map(function (_a, index) {
41
41
  var name = _a.name, originScore = _a.originScore, finalScore = _a.finalScore;
42
- return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2" }, { children: name })), (0, jsx_runtime_1.jsx)(ScoreSlider_1.default, { width: 420, isShowLabel: true, originScore: originScore, finalScore: finalScore, valueLabelDisplay: "auto", onChangeCommitted: function (score) { return handleChangeCommitted(score, index, 'ability'); } })] }, name));
42
+ return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2" }, { children: name })), (0, jsx_runtime_1.jsx)(ScoreSlider_1.default, { width: 420, disabledScore: disabledScore, isShowLabel: true, originScore: originScore, finalScore: finalScore, valueLabelDisplay: "".concat(disabledScore ? 'off' : 'auto'), onChangeCommitted: function (score) { return handleChangeCommitted(score, index, 'ability'); } })] }, name));
43
43
  }) }))] })));
44
44
  };
45
45
  exports.default = Abilities;
@@ -41,6 +41,7 @@ var QuestionItem = function (props) {
41
41
  var isShowAbilitiesButton = abilities.length > 0 && isAbilities && !showAbilitiesDetails;
42
42
  var isShowWeight = abilities.length === 0 || showAbilities || !isAbilities || showAbilitiesDetails;
43
43
  var isShowAbilitiesDetails = abilities.length > 0 && (showAbilities || showAbilitiesDetails);
44
+ var isSingleChoice = aiShowType === ai_question_1.ADD_QUESTION_TYPE.SINGLECHIOCE;
44
45
  var comprehensiveScore = (0, react_1.useMemo)(function () {
45
46
  if (status === STEP_COMPLETED) {
46
47
  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) })));
@@ -93,6 +94,6 @@ var QuestionItem = function (props) {
93
94
  mt: 2,
94
95
  cursor: videoUrl ? 'pointer' : 'inherit',
95
96
  borderColor: token === stepToken ? ThemeProvider_1.theme.palette.primary.main : '',
96
- }, 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, ".", desc] })), (0, jsx_runtime_1.jsxs)(styled_1.QuestionDesc, { children: [(0, jsx_runtime_1.jsx)(BodyImages_1.default, { reviewImgs: reviewImgs }), (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: [aiShowType === ai_question_1.ADD_QUESTION_TYPE.SINGLECHIOCE && (0, jsx_runtime_1.jsx)(SingleChoice_1.default, { options: options || [], selected: (analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.selected) || [] }), (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] }))] }))] }))] }), followupQuestion && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ mt: 1, fontSize: 14, color: token === stepToken ? ThemeProvider_1.theme.palette.primary.main : ThemeProvider_1.theme.palette.text.primary }, { children: "\u8FFD\u95EE\uFF1A".concat(followupQuestion === null || followupQuestion === void 0 ? void 0 : followupQuestion.desc) })), (0, jsx_runtime_1.jsxs)(styled_1.QuestionDesc, { children: [(0, jsx_runtime_1.jsx)(FormatQuote_1.default, {}), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "secondary", ml: 1 }, { children: followupQuestion === null || followupQuestion === void 0 ? void 0 : followupQuestion.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", style: { whiteSpace: 'nowrap' }, 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));
97
+ }, 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, ".", desc] })), (0, jsx_runtime_1.jsxs)(styled_1.QuestionDesc, { children: [(0, jsx_runtime_1.jsx)(BodyImages_1.default, { reviewImgs: reviewImgs }), (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: [isSingleChoice && (0, jsx_runtime_1.jsx)(SingleChoice_1.default, { options: options || [], selected: (analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.selected) || [] }), (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] }))] }))] }))] }), followupQuestion && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ mt: 1, fontSize: 14, color: token === stepToken ? ThemeProvider_1.theme.palette.primary.main : ThemeProvider_1.theme.palette.text.primary }, { children: "\u8FFD\u95EE\uFF1A".concat(followupQuestion === null || followupQuestion === void 0 ? void 0 : followupQuestion.desc) })), (0, jsx_runtime_1.jsxs)(styled_1.QuestionDesc, { children: [(0, jsx_runtime_1.jsx)(FormatQuote_1.default, {}), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "secondary", ml: 1 }, { children: followupQuestion === null || followupQuestion === void 0 ? void 0 : followupQuestion.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, { valueLabelDisplay: "".concat(isSingleChoice ? 'off' : 'auto'), originScore: originScore, disabledScore: isSingleChoice, finalScore: finalScore, isShowScoreRank: true, onChangeCommitted: handleChangeCommitted }), isShowAbilitiesButton && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "text", style: { whiteSpace: 'nowrap' }, 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, disabledScore: isSingleChoice })] }), token));
97
98
  };
98
99
  exports.default = QuestionItem;
@@ -18,13 +18,13 @@ var global_store_1 = require("../../../../store/ai-report/global-store");
18
18
  var fbm_ui_1 = require("fbm-ui");
19
19
  var react_1 = require("react");
20
20
  var ScoreSlider = function (props) {
21
- var _a = props.width, width = _a === void 0 ? 320 : _a, originScore = props.originScore, finalScore = props.finalScore, _b = props.valueLabelDisplay, valueLabelDisplay = _b === void 0 ? 'on' : _b, _c = props.isShowLabel, isShowLabel = _c === void 0 ? false : _c, _d = props.isShowScoreRank, isShowScoreRank = _d === void 0 ? false : _d, onChangeCommitted = props.onChangeCommitted;
21
+ var _a = props.width, width = _a === void 0 ? 320 : _a, originScore = props.originScore, finalScore = props.finalScore, _b = props.valueLabelDisplay, valueLabelDisplay = _b === void 0 ? 'on' : _b, _c = props.isShowLabel, isShowLabel = _c === void 0 ? false : _c, _d = props.isShowScoreRank, isShowScoreRank = _d === void 0 ? false : _d, onChangeCommitted = props.onChangeCommitted, _e = props.disabledScore, sliderDisabledScore = _e === void 0 ? false : _e;
22
22
  var aiScore = originScore.toFixed(0);
23
- var _e = (0, react_1.useState)(0), score = _e[0], setScore = _e[1];
23
+ var _f = (0, react_1.useState)(0), score = _f[0], setScore = _f[1];
24
24
  var disabledScore = (0, global_store_1.useAiReportStore)(function (store) { return [store.disabledScore, store.scoreRankIntervals]; }).disabledScore;
25
25
  var handleScoreChange = (0, react_1.useCallback)(function (e, v) {
26
- !disabledScore && setScore(v);
27
- }, [disabledScore]);
26
+ !disabledScore && !sliderDisabledScore && setScore(v);
27
+ }, [disabledScore, sliderDisabledScore]);
28
28
  (0, react_1.useEffect)(function () {
29
29
  setScore(Number(finalScore.toFixed(0)));
30
30
  }, [finalScore]);
@@ -27,7 +27,7 @@ var SingleChoice = function (_a) {
27
27
  // @ts-ignore
28
28
  FormControlLabelProps: {
29
29
  sx: { pointerEvents: 'none' },
30
- }, value: i, label: (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ color: "".concat(i === selected[0] ? '#4caf50' : 'rgba(0,0,0,.56)'), fontWeight: "".concat(i === selected[0] ? 'medium' : 'normal'), width: "100%", direction: "row", spacing: 1, alignItems: "center", justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ color: "inherit", fontWeight: "inherit", variant: "caption" }, { children: v.content })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ color: "inherit", fontWeight: "inherit", variant: "caption" }, { children: [v.score, "\u5206"] }))] })) }, i));
30
+ }, value: i, label: (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ color: "".concat(i === selected[0] ? '#4caf50' : 'rgba(0,0,0,.56)'), fontWeight: "".concat(i === selected[0] ? 'medium' : 'normal'), width: "100%", direction: "row", spacing: 1, alignItems: "center", justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ color: "inherit", fontWeight: "inherit", variant: "caption", flexWrap: "wrap", sx: { wordBreak: 'break-all' } }, { children: v.content })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ color: "inherit", fontWeight: "inherit", variant: "caption", flexShrink: 0 }, { children: [v.score, "\u5206"] }))] })) }, i));
31
31
  }) })) }));
32
32
  };
33
33
  exports.default = SingleChoice;
@@ -4,6 +4,7 @@ export interface ScoreSliderProps extends Pick<ScoreInfo, 'originScore' | 'final
4
4
  valueLabelDisplay?: 'on' | 'off' | 'auto';
5
5
  isShowLabel?: boolean;
6
6
  isShowScoreRank?: boolean;
7
+ disabledScore?: boolean;
7
8
  onChangeCommitted: (score: number) => void;
8
9
  }
9
10
  export interface QuestionItemProps extends AiInterviewReportStep {
@@ -11,4 +12,5 @@ export interface QuestionItemProps extends AiInterviewReportStep {
11
12
  }
12
13
  export interface AbilitiesProps {
13
14
  stepIndex: number;
15
+ disabledScore?: boolean;
14
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eli-video-interview",
3
- "version": "1.2.40-alpha.4",
3
+ "version": "1.2.40-alpha.6",
4
4
  "description": "鳄梨科技 AI视频面试 React SDK",
5
5
  "author": "鳄梨科技",
6
6
  "license": "MIT",