eli-video-interview 1.2.42-alpha.40 → 1.2.42-alpha.42

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.
@@ -21,7 +21,8 @@ import { Stack } from 'fbm-ui/lib/mui';
21
21
  import { forwardRef, memo, useEffect } from 'react';
22
22
  var ScrollDialogContent = styled(Box)({
23
23
  maxHeight: 'calc(100vh - 192px)',
24
- overflow: 'scroll',
24
+ height: 'calc(100vh - 192px)',
25
+ overflow: 'hidden',
25
26
  });
26
27
  var AiAbilitySelectRoot = forwardRef(function (_a, ref) {
27
28
  var jobToken = _a.jobToken, thirdToken = _a.thirdToken, token = _a.token, hiddenTips = _a.hiddenTips;
@@ -41,7 +42,7 @@ var AiAbilitySelectRoot = forwardRef(function (_a, ref) {
41
42
  setEnterprise({ jobToken: jobToken, thirdToken: thirdToken });
42
43
  // eslint-disable-next-line react-hooks/exhaustive-deps
43
44
  }, [jobToken, thirdToken]);
44
- 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: !hiddenTips ? '请选择要优先使用的考察能力,也可以点击「下一步」直接出题' : '已选择的考察能力会优先在面试题目中展示' })), (aiAbilityList === null || aiAbilityList === void 0 ? void 0 : aiAbilityList.some(function (v) { return v.isNew; })) && (_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 })] })) })));
45
+ return (_jsx(ScrollDialogContent, __assign({ ref: ref }, { children: _jsxs(Box, __assign({ display: "flex", flexDirection: "column", width: 760, height: 1 }, { children: [_jsxs(Stack, __assign({ spacing: 2, mb: 2 }, { children: [_jsx(Typography, __assign({ variant: "body1", fontWeight: 500 }, { children: !hiddenTips ? '请选择要优先使用的考察能力,也可以点击「下一步」直接出题' : '已选择的考察能力会优先在面试题目中展示' })), (aiAbilityList === null || aiAbilityList === void 0 ? void 0 : aiAbilityList.some(function (v) { return v.isNew; })) && (_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 })] })) })));
45
46
  });
46
47
  AiAbilitySelectRoot.displayName = 'AiAbilitySelectRoot';
47
48
  export default memo(AiAbilitySelectRoot);
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { AiAbilityDetailProps } from './interface';
3
- declare const AiAbilityDetail: React.FC<AiAbilityDetailProps>;
4
- export default AiAbilityDetail;
3
+ declare const _default: import("react").NamedExoticComponent<AiAbilityDetailProps>;
4
+ export default _default;
@@ -12,6 +12,7 @@ var __assign = (this && this.__assign) || function () {
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { Box, Typography } from 'fbm-ui';
14
14
  import { Stack } from 'fbm-ui/lib/mui';
15
+ import { memo } from 'react';
15
16
  var AiAbilityDetail = function (_a) {
16
17
  var detail = _a.detail;
17
18
  return (_jsx(Box, __assign({ p: 2, maxHeight: 582, overflow: "scroll" }, { children: detail === null || detail === void 0 ? void 0 : detail.map(function (v) {
@@ -19,4 +20,4 @@ var AiAbilityDetail = function (_a) {
19
20
  return (_jsxs(Stack, __assign({ mb: 2, spacing: 1, width: 300 }, { children: [_jsx(Typography, __assign({ variant: "body2", fontWeight: 500 }, { children: v.name })), _jsx(Typography, __assign({ variant: "body2", color: "textSecondary" }, { children: (_a = v.items) === null || _a === void 0 ? void 0 : _a.join('\n') }))] }), v.name));
20
21
  }) })));
21
22
  };
22
- export default AiAbilityDetail;
23
+ export default memo(AiAbilityDetail);
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { AiAbilityItemProps } from './interface';
3
- declare const AiAbilityItem: React.FC<AiAbilityItemProps>;
4
- export default AiAbilityItem;
3
+ declare const _default: import("react").NamedExoticComponent<AiAbilityItemProps>;
4
+ export default _default;
@@ -39,15 +39,14 @@ import AiAbilityDetail from './AiAbilityDetail';
39
39
  import { NewBadge } from './styled';
40
40
  import { useAiAbilityListStore } from "../../../../store/ai-ability-select/question-ability-store";
41
41
  import { Box, Checkbox, Paper, Popover, Typography } from 'fbm-ui';
42
+ import { memo } from 'react';
42
43
  var AiAbilityItem = function (_a) {
43
44
  var name = _a.name, isNew = _a.isNew, token = _a.token, detail = _a.detail;
44
45
  var _b = useAiAbilityListStore(), selctedAbilitys = _b.selctedAbilitys, setSelctedAbilitys = _b.setSelctedAbilitys;
45
46
  var handleChange = function (_, checked) {
46
47
  return setSelctedAbilitys(__spreadArray(__spreadArray([], __read(selctedAbilitys.filter(function (v) { return v !== token; })), false), __read((checked ? [token] : [])), false));
47
48
  };
48
- return (_jsx(Paper, __assign({ variant: "outlined" }, { children: _jsxs(Box, __assign({ sx: { pl: 2, width: 240, height: 54, display: 'flex', alignItems: 'center', position: 'relative' } }, { children: [_jsx(Checkbox, { onChange: handleChange, label: _jsx(AiAbilityLable, { name: name, detail: detail }), checked: selctedAbilitys.includes(token),
49
- // @ts-ignore
50
- sx: { width: 1, height: 1 } }), isNew && _jsx(NewBadge, { src: "//webcdn.fbmms.cn/assets/XXRf/bdUI9qZoTx-l2k_OHTotn" })] })) })));
49
+ return (_jsx(Paper, __assign({ variant: "outlined" }, { children: _jsxs(Box, __assign({ sx: { pl: 2, width: 240, height: 54, display: 'flex', alignItems: 'center', position: 'relative' } }, { children: [_jsx(Checkbox, { onChange: handleChange, label: _jsx(MemoAiAbilityLable, { name: name, detail: detail }), checked: selctedAbilitys.includes(token), sx: { width: 1, height: 1 } }), isNew && _jsx(NewBadge, { src: "//webcdn.fbmms.cn/assets/XXRf/bdUI9qZoTx-l2k_OHTotn" })] })) })));
51
50
  };
52
51
  var AiAbilityLable = function (_a) {
53
52
  var name = _a.name, detail = _a.detail;
@@ -55,4 +54,5 @@ var AiAbilityLable = function (_a) {
55
54
  return (_jsx(Popover, __assign({ content: _jsx(AiAbilityDetail, { detail: detail }), trigger: "hover", placement: "right" }, { children: _jsx(Typography, __assign({ noWrap: true, maxWidth: 180, variant: "body2", sx: { mt: 0.5 } }, { children: name })) })));
56
55
  return (_jsx(Typography, __assign({ noWrap: true, maxWidth: 180, variant: "body2" }, { children: name })));
57
56
  };
58
- export default AiAbilityItem;
57
+ var MemoAiAbilityLable = memo(AiAbilityLable);
58
+ export default memo(AiAbilityItem);
@@ -11,9 +11,21 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import AiAbilityItem from '../AiAbilityItem';
14
- import { Grid } from 'fbm-ui';
14
+ import AutoSizer from 'react-virtualized-auto-sizer';
15
+ import { FixedSizeGrid as Grid } from 'react-window';
16
+ var Cell = function (_a) {
17
+ var data = _a.data, columnIndex = _a.columnIndex, rowIndex = _a.rowIndex, style = _a.style;
18
+ var item = data[rowIndex * 3 + columnIndex];
19
+ if (!item) {
20
+ return null;
21
+ }
22
+ return (_jsx("div", __assign({ style: __assign(__assign({}, style), { width: style.width - 8, height: style.height - 8 }) }, { children: _jsx(AiAbilityItem, __assign({}, item)) })));
23
+ };
15
24
  var AiAbilityList = function (_a) {
16
25
  var items = _a.items;
17
- return (_jsx(Grid, __assign({ container: true, spacing: 1, rowSpacing: 1, columnSpacing: 1 }, { children: items === null || items === void 0 ? void 0 : items.map(function (item) { return (_jsx(Grid, __assign({ item: true }, { children: _jsx(AiAbilityItem, __assign({}, item)) }), item.token)); }) })));
26
+ return (_jsx(AutoSizer, { children: function (_a) {
27
+ var height = _a.height, width = _a.width;
28
+ return (_jsx(Grid, __assign({ columnCount: 3, columnWidth: 240, overscanRowCount: 10, height: height, rowCount: Math.ceil(items.length / 3), rowHeight: 62, width: width, itemData: items }, { children: Cell })));
29
+ } }));
18
30
  };
19
31
  export default AiAbilityList;
@@ -41,7 +41,7 @@ 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, _f = props.isOem, isOem = _f === void 0 ? false : _f;
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, expanded = props.expanded, token = props.token, onExpandedChange = props.onExpandedChange;
45
45
  var ref = useRef(null);
46
46
  var isHovering = useHover(ref);
47
47
  var updatePreview = useQuestionPreviewStore().updatePreview;
@@ -104,7 +104,7 @@ var BaseAccordion = function (props) {
104
104
  setQuestionsList(filterList);
105
105
  }
106
106
  }, [list, isShowOnlyAITest, isOem]);
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: {
107
+ return (_jsx(_Fragment, { children: questionsList.length > 0 && (_jsx(AccordionRoot, { children: _jsxs(Accordion, __assign({ defaultExpanded: index === 0, expanded: expanded === token, onChange: onExpandedChange(token) }, { children: [_jsx(AccordionSummary, __assign({ expandIcon: _jsx(ExpandMore, {}), sx: {
108
108
  '&:after': {
109
109
  content: "".concat(isNew ? 'url(//webcdn.fbmms.cn/assets/XXRf/bdUI9qZoTx-l2k_OHTotn)' : '" "'),
110
110
  position: 'absolute',
@@ -113,13 +113,13 @@ var BaseAccordion = function (props) {
113
113
  width: 38,
114
114
  height: 16,
115
115
  },
116
- } }, { children: _jsxs(Box, __assign({ flex: "1 0", display: "flex", justifyContent: "space-between", alignItems: "center", overflow: "hidden" }, { children: [_jsxs(Box, __assign({ flex: "1 0", overflow: "hidden" }, { children: [_jsx(AccordionTitle, { children: positionName || name }), positionName && _jsxs(AccordionSubTitle, __assign({ color: "secondary" }, { children: ["\u6B65\u9AA4\uFF1A", name] }))] })), isShowSummaryAction && (_jsx(Button, __assign({ sx: { mr: 1, flexShrink: 0, height: 24 }, variant: "outlined", color: "inherit", size: "small", onClick: handleUseAllQuestion }, { children: "\u4F7F\u7528" })))] })) })), _jsxs(AccordionDetails, { children: [_jsx(List, __assign({ ref: ref }, { children: questionsList.map(function (item) {
116
+ } }, { children: _jsxs(Box, __assign({ flex: "1 0", display: "flex", justifyContent: "space-between", alignItems: "center", overflow: "hidden" }, { children: [_jsxs(Box, __assign({ flex: "1 0", overflow: "hidden" }, { children: [_jsx(AccordionTitle, { children: positionName || name }), positionName && _jsxs(AccordionSubTitle, __assign({ color: "secondary" }, { children: ["\u6B65\u9AA4\uFF1A", name] }))] })), isShowSummaryAction && (_jsx(Button, __assign({ sx: { mr: 1, flexShrink: 0, height: 24 }, variant: "outlined", color: "inherit", size: "small", onClick: handleUseAllQuestion }, { children: "\u4F7F\u7528" })))] })) })), expanded === token && (_jsxs(AccordionDetails, { children: [_jsx(List, __assign({ ref: ref }, { children: questionsList.map(function (item) {
117
117
  var token = item.token, name = item.name, category = item.category;
118
118
  var isUsed = questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.steps.find(function (step) { return step.originToken === token; });
119
119
  return (_jsx(ListItem, __assign({ secondaryAction: [
120
120
  isUsed && _jsx(Done, {}, "icon"),
121
121
  _jsx(Box, __assign({ className: "secondary-action-buttons" }, { children: _jsx(Button, __assign({ variant: "outlined", color: "inherit", size: "small", onClick: function () { return handleUseQuestion(item); } }, { children: "\u4F7F\u7528" })) }), "buttons"),
122
122
  ], onMouseOver: function () { return handleMouseOver(item); } }, { children: _jsx(ListItemText, { primary: name, secondary: isShowDesc && category ? category[0] : '' }) }), token));
123
- }) })), isPaging && (_jsx(Button, __assign({ variant: "text", sx: { width: '100%', justifyContent: 'start', color: '#576B95' }, onClick: handleShowAll }, { children: "\u5C55\u793A\u5168\u90E8" })))] })] })) })) }));
123
+ }) })), isPaging && (_jsx(Button, __assign({ variant: "text", sx: { width: '100%', justifyContent: 'start', color: '#576B95' }, onClick: handleShowAll }, { children: "\u5C55\u793A\u5168\u90E8" })))] }))] })) })) }));
124
124
  };
125
125
  export default memo(BaseAccordion);
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { AiEvaluationDataList } from '../QuestionTemplate/interface';
2
3
  export interface BaseAccordionProps extends AiEvaluationDataList {
3
4
  index?: number;
@@ -7,4 +8,6 @@ export interface BaseAccordionProps extends AiEvaluationDataList {
7
8
  isShowSummaryAction?: boolean;
8
9
  isShowConfirm?: boolean;
9
10
  isOem?: boolean;
11
+ expanded: string | false;
12
+ onExpandedChange: (panel: string) => (event: React.SyntheticEvent, expanded: boolean) => void;
10
13
  }
@@ -40,7 +40,7 @@ import { uniqueId } from "../../../../utils/utils";
40
40
  import { useSetState } from 'ahooks';
41
41
  import { AddIcon, Box, Button, LayerOutlineIcon, MicIcon, Popover, RadioCheckedIcon, SMSOneIcon, Typography } from 'fbm-ui';
42
42
  import { List, ListItem, ListItemButton, ListItemIcon, ListItemText } from 'fbm-ui/lib/mui';
43
- import { useCallback } from 'react';
43
+ import { useCallback, useState } from 'react';
44
44
  var ICONS = (_a = {},
45
45
  _a[ADD_QUESTION_TYPE.FREE] = _jsx(SMSOneIcon, { color: "secondary" }),
46
46
  _a[ADD_QUESTION_TYPE.LANGUAGE] = _jsx(MicIcon, { color: "secondary" }),
@@ -59,6 +59,10 @@ var AiEvaluation = function (_a) {
59
59
  showOnlyAITest: false,
60
60
  }), 2), state = _b[0], setState = _b[1];
61
61
  var addQuestionOpen = state.addQuestionOpen, showOnlyAITest = state.showOnlyAITest;
62
+ var _c = __read(useState(false), 2), expanded = _c[0], setExpanded = _c[1];
63
+ var handleExpandedChange = function (panel) { return function (event, isExpanded) {
64
+ setExpanded(isExpanded ? panel : false);
65
+ }; };
62
66
  var handleClickAdd = useCallback(function (aiShowType) {
63
67
  setState({ addQuestionOpen: false });
64
68
  updateQuestionState({
@@ -77,7 +81,7 @@ var AiEvaluation = function (_a) {
77
81
  var name = _a.name, list = _a.list;
78
82
  return (_jsxs(Box, { children: [_jsx(Typography, __assign({ fontSize: 12, lineHeight: 1.5, weight: "500", mb: 2 }, { children: name })), list
79
83
  .filter(function (v) { return !isEdit || !v.isNew || selctedAbilitys.includes(v.token); })
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.token)); })] }, name));
84
+ .map(function (item, i) { return (_jsx(BaseAccordion, __assign({ index: i, isOem: isOem, isShowOnlyAITest: showOnlyAITest, isShowDesc: index !== 0, isShowSummaryAction: index !== 0, isShowConfirm: index !== 0, expanded: expanded, onExpandedChange: handleExpandedChange }, item), item.token)); })] }, name));
81
85
  })] }));
82
86
  };
83
87
  export default AiEvaluation;
@@ -26,7 +26,8 @@ var mui_1 = require("fbm-ui/lib/mui");
26
26
  var react_1 = require("react");
27
27
  var ScrollDialogContent = (0, fbm_ui_2.styled)(fbm_ui_1.Box)({
28
28
  maxHeight: 'calc(100vh - 192px)',
29
- overflow: 'scroll',
29
+ height: 'calc(100vh - 192px)',
30
+ overflow: 'hidden',
30
31
  });
31
32
  var AiAbilitySelectRoot = (0, react_1.forwardRef)(function (_a, ref) {
32
33
  var jobToken = _a.jobToken, thirdToken = _a.thirdToken, token = _a.token, hiddenTips = _a.hiddenTips;
@@ -46,7 +47,7 @@ var AiAbilitySelectRoot = (0, react_1.forwardRef)(function (_a, ref) {
46
47
  setEnterprise({ jobToken: jobToken, thirdToken: thirdToken });
47
48
  // eslint-disable-next-line react-hooks/exhaustive-deps
48
49
  }, [jobToken, thirdToken]);
49
- return ((0, jsx_runtime_1.jsx)(ScrollDialogContent, __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: !hiddenTips ? '请选择要优先使用的考察能力,也可以点击「下一步」直接出题' : '已选择的考察能力会优先在面试题目中展示' })), (aiAbilityList === null || aiAbilityList === void 0 ? void 0 : aiAbilityList.some(function (v) { return v.isNew; })) && ((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 })] })) })));
50
+ return ((0, jsx_runtime_1.jsx)(ScrollDialogContent, __assign({ ref: ref }, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", flexDirection: "column", width: 760, height: 1 }, { 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: !hiddenTips ? '请选择要优先使用的考察能力,也可以点击「下一步」直接出题' : '已选择的考察能力会优先在面试题目中展示' })), (aiAbilityList === null || aiAbilityList === void 0 ? void 0 : aiAbilityList.some(function (v) { return v.isNew; })) && ((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 })] })) })));
50
51
  });
51
52
  AiAbilitySelectRoot.displayName = 'AiAbilitySelectRoot';
52
53
  exports.default = (0, react_1.memo)(AiAbilitySelectRoot);
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { AiAbilityDetailProps } from './interface';
3
- declare const AiAbilityDetail: React.FC<AiAbilityDetailProps>;
4
- export default AiAbilityDetail;
3
+ declare const _default: import("react").NamedExoticComponent<AiAbilityDetailProps>;
4
+ export default _default;
@@ -14,6 +14,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  var jsx_runtime_1 = require("react/jsx-runtime");
15
15
  var fbm_ui_1 = require("fbm-ui");
16
16
  var mui_1 = require("fbm-ui/lib/mui");
17
+ var react_1 = require("react");
17
18
  var AiAbilityDetail = function (_a) {
18
19
  var detail = _a.detail;
19
20
  return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ p: 2, maxHeight: 582, overflow: "scroll" }, { children: detail === null || detail === void 0 ? void 0 : detail.map(function (v) {
@@ -21,4 +22,4 @@ var AiAbilityDetail = function (_a) {
21
22
  return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ mb: 2, spacing: 1, width: 300 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", fontWeight: 500 }, { children: v.name })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "textSecondary" }, { children: (_a = v.items) === null || _a === void 0 ? void 0 : _a.join('\n') }))] }), v.name));
22
23
  }) })));
23
24
  };
24
- exports.default = AiAbilityDetail;
25
+ exports.default = (0, react_1.memo)(AiAbilityDetail);
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { AiAbilityItemProps } from './interface';
3
- declare const AiAbilityItem: React.FC<AiAbilityItemProps>;
4
- export default AiAbilityItem;
3
+ declare const _default: import("react").NamedExoticComponent<AiAbilityItemProps>;
4
+ export default _default;
@@ -44,15 +44,14 @@ var AiAbilityDetail_1 = __importDefault(require("./AiAbilityDetail"));
44
44
  var styled_1 = require("./styled");
45
45
  var question_ability_store_1 = require("../../../../store/ai-ability-select/question-ability-store");
46
46
  var fbm_ui_1 = require("fbm-ui");
47
+ var react_1 = require("react");
47
48
  var AiAbilityItem = function (_a) {
48
49
  var name = _a.name, isNew = _a.isNew, token = _a.token, detail = _a.detail;
49
50
  var _b = (0, question_ability_store_1.useAiAbilityListStore)(), selctedAbilitys = _b.selctedAbilitys, setSelctedAbilitys = _b.setSelctedAbilitys;
50
51
  var handleChange = function (_, checked) {
51
52
  return setSelctedAbilitys(__spreadArray(__spreadArray([], __read(selctedAbilitys.filter(function (v) { return v !== token; })), false), __read((checked ? [token] : [])), false));
52
53
  };
53
- return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Paper, __assign({ variant: "outlined" }, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ sx: { pl: 2, width: 240, height: 54, display: 'flex', alignItems: 'center', position: 'relative' } }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Checkbox, { onChange: handleChange, label: (0, jsx_runtime_1.jsx)(AiAbilityLable, { name: name, detail: detail }), checked: selctedAbilitys.includes(token),
54
- // @ts-ignore
55
- sx: { width: 1, height: 1 } }), isNew && (0, jsx_runtime_1.jsx)(styled_1.NewBadge, { src: "//webcdn.fbmms.cn/assets/XXRf/bdUI9qZoTx-l2k_OHTotn" })] })) })));
54
+ return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Paper, __assign({ variant: "outlined" }, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ sx: { pl: 2, width: 240, height: 54, display: 'flex', alignItems: 'center', position: 'relative' } }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Checkbox, { onChange: handleChange, label: (0, jsx_runtime_1.jsx)(MemoAiAbilityLable, { name: name, detail: detail }), checked: selctedAbilitys.includes(token), sx: { width: 1, height: 1 } }), isNew && (0, jsx_runtime_1.jsx)(styled_1.NewBadge, { src: "//webcdn.fbmms.cn/assets/XXRf/bdUI9qZoTx-l2k_OHTotn" })] })) })));
56
55
  };
57
56
  var AiAbilityLable = function (_a) {
58
57
  var name = _a.name, detail = _a.detail;
@@ -60,4 +59,5 @@ var AiAbilityLable = function (_a) {
60
59
  return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Popover, __assign({ content: (0, jsx_runtime_1.jsx)(AiAbilityDetail_1.default, { detail: detail }), trigger: "hover", placement: "right" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ noWrap: true, maxWidth: 180, variant: "body2", sx: { mt: 0.5 } }, { children: name })) })));
61
60
  return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ noWrap: true, maxWidth: 180, variant: "body2" }, { children: name })));
62
61
  };
63
- exports.default = AiAbilityItem;
62
+ var MemoAiAbilityLable = (0, react_1.memo)(AiAbilityLable);
63
+ exports.default = (0, react_1.memo)(AiAbilityItem);
@@ -16,9 +16,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  var jsx_runtime_1 = require("react/jsx-runtime");
18
18
  var AiAbilityItem_1 = __importDefault(require("../AiAbilityItem"));
19
- var fbm_ui_1 = require("fbm-ui");
19
+ var react_virtualized_auto_sizer_1 = __importDefault(require("react-virtualized-auto-sizer"));
20
+ var react_window_1 = require("react-window");
21
+ var Cell = function (_a) {
22
+ var data = _a.data, columnIndex = _a.columnIndex, rowIndex = _a.rowIndex, style = _a.style;
23
+ var item = data[rowIndex * 3 + columnIndex];
24
+ if (!item) {
25
+ return null;
26
+ }
27
+ return ((0, jsx_runtime_1.jsx)("div", __assign({ style: __assign(__assign({}, style), { width: style.width - 8, height: style.height - 8 }) }, { children: (0, jsx_runtime_1.jsx)(AiAbilityItem_1.default, __assign({}, item)) })));
28
+ };
20
29
  var AiAbilityList = function (_a) {
21
30
  var items = _a.items;
22
- return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Grid, __assign({ container: true, spacing: 1, rowSpacing: 1, columnSpacing: 1 }, { children: items === null || items === void 0 ? void 0 : items.map(function (item) { return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Grid, __assign({ item: true }, { children: (0, jsx_runtime_1.jsx)(AiAbilityItem_1.default, __assign({}, item)) }), item.token)); }) })));
31
+ return ((0, jsx_runtime_1.jsx)(react_virtualized_auto_sizer_1.default, { children: function (_a) {
32
+ var height = _a.height, width = _a.width;
33
+ return ((0, jsx_runtime_1.jsx)(react_window_1.FixedSizeGrid, __assign({ columnCount: 3, columnWidth: 240, overscanRowCount: 10, height: height, rowCount: Math.ceil(items.length / 3), rowHeight: 62, width: width, itemData: items }, { children: Cell })));
34
+ } }));
23
35
  };
24
36
  exports.default = AiAbilityList;
@@ -43,7 +43,7 @@ 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, _f = props.isOem, isOem = _f === void 0 ? false : _f;
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, expanded = props.expanded, token = props.token, onExpandedChange = props.onExpandedChange;
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;
@@ -106,7 +106,7 @@ var BaseAccordion = function (props) {
106
106
  setQuestionsList(filterList);
107
107
  }
108
108
  }, [list, isShowOnlyAITest, isOem]);
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: {
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, expanded: expanded === token, onChange: onExpandedChange(token) }, { children: [(0, jsx_runtime_1.jsx)(mui_1.AccordionSummary, __assign({ expandIcon: (0, jsx_runtime_1.jsx)(icons_material_1.ExpandMore, {}), sx: {
110
110
  '&:after': {
111
111
  content: "".concat(isNew ? 'url(//webcdn.fbmms.cn/assets/XXRf/bdUI9qZoTx-l2k_OHTotn)' : '" "'),
112
112
  position: 'absolute',
@@ -115,13 +115,13 @@ var BaseAccordion = function (props) {
115
115
  width: 38,
116
116
  height: 16,
117
117
  },
118
- } }, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ flex: "1 0", display: "flex", justifyContent: "space-between", alignItems: "center", overflow: "hidden" }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ flex: "1 0", overflow: "hidden" }, { children: [(0, jsx_runtime_1.jsx)(styled_1.AccordionTitle, { children: positionName || name }), positionName && (0, jsx_runtime_1.jsxs)(styled_1.AccordionSubTitle, __assign({ color: "secondary" }, { children: ["\u6B65\u9AA4\uFF1A", name] }))] })), isShowSummaryAction && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ sx: { mr: 1, flexShrink: 0, height: 24 }, variant: "outlined", color: "inherit", size: "small", onClick: handleUseAllQuestion }, { children: "\u4F7F\u7528" })))] })) })), (0, jsx_runtime_1.jsxs)(mui_1.AccordionDetails, { children: [(0, jsx_runtime_1.jsx)(mui_1.List, __assign({ ref: ref }, { children: questionsList.map(function (item) {
118
+ } }, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ flex: "1 0", display: "flex", justifyContent: "space-between", alignItems: "center", overflow: "hidden" }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ flex: "1 0", overflow: "hidden" }, { children: [(0, jsx_runtime_1.jsx)(styled_1.AccordionTitle, { children: positionName || name }), positionName && (0, jsx_runtime_1.jsxs)(styled_1.AccordionSubTitle, __assign({ color: "secondary" }, { children: ["\u6B65\u9AA4\uFF1A", name] }))] })), isShowSummaryAction && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ sx: { mr: 1, flexShrink: 0, height: 24 }, variant: "outlined", color: "inherit", size: "small", onClick: handleUseAllQuestion }, { children: "\u4F7F\u7528" })))] })) })), expanded === token && ((0, jsx_runtime_1.jsxs)(mui_1.AccordionDetails, { children: [(0, jsx_runtime_1.jsx)(mui_1.List, __assign({ ref: ref }, { children: questionsList.map(function (item) {
119
119
  var token = item.token, name = item.name, category = item.category;
120
120
  var isUsed = questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.steps.find(function (step) { return step.originToken === token; });
121
121
  return ((0, jsx_runtime_1.jsx)(mui_1.ListItem, __assign({ secondaryAction: [
122
122
  isUsed && (0, jsx_runtime_1.jsx)(icons_material_1.Done, {}, "icon"),
123
123
  (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ className: "secondary-action-buttons" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "outlined", color: "inherit", size: "small", onClick: function () { return handleUseQuestion(item); } }, { children: "\u4F7F\u7528" })) }), "buttons"),
124
124
  ], onMouseOver: function () { return handleMouseOver(item); } }, { children: (0, jsx_runtime_1.jsx)(mui_1.ListItemText, { primary: name, secondary: isShowDesc && category ? category[0] : '' }) }), token));
125
- }) })), isPaging && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "text", sx: { width: '100%', justifyContent: 'start', color: '#576B95' }, onClick: handleShowAll }, { children: "\u5C55\u793A\u5168\u90E8" })))] })] })) })) }));
125
+ }) })), isPaging && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "text", sx: { width: '100%', justifyContent: 'start', color: '#576B95' }, onClick: handleShowAll }, { children: "\u5C55\u793A\u5168\u90E8" })))] }))] })) })) }));
126
126
  };
127
127
  exports.default = (0, react_1.memo)(BaseAccordion);
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { AiEvaluationDataList } from '../QuestionTemplate/interface';
2
3
  export interface BaseAccordionProps extends AiEvaluationDataList {
3
4
  index?: number;
@@ -7,4 +8,6 @@ export interface BaseAccordionProps extends AiEvaluationDataList {
7
8
  isShowSummaryAction?: boolean;
8
9
  isShowConfirm?: boolean;
9
10
  isOem?: boolean;
11
+ expanded: string | false;
12
+ onExpandedChange: (panel: string) => (event: React.SyntheticEvent, expanded: boolean) => void;
10
13
  }
@@ -64,6 +64,10 @@ var AiEvaluation = function (_a) {
64
64
  showOnlyAITest: false,
65
65
  }), 2), state = _b[0], setState = _b[1];
66
66
  var addQuestionOpen = state.addQuestionOpen, showOnlyAITest = state.showOnlyAITest;
67
+ var _c = __read((0, react_1.useState)(false), 2), expanded = _c[0], setExpanded = _c[1];
68
+ var handleExpandedChange = function (panel) { return function (event, isExpanded) {
69
+ setExpanded(isExpanded ? panel : false);
70
+ }; };
67
71
  var handleClickAdd = (0, react_1.useCallback)(function (aiShowType) {
68
72
  setState({ addQuestionOpen: false });
69
73
  updateQuestionState({
@@ -82,7 +86,7 @@ var AiEvaluation = function (_a) {
82
86
  var name = _a.name, list = _a.list;
83
87
  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
88
  .filter(function (v) { return !isEdit || !v.isNew || selctedAbilitys.includes(v.token); })
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.token)); })] }, name));
89
+ .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, expanded: expanded, onExpandedChange: handleExpandedChange }, item), item.token)); })] }, name));
86
90
  })] }));
87
91
  };
88
92
  exports.default = AiEvaluation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eli-video-interview",
3
- "version": "1.2.42-alpha.40",
3
+ "version": "1.2.42-alpha.42",
4
4
  "description": "鳄梨科技 AI视频面试 React SDK",
5
5
  "author": "鳄梨科技",
6
6
  "license": "MIT",
@@ -30,7 +30,9 @@
30
30
  "sortablejs": "^1.15.0",
31
31
  "typescript": "^4.7.2",
32
32
  "use-immer": "^0.7.0",
33
- "yup": "^1.3.3"
33
+ "yup": "^1.3.3",
34
+ "react-window":"1.8.10",
35
+ "react-virtualized-auto-sizer":"1.0.5"
34
36
  },
35
37
  "devDependencies": {
36
38
  "@types/jest": "^27.5.1",