eli-video-interview 1.2.3-5.alpha → 1.2.3-5.alpha.2

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 (25) hide show
  1. package/esm/modules/ai-ability-select/Root.js +2 -7
  2. package/esm/modules/ai-ability-select/interface.d.ts +1 -0
  3. package/esm/modules/ai-question/Root.js +1 -2
  4. package/esm/modules/ai-question/components/QuestionModel/Item.js +1 -1
  5. package/esm/modules/ai-question/components/QuestionModel/List.js +10 -8
  6. package/esm/modules/ai-question/components/QuestionModel/index.js +1 -1
  7. package/esm/modules/ai-question/components/QuestionTemplate/index.js +5 -3
  8. package/esm/modules/ai-question/components/QuestionTemplate/interface.d.ts +0 -1
  9. package/esm/modules/ai-question/components/QuestionUpdate/VideoVoice.js +6 -16
  10. package/esm/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.d.ts +3 -1
  11. package/esm/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.js +5 -10
  12. package/esm/modules/ai-question/components/QuestionUpdate/index.js +1 -1
  13. package/lib/modules/ai-ability-select/Root.js +2 -7
  14. package/lib/modules/ai-ability-select/interface.d.ts +1 -0
  15. package/lib/modules/ai-question/Root.js +1 -2
  16. package/lib/modules/ai-question/components/QuestionModel/Item.js +1 -1
  17. package/lib/modules/ai-question/components/QuestionModel/List.js +10 -8
  18. package/lib/modules/ai-question/components/QuestionModel/index.js +1 -1
  19. package/lib/modules/ai-question/components/QuestionTemplate/index.js +5 -3
  20. package/lib/modules/ai-question/components/QuestionTemplate/interface.d.ts +0 -1
  21. package/lib/modules/ai-question/components/QuestionUpdate/VideoVoice.js +6 -16
  22. package/lib/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.d.ts +3 -1
  23. package/lib/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.js +5 -10
  24. package/lib/modules/ai-question/components/QuestionUpdate/index.js +1 -1
  25. package/package.json +1 -1
@@ -19,9 +19,8 @@ import { Box, Typography } from 'fbm-ui';
19
19
  import { Stack } from 'fbm-ui/lib/mui';
20
20
  import { forwardRef, memo, useEffect } from 'react';
21
21
  var AiAbilitySelectRoot = forwardRef(function (_a, ref) {
22
- var jobToken = _a.jobToken, thirdToken = _a.thirdToken, _b = _a.selectedTokens, selectedTokens = _b === void 0 ? [] : _b;
23
- var _c = useAiAbilityListStore(), aiAbilityList = _c.aiAbilityList, setAiAbilityList = _c.setAiAbilityList;
24
- var _d = useAiAbilityListStore(), selctedAbilitys = _d.selctedAbilitys, setSelctedAbilitys = _d.setSelctedAbilitys;
22
+ var jobToken = _a.jobToken, thirdToken = _a.thirdToken;
23
+ var _b = useAiAbilityListStore(), aiAbilityList = _b.aiAbilityList, setAiAbilityList = _b.setAiAbilityList, selctedAbilitys = _b.selctedAbilitys;
25
24
  var data = useRequest(function () { return GetAiAbilityList({ jobToken: jobToken, thirdToken: thirdToken }); }, {
26
25
  refreshDeps: [jobToken, thirdToken],
27
26
  }).data;
@@ -29,10 +28,6 @@ var AiAbilitySelectRoot = forwardRef(function (_a, ref) {
29
28
  setAiAbilityList((data === null || data === void 0 ? void 0 : data.data.list) || []);
30
29
  // eslint-disable-next-line react-hooks/exhaustive-deps
31
30
  }, [data]);
32
- useEffect(function () {
33
- setSelctedAbilitys(selectedTokens);
34
- // eslint-disable-next-line react-hooks/exhaustive-deps
35
- }, [selectedTokens]);
36
31
  console.log(selctedAbilitys);
37
32
  return (_jsx(ScrollDialogContent, __assign({ ref: ref }, { children: _jsxs(Box, __assign({ display: "flex", flexDirection: "column", width: 760 }, { children: [_jsxs(Stack, __assign({ spacing: 2, mb: 2 }, { children: [_jsx(Typography, __assign({ variant: "body1", fontWeight: 500 }, { children: "\u8BF7\u9009\u62E9\u8981\u4F18\u5148\u4F7F\u7528\u7684\u8003\u5BDF\u80FD\u529B\uFF0C\u4E5F\u53EF\u4EE5\u70B9\u51FB\u300C\u4E0B\u4E00\u6B65\u300D\u76F4\u63A5\u51FA\u9898" })), _jsxs(Stack, __assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [_jsx("img", { src: "//webcdn.fbmms.cn/assets/XXRf/bdUI9qZoTx-l2k_OHTotn", alt: "", width: 38, height: 16 }), _jsx(Typography, __assign({ variant: "caption", color: "textSecondary" }, { children: "AI\u6839\u636E\u5C97\u4F4D\u4FE1\u606F\u751F\u6210\u7684\u80FD\u529B\uFF0C\u521B\u5EFA\u5B8C\u6B65\u9AA4\u540E\uFF0C\u4F1A\u81EA\u52A8\u5C06\u9009\u62E9\u7684\u65B0\u589E\u80FD\u529B\u52A0\u5165\u5230\u8BBE\u7F6E\u9875\u7684\u8003\u5BDF\u80FD\u529B\u5217\u8868\u4E2D\u3002" }))] }))] })), _jsx(AiAbilityList, { items: aiAbilityList })] })) })));
38
33
  });
@@ -13,6 +13,7 @@ export interface AiAbilityDetail {
13
13
  export interface AiAbility extends AiAbilityDetail {
14
14
  name: string;
15
15
  isNew?: boolean;
16
+ isAI?: boolean;
16
17
  token: string;
17
18
  selected?: boolean;
18
19
  }
@@ -64,7 +64,6 @@ var AiQuestionRoot = forwardRef(function (props, ref) {
64
64
  var updateBootVideo = useBootVideoStore().updateBootVideo;
65
65
  var addModel = useQuestionModelStore(function (store) { return [store.addModel]; }).addModel;
66
66
  var selctedAbilitys = useAiAbilityListStore().selctedAbilitys;
67
- console.log(selctedAbilitys);
68
67
  var handleValues = function () { return __awaiter(void 0, void 0, void 0, function () {
69
68
  var questionModelData, _a, mediaUrl, thumbUrl, appliedAllPosition, steps;
70
69
  return __generator(this, function (_b) {
@@ -149,7 +148,7 @@ var AiQuestionRoot = forwardRef(function (props, ref) {
149
148
  width: '256px',
150
149
  height: '100%',
151
150
  overflow: 'auto',
152
- } }, { children: _jsx(QuestionTemplate, { extraAbilityTokens: selctedAbilitys }) }))] })));
151
+ } }, { children: _jsx(QuestionTemplate, {}) }))] })));
153
152
  });
154
153
  AiQuestionRoot.displayName = 'AiQuestionRoot';
155
154
  export default memo(AiQuestionRoot);
@@ -68,7 +68,7 @@ var QuestionModelListItem = function (props) {
68
68
  }, [editModel, answerStatus, step, index]);
69
69
  var formatQuestion = useMemo(function () {
70
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" }, { 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)); }) }))] })));
71
+ return (_jsxs(Stack, __assign({ direction: "row", spacing: 1 }, { children: [_jsx(Typography, __assign({ variant: "body2", color: "#F5C441", flexShrink: 0 }, { 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
72
  }
73
73
  return questions.map(function (v) { return v.content; }).join('\n');
74
74
  }, [questions]);
@@ -13,7 +13,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { defaultQuestionParams } from '../QuestionUpdate/const';
14
14
  import AutoCombine from './AutoCombine';
15
15
  import QuestionModelListItem from './Item';
16
- import { useAiQuestionStore } from "../../../../store/ai-question/global-store";
16
+ import { useAiAbilityListStore } from "../../../../store/ai-ability-select/question-ability-store";
17
17
  import { useQuestionTemplateStore } from "../../../../store/ai-question/question-template-store";
18
18
  import { uniqueId } from "../../../../utils/utils";
19
19
  import { IS_AI_ANALYSIS } from "../../../../constants/ai-question";
@@ -28,9 +28,9 @@ var QuestionModelList = function () {
28
28
  var ref = useRef();
29
29
  var sortable = useRef();
30
30
  var _a = useQuestionModelStore(), questionModelData = _a.questionModelData, updateModel = _a.updateModel, addModel = _a.addModel;
31
- var extraAbilityTokens = useAiQuestionStore().extraAbilityTokens;
31
+ var _b = useAiAbilityListStore(), selctedAbilitys = _b.selctedAbilitys, aiAbilityList = _b.aiAbilityList;
32
32
  var aiEvaluationData = useQuestionTemplateStore(function (store) { return [store.aiEvaluationData]; }).aiEvaluationData;
33
- var _b = (questionModelData || {}).steps, steps = _b === void 0 ? [] : _b;
33
+ var _c = (questionModelData || {}).steps, steps = _c === void 0 ? [] : _c;
34
34
  var lastAiTestIndex = 0;
35
35
  steps.forEach(function (step, i) {
36
36
  if (IS_AI_ANALYSIS(step))
@@ -43,6 +43,12 @@ var QuestionModelList = function () {
43
43
  var handleUseQuestion = useCallback(function (items) {
44
44
  addModel(items.map(getQuestionStep));
45
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 item[Math.floor(Math.random() * item.length)]; }));
51
+ }, [aiAbilityList, aiEvaluationData, handleUseQuestion, selctedAbilitys]);
46
52
  useEffect(function () {
47
53
  if (steps) {
48
54
  sortable.current && sortable.current.destroy();
@@ -58,10 +64,6 @@ var QuestionModelList = function () {
58
64
  }, [questionModelData, updateModel, steps]);
59
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) {
60
66
  return (_jsx(QuestionModelListItem, __assign({ steps: steps, index: index, disabledWeight: index === lastAiTestIndex }, item), item.uniqueId || item.token));
61
- })) : (_jsx(AutoCombine, { onAutoCombine: function () {
62
- console.log('steps', extraAbilityTokens, aiEvaluationData);
63
- var random = aiEvaluationData[0].list.filter(function (item) { return extraAbilityTokens === null || extraAbilityTokens === void 0 ? void 0 : extraAbilityTokens.includes(item === null || item === void 0 ? void 0 : item.token); }).map(function (v) { return v.list; }) || [];
64
- handleUseQuestion(random.map(function (item) { return item[Math.floor(Math.random() * item.length)]; }));
65
- } })) })));
67
+ })) : (_jsx(AutoCombine, { onAutoCombine: handleAutoCombine })) })));
66
68
  };
67
69
  export default QuestionModelList;
@@ -70,6 +70,6 @@ var Question = function () {
70
70
  }
71
71
  }
72
72
  }, [token, aiEvaluationData, questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.steps, templateList, addModel]);
73
- return (_jsx(QuestionModelRoot, { children: loading ? (_jsx(Skeleton, {})) : (_jsxs(_Fragment, { children: [_jsx(QuestionModelHeader, {}), _jsx(Interactive, { mode: "Chat" }), _jsx(QuestionModelList, {})] })) }));
73
+ return (_jsx(QuestionModelRoot, { children: loading ? (_jsx(Skeleton, {})) : (_jsxs(_Fragment, { children: [_jsx(QuestionModelHeader, {}), _jsx(Interactive, { mode: "Traditional" }), _jsx(QuestionModelList, {})] })) }));
74
74
  };
75
75
  export default Question;
@@ -12,15 +12,17 @@ var __assign = (this && this.__assign) || function () {
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import AiEvaluation from './AiEvaluation';
14
14
  import Skeleton from './Skeleton';
15
+ import { useAiAbilityListStore } from "../../../../store/ai-ability-select/question-ability-store";
15
16
  import { PostAiModelQuestions } from "../../../../services/ai-question";
16
17
  import { useQuestionTemplateStore } from "../../../../store/ai-question/question-template-store";
17
18
  import { useRequest } from 'ahooks';
18
19
  import { Box } from 'fbm-ui';
19
- var QuestionTemplate = function (_a) {
20
- var _b = _a.extraAbilityTokens, extraAbilityTokens = _b === void 0 ? [] : _b;
20
+ var QuestionTemplate = function () {
21
21
  var updateAiEvaluationData = useQuestionTemplateStore().updateAiEvaluationData;
22
- var loading = useRequest(function () { return PostAiModelQuestions({ extraAbilityTokens: extraAbilityTokens }); }, {
22
+ var selctedAbilitys = useAiAbilityListStore().selctedAbilitys;
23
+ var loading = useRequest(function () { return PostAiModelQuestions({ extraAbilityTokens: selctedAbilitys }); }, {
23
24
  manual: false,
25
+ refreshDeps: [selctedAbilitys],
24
26
  onSuccess: function (_a) {
25
27
  var data = _a.data;
26
28
  return updateAiEvaluationData(data);
@@ -48,6 +48,5 @@ export interface AiEvaluationState {
48
48
  showOnlyAITest: boolean;
49
49
  }
50
50
  export interface QuestionTemplateProps {
51
- extraAbilityTokens?: string[];
52
51
  }
53
52
  export {};
@@ -21,19 +21,10 @@ 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 VideoVoicePreview from './VideoVoicePreview';
23
23
  import VideoVoiceUploader from './VideoVoiceUploader';
24
- // import { useUpdateQuestionStore } from '@store/ai-question/question-update-store';
25
24
  import { Box, CloseIcon, FormItem, IconButton } from 'fbm-ui';
26
25
  import { Stack } from 'fbm-ui/lib/mui';
27
26
  import { FieldArray } from 'formik';
28
27
  var VideoVoice = function () {
29
- // const { questionState, updateQuestionState } = useUpdateQuestionStore(store => [store.questionState]);
30
- // const { item } = questionState;
31
- // const handleVideoBroadcastChange = (key, checked) => {
32
- // updateQuestionState({
33
- // item: { ...item, videoBroadcast: { ...item?.videoBroadcast, [key]: checked ? 1 : 2 } },
34
- // });
35
- // };
36
- // console.log(item);
37
28
  return (_jsx(FieldArray, { name: "questions", render: function (_a) {
38
29
  var _b;
39
30
  var form = _a.form;
@@ -41,13 +32,12 @@ var VideoVoice = function () {
41
32
  borderRadius: 2,
42
33
  border: '1px dashed rgba(0,0,0, 0.08)',
43
34
  } }, { children: [q.videoUrl && (_jsx(VideoVoicePreview, { onDel: function () {
44
- form.values.questions[index] = __assign(__assign({}, form.values.questions[index]), { videoUrl: '' });
45
- form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], form.values.questions, true) }));
46
- // item.questions[index] = { content: '', videoUrl: '' };
47
- // updateQuestionState({
48
- // item: { ...item, questions: [...item.questions], videoBroadcast: { ...item?.videoBroadcast, videoUrl: '' } },
49
- // });
50
- }, videoUrl: q.videoUrl })), _jsx(VideoVoiceUploader, { index: index })] })), _jsxs(Stack, __assign({ flexGrow: 1, direction: "row", justifyContent: "space-between", spacing: 1 }, { children: [_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: {
35
+ var questons = __spreadArray([], form.values.questions, true);
36
+ questons[index] = __assign(__assign({}, questons[index]), { videoUrl: '' });
37
+ form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], questons, true) }));
38
+ }, videoUrl: q.videoUrl })), _jsx(VideoVoiceUploader, { index: index, questions: form.values.questions, setQuestions: function (qs) {
39
+ form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], qs, true) }));
40
+ } })] })), _jsxs(Stack, __assign({ flexGrow: 1, direction: "row", justifyContent: "space-between", spacing: 1 }, { children: [_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: {
51
41
  rows: 3,
52
42
  multiline: true,
53
43
  placeholder: '面试内容(系统将根据此内容向候选人进行语音播报)',
@@ -1,5 +1,7 @@
1
1
  /// <reference types="react" />
2
- declare const VideoVoiceUploader: ({ index }: {
2
+ declare const VideoVoiceUploader: ({ index, questions, setQuestions }: {
3
3
  index: any;
4
+ questions: any;
5
+ setQuestions: any;
4
6
  }) => JSX.Element;
5
7
  export default VideoVoiceUploader;
@@ -20,26 +20,21 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
20
20
  };
21
21
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
22
22
  import { PostCommonUpload } from "../../../../services/ai-question";
23
- import { useUpdateQuestionStore } from "../../../../store/ai-question/question-update-store";
24
23
  import { isExceedMaxVideoFileSize } from "../../../../utils/utils";
25
24
  import { useRequest } from 'ahooks';
26
25
  import { Message, Typography, Upload, UploadIcon } from 'fbm-ui';
27
26
  import { Stack } from 'fbm-ui/lib/mui';
28
27
  var VideoVoiceUploader = function (_a) {
29
- var index = _a.index;
30
- var _b = useUpdateQuestionStore(function (store) { return [store.questionState]; }), questionState = _b.questionState, updateQuestionState = _b.updateQuestionState;
31
- var item = questionState.item;
32
- var _c = useRequest(PostCommonUpload, {
28
+ var index = _a.index, questions = _a.questions, setQuestions = _a.setQuestions;
29
+ var _b = useRequest(PostCommonUpload, {
33
30
  manual: true,
34
31
  onSuccess: function (_a) {
35
32
  var data = _a.data;
36
33
  var firstData = data[0];
37
- item.questions[index].videoUrl = firstData.url;
38
- updateQuestionState({
39
- item: __assign(__assign({}, item), { questions: __spreadArray([], item.questions, true), videoBroadcast: __assign(__assign({}, item === null || item === void 0 ? void 0 : item.videoBroadcast), { videoUrl: firstData.url }) }),
40
- });
34
+ questions[index] = __assign(__assign({}, questions[index]), { videoUrl: firstData.url });
35
+ setQuestions(__spreadArray([], questions, true));
41
36
  },
42
- }), loading = _c.loading, postCommonUpload = _c.run;
37
+ }), loading = _b.loading, postCommonUpload = _b.run;
43
38
  var uploadProps = {
44
39
  type: 'custom',
45
40
  showUploadList: false,
@@ -193,7 +193,7 @@ var QuestionUpdate = function () {
193
193
  case 0: return [4 /*yield*/, getModelParams(values, true)];
194
194
  case 1:
195
195
  _a = _b.sent(), errorIndexes = _a.errorIndexes, params = _a.params;
196
- if ((values === null || values === void 0 ? void 0 : values.questions.length) > 4) {
196
+ if ((values === null || values === void 0 ? void 0 : values.questions.length) > 5) {
197
197
  Message.error('最多可添加5个面试内容。');
198
198
  return [2 /*return*/, false];
199
199
  }
@@ -24,9 +24,8 @@ var fbm_ui_1 = require("fbm-ui");
24
24
  var mui_1 = require("fbm-ui/lib/mui");
25
25
  var react_1 = require("react");
26
26
  var AiAbilitySelectRoot = (0, react_1.forwardRef)(function (_a, ref) {
27
- var jobToken = _a.jobToken, thirdToken = _a.thirdToken, _b = _a.selectedTokens, selectedTokens = _b === void 0 ? [] : _b;
28
- var _c = (0, question_ability_store_1.useAiAbilityListStore)(), aiAbilityList = _c.aiAbilityList, setAiAbilityList = _c.setAiAbilityList;
29
- var _d = (0, question_ability_store_1.useAiAbilityListStore)(), selctedAbilitys = _d.selctedAbilitys, setSelctedAbilitys = _d.setSelctedAbilitys;
27
+ var jobToken = _a.jobToken, thirdToken = _a.thirdToken;
28
+ var _b = (0, question_ability_store_1.useAiAbilityListStore)(), aiAbilityList = _b.aiAbilityList, setAiAbilityList = _b.setAiAbilityList, selctedAbilitys = _b.selctedAbilitys;
30
29
  var data = (0, ahooks_1.useRequest)(function () { return (0, ai_ability_1.GetAiAbilityList)({ jobToken: jobToken, thirdToken: thirdToken }); }, {
31
30
  refreshDeps: [jobToken, thirdToken],
32
31
  }).data;
@@ -34,10 +33,6 @@ var AiAbilitySelectRoot = (0, react_1.forwardRef)(function (_a, ref) {
34
33
  setAiAbilityList((data === null || data === void 0 ? void 0 : data.data.list) || []);
35
34
  // eslint-disable-next-line react-hooks/exhaustive-deps
36
35
  }, [data]);
37
- (0, react_1.useEffect)(function () {
38
- setSelctedAbilitys(selectedTokens);
39
- // eslint-disable-next-line react-hooks/exhaustive-deps
40
- }, [selectedTokens]);
41
36
  console.log(selctedAbilitys);
42
37
  return ((0, jsx_runtime_1.jsx)(ScrollDialogContent_1.default, __assign({ ref: ref }, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", flexDirection: "column", width: 760 }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ spacing: 2, mb: 2 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body1", fontWeight: 500 }, { children: "\u8BF7\u9009\u62E9\u8981\u4F18\u5148\u4F7F\u7528\u7684\u8003\u5BDF\u80FD\u529B\uFF0C\u4E5F\u53EF\u4EE5\u70B9\u51FB\u300C\u4E0B\u4E00\u6B65\u300D\u76F4\u63A5\u51FA\u9898" })), (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)("img", { src: "//webcdn.fbmms.cn/assets/XXRf/bdUI9qZoTx-l2k_OHTotn", alt: "", width: 38, height: 16 }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "textSecondary" }, { children: "AI\u6839\u636E\u5C97\u4F4D\u4FE1\u606F\u751F\u6210\u7684\u80FD\u529B\uFF0C\u521B\u5EFA\u5B8C\u6B65\u9AA4\u540E\uFF0C\u4F1A\u81EA\u52A8\u5C06\u9009\u62E9\u7684\u65B0\u589E\u80FD\u529B\u52A0\u5165\u5230\u8BBE\u7F6E\u9875\u7684\u8003\u5BDF\u80FD\u529B\u5217\u8868\u4E2D\u3002" }))] }))] })), (0, jsx_runtime_1.jsx)(AiAbilityList_1.default, { items: aiAbilityList })] })) })));
43
38
  });
@@ -13,6 +13,7 @@ export interface AiAbilityDetail {
13
13
  export interface AiAbility extends AiAbilityDetail {
14
14
  name: string;
15
15
  isNew?: boolean;
16
+ isAI?: boolean;
16
17
  token: string;
17
18
  selected?: boolean;
18
19
  }
@@ -69,7 +69,6 @@ var AiQuestionRoot = (0, react_1.forwardRef)(function (props, ref) {
69
69
  var updateBootVideo = (0, boot_video_store_1.useBootVideoStore)().updateBootVideo;
70
70
  var addModel = (0, question_model_store_2.useQuestionModelStore)(function (store) { return [store.addModel]; }).addModel;
71
71
  var selctedAbilitys = (0, question_ability_store_1.useAiAbilityListStore)().selctedAbilitys;
72
- console.log(selctedAbilitys);
73
72
  var handleValues = function () { return __awaiter(void 0, void 0, void 0, function () {
74
73
  var questionModelData, _a, mediaUrl, thumbUrl, appliedAllPosition, steps;
75
74
  return __generator(this, function (_b) {
@@ -154,7 +153,7 @@ var AiQuestionRoot = (0, react_1.forwardRef)(function (props, ref) {
154
153
  width: '256px',
155
154
  height: '100%',
156
155
  overflow: 'auto',
157
- } }, { children: (0, jsx_runtime_1.jsx)(QuestionTemplate_1.default, { extraAbilityTokens: selctedAbilitys }) }))] })));
156
+ } }, { children: (0, jsx_runtime_1.jsx)(QuestionTemplate_1.default, {}) }))] })));
158
157
  });
159
158
  AiQuestionRoot.displayName = 'AiQuestionRoot';
160
159
  exports.default = (0, react_1.memo)(AiQuestionRoot);
@@ -70,7 +70,7 @@ var QuestionModelListItem = function (props) {
70
70
  }, [editModel, answerStatus, step, index]);
71
71
  var formatQuestion = (0, react_1.useMemo)(function () {
72
72
  if ((questions === null || questions === void 0 ? void 0 : questions.length) > 1) {
73
- return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", spacing: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "#F5C441" }, { children: "[\u5185\u5BB9\u968F\u673A]" })), (0, jsx_runtime_1.jsx)(mui_1.Stack, __assign({ spacing: 1 }, { children: questions.map(function (v, index) { return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "text.secondary" }, { children: ["\u2022\u00A0", v.content] }), index)); }) }))] })));
73
+ return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", spacing: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "#F5C441", flexShrink: 0 }, { children: "[\u5185\u5BB9\u968F\u673A]" })), (0, jsx_runtime_1.jsx)(mui_1.Stack, __assign({ spacing: 1 }, { children: questions.map(function (v, index) { return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "text.secondary" }, { children: ["\u2022\u00A0", v.content] }), index)); }) }))] })));
74
74
  }
75
75
  return questions.map(function (v) { return v.content; }).join('\n');
76
76
  }, [questions]);
@@ -18,7 +18,7 @@ var jsx_runtime_1 = require("react/jsx-runtime");
18
18
  var const_1 = require("../QuestionUpdate/const");
19
19
  var AutoCombine_1 = __importDefault(require("./AutoCombine"));
20
20
  var Item_1 = __importDefault(require("./Item"));
21
- var global_store_1 = require("../../../../store/ai-question/global-store");
21
+ var question_ability_store_1 = require("../../../../store/ai-ability-select/question-ability-store");
22
22
  var question_template_store_1 = require("../../../../store/ai-question/question-template-store");
23
23
  var utils_1 = require("../../../../utils/utils");
24
24
  var ai_question_1 = require("../../../../constants/ai-question");
@@ -33,9 +33,9 @@ var QuestionModelList = function () {
33
33
  var ref = (0, react_1.useRef)();
34
34
  var sortable = (0, react_1.useRef)();
35
35
  var _a = (0, question_model_store_1.useQuestionModelStore)(), questionModelData = _a.questionModelData, updateModel = _a.updateModel, addModel = _a.addModel;
36
- var extraAbilityTokens = (0, global_store_1.useAiQuestionStore)().extraAbilityTokens;
36
+ var _b = (0, question_ability_store_1.useAiAbilityListStore)(), selctedAbilitys = _b.selctedAbilitys, aiAbilityList = _b.aiAbilityList;
37
37
  var aiEvaluationData = (0, question_template_store_1.useQuestionTemplateStore)(function (store) { return [store.aiEvaluationData]; }).aiEvaluationData;
38
- var _b = (questionModelData || {}).steps, steps = _b === void 0 ? [] : _b;
38
+ var _c = (questionModelData || {}).steps, steps = _c === void 0 ? [] : _c;
39
39
  var lastAiTestIndex = 0;
40
40
  steps.forEach(function (step, i) {
41
41
  if ((0, ai_question_1.IS_AI_ANALYSIS)(step))
@@ -48,6 +48,12 @@ var QuestionModelList = function () {
48
48
  var handleUseQuestion = (0, react_1.useCallback)(function (items) {
49
49
  addModel(items.map(getQuestionStep));
50
50
  }, [addModel]);
51
+ var handleAutoCombine = (0, react_1.useCallback)(function () {
52
+ var combineTokens = selctedAbilitys.length > 0 ? selctedAbilitys : aiAbilityList.filter(function (v) { return v.isAI; }).map(function (item) { return item.token; });
53
+ console.log(combineTokens);
54
+ 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; }) || [];
55
+ handleUseQuestion(random.map(function (item) { return item[Math.floor(Math.random() * item.length)]; }));
56
+ }, [aiAbilityList, aiEvaluationData, handleUseQuestion, selctedAbilitys]);
51
57
  (0, react_1.useEffect)(function () {
52
58
  if (steps) {
53
59
  sortable.current && sortable.current.destroy();
@@ -63,10 +69,6 @@ var QuestionModelList = function () {
63
69
  }, [questionModelData, updateModel, steps]);
64
70
  return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ width: "100%", sx: steps.length > 0 ? {} : { height: 'calc(100% - 100px)', display: 'flex', alignItems: 'center', justifyContent: 'center' }, ref: ref }, { children: steps.length > 0 ? (steps.map(function (item, index) {
65
71
  return ((0, jsx_runtime_1.jsx)(Item_1.default, __assign({ steps: steps, index: index, disabledWeight: index === lastAiTestIndex }, item), item.uniqueId || item.token));
66
- })) : ((0, jsx_runtime_1.jsx)(AutoCombine_1.default, { onAutoCombine: function () {
67
- console.log('steps', extraAbilityTokens, aiEvaluationData);
68
- var random = aiEvaluationData[0].list.filter(function (item) { return extraAbilityTokens === null || extraAbilityTokens === void 0 ? void 0 : extraAbilityTokens.includes(item === null || item === void 0 ? void 0 : item.token); }).map(function (v) { return v.list; }) || [];
69
- handleUseQuestion(random.map(function (item) { return item[Math.floor(Math.random() * item.length)]; }));
70
- } })) })));
72
+ })) : ((0, jsx_runtime_1.jsx)(AutoCombine_1.default, { onAutoCombine: handleAutoCombine })) })));
71
73
  };
72
74
  exports.default = QuestionModelList;
@@ -75,6 +75,6 @@ var Question = function () {
75
75
  }
76
76
  }
77
77
  }, [token, aiEvaluationData, questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.steps, templateList, addModel]);
78
- return ((0, jsx_runtime_1.jsx)(styled_1.QuestionModelRoot, { children: loading ? ((0, jsx_runtime_1.jsx)(Skeleton_1.default, {})) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Header_1.default, {}), (0, jsx_runtime_1.jsx)(Interactive_1.default, { mode: "Chat" }), (0, jsx_runtime_1.jsx)(List_1.default, {})] })) }));
78
+ return ((0, jsx_runtime_1.jsx)(styled_1.QuestionModelRoot, { children: loading ? ((0, jsx_runtime_1.jsx)(Skeleton_1.default, {})) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Header_1.default, {}), (0, jsx_runtime_1.jsx)(Interactive_1.default, { mode: "Traditional" }), (0, jsx_runtime_1.jsx)(List_1.default, {})] })) }));
79
79
  };
80
80
  exports.default = Question;
@@ -17,15 +17,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  var jsx_runtime_1 = require("react/jsx-runtime");
18
18
  var AiEvaluation_1 = __importDefault(require("./AiEvaluation"));
19
19
  var Skeleton_1 = __importDefault(require("./Skeleton"));
20
+ var question_ability_store_1 = require("../../../../store/ai-ability-select/question-ability-store");
20
21
  var ai_question_1 = require("../../../../services/ai-question");
21
22
  var question_template_store_1 = require("../../../../store/ai-question/question-template-store");
22
23
  var ahooks_1 = require("ahooks");
23
24
  var fbm_ui_1 = require("fbm-ui");
24
- var QuestionTemplate = function (_a) {
25
- var _b = _a.extraAbilityTokens, extraAbilityTokens = _b === void 0 ? [] : _b;
25
+ var QuestionTemplate = function () {
26
26
  var updateAiEvaluationData = (0, question_template_store_1.useQuestionTemplateStore)().updateAiEvaluationData;
27
- var loading = (0, ahooks_1.useRequest)(function () { return (0, ai_question_1.PostAiModelQuestions)({ extraAbilityTokens: extraAbilityTokens }); }, {
27
+ var selctedAbilitys = (0, question_ability_store_1.useAiAbilityListStore)().selctedAbilitys;
28
+ var loading = (0, ahooks_1.useRequest)(function () { return (0, ai_question_1.PostAiModelQuestions)({ extraAbilityTokens: selctedAbilitys }); }, {
28
29
  manual: false,
30
+ refreshDeps: [selctedAbilitys],
29
31
  onSuccess: function (_a) {
30
32
  var data = _a.data;
31
33
  return updateAiEvaluationData(data);
@@ -48,6 +48,5 @@ export interface AiEvaluationState {
48
48
  showOnlyAITest: boolean;
49
49
  }
50
50
  export interface QuestionTemplateProps {
51
- extraAbilityTokens?: string[];
52
51
  }
53
52
  export {};
@@ -26,19 +26,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  var jsx_runtime_1 = require("react/jsx-runtime");
27
27
  var VideoVoicePreview_1 = __importDefault(require("./VideoVoicePreview"));
28
28
  var VideoVoiceUploader_1 = __importDefault(require("./VideoVoiceUploader"));
29
- // import { useUpdateQuestionStore } from '@store/ai-question/question-update-store';
30
29
  var fbm_ui_1 = require("fbm-ui");
31
30
  var mui_1 = require("fbm-ui/lib/mui");
32
31
  var formik_1 = require("formik");
33
32
  var VideoVoice = function () {
34
- // const { questionState, updateQuestionState } = useUpdateQuestionStore(store => [store.questionState]);
35
- // const { item } = questionState;
36
- // const handleVideoBroadcastChange = (key, checked) => {
37
- // updateQuestionState({
38
- // item: { ...item, videoBroadcast: { ...item?.videoBroadcast, [key]: checked ? 1 : 2 } },
39
- // });
40
- // };
41
- // console.log(item);
42
33
  return ((0, jsx_runtime_1.jsx)(formik_1.FieldArray, { name: "questions", render: function (_a) {
43
34
  var _b;
44
35
  var form = _a.form;
@@ -46,13 +37,12 @@ var VideoVoice = function () {
46
37
  borderRadius: 2,
47
38
  border: '1px dashed rgba(0,0,0, 0.08)',
48
39
  } }, { children: [q.videoUrl && ((0, jsx_runtime_1.jsx)(VideoVoicePreview_1.default, { onDel: function () {
49
- form.values.questions[index] = __assign(__assign({}, form.values.questions[index]), { videoUrl: '' });
50
- form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], form.values.questions, true) }));
51
- // item.questions[index] = { content: '', videoUrl: '' };
52
- // updateQuestionState({
53
- // item: { ...item, questions: [...item.questions], videoBroadcast: { ...item?.videoBroadcast, videoUrl: '' } },
54
- // });
55
- }, videoUrl: q.videoUrl })), (0, jsx_runtime_1.jsx)(VideoVoiceUploader_1.default, { index: index })] })), (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ flexGrow: 1, direction: "row", justifyContent: "space-between", spacing: 1 }, { children: [(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: {
40
+ var questons = __spreadArray([], form.values.questions, true);
41
+ questons[index] = __assign(__assign({}, questons[index]), { videoUrl: '' });
42
+ form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], questons, true) }));
43
+ }, videoUrl: q.videoUrl })), (0, jsx_runtime_1.jsx)(VideoVoiceUploader_1.default, { index: index, questions: form.values.questions, setQuestions: function (qs) {
44
+ form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], qs, true) }));
45
+ } })] })), (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ flexGrow: 1, direction: "row", justifyContent: "space-between", spacing: 1 }, { children: [(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: {
56
46
  rows: 3,
57
47
  multiline: true,
58
48
  placeholder: '面试内容(系统将根据此内容向候选人进行语音播报)',
@@ -1,5 +1,7 @@
1
1
  /// <reference types="react" />
2
- declare const VideoVoiceUploader: ({ index }: {
2
+ declare const VideoVoiceUploader: ({ index, questions, setQuestions }: {
3
3
  index: any;
4
+ questions: any;
5
+ setQuestions: any;
4
6
  }) => JSX.Element;
5
7
  export default VideoVoiceUploader;
@@ -22,26 +22,21 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
23
  var jsx_runtime_1 = require("react/jsx-runtime");
24
24
  var ai_question_1 = require("../../../../services/ai-question");
25
- var question_update_store_1 = require("../../../../store/ai-question/question-update-store");
26
25
  var utils_1 = require("../../../../utils/utils");
27
26
  var ahooks_1 = require("ahooks");
28
27
  var fbm_ui_1 = require("fbm-ui");
29
28
  var mui_1 = require("fbm-ui/lib/mui");
30
29
  var VideoVoiceUploader = function (_a) {
31
- var index = _a.index;
32
- var _b = (0, question_update_store_1.useUpdateQuestionStore)(function (store) { return [store.questionState]; }), questionState = _b.questionState, updateQuestionState = _b.updateQuestionState;
33
- var item = questionState.item;
34
- var _c = (0, ahooks_1.useRequest)(ai_question_1.PostCommonUpload, {
30
+ var index = _a.index, questions = _a.questions, setQuestions = _a.setQuestions;
31
+ var _b = (0, ahooks_1.useRequest)(ai_question_1.PostCommonUpload, {
35
32
  manual: true,
36
33
  onSuccess: function (_a) {
37
34
  var data = _a.data;
38
35
  var firstData = data[0];
39
- item.questions[index].videoUrl = firstData.url;
40
- updateQuestionState({
41
- item: __assign(__assign({}, item), { questions: __spreadArray([], item.questions, true), videoBroadcast: __assign(__assign({}, item === null || item === void 0 ? void 0 : item.videoBroadcast), { videoUrl: firstData.url }) }),
42
- });
36
+ questions[index] = __assign(__assign({}, questions[index]), { videoUrl: firstData.url });
37
+ setQuestions(__spreadArray([], questions, true));
43
38
  },
44
- }), loading = _c.loading, postCommonUpload = _c.run;
39
+ }), loading = _b.loading, postCommonUpload = _b.run;
45
40
  var uploadProps = {
46
41
  type: 'custom',
47
42
  showUploadList: false,
@@ -198,7 +198,7 @@ var QuestionUpdate = function () {
198
198
  case 0: return [4 /*yield*/, getModelParams(values, true)];
199
199
  case 1:
200
200
  _a = _b.sent(), errorIndexes = _a.errorIndexes, params = _a.params;
201
- if ((values === null || values === void 0 ? void 0 : values.questions.length) > 4) {
201
+ if ((values === null || values === void 0 ? void 0 : values.questions.length) > 5) {
202
202
  fbm_ui_1.Message.error('最多可添加5个面试内容。');
203
203
  return [2 /*return*/, false];
204
204
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eli-video-interview",
3
- "version": "1.2.35.alpha",
3
+ "version": "1.2.35.alpha.2",
4
4
  "description": "鳄梨科技 AI视频面试 React SDK",
5
5
  "author": "鳄梨科技",
6
6
  "license": "MIT",