eli-video-interview 1.2.40-alpha.1 → 1.2.40-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/esm/constants/ai-question.js +2 -2
  2. package/esm/modules/ai-question/components/AiAnalysis/index.js +4 -1
  3. package/esm/modules/ai-question/components/QuestionModel/Item.js +1 -1
  4. package/esm/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +7 -1
  5. package/esm/modules/ai-question/components/QuestionUpdate/Chioce.js +17 -11
  6. package/esm/modules/ai-question/components/QuestionUpdate/Form.js +4 -9
  7. package/esm/modules/ai-question/components/QuestionUpdate/Score.d.ts +15 -0
  8. package/esm/modules/ai-question/components/QuestionUpdate/Score.js +53 -0
  9. package/esm/modules/ai-question/components/QuestionUpdate/index.js +24 -4
  10. package/esm/modules/ai-question/components/QuestionUpdate/interface.d.ts +2 -0
  11. package/esm/modules/ai-question/components/QuestionUpdate/styled.js +3 -0
  12. package/esm/modules/ai-report/Root.js +1 -1
  13. package/esm/modules/ai-report/components/VideoQuestion/Abilities.js +5 -3
  14. package/esm/modules/ai-report/components/VideoQuestion/QuestionItem.js +5 -2
  15. package/esm/modules/ai-report/components/VideoQuestion/ScoreSlider.js +4 -4
  16. package/esm/modules/ai-report/components/VideoQuestion/SingleChoice.js +7 -1
  17. package/esm/modules/ai-report/components/VideoQuestion/index.js +1 -1
  18. package/esm/modules/ai-report/components/VideoQuestion/interface.d.ts +2 -0
  19. package/esm/store/ai-question/ai-analysis-store.js +0 -1
  20. package/lib/constants/ai-question.js +2 -2
  21. package/lib/modules/ai-question/components/AiAnalysis/index.js +4 -1
  22. package/lib/modules/ai-question/components/QuestionModel/Item.js +1 -1
  23. package/lib/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +7 -1
  24. package/lib/modules/ai-question/components/QuestionUpdate/Chioce.js +16 -10
  25. package/lib/modules/ai-question/components/QuestionUpdate/Form.js +4 -9
  26. package/lib/modules/ai-question/components/QuestionUpdate/Score.d.ts +15 -0
  27. package/lib/modules/ai-question/components/QuestionUpdate/Score.js +57 -0
  28. package/lib/modules/ai-question/components/QuestionUpdate/index.js +24 -4
  29. package/lib/modules/ai-question/components/QuestionUpdate/interface.d.ts +2 -0
  30. package/lib/modules/ai-question/components/QuestionUpdate/styled.js +3 -0
  31. package/lib/modules/ai-report/Root.js +1 -1
  32. package/lib/modules/ai-report/components/VideoQuestion/Abilities.js +5 -3
  33. package/lib/modules/ai-report/components/VideoQuestion/QuestionItem.js +5 -2
  34. package/lib/modules/ai-report/components/VideoQuestion/ScoreSlider.js +4 -4
  35. package/lib/modules/ai-report/components/VideoQuestion/SingleChoice.js +7 -1
  36. package/lib/modules/ai-report/components/VideoQuestion/index.js +1 -1
  37. package/lib/modules/ai-report/components/VideoQuestion/interface.d.ts +2 -0
  38. package/lib/store/ai-question/ai-analysis-store.js +0 -1
  39. package/package.json +1 -1
@@ -21,7 +21,7 @@ export var ADD_QUESTION_TYPE_LIST = [
21
21
  {
22
22
  type: EVALUATION,
23
23
  hide: true,
24
- title: '评估题',
24
+ title: '评测题',
25
25
  desc: '候选人根据所提供的文案进行朗读。',
26
26
  },
27
27
  {
@@ -81,7 +81,7 @@ export var AiVideoStatus = {
81
81
  export var MAX_UPLOAD_FILE_SIZE = 1024 * 1024 * 20;
82
82
  export var MAX_UPLOAD_VIDEO_FILE_SIZE = 1024 * 1024 * 500;
83
83
  export var TEST_TYPE_READONLY = [2, 3, 4, 7, 8, 9, 10, 11, 12, 16];
84
- export var DISABLED_REPEAT_TYPE = [2, 4, 7, 8, 9, 11, 12, 16];
84
+ export var DISABLED_REPEAT_TYPE = [2, 4, 7, 8, 9, 11, 12, 16, 17];
85
85
  export var DISABLED_COST_TYPE = [7, 9, 8, 4, 11, 2, 16];
86
86
  // 是否开启AI分析
87
87
  export var IS_AI_ANALYSIS = function (step) { return step.aiType === 2; };
@@ -13,15 +13,18 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import AiAssessmentCriteria from '../AiAssessmentCriteria';
14
14
  import { LANGUAGE_NAMES } from '../AiAssessmentCriteria/const';
15
15
  import AnalysisItem from './AnalysisItem';
16
+ import { useUpdateQuestionStore } from "../../../../store/ai-question/question-update-store";
17
+ import { ADD_QUESTION_TYPE } from "../../../../enum/ai-question";
16
18
  import { useAiAnalysisStore } from "../../../../store/ai-question/ai-analysis-store";
17
19
  import { AddIcon, Box, Button, Typography } from 'fbm-ui';
18
20
  import { Divider, List } from 'fbm-ui/lib/mui';
19
21
  import { useState } from 'react';
20
22
  var AiAnalysis = function () {
23
+ var aiShowType = useUpdateQuestionStore(function (store) { return [store.questionState]; }).questionState.aiShowType;
21
24
  var _a = useAiAnalysisStore(function (store) { return [store.aiAbilities, store.analysisState]; }), aiAbilities = _a.aiAbilities, analysisState = _a.analysisState;
22
25
  var _b = useState(false), aiAnalysisOpen = _b[0], setAiAnalysisOpen = _b[1];
23
26
  var language = analysisState.language;
24
27
  var isOpenAiAnalysis = aiAbilities.length > 0;
25
- return (_jsxs(Box, { children: [aiAnalysisOpen && _jsx(AiAssessmentCriteria, { open: aiAnalysisOpen, onClose: function () { return setAiAnalysisOpen(false); } }), isOpenAiAnalysis && (_jsx(Box, __assign({ display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: _jsxs(Box, __assign({ display: "flex", alignItems: "center" }, { children: [_jsx(Typography, __assign({ variant: "subtitle1" }, { children: "\u6743\u91CD\u8BBE\u7F6E" })), language && LANGUAGE_NAMES[language] ? (_jsxs(Typography, __assign({ variant: "caption", color: "secondary", ml: "8px" }, { children: ["\u8BED\u79CD\uFF1A", language && LANGUAGE_NAMES[language]] }))) : ('')] })) }))), aiAbilities.length > 0 && (_jsx(List, { children: aiAbilities.map(function (item, index) { return (_jsx(AnalysisItem, __assign({ index: index }, item), item.token)); }) })), _jsx(Divider, { sx: { mb: 1 } }), _jsx(Button, __assign({ variant: "outlined", color: "inherit", icon: _jsx(AddIcon, {}), onClick: function () { return setAiAnalysisOpen(true); } }, { children: "\u6DFB\u52A0AI\u8003\u6838\u7EF4\u5EA6" }))] }));
28
+ return (_jsxs(Box, { children: [aiAnalysisOpen && _jsx(AiAssessmentCriteria, { open: aiAnalysisOpen, onClose: function () { return setAiAnalysisOpen(false); } }), isOpenAiAnalysis && (_jsx(Box, __assign({ display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: _jsxs(Box, __assign({ display: "flex", alignItems: "center" }, { children: [_jsx(Typography, __assign({ variant: "subtitle1" }, { children: "\u6743\u91CD\u8BBE\u7F6E" })), language && LANGUAGE_NAMES[language] ? (_jsxs(Typography, __assign({ variant: "caption", color: "secondary", ml: "8px" }, { children: ["\u8BED\u79CD\uFF1A", language && LANGUAGE_NAMES[language]] }))) : ('')] })) }))), aiAbilities.length > 0 && (_jsx(List, { children: aiAbilities.map(function (item, index) { return (_jsx(AnalysisItem, __assign({ index: index }, item), item.token)); }) })), _jsx(Divider, { sx: { mb: 1 } }), aiShowType !== ADD_QUESTION_TYPE.SINGLECHIOCE && (_jsx(Button, __assign({ variant: "outlined", color: "inherit", icon: _jsx(AddIcon, {}), onClick: function () { return setAiAnalysisOpen(true); } }, { children: "\u6DFB\u52A0AI\u8003\u6838\u7EF4\u5EA6" })))] }));
26
29
  };
27
30
  export default AiAnalysis;
@@ -79,6 +79,6 @@ var QuestionModelListItem = function (props) {
79
79
  }, [questions]);
80
80
  return (_jsxs(Paper, __assign({ variant: "outlined", sx: { display: 'block', mt: 2 } }, { children: [_jsx(Box, __assign({ display: "flex", borderBottom: !DISABLED_REPEAT_TYPE.includes(type) || isAiAnalysis ? '1px solid rgba(0, 0, 0, 0.08)' : 'none' }, { children: _jsxs(Box, __assign({ flex: "1 0", padding: "8px 0px 16px 16px" }, { children: [_jsxs(Box, __assign({ display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: [_jsxs(Typography, __assign({ variant: "body2", color: "primary.main", fontWeight: "medium" }, { children: ["\u9898\u76EE", index + 1] })), _jsx(Box, __assign({ width: 40, display: "flex", alignItems: "center", justifyContent: "center", sx: { cursor: 'move' } }, { children: _jsx(DragHandleIcon, { className: "dragHandle" }) })), _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, {}) }))] }))] })), _jsx(Box, __assign({ display: "flex", justifyContent: "space-between" }, { children: _jsxs(Box, __assign({ flex: "1 0", display: "flex", alignItems: "center" }, { children: [_jsxs(Typography, __assign({ variant: "body2", color: "primary.main", fontWeight: "medium", mr: 0.5 }, { children: ["[", QUESTION_TYPE_TITLE_MAP[aiShowType], "]"] })), _jsx(Typography, __assign({ variant: "subtitle1" }, { children: name })), category === null || category === void 0 ? void 0 : category.map(function (label) {
81
81
  return label && (_jsx(Tooltip, __assign({ title: "".concat(label), placement: "bottom" }, { children: _jsx(Chip, { color: "default", label: label, size: "medium", sx: { ml: 1, maxWidth: '158px', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' } }, label) })));
82
- }), aiType === 2 && _jsx(Chip, { variant: "filled", color: "primary", label: "AI\u8BC4\u5206", size: "medium", sx: { ml: 1 } }), (questions === null || questions === void 0 ? void 0 : questions.length) > 1 && _jsx(Chip, { variant: "filled", color: "warning", label: "\u5185\u5BB9\u968F\u673A", size: "medium", sx: { ml: 1 } })] })) })), _jsxs(Box, __assign({ mt: 1, pr: 2, display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: [_jsx(Typography, __assign({ variant: "body2", color: "secondary" }, { children: formatQuestion })), _jsxs(Typography, __assign({ sx: { ml: 2, flexShrink: 0 }, variant: "caption", color: "secondary", alignSelf: "flex-end" }, { children: ["\u56DE\u7B54\u65F6\u957F:\u00A0", getSecondToTime(Number(duration))] }))] }))] })) })), (!DISABLED_REPEAT_TYPE.includes(type) || isAiAnalysis) && (_jsxs(Stack, __assign({ direction: "row", justifyContent: "space-between", spacing: 1, height: 42 }, { children: [_jsx(Box, __assign({ display: "flex", alignItems: "center", padding: "3px 0 3px 40px" }, { children: isAiAnalysis && (_jsxs(_Fragment, { children: [_jsx(Typography, __assign({ variant: "body2", sx: { flexShrink: 0 } }, { children: "\u6743\u91CD\u5360\u6BD4\uFF1A" })), _jsx(Input, { sx: { width: 92 }, size: "small", value: weight, endAdornment: _jsx(Typography, __assign({ variant: "caption", color: "textSecondary" }, { children: "%" })), disabled: disabledWeight, onChange: handleWeightChange, onBlur: handleWeightBlur }), _jsx(Tooltip, __assign({ title: "AI\u6D4B\u8BC4\u9898\u53EF\u4EE5\u8BBE\u7F6E\u6743\u91CD\uFF0C\u7CFB\u7EDF\u5BF9\u5019\u9009\u4EBA\u89C6\u9891\u9762\u8BD5\u7ED3\u679C\u4F1A\u52A0\u5165\u6743\u91CD\u8FDB\u884C\u8BA1\u7B97\uFF0C\u5F97\u51FAAI\u89C6\u9891\u9762\u8BD5\u5F97\u5206\u3002\u8BBE\u7F6E\u540E5\u5206\u949F\u8D77\u6548" }, { children: _jsx("span", __assign({ style: { display: 'flex', alignItems: 'center', marginLeft: '8px' } }, { children: _jsx(InfoIcon, { sx: { fontSize: 14, color: 'rgba(0, 0, 0, 0.26)' } }) })) }))] })) })), !DISABLED_REPEAT_TYPE.includes(type) && (_jsxs(Stack, __assign({ direction: "row" }, { children: [_jsx(Switch, { sx: { flexShrink: 0, ml: 2, mr: 2 }, 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 }), type === 1 && aiShowType === 1 && ((aiInterviewerProfile === null || aiInterviewerProfile === void 0 ? void 0 : aiInterviewerProfile.humanType) !== 2 || interactType === 1) && (_jsx(Switch, { sx: { flexShrink: 0, mr: 2 }, size: "small", checked: isOpenAIFollowUp, label: _jsx(Typography, __assign({ fontSize: 12, lineHeight: 1.5, color: "rgba(0, 0, 0, 0.56)" }, { children: "\u56DE\u7B54\u4E0D\u5145\u5206\u65F6\u8FFD\u95EE" })), onChange: handleOpenAIFollowUpStatus }))] })))] })))] })));
82
+ }), aiType === 2 && _jsx(Chip, { variant: "filled", color: "primary", label: "AI\u8BC4\u5206", size: "medium", sx: { ml: 1 } }), (questions === null || questions === void 0 ? void 0 : questions.length) > 1 && _jsx(Chip, { variant: "filled", color: "warning", label: "\u5185\u5BB9\u968F\u673A", size: "medium", sx: { ml: 1 } })] })) })), _jsxs(Box, __assign({ mt: 1, pr: 2, display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: [_jsx(Typography, __assign({ variant: "body2", color: "secondary" }, { children: formatQuestion })), _jsxs(Typography, __assign({ sx: { ml: 2, flexShrink: 0 }, variant: "caption", color: "secondary", alignSelf: "flex-end" }, { children: ["\u56DE\u7B54\u65F6\u957F:\u00A0", getSecondToTime(Number(duration))] }))] }))] })) })), (!DISABLED_REPEAT_TYPE.includes(type) || isAiAnalysis) && (_jsxs(Stack, __assign({ direction: "row", justifyContent: "space-between", spacing: 1, height: 42 }, { children: [_jsx(Box, __assign({ display: "flex", alignItems: "center", padding: "3px 0 3px 16px" }, { children: isAiAnalysis && (_jsxs(_Fragment, { children: [_jsx(Typography, __assign({ variant: "body2", sx: { flexShrink: 0 } }, { children: "\u6743\u91CD\u5360\u6BD4\uFF1A" })), _jsx(Input, { sx: { width: 92 }, size: "small", value: weight, endAdornment: _jsx(Typography, __assign({ variant: "caption", color: "textSecondary" }, { children: "%" })), disabled: disabledWeight, onChange: handleWeightChange, onBlur: handleWeightBlur }), _jsx(Tooltip, __assign({ title: "AI\u6D4B\u8BC4\u9898\u53EF\u4EE5\u8BBE\u7F6E\u6743\u91CD\uFF0C\u7CFB\u7EDF\u5BF9\u5019\u9009\u4EBA\u89C6\u9891\u9762\u8BD5\u7ED3\u679C\u4F1A\u52A0\u5165\u6743\u91CD\u8FDB\u884C\u8BA1\u7B97\uFF0C\u5F97\u51FAAI\u89C6\u9891\u9762\u8BD5\u5F97\u5206\u3002\u8BBE\u7F6E\u540E5\u5206\u949F\u8D77\u6548" }, { children: _jsx("span", __assign({ style: { display: 'flex', alignItems: 'center', marginLeft: '8px' } }, { children: _jsx(InfoIcon, { sx: { fontSize: 14, color: 'rgba(0, 0, 0, 0.26)' } }) })) }))] })) })), !DISABLED_REPEAT_TYPE.includes(type) && (_jsxs(Stack, __assign({ direction: "row" }, { children: [_jsx(Switch, { sx: { flexShrink: 0, ml: 2, mr: 2 }, 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 }), type === 1 && aiShowType === 1 && ((aiInterviewerProfile === null || aiInterviewerProfile === void 0 ? void 0 : aiInterviewerProfile.humanType) !== 2 || interactType === 1) && (_jsx(Switch, { sx: { flexShrink: 0, mr: 2 }, size: "small", checked: isOpenAIFollowUp, label: _jsx(Typography, __assign({ fontSize: 12, lineHeight: 1.5, color: "rgba(0, 0, 0, 0.56)" }, { children: "\u56DE\u7B54\u4E0D\u5145\u5206\u65F6\u8FFD\u95EE" })), onChange: handleOpenAIFollowUpStatus }))] })))] })))] })));
83
83
  };
84
84
  export default memo(QuestionModelListItem);
@@ -44,7 +44,13 @@ var AiEvaluation = function () {
44
44
  var addQuestionOpen = state.addQuestionOpen, showOnlyAITest = state.showOnlyAITest;
45
45
  var handleClickAdd = useCallback(function (aiShowType) {
46
46
  setState({ addQuestionOpen: false });
47
- updateQuestionState({ open: true, aiShowType: aiShowType, token: '', index: -1, item: __assign(__assign({}, defaultQuestionParams), { aiShowType: aiShowType, token: uniqueId() }) });
47
+ updateQuestionState({
48
+ open: true,
49
+ aiShowType: aiShowType,
50
+ token: '',
51
+ index: -1,
52
+ item: __assign(__assign({}, defaultQuestionParams), { aiShowType: aiShowType, type: aiShowType === ADD_QUESTION_TYPE.SINGLECHIOCE ? 17 : 1, token: uniqueId() }),
53
+ });
48
54
  }, [setState, updateQuestionState]);
49
55
  var content = (_jsx(List, { children: ADD_QUESTION_TYPE_SHOW_LIST.map(function (_a) {
50
56
  var title = _a.title, desc = _a.desc, type = _a.type;
@@ -21,8 +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 { arrayMoveImmutable } from 'array-move';
25
- import { AddIcon, Box, Button, CloseIcon, DragIndicatorIcon, FormItem, IconButton } from 'fbm-ui';
24
+ import { AddIcon, Box, Button, CloseIcon, DragIndicatorIcon, FormItem, IconButton, Typography } from 'fbm-ui';
26
25
  import { FieldArray } from 'formik';
27
26
  import { useCallback, useEffect, useRef } from 'react';
28
27
  import Sortable from 'sortablejs';
@@ -40,10 +39,14 @@ var Choice = function (_a) {
40
39
  var index = _a.index, item = _a.item, onChange = _a.onChange;
41
40
  var ref = useRef();
42
41
  var sortable = useRef();
42
+ var helper = useRef();
43
43
  var handleOptionAdd = useCallback(function () {
44
+ var _a;
44
45
  var optionItem = { key: uniqueId(), content: '', score: 0 };
45
- onChange('options', __spreadArray(__spreadArray([], ((item === null || item === void 0 ? void 0 : item.options) || []), true), [optionItem], false), index);
46
- }, [index, item, onChange]);
46
+ if (helper.current) {
47
+ (_a = helper.current) === null || _a === void 0 ? void 0 : _a.push(optionItem);
48
+ }
49
+ }, []);
47
50
  useEffect(function () {
48
51
  sortable.current && sortable.current.destroy();
49
52
  sortable.current = new Sortable(ref.current, {
@@ -52,19 +55,22 @@ var Choice = function (_a) {
52
55
  forceFallback: true,
53
56
  onEnd: function (_a) {
54
57
  var oldIndex = _a.oldIndex, newIndex = _a.newIndex;
55
- var options = arrayMoveImmutable((item === null || item === void 0 ? void 0 : item.options) || [], oldIndex, newIndex);
56
- onChange('options', __spreadArray([], options, true), index);
58
+ if (helper.current) {
59
+ helper.current.move(oldIndex, newIndex);
60
+ }
57
61
  },
58
62
  });
59
- }, [index, item, onChange]);
63
+ }, [index, item, onChange, helper]);
60
64
  useEffect(function () {
61
65
  var _a;
62
66
  if (!((_a = item === null || item === void 0 ? void 0 : item.options) === null || _a === void 0 ? void 0 : _a.length)) {
63
- handleOptionAdd();
67
+ var optionItem = { key: uniqueId(), content: '', score: 0 };
68
+ onChange('options', [optionItem], index);
64
69
  }
65
- }, [item, handleOptionAdd, index]);
70
+ }, [item, onChange, index]);
66
71
  return (_jsxs(Box, __assign({ width: "100%" }, { children: [_jsx(Box, __assign({ ref: ref }, { children: ((_b = item === null || item === void 0 ? void 0 : item.options) === null || _b === void 0 ? void 0 : _b.length) > 0 && (_jsx(FieldArray, { name: "questions.".concat(index, ".options"), render: function (p) {
67
72
  var _a;
73
+ helper.current = p;
68
74
  return (_a = p.form.values.questions[index].options) === null || _a === void 0 ? void 0 : _a.map(function (v, i) {
69
75
  var _a;
70
76
  return (_jsxs(ChoiceItem, { children: [_jsx(DragIndicatorIcon, { className: "optionItemDragHandle" }), _jsx(ChoiceIcon, { borderRadius: 2 }), _jsx(FormItem, __assign({ required: true, name: "questions[".concat(index, "].options[").concat(i, "].content"), placeholder: "\u65B0\u9009\u9879", InputProps: {
@@ -73,7 +79,7 @@ var Choice = function (_a) {
73
79
  sx: {
74
80
  mr: 1.5,
75
81
  },
76
- }, sx: { height: 'auto', flexGrow: 1, overflow: 'hidden' } }, { children: _jsx(ChoiceItemInput, { multiline: true, maxRows: 3, placeholder: "\u65B0\u9009\u9879", variant: "standard" }) })), _jsx(Box, __assign({ width: 36, flexShrink: 0 }, { children: ((_a = p.form.values.questions[index].options) === null || _a === void 0 ? void 0 : _a.length) > 1 && (_jsx(IconButton, __assign({ className: "choice-item-delete-icon", onClick: function () { return p.remove(i); } }, { children: _jsx(CloseIcon, {}) }))) })), _jsx(FormItem, __assign({ required: true, name: "questions[".concat(index, "].options[").concat(i, "].score"), placeholder: "\u5206\u503C", InputProps: {
82
+ }, sx: { height: 'auto', flexGrow: 1, overflow: 'hidden' } }, { children: _jsx(ChoiceItemInput, { multiline: true, maxRows: 3, placeholder: "\u65B0\u9009\u9879", variant: "standard" }) })), _jsx(Box, __assign({ width: 36, flexShrink: 0, ml: 2 }, { children: ((_a = p.form.values.questions[index].options) === null || _a === void 0 ? void 0 : _a.length) > 1 && (_jsx(IconButton, __assign({ className: "choice-item-delete-icon", onClick: function () { return p.remove(i); } }, { children: _jsx(CloseIcon, {}) }))) })), _jsx(FormItem, __assign({ required: true, name: "questions[".concat(index, "].options[").concat(i, "].score"), placeholder: "\u5206\u503C", InputProps: {
77
83
  multiline: true,
78
84
  }, rules: [function (_a) {
79
85
  var value = _a.value;
@@ -84,7 +90,7 @@ var Choice = function (_a) {
84
90
  return;
85
91
  }
86
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);
87
- } }, { children: _jsx(ScoreInput, { size: "small", placeholder: "\u5206\u503C", endAdornment: "\u5206" }) }))] }, i));
93
+ } }, { children: _jsx(ScoreInput, { size: "small", placeholder: "\u5206\u503C", endAdornment: _jsx(Typography, __assign({ variant: "caption" }, { children: "\u5206" })) }) }))] }, v.key || uniqueId()));
88
94
  });
89
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" })) })] })));
90
96
  };
@@ -83,11 +83,6 @@ var QuestionForm = forwardRef(function (props, ref) {
83
83
  }, [data]);
84
84
  var form = useForm({
85
85
  initialValues: initialValues,
86
- validate: function (values) {
87
- var errors = {};
88
- // console.log(values);
89
- return errors;
90
- },
91
86
  onSubmit: function (values) { return __awaiter(void 0, void 0, void 0, function () {
92
87
  return __generator(this, function (_a) {
93
88
  switch (_a.label) {
@@ -122,6 +117,7 @@ var QuestionForm = forwardRef(function (props, ref) {
122
117
  useImperativeHandle(ref, function () { return ({
123
118
  handleValues: function () { return form.values; },
124
119
  handleSubmit: function () { return form.handleSubmit(); },
120
+ errors: function () { return form.errors; },
125
121
  setFormValues: function (values) { return form.setValues(__assign(__assign({}, form.values), values)); },
126
122
  }); });
127
123
  useEffect(function () {
@@ -157,11 +153,11 @@ var QuestionForm = forwardRef(function (props, ref) {
157
153
  } }, { children: _jsx(CloseIcon, {}) })) })))] }), index)); });
158
154
  } })) : (_jsx(VideoVoice, {}))), !preview && aiShowType === ADD_QUESTION_TYPE.SINGLECHIOCE && (
159
155
  // @ts-ignore
160
- _jsx(Box, __assign({ component: Paper, variant: "outlined", px: 2, pb: 2, pt: 0.5 }, { children: _jsx(FieldArray, { name: "questions", render: function () {
156
+ _jsx(Box, { children: _jsx(FieldArray, { name: "questions", render: function () {
161
157
  var _a;
162
158
  return (_a = form.values.questions) === null || _a === void 0 ? void 0 : _a.map(function (v, index) {
163
159
  var _a, _b;
164
- return (_jsxs(Stack, __assign({ width: "100%", justifyContent: "space-between", spacing: 1 }, { children: [_jsx(Box, __assign({ display: "flex", alignItems: "center", justifyContent: "flex-end" }, { children: ((_b = (_a = form === null || form === void 0 ? void 0 : form.values) === null || _a === void 0 ? void 0 : _a.questions) === null || _b === void 0 ? void 0 : _b.length) > 1 && (_jsx(IconButton, __assign({ sx: { mr: -1 }, onClick: function () {
160
+ return (_jsxs(Stack, __assign({ px: 2, pb: 2, pt: 0.5, mb: 2, boxSizing: "border-box", component: Paper, variant: "outlined", width: "100%", justifyContent: "space-between", spacing: 1 }, { children: [_jsx(Box, __assign({ display: "flex", alignItems: "center", justifyContent: "flex-end" }, { children: ((_b = (_a = form === null || form === void 0 ? void 0 : form.values) === null || _a === void 0 ? void 0 : _a.questions) === null || _b === void 0 ? void 0 : _b.length) > 1 && (_jsx(IconButton, __assign({ size: "small", sx: { mr: -1 }, onClick: function () {
165
161
  form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], form.values.questions.filter(function (_, i) { return i !== index; }), true) }));
166
162
  } }, { children: _jsx(DeleteIcon, {}) }))) })), _jsx(FormItem, { required: true, name: "questions.".concat(index, ".content"), label: "\u9762\u8BD5\u5185\u5BB9", max: 300, placeholder: "\u9762\u8BD5\u5185\u5BB9\uFF08\u7CFB\u7EDF\u5C06\u6839\u636E\u6B64\u5185\u5BB9\u5411\u5019\u9009\u4EBA\u8FDB\u884C\u8BED\u97F3\u64AD\u62A5\uFF09", InputProps: {
167
163
  // rows: 3,
@@ -174,11 +170,10 @@ var QuestionForm = forwardRef(function (props, ref) {
174
170
  height: 'auto',
175
171
  } }), _jsx(Chioce, { index: index, item: v, onChange: function (_, options, i) {
176
172
  form.values.questions[index].options = options;
177
- console.log(form.values.questions, options);
178
173
  form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], form.values.questions, true) }));
179
174
  } })] }), index));
180
175
  });
181
- } }) }))), !preview && aiShowType !== ADD_QUESTION_TYPE.LANGUAGE && (_jsx(RandomQuestion, { aiShowType: aiShowType, category: aiAbilityList === null || aiAbilityList === void 0 ? void 0 : aiAbilityList.find(function (v) { var _a; return v.name === ((_a = form.values.category) === null || _a === void 0 ? void 0 : _a.value); }), broadcastType: form.values.broadcastType, onAddCustonQuestion: function () {
176
+ } }) })), !preview && aiShowType !== ADD_QUESTION_TYPE.LANGUAGE && (_jsx(RandomQuestion, { aiShowType: aiShowType, category: aiAbilityList === null || aiAbilityList === void 0 ? void 0 : aiAbilityList.find(function (v) { var _a; return v.name === ((_a = form.values.category) === null || _a === void 0 ? void 0 : _a.value); }), broadcastType: form.values.broadcastType, onAddCustonQuestion: function () {
182
177
  form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray(__spreadArray([], form.values.questions, true), [{ content: '', videoUrl: '' }], false) }));
183
178
  }, onAddRandomQuestion: function (qs) {
184
179
  form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray(__spreadArray([], form.values.questions, true), qs.map(function (v) { return ({ content: v, videoUrl: '' }); }), true) }));
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * 验证0-9的整数
4
+ */
5
+ export declare const IS_INTEGER_REG: RegExp;
6
+ /**
7
+ * 可输入最大分值
8
+ */
9
+ export declare const MAX_SCORE_VALUE = 100;
10
+ export declare const VERIFICATION_SCORE: (value: string) => boolean;
11
+ declare const Score: ({ label, ...props }: {
12
+ [x: string]: any;
13
+ label: any;
14
+ }) => JSX.Element;
15
+ export default Score;
@@ -0,0 +1,53 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
24
+ import { ScoreInput } from './styled';
25
+ import { Typography } from 'fbm-ui';
26
+ import { useField } from 'formik';
27
+ /**
28
+ * 验证0-9的整数
29
+ */
30
+ export var IS_INTEGER_REG = /^[0-9]\d*$/;
31
+ /**
32
+ * 可输入最大分值
33
+ */
34
+ export var MAX_SCORE_VALUE = 100;
35
+ // rules={[({ value }) => VERIFICATION_SCORE(value as string)]}
36
+ // sx={{ height: 'auto', widht: 84 }}
37
+ // onChange={e => {
38
+ // const value = e.target.value;
39
+ // if (VERIFICATION_SCORE(value) || Number(value) > MAX_SCORE_VALUE || Number(value) < 1) {
40
+ // console.log('>>>>>>');
41
+ // return;
42
+ // }
43
+ // // onChange('options', [...(item?.options || []).map((v, index) => (i === index ? { ...v, score: Number(value) } : v))], index);
44
+ // }}
45
+ export var VERIFICATION_SCORE = function (value) { return (value ? !IS_INTEGER_REG.test(value) || Number(value) > MAX_SCORE_VALUE : false); };
46
+ var Score = function (_a) {
47
+ var label = _a.label, props = __rest(_a, ["label"]);
48
+ // @ts-ignore
49
+ var _b = useField(props), field = _b[0], meta = _b[1], helpers = _b[2];
50
+ console.log(field, meta, helpers);
51
+ return (_jsx(_Fragment, { children: _jsx(ScoreInput, __assign({}, field, props, { size: "small", placeholder: "\u5206\u503C", endAdornment: _jsx(Typography, __assign({ variant: "caption" }, { children: "\u5206" })) })) }));
52
+ };
53
+ export default Score;
@@ -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" })) }))] })));
@@ -182,9 +188,23 @@ var QuestionUpdate = function () {
182
188
  }
183
189
  });
184
190
  }); }, [getModelParams, item, updateQuestionState]);
185
- var handleOk = function () { return __awaiter(void 0, void 0, void 0, function () { var _a; return __generator(this, function (_b) {
186
- return [2 /*return*/, (_a = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _a === void 0 ? void 0 : _a.handleSubmit()];
187
- }); }); };
191
+ var handleOk = function () { return __awaiter(void 0, void 0, void 0, function () {
192
+ var _a;
193
+ return __generator(this, function (_b) {
194
+ switch (_b.label) {
195
+ case 0: return [4 /*yield*/, ((_a = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _a === void 0 ? void 0 : _a.handleSubmit())];
196
+ case 1:
197
+ _b.sent();
198
+ setTimeout(function () {
199
+ var _a;
200
+ if (Object.keys(((_a = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _a === void 0 ? void 0 : _a.errors()) || {}).length > 0) {
201
+ Message.error('有必填项未填');
202
+ }
203
+ }, 200);
204
+ return [2 /*return*/];
205
+ }
206
+ });
207
+ }); };
188
208
  var handleSubmit = useCallback(function (values) { return __awaiter(void 0, void 0, void 0, function () {
189
209
  var _a, errorIndexes, params, _b, minResponseDuration, duration;
190
210
  return __generator(this, function (_c) {
@@ -1,4 +1,5 @@
1
1
  import { BaseAiAbilityParams, BaseExtraParams } from '@/modules/ai-question/interface';
2
+ import type { FormikErrors } from 'formik';
2
3
  export interface VideoBroadcastParams {
3
4
  videoRetry?: number;
4
5
  videoUrl?: string;
@@ -74,6 +75,7 @@ export interface UpdateQuestionState {
74
75
  export interface FormRef {
75
76
  handleValues: () => QuestionFormValues;
76
77
  handleSubmit: () => void;
78
+ errors: () => FormikErrors<QuestionFormValues>;
77
79
  setFormValues: (values: Partial<QuestionFormValues>) => void;
78
80
  }
79
81
  export interface RandomQuestionProps {
@@ -98,6 +98,9 @@ export var ChoiceItemInput = styled(Input)({
98
98
  fontSize: 14,
99
99
  position: 'relative',
100
100
  top: 0.5,
101
+ '&::after': {
102
+ bottom: '1px',
103
+ },
101
104
  '&::before': {
102
105
  display: 'none',
103
106
  },
@@ -70,7 +70,7 @@ var AiReportRoot = forwardRef(function (props, ref) {
70
70
  else {
71
71
  return (_jsxs(Box, { children: [_jsx(NotFinish, {}), (collection === null || collection === void 0 ? void 0 : collection.length) > 0 && _jsx(ScoreReport, { customScore: customScore, onRefreshSuccess: handleRefreshSuccess }), (workplaces === null || workplaces === void 0 ? void 0 : workplaces.length) > 0 && _jsx(WorkPlaces, {}), (collection === null || collection === void 0 ? void 0 : collection.length) > 0 && _jsx(AIEvaluate, {}), _jsx(Suggestion, {}), _jsx(VideoQuestion, {})] }));
72
72
  }
73
- }, [handleRefreshSuccess, onSendReminderClick, reminderSent, status, operableButtons, collection, workplaces]);
73
+ }, [handleRefreshSuccess, onSendReminderClick, customScore, reminderSent, status, operableButtons, collection, workplaces]);
74
74
  return (_jsx(Box, __assign({ loading: firstLoad.current && loading, sx: { width: '100%', minHeight: '584px', height: '100%', margin: '0 auto', overflow: 'auto' } }, { children: aiReportResult })));
75
75
  });
76
76
  AiReportRoot.displayName = 'AiReportRoot';
@@ -16,11 +16,13 @@ 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) {
23
23
  var _a, _b;
24
+ if (disabledScore)
25
+ return;
24
26
  var newSteps = update(steps, (_a = {}, _a[stepIndex] = { scoreInfo: { abilities: (_b = {}, _b[index] = { finalScore: { $set: score } }, _b) } }, _a));
25
27
  updateReportResult(__assign(__assign({}, reportResult), { steps: newSteps }));
26
28
  onScoreChange &&
@@ -30,11 +32,11 @@ var Abilities = function (_a) {
30
32
  type: 2,
31
33
  score: score,
32
34
  });
33
- }, [stepIndex, reportResult, steps, updateReportResult, onScoreChange]);
35
+ }, [stepIndex, reportResult, steps, updateReportResult, onScoreChange, disabledScore]);
34
36
  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
37
  steps[stepIndex].scoreInfo.abilities.map(function (_a, index) {
36
38
  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));
39
+ 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
40
  }) }))] })));
39
41
  };
40
42
  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) })));
@@ -67,6 +68,8 @@ var QuestionItem = function (props) {
67
68
  }, [analysisResult]);
68
69
  var handleChangeCommitted = useCallback(function (score) {
69
70
  var _a;
71
+ if (isSingleChoice)
72
+ return;
70
73
  var newSteps = update(steps, (_a = {}, _a[index] = { scoreInfo: { finalScore: { $set: score } } }, _a));
71
74
  updateReportResult(__assign(__assign({}, reportResult), { steps: newSteps }));
72
75
  onScoreChange &&
@@ -75,7 +78,7 @@ var QuestionItem = function (props) {
75
78
  type: 1,
76
79
  score: score,
77
80
  });
78
- }, [index, reportResult, steps, updateReportResult, onScoreChange]);
81
+ }, [index, reportResult, steps, updateReportResult, onScoreChange, isSingleChoice]);
79
82
  var handleClickItem = useCallback(function (e) {
80
83
  e.stopPropagation();
81
84
  if (videoUrl) {
@@ -88,6 +91,6 @@ var QuestionItem = function (props) {
88
91
  mt: 2,
89
92
  cursor: videoUrl ? 'pointer' : 'inherit',
90
93
  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));
94
+ }, 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
95
  };
93
96
  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]);
@@ -19,7 +19,13 @@ var SingleChoice = function (_a) {
19
19
  width: '100%',
20
20
  },
21
21
  } }, { children: options.map(function (v, i) {
22
- return (_jsx(Radio, { value: i, label: _jsxs(Stack, __assign({ width: "100%", direction: "row", spacing: 1, alignItems: "center", justifyContent: "space-between" }, { children: [_jsx(Typography, __assign({ color: "#4caf50", fontWeight: "medium", variant: "caption" }, { children: v.content })), _jsxs(Typography, __assign({ color: "#4caf50", fontWeight: "medium", variant: "caption" }, { children: [v.score, "\u5206"] }))] })) }, i));
22
+ return (_jsx(Radio
23
+ // @ts-ignore
24
+ , {
25
+ // @ts-ignore
26
+ FormControlLabelProps: {
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", 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));
23
29
  }) })) }));
24
30
  };
25
31
  export default SingleChoice;
@@ -17,6 +17,6 @@ import { Box, Empty, Paper } from 'fbm-ui';
17
17
  var VideoQuestion = function () {
18
18
  var reportResult = useAiReportStore(function (store) { return [store.reportResult, store.operableButtons]; }).reportResult;
19
19
  var steps = (reportResult || {}).steps;
20
- return (_jsxs(Box, __assign({ id: "report-question", component: Paper, pl: 2, pt: 2, pr: 2, style: { background: '#fff', border: '1px solid rgb(244, 244, 244)' }, mt: 2 }, { children: [_jsx(AiHeaderTitle, { name: "\u89C6\u9891\u9898" }), _jsx(Box, __assign({ mt: 3 }, { children: steps && steps.length > 0 ? (steps === null || steps === void 0 ? void 0 : steps.map(function (item, index) { return _jsx(QuestionItem, __assign({ index: index }, item), item.token); })) : (_jsx(Empty, { src: "//public-static-assets.oss-cn-beijing.aliyuncs.com/img/empty.png", desc: "\u6682\u65E0\u9898\u76EE" })) }))] })));
20
+ return (_jsxs(Box, __assign({ id: "report-question", component: Paper, p: 2, style: { background: '#fff', border: '1px solid rgb(244, 244, 244)' }, mt: 2 }, { children: [_jsx(AiHeaderTitle, { name: "\u89C6\u9891\u9898" }), _jsx(Box, __assign({ mt: 3 }, { children: steps && steps.length > 0 ? (steps === null || steps === void 0 ? void 0 : steps.map(function (item, index) { return _jsx(QuestionItem, __assign({ index: index }, item), item.token); })) : (_jsx(Empty, { src: "//public-static-assets.oss-cn-beijing.aliyuncs.com/img/empty.png", desc: "\u6682\u65E0\u9898\u76EE" })) }))] })));
21
21
  };
22
22
  export default VideoQuestion;
@@ -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
  }
@@ -72,7 +72,6 @@ export var useAiAnalysisStore = (_a = createStore(function () {
72
72
  ];
73
73
  });
74
74
  var resAiAbilities = update(data, { $splice: $splice });
75
- console.log('resAiAbilities', resAiAbilities);
76
75
  setAiAbilities(resAiAbilities);
77
76
  }, []);
78
77
  /**
@@ -24,7 +24,7 @@ exports.ADD_QUESTION_TYPE_LIST = [
24
24
  {
25
25
  type: EVALUATION,
26
26
  hide: true,
27
- title: '评估题',
27
+ title: '评测题',
28
28
  desc: '候选人根据所提供的文案进行朗读。',
29
29
  },
30
30
  {
@@ -84,7 +84,7 @@ exports.AiVideoStatus = {
84
84
  exports.MAX_UPLOAD_FILE_SIZE = 1024 * 1024 * 20;
85
85
  exports.MAX_UPLOAD_VIDEO_FILE_SIZE = 1024 * 1024 * 500;
86
86
  exports.TEST_TYPE_READONLY = [2, 3, 4, 7, 8, 9, 10, 11, 12, 16];
87
- exports.DISABLED_REPEAT_TYPE = [2, 4, 7, 8, 9, 11, 12, 16];
87
+ exports.DISABLED_REPEAT_TYPE = [2, 4, 7, 8, 9, 11, 12, 16, 17];
88
88
  exports.DISABLED_COST_TYPE = [7, 9, 8, 4, 11, 2, 16];
89
89
  // 是否开启AI分析
90
90
  var IS_AI_ANALYSIS = function (step) { return step.aiType === 2; };
@@ -18,15 +18,18 @@ var jsx_runtime_1 = require("react/jsx-runtime");
18
18
  var AiAssessmentCriteria_1 = __importDefault(require("../AiAssessmentCriteria"));
19
19
  var const_1 = require("../AiAssessmentCriteria/const");
20
20
  var AnalysisItem_1 = __importDefault(require("./AnalysisItem"));
21
+ var question_update_store_1 = require("../../../../store/ai-question/question-update-store");
22
+ var ai_question_1 = require("../../../../enum/ai-question");
21
23
  var ai_analysis_store_1 = require("../../../../store/ai-question/ai-analysis-store");
22
24
  var fbm_ui_1 = require("fbm-ui");
23
25
  var mui_1 = require("fbm-ui/lib/mui");
24
26
  var react_1 = require("react");
25
27
  var AiAnalysis = function () {
28
+ var aiShowType = (0, question_update_store_1.useUpdateQuestionStore)(function (store) { return [store.questionState]; }).questionState.aiShowType;
26
29
  var _a = (0, ai_analysis_store_1.useAiAnalysisStore)(function (store) { return [store.aiAbilities, store.analysisState]; }), aiAbilities = _a.aiAbilities, analysisState = _a.analysisState;
27
30
  var _b = (0, react_1.useState)(false), aiAnalysisOpen = _b[0], setAiAnalysisOpen = _b[1];
28
31
  var language = analysisState.language;
29
32
  var isOpenAiAnalysis = aiAbilities.length > 0;
30
- return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [aiAnalysisOpen && (0, jsx_runtime_1.jsx)(AiAssessmentCriteria_1.default, { open: aiAnalysisOpen, onClose: function () { return setAiAnalysisOpen(false); } }), isOpenAiAnalysis && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "subtitle1" }, { children: "\u6743\u91CD\u8BBE\u7F6E" })), language && const_1.LANGUAGE_NAMES[language] ? ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "secondary", ml: "8px" }, { children: ["\u8BED\u79CD\uFF1A", language && const_1.LANGUAGE_NAMES[language]] }))) : ('')] })) }))), aiAbilities.length > 0 && ((0, jsx_runtime_1.jsx)(mui_1.List, { children: aiAbilities.map(function (item, index) { return ((0, jsx_runtime_1.jsx)(AnalysisItem_1.default, __assign({ index: index }, item), item.token)); }) })), (0, jsx_runtime_1.jsx)(mui_1.Divider, { sx: { mb: 1 } }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "outlined", color: "inherit", icon: (0, jsx_runtime_1.jsx)(fbm_ui_1.AddIcon, {}), onClick: function () { return setAiAnalysisOpen(true); } }, { children: "\u6DFB\u52A0AI\u8003\u6838\u7EF4\u5EA6" }))] }));
33
+ return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [aiAnalysisOpen && (0, jsx_runtime_1.jsx)(AiAssessmentCriteria_1.default, { open: aiAnalysisOpen, onClose: function () { return setAiAnalysisOpen(false); } }), isOpenAiAnalysis && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "subtitle1" }, { children: "\u6743\u91CD\u8BBE\u7F6E" })), language && const_1.LANGUAGE_NAMES[language] ? ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "secondary", ml: "8px" }, { children: ["\u8BED\u79CD\uFF1A", language && const_1.LANGUAGE_NAMES[language]] }))) : ('')] })) }))), aiAbilities.length > 0 && ((0, jsx_runtime_1.jsx)(mui_1.List, { children: aiAbilities.map(function (item, index) { return ((0, jsx_runtime_1.jsx)(AnalysisItem_1.default, __assign({ index: index }, item), item.token)); }) })), (0, jsx_runtime_1.jsx)(mui_1.Divider, { sx: { mb: 1 } }), aiShowType !== ai_question_1.ADD_QUESTION_TYPE.SINGLECHIOCE && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "outlined", color: "inherit", icon: (0, jsx_runtime_1.jsx)(fbm_ui_1.AddIcon, {}), onClick: function () { return setAiAnalysisOpen(true); } }, { children: "\u6DFB\u52A0AI\u8003\u6838\u7EF4\u5EA6" })))] }));
31
34
  };
32
35
  exports.default = AiAnalysis;
@@ -81,6 +81,6 @@ var QuestionModelListItem = function (props) {
81
81
  }, [questions]);
82
82
  return ((0, jsx_runtime_1.jsxs)(mui_1.Paper, __assign({ variant: "outlined", sx: { display: 'block', mt: 2 } }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ display: "flex", borderBottom: !ai_question_1.DISABLED_REPEAT_TYPE.includes(type) || isAiAnalysis ? '1px solid rgba(0, 0, 0, 0.08)' : 'none' }, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ flex: "1 0", padding: "8px 0px 16px 16px" }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "primary.main", fontWeight: "medium" }, { children: ["\u9898\u76EE", index + 1] })), (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.DragHandleIcon, { className: "dragHandle" }) })), (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.jsx)(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.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "primary.main", fontWeight: "medium", mr: 0.5 }, { children: ["[", ai_question_1.QUESTION_TYPE_TITLE_MAP[aiShowType], "]"] })), (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) {
83
83
  return label && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: "".concat(label), placement: "bottom" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Chip, { color: "default", label: label, size: "medium", sx: { ml: 1, maxWidth: '158px', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' } }, label) })));
84
- }), aiType === 2 && (0, jsx_runtime_1.jsx)(fbm_ui_1.Chip, { variant: "filled", color: "primary", label: "AI\u8BC4\u5206", size: "medium", sx: { ml: 1 } }), (questions === null || questions === void 0 ? void 0 : questions.length) > 1 && (0, jsx_runtime_1.jsx)(fbm_ui_1.Chip, { variant: "filled", color: "warning", label: "\u5185\u5BB9\u968F\u673A", size: "medium", sx: { ml: 1 } })] })) })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ mt: 1, pr: 2, display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "secondary" }, { children: formatQuestion })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ sx: { ml: 2, flexShrink: 0 }, variant: "caption", color: "secondary", alignSelf: "flex-end" }, { children: ["\u56DE\u7B54\u65F6\u957F:\u00A0", (0, utils_1.getSecondToTime)(Number(duration))] }))] }))] })) })), (!ai_question_1.DISABLED_REPEAT_TYPE.includes(type) || isAiAnalysis) && ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", justifyContent: "space-between", spacing: 1, height: 42 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", padding: "3px 0 3px 40px" }, { children: isAiAnalysis && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", sx: { flexShrink: 0 } }, { children: "\u6743\u91CD\u5360\u6BD4\uFF1A" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Input, { sx: { width: 92 }, size: "small", value: weight, endAdornment: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "textSecondary" }, { children: "%" })), disabled: disabledWeight, onChange: handleWeightChange, onBlur: handleWeightBlur }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: "AI\u6D4B\u8BC4\u9898\u53EF\u4EE5\u8BBE\u7F6E\u6743\u91CD\uFF0C\u7CFB\u7EDF\u5BF9\u5019\u9009\u4EBA\u89C6\u9891\u9762\u8BD5\u7ED3\u679C\u4F1A\u52A0\u5165\u6743\u91CD\u8FDB\u884C\u8BA1\u7B97\uFF0C\u5F97\u51FAAI\u89C6\u9891\u9762\u8BD5\u5F97\u5206\u3002\u8BBE\u7F6E\u540E5\u5206\u949F\u8D77\u6548" }, { children: (0, jsx_runtime_1.jsx)("span", __assign({ style: { display: 'flex', alignItems: 'center', marginLeft: '8px' } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.InfoIcon, { sx: { fontSize: 14, color: 'rgba(0, 0, 0, 0.26)' } }) })) }))] })) })), !ai_question_1.DISABLED_REPEAT_TYPE.includes(type) && ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Switch, { sx: { flexShrink: 0, ml: 2, mr: 2 }, 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 }), type === 1 && aiShowType === 1 && ((aiInterviewerProfile === null || aiInterviewerProfile === void 0 ? void 0 : aiInterviewerProfile.humanType) !== 2 || interactType === 1) && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Switch, { sx: { flexShrink: 0, mr: 2 }, size: "small", checked: isOpenAIFollowUp, label: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ fontSize: 12, lineHeight: 1.5, color: "rgba(0, 0, 0, 0.56)" }, { children: "\u56DE\u7B54\u4E0D\u5145\u5206\u65F6\u8FFD\u95EE" })), onChange: handleOpenAIFollowUpStatus }))] })))] })))] })));
84
+ }), aiType === 2 && (0, jsx_runtime_1.jsx)(fbm_ui_1.Chip, { variant: "filled", color: "primary", label: "AI\u8BC4\u5206", size: "medium", sx: { ml: 1 } }), (questions === null || questions === void 0 ? void 0 : questions.length) > 1 && (0, jsx_runtime_1.jsx)(fbm_ui_1.Chip, { variant: "filled", color: "warning", label: "\u5185\u5BB9\u968F\u673A", size: "medium", sx: { ml: 1 } })] })) })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ mt: 1, pr: 2, display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "secondary" }, { children: formatQuestion })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ sx: { ml: 2, flexShrink: 0 }, variant: "caption", color: "secondary", alignSelf: "flex-end" }, { children: ["\u56DE\u7B54\u65F6\u957F:\u00A0", (0, utils_1.getSecondToTime)(Number(duration))] }))] }))] })) })), (!ai_question_1.DISABLED_REPEAT_TYPE.includes(type) || isAiAnalysis) && ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", justifyContent: "space-between", spacing: 1, height: 42 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", padding: "3px 0 3px 16px" }, { children: isAiAnalysis && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", sx: { flexShrink: 0 } }, { children: "\u6743\u91CD\u5360\u6BD4\uFF1A" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Input, { sx: { width: 92 }, size: "small", value: weight, endAdornment: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "textSecondary" }, { children: "%" })), disabled: disabledWeight, onChange: handleWeightChange, onBlur: handleWeightBlur }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: "AI\u6D4B\u8BC4\u9898\u53EF\u4EE5\u8BBE\u7F6E\u6743\u91CD\uFF0C\u7CFB\u7EDF\u5BF9\u5019\u9009\u4EBA\u89C6\u9891\u9762\u8BD5\u7ED3\u679C\u4F1A\u52A0\u5165\u6743\u91CD\u8FDB\u884C\u8BA1\u7B97\uFF0C\u5F97\u51FAAI\u89C6\u9891\u9762\u8BD5\u5F97\u5206\u3002\u8BBE\u7F6E\u540E5\u5206\u949F\u8D77\u6548" }, { children: (0, jsx_runtime_1.jsx)("span", __assign({ style: { display: 'flex', alignItems: 'center', marginLeft: '8px' } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.InfoIcon, { sx: { fontSize: 14, color: 'rgba(0, 0, 0, 0.26)' } }) })) }))] })) })), !ai_question_1.DISABLED_REPEAT_TYPE.includes(type) && ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Switch, { sx: { flexShrink: 0, ml: 2, mr: 2 }, 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 }), type === 1 && aiShowType === 1 && ((aiInterviewerProfile === null || aiInterviewerProfile === void 0 ? void 0 : aiInterviewerProfile.humanType) !== 2 || interactType === 1) && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Switch, { sx: { flexShrink: 0, mr: 2 }, size: "small", checked: isOpenAIFollowUp, label: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ fontSize: 12, lineHeight: 1.5, color: "rgba(0, 0, 0, 0.56)" }, { children: "\u56DE\u7B54\u4E0D\u5145\u5206\u65F6\u8FFD\u95EE" })), onChange: handleOpenAIFollowUpStatus }))] })))] })))] })));
85
85
  };
86
86
  exports.default = (0, react_1.memo)(QuestionModelListItem);
@@ -49,7 +49,13 @@ var AiEvaluation = function () {
49
49
  var addQuestionOpen = state.addQuestionOpen, showOnlyAITest = state.showOnlyAITest;
50
50
  var handleClickAdd = (0, react_1.useCallback)(function (aiShowType) {
51
51
  setState({ addQuestionOpen: false });
52
- updateQuestionState({ open: true, aiShowType: aiShowType, token: '', index: -1, item: __assign(__assign({}, const_1.defaultQuestionParams), { aiShowType: aiShowType, token: (0, utils_1.uniqueId)() }) });
52
+ updateQuestionState({
53
+ open: true,
54
+ aiShowType: aiShowType,
55
+ token: '',
56
+ index: -1,
57
+ item: __assign(__assign({}, const_1.defaultQuestionParams), { aiShowType: aiShowType, type: aiShowType === ai_question_2.ADD_QUESTION_TYPE.SINGLECHIOCE ? 17 : 1, token: (0, utils_1.uniqueId)() }),
58
+ });
53
59
  }, [setState, updateQuestionState]);
54
60
  var content = ((0, jsx_runtime_1.jsx)(mui_1.List, { children: ai_question_1.ADD_QUESTION_TYPE_SHOW_LIST.map(function (_a) {
55
61
  var title = _a.title, desc = _a.desc, type = _a.type;
@@ -27,7 +27,6 @@ exports.VERIFICATION_SCORE = exports.MAX_SCORE_VALUE = exports.IS_INTEGER_REG =
27
27
  var jsx_runtime_1 = require("react/jsx-runtime");
28
28
  var styled_1 = require("./styled");
29
29
  var utils_1 = require("../../../../utils/utils");
30
- var array_move_1 = require("array-move");
31
30
  var fbm_ui_1 = require("fbm-ui");
32
31
  var formik_1 = require("formik");
33
32
  var react_1 = require("react");
@@ -47,10 +46,14 @@ var Choice = function (_a) {
47
46
  var index = _a.index, item = _a.item, onChange = _a.onChange;
48
47
  var ref = (0, react_1.useRef)();
49
48
  var sortable = (0, react_1.useRef)();
49
+ var helper = (0, react_1.useRef)();
50
50
  var handleOptionAdd = (0, react_1.useCallback)(function () {
51
+ var _a;
51
52
  var optionItem = { key: (0, utils_1.uniqueId)(), content: '', score: 0 };
52
- onChange('options', __spreadArray(__spreadArray([], ((item === null || item === void 0 ? void 0 : item.options) || []), true), [optionItem], false), index);
53
- }, [index, item, onChange]);
53
+ if (helper.current) {
54
+ (_a = helper.current) === null || _a === void 0 ? void 0 : _a.push(optionItem);
55
+ }
56
+ }, []);
54
57
  (0, react_1.useEffect)(function () {
55
58
  sortable.current && sortable.current.destroy();
56
59
  sortable.current = new sortablejs_1.default(ref.current, {
@@ -59,19 +62,22 @@ var Choice = function (_a) {
59
62
  forceFallback: true,
60
63
  onEnd: function (_a) {
61
64
  var oldIndex = _a.oldIndex, newIndex = _a.newIndex;
62
- var options = (0, array_move_1.arrayMoveImmutable)((item === null || item === void 0 ? void 0 : item.options) || [], oldIndex, newIndex);
63
- onChange('options', __spreadArray([], options, true), index);
65
+ if (helper.current) {
66
+ helper.current.move(oldIndex, newIndex);
67
+ }
64
68
  },
65
69
  });
66
- }, [index, item, onChange]);
70
+ }, [index, item, onChange, helper]);
67
71
  (0, react_1.useEffect)(function () {
68
72
  var _a;
69
73
  if (!((_a = item === null || item === void 0 ? void 0 : item.options) === null || _a === void 0 ? void 0 : _a.length)) {
70
- handleOptionAdd();
74
+ var optionItem = { key: (0, utils_1.uniqueId)(), content: '', score: 0 };
75
+ onChange('options', [optionItem], index);
71
76
  }
72
- }, [item, handleOptionAdd, index]);
77
+ }, [item, onChange, index]);
73
78
  return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ width: "100%" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ ref: ref }, { children: ((_b = item === null || item === void 0 ? void 0 : item.options) === null || _b === void 0 ? void 0 : _b.length) > 0 && ((0, jsx_runtime_1.jsx)(formik_1.FieldArray, { name: "questions.".concat(index, ".options"), render: function (p) {
74
79
  var _a;
80
+ helper.current = p;
75
81
  return (_a = p.form.values.questions[index].options) === null || _a === void 0 ? void 0 : _a.map(function (v, i) {
76
82
  var _a;
77
83
  return ((0, jsx_runtime_1.jsxs)(styled_1.ChoiceItem, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.DragIndicatorIcon, { className: "optionItemDragHandle" }), (0, jsx_runtime_1.jsx)(styled_1.ChoiceIcon, { borderRadius: 2 }), (0, jsx_runtime_1.jsx)(fbm_ui_1.FormItem, __assign({ required: true, name: "questions[".concat(index, "].options[").concat(i, "].content"), placeholder: "\u65B0\u9009\u9879", InputProps: {
@@ -80,7 +86,7 @@ var Choice = function (_a) {
80
86
  sx: {
81
87
  mr: 1.5,
82
88
  },
83
- }, sx: { height: 'auto', flexGrow: 1, overflow: 'hidden' } }, { children: (0, jsx_runtime_1.jsx)(styled_1.ChoiceItemInput, { multiline: true, maxRows: 3, placeholder: "\u65B0\u9009\u9879", variant: "standard" }) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ width: 36, flexShrink: 0 }, { children: ((_a = p.form.values.questions[index].options) === null || _a === void 0 ? void 0 : _a.length) > 1 && ((0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ className: "choice-item-delete-icon", onClick: function () { return p.remove(i); } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.CloseIcon, {}) }))) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.FormItem, __assign({ required: true, name: "questions[".concat(index, "].options[").concat(i, "].score"), placeholder: "\u5206\u503C", InputProps: {
89
+ }, sx: { height: 'auto', flexGrow: 1, overflow: 'hidden' } }, { children: (0, jsx_runtime_1.jsx)(styled_1.ChoiceItemInput, { multiline: true, maxRows: 3, placeholder: "\u65B0\u9009\u9879", variant: "standard" }) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ width: 36, flexShrink: 0, ml: 2 }, { children: ((_a = p.form.values.questions[index].options) === null || _a === void 0 ? void 0 : _a.length) > 1 && ((0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ className: "choice-item-delete-icon", onClick: function () { return p.remove(i); } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.CloseIcon, {}) }))) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.FormItem, __assign({ required: true, name: "questions[".concat(index, "].options[").concat(i, "].score"), placeholder: "\u5206\u503C", InputProps: {
84
90
  multiline: true,
85
91
  }, rules: [function (_a) {
86
92
  var value = _a.value;
@@ -91,7 +97,7 @@ var Choice = function (_a) {
91
97
  return;
92
98
  }
93
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);
94
- } }, { children: (0, jsx_runtime_1.jsx)(styled_1.ScoreInput, { size: "small", placeholder: "\u5206\u503C", endAdornment: "\u5206" }) }))] }, i));
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)()));
95
101
  });
96
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" })) })] })));
97
103
  };
@@ -88,11 +88,6 @@ var QuestionForm = (0, react_1.forwardRef)(function (props, ref) {
88
88
  }, [data]);
89
89
  var form = (0, fbm_ui_1.useForm)({
90
90
  initialValues: initialValues,
91
- validate: function (values) {
92
- var errors = {};
93
- // console.log(values);
94
- return errors;
95
- },
96
91
  onSubmit: function (values) { return __awaiter(void 0, void 0, void 0, function () {
97
92
  return __generator(this, function (_a) {
98
93
  switch (_a.label) {
@@ -127,6 +122,7 @@ var QuestionForm = (0, react_1.forwardRef)(function (props, ref) {
127
122
  (0, react_1.useImperativeHandle)(ref, function () { return ({
128
123
  handleValues: function () { return form.values; },
129
124
  handleSubmit: function () { return form.handleSubmit(); },
125
+ errors: function () { return form.errors; },
130
126
  setFormValues: function (values) { return form.setValues(__assign(__assign({}, form.values), values)); },
131
127
  }); });
132
128
  (0, react_1.useEffect)(function () {
@@ -162,11 +158,11 @@ var QuestionForm = (0, react_1.forwardRef)(function (props, ref) {
162
158
  } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.CloseIcon, {}) })) })))] }), index)); });
163
159
  } })) : ((0, jsx_runtime_1.jsx)(VideoVoice_1.default, {}))), !preview && aiShowType === ai_question_1.ADD_QUESTION_TYPE.SINGLECHIOCE && (
164
160
  // @ts-ignore
165
- (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ component: mui_1.Paper, variant: "outlined", px: 2, pb: 2, pt: 0.5 }, { children: (0, jsx_runtime_1.jsx)(formik_1.FieldArray, { name: "questions", render: function () {
161
+ (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, { children: (0, jsx_runtime_1.jsx)(formik_1.FieldArray, { name: "questions", render: function () {
166
162
  var _a;
167
163
  return (_a = form.values.questions) === null || _a === void 0 ? void 0 : _a.map(function (v, index) {
168
164
  var _a, _b;
169
- return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ width: "100%", justifyContent: "space-between", spacing: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", justifyContent: "flex-end" }, { children: ((_b = (_a = form === null || form === void 0 ? void 0 : form.values) === null || _a === void 0 ? void 0 : _a.questions) === null || _b === void 0 ? void 0 : _b.length) > 1 && ((0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ sx: { mr: -1 }, onClick: function () {
165
+ return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ px: 2, pb: 2, pt: 0.5, mb: 2, boxSizing: "border-box", component: mui_1.Paper, variant: "outlined", width: "100%", justifyContent: "space-between", spacing: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", justifyContent: "flex-end" }, { children: ((_b = (_a = form === null || form === void 0 ? void 0 : form.values) === null || _a === void 0 ? void 0 : _a.questions) === null || _b === void 0 ? void 0 : _b.length) > 1 && ((0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ size: "small", sx: { mr: -1 }, onClick: function () {
170
166
  form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], form.values.questions.filter(function (_, i) { return i !== index; }), true) }));
171
167
  } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.DeleteIcon, {}) }))) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.FormItem, { required: true, name: "questions.".concat(index, ".content"), label: "\u9762\u8BD5\u5185\u5BB9", max: 300, placeholder: "\u9762\u8BD5\u5185\u5BB9\uFF08\u7CFB\u7EDF\u5C06\u6839\u636E\u6B64\u5185\u5BB9\u5411\u5019\u9009\u4EBA\u8FDB\u884C\u8BED\u97F3\u64AD\u62A5\uFF09", InputProps: {
172
168
  // rows: 3,
@@ -179,11 +175,10 @@ var QuestionForm = (0, react_1.forwardRef)(function (props, ref) {
179
175
  height: 'auto',
180
176
  } }), (0, jsx_runtime_1.jsx)(Chioce_1.default, { index: index, item: v, onChange: function (_, options, i) {
181
177
  form.values.questions[index].options = options;
182
- console.log(form.values.questions, options);
183
178
  form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], form.values.questions, true) }));
184
179
  } })] }), index));
185
180
  });
186
- } }) }))), !preview && aiShowType !== ai_question_1.ADD_QUESTION_TYPE.LANGUAGE && ((0, jsx_runtime_1.jsx)(RandomQuestion_1.default, { aiShowType: aiShowType, category: aiAbilityList === null || aiAbilityList === void 0 ? void 0 : aiAbilityList.find(function (v) { var _a; return v.name === ((_a = form.values.category) === null || _a === void 0 ? void 0 : _a.value); }), broadcastType: form.values.broadcastType, onAddCustonQuestion: function () {
181
+ } }) })), !preview && aiShowType !== ai_question_1.ADD_QUESTION_TYPE.LANGUAGE && ((0, jsx_runtime_1.jsx)(RandomQuestion_1.default, { aiShowType: aiShowType, category: aiAbilityList === null || aiAbilityList === void 0 ? void 0 : aiAbilityList.find(function (v) { var _a; return v.name === ((_a = form.values.category) === null || _a === void 0 ? void 0 : _a.value); }), broadcastType: form.values.broadcastType, onAddCustonQuestion: function () {
187
182
  form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray(__spreadArray([], form.values.questions, true), [{ content: '', videoUrl: '' }], false) }));
188
183
  }, onAddRandomQuestion: function (qs) {
189
184
  form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray(__spreadArray([], form.values.questions, true), qs.map(function (v) { return ({ content: v, videoUrl: '' }); }), true) }));
@@ -0,0 +1,15 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * 验证0-9的整数
4
+ */
5
+ export declare const IS_INTEGER_REG: RegExp;
6
+ /**
7
+ * 可输入最大分值
8
+ */
9
+ export declare const MAX_SCORE_VALUE = 100;
10
+ export declare const VERIFICATION_SCORE: (value: string) => boolean;
11
+ declare const Score: ({ label, ...props }: {
12
+ [x: string]: any;
13
+ label: any;
14
+ }) => JSX.Element;
15
+ export default Score;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.VERIFICATION_SCORE = exports.MAX_SCORE_VALUE = exports.IS_INTEGER_REG = void 0;
26
+ var jsx_runtime_1 = require("react/jsx-runtime");
27
+ var styled_1 = require("./styled");
28
+ var fbm_ui_1 = require("fbm-ui");
29
+ var formik_1 = require("formik");
30
+ /**
31
+ * 验证0-9的整数
32
+ */
33
+ exports.IS_INTEGER_REG = /^[0-9]\d*$/;
34
+ /**
35
+ * 可输入最大分值
36
+ */
37
+ exports.MAX_SCORE_VALUE = 100;
38
+ // rules={[({ value }) => VERIFICATION_SCORE(value as string)]}
39
+ // sx={{ height: 'auto', widht: 84 }}
40
+ // onChange={e => {
41
+ // const value = e.target.value;
42
+ // if (VERIFICATION_SCORE(value) || Number(value) > MAX_SCORE_VALUE || Number(value) < 1) {
43
+ // console.log('>>>>>>');
44
+ // return;
45
+ // }
46
+ // // onChange('options', [...(item?.options || []).map((v, index) => (i === index ? { ...v, score: Number(value) } : v))], index);
47
+ // }}
48
+ var VERIFICATION_SCORE = function (value) { return (value ? !exports.IS_INTEGER_REG.test(value) || Number(value) > exports.MAX_SCORE_VALUE : false); };
49
+ exports.VERIFICATION_SCORE = VERIFICATION_SCORE;
50
+ var Score = function (_a) {
51
+ var label = _a.label, props = __rest(_a, ["label"]);
52
+ // @ts-ignore
53
+ var _b = (0, formik_1.useField)(props), field = _b[0], meta = _b[1], helpers = _b[2];
54
+ console.log(field, meta, helpers);
55
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(styled_1.ScoreInput, __assign({}, field, props, { size: "small", placeholder: "\u5206\u503C", endAdornment: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "caption" }, { children: "\u5206" })) })) }));
56
+ };
57
+ exports.default = Score;
@@ -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" })) }))] })));
@@ -187,9 +193,23 @@ var QuestionUpdate = function () {
187
193
  }
188
194
  });
189
195
  }); }, [getModelParams, item, updateQuestionState]);
190
- var handleOk = function () { return __awaiter(void 0, void 0, void 0, function () { var _a; return __generator(this, function (_b) {
191
- return [2 /*return*/, (_a = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _a === void 0 ? void 0 : _a.handleSubmit()];
192
- }); }); };
196
+ var handleOk = function () { return __awaiter(void 0, void 0, void 0, function () {
197
+ var _a;
198
+ return __generator(this, function (_b) {
199
+ switch (_b.label) {
200
+ case 0: return [4 /*yield*/, ((_a = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _a === void 0 ? void 0 : _a.handleSubmit())];
201
+ case 1:
202
+ _b.sent();
203
+ setTimeout(function () {
204
+ var _a;
205
+ if (Object.keys(((_a = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _a === void 0 ? void 0 : _a.errors()) || {}).length > 0) {
206
+ fbm_ui_1.Message.error('有必填项未填');
207
+ }
208
+ }, 200);
209
+ return [2 /*return*/];
210
+ }
211
+ });
212
+ }); };
193
213
  var handleSubmit = (0, react_1.useCallback)(function (values) { return __awaiter(void 0, void 0, void 0, function () {
194
214
  var _a, errorIndexes, params, _b, minResponseDuration, duration;
195
215
  return __generator(this, function (_c) {
@@ -1,4 +1,5 @@
1
1
  import { BaseAiAbilityParams, BaseExtraParams } from '@/modules/ai-question/interface';
2
+ import type { FormikErrors } from 'formik';
2
3
  export interface VideoBroadcastParams {
3
4
  videoRetry?: number;
4
5
  videoUrl?: string;
@@ -74,6 +75,7 @@ export interface UpdateQuestionState {
74
75
  export interface FormRef {
75
76
  handleValues: () => QuestionFormValues;
76
77
  handleSubmit: () => void;
78
+ errors: () => FormikErrors<QuestionFormValues>;
77
79
  setFormValues: (values: Partial<QuestionFormValues>) => void;
78
80
  }
79
81
  export interface RandomQuestionProps {
@@ -101,6 +101,9 @@ exports.ChoiceItemInput = (0, fbm_ui_1.styled)(fbm_ui_1.Input)({
101
101
  fontSize: 14,
102
102
  position: 'relative',
103
103
  top: 0.5,
104
+ '&::after': {
105
+ bottom: '1px',
106
+ },
104
107
  '&::before': {
105
108
  display: 'none',
106
109
  },
@@ -75,7 +75,7 @@ var AiReportRoot = (0, react_1.forwardRef)(function (props, ref) {
75
75
  else {
76
76
  return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsx)(NotFinish_1.default, {}), (collection === null || collection === void 0 ? void 0 : collection.length) > 0 && (0, jsx_runtime_1.jsx)(ScoreReport_1.default, { customScore: customScore, onRefreshSuccess: handleRefreshSuccess }), (workplaces === null || workplaces === void 0 ? void 0 : workplaces.length) > 0 && (0, jsx_runtime_1.jsx)(WorkPlaces_1.default, {}), (collection === null || collection === void 0 ? void 0 : collection.length) > 0 && (0, jsx_runtime_1.jsx)(AIEvaluate_1.default, {}), (0, jsx_runtime_1.jsx)(Suggestion_1.default, {}), (0, jsx_runtime_1.jsx)(VideoQuestion_1.default, {})] }));
77
77
  }
78
- }, [handleRefreshSuccess, onSendReminderClick, reminderSent, status, operableButtons, collection, workplaces]);
78
+ }, [handleRefreshSuccess, onSendReminderClick, customScore, reminderSent, status, operableButtons, collection, workplaces]);
79
79
  return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ loading: firstLoad.current && loading, sx: { width: '100%', minHeight: '584px', height: '100%', margin: '0 auto', overflow: 'auto' } }, { children: aiReportResult })));
80
80
  });
81
81
  AiReportRoot.displayName = 'AiReportRoot';
@@ -21,11 +21,13 @@ 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) {
28
28
  var _a, _b;
29
+ if (disabledScore)
30
+ return;
29
31
  var newSteps = (0, immutability_helper_1.default)(steps, (_a = {}, _a[stepIndex] = { scoreInfo: { abilities: (_b = {}, _b[index] = { finalScore: { $set: score } }, _b) } }, _a));
30
32
  updateReportResult(__assign(__assign({}, reportResult), { steps: newSteps }));
31
33
  onScoreChange &&
@@ -35,11 +37,11 @@ var Abilities = function (_a) {
35
37
  type: 2,
36
38
  score: score,
37
39
  });
38
- }, [stepIndex, reportResult, steps, updateReportResult, onScoreChange]);
40
+ }, [stepIndex, reportResult, steps, updateReportResult, onScoreChange, disabledScore]);
39
41
  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
42
  steps[stepIndex].scoreInfo.abilities.map(function (_a, index) {
41
43
  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));
44
+ 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
45
  }) }))] })));
44
46
  };
45
47
  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) })));
@@ -72,6 +73,8 @@ var QuestionItem = function (props) {
72
73
  }, [analysisResult]);
73
74
  var handleChangeCommitted = (0, react_1.useCallback)(function (score) {
74
75
  var _a;
76
+ if (isSingleChoice)
77
+ return;
75
78
  var newSteps = (0, immutability_helper_1.default)(steps, (_a = {}, _a[index] = { scoreInfo: { finalScore: { $set: score } } }, _a));
76
79
  updateReportResult(__assign(__assign({}, reportResult), { steps: newSteps }));
77
80
  onScoreChange &&
@@ -80,7 +83,7 @@ var QuestionItem = function (props) {
80
83
  type: 1,
81
84
  score: score,
82
85
  });
83
- }, [index, reportResult, steps, updateReportResult, onScoreChange]);
86
+ }, [index, reportResult, steps, updateReportResult, onScoreChange, isSingleChoice]);
84
87
  var handleClickItem = (0, react_1.useCallback)(function (e) {
85
88
  e.stopPropagation();
86
89
  if (videoUrl) {
@@ -93,6 +96,6 @@ var QuestionItem = function (props) {
93
96
  mt: 2,
94
97
  cursor: videoUrl ? 'pointer' : 'inherit',
95
98
  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));
99
+ }, 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
100
  };
98
101
  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]);
@@ -21,7 +21,13 @@ var SingleChoice = function (_a) {
21
21
  width: '100%',
22
22
  },
23
23
  } }, { children: options.map(function (v, i) {
24
- return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Radio, { value: i, label: (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ width: "100%", direction: "row", spacing: 1, alignItems: "center", justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ color: "#4caf50", fontWeight: "medium", variant: "caption" }, { children: v.content })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ color: "#4caf50", fontWeight: "medium", variant: "caption" }, { children: [v.score, "\u5206"] }))] })) }, i));
24
+ return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Radio
25
+ // @ts-ignore
26
+ , {
27
+ // @ts-ignore
28
+ FormControlLabelProps: {
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", 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));
25
31
  }) })) }));
26
32
  };
27
33
  exports.default = SingleChoice;
@@ -22,6 +22,6 @@ var fbm_ui_1 = require("fbm-ui");
22
22
  var VideoQuestion = function () {
23
23
  var reportResult = (0, global_store_1.useAiReportStore)(function (store) { return [store.reportResult, store.operableButtons]; }).reportResult;
24
24
  var steps = (reportResult || {}).steps;
25
- return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ id: "report-question", component: fbm_ui_1.Paper, pl: 2, pt: 2, pr: 2, style: { background: '#fff', border: '1px solid rgb(244, 244, 244)' }, mt: 2 }, { children: [(0, jsx_runtime_1.jsx)(AiHeaderTitle_1.default, { name: "\u89C6\u9891\u9898" }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ mt: 3 }, { children: steps && steps.length > 0 ? (steps === null || steps === void 0 ? void 0 : steps.map(function (item, index) { return (0, jsx_runtime_1.jsx)(QuestionItem_1.default, __assign({ index: index }, item), item.token); })) : ((0, jsx_runtime_1.jsx)(fbm_ui_1.Empty, { src: "//public-static-assets.oss-cn-beijing.aliyuncs.com/img/empty.png", desc: "\u6682\u65E0\u9898\u76EE" })) }))] })));
25
+ return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ id: "report-question", component: fbm_ui_1.Paper, p: 2, style: { background: '#fff', border: '1px solid rgb(244, 244, 244)' }, mt: 2 }, { children: [(0, jsx_runtime_1.jsx)(AiHeaderTitle_1.default, { name: "\u89C6\u9891\u9898" }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ mt: 3 }, { children: steps && steps.length > 0 ? (steps === null || steps === void 0 ? void 0 : steps.map(function (item, index) { return (0, jsx_runtime_1.jsx)(QuestionItem_1.default, __assign({ index: index }, item), item.token); })) : ((0, jsx_runtime_1.jsx)(fbm_ui_1.Empty, { src: "//public-static-assets.oss-cn-beijing.aliyuncs.com/img/empty.png", desc: "\u6682\u65E0\u9898\u76EE" })) }))] })));
26
26
  };
27
27
  exports.default = VideoQuestion;
@@ -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
  }
@@ -78,7 +78,6 @@ exports.useAiAnalysisStore = (_a = (0, hox_1.createStore)(function () {
78
78
  ];
79
79
  });
80
80
  var resAiAbilities = (0, immutability_helper_1.default)(data, { $splice: $splice });
81
- console.log('resAiAbilities', resAiAbilities);
82
81
  setAiAbilities(resAiAbilities);
83
82
  }, []);
84
83
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eli-video-interview",
3
- "version": "1.2.40-alpha.1",
3
+ "version": "1.2.40-alpha.10",
4
4
  "description": "鳄梨科技 AI视频面试 React SDK",
5
5
  "author": "鳄梨科技",
6
6
  "license": "MIT",