eli-video-interview 1.2.3-5.alpha.1 → 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.
- package/esm/modules/ai-ability-select/interface.d.ts +1 -0
- package/esm/modules/ai-question/Root.js +1 -1
- package/esm/modules/ai-question/components/QuestionModel/List.js +10 -7
- package/esm/modules/ai-question/components/QuestionTemplate/index.js +5 -3
- package/esm/modules/ai-question/components/QuestionTemplate/interface.d.ts +0 -1
- package/lib/modules/ai-ability-select/interface.d.ts +1 -0
- package/lib/modules/ai-question/Root.js +1 -1
- package/lib/modules/ai-question/components/QuestionModel/List.js +10 -7
- package/lib/modules/ai-question/components/QuestionTemplate/index.js +5 -3
- package/lib/modules/ai-question/components/QuestionTemplate/interface.d.ts +0 -1
- package/package.json +1 -1
|
@@ -148,7 +148,7 @@ var AiQuestionRoot = forwardRef(function (props, ref) {
|
|
|
148
148
|
width: '256px',
|
|
149
149
|
height: '100%',
|
|
150
150
|
overflow: 'auto',
|
|
151
|
-
} }, { children: _jsx(QuestionTemplate, {
|
|
151
|
+
} }, { children: _jsx(QuestionTemplate, {}) }))] })));
|
|
152
152
|
});
|
|
153
153
|
AiQuestionRoot.displayName = 'AiQuestionRoot';
|
|
154
154
|
export default memo(AiQuestionRoot);
|
|
@@ -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 {
|
|
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
|
|
31
|
+
var _b = useAiAbilityListStore(), selctedAbilitys = _b.selctedAbilitys, aiAbilityList = _b.aiAbilityList;
|
|
32
32
|
var aiEvaluationData = useQuestionTemplateStore(function (store) { return [store.aiEvaluationData]; }).aiEvaluationData;
|
|
33
|
-
var
|
|
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,9 +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:
|
|
62
|
-
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; }) || [];
|
|
63
|
-
handleUseQuestion(random.map(function (item) { return item[Math.floor(Math.random() * item.length)]; }));
|
|
64
|
-
} })) })));
|
|
67
|
+
})) : (_jsx(AutoCombine, { onAutoCombine: handleAutoCombine })) })));
|
|
65
68
|
};
|
|
66
69
|
export default QuestionModelList;
|
|
@@ -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 (
|
|
20
|
-
var _b = _a.extraAbilityTokens, extraAbilityTokens = _b === void 0 ? [] : _b;
|
|
20
|
+
var QuestionTemplate = function () {
|
|
21
21
|
var updateAiEvaluationData = useQuestionTemplateStore().updateAiEvaluationData;
|
|
22
|
-
var
|
|
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);
|
|
@@ -153,7 +153,7 @@ var AiQuestionRoot = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
153
153
|
width: '256px',
|
|
154
154
|
height: '100%',
|
|
155
155
|
overflow: 'auto',
|
|
156
|
-
} }, { children: (0, jsx_runtime_1.jsx)(QuestionTemplate_1.default, {
|
|
156
|
+
} }, { children: (0, jsx_runtime_1.jsx)(QuestionTemplate_1.default, {}) }))] })));
|
|
157
157
|
});
|
|
158
158
|
AiQuestionRoot.displayName = 'AiQuestionRoot';
|
|
159
159
|
exports.default = (0, react_1.memo)(AiQuestionRoot);
|
|
@@ -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
|
|
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
|
|
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
|
|
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,9 +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:
|
|
67
|
-
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; }) || [];
|
|
68
|
-
handleUseQuestion(random.map(function (item) { return item[Math.floor(Math.random() * item.length)]; }));
|
|
69
|
-
} })) })));
|
|
72
|
+
})) : ((0, jsx_runtime_1.jsx)(AutoCombine_1.default, { onAutoCombine: handleAutoCombine })) })));
|
|
70
73
|
};
|
|
71
74
|
exports.default = QuestionModelList;
|
|
@@ -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 (
|
|
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
|
|
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);
|