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

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 (241) 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/AiAnalysis/index.js +4 -1
  90. package/esm/modules/ai-question/components/BootVideo/index.js +1 -1
  91. package/esm/modules/ai-question/components/QuestionModel/Item.js +14 -9
  92. package/esm/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +17 -6
  93. package/esm/modules/ai-question/components/QuestionUpdate/Chioce.d.ts +17 -0
  94. package/esm/modules/ai-question/components/QuestionUpdate/Chioce.js +97 -0
  95. package/esm/modules/ai-question/components/QuestionUpdate/Form.js +37 -12
  96. package/esm/modules/ai-question/components/QuestionUpdate/RandomQuestion.js +14 -4
  97. package/esm/modules/ai-question/components/QuestionUpdate/Score.d.ts +15 -0
  98. package/esm/modules/ai-question/components/QuestionUpdate/Score.js +53 -0
  99. package/esm/modules/ai-question/components/QuestionUpdate/const.js +4 -0
  100. package/esm/modules/ai-question/components/QuestionUpdate/index.js +35 -17
  101. package/esm/modules/ai-question/components/QuestionUpdate/interface.d.ts +10 -0
  102. package/esm/modules/ai-question/components/QuestionUpdate/styled.d.ts +15 -0
  103. package/esm/modules/ai-question/components/QuestionUpdate/styled.js +56 -1
  104. package/esm/modules/ai-report/Root.js +1 -1
  105. package/esm/modules/ai-report/components/ScoreReport/Score.js +4 -1
  106. package/esm/modules/ai-report/components/VideoQuestion/Abilities.js +5 -3
  107. package/esm/modules/ai-report/components/VideoQuestion/BodyImages.d.ts +7 -0
  108. package/esm/modules/ai-report/components/VideoQuestion/BodyImages.js +40 -0
  109. package/esm/modules/ai-report/components/VideoQuestion/QuestionItem.js +9 -4
  110. package/esm/modules/ai-report/components/VideoQuestion/ScoreSlider.js +4 -4
  111. package/esm/modules/ai-report/components/VideoQuestion/SingleChoice.d.ts +8 -0
  112. package/esm/modules/ai-report/components/VideoQuestion/SingleChoice.js +31 -0
  113. package/esm/modules/ai-report/components/VideoQuestion/index.js +1 -1
  114. package/esm/modules/ai-report/components/VideoQuestion/interface.d.ts +2 -0
  115. package/esm/modules/ai-report/components/VideoQuestion/styled.d.ts +1 -0
  116. package/esm/modules/ai-report/components/VideoQuestion/styled.js +7 -1
  117. package/esm/modules/ai-report/interface.d.ts +19 -0
  118. package/esm/services/ai-ability.d.ts +1 -1
  119. package/esm/services/ai-ability.js +1 -1
  120. package/esm/store/ai-question/ai-analysis-store.js +0 -1
  121. package/lib/components/react-photo-view/Photo.css +14 -0
  122. package/lib/components/react-photo-view/Photo.d.ts +18 -0
  123. package/lib/components/react-photo-view/Photo.js +60 -0
  124. package/lib/components/react-photo-view/PhotoBox.css +18 -0
  125. package/lib/components/react-photo-view/PhotoBox.d.ts +22 -0
  126. package/lib/components/react-photo-view/PhotoBox.js +308 -0
  127. package/lib/components/react-photo-view/PhotoPage.d.ts +9 -0
  128. package/lib/components/react-photo-view/PhotoPage.js +79 -0
  129. package/lib/components/react-photo-view/PhotoProvider.d.ts +14 -0
  130. package/lib/components/react-photo-view/PhotoProvider.js +104 -0
  131. package/lib/components/react-photo-view/PhotoSlider.css +125 -0
  132. package/lib/components/react-photo-view/PhotoSlider.d.ts +12 -0
  133. package/lib/components/react-photo-view/PhotoSlider.js +268 -0
  134. package/lib/components/react-photo-view/PhotoView.d.ts +30 -0
  135. package/lib/components/react-photo-view/PhotoView.js +53 -0
  136. package/lib/components/react-photo-view/components/ArrowLeft.d.ts +3 -0
  137. package/lib/components/react-photo-view/components/ArrowLeft.js +20 -0
  138. package/lib/components/react-photo-view/components/ArrowRight.d.ts +3 -0
  139. package/lib/components/react-photo-view/components/ArrowRight.js +20 -0
  140. package/lib/components/react-photo-view/components/CloseIcon.d.ts +3 -0
  141. package/lib/components/react-photo-view/components/CloseIcon.js +18 -0
  142. package/lib/components/react-photo-view/components/PreventScroll.d.ts +1 -0
  143. package/lib/components/react-photo-view/components/PreventScroll.js +15 -0
  144. package/lib/components/react-photo-view/components/SlidePortal.css +10 -0
  145. package/lib/components/react-photo-view/components/SlidePortal.d.ts +7 -0
  146. package/lib/components/react-photo-view/components/SlidePortal.js +32 -0
  147. package/lib/components/react-photo-view/components/Spinner.css +23 -0
  148. package/lib/components/react-photo-view/components/Spinner.d.ts +4 -0
  149. package/lib/components/react-photo-view/components/Spinner.js +31 -0
  150. package/lib/components/react-photo-view/hooks/useAdjacentImages.d.ts +5 -0
  151. package/lib/components/react-photo-view/hooks/useAdjacentImages.js +17 -0
  152. package/lib/components/react-photo-view/hooks/useAnimationOrigin.d.ts +6 -0
  153. package/lib/components/react-photo-view/hooks/useAnimationOrigin.js +78 -0
  154. package/lib/components/react-photo-view/hooks/useAnimationPosition.d.ts +2 -0
  155. package/lib/components/react-photo-view/hooks/useAnimationPosition.js +34 -0
  156. package/lib/components/react-photo-view/hooks/useAnimationVisible.d.ts +6 -0
  157. package/lib/components/react-photo-view/hooks/useAnimationVisible.js +55 -0
  158. package/lib/components/react-photo-view/hooks/useContinuousTap.d.ts +8 -0
  159. package/lib/components/react-photo-view/hooks/useContinuousTap.js +42 -0
  160. package/lib/components/react-photo-view/hooks/useDebounceCallback.d.ts +10 -0
  161. package/lib/components/react-photo-view/hooks/useDebounceCallback.js +51 -0
  162. package/lib/components/react-photo-view/hooks/useEventListener.d.ts +1 -0
  163. package/lib/components/react-photo-view/hooks/useEventListener.js +21 -0
  164. package/lib/components/react-photo-view/hooks/useForkedVariable.d.ts +5 -0
  165. package/lib/components/react-photo-view/hooks/useForkedVariable.js +20 -0
  166. package/lib/components/react-photo-view/hooks/useInitial.d.ts +1 -0
  167. package/lib/components/react-photo-view/hooks/useInitial.js +12 -0
  168. package/lib/components/react-photo-view/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
  169. package/lib/components/react-photo-view/hooks/useIsomorphicLayoutEffect.js +5 -0
  170. package/lib/components/react-photo-view/hooks/useMethods.d.ts +4 -0
  171. package/lib/components/react-photo-view/hooks/useMethods.js +38 -0
  172. package/lib/components/react-photo-view/hooks/useMountedRef.d.ts +3 -0
  173. package/lib/components/react-photo-view/hooks/useMountedRef.js +14 -0
  174. package/lib/components/react-photo-view/hooks/useScrollPosition.d.ts +4 -0
  175. package/lib/components/react-photo-view/hooks/useScrollPosition.js +163 -0
  176. package/lib/components/react-photo-view/hooks/useSetState.d.ts +2 -0
  177. package/lib/components/react-photo-view/hooks/useSetState.js +18 -0
  178. package/lib/components/react-photo-view/hooks/useTargetScale.d.ts +4 -0
  179. package/lib/components/react-photo-view/hooks/useTargetScale.js +76 -0
  180. package/lib/components/react-photo-view/index.d.ts +4 -0
  181. package/lib/components/react-photo-view/index.js +12 -0
  182. package/lib/components/react-photo-view/photo-context.d.ts +11 -0
  183. package/lib/components/react-photo-view/photo-context.js +4 -0
  184. package/lib/components/react-photo-view/types.d.ts +196 -0
  185. package/lib/components/react-photo-view/types.js +2 -0
  186. package/lib/components/react-photo-view/utils/edgeHandle.d.ts +15 -0
  187. package/lib/components/react-photo-view/utils/edgeHandle.js +45 -0
  188. package/lib/components/react-photo-view/utils/getMultipleTouchPosition.d.ts +5 -0
  189. package/lib/components/react-photo-view/utils/getMultipleTouchPosition.js +14 -0
  190. package/lib/components/react-photo-view/utils/getPositionOnMoveOrScale.d.ts +9 -0
  191. package/lib/components/react-photo-view/utils/getPositionOnMoveOrScale.js +34 -0
  192. package/lib/components/react-photo-view/utils/getRotateSize.d.ts +4 -0
  193. package/lib/components/react-photo-view/utils/getRotateSize.js +14 -0
  194. package/lib/components/react-photo-view/utils/getSuitableImageSize.d.ts +10 -0
  195. package/lib/components/react-photo-view/utils/getSuitableImageSize.js +48 -0
  196. package/lib/components/react-photo-view/utils/isTouchDevice.d.ts +5 -0
  197. package/lib/components/react-photo-view/utils/isTouchDevice.js +7 -0
  198. package/lib/components/react-photo-view/utils/limitTarget.d.ts +5 -0
  199. package/lib/components/react-photo-view/utils/limitTarget.js +17 -0
  200. package/lib/components/react-photo-view/variables.d.ts +48 -0
  201. package/lib/components/react-photo-view/variables.js +51 -0
  202. package/lib/constants/ai-question.d.ts +9 -0
  203. package/lib/constants/ai-question.js +34 -5
  204. package/lib/enum/ai-question.d.ts +5 -2
  205. package/lib/enum/ai-question.js +3 -0
  206. package/lib/modules/ai-ability/Root.js +15 -4
  207. package/lib/modules/ai-ability-select/Root.js +2 -2
  208. package/lib/modules/ai-ability-select/interface.d.ts +1 -0
  209. package/lib/modules/ai-question/components/AiAnalysis/index.js +4 -1
  210. package/lib/modules/ai-question/components/BootVideo/index.js +1 -1
  211. package/lib/modules/ai-question/components/QuestionModel/Item.js +11 -6
  212. package/lib/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +15 -4
  213. package/lib/modules/ai-question/components/QuestionUpdate/Chioce.d.ts +17 -0
  214. package/lib/modules/ai-question/components/QuestionUpdate/Chioce.js +104 -0
  215. package/lib/modules/ai-question/components/QuestionUpdate/Form.js +35 -10
  216. package/lib/modules/ai-question/components/QuestionUpdate/RandomQuestion.js +12 -2
  217. package/lib/modules/ai-question/components/QuestionUpdate/Score.d.ts +15 -0
  218. package/lib/modules/ai-question/components/QuestionUpdate/Score.js +57 -0
  219. package/lib/modules/ai-question/components/QuestionUpdate/const.js +4 -0
  220. package/lib/modules/ai-question/components/QuestionUpdate/index.js +34 -16
  221. package/lib/modules/ai-question/components/QuestionUpdate/interface.d.ts +10 -0
  222. package/lib/modules/ai-question/components/QuestionUpdate/styled.d.ts +15 -0
  223. package/lib/modules/ai-question/components/QuestionUpdate/styled.js +56 -1
  224. package/lib/modules/ai-report/Root.js +1 -1
  225. package/lib/modules/ai-report/components/ScoreReport/Score.js +4 -1
  226. package/lib/modules/ai-report/components/VideoQuestion/Abilities.js +5 -3
  227. package/lib/modules/ai-report/components/VideoQuestion/BodyImages.d.ts +7 -0
  228. package/lib/modules/ai-report/components/VideoQuestion/BodyImages.js +45 -0
  229. package/lib/modules/ai-report/components/VideoQuestion/QuestionItem.js +8 -3
  230. package/lib/modules/ai-report/components/VideoQuestion/ScoreSlider.js +4 -4
  231. package/lib/modules/ai-report/components/VideoQuestion/SingleChoice.d.ts +8 -0
  232. package/lib/modules/ai-report/components/VideoQuestion/SingleChoice.js +33 -0
  233. package/lib/modules/ai-report/components/VideoQuestion/index.js +1 -1
  234. package/lib/modules/ai-report/components/VideoQuestion/interface.d.ts +2 -0
  235. package/lib/modules/ai-report/components/VideoQuestion/styled.d.ts +1 -0
  236. package/lib/modules/ai-report/components/VideoQuestion/styled.js +8 -2
  237. package/lib/modules/ai-report/interface.d.ts +19 -0
  238. package/lib/services/ai-ability.d.ts +1 -1
  239. package/lib/services/ai-ability.js +1 -1
  240. package/lib/store/ai-question/ai-analysis-store.js +0 -1
  241. package/package.json +2 -2
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
14
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
15
+ if (ar || !(i in from)) {
16
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
17
+ ar[i] = from[i];
18
+ }
19
+ }
20
+ return to.concat(ar || Array.prototype.slice.call(from));
21
+ };
22
+ var __importDefault = (this && this.__importDefault) || function (mod) {
23
+ return (mod && mod.__esModule) ? mod : { "default": mod };
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.VERIFICATION_SCORE = exports.MAX_SCORE_VALUE = exports.IS_INTEGER_REG = void 0;
27
+ var jsx_runtime_1 = require("react/jsx-runtime");
28
+ var styled_1 = require("./styled");
29
+ var utils_1 = require("../../../../utils/utils");
30
+ var fbm_ui_1 = require("fbm-ui");
31
+ var formik_1 = require("formik");
32
+ var react_1 = require("react");
33
+ var sortablejs_1 = __importDefault(require("sortablejs"));
34
+ /**
35
+ * 验证0-9的整数
36
+ */
37
+ exports.IS_INTEGER_REG = /^[0-9]\d*$/;
38
+ /**
39
+ * 可输入最大分值
40
+ */
41
+ exports.MAX_SCORE_VALUE = 100;
42
+ var VERIFICATION_SCORE = function (value) { return (value ? !exports.IS_INTEGER_REG.test(value) || Number(value) > exports.MAX_SCORE_VALUE : false); };
43
+ exports.VERIFICATION_SCORE = VERIFICATION_SCORE;
44
+ var Choice = function (_a) {
45
+ var _b;
46
+ var index = _a.index, item = _a.item, onChange = _a.onChange;
47
+ var ref = (0, react_1.useRef)();
48
+ var sortable = (0, react_1.useRef)();
49
+ var helper = (0, react_1.useRef)();
50
+ var handleOptionAdd = (0, react_1.useCallback)(function () {
51
+ var _a;
52
+ var optionItem = { key: (0, utils_1.uniqueId)(), content: '', score: 0 };
53
+ if (helper.current) {
54
+ (_a = helper.current) === null || _a === void 0 ? void 0 : _a.push(optionItem);
55
+ }
56
+ }, []);
57
+ (0, react_1.useEffect)(function () {
58
+ sortable.current && sortable.current.destroy();
59
+ sortable.current = new sortablejs_1.default(ref.current, {
60
+ handle: '.optionItemDragHandle',
61
+ animation: 150,
62
+ forceFallback: true,
63
+ onEnd: function (_a) {
64
+ var oldIndex = _a.oldIndex, newIndex = _a.newIndex;
65
+ if (helper.current) {
66
+ helper.current.move(oldIndex, newIndex);
67
+ }
68
+ },
69
+ });
70
+ }, [index, item, onChange, helper]);
71
+ (0, react_1.useEffect)(function () {
72
+ var _a;
73
+ if (!((_a = item === null || item === void 0 ? void 0 : item.options) === null || _a === void 0 ? void 0 : _a.length)) {
74
+ var optionItem = { key: (0, utils_1.uniqueId)(), content: '', score: 0 };
75
+ onChange('options', [optionItem], index);
76
+ }
77
+ }, [item, onChange, index]);
78
+ return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ width: "100%" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ ref: ref }, { children: ((_b = item === null || item === void 0 ? void 0 : item.options) === null || _b === void 0 ? void 0 : _b.length) > 0 && ((0, jsx_runtime_1.jsx)(formik_1.FieldArray, { name: "questions.".concat(index, ".options"), render: function (p) {
79
+ var _a;
80
+ helper.current = p;
81
+ return (_a = p.form.values.questions[index].options) === null || _a === void 0 ? void 0 : _a.map(function (v, i) {
82
+ var _a;
83
+ return ((0, jsx_runtime_1.jsxs)(styled_1.ChoiceItem, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.DragIndicatorIcon, { className: "optionItemDragHandle" }), (0, jsx_runtime_1.jsx)(styled_1.ChoiceIcon, { borderRadius: 2 }), (0, jsx_runtime_1.jsx)(fbm_ui_1.FormItem, __assign({ required: true, name: "questions[".concat(index, "].options[").concat(i, "].content"), placeholder: "\u65B0\u9009\u9879", InputProps: {
84
+ variant: 'standard',
85
+ multiline: true,
86
+ sx: {
87
+ mr: 1.5,
88
+ },
89
+ }, sx: { height: 'auto', flexGrow: 1, overflow: 'hidden' } }, { children: (0, jsx_runtime_1.jsx)(styled_1.ChoiceItemInput, { multiline: true, maxRows: 3, placeholder: "\u65B0\u9009\u9879", variant: "standard" }) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.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 && ((0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ className: "choice-item-delete-icon", onClick: function () { return p.remove(i); } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.CloseIcon, {}) }))) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.FormItem, __assign({ required: true, name: "questions[".concat(index, "].options[").concat(i, "].score"), placeholder: "\u5206\u503C", InputProps: {
90
+ multiline: true,
91
+ }, rules: [function (_a) {
92
+ var value = _a.value;
93
+ return (0, exports.VERIFICATION_SCORE)(value);
94
+ }], sx: { height: 'auto', widht: 84 }, onChange: function (e) {
95
+ var value = e.target.value;
96
+ if ((0, exports.VERIFICATION_SCORE)(value) || Number(value) > exports.MAX_SCORE_VALUE || Number(value) < 1) {
97
+ return;
98
+ }
99
+ 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);
100
+ } }, { children: (0, jsx_runtime_1.jsx)(styled_1.ScoreInput, { size: "small", placeholder: "\u5206\u503C", endAdornment: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "caption" }, { children: "\u5206" })) }) }))] }, v.key || (0, utils_1.uniqueId)()));
101
+ });
102
+ } })) })), (0, jsx_runtime_1.jsx)(styled_1.ChoiceItem, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ icon: (0, jsx_runtime_1.jsx)(fbm_ui_1.AddIcon, {}), variant: "outlined", color: "inherit", size: "small", onClick: handleOptionAdd, sx: { ml: -2 } }, { children: "\u6DFB\u52A0\u9009\u9879" })) })] })));
103
+ };
104
+ exports.default = Choice;
@@ -61,6 +61,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
61
61
  Object.defineProperty(exports, "__esModule", { value: true });
62
62
  var jsx_runtime_1 = require("react/jsx-runtime");
63
63
  var AiAnalysis_1 = __importDefault(require("../AiAnalysis"));
64
+ var Chioce_1 = __importDefault(require("./Chioce"));
64
65
  var const_1 = require("./const");
65
66
  var RandomQuestion_1 = __importDefault(require("./RandomQuestion"));
66
67
  var VideoVoice_1 = __importDefault(require("./VideoVoice"));
@@ -121,6 +122,7 @@ var QuestionForm = (0, react_1.forwardRef)(function (props, ref) {
121
122
  (0, react_1.useImperativeHandle)(ref, function () { return ({
122
123
  handleValues: function () { return form.values; },
123
124
  handleSubmit: function () { return form.handleSubmit(); },
125
+ errors: function () { return form.errors; },
124
126
  setFormValues: function (values) { return form.setValues(__assign(__assign({}, form.values), values)); },
125
127
  }); });
126
128
  (0, react_1.useEffect)(function () {
@@ -144,16 +146,39 @@ var QuestionForm = (0, react_1.forwardRef)(function (props, ref) {
144
146
  define: define,
145
147
  isWorkplace: isWorkplace,
146
148
  });
147
- }), onChange: handleCategoryChange }) })))] })), (form === null || form === void 0 ? void 0 : form.values.broadcastType) === 1 || preview ? ((0, jsx_runtime_1.jsx)(formik_1.FieldArray, { name: "questions", render: function () {
148
- var _a;
149
- return (_a = form.values.questions) === null || _a === void 0 ? void 0 : _a.map(function (_, index) { return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", justifyContent: "space-between", spacing: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.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: {
150
- rows: 3,
151
- multiline: true,
152
- sx: { padding: 0 },
153
- }, sx: { flexGrow: 1, height: 120 } }), form.values.questions.length > 1 && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ height: 84, pt: 1 }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ size: "small", onClick: function () {
154
- form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], form.values.questions.filter(function (_, i) { return i !== index; }), true) }));
155
- } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.CloseIcon, {}) })) })))] }), index)); });
156
- } })) : ((0, jsx_runtime_1.jsx)(VideoVoice_1.default, {})), !preview && aiShowType === ai_question_1.ADD_QUESTION_TYPE.FREE && ((0, jsx_runtime_1.jsx)(RandomQuestion_1.default, { 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 () {
149
+ }), onChange: handleCategoryChange }) })))] })), aiShowType !== ai_question_1.ADD_QUESTION_TYPE.SINGLECHIOCE &&
150
+ ((form === null || form === void 0 ? void 0 : form.values.broadcastType) === 1 || preview ? ((0, jsx_runtime_1.jsx)(formik_1.FieldArray, { name: "questions", render: function () {
151
+ var _a;
152
+ return (_a = form.values.questions) === null || _a === void 0 ? void 0 : _a.map(function (_, index) { return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", justifyContent: "space-between", spacing: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.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: {
153
+ rows: 3,
154
+ multiline: true,
155
+ sx: { padding: 0 },
156
+ }, sx: { flexGrow: 1, height: 120 } }), form.values.questions.length > 1 && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ height: 84, pt: 1 }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ size: "small", onClick: function () {
157
+ form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], form.values.questions.filter(function (_, i) { return i !== index; }), true) }));
158
+ } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.CloseIcon, {}) })) })))] }), index)); });
159
+ } })) : ((0, jsx_runtime_1.jsx)(VideoVoice_1.default, {}))), !preview && aiShowType === ai_question_1.ADD_QUESTION_TYPE.SINGLECHIOCE && (
160
+ // @ts-ignore
161
+ (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, { children: (0, jsx_runtime_1.jsx)(formik_1.FieldArray, { name: "questions", render: function () {
162
+ var _a;
163
+ return (_a = form.values.questions) === null || _a === void 0 ? void 0 : _a.map(function (v, index) {
164
+ var _a, _b;
165
+ return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ px: 2, pb: 2, pt: 0.5, mb: 2, boxSizing: "border-box", component: mui_1.Paper, variant: "outlined", width: "100%", justifyContent: "space-between", spacing: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.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 && ((0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ size: "small", sx: { mr: -1 }, onClick: function () {
166
+ form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], form.values.questions.filter(function (_, i) { return i !== index; }), true) }));
167
+ } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.DeleteIcon, {}) }))) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.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: {
168
+ // rows: 3,
169
+ maxRows: 3,
170
+ minRows: 1,
171
+ multiline: true,
172
+ sx: { padding: 0 },
173
+ }, sx: {
174
+ flexGrow: 1,
175
+ height: 'auto',
176
+ } }), (0, jsx_runtime_1.jsx)(Chioce_1.default, { index: index, item: v, onChange: function (_, options, i) {
177
+ form.values.questions[index].options = options;
178
+ form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], form.values.questions, true) }));
179
+ } })] }), index));
180
+ });
181
+ } }) })), !preview && aiShowType !== ai_question_1.ADD_QUESTION_TYPE.LANGUAGE && ((0, jsx_runtime_1.jsx)(RandomQuestion_1.default, { 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 () {
157
182
  form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray(__spreadArray([], form.values.questions, true), [{ content: '', videoUrl: '' }], false) }));
158
183
  }, onAddRandomQuestion: function (qs) {
159
184
  form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray(__spreadArray([], form.values.questions, true), qs.map(function (v) { return ({ content: v, videoUrl: '' }); }), true) }));
@@ -16,6 +16,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  var jsx_runtime_1 = require("react/jsx-runtime");
18
18
  var SelectQuestion_1 = __importDefault(require("./SelectQuestion"));
19
+ var ai_question_1 = require("../../../../enum/ai-question");
19
20
  var question_update_store_1 = require("../../../../store/ai-question/question-update-store");
20
21
  var fbm_ui_1 = require("fbm-ui");
21
22
  var mui_1 = require("fbm-ui/lib/mui");
@@ -23,7 +24,7 @@ var mui_2 = require("fbm-ui/lib/mui");
23
24
  var react_1 = require("react");
24
25
  var RandomQuestion = function (_a) {
25
26
  var _b, _c;
26
- var broadcastType = _a.broadcastType, onAddCustonQuestion = _a.onAddCustonQuestion, onAddRandomQuestion = _a.onAddRandomQuestion, category = _a.category;
27
+ var broadcastType = _a.broadcastType, onAddCustonQuestion = _a.onAddCustonQuestion, onAddRandomQuestion = _a.onAddRandomQuestion, category = _a.category, aiShowType = _a.aiShowType;
27
28
  var _d = (0, question_update_store_1.useUpdateQuestionStore)(function (store) { return [store.questionState]; }), questionState = _d.questionState, updateQuestionState = _d.updateQuestionState;
28
29
  var _e = (0, react_1.useState)(false), open = _e[0], setOpen = _e[1];
29
30
  var item = questionState.item;
@@ -58,6 +59,15 @@ var RandomQuestion = function (_a) {
58
59
  item: __assign(__assign({}, item), { videoBroadcast: __assign(__assign({}, item === null || item === void 0 ? void 0 : item.videoBroadcast), (_a = {}, _a[key] = checked ? 1 : 2, _a)) }),
59
60
  });
60
61
  };
61
- return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Layout, { children: [(0, jsx_runtime_1.jsxs)(mui_2.Stack, __assign({ spacing: 2, mb: 1, direction: "row", alignItems: "center", justifyContent: "space-between", mt: 0.375 }, { children: [(0, jsx_runtime_1.jsxs)(mui_2.Stack, __assign({ spacing: 1, direction: "row", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Popactions, __assign({ actions: actions, trigger: "click", isClickAway: true, sx: { height: 1 } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "outlined", color: "inherit", icon: (0, jsx_runtime_1.jsx)(fbm_ui_1.AddIcon, {}) }, { children: "\u968F\u673A\u9762\u8BD5\u5185\u5BB9" })) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: desc, placement: "bottom-start" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", sx: { ml: 1, height: 48 } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.InfoIcon, { sx: { color: 'rgba(0, 0, 0, 0.26)', fontSize: 16 } }) })) }))] })), (0, jsx_runtime_1.jsx)(mui_2.Stack, __assign({ spacing: 1, direction: "row", alignItems: "center", mb: 2 }, { children: isVideoBroadcast && ((0, jsx_runtime_1.jsx)(mui_1.FormGroup, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex" }, { children: [(0, jsx_runtime_1.jsx)(mui_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(mui_1.Checkbox, { checked: ((_b = item === null || item === void 0 ? void 0 : item.videoBroadcast) === null || _b === void 0 ? void 0 : _b.videoRetry) === 1 }), label: (0, jsx_runtime_1.jsx)(mui_1.Typography, __assign({ variant: "body2" }, { children: "\u5141\u8BB8\u91CD\u590D\u542C\u9898" })), onChange: function (e, checked) { return handleVideoBroadcastChange('videoRetry', checked); } }), (0, jsx_runtime_1.jsx)(mui_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(mui_1.Checkbox, { checked: ((_c = item === null || item === void 0 ? void 0 : item.videoBroadcast) === null || _c === void 0 ? void 0 : _c.videoSkip) === 1 }), label: (0, jsx_runtime_1.jsx)(mui_1.Typography, __assign({ variant: "body2" }, { children: "\u5141\u8BB8\u8DF3\u8FC7" })), onChange: function (e, checked) { return handleVideoBroadcastChange('videoSkip', checked); } })] })) })) }))] })), open && (0, jsx_runtime_1.jsx)(SelectQuestion_1.default, { token: category === null || category === void 0 ? void 0 : category.token, open: open, onClose: function () { return setOpen(false); }, onOk: onAddRandomQuestion })] }));
62
+ var handleEnableScoreOptimizationStatus = function () {
63
+ updateQuestionState({
64
+ item: __assign(__assign({}, item), { enableScoreOptimization: !item.enableScoreOptimization }),
65
+ });
66
+ };
67
+ return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Layout, { children: [(0, jsx_runtime_1.jsxs)(mui_2.Stack, __assign({ spacing: 2, mb: 1, direction: "row", alignItems: "center", justifyContent: "space-between", mt: 0.375 }, { children: [(0, jsx_runtime_1.jsxs)(mui_2.Stack, __assign({ spacing: 1, direction: "row", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Popactions, __assign({ actions: aiShowType === ai_question_1.ADD_QUESTION_TYPE.SINGLECHIOCE ? [actions[1]] : actions, trigger: "click", isClickAway: true, sx: { height: 1 } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "outlined", color: "inherit", icon: (0, jsx_runtime_1.jsx)(fbm_ui_1.AddIcon, {}) }, { children: "\u968F\u673A\u9762\u8BD5\u5185\u5BB9" })) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: desc, placement: "bottom-start" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", sx: { ml: 1, height: 48 } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.InfoIcon, { sx: { color: 'rgba(0, 0, 0, 0.26)', fontSize: 16 } }) })) }))] })), (0, jsx_runtime_1.jsxs)(mui_2.Stack, __assign({ spacing: 1, direction: "row", alignItems: "center", mb: 2 }, { children: [isVideoBroadcast && ((0, jsx_runtime_1.jsxs)(mui_2.Stack, __assign({ spacing: 1, direction: "row" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Checkbox, { sx: {
68
+ mr: 0,
69
+ }, checked: ((_b = item === null || item === void 0 ? void 0 : item.videoBroadcast) === null || _b === void 0 ? void 0 : _b.videoRetry) === 1, label: (0, jsx_runtime_1.jsx)(mui_1.Typography, __assign({ variant: "body2" }, { children: "\u5141\u8BB8\u91CD\u590D\u542C\u9898" })), onChange: function (e, checked) { return handleVideoBroadcastChange('videoRetry', checked); } }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Checkbox, { sx: {
70
+ mr: 0,
71
+ }, checked: ((_c = item === null || item === void 0 ? void 0 : item.videoBroadcast) === null || _c === void 0 ? void 0 : _c.videoSkip) === 1, label: (0, jsx_runtime_1.jsx)(mui_1.Typography, __assign({ variant: "body2" }, { children: "\u5141\u8BB8\u8DF3\u8FC7" })), onChange: function (e, checked) { return handleVideoBroadcastChange('videoSkip', checked); } })] }))), item.type === 1 && item.aiShowType === 1 && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Checkbox, { checked: item === null || item === void 0 ? void 0 : item.enableScoreOptimization, label: (0, jsx_runtime_1.jsxs)(mui_1.Typography, __assign({ variant: "body2", display: "flex" }, { children: ["\u56DE\u7B54\u8FC7\u77ED\u6263\u5206", (0, jsx_runtime_1.jsx)(fbm_ui_1.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: (0, jsx_runtime_1.jsx)("span", __assign({ style: { display: 'flex', alignItems: 'center', marginLeft: '8px' } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.InfoIcon, { sx: { fontSize: 14, color: 'rgba(0, 0, 0, 0.26)' } }) })) }))] })), onChange: handleEnableScoreOptimizationStatus }))] }))] })), open && (0, jsx_runtime_1.jsx)(SelectQuestion_1.default, { token: category === null || category === void 0 ? void 0 : category.token, open: open, onClose: function () { return setOpen(false); }, onOk: onAddRandomQuestion })] }));
62
72
  };
63
73
  exports.default = RandomQuestion;
@@ -0,0 +1,15 @@
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
+ declare const Score: ({ label, ...props }: {
12
+ [x: string]: any;
13
+ label: any;
14
+ }) => JSX.Element;
15
+ export default Score;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.VERIFICATION_SCORE = exports.MAX_SCORE_VALUE = exports.IS_INTEGER_REG = void 0;
26
+ var jsx_runtime_1 = require("react/jsx-runtime");
27
+ var styled_1 = require("./styled");
28
+ var fbm_ui_1 = require("fbm-ui");
29
+ var formik_1 = require("formik");
30
+ /**
31
+ * 验证0-9的整数
32
+ */
33
+ exports.IS_INTEGER_REG = /^[0-9]\d*$/;
34
+ /**
35
+ * 可输入最大分值
36
+ */
37
+ exports.MAX_SCORE_VALUE = 100;
38
+ // rules={[({ value }) => VERIFICATION_SCORE(value as string)]}
39
+ // sx={{ height: 'auto', widht: 84 }}
40
+ // onChange={e => {
41
+ // const value = e.target.value;
42
+ // if (VERIFICATION_SCORE(value) || Number(value) > MAX_SCORE_VALUE || Number(value) < 1) {
43
+ // console.log('>>>>>>');
44
+ // return;
45
+ // }
46
+ // // onChange('options', [...(item?.options || []).map((v, index) => (i === index ? { ...v, score: Number(value) } : v))], index);
47
+ // }}
48
+ var VERIFICATION_SCORE = function (value) { return (value ? !exports.IS_INTEGER_REG.test(value) || Number(value) > exports.MAX_SCORE_VALUE : false); };
49
+ exports.VERIFICATION_SCORE = VERIFICATION_SCORE;
50
+ var Score = function (_a) {
51
+ var label = _a.label, props = __rest(_a, ["label"]);
52
+ // @ts-ignore
53
+ var _b = (0, formik_1.useField)(props), field = _b[0], meta = _b[1], helpers = _b[2];
54
+ console.log(field, meta, helpers);
55
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(styled_1.ScoreInput, __assign({}, field, props, { size: "small", placeholder: "\u5206\u503C", endAdornment: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "caption" }, { children: "\u5206" })) })) }));
56
+ };
57
+ exports.default = Score;
@@ -30,6 +30,8 @@ exports.defaultQuestionParams = {
30
30
  weight: 0,
31
31
  token: '',
32
32
  originToken: '',
33
+ isOpenAIFollowUp: false,
34
+ enableScoreOptimization: false,
33
35
  };
34
36
  // 播报方式
35
37
  exports.broadcastModeOptions = [
@@ -55,5 +57,7 @@ exports.durationOptions = [
55
57
  { value: 30, label: '30s' },
56
58
  { value: 60, label: '1m' },
57
59
  { value: 180, label: '3m' },
60
+ { value: 300, label: '5m' },
61
+ { value: 600, label: '10m' },
58
62
  { value: 1200, label: '20m' },
59
63
  ];
@@ -64,9 +64,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
64
64
  var jsx_runtime_1 = require("react/jsx-runtime");
65
65
  var const_1 = require("./const");
66
66
  var Form_1 = __importDefault(require("./Form"));
67
+ var ai_question_1 = require("../../../../constants/ai-question");
68
+ var ai_question_2 = require("../../../../enum/ai-question");
67
69
  var question_ability_store_1 = require("../../../../store/ai-ability/question-ability-store");
68
70
  var ScrollDialogContent_1 = __importDefault(require("../../../../components/ScrollDialogContent"));
69
- var ai_question_1 = require("../../../../enum/ai-question");
70
71
  var ai_analysis_store_1 = require("../../../../store/ai-question/ai-analysis-store");
71
72
  var question_model_store_1 = require("../../../../store/ai-question/question-model-store");
72
73
  var question_update_store_1 = require("../../../../store/ai-question/question-update-store");
@@ -98,18 +99,21 @@ var QuestionUpdate = function () {
98
99
  category: (item === null || item === void 0 ? void 0 : item.category) ? { label: (item === null || item === void 0 ? void 0 : item.category[0]) || '', value: (item === null || item === void 0 ? void 0 : item.category[0]) || '' } : { label: '', value: '' },
99
100
  };
100
101
  var CustomHeader = function () {
101
- var content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(mui_1.MenuItem, __assign({ sx: { backgroundColor: aiShowType === ai_question_1.ADD_QUESTION_TYPE.FREE ? 'rgba(76, 175, 80, 0.08)' : 'rgba(255, 255, 255, 1)' }, onClick: function () {
102
- var _a;
103
- setSwitchTypeOpen(false);
104
- (_a = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _a === void 0 ? void 0 : _a.setFormValues({ broadcastType: const_1.defaultQuestionParams.broadcastType });
105
- updateQuestionState({ aiShowType: ai_question_1.ADD_QUESTION_TYPE.FREE });
106
- } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2" }, { children: "\u81EA\u7531\u4F5C\u7B54" })) })), (0, jsx_runtime_1.jsx)(mui_1.MenuItem, __assign({ sx: { backgroundColor: aiShowType === ai_question_1.ADD_QUESTION_TYPE.LANGUAGE ? 'rgba(76, 175, 80, 0.08)' : 'rgba(255, 255, 255, 1)' }, onClick: function () {
107
- var _a;
108
- setSwitchTypeOpen(false);
109
- (_a = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _a === void 0 ? void 0 : _a.setFormValues({ broadcastType: const_1.defaultQuestionParams.broadcastType });
110
- updateQuestionState({ aiShowType: ai_question_1.ADD_QUESTION_TYPE.LANGUAGE });
111
- } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2" }, { children: "\u6717\u8BFB\u9898" })) }))] }));
112
- return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", height: 56 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ ml: 3, variant: "subtitle1" }, { children: aiShowType === ai_question_1.ADD_QUESTION_TYPE.FREE ? '自由作答' : '朗读题' })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Popover, __assign({ open: switchTypeOpen, content: content, onClickAway: function () { return setSwitchTypeOpen(false); } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "text", size: "small", sx: { fontSize: 12, color: 'rgb(87, 107, 149)' }, onClick: function () { return setSwitchTypeOpen(true); } }, { children: "\u5207\u6362\u9898\u578B" })) }))] })));
102
+ var content = ai_question_1.ADD_QUESTION_TYPE_SHOW_LIST.map(function (_a) {
103
+ var title = _a.title, type = _a.type;
104
+ return ((0, jsx_runtime_1.jsx)(mui_1.MenuItem, __assign({ sx: { backgroundColor: aiShowType === type ? 'rgba(76, 175, 80, 0.08)' : 'rgba(255, 255, 255, 1)' }, onClick: function () {
105
+ var _a;
106
+ setSwitchTypeOpen(false);
107
+ (_a = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _a === void 0 ? void 0 : _a.setFormValues({ broadcastType: const_1.defaultQuestionParams.broadcastType });
108
+ if (type === ai_question_2.ADD_QUESTION_TYPE.SINGLECHIOCE) {
109
+ updateQuestionState({ aiShowType: type, item: __assign(__assign({}, item), { type: ai_question_2.QUESTION_TYPE.SINGLECHIOCE }) });
110
+ }
111
+ else {
112
+ updateQuestionState({ aiShowType: type });
113
+ }
114
+ } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2" }, { children: title })) }), "question_type_".concat(type)));
115
+ });
116
+ return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", height: 56 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ ml: 3, variant: "subtitle1" }, { children: ai_question_1.QUESTION_TYPE_TITLE_MAP[aiShowType] })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Popover, __assign({ open: switchTypeOpen, content: content, onClickAway: function () { return setSwitchTypeOpen(false); } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "text", size: "small", sx: { fontSize: 12, color: 'rgb(87, 107, 149)' }, onClick: function () { return setSwitchTypeOpen(true); } }, { children: "\u5207\u6362\u9898\u578B" })) }))] })));
113
117
  };
114
118
  var getModelParams = (0, react_1.useCallback)(function (values, isSubmit) {
115
119
  return new Promise(function (resolve, reject) {
@@ -189,9 +193,23 @@ var QuestionUpdate = function () {
189
193
  }
190
194
  });
191
195
  }); }, [getModelParams, item, updateQuestionState]);
192
- var handleOk = function () { return __awaiter(void 0, void 0, void 0, function () { var _a; return __generator(this, function (_b) {
193
- return [2 /*return*/, (_a = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _a === void 0 ? void 0 : _a.handleSubmit()];
194
- }); }); };
196
+ var handleOk = function () { return __awaiter(void 0, void 0, void 0, function () {
197
+ var _a;
198
+ return __generator(this, function (_b) {
199
+ switch (_b.label) {
200
+ case 0: return [4 /*yield*/, ((_a = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _a === void 0 ? void 0 : _a.handleSubmit())];
201
+ case 1:
202
+ _b.sent();
203
+ setTimeout(function () {
204
+ var _a;
205
+ if (Object.keys(((_a = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _a === void 0 ? void 0 : _a.errors()) || {}).length > 0) {
206
+ fbm_ui_1.Message.error('有必填项未填');
207
+ }
208
+ }, 200);
209
+ return [2 /*return*/];
210
+ }
211
+ });
212
+ }); };
195
213
  var handleSubmit = (0, react_1.useCallback)(function (values) { return __awaiter(void 0, void 0, void 0, function () {
196
214
  var _a, errorIndexes, params, _b, minResponseDuration, duration;
197
215
  return __generator(this, function (_c) {
@@ -1,12 +1,18 @@
1
1
  import { BaseAiAbilityParams, BaseExtraParams } from '@/modules/ai-question/interface';
2
+ import type { FormikErrors } from 'formik';
2
3
  export interface VideoBroadcastParams {
3
4
  videoRetry?: number;
4
5
  videoUrl?: string;
5
6
  videoSkip?: number;
6
7
  }
8
+ export interface Option {
9
+ content: string;
10
+ score: number;
11
+ }
7
12
  export interface Question {
8
13
  content: string;
9
14
  videoUrl: string;
15
+ options?: Option[];
10
16
  }
11
17
  export interface QuestionParams {
12
18
  name: string;
@@ -20,6 +26,8 @@ export interface QuestionParams {
20
26
  minResponseDuration?: number;
21
27
  category?: string[];
22
28
  extra: BaseExtraParams;
29
+ isOpenAIFollowUp: boolean;
30
+ enableScoreOptimization: boolean;
23
31
  broadcastType: number;
24
32
  aiSwitch?: number;
25
33
  aiType: number;
@@ -67,11 +75,13 @@ export interface UpdateQuestionState {
67
75
  export interface FormRef {
68
76
  handleValues: () => QuestionFormValues;
69
77
  handleSubmit: () => void;
78
+ errors: () => FormikErrors<QuestionFormValues>;
70
79
  setFormValues: (values: Partial<QuestionFormValues>) => void;
71
80
  }
72
81
  export interface RandomQuestionProps {
73
82
  broadcastType: number;
74
83
  category: any;
84
+ aiShowType: number;
75
85
  onAddCustonQuestion?: () => void;
76
86
  onAddRandomQuestion?: (qs: string[]) => void;
77
87
  }
@@ -4,3 +4,18 @@ export declare const VideoPreviewWrapper: import("@emotion/styled").StyledCompon
4
4
  export declare const VideoPreviewMask: import("@emotion/styled").StyledComponent<import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
5
5
  export declare const VideoPreviewMaskContent: import("@emotion/styled").StyledComponent<import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
6
  export declare const VideoPreviewMaskIcon: import("@emotion/styled").StyledComponent<import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
7
+ export declare const SmallSelect: import("@emotion/styled").StyledComponent<import("fbm-ui").SelectProps & {
8
+ children?: import("react").ReactNode;
9
+ } & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
10
+ export declare const ScoreInput: import("@emotion/styled").StyledComponent<import("fbm-ui").BaseInputProps & import("@mui/material").OutlinedInputProps & import("@mui/material").InputProps & {
11
+ children?: import("react").ReactNode;
12
+ } & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
13
+ export declare const ChoiceIcon: import("@emotion/styled").StyledComponent<import("fbm-ui/lib/components/Box").BoxProps & {
14
+ children?: import("react").ReactNode;
15
+ } & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
16
+ export declare const ChoiceItem: import("@emotion/styled").StyledComponent<import("fbm-ui/lib/components/Box").BoxProps & {
17
+ children?: import("react").ReactNode;
18
+ } & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
19
+ export declare const ChoiceItemInput: import("@emotion/styled").StyledComponent<import("fbm-ui").BaseInputProps & import("@mui/material").OutlinedInputProps & import("@mui/material").InputProps & {
20
+ children?: import("react").ReactNode;
21
+ } & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VideoPreviewMaskIcon = exports.VideoPreviewMaskContent = exports.VideoPreviewMask = exports.VideoPreviewWrapper = exports.VideoPreview = void 0;
3
+ exports.ChoiceItemInput = exports.ChoiceItem = exports.ChoiceIcon = exports.ScoreInput = exports.SmallSelect = exports.VideoPreviewMaskIcon = exports.VideoPreviewMaskContent = exports.VideoPreviewMask = exports.VideoPreviewWrapper = exports.VideoPreview = void 0;
4
4
  var fbm_ui_1 = require("fbm-ui");
5
5
  exports.VideoPreview = (0, fbm_ui_1.styled)('video')({
6
6
  width: '100%',
@@ -53,3 +53,58 @@ exports.VideoPreviewMaskIcon = (0, fbm_ui_1.styled)('div')({
53
53
  backgroundColor: 'rgba(0, 0, 0, 0.8)',
54
54
  },
55
55
  });
56
+ exports.SmallSelect = (0, fbm_ui_1.styled)(fbm_ui_1.Select)({
57
+ width: 62,
58
+ height: 32,
59
+ '& .MuiOutlinedInput-notchedOutline': {
60
+ border: 'none',
61
+ },
62
+ });
63
+ exports.ScoreInput = (0, fbm_ui_1.styled)(fbm_ui_1.Input)({
64
+ width: 84,
65
+ flexShrink: 0,
66
+ });
67
+ exports.ChoiceIcon = (0, fbm_ui_1.styled)(fbm_ui_1.Box)({
68
+ width: 16,
69
+ height: 16,
70
+ border: '1px solid rgba(0, 0, 0, 0.08)',
71
+ flexShrink: 0,
72
+ });
73
+ exports.ChoiceItem = (0, fbm_ui_1.styled)(fbm_ui_1.Box)({
74
+ minHeight: 40,
75
+ display: 'flex',
76
+ alignItems: 'center',
77
+ paddingLeft: 16,
78
+ '& .choice-item-delete-icon': {
79
+ display: 'none',
80
+ },
81
+ '& .optionItemDragHandle': {
82
+ position: 'absolute',
83
+ left: -8,
84
+ cursor: 'move',
85
+ display: 'none',
86
+ },
87
+ '& .MuiFormHelperText-root': {
88
+ display: 'none',
89
+ },
90
+ '&:hover': {
91
+ '& .choice-item-delete-icon': {
92
+ display: 'inline-flex',
93
+ },
94
+ '& .optionItemDragHandle': {
95
+ display: 'block',
96
+ },
97
+ },
98
+ });
99
+ exports.ChoiceItemInput = (0, fbm_ui_1.styled)(fbm_ui_1.Input)({
100
+ margin: '0 16px 0 12px',
101
+ fontSize: 14,
102
+ position: 'relative',
103
+ top: 0.5,
104
+ '&::after': {
105
+ bottom: '1px',
106
+ },
107
+ '&::before': {
108
+ display: 'none',
109
+ },
110
+ });
@@ -75,7 +75,7 @@ var AiReportRoot = (0, react_1.forwardRef)(function (props, ref) {
75
75
  else {
76
76
  return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsx)(NotFinish_1.default, {}), (collection === null || collection === void 0 ? void 0 : collection.length) > 0 && (0, jsx_runtime_1.jsx)(ScoreReport_1.default, { customScore: customScore, onRefreshSuccess: handleRefreshSuccess }), (workplaces === null || workplaces === void 0 ? void 0 : workplaces.length) > 0 && (0, jsx_runtime_1.jsx)(WorkPlaces_1.default, {}), (collection === null || collection === void 0 ? void 0 : collection.length) > 0 && (0, jsx_runtime_1.jsx)(AIEvaluate_1.default, {}), (0, jsx_runtime_1.jsx)(Suggestion_1.default, {}), (0, jsx_runtime_1.jsx)(VideoQuestion_1.default, {})] }));
77
77
  }
78
- }, [handleRefreshSuccess, onSendReminderClick, reminderSent, status, operableButtons, collection, workplaces]);
78
+ }, [handleRefreshSuccess, onSendReminderClick, customScore, reminderSent, status, operableButtons, collection, workplaces]);
79
79
  return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ loading: firstLoad.current && loading, sx: { width: '100%', minHeight: '584px', height: '100%', margin: '0 auto', overflow: 'auto' } }, { children: aiReportResult })));
80
80
  });
81
81
  AiReportRoot.displayName = 'AiReportRoot';
@@ -34,9 +34,12 @@ var Score = function (_a) {
34
34
  if (typeof customScore === 'number' && customScore > -1) {
35
35
  setScore(customScore);
36
36
  }
37
+ else {
38
+ setScore(score || 0);
39
+ }
37
40
  if (!loading)
38
41
  setOpenRefresh(false);
39
- }, [loading, customScore]);
42
+ }, [loading, customScore, score]);
40
43
  var content = ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ padding: 2 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body1", color: "secondary" }, { children: "\u5237\u65B0\u540E\u5C06\u6309\u6700\u65B0\u7B97\u5206\u89C4\u5219\u8BA1\u7B97\uFF0C\u662F\u5426\u786E\u8BA4\u5237\u65B0" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ paddingTop: 1, textAlign: "right" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ loading: loading, onClick: onRefresh }, { children: "\u5237\u65B0" })) }))] })));
41
44
  return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", sx: { padding: '24px' } }, { children: [(0, jsx_runtime_1.jsx)(RankingRange_1.default, { open: openRankingRange, onClose: function () { return setOpenRankingRange(false); } }), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ flex: "1 0" }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsxs)(styled_1.ScoreTypography, { children: [(0, utils_1.formatScore)(feScore || 0), (0, jsx_runtime_1.jsx)(styled_1.ScoreUnitTypography, __assign({ variant: "caption" }, { children: "\u5206" }))] }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ width: 50, height: 50 }, { children: !!feScore && feScore >= 80 && (0, jsx_runtime_1.jsx)("img", { src: "//webcdn.fbmms.cn/web/saas/asset/image/recommended.svg", alt: "" }) })), (operableButtons === null || operableButtons === void 0 ? void 0 : operableButtons.includes('export')) && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "outlined", size: "small", icon: (0, jsx_runtime_1.jsx)(fbm_ui_1.DownloadIcon, {}), sx: { ml: 1 }, onClick: onExportReportClick }, { children: "\u5BFC\u51FA\u62A5\u544A" })))] })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", mt: 1 }, { children: [(operableButtons === null || operableButtons === void 0 ? void 0 : operableButtons.includes('refresh')) && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Popover, __assign({ open: openRefresh, content: content, onClickAway: function () { return setOpenRefresh(false); } }, { children: (0, jsx_runtime_1.jsx)(styled_1.RefreshIconRoot, { onClick: function () { return setOpenRefresh(true); } }) }))), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "secondary", ml: 0.5 }, { children: ["\u62A5\u544A\u751F\u6210\u4E8E ", (0, dayjs_1.default)(createTime && createTime * 1000).format('YYYY-MM-DD HH:mm')] })), (operableButtons === null || operableButtons === void 0 ? void 0 : operableButtons.includes('scoreRank')) && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "text", size: "small", sx: { textDecoration: 'underline' }, onClick: function () { return setOpenRankingRange(true); } }, { children: "\u6392\u540D\u533A\u95F4\u8BBE\u7F6E" })))] }))] })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ width: 200 }, { children: (0, jsx_runtime_1.jsx)(Bar_1.default, {}) }))] })));
42
45
  };
@@ -21,11 +21,13 @@ var fbm_ui_1 = require("fbm-ui");
21
21
  var immutability_helper_1 = __importDefault(require("immutability-helper"));
22
22
  var react_1 = require("react");
23
23
  var Abilities = function (_a) {
24
- var stepIndex = _a.stepIndex;
24
+ var stepIndex = _a.stepIndex, disabledScore = _a.disabledScore;
25
25
  var _b = (0, global_store_1.useAiReportStore)(function (store) { return [store.reportResult]; }), reportResult = _b.reportResult, updateReportResult = _b.updateReportResult, onScoreChange = _b.onScoreChange;
26
26
  var steps = (reportResult || {}).steps;
27
27
  var handleChangeCommitted = (0, react_1.useCallback)(function (score, index, type) {
28
28
  var _a, _b;
29
+ if (disabledScore)
30
+ return;
29
31
  var newSteps = (0, immutability_helper_1.default)(steps, (_a = {}, _a[stepIndex] = { scoreInfo: { abilities: (_b = {}, _b[index] = { finalScore: { $set: score } }, _b) } }, _a));
30
32
  updateReportResult(__assign(__assign({}, reportResult), { steps: newSteps }));
31
33
  onScoreChange &&
@@ -35,11 +37,11 @@ var Abilities = function (_a) {
35
37
  type: 2,
36
38
  score: score,
37
39
  });
38
- }, [stepIndex, reportResult, steps, updateReportResult, onScoreChange]);
40
+ }, [stepIndex, reportResult, steps, updateReportResult, onScoreChange, disabledScore]);
39
41
  return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ mt: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "secondary", mb: 1 }, { children: "\u5206\u503C\u8BA1\u7B97\u89C4\u5219\uFF1A\u7EFC\u5408\u8BC4\u5206=AI\u8BC4\u5206*\u5355\u9898\u6743\u91CD" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ mt: 3 }, { children: steps &&
40
42
  steps[stepIndex].scoreInfo.abilities.map(function (_a, index) {
41
43
  var name = _a.name, originScore = _a.originScore, finalScore = _a.finalScore;
42
- return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2" }, { children: name })), (0, jsx_runtime_1.jsx)(ScoreSlider_1.default, { width: 420, isShowLabel: true, originScore: originScore, finalScore: finalScore, valueLabelDisplay: "auto", onChangeCommitted: function (score) { return handleChangeCommitted(score, index, 'ability'); } })] }, name));
44
+ return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2" }, { children: name })), (0, jsx_runtime_1.jsx)(ScoreSlider_1.default, { width: 420, disabledScore: disabledScore, isShowLabel: true, originScore: originScore, finalScore: finalScore, valueLabelDisplay: "".concat(disabledScore ? 'off' : 'auto'), onChangeCommitted: function (score) { return handleChangeCommitted(score, index, 'ability'); } })] }, name));
43
45
  }) }))] })));
44
46
  };
45
47
  exports.default = Abilities;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import '@components/react-photo-view/Photo';
3
+ import '@components/react-photo-view/PhotoSlider';
4
+ declare const BodyImages: ({ reviewImgs }: {
5
+ reviewImgs: any;
6
+ }) => JSX.Element;
7
+ export default BodyImages;