eli-video-interview 1.2.36 → 1.2.37-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/components/ScrollDialogContent/index.js +1 -1
- package/esm/constants/ai-question.d.ts +7 -0
- package/esm/constants/ai-question.js +10 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/esm/modules/ai-ability-select/Root.d.ts +4 -0
- package/esm/modules/ai-ability-select/Root.js +47 -0
- package/esm/modules/ai-ability-select/components/AiAbilityItem/AiAbilityDetail.d.ts +4 -0
- package/esm/modules/ai-ability-select/components/AiAbilityItem/AiAbilityDetail.js +22 -0
- package/esm/modules/ai-ability-select/components/AiAbilityItem/index.d.ts +4 -0
- package/esm/modules/ai-ability-select/components/AiAbilityItem/index.js +42 -0
- package/esm/modules/ai-ability-select/components/AiAbilityItem/interface.d.ts +13 -0
- package/esm/modules/ai-ability-select/components/AiAbilityItem/interface.js +1 -0
- package/esm/modules/ai-ability-select/components/AiAbilityItem/styled.d.ts +2 -0
- package/esm/modules/ai-ability-select/components/AiAbilityItem/styled.js +8 -0
- package/esm/modules/ai-ability-select/components/AiAbilityList/index.d.ts +4 -0
- package/esm/modules/ai-ability-select/components/AiAbilityList/index.js +19 -0
- package/esm/modules/ai-ability-select/components/AiAbilityList/interface.d.ts +4 -0
- package/esm/modules/ai-ability-select/components/AiAbilityList/interface.js +1 -0
- package/esm/modules/ai-ability-select/index.d.ts +4 -0
- package/esm/modules/ai-ability-select/index.js +20 -0
- package/esm/modules/ai-ability-select/interface.d.ts +33 -0
- package/esm/modules/ai-ability-select/interface.js +1 -0
- package/esm/modules/ai-question/Root.js +5 -1
- package/esm/modules/ai-question/components/AiAnalysis/AnalysisItem.js +1 -1
- package/esm/modules/ai-question/components/AiAnalysis/index.js +1 -1
- package/esm/modules/ai-question/components/AiAssessmentCriteria/index.js +13 -4
- package/esm/modules/ai-question/components/BaseAccordion/index.d.ts +1 -1
- package/esm/modules/ai-question/components/BaseAccordion/index.js +22 -13
- package/esm/modules/ai-question/components/BootVideo/index.js +43 -24
- package/esm/modules/ai-question/components/BootVideo/styled.js +5 -4
- package/esm/modules/ai-question/components/QuestionModel/AutoCombine.d.ts +4 -0
- package/esm/modules/ai-question/components/QuestionModel/AutoCombine.js +19 -0
- package/esm/modules/ai-question/components/QuestionModel/Header.js +6 -6
- package/esm/modules/ai-question/components/QuestionModel/Interactive.d.ts +6 -0
- package/esm/modules/ai-question/components/QuestionModel/Interactive.js +26 -0
- package/esm/modules/ai-question/components/QuestionModel/Item.d.ts +2 -2
- package/esm/modules/ai-question/components/QuestionModel/Item.js +13 -8
- package/esm/modules/ai-question/components/QuestionModel/List.js +30 -8
- package/esm/modules/ai-question/components/QuestionModel/index.js +5 -1
- package/esm/modules/ai-question/components/QuestionModel/interface.d.ts +7 -0
- package/esm/modules/ai-question/components/QuestionPreview/index.js +1 -1
- package/esm/modules/ai-question/components/QuestionPreview/styled.d.ts +1 -1
- package/esm/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +13 -8
- package/esm/modules/ai-question/components/QuestionTemplate/index.d.ts +2 -1
- package/esm/modules/ai-question/components/QuestionTemplate/index.js +10 -5
- package/esm/modules/ai-question/components/QuestionTemplate/interface.d.ts +10 -0
- package/esm/modules/ai-question/components/QuestionUpdate/Form.d.ts +2 -2
- package/esm/modules/ai-question/components/QuestionUpdate/Form.js +44 -10
- package/esm/modules/ai-question/components/QuestionUpdate/RandomQuestion.d.ts +4 -0
- package/esm/modules/ai-question/components/QuestionUpdate/RandomQuestion.js +58 -0
- package/esm/modules/ai-question/components/QuestionUpdate/SelectQuestion.d.ts +8 -0
- package/esm/modules/ai-question/components/QuestionUpdate/SelectQuestion.js +62 -0
- package/esm/modules/ai-question/components/QuestionUpdate/VideoVoice.d.ts +2 -2
- package/esm/modules/ai-question/components/QuestionUpdate/VideoVoice.js +35 -49
- package/esm/modules/ai-question/components/QuestionUpdate/VideoVoicePreview.d.ts +6 -0
- package/esm/modules/ai-question/components/QuestionUpdate/VideoVoicePreview.js +47 -0
- package/esm/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.d.ts +7 -0
- package/esm/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.js +60 -0
- package/esm/modules/ai-question/components/QuestionUpdate/const.js +1 -0
- package/esm/modules/ai-question/components/QuestionUpdate/index.js +9 -6
- package/esm/modules/ai-question/components/QuestionUpdate/interface.d.ts +12 -0
- package/esm/modules/ai-question/components/QuestionUpdate/styled.d.ts +6 -0
- package/esm/modules/ai-question/components/QuestionUpdate/styled.js +52 -0
- package/esm/modules/ai-question/index.js +3 -5
- package/esm/modules/ai-question/interface.d.ts +17 -0
- package/esm/modules/ai-question/useAiQuestion.d.ts +1 -0
- package/esm/modules/ai-report/components/ScoreReport/styled.d.ts +3 -3
- package/esm/modules/ai-report/components/VideoQuestion/styled.d.ts +2 -2
- package/esm/modules/ai-report/components/WorkPlaces/styled.d.ts +2 -2
- package/esm/modules/ai-template/components/TemplateList/styled.d.ts +3 -3
- package/esm/modules/ai-template/components/TemplateMenu/styled.d.ts +1 -1
- package/esm/services/ai-ability.d.ts +1 -0
- package/esm/services/ai-ability.js +3 -1
- package/esm/services/ai-question.d.ts +2 -1
- package/esm/services/ai-question.js +4 -2
- package/esm/store/ai-ability-select/question-ability-store.d.ts +21 -0
- package/esm/store/ai-ability-select/question-ability-store.js +21 -0
- package/esm/store/ai-question/ai-analysis-store.d.ts +2 -2
- package/esm/store/ai-question/boot-video-store.js +7 -2
- package/esm/store/ai-question/global-store.d.ts +3 -0
- package/esm/store/ai-question/global-store.js +1 -0
- package/esm/store/ai-question/interview-room-store.d.ts +17 -0
- package/esm/store/ai-question/interview-room-store.js +24 -0
- package/esm/store/ai-question/question-model-store.d.ts +3 -0
- package/esm/store/ai-question/question-model-store.js +5 -3
- package/esm/store/ai-question/question-template-store.js +1 -1
- package/esm/store/enterprise/enterprise-store.d.ts +29 -0
- package/esm/store/enterprise/enterprise-store.js +13 -0
- package/lib/components/ScrollDialogContent/index.js +1 -1
- package/lib/constants/ai-question.d.ts +7 -0
- package/lib/constants/ai-question.js +11 -2
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -1
- package/lib/modules/ai-ability-select/Root.d.ts +4 -0
- package/lib/modules/ai-ability-select/Root.js +52 -0
- package/lib/modules/ai-ability-select/components/AiAbilityItem/AiAbilityDetail.d.ts +4 -0
- package/lib/modules/ai-ability-select/components/AiAbilityItem/AiAbilityDetail.js +24 -0
- package/lib/modules/ai-ability-select/components/AiAbilityItem/index.d.ts +4 -0
- package/lib/modules/ai-ability-select/components/AiAbilityItem/index.js +47 -0
- package/lib/modules/ai-ability-select/components/AiAbilityItem/interface.d.ts +13 -0
- package/lib/modules/ai-ability-select/components/AiAbilityItem/interface.js +2 -0
- package/lib/modules/ai-ability-select/components/AiAbilityItem/styled.d.ts +2 -0
- package/lib/modules/ai-ability-select/components/AiAbilityItem/styled.js +11 -0
- package/lib/modules/ai-ability-select/components/AiAbilityList/index.d.ts +4 -0
- package/lib/modules/ai-ability-select/components/AiAbilityList/index.js +24 -0
- package/lib/modules/ai-ability-select/components/AiAbilityList/interface.d.ts +4 -0
- package/lib/modules/ai-ability-select/components/AiAbilityList/interface.js +2 -0
- package/lib/modules/ai-ability-select/index.d.ts +4 -0
- package/lib/modules/ai-ability-select/index.js +25 -0
- package/lib/modules/ai-ability-select/interface.d.ts +33 -0
- package/lib/modules/ai-ability-select/interface.js +2 -0
- package/lib/modules/ai-question/Root.js +5 -1
- package/lib/modules/ai-question/components/AiAnalysis/AnalysisItem.js +1 -1
- package/lib/modules/ai-question/components/AiAnalysis/index.js +1 -1
- package/lib/modules/ai-question/components/AiAssessmentCriteria/index.js +13 -4
- package/lib/modules/ai-question/components/BaseAccordion/index.d.ts +1 -1
- package/lib/modules/ai-question/components/BaseAccordion/index.js +22 -13
- package/lib/modules/ai-question/components/BootVideo/index.js +38 -19
- package/lib/modules/ai-question/components/BootVideo/styled.js +5 -4
- package/lib/modules/ai-question/components/QuestionModel/AutoCombine.d.ts +4 -0
- package/lib/modules/ai-question/components/QuestionModel/AutoCombine.js +21 -0
- package/lib/modules/ai-question/components/QuestionModel/Header.js +5 -8
- package/lib/modules/ai-question/components/QuestionModel/Interactive.d.ts +6 -0
- package/lib/modules/ai-question/components/QuestionModel/Interactive.js +31 -0
- package/lib/modules/ai-question/components/QuestionModel/Item.d.ts +2 -2
- package/lib/modules/ai-question/components/QuestionModel/Item.js +9 -4
- package/lib/modules/ai-question/components/QuestionModel/List.js +30 -8
- package/lib/modules/ai-question/components/QuestionModel/index.js +5 -1
- package/lib/modules/ai-question/components/QuestionModel/interface.d.ts +7 -0
- package/lib/modules/ai-question/components/QuestionPreview/index.js +1 -1
- package/lib/modules/ai-question/components/QuestionPreview/styled.d.ts +1 -1
- package/lib/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +12 -7
- package/lib/modules/ai-question/components/QuestionTemplate/index.d.ts +2 -1
- package/lib/modules/ai-question/components/QuestionTemplate/index.js +10 -5
- package/lib/modules/ai-question/components/QuestionTemplate/interface.d.ts +10 -0
- package/lib/modules/ai-question/components/QuestionUpdate/Form.d.ts +2 -2
- package/lib/modules/ai-question/components/QuestionUpdate/Form.js +42 -8
- package/lib/modules/ai-question/components/QuestionUpdate/RandomQuestion.d.ts +4 -0
- package/lib/modules/ai-question/components/QuestionUpdate/RandomQuestion.js +63 -0
- package/lib/modules/ai-question/components/QuestionUpdate/SelectQuestion.d.ts +8 -0
- package/lib/modules/ai-question/components/QuestionUpdate/SelectQuestion.js +64 -0
- package/lib/modules/ai-question/components/QuestionUpdate/VideoVoice.d.ts +2 -2
- package/lib/modules/ai-question/components/QuestionUpdate/VideoVoice.js +36 -47
- package/lib/modules/ai-question/components/QuestionUpdate/VideoVoicePreview.d.ts +6 -0
- package/lib/modules/ai-question/components/QuestionUpdate/VideoVoicePreview.js +49 -0
- package/lib/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.d.ts +7 -0
- package/lib/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.js +62 -0
- package/lib/modules/ai-question/components/QuestionUpdate/const.js +1 -0
- package/lib/modules/ai-question/components/QuestionUpdate/index.js +9 -6
- package/lib/modules/ai-question/components/QuestionUpdate/interface.d.ts +12 -0
- package/lib/modules/ai-question/components/QuestionUpdate/styled.d.ts +6 -0
- package/lib/modules/ai-question/components/QuestionUpdate/styled.js +55 -0
- package/lib/modules/ai-question/index.js +3 -5
- package/lib/modules/ai-question/interface.d.ts +17 -0
- package/lib/modules/ai-question/useAiQuestion.d.ts +1 -0
- package/lib/modules/ai-report/components/ScoreReport/styled.d.ts +3 -3
- package/lib/modules/ai-report/components/VideoQuestion/styled.d.ts +2 -2
- package/lib/modules/ai-report/components/WorkPlaces/styled.d.ts +2 -2
- package/lib/modules/ai-template/components/TemplateList/styled.d.ts +3 -3
- package/lib/modules/ai-template/components/TemplateMenu/styled.d.ts +1 -1
- package/lib/services/ai-ability.d.ts +1 -0
- package/lib/services/ai-ability.js +4 -1
- package/lib/services/ai-question.d.ts +2 -1
- package/lib/services/ai-question.js +5 -2
- package/lib/store/ai-ability-select/question-ability-store.d.ts +21 -0
- package/lib/store/ai-ability-select/question-ability-store.js +24 -0
- package/lib/store/ai-question/ai-analysis-store.d.ts +2 -2
- package/lib/store/ai-question/boot-video-store.js +7 -2
- package/lib/store/ai-question/global-store.d.ts +3 -0
- package/lib/store/ai-question/global-store.js +1 -0
- package/lib/store/ai-question/interview-room-store.d.ts +17 -0
- package/lib/store/ai-question/interview-room-store.js +27 -0
- package/lib/store/ai-question/question-model-store.d.ts +3 -0
- package/lib/store/ai-question/question-model-store.js +5 -3
- package/lib/store/ai-question/question-template-store.js +1 -1
- package/lib/store/enterprise/enterprise-store.d.ts +29 -0
- package/lib/store/enterprise/enterprise-store.js +16 -0
- package/package.json +1 -1
|
@@ -18,24 +18,29 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
18
18
|
}
|
|
19
19
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
20
|
};
|
|
21
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
22
22
|
import { CustomUploadButtonRoot, CustomUploadCardRoot, CustomUploadCardTitle, CustomUploadedImgRoot } from './styled';
|
|
23
23
|
import ScrollDialogContent from "../../../../components/ScrollDialogContent";
|
|
24
24
|
import SvgIcon from "../../../../components/SvgIcon";
|
|
25
|
-
import { DEFAULT_GUIDE_VIDEO } from "../../../../constants/ai-question";
|
|
26
|
-
import { PostCommonUpload } from "../../../../services/ai-question";
|
|
25
|
+
import { DEFAULT_GUIDE_VIDEO, DEFAULT_VITUAL_HUMAN_LIST } from "../../../../constants/ai-question";
|
|
26
|
+
import { GetAiInterviewerProfileList, PostCommonUpload } from "../../../../services/ai-question";
|
|
27
27
|
import { useBootVideoStore } from "../../../../store/ai-question/boot-video-store";
|
|
28
|
+
import { useInterviewRoomStore } from "../../../../store/ai-question/interview-room-store";
|
|
28
29
|
import { isExceedMaxVideoFileSize } from "../../../../utils/utils";
|
|
29
30
|
import { useRequest, useSetState } from 'ahooks';
|
|
30
|
-
import { AddIcon, Box, Button, Checkbox, Dialog,
|
|
31
|
-
import {
|
|
31
|
+
import { AddIcon, Box, Button, Checkbox, Dialog, Message, Radio, RadioGroup, Typography, Upload } from 'fbm-ui';
|
|
32
|
+
import { Stack } from 'fbm-ui/lib/mui';
|
|
32
33
|
import { useCallback, useEffect, useState } from 'react';
|
|
33
34
|
var BootVideo = function (props) {
|
|
35
|
+
var _a;
|
|
34
36
|
var open = props.open, onClose = props.onClose;
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
37
|
+
var _b = useInterviewRoomStore(), interactType = _b.interactType, aiInterviewerProfile = _b.aiInterviewerProfile, updateInterviewRoom = _b.updateInterviewRoom;
|
|
38
|
+
var _c = useState({ interactType: interactType, aiInterviewerProfile: aiInterviewerProfile }), interviewRoomState = _c[0], setInterviewRoomState = _c[1];
|
|
39
|
+
var _d = useState(DEFAULT_VITUAL_HUMAN_LIST), virtualManList = _d[0], setVirtualManList = _d[1];
|
|
40
|
+
var _e = useBootVideoStore(), mediaUrl = _e.mediaUrl, thumbUrl = _e.thumbUrl, updateBootVideo = _e.updateBootVideo;
|
|
41
|
+
var _f = useState(DEFAULT_GUIDE_VIDEO), mediaList = _f[0], setMediaList = _f[1];
|
|
42
|
+
var _g = useSetState({ mediaUrl: mediaUrl, thumbUrl: thumbUrl, appliedAllPosition: false }), mediaState = _g[0], setMediaState = _g[1];
|
|
43
|
+
var _h = useRequest(PostCommonUpload, {
|
|
39
44
|
manual: true,
|
|
40
45
|
onSuccess: function (_a) {
|
|
41
46
|
var data = _a.data;
|
|
@@ -50,13 +55,33 @@ var BootVideo = function (props) {
|
|
|
50
55
|
]);
|
|
51
56
|
setMediaState({ mediaUrl: item.url, thumbUrl: item.mineExtra.firstFrameUrl });
|
|
52
57
|
},
|
|
53
|
-
}), loading =
|
|
58
|
+
}), loading = _h.loading, postCommonUpload = _h.run;
|
|
59
|
+
var getAiInterviewerProfileList = useRequest(GetAiInterviewerProfileList, {
|
|
60
|
+
manual: true,
|
|
61
|
+
onSuccess: function (_a) {
|
|
62
|
+
var list = _a.data.list;
|
|
63
|
+
setVirtualManList(list);
|
|
64
|
+
},
|
|
65
|
+
}).run;
|
|
54
66
|
var handleSelectVideo = useCallback(function (mediaUrl, thumbUrl) {
|
|
55
67
|
setMediaState({ mediaUrl: mediaUrl, thumbUrl: thumbUrl });
|
|
56
68
|
}, [setMediaState]);
|
|
69
|
+
var handleInteractTypeChange = useCallback(function (e) {
|
|
70
|
+
var value = Number(e.target.value);
|
|
71
|
+
if (value === 1) {
|
|
72
|
+
setInterviewRoomState({ interactType: value });
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
setInterviewRoomState({ interactType: value, aiInterviewerProfile: interviewRoomState.aiInterviewerProfile });
|
|
76
|
+
}
|
|
77
|
+
}, [setInterviewRoomState, interviewRoomState]);
|
|
78
|
+
var handleSelectHumanType = useCallback(function (value) {
|
|
79
|
+
setInterviewRoomState({ interactType: interviewRoomState.interactType, aiInterviewerProfile: value });
|
|
80
|
+
}, [setInterviewRoomState, interviewRoomState]);
|
|
57
81
|
var handleOk = function () {
|
|
58
82
|
console.log(mediaState);
|
|
59
83
|
updateBootVideo(mediaState);
|
|
84
|
+
updateInterviewRoom(interviewRoomState);
|
|
60
85
|
onClose();
|
|
61
86
|
};
|
|
62
87
|
var uploadProps = {
|
|
@@ -76,19 +101,10 @@ var BootVideo = function (props) {
|
|
|
76
101
|
postCommonUpload(formData);
|
|
77
102
|
}
|
|
78
103
|
},
|
|
79
|
-
// onChange: ({ file }: any) => {
|
|
80
|
-
// console.log('onChange', file);
|
|
81
|
-
// if (isExceedMaxVideoFileSize(file.size)) {
|
|
82
|
-
// Message.error('视频大小超过500M,请重新上传!');
|
|
83
|
-
// } else {
|
|
84
|
-
// const formData = new FormData();
|
|
85
|
-
// formData.append('files', file.originFileObj);
|
|
86
|
-
// postCommonUpload(formData);
|
|
87
|
-
// }
|
|
88
|
-
// },
|
|
89
104
|
};
|
|
90
105
|
useEffect(function () {
|
|
91
106
|
if (open) {
|
|
107
|
+
getAiInterviewerProfileList();
|
|
92
108
|
setMediaState({ mediaUrl: mediaUrl, thumbUrl: thumbUrl });
|
|
93
109
|
if (mediaUrl && thumbUrl && mediaUrl !== mediaList[0].videoUrl) {
|
|
94
110
|
setMediaList(__spreadArray(__spreadArray([], mediaList, true), [
|
|
@@ -105,9 +121,12 @@ var BootVideo = function (props) {
|
|
|
105
121
|
}
|
|
106
122
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
107
123
|
}, [open]);
|
|
108
|
-
return (_jsx(Dialog, __assign({ open: open, title: "\
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
124
|
+
return (_jsx(Dialog, __assign({ open: open, title: "\u5B9A\u5236\u9762\u8BD5\u95F4", okText: "\u4FDD\u5B58", onClose: onClose, onOk: handleOk, width: 768 }, { children: _jsx(ScrollDialogContent, { children: _jsxs(Box, __assign({ sx: { display: 'flex', justifyContent: 'space-between' } }, { children: [_jsxs(Stack, { children: [_jsx(Typography, __assign({ variant: "body1", fontWeight: 500 }, { children: "\u9762\u8BD5\u95F4\u4E92\u52A8\u65B9\u5F0F" })), _jsxs(RadioGroup, __assign({ defaultValue: "outlined", onChange: handleInteractTypeChange, value: interviewRoomState.interactType }, { children: [_jsx(Radio, { value: 1, label: "\u4F20\u7EDF\u8BFB\u9898\u6A21\u5F0F" }), _jsx(Radio, { value: 2, label: "AI\u9762\u8BD5\u5B98\u5BF9\u8BDD\u6A21\u5F0F" })] })), interviewRoomState.interactType === 2 && (_jsxs(_Fragment, { children: [_jsxs(Typography, __assign({ variant: "body1", fontWeight: 500, mt: 3, mb: 1 }, { children: ["\u9762\u8BD5\u5B98\u5F62\u8C61", _jsx(Typography, __assign({ variant: "caption", ml: 1, color: "disabled" }, { children: "\u76EE\u524D\u53EA\u6709\u5C0F\u9762\u53EF\u652F\u6301\u5BF9\u9898\u76EE\u8FFD\u95EE\uFF0C\u5176\u4ED6\u5F62\u8C61\u6682\u4E0D\u652F\u6301\u8FFD\u95EE" }))] })), _jsx(CustomUploadedImgRoot, { children: virtualManList.map(function (human) {
|
|
125
|
+
var _a;
|
|
126
|
+
return (_jsxs(Box, { children: [_jsx("img", { src: human.virtualHumanAvatar, style: { borderColor: ((_a = interviewRoomState.aiInterviewerProfile) === null || _a === void 0 ? void 0 : _a.humanToken) === human.humanToken ? '#4CAF50' : 'transparent' }, height: 100, alt: "", onClick: function () { return handleSelectHumanType(human); } }), _jsx(Typography, __assign({ variant: "body2", textAlign: "center" }, { children: human.name }))] }, human.humanToken));
|
|
127
|
+
}) })] })), interviewRoomState.interactType === 1 && (_jsxs(_Fragment, { children: [_jsx(Typography, __assign({ variant: "body1", fontWeight: 500, mt: 3, mb: 1 }, { children: "\u5F15\u5BFC\u89C6\u9891" })), _jsx(CustomUploadedImgRoot, { children: mediaList.map(function (_a) {
|
|
128
|
+
var videoUrl = _a.videoUrl, frameUrl = _a.frameUrl;
|
|
129
|
+
return (_jsx("img", { src: frameUrl, style: { borderColor: (mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaUrl) === videoUrl ? '#4CAF50' : 'transparent' }, height: 100, alt: "", onClick: function () { return handleSelectVideo(videoUrl, frameUrl); } }, videoUrl));
|
|
130
|
+
}) }), _jsx(Typography, __assign({ variant: "caption", flexWrap: "wrap", width: 344, color: "text.disabled", mb: 1 }, { children: "\u5EFA\u8BAE\u4E0A\u4F20mp4\u683C\u5F0F\uFF0C\u5927\u5C0F\u4E0D\u8981\u8D85\u8FC7500M\uFF0C\u6700\u591A\u652F\u6301\u4E0A\u4F205\u4E2A\uFF0C\u652F\u6301\u89C6\u9891\u683C\u5F0F\uFF1Amp4\u3001mov\u3001m4v\u30013gp\u3001avi\u3001webm" })), _jsxs(Stack, __assign({ direction: "row", alignItems: "center" }, { children: [_jsx(CustomUploadButtonRoot, { children: _jsx(Upload, __assign({}, uploadProps, { children: _jsx(Button, __assign({ variant: "outlined", color: "inherit", icon: _jsx(AddIcon, {}) }, { children: "\u4E0A\u4F20\u89C6\u9891" })) })) }), _jsx(Box, __assign({ ml: 2 }, { children: _jsx(Checkbox, { checked: mediaState.appliedAllPosition, label: _jsx(Typography, __assign({ variant: "body2" }, { children: "\u5E94\u7528\u5230\u6240\u6709AI\u89C6\u9891" })), onChange: function (e, checked) { return setMediaState({ appliedAllPosition: checked }); } }) }))] }))] }))] }), interviewRoomState.interactType === 1 && (_jsx(Box, __assign({ sx: { maxHeight: 'calc(100vh - 150px)', overflow: 'auto', flexGrow: 1 } }, { children: (mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaUrl) || loading ? (_jsx(Box, __assign({ loading: loading, sx: { width: 160, height: 286, margin: 'auto', cursor: 'pointer' } }, { children: _jsx("video", { width: 160, height: 286, src: mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaUrl, controls: true }) }))) : (_jsx(Upload, __assign({}, uploadProps, { children: _jsxs(CustomUploadCardRoot, { children: [_jsxs(CustomUploadCardTitle, { children: [_jsx(SvgIcon, { name: "video" }), _jsx(Typography, __assign({ variant: "subtitle1", color: "secondary" }, { children: "\u4E0A\u4F20\u89C6\u9891" }))] }), _jsx(Typography, __assign({ variant: "caption", color: "disabled", sx: { mt: 1 } }, { children: "\u62D6\u62FD\u89C6\u9891\u5230\u6B64\u5904\u4E5F\u53EF\u4E0A\u4F20" }))] }) }))) }))), interviewRoomState.interactType === 2 && (_jsx(Box, __assign({ sx: { maxHeight: 'calc(100vh - 150px)', overflow: 'auto', flexGrow: 1 } }, { children: _jsx(Box, __assign({ sx: { width: 160, height: 286, margin: 'auto', cursor: 'pointer' } }, { children: _jsx("video", { width: 160, height: 286, src: (_a = interviewRoomState.aiInterviewerProfile) === null || _a === void 0 ? void 0 : _a.virtualPreviewMedia, controls: true }) })) })))] })) }) })));
|
|
112
131
|
};
|
|
113
132
|
export default BootVideo;
|
|
@@ -30,18 +30,19 @@ export var CustomUploadButtonRoot = styled(Box)({
|
|
|
30
30
|
margin: '8px 0',
|
|
31
31
|
});
|
|
32
32
|
export var CustomUploadedImgRoot = styled(Box)({
|
|
33
|
-
minHeight:
|
|
33
|
+
minHeight: 100,
|
|
34
34
|
display: 'flex',
|
|
35
35
|
flexWrap: 'wrap',
|
|
36
36
|
alignItems: 'center',
|
|
37
37
|
padding: '8px 0',
|
|
38
38
|
boxSizing: 'content-box',
|
|
39
39
|
'& img': {
|
|
40
|
-
|
|
40
|
+
boxSizing: 'border-box',
|
|
41
|
+
width: 56,
|
|
41
42
|
objectFit: 'cover',
|
|
42
|
-
transition: 'all 0.3s ease 0s',
|
|
43
|
+
// transition: 'all 0.3s ease 0s',
|
|
43
44
|
cursor: 'pointer',
|
|
44
|
-
border: '
|
|
45
|
+
border: '2px solid transparent',
|
|
45
46
|
borderRadius: 4,
|
|
46
47
|
marginRight: 4,
|
|
47
48
|
},
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { Button, Typography } from 'fbm-ui';
|
|
14
|
+
import { Stack } from 'fbm-ui/lib/mui';
|
|
15
|
+
var AutoCombine = function (_a) {
|
|
16
|
+
var onAutoCombine = _a.onAutoCombine;
|
|
17
|
+
return (_jsx(Stack, { children: _jsxs(Stack, __assign({ width: 210, alignItems: "center" }, { children: [_jsx(Typography, __assign({ variant: "body1", fontWeight: 500 }, { children: "\u6682\u65E0\u9898\u76EE" })), _jsxs(Typography, __assign({ textAlign: "center", variant: "caption", color: "text.disabled", mb: 2 }, { children: ["\u70B9\u51FB\u300CAI\u81EA\u52A8\u7EC4\u9898\u300D\u6309\u94AE", _jsx("br", {}), "\u53EF\u6839\u636E\u60A8\u9009\u62E9\u7684\u80FD\u529B\u5B9E\u73B0\u4E00\u952E\u7EC4\u9898"] })), _jsx(Button, __assign({ onClick: onAutoCombine }, { children: "AI\u81EA\u52A8\u7EC4\u9898" }))] })) }));
|
|
18
|
+
};
|
|
19
|
+
export default AutoCombine;
|
|
@@ -9,15 +9,15 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import {
|
|
13
|
-
import { useState } from 'react';
|
|
14
|
-
import { Box, Button, InfoOutlineIcon, Tooltip, Typography, VideocamOutlineIcon } from 'fbm-ui';
|
|
12
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
15
13
|
import { useQuestionModelStore } from "../../../../store/ai-question/question-model-store";
|
|
16
14
|
import { getSecondToTime } from "../../../../utils/utils";
|
|
17
|
-
import
|
|
15
|
+
import { Typography } from 'fbm-ui';
|
|
16
|
+
import { Stack } from 'fbm-ui/lib/mui';
|
|
18
17
|
var QuestionHeader = function () {
|
|
19
18
|
var questionModelData = useQuestionModelStore().questionModelData;
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
if (!questionModelData)
|
|
20
|
+
return null;
|
|
21
|
+
return (_jsxs(Stack, __assign({ width: "100%", direction: "row", spacing: 2, alignItems: "center" }, { children: [_jsxs(Typography, __assign({ variant: "body2", fontWeight: 500 }, { children: ["\u9884\u8BA1\u9762\u8BD5\u65F6\u957F\uFF1A", getSecondToTime((questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.duration) || 0)] })), _jsx(Typography, __assign({ variant: "caption", color: "secondary" }, { children: "\u62D6\u52A8\u8BD5\u9898\u5361\u7247\u53EF\u6539\u53D8\u8BD5\u9898\u987A\u5E8F" }))] })));
|
|
22
22
|
};
|
|
23
23
|
export default QuestionHeader;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
import BootVideo from '../BootVideo';
|
|
14
|
+
import { Button, Typography, VideocamOutlineIcon } from 'fbm-ui';
|
|
15
|
+
import { Paper, Stack } from 'fbm-ui/lib/mui';
|
|
16
|
+
import { useState } from 'react';
|
|
17
|
+
var InteractiveModes = {
|
|
18
|
+
Traditional: '传统读题模式',
|
|
19
|
+
Chat: 'AI面试官对话模式',
|
|
20
|
+
};
|
|
21
|
+
var Interactive = function (_a) {
|
|
22
|
+
var mode = _a.mode;
|
|
23
|
+
var _b = useState(false), bootVideoOpen = _b[0], setBootVideoOpen = _b[1];
|
|
24
|
+
return (_jsxs(_Fragment, { children: [_jsx(BootVideo, { open: bootVideoOpen, onClose: function () { return setBootVideoOpen(false); } }), _jsxs(Stack, __assign({ direction: "row", justifyContent: "space-between", component: Paper, variant: "outlined", height: 54, alignItems: "center", px: 2, mt: 2 }, { children: [_jsx(Typography, __assign({ variant: "body1", fontWeight: 500 }, { children: "\u9762\u8BD5\u95F4\u4E92\u52A8\u65B9\u5F0F\uFF1A".concat(InteractiveModes[mode]) })), _jsx(Button, __assign({ icon: _jsx(VideocamOutlineIcon, {}), variant: "text", onClick: function () { return setBootVideoOpen(true); } }, { children: "\u5B9A\u5236\u9762\u8BD5\u95F4" }))] }))] }));
|
|
25
|
+
};
|
|
26
|
+
export default Interactive;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { QuestionModelListItemProps } from './interface';
|
|
2
|
-
|
|
3
|
-
declare const _default: React.NamedExoticComponent<QuestionModelListItemProps>;
|
|
3
|
+
declare const _default: import("react").NamedExoticComponent<QuestionModelListItemProps>;
|
|
4
4
|
export default _default;
|
|
@@ -20,17 +20,17 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
24
24
|
import { DISABLED_REPEAT_TYPE, IS_AI_ANALYSIS, TEST_TYPE_READONLY } from "../../../../constants/ai-question";
|
|
25
25
|
import { useQuestionModelStore } from "../../../../store/ai-question/question-model-store";
|
|
26
26
|
import { useUpdateQuestionStore } from "../../../../store/ai-question/question-update-store";
|
|
27
27
|
import { getSecondToTime } from "../../../../utils/utils";
|
|
28
|
-
import { Box, Chip, confirm, DeleteIcon, DragIndicatorIcon, EditIcon, IconButton, Input, Switch, Tooltip, Typography } from 'fbm-ui';
|
|
29
|
-
import { Paper } from 'fbm-ui/lib/mui';
|
|
30
|
-
import { memo, useCallback } from 'react';
|
|
28
|
+
import { Box, Chip, confirm, DeleteIcon, DragIndicatorIcon, EditIcon, IconButton, InfoIcon, Input, Switch, Tooltip, Typography } from 'fbm-ui';
|
|
29
|
+
import { Paper, Stack } from 'fbm-ui/lib/mui';
|
|
30
|
+
import { memo, useCallback, useMemo } from 'react';
|
|
31
31
|
var QuestionModelListItem = function (props) {
|
|
32
32
|
var index = props.index, disabledWeight = props.disabledWeight, steps = props.steps, step = __rest(props, ["index", "disabledWeight", "steps"]);
|
|
33
|
-
var token = step.token, name = step.name,
|
|
33
|
+
var token = step.token, name = step.name, questions = step.questions, duration = step.duration, weight = step.weight, type = step.type, aiShowType = step.aiShowType, aiType = step.aiType, answerStatus = step.answerStatus, category = step.category;
|
|
34
34
|
var isAiAnalysis = IS_AI_ANALYSIS(step);
|
|
35
35
|
var _a = useQuestionModelStore(), editModel = _a.editModel, removeModel = _a.removeModel, updateModelWeight = _a.updateModelWeight;
|
|
36
36
|
var updateQuestionState = useUpdateQuestionStore().updateQuestionState;
|
|
@@ -64,11 +64,16 @@ var QuestionModelListItem = function (props) {
|
|
|
64
64
|
}
|
|
65
65
|
}, [updateModelWeight, index]);
|
|
66
66
|
var handleAnswerStatus = useCallback(function () {
|
|
67
|
-
console.log(answerStatus);
|
|
68
67
|
editModel(__assign(__assign({}, step), { answerStatus: answerStatus === 2 ? 1 : 2 }), index);
|
|
69
68
|
}, [editModel, answerStatus, step, index]);
|
|
70
|
-
|
|
69
|
+
var formatQuestion = useMemo(function () {
|
|
70
|
+
if ((questions === null || questions === void 0 ? void 0 : questions.length) > 1) {
|
|
71
|
+
return (_jsxs(Stack, __assign({ direction: "row", spacing: 1 }, { children: [_jsx(Typography, __assign({ variant: "body2", color: "#F5C441", flexShrink: 0, fontWeight: 500 }, { children: "[\u5185\u5BB9\u968F\u673A]" })), _jsx(Stack, __assign({ spacing: 1 }, { children: questions.map(function (v, index) { return (_jsxs(Typography, __assign({ variant: "body2", color: "text.secondary" }, { children: ["\u2022\u00A0", v.content] }), index)); }) }))] })));
|
|
72
|
+
}
|
|
73
|
+
return questions.map(function (v) { return v.content; }).join('\n');
|
|
74
|
+
}, [questions]);
|
|
75
|
+
return (_jsxs(Paper, __assign({ variant: "outlined", sx: { display: 'block', mt: 2 } }, { children: [_jsxs(Box, __assign({ display: "flex", borderBottom: !DISABLED_REPEAT_TYPE.includes(type) || isAiAnalysis ? '1px solid rgba(0, 0, 0, 0.08)' : 'none' }, { children: [_jsx(Box, __assign({ width: 40, display: "flex", alignItems: "center", justifyContent: "center", sx: { cursor: 'move' } }, { children: _jsx(DragIndicatorIcon, { className: "dragHandle" }) })), _jsxs(Box, __assign({ flex: "1 0", padding: "16px 0" }, { children: [_jsxs(Box, __assign({ display: "flex", justifyContent: "space-between" }, { children: [_jsxs(Box, __assign({ flex: "1 0", display: "flex", alignItems: "center" }, { children: [_jsx(Typography, __assign({ variant: "subtitle1" }, { children: name })), category === null || category === void 0 ? void 0 : category.map(function (label) {
|
|
71
76
|
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) })));
|
|
72
|
-
}), aiType === 2 && _jsx(Chip, { variant: "filled", color: "primary", label: "AI\u8BC4\u5206", size: "medium", sx: { ml: 1 } })
|
|
77
|
+
}), aiType === 2 && _jsx(Chip, { variant: "filled", color: "primary", label: "AI\u8BC4\u5206", size: "medium", sx: { ml: 1 } })] })), _jsxs(Box, __assign({ width: 62, mr: 1, textAlign: "right" }, { children: [!TEST_TYPE_READONLY.includes(type) && (_jsx(IconButton, __assign({ size: "small", onClick: handleEdit }, { children: _jsx(EditIcon, {}) }))), _jsx(IconButton, __assign({ size: "small", onClick: handleRemove }, { children: _jsx(DeleteIcon, {}) }))] }))] })), _jsxs(Box, __assign({ mt: 1, 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" }, { 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) && (_jsx(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 }) })))] })))] })));
|
|
73
78
|
};
|
|
74
79
|
export default memo(QuestionModelListItem);
|
|
@@ -10,23 +10,45 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
13
|
+
import { defaultQuestionParams } from '../QuestionUpdate/const';
|
|
14
|
+
import AutoCombine from './AutoCombine';
|
|
15
|
+
import QuestionModelListItem from './Item';
|
|
16
|
+
import { useAiAbilityListStore } from "../../../../store/ai-ability-select/question-ability-store";
|
|
17
|
+
import { useQuestionTemplateStore } from "../../../../store/ai-question/question-template-store";
|
|
18
|
+
import { uniqueId } from "../../../../utils/utils";
|
|
17
19
|
import { IS_AI_ANALYSIS } from "../../../../constants/ai-question";
|
|
20
|
+
import { LANGUAGE_TYPE } from "../../../../enum/ai-question";
|
|
18
21
|
import { useQuestionModelStore } from "../../../../store/ai-question/question-model-store";
|
|
19
|
-
import
|
|
22
|
+
import { arrayMoveImmutable } from 'array-move';
|
|
23
|
+
import { Box } from 'fbm-ui';
|
|
24
|
+
import { useCallback, useEffect, useRef } from 'react';
|
|
25
|
+
import Sortable from 'sortablejs';
|
|
26
|
+
var LANGUAGE_TYPE_LIST = [LANGUAGE_TYPE.MANDARIN, LANGUAGE_TYPE.CANTONESE, LANGUAGE_TYPE.JAPANESE, LANGUAGE_TYPE.ENGLISH];
|
|
20
27
|
var QuestionModelList = function () {
|
|
21
28
|
var ref = useRef();
|
|
22
29
|
var sortable = useRef();
|
|
23
|
-
var _a = useQuestionModelStore(), questionModelData = _a.questionModelData, updateModel = _a.updateModel;
|
|
24
|
-
var _b = (
|
|
30
|
+
var _a = useQuestionModelStore(), questionModelData = _a.questionModelData, updateModel = _a.updateModel, addModel = _a.addModel;
|
|
31
|
+
var _b = useAiAbilityListStore(), selctedAbilitys = _b.selctedAbilitys, aiAbilityList = _b.aiAbilityList;
|
|
32
|
+
var aiEvaluationData = useQuestionTemplateStore(function (store) { return [store.aiEvaluationData]; }).aiEvaluationData;
|
|
33
|
+
var _c = (questionModelData || {}).steps, steps = _c === void 0 ? [] : _c;
|
|
25
34
|
var lastAiTestIndex = 0;
|
|
26
35
|
steps.forEach(function (step, i) {
|
|
27
36
|
if (IS_AI_ANALYSIS(step))
|
|
28
37
|
lastAiTestIndex = i;
|
|
29
38
|
});
|
|
39
|
+
var getQuestionStep = function (item) { return (__assign(__assign(__assign({}, defaultQuestionParams), item), { aiAbilities: item.aiAbilities.filter(function (_a) {
|
|
40
|
+
var type = _a.type;
|
|
41
|
+
return !LANGUAGE_TYPE_LIST.includes(type);
|
|
42
|
+
}), uniqueId: uniqueId(), originToken: item.token })); };
|
|
43
|
+
var handleUseQuestion = useCallback(function (items) {
|
|
44
|
+
addModel(items.map(getQuestionStep));
|
|
45
|
+
}, [addModel]);
|
|
46
|
+
var handleAutoCombine = useCallback(function () {
|
|
47
|
+
var combineTokens = selctedAbilitys.length > 0 ? selctedAbilitys : aiAbilityList.filter(function (v) { return v.isAI; }).map(function (item) { return item.token; });
|
|
48
|
+
console.log(combineTokens);
|
|
49
|
+
var random = aiEvaluationData[0].list.filter(function (item) { return combineTokens === null || combineTokens === void 0 ? void 0 : combineTokens.includes(item === null || item === void 0 ? void 0 : item.token); }).map(function (v) { return v.list; }) || [];
|
|
50
|
+
handleUseQuestion(random.map(function (item) { return (__assign(__assign({}, item[Math.floor(Math.random() * item.length)]), { weight: (100 / combineTokens.length).toFixed(2) })); }));
|
|
51
|
+
}, [aiAbilityList, aiEvaluationData, handleUseQuestion, selctedAbilitys]);
|
|
30
52
|
useEffect(function () {
|
|
31
53
|
if (steps) {
|
|
32
54
|
sortable.current && sortable.current.destroy();
|
|
@@ -42,6 +64,6 @@ var QuestionModelList = function () {
|
|
|
42
64
|
}, [questionModelData, updateModel, steps]);
|
|
43
65
|
return (_jsx(Box, __assign({ width: "100%", sx: steps.length > 0 ? {} : { height: 'calc(100% - 100px)', display: 'flex', alignItems: 'center', justifyContent: 'center' }, ref: ref }, { children: steps.length > 0 ? (steps.map(function (item, index) {
|
|
44
66
|
return (_jsx(QuestionModelListItem, __assign({ steps: steps, index: index, disabledWeight: index === lastAiTestIndex }, item), item.uniqueId || item.token));
|
|
45
|
-
})) : (_jsx(
|
|
67
|
+
})) : (_jsx(AutoCombine, { onAutoCombine: handleAutoCombine })) })));
|
|
46
68
|
};
|
|
47
69
|
export default QuestionModelList;
|
|
@@ -12,9 +12,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { defaultQuestionParams } from '../QuestionUpdate/const';
|
|
14
14
|
import QuestionModelHeader from './Header';
|
|
15
|
+
import Interactive from './Interactive';
|
|
15
16
|
import QuestionModelList from './List';
|
|
16
17
|
import Skeleton from './Skeleton';
|
|
17
18
|
import { QuestionModelRoot } from './styled';
|
|
19
|
+
import { useAiAbilityListStore } from "../../../../store/ai-ability-select/question-ability-store";
|
|
18
20
|
import { PostAiModelDetails } from "../../../../services/ai-question";
|
|
19
21
|
import { useAiQuestionStore } from "../../../../store/ai-question/global-store";
|
|
20
22
|
import { useQuestionModelStore } from "../../../../store/ai-question/question-model-store";
|
|
@@ -26,11 +28,13 @@ var Question = function () {
|
|
|
26
28
|
var _a = useAiQuestionStore(function (store) { return [store.token, store.name, store.templateList]; }), token = _a.token, name = _a.name, templateList = _a.templateList, onLoad = _a.onLoad;
|
|
27
29
|
var aiEvaluationData = useQuestionTemplateStore(function (store) { return [store.aiEvaluationData]; }).aiEvaluationData;
|
|
28
30
|
var _b = useQuestionModelStore(function (store) { return [store.questionModelData]; }), questionModelData = _b.questionModelData, updateModel = _b.updateModel, addModel = _b.addModel;
|
|
31
|
+
var setSelctedAbilitys = useAiAbilityListStore().setSelctedAbilitys;
|
|
29
32
|
var _c = useRequest(function () { return PostAiModelDetails(token); }, {
|
|
30
33
|
manual: true,
|
|
31
34
|
onSuccess: function (_a) {
|
|
32
35
|
var data = _a.data;
|
|
33
36
|
updateModel(data);
|
|
37
|
+
setSelctedAbilitys((data === null || data === void 0 ? void 0 : data.selectAbilities) || []);
|
|
34
38
|
onLoad === null || onLoad === void 0 ? void 0 : onLoad(data.steps);
|
|
35
39
|
},
|
|
36
40
|
}), postAiModelDetails = _c.run, loading = _c.loading;
|
|
@@ -66,6 +70,6 @@ var Question = function () {
|
|
|
66
70
|
}
|
|
67
71
|
}
|
|
68
72
|
}, [token, aiEvaluationData, questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.steps, templateList, addModel]);
|
|
69
|
-
return (_jsx(QuestionModelRoot, { children: loading ? (_jsx(Skeleton, {})) : (_jsxs(_Fragment, { children: [_jsx(QuestionModelHeader, {}), _jsx(QuestionModelList, {})] })) }));
|
|
73
|
+
return (_jsx(QuestionModelRoot, { children: loading ? (_jsx(Skeleton, {})) : (_jsxs(_Fragment, { children: [_jsx(QuestionModelHeader, {}), _jsx(Interactive, { mode: "Traditional" }), _jsx(QuestionModelList, {})] })) }));
|
|
70
74
|
};
|
|
71
75
|
export default Question;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { QuestionParams } from '../QuestionUpdate/interface';
|
|
2
|
+
import { AiInterviewerProfile } from '@/modules/ai-question/interface';
|
|
2
3
|
export interface QuestionModelStep extends QuestionParams {
|
|
3
4
|
uniqueId?: string;
|
|
4
5
|
isNotCompute?: boolean;
|
|
@@ -7,6 +8,9 @@ export interface QuestionModelData {
|
|
|
7
8
|
name?: string | undefined;
|
|
8
9
|
token?: string;
|
|
9
10
|
duration?: number;
|
|
11
|
+
selectAbilities?: string[];
|
|
12
|
+
interactType?: number;
|
|
13
|
+
aiInterviewerProfile?: AiInterviewerProfile;
|
|
10
14
|
steps: QuestionModelStep[];
|
|
11
15
|
}
|
|
12
16
|
export interface QuestionModelDataRes {
|
|
@@ -17,3 +21,6 @@ export interface QuestionModelListItemProps extends QuestionModelStep {
|
|
|
17
21
|
index: number;
|
|
18
22
|
disabledWeight: boolean;
|
|
19
23
|
}
|
|
24
|
+
export interface AutoCombineProps {
|
|
25
|
+
onAutoCombine: () => void;
|
|
26
|
+
}
|
|
@@ -23,7 +23,7 @@ var QuestionPreview = function () {
|
|
|
23
23
|
var _k = useState(), values = _k[0], setValues = _k[1];
|
|
24
24
|
var _l = useState('none'), display = _l[0], setDisplay = _l[1];
|
|
25
25
|
useEffect(function () {
|
|
26
|
-
setValues({ name: name, broadcastType: broadcastType, desc: desc, prepareTime: prepareTime, duration: duration, minResponseDuration: minResponseDuration });
|
|
26
|
+
setValues({ name: name, broadcastType: broadcastType, desc: desc, prepareTime: prepareTime, duration: duration, minResponseDuration: minResponseDuration, questions: [] });
|
|
27
27
|
setDisplay(visible ? 'block' : 'none');
|
|
28
28
|
}, [name, broadcastType, desc, prepareTime, duration, visible, minResponseDuration]);
|
|
29
29
|
return (_jsx(PreviewRoot, __assign({ style: { display: display } }, { children: (extra === null || extra === void 0 ? void 0 : extra.icon) ? (_jsx("img", { src: extra === null || extra === void 0 ? void 0 : extra.icon, alt: "", style: { width: 250 } })) : (_jsxs(Box, __assign({ width: 500 }, { children: [_jsxs(Typography, __assign({ variant: "h5", textAlign: "center", mb: 3 }, { children: [QUESTION_TYPE_MAPPING_LABEL[type], "\uFF08\u9884\u89C8\uFF09"] })), values && _jsx(Form, { preview: true, aiShowType: ADD_QUESTION_TYPE.FREE, initialValues: values, values: values })] }))) })));
|
|
@@ -8,4 +8,4 @@ export declare const PreviewRoot: import("@emotion/styled").StyledComponent<{
|
|
|
8
8
|
variant?: "elevation" | "outlined" | undefined;
|
|
9
9
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
10
10
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
11
|
-
},
|
|
11
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "elevation" | "square" | "variant"> & import("@mui/system/createStyled").MUIStyledCommonProps<import("fbm-ui/lib/mui").Theme>, {}, {}>;
|
|
@@ -10,24 +10,27 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { useSetState } from 'ahooks';
|
|
13
|
+
import BaseAccordion from '../BaseAccordion';
|
|
14
|
+
import { defaultQuestionParams } from '../QuestionUpdate/const';
|
|
15
|
+
import { useAiAbilityListStore } from "../../../../store/ai-ability-select/question-ability-store";
|
|
17
16
|
import SvgIcon from "../../../../components/SvgIcon";
|
|
18
17
|
import { ADD_QUESTION_TYPE_LIST } from "../../../../constants/ai-question";
|
|
19
18
|
import { ADD_QUESTION_TYPE } from "../../../../enum/ai-question";
|
|
20
19
|
import { useAiQuestionStore } from "../../../../store/ai-question/global-store";
|
|
21
|
-
import { useQuestionModelStore } from "../../../../store/ai-question/question-model-store";
|
|
20
|
+
import { getQuestionModelStore, useQuestionModelStore } from "../../../../store/ai-question/question-model-store";
|
|
22
21
|
import { useQuestionTemplateStore } from "../../../../store/ai-question/question-template-store";
|
|
23
22
|
import { useUpdateQuestionStore } from "../../../../store/ai-question/question-update-store";
|
|
24
23
|
import { uniqueId } from "../../../../utils/utils";
|
|
25
|
-
import
|
|
26
|
-
import {
|
|
24
|
+
import { useSetState } from 'ahooks';
|
|
25
|
+
import { AddIcon, Box, Button, LayerOutlineIcon, Popover, SMSOneIcon, Typography } from 'fbm-ui';
|
|
26
|
+
import { List, ListItem, ListItemButton, ListItemIcon, ListItemText } from 'fbm-ui/lib/mui';
|
|
27
|
+
import { useCallback } from 'react';
|
|
27
28
|
var AiEvaluation = function () {
|
|
28
29
|
var onOpenTemplate = useAiQuestionStore(function (store) { return [store.onOpenTemplate]; }).onOpenTemplate;
|
|
29
30
|
var updateQuestionState = useUpdateQuestionStore(function (store) { return [store.updateQuestionState]; }).updateQuestionState;
|
|
30
31
|
var questionModelData = useQuestionModelStore(function (store) { return [store.questionModelData]; }).questionModelData;
|
|
32
|
+
var isEdit = (getQuestionModelStore() || {}).isEdit;
|
|
33
|
+
var selctedAbilitys = useAiAbilityListStore().selctedAbilitys;
|
|
31
34
|
var aiEvaluationData = useQuestionTemplateStore(function (store) { return [store.aiEvaluationData]; }).aiEvaluationData;
|
|
32
35
|
var _a = useSetState({
|
|
33
36
|
addQuestionOpen: false,
|
|
@@ -44,7 +47,9 @@ var AiEvaluation = function () {
|
|
|
44
47
|
}) }));
|
|
45
48
|
return (_jsxs(Box, { children: [_jsxs(Box, __assign({ display: "flex", justifyContent: "space-between", alignItems: "center", mb: 2 }, { children: [_jsx(Button, __assign({ variant: "outlined", color: "inherit", icon: _jsx(LayerOutlineIcon, {}), onClick: function () { return onOpenTemplate === null || onOpenTemplate === void 0 ? void 0 : onOpenTemplate(questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.steps); } }, { children: "\u5C97\u4F4D\u6A21\u7248\u5E93" })), _jsx(Popover, __assign({ open: addQuestionOpen, arrow: false, content: content, onClickAway: function () { return setState({ addQuestionOpen: false }); } }, { children: _jsx(Button, __assign({ variant: "outlined", icon: _jsx(AddIcon, {}), onClick: function () { return setState({ addQuestionOpen: true }); } }, { children: "\u81EA\u5B9A\u4E49\u9898\u76EE" })) }))] })), aiEvaluationData.map(function (_a, index) {
|
|
46
49
|
var name = _a.name, list = _a.list;
|
|
47
|
-
return (_jsxs(Box, { children: [_jsx(Typography, __assign({ fontSize: 12, lineHeight: 1.5, weight: "500", mb: 2 }, { children: name })), list
|
|
50
|
+
return (_jsxs(Box, { children: [_jsx(Typography, __assign({ fontSize: 12, lineHeight: 1.5, weight: "500", mb: 2 }, { children: name })), list
|
|
51
|
+
.filter(function (v) { return !isEdit || !v.isNew || selctedAbilitys.includes(v.token); })
|
|
52
|
+
.map(function (item, i) { return (_jsx(BaseAccordion, __assign({ index: i, isShowOnlyAITest: showOnlyAITest, isShowDesc: index !== 0, isShowSummaryAction: index !== 0, isShowConfirm: index !== 0 }, item), item.name + i)); })] }, name));
|
|
48
53
|
})] }));
|
|
49
54
|
};
|
|
50
55
|
export default AiEvaluation;
|
|
@@ -10,16 +10,21 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { Box } from 'fbm-ui';
|
|
14
|
-
import { useRequest } from 'ahooks';
|
|
15
|
-
import { PostAiModelQuestions } from "../../../../services/ai-question";
|
|
16
|
-
import { useQuestionTemplateStore } from "../../../../store/ai-question/question-template-store";
|
|
17
13
|
import AiEvaluation from './AiEvaluation';
|
|
18
14
|
import Skeleton from './Skeleton';
|
|
15
|
+
import { useAiAbilityListStore } from "../../../../store/ai-ability-select/question-ability-store";
|
|
16
|
+
import { useEnterpriseStore } from "../../../../store/enterprise/enterprise-store";
|
|
17
|
+
import { PostAiModelQuestions } from "../../../../services/ai-question";
|
|
18
|
+
import { useQuestionTemplateStore } from "../../../../store/ai-question/question-template-store";
|
|
19
|
+
import { useRequest } from 'ahooks';
|
|
20
|
+
import { Box } from 'fbm-ui';
|
|
19
21
|
var QuestionTemplate = function () {
|
|
20
22
|
var updateAiEvaluationData = useQuestionTemplateStore().updateAiEvaluationData;
|
|
21
|
-
var
|
|
23
|
+
var selctedAbilitys = useAiAbilityListStore().selctedAbilitys;
|
|
24
|
+
var enterprise = useEnterpriseStore().enterprise;
|
|
25
|
+
var loading = useRequest(function () { return PostAiModelQuestions(__assign({ extraAbilityTokens: selctedAbilitys }, enterprise)); }, {
|
|
22
26
|
manual: false,
|
|
27
|
+
refreshDeps: [selctedAbilitys, enterprise],
|
|
23
28
|
onSuccess: function (_a) {
|
|
24
29
|
var data = _a.data;
|
|
25
30
|
return updateAiEvaluationData(data);
|
|
@@ -9,6 +9,10 @@ export interface AiEvaluationListExtra {
|
|
|
9
9
|
riskMaxScore?: number;
|
|
10
10
|
maxScore?: number;
|
|
11
11
|
}
|
|
12
|
+
interface Question {
|
|
13
|
+
content: '';
|
|
14
|
+
videoUrl: '';
|
|
15
|
+
}
|
|
12
16
|
export interface AiEvaluationList {
|
|
13
17
|
aiAbilities: BaseAiAbilityParams[];
|
|
14
18
|
name: string;
|
|
@@ -19,6 +23,7 @@ export interface AiEvaluationList {
|
|
|
19
23
|
isDefault: boolean;
|
|
20
24
|
duration: number;
|
|
21
25
|
prepareTime: number;
|
|
26
|
+
questions: Question[];
|
|
22
27
|
minResponseDuration: number;
|
|
23
28
|
extra: AiEvaluationListExtra;
|
|
24
29
|
broadcastType: number;
|
|
@@ -28,7 +33,9 @@ export interface AiEvaluationList {
|
|
|
28
33
|
}
|
|
29
34
|
export interface AiEvaluationDataList {
|
|
30
35
|
name: string;
|
|
36
|
+
token: string;
|
|
31
37
|
positionName?: string;
|
|
38
|
+
isNew: boolean;
|
|
32
39
|
list: AiEvaluationList[];
|
|
33
40
|
}
|
|
34
41
|
export interface AiEvaluationData {
|
|
@@ -42,3 +49,6 @@ export interface AiEvaluationState {
|
|
|
42
49
|
addQuestionOpen: boolean;
|
|
43
50
|
showOnlyAITest: boolean;
|
|
44
51
|
}
|
|
52
|
+
export interface QuestionTemplateProps {
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { QuestionFormProps } from './interface';
|
|
2
|
-
|
|
3
|
-
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<QuestionFormProps & React.RefAttributes<any>>>;
|
|
3
|
+
declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<QuestionFormProps & import("react").RefAttributes<any>>>;
|
|
4
4
|
export default _default;
|