eli-video-interview 1.2.41-alpha.42 → 1.2.41-alpha.43
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-question/components/BaseAccordion/index.js +9 -7
- package/esm/modules/ai-question/components/BaseAccordion/interface.d.ts +1 -0
- package/esm/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +1 -2
- package/lib/modules/ai-question/components/BaseAccordion/index.js +9 -7
- package/lib/modules/ai-question/components/BaseAccordion/interface.d.ts +1 -0
- package/lib/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +1 -2
- package/package.json +1 -1
|
@@ -41,14 +41,14 @@ import { Accordion, AccordionDetails, AccordionSummary, List, ListItem, ListItem
|
|
|
41
41
|
import { memo, useCallback, useEffect, useRef, useState } from 'react';
|
|
42
42
|
var LANGUAGE_TYPE_LIST = [LANGUAGE_TYPE.MANDARIN, LANGUAGE_TYPE.CANTONESE, LANGUAGE_TYPE.JAPANESE, LANGUAGE_TYPE.ENGLISH];
|
|
43
43
|
var BaseAccordion = function (props) {
|
|
44
|
-
var name = props.name, positionName = props.positionName, list = props.list, index = props.index, isShowOnlyAITest = props.isShowOnlyAITest, _a = props.isShowDesc, isShowDesc = _a === void 0 ? false : _a, _b = props.isShowSummaryAction, isShowSummaryAction = _b === void 0 ? false : _b, _c = props.isShowConfirm, isShowConfirm = _c === void 0 ? false : _c, _d = props.isShowPreview, isShowPreview = _d === void 0 ? true : _d, _e = props.isNew, isNew = _e === void 0 ? false : _e;
|
|
44
|
+
var name = props.name, positionName = props.positionName, list = props.list, index = props.index, isShowOnlyAITest = props.isShowOnlyAITest, _a = props.isShowDesc, isShowDesc = _a === void 0 ? false : _a, _b = props.isShowSummaryAction, isShowSummaryAction = _b === void 0 ? false : _b, _c = props.isShowConfirm, isShowConfirm = _c === void 0 ? false : _c, _d = props.isShowPreview, isShowPreview = _d === void 0 ? true : _d, _e = props.isNew, isNew = _e === void 0 ? false : _e, _f = props.isOem, isOem = _f === void 0 ? false : _f;
|
|
45
45
|
var ref = useRef(null);
|
|
46
46
|
var isHovering = useHover(ref);
|
|
47
47
|
var updatePreview = useQuestionPreviewStore().updatePreview;
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
var
|
|
48
|
+
var _g = useQuestionModelStore(), questionModelData = _g.questionModelData, addModel = _g.addModel;
|
|
49
|
+
var _h = __read(useState(false), 2), isPaging = _h[0], setIsPaging = _h[1];
|
|
50
|
+
var _j = __read(useState([]), 2), questionsList = _j[0], setQuestionsList = _j[1];
|
|
51
|
+
var _k = __read(useState(), 2), hoverItem = _k[0], setHoverItem = _k[1];
|
|
52
52
|
var handlePreview = useDebounceFn(function () {
|
|
53
53
|
isShowPreview && updatePreview(isHovering, isHovering ? hoverItem : undefined);
|
|
54
54
|
}, {
|
|
@@ -92,7 +92,9 @@ var BaseAccordion = function (props) {
|
|
|
92
92
|
isHovering ? handlePreview() : isShowPreview && updatePreview(isHovering);
|
|
93
93
|
}, [handlePreview, hoverItem, isHovering, isShowPreview, updatePreview]);
|
|
94
94
|
useEffect(function () {
|
|
95
|
-
var filterList = list
|
|
95
|
+
var filterList = list
|
|
96
|
+
.filter(function (item) { return !isShowOnlyAITest || IS_AI_ANALYSIS(item); })
|
|
97
|
+
.filter(function (v) { return !isOem || !['情绪判断测评-游戏题', '决策能力测评-游戏题', '短期记忆测评-游戏题'].includes(v.name); });
|
|
96
98
|
if (filterList.length > MAX_DISPLAY_SIZE) {
|
|
97
99
|
setIsPaging(true);
|
|
98
100
|
setQuestionsList(filterList.slice(0, MAX_DISPLAY_SIZE));
|
|
@@ -101,7 +103,7 @@ var BaseAccordion = function (props) {
|
|
|
101
103
|
setIsPaging(false);
|
|
102
104
|
setQuestionsList(filterList);
|
|
103
105
|
}
|
|
104
|
-
}, [list, isShowOnlyAITest]);
|
|
106
|
+
}, [list, isShowOnlyAITest, isOem]);
|
|
105
107
|
return (_jsx(_Fragment, { children: questionsList.length > 0 && (_jsx(AccordionRoot, { children: _jsxs(Accordion, __assign({ defaultExpanded: index === 0 }, { children: [_jsx(AccordionSummary, __assign({ expandIcon: _jsx(ExpandMore, {}), sx: {
|
|
106
108
|
'&:after': {
|
|
107
109
|
content: "".concat(isNew ? 'url(//webcdn.fbmms.cn/assets/XXRf/bdUI9qZoTx-l2k_OHTotn)' : '" "'),
|
|
@@ -76,9 +76,8 @@ var AiEvaluation = function (_a) {
|
|
|
76
76
|
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) {
|
|
77
77
|
var name = _a.name, list = _a.list;
|
|
78
78
|
return (_jsxs(Box, { children: [_jsx(Typography, __assign({ fontSize: 12, lineHeight: 1.5, weight: "500", mb: 2 }, { children: name })), list
|
|
79
|
-
.filter(function (v) { return !isOem || v.name !== '游戏测评'; })
|
|
80
79
|
.filter(function (v) { return !isEdit || !v.isNew || selctedAbilitys.includes(v.token); })
|
|
81
|
-
.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));
|
|
80
|
+
.map(function (item, i) { return (_jsx(BaseAccordion, __assign({ index: i, isOem: isOem, isShowOnlyAITest: showOnlyAITest, isShowDesc: index !== 0, isShowSummaryAction: index !== 0, isShowConfirm: index !== 0 }, item), item.name + i)); })] }, name));
|
|
82
81
|
})] }));
|
|
83
82
|
};
|
|
84
83
|
export default AiEvaluation;
|
|
@@ -43,14 +43,14 @@ var mui_1 = require("fbm-ui/lib/mui");
|
|
|
43
43
|
var react_1 = require("react");
|
|
44
44
|
var LANGUAGE_TYPE_LIST = [ai_question_2.LANGUAGE_TYPE.MANDARIN, ai_question_2.LANGUAGE_TYPE.CANTONESE, ai_question_2.LANGUAGE_TYPE.JAPANESE, ai_question_2.LANGUAGE_TYPE.ENGLISH];
|
|
45
45
|
var BaseAccordion = function (props) {
|
|
46
|
-
var name = props.name, positionName = props.positionName, list = props.list, index = props.index, isShowOnlyAITest = props.isShowOnlyAITest, _a = props.isShowDesc, isShowDesc = _a === void 0 ? false : _a, _b = props.isShowSummaryAction, isShowSummaryAction = _b === void 0 ? false : _b, _c = props.isShowConfirm, isShowConfirm = _c === void 0 ? false : _c, _d = props.isShowPreview, isShowPreview = _d === void 0 ? true : _d, _e = props.isNew, isNew = _e === void 0 ? false : _e;
|
|
46
|
+
var name = props.name, positionName = props.positionName, list = props.list, index = props.index, isShowOnlyAITest = props.isShowOnlyAITest, _a = props.isShowDesc, isShowDesc = _a === void 0 ? false : _a, _b = props.isShowSummaryAction, isShowSummaryAction = _b === void 0 ? false : _b, _c = props.isShowConfirm, isShowConfirm = _c === void 0 ? false : _c, _d = props.isShowPreview, isShowPreview = _d === void 0 ? true : _d, _e = props.isNew, isNew = _e === void 0 ? false : _e, _f = props.isOem, isOem = _f === void 0 ? false : _f;
|
|
47
47
|
var ref = (0, react_1.useRef)(null);
|
|
48
48
|
var isHovering = (0, ahooks_1.useHover)(ref);
|
|
49
49
|
var updatePreview = (0, question_preview_store_1.useQuestionPreviewStore)().updatePreview;
|
|
50
|
-
var
|
|
51
|
-
var
|
|
52
|
-
var
|
|
53
|
-
var
|
|
50
|
+
var _g = (0, question_model_store_1.useQuestionModelStore)(), questionModelData = _g.questionModelData, addModel = _g.addModel;
|
|
51
|
+
var _h = __read((0, react_1.useState)(false), 2), isPaging = _h[0], setIsPaging = _h[1];
|
|
52
|
+
var _j = __read((0, react_1.useState)([]), 2), questionsList = _j[0], setQuestionsList = _j[1];
|
|
53
|
+
var _k = __read((0, react_1.useState)(), 2), hoverItem = _k[0], setHoverItem = _k[1];
|
|
54
54
|
var handlePreview = (0, ahooks_1.useDebounceFn)(function () {
|
|
55
55
|
isShowPreview && updatePreview(isHovering, isHovering ? hoverItem : undefined);
|
|
56
56
|
}, {
|
|
@@ -94,7 +94,9 @@ var BaseAccordion = function (props) {
|
|
|
94
94
|
isHovering ? handlePreview() : isShowPreview && updatePreview(isHovering);
|
|
95
95
|
}, [handlePreview, hoverItem, isHovering, isShowPreview, updatePreview]);
|
|
96
96
|
(0, react_1.useEffect)(function () {
|
|
97
|
-
var filterList = list
|
|
97
|
+
var filterList = list
|
|
98
|
+
.filter(function (item) { return !isShowOnlyAITest || (0, ai_question_1.IS_AI_ANALYSIS)(item); })
|
|
99
|
+
.filter(function (v) { return !isOem || !['情绪判断测评-游戏题', '决策能力测评-游戏题', '短期记忆测评-游戏题'].includes(v.name); });
|
|
98
100
|
if (filterList.length > const_2.MAX_DISPLAY_SIZE) {
|
|
99
101
|
setIsPaging(true);
|
|
100
102
|
setQuestionsList(filterList.slice(0, const_2.MAX_DISPLAY_SIZE));
|
|
@@ -103,7 +105,7 @@ var BaseAccordion = function (props) {
|
|
|
103
105
|
setIsPaging(false);
|
|
104
106
|
setQuestionsList(filterList);
|
|
105
107
|
}
|
|
106
|
-
}, [list, isShowOnlyAITest]);
|
|
108
|
+
}, [list, isShowOnlyAITest, isOem]);
|
|
107
109
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: questionsList.length > 0 && ((0, jsx_runtime_1.jsx)(styled_1.AccordionRoot, { children: (0, jsx_runtime_1.jsxs)(mui_1.Accordion, __assign({ defaultExpanded: index === 0 }, { children: [(0, jsx_runtime_1.jsx)(mui_1.AccordionSummary, __assign({ expandIcon: (0, jsx_runtime_1.jsx)(icons_material_1.ExpandMore, {}), sx: {
|
|
108
110
|
'&:after': {
|
|
109
111
|
content: "".concat(isNew ? 'url(//webcdn.fbmms.cn/assets/XXRf/bdUI9qZoTx-l2k_OHTotn)' : '" "'),
|
|
@@ -81,9 +81,8 @@ var AiEvaluation = function (_a) {
|
|
|
81
81
|
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", justifyContent: "space-between", alignItems: "center", mb: 2 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "outlined", color: "inherit", icon: (0, jsx_runtime_1.jsx)(fbm_ui_1.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" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Popover, __assign({ open: addQuestionOpen, arrow: false, content: content, onClickAway: function () { return setState({ addQuestionOpen: false }); } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "outlined", icon: (0, jsx_runtime_1.jsx)(fbm_ui_1.AddIcon, {}), onClick: function () { return setState({ addQuestionOpen: true }); } }, { children: "\u81EA\u5B9A\u4E49\u9898\u76EE" })) }))] })), aiEvaluationData.map(function (_a, index) {
|
|
82
82
|
var name = _a.name, list = _a.list;
|
|
83
83
|
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ fontSize: 12, lineHeight: 1.5, weight: "500", mb: 2 }, { children: name })), list
|
|
84
|
-
.filter(function (v) { return !isOem || v.name !== '游戏测评'; })
|
|
85
84
|
.filter(function (v) { return !isEdit || !v.isNew || selctedAbilitys.includes(v.token); })
|
|
86
|
-
.map(function (item, i) { return ((0, jsx_runtime_1.jsx)(BaseAccordion_1.default, __assign({ index: i, isShowOnlyAITest: showOnlyAITest, isShowDesc: index !== 0, isShowSummaryAction: index !== 0, isShowConfirm: index !== 0 }, item), item.name + i)); })] }, name));
|
|
85
|
+
.map(function (item, i) { return ((0, jsx_runtime_1.jsx)(BaseAccordion_1.default, __assign({ index: i, isOem: isOem, isShowOnlyAITest: showOnlyAITest, isShowDesc: index !== 0, isShowSummaryAction: index !== 0, isShowConfirm: index !== 0 }, item), item.name + i)); })] }, name));
|
|
87
86
|
})] }));
|
|
88
87
|
};
|
|
89
88
|
exports.default = AiEvaluation;
|