eli-video-interview 1.2.39 → 1.2.40-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/esm/components/react-photo-view/Photo.css +14 -0
  2. package/esm/components/react-photo-view/Photo.d.ts +18 -0
  3. package/esm/components/react-photo-view/Photo.js +54 -0
  4. package/esm/components/react-photo-view/PhotoBox.css +18 -0
  5. package/esm/components/react-photo-view/PhotoBox.d.ts +22 -0
  6. package/esm/components/react-photo-view/PhotoBox.js +302 -0
  7. package/esm/components/react-photo-view/PhotoPage.d.ts +9 -0
  8. package/esm/components/react-photo-view/PhotoPage.js +77 -0
  9. package/esm/components/react-photo-view/PhotoProvider.d.ts +14 -0
  10. package/esm/components/react-photo-view/PhotoProvider.js +98 -0
  11. package/esm/components/react-photo-view/PhotoSlider.css +125 -0
  12. package/esm/components/react-photo-view/PhotoSlider.d.ts +12 -0
  13. package/esm/components/react-photo-view/PhotoSlider.js +262 -0
  14. package/esm/components/react-photo-view/PhotoView.d.ts +30 -0
  15. package/esm/components/react-photo-view/PhotoView.js +48 -0
  16. package/esm/components/react-photo-view/components/ArrowLeft.d.ts +3 -0
  17. package/esm/components/react-photo-view/components/ArrowLeft.js +18 -0
  18. package/esm/components/react-photo-view/components/ArrowRight.d.ts +3 -0
  19. package/esm/components/react-photo-view/components/ArrowRight.js +18 -0
  20. package/esm/components/react-photo-view/components/CloseIcon.d.ts +3 -0
  21. package/esm/components/react-photo-view/components/CloseIcon.js +16 -0
  22. package/esm/components/react-photo-view/components/PreventScroll.d.ts +1 -0
  23. package/esm/components/react-photo-view/components/PreventScroll.js +12 -0
  24. package/esm/components/react-photo-view/components/SlidePortal.css +10 -0
  25. package/esm/components/react-photo-view/components/SlidePortal.d.ts +7 -0
  26. package/esm/components/react-photo-view/components/SlidePortal.js +30 -0
  27. package/esm/components/react-photo-view/components/Spinner.css +23 -0
  28. package/esm/components/react-photo-view/components/Spinner.d.ts +4 -0
  29. package/esm/components/react-photo-view/components/Spinner.js +29 -0
  30. package/esm/components/react-photo-view/hooks/useAdjacentImages.d.ts +5 -0
  31. package/esm/components/react-photo-view/hooks/useAdjacentImages.js +14 -0
  32. package/esm/components/react-photo-view/hooks/useAnimationOrigin.d.ts +6 -0
  33. package/esm/components/react-photo-view/hooks/useAnimationOrigin.js +72 -0
  34. package/esm/components/react-photo-view/hooks/useAnimationPosition.d.ts +2 -0
  35. package/esm/components/react-photo-view/hooks/useAnimationPosition.js +28 -0
  36. package/esm/components/react-photo-view/hooks/useAnimationVisible.d.ts +6 -0
  37. package/esm/components/react-photo-view/hooks/useAnimationVisible.js +49 -0
  38. package/esm/components/react-photo-view/hooks/useContinuousTap.d.ts +8 -0
  39. package/esm/components/react-photo-view/hooks/useContinuousTap.js +36 -0
  40. package/esm/components/react-photo-view/hooks/useDebounceCallback.d.ts +10 -0
  41. package/esm/components/react-photo-view/hooks/useDebounceCallback.js +48 -0
  42. package/esm/components/react-photo-view/hooks/useEventListener.d.ts +1 -0
  43. package/esm/components/react-photo-view/hooks/useEventListener.js +18 -0
  44. package/esm/components/react-photo-view/hooks/useForkedVariable.d.ts +5 -0
  45. package/esm/components/react-photo-view/hooks/useForkedVariable.js +17 -0
  46. package/esm/components/react-photo-view/hooks/useInitial.d.ts +1 -0
  47. package/esm/components/react-photo-view/hooks/useInitial.js +9 -0
  48. package/esm/components/react-photo-view/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
  49. package/esm/components/react-photo-view/hooks/useIsomorphicLayoutEffect.js +3 -0
  50. package/esm/components/react-photo-view/hooks/useMethods.d.ts +4 -0
  51. package/esm/components/react-photo-view/hooks/useMethods.js +35 -0
  52. package/esm/components/react-photo-view/hooks/useMountedRef.d.ts +3 -0
  53. package/esm/components/react-photo-view/hooks/useMountedRef.js +12 -0
  54. package/esm/components/react-photo-view/hooks/useScrollPosition.d.ts +4 -0
  55. package/esm/components/react-photo-view/hooks/useScrollPosition.js +157 -0
  56. package/esm/components/react-photo-view/hooks/useSetState.d.ts +2 -0
  57. package/esm/components/react-photo-view/hooks/useSetState.js +15 -0
  58. package/esm/components/react-photo-view/hooks/useTargetScale.d.ts +4 -0
  59. package/esm/components/react-photo-view/hooks/useTargetScale.js +70 -0
  60. package/esm/components/react-photo-view/index.d.ts +4 -0
  61. package/esm/components/react-photo-view/index.js +4 -0
  62. package/esm/components/react-photo-view/photo-context.d.ts +11 -0
  63. package/esm/components/react-photo-view/photo-context.js +2 -0
  64. package/esm/components/react-photo-view/types.d.ts +196 -0
  65. package/esm/components/react-photo-view/types.js +1 -0
  66. package/esm/components/react-photo-view/utils/edgeHandle.d.ts +15 -0
  67. package/esm/components/react-photo-view/utils/edgeHandle.js +40 -0
  68. package/esm/components/react-photo-view/utils/getMultipleTouchPosition.d.ts +5 -0
  69. package/esm/components/react-photo-view/utils/getMultipleTouchPosition.js +11 -0
  70. package/esm/components/react-photo-view/utils/getPositionOnMoveOrScale.d.ts +9 -0
  71. package/esm/components/react-photo-view/utils/getPositionOnMoveOrScale.js +31 -0
  72. package/esm/components/react-photo-view/utils/getRotateSize.d.ts +4 -0
  73. package/esm/components/react-photo-view/utils/getRotateSize.js +11 -0
  74. package/esm/components/react-photo-view/utils/getSuitableImageSize.d.ts +10 -0
  75. package/esm/components/react-photo-view/utils/getSuitableImageSize.js +42 -0
  76. package/esm/components/react-photo-view/utils/isTouchDevice.d.ts +5 -0
  77. package/esm/components/react-photo-view/utils/isTouchDevice.js +5 -0
  78. package/esm/components/react-photo-view/utils/limitTarget.d.ts +5 -0
  79. package/esm/components/react-photo-view/utils/limitTarget.js +12 -0
  80. package/esm/components/react-photo-view/variables.d.ts +48 -0
  81. package/esm/components/react-photo-view/variables.js +48 -0
  82. package/esm/constants/ai-question.d.ts +9 -0
  83. package/esm/constants/ai-question.js +33 -4
  84. package/esm/enum/ai-question.d.ts +5 -2
  85. package/esm/enum/ai-question.js +3 -0
  86. package/esm/modules/ai-ability/Root.js +15 -4
  87. package/esm/modules/ai-ability-select/Root.js +2 -2
  88. package/esm/modules/ai-ability-select/interface.d.ts +1 -0
  89. package/esm/modules/ai-question/components/BootVideo/index.js +1 -1
  90. package/esm/modules/ai-question/components/QuestionModel/Item.js +14 -9
  91. package/esm/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +10 -5
  92. package/esm/modules/ai-question/components/QuestionUpdate/Chioce.d.ts +17 -0
  93. package/esm/modules/ai-question/components/QuestionUpdate/Chioce.js +96 -0
  94. package/esm/modules/ai-question/components/QuestionUpdate/Form.js +42 -12
  95. package/esm/modules/ai-question/components/QuestionUpdate/RandomQuestion.js +14 -4
  96. package/esm/modules/ai-question/components/QuestionUpdate/const.js +4 -0
  97. package/esm/modules/ai-question/components/QuestionUpdate/index.js +12 -14
  98. package/esm/modules/ai-question/components/QuestionUpdate/interface.d.ts +8 -0
  99. package/esm/modules/ai-question/components/QuestionUpdate/styled.d.ts +15 -0
  100. package/esm/modules/ai-question/components/QuestionUpdate/styled.js +53 -1
  101. package/esm/modules/ai-report/components/ScoreReport/Score.js +4 -1
  102. package/esm/modules/ai-report/components/VideoQuestion/BodyImages.d.ts +7 -0
  103. package/esm/modules/ai-report/components/VideoQuestion/BodyImages.js +40 -0
  104. package/esm/modules/ai-report/components/VideoQuestion/QuestionItem.js +5 -3
  105. package/esm/modules/ai-report/components/VideoQuestion/SingleChoice.d.ts +8 -0
  106. package/esm/modules/ai-report/components/VideoQuestion/SingleChoice.js +25 -0
  107. package/esm/modules/ai-report/components/VideoQuestion/styled.d.ts +1 -0
  108. package/esm/modules/ai-report/components/VideoQuestion/styled.js +7 -1
  109. package/esm/modules/ai-report/interface.d.ts +19 -0
  110. package/esm/services/ai-ability.d.ts +1 -1
  111. package/esm/services/ai-ability.js +1 -1
  112. package/lib/components/react-photo-view/Photo.css +14 -0
  113. package/lib/components/react-photo-view/Photo.d.ts +18 -0
  114. package/lib/components/react-photo-view/Photo.js +60 -0
  115. package/lib/components/react-photo-view/PhotoBox.css +18 -0
  116. package/lib/components/react-photo-view/PhotoBox.d.ts +22 -0
  117. package/lib/components/react-photo-view/PhotoBox.js +308 -0
  118. package/lib/components/react-photo-view/PhotoPage.d.ts +9 -0
  119. package/lib/components/react-photo-view/PhotoPage.js +79 -0
  120. package/lib/components/react-photo-view/PhotoProvider.d.ts +14 -0
  121. package/lib/components/react-photo-view/PhotoProvider.js +104 -0
  122. package/lib/components/react-photo-view/PhotoSlider.css +125 -0
  123. package/lib/components/react-photo-view/PhotoSlider.d.ts +12 -0
  124. package/lib/components/react-photo-view/PhotoSlider.js +268 -0
  125. package/lib/components/react-photo-view/PhotoView.d.ts +30 -0
  126. package/lib/components/react-photo-view/PhotoView.js +53 -0
  127. package/lib/components/react-photo-view/components/ArrowLeft.d.ts +3 -0
  128. package/lib/components/react-photo-view/components/ArrowLeft.js +20 -0
  129. package/lib/components/react-photo-view/components/ArrowRight.d.ts +3 -0
  130. package/lib/components/react-photo-view/components/ArrowRight.js +20 -0
  131. package/lib/components/react-photo-view/components/CloseIcon.d.ts +3 -0
  132. package/lib/components/react-photo-view/components/CloseIcon.js +18 -0
  133. package/lib/components/react-photo-view/components/PreventScroll.d.ts +1 -0
  134. package/lib/components/react-photo-view/components/PreventScroll.js +15 -0
  135. package/lib/components/react-photo-view/components/SlidePortal.css +10 -0
  136. package/lib/components/react-photo-view/components/SlidePortal.d.ts +7 -0
  137. package/lib/components/react-photo-view/components/SlidePortal.js +32 -0
  138. package/lib/components/react-photo-view/components/Spinner.css +23 -0
  139. package/lib/components/react-photo-view/components/Spinner.d.ts +4 -0
  140. package/lib/components/react-photo-view/components/Spinner.js +31 -0
  141. package/lib/components/react-photo-view/hooks/useAdjacentImages.d.ts +5 -0
  142. package/lib/components/react-photo-view/hooks/useAdjacentImages.js +17 -0
  143. package/lib/components/react-photo-view/hooks/useAnimationOrigin.d.ts +6 -0
  144. package/lib/components/react-photo-view/hooks/useAnimationOrigin.js +78 -0
  145. package/lib/components/react-photo-view/hooks/useAnimationPosition.d.ts +2 -0
  146. package/lib/components/react-photo-view/hooks/useAnimationPosition.js +34 -0
  147. package/lib/components/react-photo-view/hooks/useAnimationVisible.d.ts +6 -0
  148. package/lib/components/react-photo-view/hooks/useAnimationVisible.js +55 -0
  149. package/lib/components/react-photo-view/hooks/useContinuousTap.d.ts +8 -0
  150. package/lib/components/react-photo-view/hooks/useContinuousTap.js +42 -0
  151. package/lib/components/react-photo-view/hooks/useDebounceCallback.d.ts +10 -0
  152. package/lib/components/react-photo-view/hooks/useDebounceCallback.js +51 -0
  153. package/lib/components/react-photo-view/hooks/useEventListener.d.ts +1 -0
  154. package/lib/components/react-photo-view/hooks/useEventListener.js +21 -0
  155. package/lib/components/react-photo-view/hooks/useForkedVariable.d.ts +5 -0
  156. package/lib/components/react-photo-view/hooks/useForkedVariable.js +20 -0
  157. package/lib/components/react-photo-view/hooks/useInitial.d.ts +1 -0
  158. package/lib/components/react-photo-view/hooks/useInitial.js +12 -0
  159. package/lib/components/react-photo-view/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
  160. package/lib/components/react-photo-view/hooks/useIsomorphicLayoutEffect.js +5 -0
  161. package/lib/components/react-photo-view/hooks/useMethods.d.ts +4 -0
  162. package/lib/components/react-photo-view/hooks/useMethods.js +38 -0
  163. package/lib/components/react-photo-view/hooks/useMountedRef.d.ts +3 -0
  164. package/lib/components/react-photo-view/hooks/useMountedRef.js +14 -0
  165. package/lib/components/react-photo-view/hooks/useScrollPosition.d.ts +4 -0
  166. package/lib/components/react-photo-view/hooks/useScrollPosition.js +163 -0
  167. package/lib/components/react-photo-view/hooks/useSetState.d.ts +2 -0
  168. package/lib/components/react-photo-view/hooks/useSetState.js +18 -0
  169. package/lib/components/react-photo-view/hooks/useTargetScale.d.ts +4 -0
  170. package/lib/components/react-photo-view/hooks/useTargetScale.js +76 -0
  171. package/lib/components/react-photo-view/index.d.ts +4 -0
  172. package/lib/components/react-photo-view/index.js +12 -0
  173. package/lib/components/react-photo-view/photo-context.d.ts +11 -0
  174. package/lib/components/react-photo-view/photo-context.js +4 -0
  175. package/lib/components/react-photo-view/types.d.ts +196 -0
  176. package/lib/components/react-photo-view/types.js +2 -0
  177. package/lib/components/react-photo-view/utils/edgeHandle.d.ts +15 -0
  178. package/lib/components/react-photo-view/utils/edgeHandle.js +45 -0
  179. package/lib/components/react-photo-view/utils/getMultipleTouchPosition.d.ts +5 -0
  180. package/lib/components/react-photo-view/utils/getMultipleTouchPosition.js +14 -0
  181. package/lib/components/react-photo-view/utils/getPositionOnMoveOrScale.d.ts +9 -0
  182. package/lib/components/react-photo-view/utils/getPositionOnMoveOrScale.js +34 -0
  183. package/lib/components/react-photo-view/utils/getRotateSize.d.ts +4 -0
  184. package/lib/components/react-photo-view/utils/getRotateSize.js +14 -0
  185. package/lib/components/react-photo-view/utils/getSuitableImageSize.d.ts +10 -0
  186. package/lib/components/react-photo-view/utils/getSuitableImageSize.js +48 -0
  187. package/lib/components/react-photo-view/utils/isTouchDevice.d.ts +5 -0
  188. package/lib/components/react-photo-view/utils/isTouchDevice.js +7 -0
  189. package/lib/components/react-photo-view/utils/limitTarget.d.ts +5 -0
  190. package/lib/components/react-photo-view/utils/limitTarget.js +17 -0
  191. package/lib/components/react-photo-view/variables.d.ts +48 -0
  192. package/lib/components/react-photo-view/variables.js +51 -0
  193. package/lib/constants/ai-question.d.ts +9 -0
  194. package/lib/constants/ai-question.js +34 -5
  195. package/lib/enum/ai-question.d.ts +5 -2
  196. package/lib/enum/ai-question.js +3 -0
  197. package/lib/modules/ai-ability/Root.js +15 -4
  198. package/lib/modules/ai-ability-select/Root.js +2 -2
  199. package/lib/modules/ai-ability-select/interface.d.ts +1 -0
  200. package/lib/modules/ai-question/components/BootVideo/index.js +1 -1
  201. package/lib/modules/ai-question/components/QuestionModel/Item.js +11 -6
  202. package/lib/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +8 -3
  203. package/lib/modules/ai-question/components/QuestionUpdate/Chioce.d.ts +17 -0
  204. package/lib/modules/ai-question/components/QuestionUpdate/Chioce.js +103 -0
  205. package/lib/modules/ai-question/components/QuestionUpdate/Form.js +40 -10
  206. package/lib/modules/ai-question/components/QuestionUpdate/RandomQuestion.js +12 -2
  207. package/lib/modules/ai-question/components/QuestionUpdate/const.js +4 -0
  208. package/lib/modules/ai-question/components/QuestionUpdate/index.js +11 -13
  209. package/lib/modules/ai-question/components/QuestionUpdate/interface.d.ts +8 -0
  210. package/lib/modules/ai-question/components/QuestionUpdate/styled.d.ts +15 -0
  211. package/lib/modules/ai-question/components/QuestionUpdate/styled.js +53 -1
  212. package/lib/modules/ai-report/components/ScoreReport/Score.js +4 -1
  213. package/lib/modules/ai-report/components/VideoQuestion/BodyImages.d.ts +7 -0
  214. package/lib/modules/ai-report/components/VideoQuestion/BodyImages.js +45 -0
  215. package/lib/modules/ai-report/components/VideoQuestion/QuestionItem.js +4 -2
  216. package/lib/modules/ai-report/components/VideoQuestion/SingleChoice.d.ts +8 -0
  217. package/lib/modules/ai-report/components/VideoQuestion/SingleChoice.js +27 -0
  218. package/lib/modules/ai-report/components/VideoQuestion/styled.d.ts +1 -0
  219. package/lib/modules/ai-report/components/VideoQuestion/styled.js +8 -2
  220. package/lib/modules/ai-report/interface.d.ts +19 -0
  221. package/lib/services/ai-ability.d.ts +1 -1
  222. package/lib/services/ai-ability.js +1 -1
  223. package/package.json +2 -2
@@ -1,19 +1,47 @@
1
1
  var _a;
2
2
  import { ADD_QUESTION_TYPE, QUESTION_TYPE } from "../enum/ai-question";
3
- var FREE = ADD_QUESTION_TYPE.FREE, LANGUAGE = ADD_QUESTION_TYPE.LANGUAGE;
3
+ var FREE = ADD_QUESTION_TYPE.FREE, LANGUAGE = ADD_QUESTION_TYPE.LANGUAGE, EVALUATION = ADD_QUESTION_TYPE.EVALUATION, SINGLECHIOCE = ADD_QUESTION_TYPE.SINGLECHIOCE;
4
4
  var QA = QUESTION_TYPE.QA, COLOR_BLINDNESS = QUESTION_TYPE.COLOR_BLINDNESS, ALPHABETIC_DICTATION = QUESTION_TYPE.ALPHABETIC_DICTATION, AI_ANALYSIS = QUESTION_TYPE.AI_ANALYSIS, POLICY_DECISION_GAME = QUESTION_TYPE.POLICY_DECISION_GAME, MEMORY_GAME = QUESTION_TYPE.MEMORY_GAME, EMOTION_GAME = QUESTION_TYPE.EMOTION_GAME;
5
+ /*
6
+ * 题目类型列表
7
+ */
5
8
  export var ADD_QUESTION_TYPE_LIST = [
6
9
  {
7
10
  type: FREE,
8
- title: '自由作答题',
11
+ hide: false,
12
+ title: '问答题',
9
13
  desc: '以问答的形式要求候选人对你定问题作答。',
10
14
  },
11
15
  {
12
16
  type: LANGUAGE,
17
+ hide: false,
13
18
  title: '朗读题',
14
19
  desc: '候选人根据所提供的文案进行朗读。',
15
20
  },
21
+ {
22
+ type: EVALUATION,
23
+ hide: true,
24
+ title: '评估题',
25
+ desc: '候选人根据所提供的文案进行朗读。',
26
+ },
27
+ {
28
+ type: SINGLECHIOCE,
29
+ hide: false,
30
+ title: '单选题',
31
+ desc: '以单选的形式要求候选人对问题进行作答。',
32
+ },
16
33
  ];
34
+ /*
35
+ * 可以自定义的题目类型列表
36
+ */
37
+ export var ADD_QUESTION_TYPE_SHOW_LIST = ADD_QUESTION_TYPE_LIST.filter(function (v) { return !v.hide; });
38
+ /*
39
+ * 题目类型名称映射表
40
+ */
41
+ export var QUESTION_TYPE_TITLE_MAP = ADD_QUESTION_TYPE_LIST.reduce(function (acc, cur) {
42
+ acc[cur.type] = cur.title;
43
+ return acc;
44
+ }, {});
17
45
  export var QUESTION_TYPE_MAPPING_LABEL = (_a = {},
18
46
  _a[QA] = '问答题',
19
47
  _a[COLOR_BLINDNESS] = '色盲题',
@@ -52,7 +80,8 @@ export var AiVideoStatus = {
52
80
  };
53
81
  export var MAX_UPLOAD_FILE_SIZE = 1024 * 1024 * 20;
54
82
  export var MAX_UPLOAD_VIDEO_FILE_SIZE = 1024 * 1024 * 500;
55
- export var TEST_TYPE_READONLY = [2, 3, 4, 7, 8, 9, 10, 11, 12];
56
- export var DISABLED_REPEAT_TYPE = [2, 4, 7, 8, 9, 11, 12];
83
+ export var TEST_TYPE_READONLY = [2, 3, 4, 7, 8, 9, 10, 11, 12, 16];
84
+ export var DISABLED_REPEAT_TYPE = [2, 4, 7, 8, 9, 11, 12, 16];
85
+ export var DISABLED_COST_TYPE = [7, 9, 8, 4, 11, 2, 16];
57
86
  // 是否开启AI分析
58
87
  export var IS_AI_ANALYSIS = function (step) { return step.aiType === 2; };
@@ -3,7 +3,9 @@
3
3
  */
4
4
  export declare enum ADD_QUESTION_TYPE {
5
5
  FREE = 1,
6
- LANGUAGE = 2
6
+ LANGUAGE = 2,
7
+ EVALUATION = 3,
8
+ SINGLECHIOCE = 4
7
9
  }
8
10
  /**
9
11
  * AI考核标准类型
@@ -34,5 +36,6 @@ export declare enum QUESTION_TYPE {
34
36
  AI_ANALYSIS = 6,
35
37
  POLICY_DECISION_GAME = 7,
36
38
  MEMORY_GAME = 8,
37
- EMOTION_GAME = 9
39
+ EMOTION_GAME = 9,
40
+ SINGLECHIOCE = 17
38
41
  }
@@ -5,6 +5,8 @@ export var ADD_QUESTION_TYPE;
5
5
  (function (ADD_QUESTION_TYPE) {
6
6
  ADD_QUESTION_TYPE[ADD_QUESTION_TYPE["FREE"] = 1] = "FREE";
7
7
  ADD_QUESTION_TYPE[ADD_QUESTION_TYPE["LANGUAGE"] = 2] = "LANGUAGE";
8
+ ADD_QUESTION_TYPE[ADD_QUESTION_TYPE["EVALUATION"] = 3] = "EVALUATION";
9
+ ADD_QUESTION_TYPE[ADD_QUESTION_TYPE["SINGLECHIOCE"] = 4] = "SINGLECHIOCE";
8
10
  })(ADD_QUESTION_TYPE || (ADD_QUESTION_TYPE = {}));
9
11
  /**
10
12
  * AI考核标准类型
@@ -39,4 +41,5 @@ export var QUESTION_TYPE;
39
41
  QUESTION_TYPE[QUESTION_TYPE["POLICY_DECISION_GAME"] = 7] = "POLICY_DECISION_GAME";
40
42
  QUESTION_TYPE[QUESTION_TYPE["MEMORY_GAME"] = 8] = "MEMORY_GAME";
41
43
  QUESTION_TYPE[QUESTION_TYPE["EMOTION_GAME"] = 9] = "EMOTION_GAME";
44
+ QUESTION_TYPE[QUESTION_TYPE["SINGLECHIOCE"] = 17] = "SINGLECHIOCE";
42
45
  })(QUESTION_TYPE || (QUESTION_TYPE = {}));
@@ -54,6 +54,7 @@ import { useRequest, useSetState } from 'ahooks';
54
54
  import dayjs from 'dayjs';
55
55
  import { AddIcon, Box, Button, confirm, DeleteIcon, DocumentIcon, Header, Link, Message, Table, Tooltip } from 'fbm-ui';
56
56
  import { useCallback, useState } from 'react';
57
+ var PAGE_SIZE = 20;
57
58
  var AiAbilityRoot = function (_a) {
58
59
  var _b = _a.ablilityNameLength, ablilityNameLength = _b === void 0 ? 30 : _b;
59
60
  var _c = useSetState({
@@ -62,9 +63,12 @@ var AiAbilityRoot = function (_a) {
62
63
  type: 3,
63
64
  isWorkplace: false,
64
65
  }), state = _c[0], setState = _c[1];
65
- var _d = useState(false), AddAbilityOpen = _d[0], setAddAbilityOpen = _d[1];
66
- var _e = useState(false), UpdateAbilityOpen = _e[0], setUpdateAbilityOpen = _e[1];
67
- var _f = useRequest(PostQuestionCollectionList), data = _f.data, getList = _f.run, listLoading = _f.loading;
66
+ var _d = useState(0), page = _d[0], setPage = _d[1];
67
+ var _e = useState(false), AddAbilityOpen = _e[0], setAddAbilityOpen = _e[1];
68
+ var _f = useState(false), UpdateAbilityOpen = _f[0], setUpdateAbilityOpen = _f[1];
69
+ var _g = useRequest(function () { return PostQuestionCollectionList({ page: page, pageSize: PAGE_SIZE }); }, {
70
+ refreshDeps: [page],
71
+ }), data = _g.data, getList = _g.run, listLoading = _g.loading;
68
72
  var deleteList = useRequest(PostQuestionCollectionDelete, {
69
73
  manual: true,
70
74
  onSuccess: function () {
@@ -143,6 +147,13 @@ var AiAbilityRoot = function (_a) {
143
147
  },
144
148
  },
145
149
  ];
146
- return (_jsxs(AbilityRoot, { children: [AddAbilityOpen && (_jsx(AddAbility, __assign({}, state, { open: AddAbilityOpen, ablilityNameLength: ablilityNameLength, onClose: handleClose, onSuccess: getList }))), UpdateAbilityOpen && (_jsx(UpdateAbility, __assign({}, state, { open: UpdateAbilityOpen, ablilityNameLength: ablilityNameLength, onClose: handleClose, onSuccess: getList }))), _jsx(Header, { title: "\u8003\u5BDF\u80FD\u529B\u7BA1\u7406", renderAction: function () { return (_jsx(Button, __assign({ icon: _jsx(AddIcon, {}), onClick: handleAdd }, { children: "\u65B0\u589E\u80FD\u529B" }))); } }), _jsx(Box, __assign({ mt: 2, border: "1px solid rgba(0, 0, 0, 0.08)", borderRadius: 0.5, overflow: "hidden" }, { children: _jsx(Table, { emptyText: "\u6682\u65E0\u6570\u636E", nameText: "\u8003\u5BDF\u80FD\u529B", loading: listLoading, data: data === null || data === void 0 ? void 0 : data.data.list, columns: columns }) }))] }));
150
+ return (_jsxs(AbilityRoot, { children: [AddAbilityOpen && (_jsx(AddAbility, __assign({}, state, { open: AddAbilityOpen, ablilityNameLength: ablilityNameLength, onClose: handleClose, onSuccess: getList }))), UpdateAbilityOpen && (_jsx(UpdateAbility, __assign({}, state, { open: UpdateAbilityOpen, ablilityNameLength: ablilityNameLength, onClose: handleClose, onSuccess: getList }))), _jsx(Header, { title: "\u8003\u5BDF\u80FD\u529B\u7BA1\u7406", renderAction: function () { return (_jsx(Button, __assign({ icon: _jsx(AddIcon, {}), onClick: handleAdd }, { children: "\u65B0\u589E\u80FD\u529B" }))); } }), _jsx(Box, __assign({ mt: 2, border: "1px solid rgba(0, 0, 0, 0.08)", borderRadius: 0.5, overflow: "hidden" }, { children: _jsx(Table, { emptyText: "\u6682\u65E0\u6570\u636E", nameText: "\u8003\u5BDF\u80FD\u529B", loading: listLoading, data: data === null || data === void 0 ? void 0 : data.data.list, columns: columns, PaginationProps: {
151
+ total: (data === null || data === void 0 ? void 0 : data.data.total) || 0,
152
+ pageSize: PAGE_SIZE,
153
+ onPageChange: function (page) {
154
+ setPage(Math.max(0, page - 1));
155
+ return true;
156
+ },
157
+ } }) }))] }));
147
158
  };
148
159
  export default AiAbilityRoot;
@@ -24,7 +24,7 @@ var ScrollDialogContent = styled(Box)({
24
24
  overflow: 'scroll',
25
25
  });
26
26
  var AiAbilitySelectRoot = forwardRef(function (_a, ref) {
27
- var jobToken = _a.jobToken, thirdToken = _a.thirdToken, token = _a.token;
27
+ var jobToken = _a.jobToken, thirdToken = _a.thirdToken, token = _a.token, hiddenTips = _a.hiddenTips;
28
28
  var _b = useAiAbilityListStore(), aiAbilityList = _b.aiAbilityList, setAiAbilityList = _b.setAiAbilityList, selctedAbilitys = _b.selctedAbilitys;
29
29
  var setEnterprise = useEnterpriseStore().setEnterprise;
30
30
  var data = useRequest(function () { return GetAiAbilityList({ jobToken: jobToken, thirdToken: thirdToken }); }, {
@@ -41,7 +41,7 @@ var AiAbilitySelectRoot = forwardRef(function (_a, ref) {
41
41
  setEnterprise({ jobToken: jobToken, thirdToken: thirdToken });
42
42
  // eslint-disable-next-line react-hooks/exhaustive-deps
43
43
  }, [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: "\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 })] })) })));
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
45
  });
46
46
  AiAbilitySelectRoot.displayName = 'AiAbilitySelectRoot';
47
47
  export default memo(AiAbilitySelectRoot);
@@ -3,6 +3,7 @@ export interface AiAbilitySelectProps {
3
3
  thirdToken?: string;
4
4
  selectedTokens?: string[];
5
5
  token?: string;
6
+ hiddenTips?: boolean;
6
7
  }
7
8
  interface AiAbilityDetailInfo {
8
9
  name: string;
@@ -128,7 +128,7 @@ var BootVideo = function (props) {
128
128
  return (_jsx(Dialog, __assign({ open: open, title: "\u5B9A\u5236\u9762\u8BD5\u95F4", okText: "\u786E\u8BA4", 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({ fontSize: "14px", variant: "body1", fontWeight: 500 }, { children: "\u9762\u8BD5\u95F4\u4E92\u52A8\u65B9\u5F0F" })), _jsxs(RadioGroup, __assign({ defaultValue: "outlined", onChange: handleInteractTypeChange, value: interviewRoomState.interactType }, { children: [_jsx(Radio, { value: 1, label: "\u4F20\u7EDF\u8BFB\u9898\u6A21\u5F0F" }), _jsx(Radio, { value: 2, label: "AI\u9762\u8BD5\u5B98\u5BF9\u8BDD\u6A21\u5F0F" })] })), interviewRoomState.interactType === 2 && (_jsxs(_Fragment, { children: [_jsx(Typography, __assign({ fontSize: "14px", variant: "body1", fontWeight: 500, mt: 2, mb: 1 }, { children: "\u9762\u8BD5\u5B98\u5F62\u8C61" })), _jsx(CustomUploadedImgRoot, { children: virtualManList.map(function (human) {
129
129
  var _a;
130
130
  return (_jsxs(Box, { children: [_jsx("img", { src: human.virtualHumanAvatar, style: { borderColor: ((_a = interviewRoomState.aiInterviewerProfile) === null || _a === void 0 ? void 0 : _a.humanToken) === human.humanToken ? '#4CAF50' : 'transparent' }, height: 100, alt: "", onClick: function () { return handleSelectHumanType(human); } }), _jsx(Typography, __assign({ variant: "body2", textAlign: "center" }, { children: human.name }))] }, human.humanToken));
131
- }) }), _jsx(Typography, __assign({ variant: "caption", flexWrap: "wrap", width: 462, color: "disabled", mb: 1 }, { children: "\u8BF4\u660E\uFF1A\u6B65\u9AA4\u4E0B\u7684\u6240\u6709\u9898\u76EE\u7684\u865A\u62DF\u4EBA\u64AD\u653E\u89C6\u9891\u5747\u751F\u6210\u540E\uFF0C\u624D\u80FD\u751F\u6548\u865A\u62DF\u4EBA\u6548\u679C\u3002\u5426\u5219\uFF0C\u5C06\u4EE5\u4F20\u7EDF\u8BFB\u9898\u6A21\u5F0F\u8FDB\u884C\u4EA4\u4E92\u3002" }))] })), interviewRoomState.interactType === 1 && (_jsxs(_Fragment, { children: [_jsx(Typography, __assign({ fontSize: "14px", variant: "body1", fontWeight: 500, mt: 2, mb: 1 }, { children: "\u5F15\u5BFC\u89C6\u9891" })), _jsx(CustomUploadedImgRoot, { children: mediaList.map(function (_a) {
131
+ }) }), _jsx(Typography, __assign({ variant: "caption", flexWrap: "wrap", width: 462, color: "disabled", mb: 1 }, { children: "\u8BF4\u660E\uFF1A\u6B65\u9AA4\u4E0B\u7684\u6240\u6709\u9898\u76EE\u7684\u865A\u62DF\u4EBA\u64AD\u653E\u89C6\u9891\u5747\u751F\u6210\u540E\uFF0C\u624D\u80FD\u751F\u6548\u865A\u62DF\u4EBA\u6548\u679C\u3002\u5426\u5219\uFF0C\u5C06\u4EE5\u4F20\u7EDF\u8BFB\u9898\u6A21\u5F0F\u8FDB\u884C\u4EA4\u4E92\u3002\u76EE\u524D\u53EA\u6709\u5C0F\u9762\u652F\u6301\u5BF9\u9898\u76EE\u8FFD\u95EE\uFF0C\u5176\u4ED6\u5F62\u8C61\u6682\u4E0D\u652F\u6301\u3002" }))] })), interviewRoomState.interactType === 1 && (_jsxs(_Fragment, { children: [_jsx(Typography, __assign({ fontSize: "14px", variant: "body1", fontWeight: 500, mt: 2, mb: 1 }, { children: "\u5F15\u5BFC\u89C6\u9891" })), _jsx(CustomUploadedImgRoot, { children: mediaList.map(function (_a) {
132
132
  var videoUrl = _a.videoUrl, frameUrl = _a.frameUrl;
133
133
  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));
134
134
  }) }), _jsx(Typography, __assign({ variant: "caption", flexWrap: "wrap", width: 462, 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 }); } }) }))] }))] }))] }), interviewRoomState.interactType === 1 && (_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" }))] }) }))) }))), interviewRoomState.interactType === 2 && (_jsx(Box, __assign({ sx: { maxHeight: 'calc(100vh - 150px)', overflow: 'auto', flexGrow: 1 } }, { children: _jsx(Box, __assign({ sx: { width: 160, height: 286, margin: 'auto', cursor: 'pointer' } }, { children: _jsx("video", { width: 160, height: 286, src: (_a = interviewRoomState.aiInterviewerProfile) === null || _a === void 0 ? void 0 : _a.virtualPreviewMedia, controls: true }) })) })))] })) }) })));
@@ -20,19 +20,21 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  }
21
21
  return t;
22
22
  };
23
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
24
- import { DISABLED_REPEAT_TYPE, IS_AI_ANALYSIS, TEST_TYPE_READONLY } from "../../../../constants/ai-question";
23
+ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
24
+ import { useInterviewRoomStore } from "../../../../store/ai-question/interview-room-store";
25
+ import { DISABLED_REPEAT_TYPE, IS_AI_ANALYSIS, QUESTION_TYPE_TITLE_MAP, TEST_TYPE_READONLY } from "../../../../constants/ai-question";
25
26
  import { useQuestionModelStore } from "../../../../store/ai-question/question-model-store";
26
27
  import { useUpdateQuestionStore } from "../../../../store/ai-question/question-update-store";
27
28
  import { getSecondToTime } from "../../../../utils/utils";
28
- import { Box, Chip, confirm, DeleteIcon, DragIndicatorIcon, EditIcon, IconButton, InfoIcon, Input, Switch, Tooltip, Typography } from 'fbm-ui';
29
+ import { Box, Chip, confirm, DeleteIcon, DragHandleIcon, EditIcon, IconButton, InfoIcon, Input, Switch, Tooltip, Typography } from 'fbm-ui';
29
30
  import { Paper, Stack } from 'fbm-ui/lib/mui';
30
31
  import { memo, useCallback, useMemo } from 'react';
31
32
  var QuestionModelListItem = function (props) {
33
+ var _a = useInterviewRoomStore(), interactType = _a.interactType, aiInterviewerProfile = _a.aiInterviewerProfile;
32
34
  var index = props.index, disabledWeight = props.disabledWeight, steps = props.steps, step = __rest(props, ["index", "disabledWeight", "steps"]);
33
- var token = step.token, name = step.name, questions = step.questions, duration = step.duration, weight = step.weight, type = step.type, aiShowType = step.aiShowType, aiType = step.aiType, answerStatus = step.answerStatus, category = step.category;
35
+ var token = step.token, name = step.name, questions = step.questions, duration = step.duration, weight = step.weight, type = step.type, aiShowType = step.aiShowType, aiType = step.aiType, answerStatus = step.answerStatus, category = step.category, isOpenAIFollowUp = step.isOpenAIFollowUp;
34
36
  var isAiAnalysis = IS_AI_ANALYSIS(step);
35
- var _a = useQuestionModelStore(), editModel = _a.editModel, removeModel = _a.removeModel, updateModelWeight = _a.updateModelWeight;
37
+ var _b = useQuestionModelStore(), editModel = _b.editModel, removeModel = _b.removeModel, updateModelWeight = _b.updateModelWeight;
36
38
  var updateQuestionState = useUpdateQuestionStore().updateQuestionState;
37
39
  var handleEdit = useCallback(function () {
38
40
  updateQuestionState({ open: true, token: token, index: index, aiShowType: aiShowType, item: step });
@@ -66,14 +68,17 @@ var QuestionModelListItem = function (props) {
66
68
  var handleAnswerStatus = useCallback(function () {
67
69
  editModel(__assign(__assign({}, step), { answerStatus: answerStatus === 2 ? 1 : 2 }), index);
68
70
  }, [editModel, answerStatus, step, index]);
71
+ var handleOpenAIFollowUpStatus = useCallback(function () {
72
+ editModel(__assign(__assign({}, step), { isOpenAIFollowUp: !isOpenAIFollowUp }), index);
73
+ }, [editModel, isOpenAIFollowUp, step, index]);
69
74
  var formatQuestion = useMemo(function () {
70
75
  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, 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)); }) }))] })));
76
+ return (_jsx(Stack, __assign({ direction: "row", spacing: 1 }, { children: _jsx(Stack, __assign({ spacing: 1 }, { children: questions.map(function (v, i) { return (_jsxs(Typography, __assign({ variant: "body2", color: "text.secondary" }, { children: ["\u2022\u00A0", v.content] }), i)); }) })) })));
72
77
  }
73
78
  return questions.map(function (v) { return v.content; }).join('\n');
74
79
  }, [questions]);
75
- return (_jsxs(Paper, __assign({ variant: "outlined", sx: { display: 'block', mt: 2 } }, { children: [_jsxs(Box, __assign({ display: "flex", borderBottom: !DISABLED_REPEAT_TYPE.includes(type) || 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) {
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 } })] })), _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))] }))] }))] }))] })), (!DISABLED_REPEAT_TYPE.includes(type) || isAiAnalysis) && (_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 }) })))] })))] })));
80
+ return (_jsxs(Paper, __assign({ variant: "outlined", sx: { display: 'block', mt: 2 } }, { children: [_jsx(Box, __assign({ display: "flex", borderBottom: !DISABLED_REPEAT_TYPE.includes(type) || isAiAnalysis ? '1px solid rgba(0, 0, 0, 0.08)' : 'none' }, { children: _jsxs(Box, __assign({ flex: "1 0", padding: "8px 0px 16px 16px" }, { children: [_jsxs(Box, __assign({ display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: [_jsxs(Typography, __assign({ variant: "body2", color: "primary.main", fontWeight: "medium" }, { children: ["\u9898\u76EE", index + 1] })), _jsx(Box, __assign({ width: 40, display: "flex", alignItems: "center", justifyContent: "center", sx: { cursor: 'move' } }, { children: _jsx(DragHandleIcon, { className: "dragHandle" }) })), _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, {}) }))] }))] })), _jsx(Box, __assign({ display: "flex", justifyContent: "space-between" }, { children: _jsxs(Box, __assign({ flex: "1 0", display: "flex", alignItems: "center" }, { children: [_jsxs(Typography, __assign({ variant: "body2", color: "primary.main", fontWeight: "medium", mr: 0.5 }, { children: ["[", QUESTION_TYPE_TITLE_MAP[aiShowType], "]"] })), _jsx(Typography, __assign({ variant: "subtitle1" }, { children: name })), category === null || category === void 0 ? void 0 : category.map(function (label) {
81
+ 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) })));
82
+ }), aiType === 2 && _jsx(Chip, { variant: "filled", color: "primary", label: "AI\u8BC4\u5206", size: "medium", sx: { ml: 1 } }), (questions === null || questions === void 0 ? void 0 : questions.length) > 1 && _jsx(Chip, { variant: "filled", color: "warning", label: "\u5185\u5BB9\u968F\u673A", size: "medium", sx: { ml: 1 } })] })) })), _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))] }))] }))] })) })), (!DISABLED_REPEAT_TYPE.includes(type) || isAiAnalysis) && (_jsxs(Stack, __assign({ direction: "row", justifyContent: "space-between", spacing: 1, height: 42 }, { children: [_jsx(Box, __assign({ display: "flex", alignItems: "center", padding: "3px 0 3px 16px" }, { children: isAiAnalysis && (_jsxs(_Fragment, { children: [_jsx(Typography, __assign({ variant: "body2", sx: { flexShrink: 0 } }, { 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) && (_jsxs(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 }), type === 1 && aiShowType === 1 && ((aiInterviewerProfile === null || aiInterviewerProfile === void 0 ? void 0 : aiInterviewerProfile.humanType) !== 2 || interactType === 1) && (_jsx(Switch, { sx: { flexShrink: 0, mr: 2 }, size: "small", checked: isOpenAIFollowUp, label: _jsx(Typography, __assign({ fontSize: 12, lineHeight: 1.5, color: "rgba(0, 0, 0, 0.56)" }, { children: "\u56DE\u7B54\u4E0D\u5145\u5206\u65F6\u8FFD\u95EE" })), onChange: handleOpenAIFollowUpStatus }))] })))] })))] })));
78
83
  };
79
84
  export default memo(QuestionModelListItem);
@@ -9,12 +9,12 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var _a;
12
13
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
14
  import BaseAccordion from '../BaseAccordion';
14
15
  import { defaultQuestionParams } from '../QuestionUpdate/const';
15
16
  import { useAiAbilityListStore } from "../../../../store/ai-ability-select/question-ability-store";
16
- import SvgIcon from "../../../../components/SvgIcon";
17
- import { ADD_QUESTION_TYPE_LIST } from "../../../../constants/ai-question";
17
+ import { ADD_QUESTION_TYPE_SHOW_LIST } from "../../../../constants/ai-question";
18
18
  import { ADD_QUESTION_TYPE } from "../../../../enum/ai-question";
19
19
  import { useAiQuestionStore } from "../../../../store/ai-question/global-store";
20
20
  import { getQuestionModelStore, useQuestionModelStore } from "../../../../store/ai-question/question-model-store";
@@ -22,9 +22,14 @@ import { useQuestionTemplateStore } from "../../../../store/ai-question/question
22
22
  import { useUpdateQuestionStore } from "../../../../store/ai-question/question-update-store";
23
23
  import { uniqueId } from "../../../../utils/utils";
24
24
  import { useSetState } from 'ahooks';
25
- import { AddIcon, Box, Button, LayerOutlineIcon, Popover, SMSOneIcon, Typography } from 'fbm-ui';
25
+ import { AddIcon, Box, Button, LayerOutlineIcon, MicIcon, Popover, RadioCheckedIcon, SMSOneIcon, Typography } from 'fbm-ui';
26
26
  import { List, ListItem, ListItemButton, ListItemIcon, ListItemText } from 'fbm-ui/lib/mui';
27
27
  import { useCallback } from 'react';
28
+ var ICONS = (_a = {},
29
+ _a[ADD_QUESTION_TYPE.FREE] = _jsx(SMSOneIcon, { color: "secondary" }),
30
+ _a[ADD_QUESTION_TYPE.LANGUAGE] = _jsx(MicIcon, { color: "secondary" }),
31
+ _a[ADD_QUESTION_TYPE.SINGLECHIOCE] = _jsx(RadioCheckedIcon, { color: "secondary" }),
32
+ _a);
28
33
  var AiEvaluation = function () {
29
34
  var onOpenTemplate = useAiQuestionStore(function (store) { return [store.onOpenTemplate]; }).onOpenTemplate;
30
35
  var updateQuestionState = useUpdateQuestionStore(function (store) { return [store.updateQuestionState]; }).updateQuestionState;
@@ -41,9 +46,9 @@ var AiEvaluation = function () {
41
46
  setState({ addQuestionOpen: false });
42
47
  updateQuestionState({ open: true, aiShowType: aiShowType, token: '', index: -1, item: __assign(__assign({}, defaultQuestionParams), { aiShowType: aiShowType, token: uniqueId() }) });
43
48
  }, [setState, updateQuestionState]);
44
- var content = (_jsx(List, { children: ADD_QUESTION_TYPE_LIST.map(function (_a) {
49
+ var content = (_jsx(List, { children: ADD_QUESTION_TYPE_SHOW_LIST.map(function (_a) {
45
50
  var title = _a.title, desc = _a.desc, type = _a.type;
46
- return (_jsx(ListItem, __assign({ disablePadding: true }, { children: _jsxs(ListItemButton, __assign({ onClick: function () { return handleClickAdd(type); } }, { children: [_jsx(ListItemIcon, __assign({ sx: { minWidth: 40 } }, { children: type === ADD_QUESTION_TYPE.FREE ? _jsx(SMSOneIcon, { color: "secondary" }) : _jsx(SvgIcon, { name: "free", style: { fill: 'rgba(0, 0, 0, 0.56)' } }) })), _jsx(ListItemText, { primary: title, secondary: desc })] })) }), "question_type_".concat(type)));
51
+ return (_jsx(ListItem, __assign({ disablePadding: true }, { children: _jsxs(ListItemButton, __assign({ onClick: function () { return handleClickAdd(type); } }, { children: [_jsx(ListItemIcon, __assign({ sx: { minWidth: 40 } }, { children: ICONS[type] })), _jsx(ListItemText, { primary: title, secondary: desc })] })) }), "question_type_".concat(type)));
47
52
  }) }));
48
53
  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) {
49
54
  var name = _a.name, list = _a.list;
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * 验证0-9的整数
4
+ */
5
+ export declare const IS_INTEGER_REG: RegExp;
6
+ /**
7
+ * 可输入最大分值
8
+ */
9
+ export declare const MAX_SCORE_VALUE = 100;
10
+ export declare const VERIFICATION_SCORE: (value: string) => boolean;
11
+ export interface QuestionItemProps {
12
+ index: number;
13
+ item: any;
14
+ onChange: (key: string, value: any, index: number) => void;
15
+ }
16
+ declare const Choice: React.FC<QuestionItemProps>;
17
+ export default Choice;
@@ -0,0 +1,96 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
13
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
14
+ if (ar || !(i in from)) {
15
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
16
+ ar[i] = from[i];
17
+ }
18
+ }
19
+ return to.concat(ar || Array.prototype.slice.call(from));
20
+ };
21
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
+ import { ChoiceIcon, ChoiceItem, ChoiceItemInput, ScoreInput } from './styled';
23
+ import { uniqueId } from "../../../../utils/utils";
24
+ import { AddIcon, Box, Button, CloseIcon, DragIndicatorIcon, FormItem, IconButton } from 'fbm-ui';
25
+ import { FieldArray } from 'formik';
26
+ import { useCallback, useEffect, useRef } from 'react';
27
+ import Sortable from 'sortablejs';
28
+ /**
29
+ * 验证0-9的整数
30
+ */
31
+ export var IS_INTEGER_REG = /^[0-9]\d*$/;
32
+ /**
33
+ * 可输入最大分值
34
+ */
35
+ export var MAX_SCORE_VALUE = 100;
36
+ export var VERIFICATION_SCORE = function (value) { return (value ? !IS_INTEGER_REG.test(value) || Number(value) > MAX_SCORE_VALUE : false); };
37
+ var Choice = function (_a) {
38
+ var _b;
39
+ var index = _a.index, item = _a.item, onChange = _a.onChange;
40
+ var ref = useRef();
41
+ var sortable = useRef();
42
+ var helper = useRef();
43
+ var handleOptionAdd = useCallback(function () {
44
+ var _a;
45
+ var optionItem = { key: uniqueId(), content: '', score: 0 };
46
+ if (helper.current) {
47
+ (_a = helper.current) === null || _a === void 0 ? void 0 : _a.push(optionItem);
48
+ }
49
+ }, []);
50
+ useEffect(function () {
51
+ sortable.current && sortable.current.destroy();
52
+ sortable.current = new Sortable(ref.current, {
53
+ handle: '.optionItemDragHandle',
54
+ animation: 150,
55
+ forceFallback: true,
56
+ onEnd: function (_a) {
57
+ var oldIndex = _a.oldIndex, newIndex = _a.newIndex;
58
+ if (helper.current) {
59
+ helper.current.handleMove(newIndex, oldIndex);
60
+ }
61
+ },
62
+ });
63
+ }, [index, item, onChange]);
64
+ useEffect(function () {
65
+ var _a;
66
+ if (!((_a = item === null || item === void 0 ? void 0 : item.options) === null || _a === void 0 ? void 0 : _a.length)) {
67
+ handleOptionAdd();
68
+ }
69
+ }, [item, handleOptionAdd, index]);
70
+ return (_jsxs(Box, __assign({ width: "100%" }, { children: [_jsx(Box, __assign({ ref: ref }, { children: ((_b = item === null || item === void 0 ? void 0 : item.options) === null || _b === void 0 ? void 0 : _b.length) > 0 && (_jsx(FieldArray, { name: "questions.".concat(index, ".options"), render: function (p) {
71
+ var _a;
72
+ helper.current = p;
73
+ return (_a = p.form.values.questions[index].options) === null || _a === void 0 ? void 0 : _a.map(function (v, i) {
74
+ var _a;
75
+ return (_jsxs(ChoiceItem, { children: [_jsx(DragIndicatorIcon, { className: "optionItemDragHandle" }), _jsx(ChoiceIcon, { borderRadius: 2 }), _jsx(FormItem, __assign({ required: true, name: "questions[".concat(index, "].options[").concat(i, "].content"), placeholder: "\u65B0\u9009\u9879", InputProps: {
76
+ variant: 'standard',
77
+ multiline: true,
78
+ sx: {
79
+ mr: 1.5,
80
+ },
81
+ }, sx: { height: 'auto', flexGrow: 1, overflow: 'hidden' } }, { children: _jsx(ChoiceItemInput, { multiline: true, maxRows: 3, placeholder: "\u65B0\u9009\u9879", variant: "standard" }) })), _jsx(Box, __assign({ width: 36, flexShrink: 0, ml: 2 }, { children: ((_a = p.form.values.questions[index].options) === null || _a === void 0 ? void 0 : _a.length) > 1 && (_jsx(IconButton, __assign({ className: "choice-item-delete-icon", onClick: function () { return p.remove(i); } }, { children: _jsx(CloseIcon, {}) }))) })), _jsx(FormItem, __assign({ required: true, name: "questions[".concat(index, "].options[").concat(i, "].score"), placeholder: "\u5206\u503C", InputProps: {
82
+ multiline: true,
83
+ }, rules: [function (_a) {
84
+ var value = _a.value;
85
+ return VERIFICATION_SCORE(value);
86
+ }], sx: { height: 'auto', widht: 84 }, onChange: function (e) {
87
+ var value = e.target.value;
88
+ if (VERIFICATION_SCORE(value) || Number(value) > MAX_SCORE_VALUE || Number(value) < 1) {
89
+ return;
90
+ }
91
+ onChange('options', __spreadArray([], ((item === null || item === void 0 ? void 0 : item.options) || []).map(function (v, index) { return (i === index ? __assign(__assign({}, v), { score: Number(value) }) : v); }), true), index);
92
+ } }, { children: _jsx(ScoreInput, { size: "small", placeholder: "\u5206\u503C", endAdornment: "\u5206" }) }))] }, i));
93
+ });
94
+ } })) })), _jsx(ChoiceItem, { children: _jsx(Button, __assign({ icon: _jsx(AddIcon, {}), variant: "outlined", color: "inherit", size: "small", onClick: handleOptionAdd, sx: { ml: -2 } }, { children: "\u6DFB\u52A0\u9009\u9879" })) })] })));
95
+ };
96
+ export default Choice;
@@ -56,6 +56,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
56
56
  };
57
57
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
58
58
  import AiAnalysis from '../AiAnalysis';
59
+ import Chioce from './Chioce';
59
60
  import { broadcastModeOptions, durationOptions, prepareTimeOptions } from './const';
60
61
  import RandomQuestion from './RandomQuestion';
61
62
  import VideoVoice from './VideoVoice';
@@ -64,8 +65,8 @@ import { useEnterpriseStore } from "../../../../store/enterprise/enterprise-stor
64
65
  import { ADD_QUESTION_TYPE } from "../../../../enum/ai-question";
65
66
  import { GetAiAbilityList } from "../../../../services/ai-ability";
66
67
  import { useRequest } from 'ahooks';
67
- import { Autocomplete, Box, CloseIcon, Form, FormItem, IconButton, Select, useForm } from 'fbm-ui';
68
- import { Stack } from 'fbm-ui/lib/mui';
68
+ import { Autocomplete, Box, CloseIcon, DeleteIcon, Form, FormItem, IconButton, Select, useForm } from 'fbm-ui';
69
+ import { Paper, Stack } from 'fbm-ui/lib/mui';
69
70
  import { FieldArray } from 'formik';
70
71
  import { forwardRef, memo, useEffect, useImperativeHandle } from 'react';
71
72
  var QuestionForm = forwardRef(function (props, ref) {
@@ -82,6 +83,11 @@ var QuestionForm = forwardRef(function (props, ref) {
82
83
  }, [data]);
83
84
  var form = useForm({
84
85
  initialValues: initialValues,
86
+ validate: function (values) {
87
+ var errors = {};
88
+ // console.log(values);
89
+ return errors;
90
+ },
85
91
  onSubmit: function (values) { return __awaiter(void 0, void 0, void 0, function () {
86
92
  return __generator(this, function (_a) {
87
93
  switch (_a.label) {
@@ -139,16 +145,40 @@ var QuestionForm = forwardRef(function (props, ref) {
139
145
  define: define,
140
146
  isWorkplace: isWorkplace,
141
147
  });
142
- }), onChange: handleCategoryChange }) })))] })), (form === null || form === void 0 ? void 0 : form.values.broadcastType) === 1 || preview ? (_jsx(FieldArray, { name: "questions", render: function () {
143
- var _a;
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 () {
149
- form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], form.values.questions.filter(function (_, i) { return i !== index; }), true) }));
150
- } }, { children: _jsx(CloseIcon, {}) })) })))] }), index)); });
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 () {
148
+ }), onChange: handleCategoryChange }) })))] })), aiShowType !== ADD_QUESTION_TYPE.SINGLECHIOCE &&
149
+ ((form === null || form === void 0 ? void 0 : form.values.broadcastType) === 1 || preview ? (_jsx(FieldArray, { name: "questions", render: function () {
150
+ var _a;
151
+ 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: {
152
+ rows: 3,
153
+ multiline: true,
154
+ sx: { padding: 0 },
155
+ }, 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 () {
156
+ form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], form.values.questions.filter(function (_, i) { return i !== index; }), true) }));
157
+ } }, { children: _jsx(CloseIcon, {}) })) })))] }), index)); });
158
+ } })) : (_jsx(VideoVoice, {}))), !preview && aiShowType === ADD_QUESTION_TYPE.SINGLECHIOCE && (
159
+ // @ts-ignore
160
+ _jsx(Box, { children: _jsx(FieldArray, { name: "questions", render: function () {
161
+ var _a;
162
+ return (_a = form.values.questions) === null || _a === void 0 ? void 0 : _a.map(function (v, index) {
163
+ var _a, _b;
164
+ return (_jsxs(Stack, __assign({ px: 2, pb: 2, pt: 0.5, mb: 2, boxSizing: "border-box", component: Paper, variant: "outlined", width: "100%", justifyContent: "space-between", spacing: 1 }, { children: [_jsx(Box, __assign({ display: "flex", alignItems: "center", justifyContent: "flex-end" }, { children: ((_b = (_a = form === null || form === void 0 ? void 0 : form.values) === null || _a === void 0 ? void 0 : _a.questions) === null || _b === void 0 ? void 0 : _b.length) > 1 && (_jsx(IconButton, __assign({ sx: { mr: -1 }, onClick: function () {
165
+ form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], form.values.questions.filter(function (_, i) { return i !== index; }), true) }));
166
+ } }, { children: _jsx(DeleteIcon, {}) }))) })), _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: {
167
+ // rows: 3,
168
+ maxRows: 3,
169
+ minRows: 1,
170
+ multiline: true,
171
+ sx: { padding: 0 },
172
+ }, sx: {
173
+ flexGrow: 1,
174
+ height: 'auto',
175
+ } }), _jsx(Chioce, { index: index, item: v, onChange: function (_, options, i) {
176
+ form.values.questions[index].options = options;
177
+ console.log(form.values.questions, options);
178
+ form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], form.values.questions, true) }));
179
+ } })] }), index));
180
+ });
181
+ } }) })), !preview && aiShowType !== ADD_QUESTION_TYPE.LANGUAGE && (_jsx(RandomQuestion, { aiShowType: aiShowType, 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 () {
152
182
  form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray(__spreadArray([], form.values.questions, true), [{ content: '', videoUrl: '' }], false) }));
153
183
  }, onAddRandomQuestion: function (qs) {
154
184
  form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray(__spreadArray([], form.values.questions, true), qs.map(function (v) { return ({ content: v, videoUrl: '' }); }), true) }));
@@ -11,14 +11,15 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import SelectQuestion from './SelectQuestion';
14
+ import { ADD_QUESTION_TYPE } from "../../../../enum/ai-question";
14
15
  import { useUpdateQuestionStore } from "../../../../store/ai-question/question-update-store";
15
- import { AddIcon, Box, Button, InfoIcon, Layout, Message, Popactions, Tooltip } from 'fbm-ui';
16
- import { Checkbox, FormControlLabel, FormGroup, Typography } from 'fbm-ui/lib/mui';
16
+ import { AddIcon, Box, Button, Checkbox, InfoIcon, Layout, Message, Popactions, Tooltip } from 'fbm-ui';
17
+ import { Typography } from 'fbm-ui/lib/mui';
17
18
  import { Stack } from 'fbm-ui/lib/mui';
18
19
  import { useState } from 'react';
19
20
  var RandomQuestion = function (_a) {
20
21
  var _b, _c;
21
- var broadcastType = _a.broadcastType, onAddCustonQuestion = _a.onAddCustonQuestion, onAddRandomQuestion = _a.onAddRandomQuestion, category = _a.category;
22
+ var broadcastType = _a.broadcastType, onAddCustonQuestion = _a.onAddCustonQuestion, onAddRandomQuestion = _a.onAddRandomQuestion, category = _a.category, aiShowType = _a.aiShowType;
22
23
  var _d = useUpdateQuestionStore(function (store) { return [store.questionState]; }), questionState = _d.questionState, updateQuestionState = _d.updateQuestionState;
23
24
  var _e = useState(false), open = _e[0], setOpen = _e[1];
24
25
  var item = questionState.item;
@@ -53,6 +54,15 @@ var RandomQuestion = function (_a) {
53
54
  item: __assign(__assign({}, item), { videoBroadcast: __assign(__assign({}, item === null || item === void 0 ? void 0 : item.videoBroadcast), (_a = {}, _a[key] = checked ? 1 : 2, _a)) }),
54
55
  });
55
56
  };
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); } })] })) })) }))] })), open && _jsx(SelectQuestion, { token: category === null || category === void 0 ? void 0 : category.token, open: open, onClose: function () { return setOpen(false); }, onOk: onAddRandomQuestion })] }));
57
+ var handleEnableScoreOptimizationStatus = function () {
58
+ updateQuestionState({
59
+ item: __assign(__assign({}, item), { enableScoreOptimization: !item.enableScoreOptimization }),
60
+ });
61
+ };
62
+ 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: aiShowType === ADD_QUESTION_TYPE.SINGLECHIOCE ? [actions[1]] : 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 } }) })) }))] })), _jsxs(Stack, __assign({ spacing: 1, direction: "row", alignItems: "center", mb: 2 }, { children: [isVideoBroadcast && (_jsxs(Stack, __assign({ spacing: 1, direction: "row" }, { children: [_jsx(Checkbox, { sx: {
63
+ mr: 0,
64
+ }, 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(Checkbox, { sx: {
65
+ mr: 0,
66
+ }, 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); } })] }))), item.type === 1 && item.aiShowType === 1 && (_jsx(Checkbox, { checked: item === null || item === void 0 ? void 0 : item.enableScoreOptimization, label: _jsxs(Typography, __assign({ variant: "body2", display: "flex" }, { children: ["\u56DE\u7B54\u8FC7\u77ED\u6263\u5206", _jsx(Tooltip, __assign({ title: "\u82E5\u5B57\u6570\u5C0F\u4E8E\u7B49\u4E8E80\u65F6\uFF0C\u5BF9AI\u5206\u6570\u8FDB\u884C\u4E00\u5B9A\u7684\u51CF\u5C11\uFF0C\u6700\u5C11\n\u51CF10\u5206\uFF0C\u6700\u9AD8\u51CF40\u5206\uFF0C\u6309\u7167\u5B57\u6570\u9010\u51CF\u3002" }, { children: _jsx("span", __assign({ style: { display: 'flex', alignItems: 'center', marginLeft: '8px' } }, { children: _jsx(InfoIcon, { sx: { fontSize: 14, color: 'rgba(0, 0, 0, 0.26)' } }) })) }))] })), onChange: handleEnableScoreOptimizationStatus }))] }))] })), open && _jsx(SelectQuestion, { token: category === null || category === void 0 ? void 0 : category.token, open: open, onClose: function () { return setOpen(false); }, onOk: onAddRandomQuestion })] }));
57
67
  };
58
68
  export default RandomQuestion;
@@ -27,6 +27,8 @@ export var defaultQuestionParams = {
27
27
  weight: 0,
28
28
  token: '',
29
29
  originToken: '',
30
+ isOpenAIFollowUp: false,
31
+ enableScoreOptimization: false,
30
32
  };
31
33
  // 播报方式
32
34
  export var broadcastModeOptions = [
@@ -52,5 +54,7 @@ export var durationOptions = [
52
54
  { value: 30, label: '30s' },
53
55
  { value: 60, label: '1m' },
54
56
  { value: 180, label: '3m' },
57
+ { value: 300, label: '5m' },
58
+ { value: 600, label: '10m' },
55
59
  { value: 1200, label: '20m' },
56
60
  ];