eli-video-interview 1.2.3-5.alpha.1 → 1.2.3-5.alpha.11

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 (82) hide show
  1. package/README.md +1 -0
  2. package/esm/constants/ai-question.js +1 -1
  3. package/esm/modules/ai-ability-select/Root.js +9 -4
  4. package/esm/modules/ai-ability-select/components/AiAbilityItem/index.d.ts +2 -2
  5. package/esm/modules/ai-ability-select/components/AiAbilityItem/index.js +9 -7
  6. package/esm/modules/ai-ability-select/interface.d.ts +5 -0
  7. package/esm/modules/ai-question/Root.js +1 -1
  8. package/esm/modules/ai-question/components/BaseAccordion/index.d.ts +1 -1
  9. package/esm/modules/ai-question/components/BaseAccordion/index.js +22 -13
  10. package/esm/modules/ai-question/components/BootVideo/index.js +3 -3
  11. package/esm/modules/ai-question/components/QuestionModel/Item.js +4 -4
  12. package/esm/modules/ai-question/components/QuestionModel/List.js +10 -7
  13. package/esm/modules/ai-question/components/QuestionPreview/index.js +5 -5
  14. package/esm/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +7 -2
  15. package/esm/modules/ai-question/components/QuestionTemplate/index.js +7 -3
  16. package/esm/modules/ai-question/components/QuestionTemplate/interface.d.ts +2 -1
  17. package/esm/modules/ai-question/components/QuestionUpdate/Form.js +50 -9
  18. package/esm/modules/ai-question/components/QuestionUpdate/RandomQuestion.js +5 -7
  19. package/esm/modules/ai-question/components/QuestionUpdate/SelectQuestion.js +11 -1
  20. package/esm/modules/ai-question/components/QuestionUpdate/const.js +1 -0
  21. package/esm/modules/ai-question/components/QuestionUpdate/index.js +12 -6
  22. package/esm/modules/ai-question/components/QuestionUpdate/interface.d.ts +2 -0
  23. package/esm/modules/ai-template/Root.js +32 -10
  24. package/esm/modules/ai-template/components/CapabilityModel/index.js +1 -1
  25. package/esm/modules/ai-template/components/QuestionList/Item.d.ts +2 -2
  26. package/esm/modules/ai-template/components/QuestionList/Item.js +28 -7
  27. package/esm/modules/ai-template/components/QuestionList/index.d.ts +2 -1
  28. package/esm/modules/ai-template/components/QuestionList/index.js +15 -4
  29. package/esm/modules/ai-template/components/QuestionList/interface.d.ts +6 -1
  30. package/esm/modules/ai-template/components/TemplateList/index.js +4 -4
  31. package/esm/modules/ai-template/index.js +2 -2
  32. package/esm/modules/ai-template/interface.d.ts +2 -0
  33. package/esm/services/ai-ability.js +1 -1
  34. package/esm/store/ai-ability-select/question-ability-store.d.ts +3 -0
  35. package/esm/store/ai-ability-select/question-ability-store.js +9 -1
  36. package/esm/store/ai-question/question-model-store.d.ts +3 -0
  37. package/esm/store/ai-question/question-model-store.js +5 -3
  38. package/esm/store/ai-template/global-store.d.ts +3 -0
  39. package/esm/store/ai-template/global-store.js +3 -3
  40. package/esm/store/enterprise/enterprise-store.d.ts +29 -0
  41. package/esm/store/enterprise/enterprise-store.js +13 -0
  42. package/lib/constants/ai-question.js +1 -1
  43. package/lib/modules/ai-ability-select/Root.js +9 -4
  44. package/lib/modules/ai-ability-select/components/AiAbilityItem/index.d.ts +2 -2
  45. package/lib/modules/ai-ability-select/components/AiAbilityItem/index.js +9 -7
  46. package/lib/modules/ai-ability-select/interface.d.ts +5 -0
  47. package/lib/modules/ai-question/Root.js +1 -1
  48. package/lib/modules/ai-question/components/BaseAccordion/index.d.ts +1 -1
  49. package/lib/modules/ai-question/components/BaseAccordion/index.js +22 -13
  50. package/lib/modules/ai-question/components/BootVideo/index.js +2 -2
  51. package/lib/modules/ai-question/components/QuestionModel/Item.js +3 -3
  52. package/lib/modules/ai-question/components/QuestionModel/List.js +10 -7
  53. package/lib/modules/ai-question/components/QuestionPreview/index.js +5 -5
  54. package/lib/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +6 -1
  55. package/lib/modules/ai-question/components/QuestionTemplate/index.js +7 -3
  56. package/lib/modules/ai-question/components/QuestionTemplate/interface.d.ts +2 -1
  57. package/lib/modules/ai-question/components/QuestionUpdate/Form.js +49 -8
  58. package/lib/modules/ai-question/components/QuestionUpdate/RandomQuestion.js +4 -6
  59. package/lib/modules/ai-question/components/QuestionUpdate/SelectQuestion.js +11 -1
  60. package/lib/modules/ai-question/components/QuestionUpdate/const.js +1 -0
  61. package/lib/modules/ai-question/components/QuestionUpdate/index.js +12 -6
  62. package/lib/modules/ai-question/components/QuestionUpdate/interface.d.ts +2 -0
  63. package/lib/modules/ai-template/Root.js +32 -10
  64. package/lib/modules/ai-template/components/CapabilityModel/index.js +1 -1
  65. package/lib/modules/ai-template/components/QuestionList/Item.d.ts +2 -2
  66. package/lib/modules/ai-template/components/QuestionList/Item.js +27 -6
  67. package/lib/modules/ai-template/components/QuestionList/index.d.ts +2 -1
  68. package/lib/modules/ai-template/components/QuestionList/index.js +15 -4
  69. package/lib/modules/ai-template/components/QuestionList/interface.d.ts +6 -1
  70. package/lib/modules/ai-template/components/TemplateList/index.js +4 -4
  71. package/lib/modules/ai-template/index.js +2 -2
  72. package/lib/modules/ai-template/interface.d.ts +2 -0
  73. package/lib/services/ai-ability.js +1 -1
  74. package/lib/store/ai-ability-select/question-ability-store.d.ts +3 -0
  75. package/lib/store/ai-ability-select/question-ability-store.js +8 -0
  76. package/lib/store/ai-question/question-model-store.d.ts +3 -0
  77. package/lib/store/ai-question/question-model-store.js +5 -3
  78. package/lib/store/ai-template/global-store.d.ts +3 -0
  79. package/lib/store/ai-template/global-store.js +3 -3
  80. package/lib/store/enterprise/enterprise-store.d.ts +29 -0
  81. package/lib/store/enterprise/enterprise-store.js +16 -0
  82. package/package.json +1 -1
package/README.md CHANGED
@@ -110,6 +110,7 @@ return (
110
110
  | desc | 题目描述 | string |
111
111
  | prepareTime | 准备时长 | number |
112
112
  | duration | 回答时长 | number |
113
+ | minResponseDuration | 最少回答时长 | number |
113
114
  | category | 标签信息 | string[] |
114
115
  | [broadcastType](#题目播报类型) | 题目播报类型 | number |
115
116
  | [aiSwitch](#题目是否开启ai分析) | 题目是否开启AI分析 | number |
@@ -10,7 +10,7 @@ export var ADD_QUESTION_TYPE_LIST = [
10
10
  },
11
11
  {
12
12
  type: LANGUAGE,
13
- title: '语言能力题',
13
+ title: '朗读题',
14
14
  desc: '候选人根据所提供的文案进行朗读。',
15
15
  },
16
16
  ];
@@ -13,6 +13,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import AiAbilityList from './components/AiAbilityList';
14
14
  import { GetAiAbilityList } from "../../services/ai-ability";
15
15
  import { useAiAbilityListStore } from "../../store/ai-ability-select/question-ability-store";
16
+ import { useEnterpriseStore } from "../../store/enterprise/enterprise-store";
16
17
  import ScrollDialogContent from "../../components/ScrollDialogContent";
17
18
  import { useRequest } from 'ahooks';
18
19
  import { Box, Typography } from 'fbm-ui';
@@ -20,16 +21,20 @@ import { Stack } from 'fbm-ui/lib/mui';
20
21
  import { forwardRef, memo, useEffect } from 'react';
21
22
  var AiAbilitySelectRoot = forwardRef(function (_a, ref) {
22
23
  var jobToken = _a.jobToken, thirdToken = _a.thirdToken;
23
- var _b = useAiAbilityListStore(), aiAbilityList = _b.aiAbilityList, setAiAbilityList = _b.setAiAbilityList, selctedAbilitys = _b.selctedAbilitys;
24
+ var _b = useAiAbilityListStore(), aiAbilityList = _b.aiAbilityList, setSpecialAiAbilityList = _b.setSpecialAiAbilityList;
25
+ var setEnterprise = useEnterpriseStore().setEnterprise;
24
26
  var data = useRequest(function () { return GetAiAbilityList({ jobToken: jobToken, thirdToken: thirdToken }); }, {
25
27
  refreshDeps: [jobToken, thirdToken],
26
28
  }).data;
27
29
  useEffect(function () {
28
- setAiAbilityList((data === null || data === void 0 ? void 0 : data.data.list) || []);
30
+ setSpecialAiAbilityList((data === null || data === void 0 ? void 0 : data.data.list) || []);
29
31
  // eslint-disable-next-line react-hooks/exhaustive-deps
30
32
  }, [data]);
31
- console.log(selctedAbilitys);
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 })] })) })));
33
+ useEffect(function () {
34
+ setEnterprise({ jobToken: jobToken, thirdToken: thirdToken });
35
+ // eslint-disable-next-line react-hooks/exhaustive-deps
36
+ }, [jobToken, thirdToken]);
37
+ 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" })), (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 })] })) })));
33
38
  });
34
39
  AiAbilitySelectRoot.displayName = 'AiAbilitySelectRoot';
35
40
  export default memo(AiAbilitySelectRoot);
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { AiAbilityItemProps } from './interface';
3
- declare const AiAbilityItemWrapper: React.FC<AiAbilityItemProps>;
4
- export default AiAbilityItemWrapper;
3
+ declare const AiAbilityItem: React.FC<AiAbilityItemProps>;
4
+ export default AiAbilityItem;
@@ -24,17 +24,19 @@ import { NewBadge } from './styled';
24
24
  import { useAiAbilityListStore } from "../../../../store/ai-ability-select/question-ability-store";
25
25
  import { Box, Checkbox, Paper, Popover, Typography } from 'fbm-ui';
26
26
  var AiAbilityItem = function (_a) {
27
- var name = _a.name, isNew = _a.isNew, token = _a.token;
27
+ var name = _a.name, isNew = _a.isNew, token = _a.token, detail = _a.detail;
28
28
  var _b = useAiAbilityListStore(), selctedAbilitys = _b.selctedAbilitys, setSelctedAbilitys = _b.setSelctedAbilitys;
29
29
  var handleChange = function (_, checked) {
30
30
  return setSelctedAbilitys(__spreadArray(__spreadArray([], selctedAbilitys.filter(function (v) { return v !== token; }), true), (checked ? [token] : []), true));
31
31
  };
32
- 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(Typography, __assign({ noWrap: true, maxWidth: 180, variant: "body2" }, { children: name })), checked: selctedAbilitys.includes(token) }), isNew && _jsx(NewBadge, { src: "//webcdn.fbmms.cn/assets/XXRf/bdUI9qZoTx-l2k_OHTotn" })] })) })));
32
+ 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),
33
+ // @ts-ignore
34
+ sx: { width: 1, height: 1 } }), isNew && _jsx(NewBadge, { src: "//webcdn.fbmms.cn/assets/XXRf/bdUI9qZoTx-l2k_OHTotn" })] })) })));
33
35
  };
34
- var AiAbilityItemWrapper = function (props) {
35
- var detail = props.detail;
36
+ var AiAbilityLable = function (_a) {
37
+ var name = _a.name, detail = _a.detail;
36
38
  if ((detail === null || detail === void 0 ? void 0 : detail.length) > 0)
37
- return (_jsx(Popover, __assign({ content: _jsx(AiAbilityDetail, { detail: detail }), trigger: "hover", placement: "right" }, { children: _jsx(AiAbilityItem, __assign({}, props)) })));
38
- return _jsx(AiAbilityItem, __assign({}, props));
39
+ 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 })) })));
40
+ return (_jsx(Typography, __assign({ noWrap: true, maxWidth: 180, variant: "body2" }, { children: name })));
39
41
  };
40
- export default AiAbilityItemWrapper;
42
+ export default AiAbilityItem;
@@ -12,9 +12,14 @@ export interface AiAbilityDetail {
12
12
  }
13
13
  export interface AiAbility extends AiAbilityDetail {
14
14
  name: string;
15
+ tag: string;
16
+ isWorkplace: boolean;
17
+ define: string;
15
18
  isNew?: boolean;
19
+ isAI?: boolean;
16
20
  token: string;
17
21
  selected?: boolean;
22
+ type: number;
18
23
  }
19
24
  export declare type AiAbilityItemProps = AiAbility;
20
25
  export interface AiAbilityListData {
@@ -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, { extraAbilityTokens: selctedAbilitys }) }))] })));
151
+ } }, { children: _jsx(QuestionTemplate, {}) }))] })));
152
152
  });
153
153
  AiQuestionRoot.displayName = 'AiQuestionRoot';
154
154
  export default memo(AiQuestionRoot);
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
1
  import { BaseAccordionProps } from './interface';
2
+ import React from 'react';
3
3
  declare const _default: React.NamedExoticComponent<BaseAccordionProps>;
4
4
  export default _default;
@@ -10,29 +10,29 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
- import { memo, useCallback, useEffect, useRef, useState } from 'react';
14
- import { Box, Button, confirm } from 'fbm-ui';
15
- import { Accordion, AccordionDetails, AccordionSummary, List, ListItem, ListItemText } from 'fbm-ui/lib/mui';
16
- import { useDebounceFn, useHover } from 'ahooks';
13
+ import { defaultQuestionParams } from '../QuestionUpdate/const';
14
+ import { MAX_DISPLAY_SIZE } from './const';
15
+ import { AccordionRoot, AccordionSubTitle, AccordionTitle } from './styled';
17
16
  import { IS_AI_ANALYSIS } from "../../../../constants/ai-question";
18
17
  import { LANGUAGE_TYPE } from "../../../../enum/ai-question";
19
18
  import { Done, ExpandMore } from '@mui/icons-material';
20
19
  import { useQuestionModelStore } from "../../../../store/ai-question/question-model-store";
21
20
  import { useQuestionPreviewStore } from "../../../../store/ai-question/question-preview-store";
22
21
  import { uniqueId } from "../../../../utils/utils";
23
- import { defaultQuestionParams } from '../QuestionUpdate/const';
24
- import { MAX_DISPLAY_SIZE } from './const';
25
- import { AccordionRoot, AccordionSubTitle, AccordionTitle } from './styled';
22
+ import { useDebounceFn, useHover } from 'ahooks';
23
+ import { Box, Button, confirm } from 'fbm-ui';
24
+ import { Accordion, AccordionDetails, AccordionSummary, List, ListItem, ListItemText } from 'fbm-ui/lib/mui';
25
+ import { memo, useCallback, useEffect, useRef, useState } from 'react';
26
26
  var LANGUAGE_TYPE_LIST = [LANGUAGE_TYPE.MANDARIN, LANGUAGE_TYPE.CANTONESE, LANGUAGE_TYPE.JAPANESE, LANGUAGE_TYPE.ENGLISH];
27
27
  var BaseAccordion = function (props) {
28
- 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;
28
+ 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;
29
29
  var ref = useRef(null);
30
30
  var isHovering = useHover(ref);
31
31
  var updatePreview = useQuestionPreviewStore().updatePreview;
32
- var _e = useQuestionModelStore(), questionModelData = _e.questionModelData, addModel = _e.addModel;
33
- var _f = useState(false), isPaging = _f[0], setIsPaging = _f[1];
34
- var _g = useState([]), questionsList = _g[0], setQuestionsList = _g[1];
35
- var _h = useState(), hoverItem = _h[0], setHoverItem = _h[1];
32
+ var _f = useQuestionModelStore(), questionModelData = _f.questionModelData, addModel = _f.addModel;
33
+ var _g = useState(false), isPaging = _g[0], setIsPaging = _g[1];
34
+ var _h = useState([]), questionsList = _h[0], setQuestionsList = _h[1];
35
+ var _j = useState(), hoverItem = _j[0], setHoverItem = _j[1];
36
36
  var handlePreview = useDebounceFn(function () {
37
37
  isShowPreview && updatePreview(isHovering, isHovering ? hoverItem : undefined);
38
38
  }, {
@@ -86,7 +86,16 @@ var BaseAccordion = function (props) {
86
86
  setQuestionsList(filterList);
87
87
  }
88
88
  }, [list, isShowOnlyAITest]);
89
- return (_jsx(_Fragment, { children: questionsList.length > 0 && (_jsx(AccordionRoot, { children: _jsxs(Accordion, __assign({ defaultExpanded: index === 0 }, { children: [_jsx(AccordionSummary, __assign({ expandIcon: _jsx(ExpandMore, {}) }, { 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) {
89
+ return (_jsx(_Fragment, { children: questionsList.length > 0 && (_jsx(AccordionRoot, { children: _jsxs(Accordion, __assign({ defaultExpanded: index === 0 }, { children: [_jsx(AccordionSummary, __assign({ expandIcon: _jsx(ExpandMore, {}), sx: {
90
+ '&:after': {
91
+ content: "".concat(isNew ? 'url(//webcdn.fbmms.cn/assets/XXRf/bdUI9qZoTx-l2k_OHTotn)' : '" "'),
92
+ position: 'absolute',
93
+ top: -1,
94
+ right: 0,
95
+ width: 38,
96
+ height: 16,
97
+ },
98
+ } }, { 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) {
90
99
  var token = item.token, name = item.name, category = item.category;
91
100
  var isUsed = questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.steps.find(function (step) { return step.originToken === token; });
92
101
  return (_jsx(ListItem, __assign({ secondaryAction: [
@@ -27,7 +27,7 @@ import { PostCommonUpload } from "../../../../services/ai-question";
27
27
  import { useBootVideoStore } from "../../../../store/ai-question/boot-video-store";
28
28
  import { isExceedMaxVideoFileSize } from "../../../../utils/utils";
29
29
  import { useRequest, useSetState } from 'ahooks';
30
- import { AddIcon, Box, Button, Checkbox, Dialog, InfoIcon, Message, Radio, RadioGroup, Tooltip, Typography, Upload } from 'fbm-ui';
30
+ import { AddIcon, Box, Button, Checkbox, Dialog, Message, Radio, RadioGroup, Typography, Upload } from 'fbm-ui';
31
31
  import { Stack } from 'fbm-ui/lib/mui';
32
32
  import { useCallback, useEffect, useState } from 'react';
33
33
  var BootVideo = function (props) {
@@ -105,9 +105,9 @@ var BootVideo = function (props) {
105
105
  }
106
106
  // eslint-disable-next-line react-hooks/exhaustive-deps
107
107
  }, [open]);
108
- return (_jsx(Dialog, __assign({ open: open, title: "\u5B9A\u5236\u9762\u8BD5\u95F4", onClose: onClose, onOk: handleOk, width: 768 }, { children: _jsx(ScrollDialogContent, { children: _jsxs(Box, __assign({ sx: { display: 'flex', justifyContent: 'space-between' } }, { children: [_jsxs(Stack, { children: [_jsx(Typography, __assign({ variant: "body1", fontWeight: 500 }, { children: "\u9762\u8BD5\u95F4\u4E92\u52A8\u65B9\u5F0F" })), _jsx(RadioGroup, __assign({ defaultValue: "outlined", value: 1 }, { children: _jsx(Radio, { value: "1", label: "\u4F20\u7EDF\u8BFB\u9898\u6A21\u5F0F" }) })), _jsx(Typography, __assign({ variant: "body1", fontWeight: 500, mt: 3, mb: 2 }, { children: "\u5F15\u5BFC\u89C6\u9891" })), _jsx(CustomUploadedImgRoot, { children: mediaList.map(function (_a) {
108
+ return (_jsx(Dialog, __assign({ open: open, title: "\u5B9A\u5236\u9762\u8BD5\u95F4", okText: "\u4FDD\u5B58", onClose: onClose, onOk: handleOk, width: 768 }, { children: _jsx(ScrollDialogContent, { children: _jsxs(Box, __assign({ sx: { display: 'flex', justifyContent: 'space-between' } }, { children: [_jsxs(Stack, { children: [_jsx(Typography, __assign({ variant: "body1", fontWeight: 500 }, { children: "\u9762\u8BD5\u95F4\u4E92\u52A8\u65B9\u5F0F" })), _jsx(RadioGroup, __assign({ defaultValue: "outlined", value: 1 }, { children: _jsx(Radio, { value: "1", label: "\u4F20\u7EDF\u8BFB\u9898\u6A21\u5F0F" }) })), _jsx(Typography, __assign({ variant: "body1", fontWeight: 500, mt: 3, mb: 1 }, { children: "\u5F15\u5BFC\u89C6\u9891" })), _jsx(CustomUploadedImgRoot, { children: mediaList.map(function (_a) {
109
109
  var videoUrl = _a.videoUrl, frameUrl = _a.frameUrl;
110
110
  return (_jsx("img", { src: frameUrl, style: { borderColor: (mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaUrl) === videoUrl ? '#4CAF50' : 'transparent' }, height: 100, alt: "", onClick: function () { return handleSelectVideo(videoUrl, frameUrl); } }, videoUrl));
111
- }) }), _jsx(Typography, __assign({ variant: "caption", flexWrap: "wrap", width: 344, color: "text.disabled", mb: 2, mt: 1 }, { children: "\u5EFA\u8BAE\u4E0A\u4F20mp4\u683C\u5F0F\uFF0C\u5927\u5C0F\u4E0D\u8981\u8D85\u8FC7500M\uFF0C\u6700\u591A\u652F\u6301\u4E0A\u4F205\u4E2A\uFF0C\u652F\u6301\u89C6\u9891\u683C\u5F0F\uFF1Amp4\u3001mov\u3001m4v\u30013gp\u3001avi\u3001webm" })), _jsxs(Stack, __assign({ direction: "row", alignItems: "center" }, { children: [_jsxs(CustomUploadButtonRoot, { children: [_jsx(Upload, __assign({}, uploadProps, { children: _jsx(Button, __assign({ variant: "outlined", color: "inherit", icon: _jsx(AddIcon, {}) }, { children: "\u4E0A\u4F20\u89C6\u9891" })) })), _jsx(Tooltip, __assign({ title: "\u8BF7\u52FF\u4E0A\u4F20\u8272\u60C5\u53CA\u53CD\u52A8\u8FDD\u89C4\u89C6\u9891\uFF0C\u5EFA\u8BAE\u4F7F\u7528360\u6D4F\u89C8\u5668\u3002 \u5EFA\u8BAE\u4E0A\u4F20mp4\u683C\u5F0F\uFF0C\u5927\u5C0F\u4E0D\u8981\u8D85\u8FC7500M\uFF0C\u652F\u6301\u89C6\u9891\u683C\u5F0F\uFF1Amp4\u3001mov\u3001m4v\u30013gp\u3001avi\u3001webm\uFF0C\u652F\u6301\u7F16\u7801\u683C\u5F0F\uFF1AH.264\u3001HEV4\u3001 MPRG-4\u3001VP9" }, { children: _jsx("span", __assign({ style: { display: 'flex', alignItems: 'center', marginLeft: 8 } }, { children: _jsx(InfoIcon, { sx: { fontSize: 18, color: 'rgb(118, 118, 118)' } }) })) }))] }), _jsx(Box, __assign({ ml: 0.5 }, { children: _jsx(Checkbox, { checked: mediaState.appliedAllPosition, label: _jsx(Typography, __assign({ variant: "body2" }, { children: "\u5E94\u7528\u5230\u6240\u6709AI\u89C6\u9891" })), onChange: function (e, checked) { return setMediaState({ appliedAllPosition: checked }); } }) }))] }))] }), _jsx(Box, __assign({ sx: { maxHeight: 'calc(100vh - 150px)', overflow: 'auto', flexGrow: 1 } }, { children: (mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaUrl) || loading ? (_jsx(Box, __assign({ loading: loading, sx: { width: 160, height: 286, margin: 'auto', cursor: 'pointer' } }, { children: _jsx("video", { width: 160, height: 286, src: mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaUrl, controls: true }) }))) : (_jsx(Upload, __assign({}, uploadProps, { children: _jsxs(CustomUploadCardRoot, { children: [_jsxs(CustomUploadCardTitle, { children: [_jsx(SvgIcon, { name: "video" }), _jsx(Typography, __assign({ variant: "subtitle1", color: "secondary" }, { children: "\u4E0A\u4F20\u89C6\u9891" }))] }), _jsx(Typography, __assign({ variant: "caption", color: "disabled", sx: { mt: 1 } }, { children: "\u62D6\u62FD\u89C6\u9891\u5230\u6B64\u5904\u4E5F\u53EF\u4E0A\u4F20" }))] }) }))) }))] })) }) })));
111
+ }) }), _jsx(Typography, __assign({ variant: "caption", flexWrap: "wrap", width: 344, color: "text.disabled", mb: 1 }, { children: "\u5EFA\u8BAE\u4E0A\u4F20mp4\u683C\u5F0F\uFF0C\u5927\u5C0F\u4E0D\u8981\u8D85\u8FC7500M\uFF0C\u6700\u591A\u652F\u6301\u4E0A\u4F205\u4E2A\uFF0C\u652F\u6301\u89C6\u9891\u683C\u5F0F\uFF1Amp4\u3001mov\u3001m4v\u30013gp\u3001avi\u3001webm" })), _jsxs(Stack, __assign({ direction: "row", alignItems: "center" }, { children: [_jsx(CustomUploadButtonRoot, { children: _jsx(Upload, __assign({}, uploadProps, { children: _jsx(Button, __assign({ variant: "outlined", color: "inherit", icon: _jsx(AddIcon, {}) }, { children: "\u4E0A\u4F20\u89C6\u9891" })) })) }), _jsx(Box, __assign({ ml: 2 }, { children: _jsx(Checkbox, { checked: mediaState.appliedAllPosition, label: _jsx(Typography, __assign({ variant: "body2" }, { children: "\u5E94\u7528\u5230\u6240\u6709AI\u89C6\u9891" })), onChange: function (e, checked) { return setMediaState({ appliedAllPosition: checked }); } }) }))] }))] }), _jsx(Box, __assign({ sx: { maxHeight: 'calc(100vh - 150px)', overflow: 'auto', flexGrow: 1 } }, { children: (mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaUrl) || loading ? (_jsx(Box, __assign({ loading: loading, sx: { width: 160, height: 286, margin: 'auto', cursor: 'pointer' } }, { children: _jsx("video", { width: 160, height: 286, src: mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaUrl, controls: true }) }))) : (_jsx(Upload, __assign({}, uploadProps, { children: _jsxs(CustomUploadCardRoot, { children: [_jsxs(CustomUploadCardTitle, { children: [_jsx(SvgIcon, { name: "video" }), _jsx(Typography, __assign({ variant: "subtitle1", color: "secondary" }, { children: "\u4E0A\u4F20\u89C6\u9891" }))] }), _jsx(Typography, __assign({ variant: "caption", color: "disabled", sx: { mt: 1 } }, { children: "\u62D6\u62FD\u89C6\u9891\u5230\u6B64\u5904\u4E5F\u53EF\u4E0A\u4F20" }))] }) }))) }))] })) }) })));
112
112
  };
113
113
  export default BootVideo;
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  }
21
21
  return t;
22
22
  };
23
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
24
24
  import { DISABLED_REPEAT_TYPE, IS_AI_ANALYSIS, TEST_TYPE_READONLY } from "../../../../constants/ai-question";
25
25
  import { useQuestionModelStore } from "../../../../store/ai-question/question-model-store";
26
26
  import { useUpdateQuestionStore } from "../../../../store/ai-question/question-update-store";
@@ -68,12 +68,12 @@ 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", 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)); }) }))] })));
71
+ return (_jsxs(Stack, __assign({ direction: "row", spacing: 1 }, { children: [_jsx(Typography, __assign({ variant: "body2", color: "#F5C441", flexShrink: 0, fontWeight: 500 }, { children: "[\u5185\u5BB9\u968F\u673A]" })), _jsx(Stack, __assign({ spacing: 1 }, { children: questions.map(function (v, index) { return (_jsxs(Typography, __assign({ variant: "body2", color: "text.secondary" }, { children: ["\u2022\u00A0", v.content] }), index)); }) }))] })));
72
72
  }
73
73
  return questions.map(function (v) { return v.content; }).join('\n');
74
74
  }, [questions]);
75
- return (_jsxs(Paper, __assign({ variant: "outlined", sx: { display: 'block', mt: 2 } }, { children: [_jsxs(Box, __assign({ display: "flex", borderBottom: isAiAnalysis ? '1px solid rgba(0, 0, 0, 0.08)' : 'none' }, { children: [_jsx(Box, __assign({ width: 40, display: "flex", alignItems: "center", justifyContent: "center", sx: { cursor: 'move' } }, { children: _jsx(DragIndicatorIcon, { className: "dragHandle" }) })), _jsxs(Box, __assign({ flex: "1 0", padding: "16px 0" }, { children: [_jsxs(Box, __assign({ display: "flex", justifyContent: "space-between" }, { children: [_jsxs(Box, __assign({ flex: "1 0", display: "flex", alignItems: "center" }, { children: [_jsx(Typography, __assign({ variant: "subtitle1" }, { children: name })), category === null || category === void 0 ? void 0 : category.map(function (label) {
75
+ return (_jsxs(Paper, __assign({ variant: "outlined", sx: { display: 'block', mt: 2 } }, { children: [_jsxs(Box, __assign({ display: "flex", borderBottom: "1px solid rgba(0, 0, 0, 0.08)" }, { children: [_jsx(Box, __assign({ width: 40, display: "flex", alignItems: "center", justifyContent: "center", sx: { cursor: 'move' } }, { children: _jsx(DragIndicatorIcon, { className: "dragHandle" }) })), _jsxs(Box, __assign({ flex: "1 0", padding: "16px 0" }, { children: [_jsxs(Box, __assign({ display: "flex", justifyContent: "space-between" }, { children: [_jsxs(Box, __assign({ flex: "1 0", display: "flex", alignItems: "center" }, { children: [_jsx(Typography, __assign({ variant: "subtitle1" }, { children: name })), category === null || category === void 0 ? void 0 : category.map(function (label) {
76
76
  return label && (_jsx(Tooltip, __assign({ title: "".concat(label), placement: "bottom" }, { children: _jsx(Chip, { color: "default", label: label, size: "medium", sx: { ml: 1, maxWidth: '158px', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' } }, label) })));
77
- }), aiType === 2 && _jsx(Chip, { variant: "filled", color: "primary", label: "AI\u8BC4\u5206", size: "medium", sx: { ml: 1 } }), _jsx(Typography, __assign({ sx: { ml: 2 }, variant: "body2", color: "secondary" }, { children: getSecondToTime(Number(duration)) }))] })), _jsxs(Box, __assign({ width: 62, mr: 1, textAlign: "right" }, { children: [!TEST_TYPE_READONLY.includes(type) && (_jsx(IconButton, __assign({ size: "small", onClick: handleEdit }, { children: _jsx(EditIcon, {}) }))), _jsx(IconButton, __assign({ size: "small", onClick: handleRemove }, { children: _jsx(DeleteIcon, {}) }))] }))] })), _jsxs(Box, __assign({ mt: 1, pr: 2, display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: [_jsx(Typography, __assign({ variant: "body2", color: "secondary" }, { children: formatQuestion })), _jsxs(Typography, __assign({ sx: { ml: 2, flexShrink: 0 }, variant: "caption", color: "secondary", alignSelf: "flex-end" }, { children: ["\u56DE\u7B54\u65F6\u957F:\u00A0", getSecondToTime(Number(duration))] }))] }))] }))] })), isAiAnalysis && (_jsxs(Stack, __assign({ direction: "row", justifyContent: "space-between", spacing: 1 }, { children: [_jsxs(Box, __assign({ display: "flex", alignItems: "center", padding: "3px 0 3px 40px" }, { children: [_jsx(Typography, __assign({ variant: "body2" }, { children: "\u6743\u91CD\u5360\u6BD4\uFF1A" })), _jsx(Input, { sx: { width: 82 }, size: "small", value: weight, endAdornment: "%", disabled: disabledWeight, onChange: handleWeightChange, onBlur: handleWeightBlur }), _jsx(Tooltip, __assign({ title: "AI\u6D4B\u8BC4\u9898\u53EF\u4EE5\u8BBE\u7F6E\u6743\u91CD\uFF0C\u7CFB\u7EDF\u5BF9\u5019\u9009\u4EBA\u89C6\u9891\u9762\u8BD5\u7ED3\u679C\u4F1A\u52A0\u5165\u6743\u91CD\u8FDB\u884C\u8BA1\u7B97\uFF0C\u5F97\u51FAAI\u89C6\u9891\u9762\u8BD5\u5F97\u5206\u3002\u8BBE\u7F6E\u540E5\u5206\u949F\u8D77\u6548" }, { children: _jsx("span", __assign({ style: { display: 'flex', alignItems: 'center', marginLeft: '8px' } }, { children: _jsx(InfoIcon, { sx: { fontSize: 14, color: 'rgba(0, 0, 0, 0.26)' } }) })) }))] })), !DISABLED_REPEAT_TYPE.includes(type) && (_jsx(Stack, __assign({ direction: "row" }, { children: _jsx(Switch, { sx: { flexShrink: 0, ml: 2, mr: 2 }, size: "small", checked: answerStatus === 1, label: _jsx(Typography, __assign({ fontSize: 12, lineHeight: 1.5, color: "rgba(0, 0, 0, 0.56)" }, { children: "\u5141\u8BB8\u91CD\u590D\u7B54\u9898" })), onChange: handleAnswerStatus }) })))] })))] })));
77
+ }), aiType === 2 && _jsx(Chip, { variant: "filled", color: "primary", label: "AI\u8BC4\u5206", size: "medium", sx: { ml: 1 } })] })), _jsxs(Box, __assign({ width: 62, mr: 1, textAlign: "right" }, { children: [!TEST_TYPE_READONLY.includes(type) && (_jsx(IconButton, __assign({ size: "small", onClick: handleEdit }, { children: _jsx(EditIcon, {}) }))), _jsx(IconButton, __assign({ size: "small", onClick: handleRemove }, { children: _jsx(DeleteIcon, {}) }))] }))] })), _jsxs(Box, __assign({ mt: 1, pr: 2, display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: [_jsx(Typography, __assign({ variant: "body2", color: "secondary" }, { children: formatQuestion })), _jsxs(Typography, __assign({ sx: { ml: 2, flexShrink: 0 }, variant: "caption", color: "secondary", alignSelf: "flex-end" }, { children: ["\u56DE\u7B54\u65F6\u957F:\u00A0", getSecondToTime(Number(duration))] }))] }))] }))] })), _jsxs(Stack, __assign({ direction: "row", justifyContent: "space-between", spacing: 1, height: 42 }, { children: [_jsx(Box, __assign({ display: "flex", alignItems: "center", padding: "3px 0 3px 40px" }, { children: isAiAnalysis && (_jsxs(_Fragment, { children: [_jsx(Typography, __assign({ variant: "body2" }, { children: "\u6743\u91CD\u5360\u6BD4\uFF1A" })), _jsx(Input, { sx: { width: 92 }, size: "small", value: weight, endAdornment: _jsx(Typography, __assign({ variant: "caption", color: "textSecondary" }, { children: "%" })), disabled: disabledWeight, onChange: handleWeightChange, onBlur: handleWeightBlur }), _jsx(Tooltip, __assign({ title: "AI\u6D4B\u8BC4\u9898\u53EF\u4EE5\u8BBE\u7F6E\u6743\u91CD\uFF0C\u7CFB\u7EDF\u5BF9\u5019\u9009\u4EBA\u89C6\u9891\u9762\u8BD5\u7ED3\u679C\u4F1A\u52A0\u5165\u6743\u91CD\u8FDB\u884C\u8BA1\u7B97\uFF0C\u5F97\u51FAAI\u89C6\u9891\u9762\u8BD5\u5F97\u5206\u3002\u8BBE\u7F6E\u540E5\u5206\u949F\u8D77\u6548" }, { children: _jsx("span", __assign({ style: { display: 'flex', alignItems: 'center', marginLeft: '8px' } }, { children: _jsx(InfoIcon, { sx: { fontSize: 14, color: 'rgba(0, 0, 0, 0.26)' } }) })) }))] })) })), !DISABLED_REPEAT_TYPE.includes(type) && (_jsx(Stack, __assign({ direction: "row" }, { children: _jsx(Switch, { sx: { flexShrink: 0, ml: 2, mr: 2 }, size: "small", checked: answerStatus === 1, label: _jsx(Typography, __assign({ fontSize: 12, lineHeight: 1.5, color: "rgba(0, 0, 0, 0.56)" }, { children: "\u5141\u8BB8\u91CD\u590D\u7B54\u9898" })), onChange: handleAnswerStatus }) })))] }))] })));
78
78
  };
79
79
  export default memo(QuestionModelListItem);
@@ -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 (__assign(__assign({}, item[Math.floor(Math.random() * item.length)]), { weight: (100 / combineTokens.length).toFixed(2) })); }));
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: function () {
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;
@@ -19,13 +19,13 @@ import { Box, Typography } from 'fbm-ui';
19
19
  import { useEffect, useState } from 'react';
20
20
  var QuestionPreview = function () {
21
21
  var _a = useQuestionPreviewStore(), visible = _a.visible, previewItem = _a.previewItem;
22
- var _b = previewItem || {}, _c = _b.name, name = _c === void 0 ? '' : _c, _d = _b.type, type = _d === void 0 ? 1 : _d, _e = _b.broadcastType, broadcastType = _e === void 0 ? 1 : _e, _f = _b.desc, desc = _f === void 0 ? '' : _f, _g = _b.prepareTime, prepareTime = _g === void 0 ? 3 : _g, _h = _b.duration, duration = _h === void 0 ? 30 : _h, extra = _b.extra;
23
- var _j = useState(), values = _j[0], setValues = _j[1];
24
- var _k = useState('none'), display = _k[0], setDisplay = _k[1];
22
+ var _b = previewItem || {}, _c = _b.name, name = _c === void 0 ? '' : _c, _d = _b.type, type = _d === void 0 ? 1 : _d, _e = _b.broadcastType, broadcastType = _e === void 0 ? 1 : _e, _f = _b.desc, desc = _f === void 0 ? '' : _f, _g = _b.prepareTime, prepareTime = _g === void 0 ? 3 : _g, _h = _b.minResponseDuration, minResponseDuration = _h === void 0 ? 3 : _h, _j = _b.duration, duration = _j === void 0 ? 30 : _j, extra = _b.extra;
23
+ var _k = useState(), values = _k[0], setValues = _k[1];
24
+ var _l = useState('none'), display = _l[0], setDisplay = _l[1];
25
25
  useEffect(function () {
26
- setValues({ name: name, broadcastType: broadcastType, desc: desc, prepareTime: prepareTime, duration: duration, questions: [] });
26
+ setValues({ name: name, broadcastType: broadcastType, desc: desc, prepareTime: prepareTime, duration: duration, minResponseDuration: minResponseDuration, questions: [] });
27
27
  setDisplay(visible ? 'block' : 'none');
28
- }, [name, broadcastType, desc, prepareTime, duration, visible]);
28
+ }, [name, broadcastType, desc, prepareTime, duration, visible, minResponseDuration]);
29
29
  return (_jsx(PreviewRoot, __assign({ style: { display: display } }, { children: (extra === null || extra === void 0 ? void 0 : extra.icon) ? (_jsx("img", { src: extra === null || extra === void 0 ? void 0 : extra.icon, alt: "", style: { width: 250 } })) : (_jsxs(Box, __assign({ width: 500 }, { children: [_jsxs(Typography, __assign({ variant: "h5", textAlign: "center", mb: 3 }, { children: [QUESTION_TYPE_MAPPING_LABEL[type], "\uFF08\u9884\u89C8\uFF09"] })), values && _jsx(Form, { preview: true, aiShowType: ADD_QUESTION_TYPE.FREE, initialValues: values, values: values })] }))) })));
30
30
  };
31
31
  export default QuestionPreview;
@@ -12,11 +12,12 @@ var __assign = (this && this.__assign) || function () {
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import BaseAccordion from '../BaseAccordion';
14
14
  import { defaultQuestionParams } from '../QuestionUpdate/const';
15
+ import { useAiAbilityListStore } from "../../../../store/ai-ability-select/question-ability-store";
15
16
  import SvgIcon from "../../../../components/SvgIcon";
16
17
  import { ADD_QUESTION_TYPE_LIST } from "../../../../constants/ai-question";
17
18
  import { ADD_QUESTION_TYPE } from "../../../../enum/ai-question";
18
19
  import { useAiQuestionStore } from "../../../../store/ai-question/global-store";
19
- import { useQuestionModelStore } from "../../../../store/ai-question/question-model-store";
20
+ import { getQuestionModelStore, useQuestionModelStore } from "../../../../store/ai-question/question-model-store";
20
21
  import { useQuestionTemplateStore } from "../../../../store/ai-question/question-template-store";
21
22
  import { useUpdateQuestionStore } from "../../../../store/ai-question/question-update-store";
22
23
  import { uniqueId } from "../../../../utils/utils";
@@ -28,6 +29,8 @@ var AiEvaluation = function () {
28
29
  var onOpenTemplate = useAiQuestionStore(function (store) { return [store.onOpenTemplate]; }).onOpenTemplate;
29
30
  var updateQuestionState = useUpdateQuestionStore(function (store) { return [store.updateQuestionState]; }).updateQuestionState;
30
31
  var questionModelData = useQuestionModelStore(function (store) { return [store.questionModelData]; }).questionModelData;
32
+ var isEdit = (getQuestionModelStore() || {}).isEdit;
33
+ var selctedAbilitys = useAiAbilityListStore().selctedAbilitys;
31
34
  var aiEvaluationData = useQuestionTemplateStore(function (store) { return [store.aiEvaluationData]; }).aiEvaluationData;
32
35
  var _a = useSetState({
33
36
  addQuestionOpen: false,
@@ -44,7 +47,9 @@ var AiEvaluation = function () {
44
47
  }) }));
45
48
  return (_jsxs(Box, { children: [_jsxs(Box, __assign({ display: "flex", justifyContent: "space-between", alignItems: "center", mb: 2 }, { children: [_jsx(Button, __assign({ variant: "outlined", color: "inherit", icon: _jsx(LayerOutlineIcon, {}), onClick: function () { return onOpenTemplate === null || onOpenTemplate === void 0 ? void 0 : onOpenTemplate(questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.steps); } }, { children: "\u5C97\u4F4D\u6A21\u7248\u5E93" })), _jsx(Popover, __assign({ open: addQuestionOpen, arrow: false, content: content, onClickAway: function () { return setState({ addQuestionOpen: false }); } }, { children: _jsx(Button, __assign({ variant: "outlined", icon: _jsx(AddIcon, {}), onClick: function () { return setState({ addQuestionOpen: true }); } }, { children: "\u81EA\u5B9A\u4E49\u9898\u76EE" })) }))] })), aiEvaluationData.map(function (_a, index) {
46
49
  var name = _a.name, list = _a.list;
47
- return (_jsxs(Box, { children: [_jsx(Typography, __assign({ fontSize: 12, lineHeight: 1.5, weight: "500", mb: 2 }, { children: name })), list.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));
50
+ return (_jsxs(Box, { children: [_jsx(Typography, __assign({ fontSize: 12, lineHeight: 1.5, weight: "500", mb: 2 }, { children: name })), list
51
+ .filter(function (v) { return !isEdit || !v.isNew || selctedAbilitys.includes(v.token); })
52
+ .map(function (item, i) { return (_jsx(BaseAccordion, __assign({ index: i, isShowOnlyAITest: showOnlyAITest, isShowDesc: index !== 0, isShowSummaryAction: index !== 0, isShowConfirm: index !== 0 }, item), item.name + i)); })] }, name));
48
53
  })] }));
49
54
  };
50
55
  export default AiEvaluation;
@@ -12,15 +12,19 @@ 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";
16
+ import { useEnterpriseStore } from "../../../../store/enterprise/enterprise-store";
15
17
  import { PostAiModelQuestions } from "../../../../services/ai-question";
16
18
  import { useQuestionTemplateStore } from "../../../../store/ai-question/question-template-store";
17
19
  import { useRequest } from 'ahooks';
18
20
  import { Box } from 'fbm-ui';
19
- var QuestionTemplate = function (_a) {
20
- var _b = _a.extraAbilityTokens, extraAbilityTokens = _b === void 0 ? [] : _b;
21
+ var QuestionTemplate = function () {
21
22
  var updateAiEvaluationData = useQuestionTemplateStore().updateAiEvaluationData;
22
- var loading = useRequest(function () { return PostAiModelQuestions({ extraAbilityTokens: extraAbilityTokens }); }, {
23
+ var selctedAbilitys = useAiAbilityListStore().selctedAbilitys;
24
+ var enterprise = useEnterpriseStore().enterprise;
25
+ var loading = useRequest(function () { return PostAiModelQuestions(__assign({ extraAbilityTokens: selctedAbilitys }, enterprise)); }, {
23
26
  manual: false,
27
+ refreshDeps: [selctedAbilitys, enterprise],
24
28
  onSuccess: function (_a) {
25
29
  var data = _a.data;
26
30
  return updateAiEvaluationData(data);
@@ -24,6 +24,7 @@ export interface AiEvaluationList {
24
24
  duration: number;
25
25
  prepareTime: number;
26
26
  questions: Question[];
27
+ minResponseDuration: number;
27
28
  extra: AiEvaluationListExtra;
28
29
  broadcastType: number;
29
30
  aiSwitch: number;
@@ -34,6 +35,7 @@ export interface AiEvaluationDataList {
34
35
  name: string;
35
36
  token: string;
36
37
  positionName?: string;
38
+ isNew: boolean;
37
39
  list: AiEvaluationList[];
38
40
  }
39
41
  export interface AiEvaluationData {
@@ -48,6 +50,5 @@ export interface AiEvaluationState {
48
50
  showOnlyAITest: boolean;
49
51
  }
50
52
  export interface QuestionTemplateProps {
51
- extraAbilityTokens?: string[];
52
53
  }
53
54
  export {};
@@ -59,9 +59,10 @@ import AiAnalysis from '../AiAnalysis';
59
59
  import { broadcastModeOptions, durationOptions, prepareTimeOptions } from './const';
60
60
  import RandomQuestion from './RandomQuestion';
61
61
  import VideoVoice from './VideoVoice';
62
- import { useQuestionCollectionListStore } from "../../../../store/ai-ability/question-ability-store";
62
+ import { useAiAbilityListStore } from "../../../../store/ai-ability-select/question-ability-store";
63
+ import { useEnterpriseStore } from "../../../../store/enterprise/enterprise-store";
63
64
  import { ADD_QUESTION_TYPE } from "../../../../enum/ai-question";
64
- import { PostQuestionCollectionList } from "../../../../services/ai-ability";
65
+ import { GetAiAbilityList } from "../../../../services/ai-ability";
65
66
  import { useRequest } from 'ahooks';
66
67
  import { Autocomplete, Box, CloseIcon, Form, FormItem, IconButton, Select, useForm } from 'fbm-ui';
67
68
  import { Stack } from 'fbm-ui/lib/mui';
@@ -69,8 +70,16 @@ import { FieldArray } from 'formik';
69
70
  import { forwardRef, memo, useEffect, useImperativeHandle } from 'react';
70
71
  var QuestionForm = forwardRef(function (props, ref) {
71
72
  var aiShowType = props.aiShowType, initialValues = props.initialValues, values = props.values, preview = props.preview, onValuesChange = props.onValuesChange, onSubmit = props.onSubmit, onCategoryChange = props.onCategoryChange;
72
- var _a = useQuestionCollectionListStore(function (store) { return [store.questionCollectionList]; }), questionCollectionList = _a.questionCollectionList, updateQuestionCollectionList = _a.updateQuestionCollectionList;
73
- var data = useRequest(PostQuestionCollectionList, { manual: preview }).data;
73
+ var _a = useAiAbilityListStore(), aiAbilityList = _a.aiAbilityList, setSpecialAiAbilityList = _a.setSpecialAiAbilityList;
74
+ var _b = useEnterpriseStore().enterprise, jobToken = _b.jobToken, thirdToken = _b.thirdToken;
75
+ var data = useRequest(function () { return GetAiAbilityList({ jobToken: jobToken, thirdToken: thirdToken }); }, {
76
+ refreshDeps: [jobToken, thirdToken],
77
+ manual: preview,
78
+ }).data;
79
+ useEffect(function () {
80
+ setSpecialAiAbilityList((data === null || data === void 0 ? void 0 : data.data.list) || []);
81
+ // eslint-disable-next-line react-hooks/exhaustive-deps
82
+ }, [data]);
74
83
  var form = useForm({
75
84
  initialValues: initialValues,
76
85
  onSubmit: function (values) { return __awaiter(void 0, void 0, void 0, function () {
@@ -88,6 +97,22 @@ var QuestionForm = forwardRef(function (props, ref) {
88
97
  var handleCategoryChange = function (_, value) {
89
98
  onCategoryChange === null || onCategoryChange === void 0 ? void 0 : onCategoryChange(value);
90
99
  };
100
+ var handleMinResponseDurationChange = function (e) {
101
+ var minResponseDurationValue = e.target.value;
102
+ if (minResponseDurationValue && minResponseDurationValue.indexOf('-') > -1) {
103
+ minResponseDurationValue = minResponseDurationValue.replaceAll('-', '');
104
+ }
105
+ if (minResponseDurationValue && minResponseDurationValue.indexOf('.') > -1) {
106
+ minResponseDurationValue = minResponseDurationValue.split('.')[0];
107
+ }
108
+ if (/^[1-9]\d*$/.test(minResponseDurationValue)) {
109
+ minResponseDurationValue = Number(minResponseDurationValue);
110
+ }
111
+ else {
112
+ minResponseDurationValue = '';
113
+ }
114
+ form.setValues(__assign(__assign({}, form.values), { minResponseDuration: minResponseDurationValue }));
115
+ };
91
116
  useImperativeHandle(ref, function () { return ({
92
117
  handleValues: function () { return form.values; },
93
118
  handleSubmit: function () { return form.handleSubmit(); },
@@ -95,14 +120,14 @@ var QuestionForm = forwardRef(function (props, ref) {
95
120
  }); });
96
121
  useEffect(function () {
97
122
  values && form.setValues(values);
98
- updateQuestionCollectionList((data === null || data === void 0 ? void 0 : data.data.list) || []);
123
+ // updateQuestionCollectionList(data?.data.list || []);
99
124
  // eslint-disable-next-line react-hooks/exhaustive-deps
100
125
  }, [values, data]);
101
126
  useEffect(function () {
102
127
  // console.log(form.values);
103
128
  onValuesChange === null || onValuesChange === void 0 ? void 0 : onValuesChange(form.values);
104
129
  }, [form.values, onValuesChange]);
105
- return (_jsxs(_Fragment, { children: [_jsxs(Form, __assign({}, form, { children: [_jsx(FormItem, { required: true, disabled: preview, name: "name", label: "\u6807\u9898", placeholder: "\u6807\u9898\uFF08\u7528\u4E8E\u7CFB\u7EDF\u7BA1\u7406\uFF09", max: 15 }), _jsxs(Box, __assign({ display: "flex" }, { children: [!preview && aiShowType === ADD_QUESTION_TYPE.FREE && (_jsx(FormItem, __assign({ sx: { flex: '1 0', mr: 1 }, required: true, disabled: preview, name: "broadcastType", label: "\u64AD\u62A5\u65B9\u5F0F" }, { children: _jsx(Select, { placeholder: "\u64AD\u62A5\u65B9\u5F0F", options: broadcastModeOptions }) }))), !preview && (_jsx(FormItem, __assign({ style: { flex: '1 0' }, disabled: preview, name: "category", label: "\u8003\u5BDF\u80FD\u529B" }, { children: _jsx(Autocomplete, { placeholder: "\u8003\u5BDF\u80FD\u529B", options: questionCollectionList.map(function (_a) {
130
+ return (_jsxs(_Fragment, { children: [_jsxs(Form, __assign({}, form, { children: [_jsx(FormItem, { required: true, disabled: preview, name: "name", label: "\u6807\u9898", placeholder: "\u6807\u9898\uFF08\u7528\u4E8E\u7CFB\u7EDF\u7BA1\u7406\uFF09", max: 15 }), _jsxs(Box, __assign({ display: "flex" }, { children: [!preview && aiShowType === ADD_QUESTION_TYPE.FREE && (_jsx(FormItem, __assign({ sx: { flex: '1 0', mr: 1 }, required: true, disabled: preview, name: "broadcastType", label: "\u64AD\u62A5\u65B9\u5F0F" }, { children: _jsx(Select, { placeholder: "\u64AD\u62A5\u65B9\u5F0F", options: broadcastModeOptions }) }))), !preview && (_jsx(FormItem, __assign({ style: { flex: '1 0' }, disabled: preview, name: "category", label: "\u8003\u5BDF\u80FD\u529B" }, { children: _jsx(Autocomplete, { placeholder: "\u8003\u5BDF\u80FD\u529B", options: aiAbilityList.map(function (_a) {
106
131
  var tag = _a.tag, token = _a.token, isWorkplace = _a.isWorkplace, define = _a.define, type = _a.type;
107
132
  return ({
108
133
  label: tag,
@@ -116,10 +141,14 @@ var QuestionForm = forwardRef(function (props, ref) {
116
141
  });
117
142
  }), onChange: handleCategoryChange }) })))] })), (form === null || form === void 0 ? void 0 : form.values.broadcastType) === 1 || preview ? (_jsx(FieldArray, { name: "questions", render: function () {
118
143
  var _a;
119
- return (_a = form.values.questions) === null || _a === void 0 ? void 0 : _a.map(function (_, index) { return (_jsxs(Stack, __assign({ 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", sx: { flexGrow: 1 } }, index), form.values.questions.length > 1 && (_jsx(Box, __assign({ height: 84, pt: 1 }, { children: _jsx(IconButton, __assign({ size: "small", onClick: function () {
144
+ return (_a = form.values.questions) === null || _a === void 0 ? void 0 : _a.map(function (_, index) { return (_jsxs(Stack, __assign({ 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: {
145
+ rows: 3,
146
+ multiline: true,
147
+ sx: { padding: 0 },
148
+ }, sx: { flexGrow: 1, height: 120 } }), form.values.questions.length > 1 && (_jsx(Box, __assign({ height: 84, pt: 1 }, { children: _jsx(IconButton, __assign({ size: "small", onClick: function () {
120
149
  form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], form.values.questions.filter(function (_, i) { return i !== index; }), true) }));
121
150
  } }, { children: _jsx(CloseIcon, {}) })) })))] }), index)); });
122
- } })) : (_jsx(VideoVoice, {})), !preview && aiShowType === ADD_QUESTION_TYPE.FREE && (_jsx(RandomQuestion, { category: form.values.category, broadcastType: form.values.broadcastType, onAddCustonQuestion: function () {
151
+ } })) : (_jsx(VideoVoice, {})), !preview && aiShowType === ADD_QUESTION_TYPE.FREE && (_jsx(RandomQuestion, { category: aiAbilityList === null || aiAbilityList === void 0 ? void 0 : aiAbilityList.find(function (v) { var _a; return v.name === ((_a = form.values.category) === null || _a === void 0 ? void 0 : _a.value); }), broadcastType: form.values.broadcastType, onAddCustonQuestion: function () {
123
152
  form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray(__spreadArray([], form.values.questions, true), [{ content: '', videoUrl: '' }], false) }));
124
153
  }, onAddRandomQuestion: function (qs) {
125
154
  form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray(__spreadArray([], form.values.questions, true), qs.map(function (v) { return ({ content: v, videoUrl: '' }); }), true) }));
@@ -128,7 +157,19 @@ var QuestionForm = forwardRef(function (props, ref) {
128
157
  multiline: true,
129
158
  placeholder: '朗读内容(候选人将根据此内容进行朗读)',
130
159
  sx: { padding: 0 },
131
- } })), _jsxs(Box, __assign({ display: "flex" }, { children: [_jsx(FormItem, __assign({ sx: { height: 64, flex: '1 0', mr: 1 }, required: true, disabled: preview, name: "prepareTime", label: "\u51C6\u5907\u65F6\u957F" }, { children: _jsx(Select, { options: prepareTimeOptions }) })), _jsx(FormItem, __assign({ sx: { height: 64, flex: '1 0' }, required: true, disabled: preview, name: "duration", label: "\u56DE\u7B54\u65F6\u957F" }, { children: _jsx(Select, { options: durationOptions }) }))] }))] })), !preview && _jsx(AiAnalysis, {})] }));
160
+ } })), _jsxs(Box, __assign({ display: "flex" }, { children: [_jsx(FormItem, __assign({ sx: { height: 64, flex: '1 0', mr: 2 }, required: true, disabled: preview, name: "prepareTime", label: "\u51C6\u5907\u65F6\u957F" }, { children: _jsx(Select, { options: prepareTimeOptions }) })), _jsx(FormItem, __assign({ sx: { height: 64, flex: '1 0' }, required: true, disabled: preview, name: "duration", label: "\u56DE\u7B54\u65F6\u957F" }, { children: _jsx(Select, { options: durationOptions }) })), _jsx(FormItem, { sx: { height: 64, flex: '1 0', ml: 2 }, name: "minResponseDuration", label: "\u6700\u5C11\u56DE\u7B54\u65F6\u957F", type: "number", disabled: preview,
161
+ // rules={[
162
+ // e => {
163
+ // if (!/^[1-9]\d*$/.test(e.value)) {
164
+ // return '输入不正确';
165
+ // }
166
+ // },
167
+ // ]}
168
+ InputProps: {
169
+ placeholder: '最少回答时长',
170
+ sx: { padding: 0, pr: 1 },
171
+ endAdornment: 's',
172
+ }, onChange: handleMinResponseDurationChange })] }))] })), !preview && _jsx(AiAnalysis, {})] }));
132
173
  });
133
174
  QuestionForm.displayName = 'QuestionForm';
134
175
  export default memo(QuestionForm);
@@ -9,7 +9,7 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import SelectQuestion from './SelectQuestion';
14
14
  import { useUpdateQuestionStore } from "../../../../store/ai-question/question-update-store";
15
15
  import { AddIcon, Box, Button, InfoIcon, Layout, Message, Popactions, Tooltip } from 'fbm-ui';
@@ -24,7 +24,7 @@ var RandomQuestion = function (_a) {
24
24
  var item = questionState.item;
25
25
  var actions = [
26
26
  {
27
- text: '快速选题',
27
+ text: _jsx(Typography, __assign({ width: 108 }, { children: "\u5FEB\u901F\u9009\u9898" })),
28
28
  onClick: function (_a) {
29
29
  var handleClose = _a.handleClose;
30
30
  handleClose();
@@ -37,7 +37,7 @@ var RandomQuestion = function (_a) {
37
37
  },
38
38
  },
39
39
  {
40
- text: '自定义',
40
+ text: _jsx(Typography, __assign({ width: 108 }, { children: "\u81EA\u5B9A\u4E49" })),
41
41
  onClick: function (_a) {
42
42
  var handleClose = _a.handleClose;
43
43
  handleClose();
@@ -46,15 +46,13 @@ var RandomQuestion = function (_a) {
46
46
  },
47
47
  ];
48
48
  var isVideoBroadcast = broadcastType === 2;
49
- var desc = isVideoBroadcast
50
- ? "1. \u89C6\u9891\u5EFA\u8BAE\u7AD6\u7248\uFF0C\u6BD4\u4F8B9\uFF1A16\uFF0C\u683C\u5F0F.mp4\uFF1B\u5019\u9009\u4EBA\u53EF\u91CD\u590D\u542C\u9898\uFF0C\u4F46\u5355\u9898\n \u6700\u591A\u91CD\u590D3\u6B21\u3002\n 2. \u5F53\u9762\u8BD5\u95F4\u4EA4\u4E92\u65B9\u5F0F\u662FAI\u9762\u8BD5\u5B98\u5BF9\u8BDD\u6A21\u5F0F\u65F6\uFF0C\u5019\u9009\u4EBA\u9762\u8BD5\u65F6\u5C06\u81EA\u52A8\u628A\n \u9898\u76EE\u7684\u64AD\u62A5\u65B9\u5F0F\u53D8\u6362\u4E3AAI\u8BED\u97F3\u64AD\u62A5\u65B9\u5F0F\n 3.\u6BCF\u4F4D\u5019\u9009\u4EBA\u968F\u673A1\u9898\uFF0C\u6700\u591A5\u4E2A\u9009\u9879\u3002"
51
- : '每位候选人随机1题,最多5个选项。';
49
+ var desc = isVideoBroadcast ? (_jsxs(_Fragment, { children: ["1. \u89C6\u9891\u5EFA\u8BAE\u7AD6\u7248\uFF0C\u6BD4\u4F8B9\uFF1A16\uFF0C\u683C\u5F0F.mp4\uFF1B\u5019\u9009\u4EBA\u53EF\u91CD\u590D\u542C\u9898\uFF0C\u4F46\u5355\u9898 \u6700\u591A\u91CD\u590D3\u6B21\u3002", _jsx("br", {}), "2. \u5F53\u9762\u8BD5\u95F4\u4EA4\u4E92\u65B9\u5F0F\u662FAI\u9762\u8BD5\u5B98\u5BF9\u8BDD\u6A21\u5F0F\u65F6\uFF0C\u5019\u9009\u4EBA\u9762\u8BD5\u65F6\u5C06\u81EA\u52A8\u628A \u9898\u76EE\u7684\u64AD\u62A5\u65B9\u5F0F\u53D8\u6362\u4E3AAI\u8BED\u97F3\u64AD\u62A5\u65B9\u5F0F", _jsx("br", {}), "3.\u6BCF\u4F4D\u5019\u9009\u4EBA\u968F\u673A1\u9898\uFF0C\u6700\u591A5\u4E2A\u9009\u9879\u3002"] })) : ('每位候选人随机1题,最多5个选项。');
52
50
  var handleVideoBroadcastChange = function (key, checked) {
53
51
  var _a;
54
52
  updateQuestionState({
55
53
  item: __assign(__assign({}, item), { videoBroadcast: __assign(__assign({}, item === null || item === void 0 ? void 0 : item.videoBroadcast), (_a = {}, _a[key] = checked ? 1 : 2, _a)) }),
56
54
  });
57
55
  };
58
- return (_jsxs(Layout, { children: [_jsxs(Stack, __assign({ spacing: 2, mb: 1, direction: "row", alignItems: "center", justifyContent: "space-between" }, { children: [_jsxs(Stack, __assign({ spacing: 1, direction: "row", alignItems: "center" }, { children: [_jsx(Popactions, __assign({ actions: actions, trigger: "click", isClickAway: true }, { children: _jsx(Button, __assign({ variant: "outlined", color: "inherit", icon: _jsx(AddIcon, {}) }, { children: "\u968F\u673A\u9762\u8BD5\u5185\u5BB9" })) })), _jsx(Tooltip, __assign({ title: "".concat(desc), placement: "bottom-start" }, { children: _jsx(Box, __assign({ display: "flex", alignItems: "center", sx: { ml: 1, height: 48 } }, { children: _jsx(InfoIcon, { sx: { color: 'rgba(0, 0, 0, 0.26)', fontSize: 16 } }) })) }))] })), _jsx(Stack, __assign({ spacing: 1, direction: "row", alignItems: "center", mb: 2 }, { children: isVideoBroadcast && (_jsx(FormGroup, { children: _jsxs(Box, __assign({ display: "flex" }, { children: [_jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: ((_b = item === null || item === void 0 ? void 0 : item.videoBroadcast) === null || _b === void 0 ? void 0 : _b.videoRetry) === 1 }), label: _jsx(Typography, __assign({ variant: "body2" }, { children: "\u5141\u8BB8\u91CD\u590D\u542C\u9898" })), onChange: function (e, checked) { return handleVideoBroadcastChange('videoRetry', checked); } }), _jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: ((_c = item === null || item === void 0 ? void 0 : item.videoBroadcast) === null || _c === void 0 ? void 0 : _c.videoSkip) === 1 }), label: _jsx(Typography, __assign({ variant: "body2" }, { children: "\u5141\u8BB8\u8DF3\u8FC7" })), onChange: function (e, checked) { return handleVideoBroadcastChange('videoSkip', checked); } })] })) })) }))] })), _jsx(SelectQuestion, { token: category === null || category === void 0 ? void 0 : category.token, open: open, onClose: function () { return setOpen(false); }, onOk: onAddRandomQuestion })] }));
56
+ return (_jsxs(Layout, { children: [_jsxs(Stack, __assign({ spacing: 2, mb: 1, direction: "row", alignItems: "center", justifyContent: "space-between", mt: 0.375 }, { children: [_jsxs(Stack, __assign({ spacing: 1, direction: "row", alignItems: "center" }, { children: [_jsx(Popactions, __assign({ actions: actions, trigger: "click", isClickAway: true, sx: { height: 1 } }, { children: _jsx(Button, __assign({ variant: "outlined", color: "inherit", icon: _jsx(AddIcon, {}) }, { children: "\u968F\u673A\u9762\u8BD5\u5185\u5BB9" })) })), _jsx(Tooltip, __assign({ title: desc, placement: "bottom-start" }, { children: _jsx(Box, __assign({ display: "flex", alignItems: "center", sx: { ml: 1, height: 48 } }, { children: _jsx(InfoIcon, { sx: { color: 'rgba(0, 0, 0, 0.26)', fontSize: 16 } }) })) }))] })), _jsx(Stack, __assign({ spacing: 1, direction: "row", alignItems: "center", mb: 2 }, { children: isVideoBroadcast && (_jsx(FormGroup, { children: _jsxs(Box, __assign({ display: "flex" }, { children: [_jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: ((_b = item === null || item === void 0 ? void 0 : item.videoBroadcast) === null || _b === void 0 ? void 0 : _b.videoRetry) === 1 }), label: _jsx(Typography, __assign({ variant: "body2" }, { children: "\u5141\u8BB8\u91CD\u590D\u542C\u9898" })), onChange: function (e, checked) { return handleVideoBroadcastChange('videoRetry', checked); } }), _jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: ((_c = item === null || item === void 0 ? void 0 : item.videoBroadcast) === null || _c === void 0 ? void 0 : _c.videoSkip) === 1 }), label: _jsx(Typography, __assign({ variant: "body2" }, { children: "\u5141\u8BB8\u8DF3\u8FC7" })), onChange: function (e, checked) { return handleVideoBroadcastChange('videoSkip', checked); } })] })) })) }))] })), _jsx(SelectQuestion, { token: category === null || category === void 0 ? void 0 : category.token, open: open, onClose: function () { return setOpen(false); }, onOk: onAddRandomQuestion })] }));
59
57
  };
60
58
  export default RandomQuestion;