eli-video-interview 1.2.41-alpha.3 → 1.2.41-alpha.30

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 (155) hide show
  1. package/esm/components/react-photo-view/hooks/useAnimationPosition.d.ts +1 -1
  2. package/esm/constants/ai-question.d.ts +3 -0
  3. package/esm/constants/ai-question.js +10 -0
  4. package/esm/constants/ai-report.d.ts +5 -0
  5. package/esm/constants/ai-report.js +5 -0
  6. package/esm/enum/ai-report.d.ts +12 -0
  7. package/esm/enum/ai-report.js +12 -0
  8. package/esm/modules/ai-ability/components/AbilityFormItem/AbilityFormItem.d.ts +14 -0
  9. package/esm/modules/ai-ability/components/AbilityFormItem/AbilityFormItem.js +145 -0
  10. package/esm/modules/ai-ability/components/AbilityFormItem/index.d.ts +2 -0
  11. package/esm/modules/ai-ability/components/AbilityFormItem/index.js +17 -6
  12. package/esm/modules/ai-ability/components/AddAbility/index.js +131 -101
  13. package/esm/modules/ai-ability/components/UpdateAbility/index.js +81 -106
  14. package/esm/modules/ai-question/Root.js +3 -3
  15. package/esm/modules/ai-question/components/BootVideo/CustomVideos.js +1 -1
  16. package/esm/modules/ai-question/components/BootVideo/UploadPreview.js +9 -1
  17. package/esm/modules/ai-question/components/BootVideo/index.js +13 -3
  18. package/esm/modules/ai-question/components/QuestionImport/index.d.ts +4 -0
  19. package/esm/modules/ai-question/components/QuestionImport/index.js +109 -0
  20. package/esm/modules/ai-question/components/QuestionImport/interface.d.ts +8 -0
  21. package/esm/modules/ai-question/components/QuestionImport/interface.js +1 -0
  22. package/esm/modules/ai-question/components/QuestionImport/styled.d.ts +13 -0
  23. package/esm/modules/ai-question/components/QuestionImport/styled.js +49 -0
  24. package/esm/modules/ai-question/components/QuestionModel/Header.js +23 -2
  25. package/esm/modules/ai-question/components/QuestionModel/Item.js +4 -4
  26. package/esm/modules/ai-question/components/QuestionModel/index.js +1 -1
  27. package/esm/modules/ai-question/components/QuestionModel/interface.d.ts +1 -0
  28. package/esm/modules/ai-question/components/QuestionPreview/styled.d.ts +2 -2
  29. package/esm/modules/ai-question/components/QuestionUpdate/FllowupSetting.d.ts +4 -0
  30. package/esm/modules/ai-question/components/QuestionUpdate/FllowupSetting.js +86 -0
  31. package/esm/modules/ai-question/components/QuestionUpdate/FollowupKeyPoints.d.ts +9 -0
  32. package/esm/modules/ai-question/components/QuestionUpdate/FollowupKeyPoints.js +94 -0
  33. package/esm/modules/ai-question/components/QuestionUpdate/FollowupTarget.d.ts +9 -0
  34. package/esm/modules/ai-question/components/QuestionUpdate/FollowupTarget.js +73 -0
  35. package/esm/modules/ai-question/components/QuestionUpdate/Form.js +8 -7
  36. package/esm/modules/ai-question/components/QuestionUpdate/RandomQuestion.js +2 -1
  37. package/esm/modules/ai-question/components/QuestionUpdate/VideoVoice.js +9 -8
  38. package/esm/modules/ai-question/components/QuestionUpdate/index.js +3 -3
  39. package/esm/modules/ai-question/components/QuestionUpdate/interface.d.ts +7 -0
  40. package/esm/modules/ai-question/interface.d.ts +1 -0
  41. package/esm/modules/ai-question/useAiQuestion.d.ts +1 -0
  42. package/esm/modules/ai-report/Root.js +54 -10
  43. package/esm/modules/ai-report/components/AIEvaluate/index.js +2 -2
  44. package/esm/modules/ai-report/components/ScoreReport/Bar.d.ts +4 -1
  45. package/esm/modules/ai-report/components/ScoreReport/Bar.js +12 -10
  46. package/esm/modules/ai-report/components/ScoreReport/Failed.d.ts +1 -1
  47. package/esm/modules/ai-report/components/ScoreReport/Failed.js +12 -4
  48. package/esm/modules/ai-report/components/ScoreReport/RecommendIcon.d.ts +3 -0
  49. package/esm/modules/ai-report/components/ScoreReport/RecommendIcon.js +17 -0
  50. package/esm/modules/ai-report/components/ScoreReport/Score.js +35 -9
  51. package/esm/modules/ai-report/components/ScoreReport/Tips.d.ts +3 -0
  52. package/esm/modules/ai-report/components/ScoreReport/Tips.js +18 -0
  53. package/esm/modules/ai-report/components/ScoreReport/index.js +8 -10
  54. package/esm/modules/ai-report/components/ScoreReport/interface.d.ts +5 -0
  55. package/esm/modules/ai-report/components/ScoreReport/styled.d.ts +3 -3
  56. package/esm/modules/ai-report/components/ScoreReport/styled.js +2 -4
  57. package/esm/modules/ai-report/components/Suggestion/index.js +2 -2
  58. package/esm/modules/ai-report/components/VideoQuestion/QuestionItem.js +3 -1
  59. package/esm/modules/ai-report/components/VideoQuestion/Workplaces.d.ts +6 -0
  60. package/esm/modules/ai-report/components/VideoQuestion/Workplaces.js +26 -0
  61. package/esm/modules/ai-report/components/VideoQuestion/index.js +2 -2
  62. package/esm/modules/ai-report/components/VideoQuestion/styled.d.ts +2 -2
  63. package/esm/modules/ai-report/components/WorkPlaces/WorkPlace.d.ts +1 -0
  64. package/esm/modules/ai-report/components/WorkPlaces/WorkPlace.js +2 -1
  65. package/esm/modules/ai-report/components/WorkPlaces/index.js +4 -3
  66. package/esm/modules/ai-report/components/WorkPlaces/styled.d.ts +2 -2
  67. package/esm/modules/ai-report/interface.d.ts +6 -0
  68. package/esm/modules/ai-template/components/TemplateList/styled.d.ts +3 -3
  69. package/esm/modules/ai-template/components/TemplateMenu/styled.d.ts +1 -1
  70. package/esm/services/ai-question.d.ts +3 -0
  71. package/esm/services/ai-question.js +3 -0
  72. package/esm/services/ai-report.d.ts +6 -0
  73. package/esm/services/ai-report.js +1 -0
  74. package/esm/store/ai-question/global-store.d.ts +3 -0
  75. package/esm/store/ai-question/global-store.js +1 -0
  76. package/esm/store/enterprise/enterprise-store.js +2 -2
  77. package/esm/utils/interceptor.js +5 -2
  78. package/lib/components/react-photo-view/hooks/useAnimationPosition.d.ts +1 -1
  79. package/lib/constants/ai-question.d.ts +3 -0
  80. package/lib/constants/ai-question.js +12 -1
  81. package/lib/constants/ai-report.d.ts +5 -0
  82. package/lib/constants/ai-report.js +6 -1
  83. package/lib/enum/ai-report.d.ts +12 -0
  84. package/lib/enum/ai-report.js +13 -1
  85. package/lib/modules/ai-ability/components/AbilityFormItem/AbilityFormItem.d.ts +14 -0
  86. package/lib/modules/ai-ability/components/AbilityFormItem/AbilityFormItem.js +147 -0
  87. package/lib/modules/ai-ability/components/AbilityFormItem/index.d.ts +2 -0
  88. package/lib/modules/ai-ability/components/AbilityFormItem/index.js +15 -4
  89. package/lib/modules/ai-ability/components/AddAbility/index.js +153 -100
  90. package/lib/modules/ai-ability/components/UpdateAbility/index.js +101 -103
  91. package/lib/modules/ai-question/Root.js +3 -3
  92. package/lib/modules/ai-question/components/BootVideo/CustomVideos.js +1 -1
  93. package/lib/modules/ai-question/components/BootVideo/UploadPreview.js +9 -1
  94. package/lib/modules/ai-question/components/BootVideo/index.js +13 -3
  95. package/lib/modules/ai-question/components/QuestionImport/index.d.ts +4 -0
  96. package/lib/modules/ai-question/components/QuestionImport/index.js +114 -0
  97. package/lib/modules/ai-question/components/QuestionImport/interface.d.ts +8 -0
  98. package/lib/modules/ai-question/components/QuestionImport/interface.js +2 -0
  99. package/lib/modules/ai-question/components/QuestionImport/styled.d.ts +13 -0
  100. package/lib/modules/ai-question/components/QuestionImport/styled.js +52 -0
  101. package/lib/modules/ai-question/components/QuestionModel/Header.js +25 -1
  102. package/lib/modules/ai-question/components/QuestionModel/Item.js +3 -3
  103. package/lib/modules/ai-question/components/QuestionModel/index.js +1 -1
  104. package/lib/modules/ai-question/components/QuestionModel/interface.d.ts +1 -0
  105. package/lib/modules/ai-question/components/QuestionPreview/styled.d.ts +2 -2
  106. package/lib/modules/ai-question/components/QuestionUpdate/FllowupSetting.d.ts +4 -0
  107. package/lib/modules/ai-question/components/QuestionUpdate/FllowupSetting.js +91 -0
  108. package/lib/modules/ai-question/components/QuestionUpdate/FollowupKeyPoints.d.ts +9 -0
  109. package/lib/modules/ai-question/components/QuestionUpdate/FollowupKeyPoints.js +96 -0
  110. package/lib/modules/ai-question/components/QuestionUpdate/FollowupTarget.d.ts +9 -0
  111. package/lib/modules/ai-question/components/QuestionUpdate/FollowupTarget.js +75 -0
  112. package/lib/modules/ai-question/components/QuestionUpdate/Form.js +8 -7
  113. package/lib/modules/ai-question/components/QuestionUpdate/RandomQuestion.js +4 -3
  114. package/lib/modules/ai-question/components/QuestionUpdate/VideoVoice.js +9 -8
  115. package/lib/modules/ai-question/components/QuestionUpdate/index.js +2 -2
  116. package/lib/modules/ai-question/components/QuestionUpdate/interface.d.ts +7 -0
  117. package/lib/modules/ai-question/interface.d.ts +1 -0
  118. package/lib/modules/ai-question/useAiQuestion.d.ts +1 -0
  119. package/lib/modules/ai-report/Root.js +51 -7
  120. package/lib/modules/ai-report/components/AIEvaluate/index.js +2 -2
  121. package/lib/modules/ai-report/components/ScoreReport/Bar.d.ts +4 -1
  122. package/lib/modules/ai-report/components/ScoreReport/Bar.js +11 -9
  123. package/lib/modules/ai-report/components/ScoreReport/Failed.d.ts +1 -1
  124. package/lib/modules/ai-report/components/ScoreReport/Failed.js +12 -5
  125. package/lib/modules/ai-report/components/ScoreReport/RecommendIcon.d.ts +3 -0
  126. package/lib/modules/ai-report/components/ScoreReport/RecommendIcon.js +22 -0
  127. package/lib/modules/ai-report/components/ScoreReport/Score.js +31 -7
  128. package/lib/modules/ai-report/components/ScoreReport/Tips.d.ts +3 -0
  129. package/lib/modules/ai-report/components/ScoreReport/Tips.js +20 -0
  130. package/lib/modules/ai-report/components/ScoreReport/index.js +6 -8
  131. package/lib/modules/ai-report/components/ScoreReport/interface.d.ts +5 -0
  132. package/lib/modules/ai-report/components/ScoreReport/styled.d.ts +3 -3
  133. package/lib/modules/ai-report/components/ScoreReport/styled.js +2 -4
  134. package/lib/modules/ai-report/components/Suggestion/index.js +1 -1
  135. package/lib/modules/ai-report/components/VideoQuestion/QuestionItem.js +9 -7
  136. package/lib/modules/ai-report/components/VideoQuestion/index.js +1 -1
  137. package/lib/modules/ai-report/components/VideoQuestion/styled.d.ts +2 -2
  138. package/lib/modules/ai-report/components/VideoQuestion/workplaces.d.ts +6 -0
  139. package/lib/modules/ai-report/components/VideoQuestion/workplaces.js +28 -0
  140. package/lib/modules/ai-report/components/WorkPlaces/WorkPlace.d.ts +1 -0
  141. package/lib/modules/ai-report/components/WorkPlaces/WorkPlace.js +2 -1
  142. package/lib/modules/ai-report/components/WorkPlaces/index.js +3 -2
  143. package/lib/modules/ai-report/components/WorkPlaces/styled.d.ts +2 -2
  144. package/lib/modules/ai-report/interface.d.ts +6 -0
  145. package/lib/modules/ai-template/components/TemplateList/styled.d.ts +3 -3
  146. package/lib/modules/ai-template/components/TemplateMenu/styled.d.ts +1 -1
  147. package/lib/services/ai-question.d.ts +3 -0
  148. package/lib/services/ai-question.js +7 -1
  149. package/lib/services/ai-report.d.ts +6 -0
  150. package/lib/services/ai-report.js +3 -1
  151. package/lib/store/ai-question/global-store.d.ts +3 -0
  152. package/lib/store/ai-question/global-store.js +1 -0
  153. package/lib/store/enterprise/enterprise-store.js +2 -2
  154. package/lib/utils/interceptor.js +5 -2
  155. package/package.json +6 -3
@@ -9,42 +9,6 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
- return new (P || (P = Promise))(function (resolve, reject) {
15
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
- step((generator = generator.apply(thisArg, _arguments || [])).next());
19
- });
20
- };
21
- var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
- function verb(n) { return function (v) { return step([n, v]); }; }
25
- function step(op) {
26
- if (f) throw new TypeError("Generator is already executing.");
27
- while (_) try {
28
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
- if (y = 0, t) op = [op[0] & 2, t.value];
30
- switch (op[0]) {
31
- case 0: case 1: t = op; break;
32
- case 4: _.label++; return { value: op[1], done: false };
33
- case 5: _.label++; y = op[1]; op = [0]; continue;
34
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
- default:
36
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
- if (t[2]) _.ops.pop();
41
- _.trys.pop(); continue;
42
- }
43
- op = body.call(thisArg, _);
44
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
- }
47
- };
48
12
  var __read = (this && this.__read) || function (o, n) {
49
13
  var m = typeof Symbol === "function" && o[Symbol.iterator];
50
14
  if (!m) return o;
@@ -62,12 +26,23 @@ var __read = (this && this.__read) || function (o, n) {
62
26
  return ar;
63
27
  };
64
28
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
29
+ /* eslint-disable react-hooks/exhaustive-deps */
30
+ import * as Yup from 'yup';
65
31
  import { InitialValues } from '../../const';
66
32
  import AbilityFormItem from '../AbilityFormItem';
67
33
  import { GetAbilityDetail, PostQuestionCollectionUpsert } from "../../../../services/ai-ability";
68
34
  import { useRequest } from 'ahooks';
69
- import { Box, Button, Divider, Drawer, Message, TextField, Typography, useTextField } from 'fbm-ui';
35
+ import { Box, Button, Divider, Drawer, Form, FormItem, Message, Typography, useForm } from 'fbm-ui';
36
+ import { Stack } from 'fbm-ui/lib/mui';
37
+ import { FieldArray } from 'formik';
70
38
  import { useCallback, useEffect, useRef, useState } from 'react';
39
+ var validationSchema = Yup.object().shape({
40
+ name: Yup.string().required('能力名称不能为空'),
41
+ workPlaceItems: Yup.array().of(Yup.object().shape({
42
+ name: Yup.string().required(''),
43
+ items: Yup.array().of(Yup.string().required('')),
44
+ })),
45
+ });
71
46
  var UpdateAbility = function (props) {
72
47
  var open = props.open, _a = props.type, type = _a === void 0 ? 1 : _a, isWorkplace = props.isWorkplace, _b = props.name, name = _b === void 0 ? '' : _b, ablilityNameLength = props.ablilityNameLength, token = props.token, onClose = props.onClose, onSuccess = props.onSuccess;
73
48
  var _c = __read(useState(''), 2), value = _c[0], setValue = _c[1];
@@ -75,8 +50,27 @@ var UpdateAbility = function (props) {
75
50
  var _e = __read(useState('show'), 2), mode = _e[0], setMode = _e[1];
76
51
  var firstLoad = useRef(true);
77
52
  var _f = __read(useState(false), 2), showAiDefineDetail = _f[0], setShowAiDefineDetail = _f[1];
78
- // const [submitDisabled, setSubmitDisabled] = useState<boolean>(true);
79
53
  var _g = __read(useState(InitialValues.workPlaceItems), 2), workPlaceItems = _g[0], setWorkPlaceItems = _g[1];
54
+ var formik = useForm({
55
+ initialValues: { name: '', workPlaceItems: [] },
56
+ validationSchema: validationSchema,
57
+ validateOnChange: true,
58
+ onSubmit: function (values) {
59
+ // 处理表单提交逻辑
60
+ console.log(values);
61
+ var avocadoConfig = window['AvocadoVideoInterviewConfig'];
62
+ run({
63
+ name: values.name,
64
+ tag: values.name,
65
+ token: token,
66
+ workPlaceItems: values.workPlaceItems,
67
+ mateData: {
68
+ account: avocadoConfig === null || avocadoConfig === void 0 ? void 0 : avocadoConfig.account,
69
+ enterpriseId: avocadoConfig === null || avocadoConfig === void 0 ? void 0 : avocadoConfig.enterpriseId,
70
+ },
71
+ });
72
+ },
73
+ });
80
74
  var _h = useRequest(PostQuestionCollectionUpsert, {
81
75
  manual: true,
82
76
  onSuccess: function () {
@@ -87,7 +81,7 @@ var UpdateAbility = function (props) {
87
81
  onError: function (err) {
88
82
  console.log(err);
89
83
  if ((err === null || err === void 0 ? void 0 : err.code) === -1211) {
90
- nameTextField.setError('能力名称不能重复');
84
+ formik.errors.name = '能力名称不能重复';
91
85
  }
92
86
  },
93
87
  }), run = _h.run, loading = _h.loading;
@@ -106,82 +100,60 @@ var UpdateAbility = function (props) {
106
100
  }
107
101
  },
108
102
  }).run;
109
- var nameTextField = useTextField({
110
- value: value,
111
- label: '能力名称',
112
- required: true,
113
- rules: [
114
- {
115
- required: true,
116
- message: '能力名称不能为空',
117
- },
118
- ],
119
- onChange: function (e) { return setValue(e.target.value); },
120
- max: ablilityNameLength,
121
- sx: {
122
- height: '48px',
123
- width: '100%',
124
- marginTop: '16px',
125
- },
126
- });
127
103
  var handleValue = useCallback(function (v) {
128
- var index = workPlaceItems.findIndex(function (ele) { return ele.type === v.type; });
129
- workPlaceItems.splice(index, 1, v);
130
- var list = workPlaceItems;
131
- setWorkPlaceItems(list);
104
+ // const index = workPlaceItems.findIndex(ele => ele.type === v.type);
105
+ // workPlaceItems.splice(index, 1, v);
106
+ // const list = workPlaceItems;
107
+ // setWorkPlaceItems(list);
132
108
  }, [workPlaceItems]);
133
- var handleOk = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
134
- var error, workPlaceItemsError, avocadoConfig;
135
- return __generator(this, function (_a) {
136
- switch (_a.label) {
137
- case 0: return [4 /*yield*/, nameTextField.handleValidate()];
138
- case 1:
139
- error = _a.sent();
140
- workPlaceItemsError = workPlaceItems.some(function (v) { return v.items.length === 0; });
141
- if (!error) {
142
- avocadoConfig = window['AvocadoVideoInterviewConfig'];
143
- // 旧自定义能力
144
- if (type === 3 && !isWorkplace) {
145
- run({
146
- name: value,
147
- tag: value,
148
- token: token,
149
- mateData: {
150
- account: avocadoConfig === null || avocadoConfig === void 0 ? void 0 : avocadoConfig.account,
151
- enterpriseId: avocadoConfig === null || avocadoConfig === void 0 ? void 0 : avocadoConfig.enterpriseId,
152
- },
153
- });
154
- }
155
- else if (!workPlaceItemsError) {
156
- // 职场能力
157
- run({
158
- name: value,
159
- tag: value,
160
- token: token,
161
- workPlaceItems: workPlaceItems,
162
- mateData: {
163
- account: avocadoConfig === null || avocadoConfig === void 0 ? void 0 : avocadoConfig.account,
164
- enterpriseId: avocadoConfig === null || avocadoConfig === void 0 ? void 0 : avocadoConfig.enterpriseId,
165
- },
166
- });
167
- }
168
- }
169
- return [2 /*return*/];
170
- }
171
- });
172
- }); }, [nameTextField, run, token, value, isWorkplace, type, workPlaceItems]);
109
+ // const handleOk = useCallback(async () => {
110
+ // // const error = await nameTextField.handleValidate();
111
+ // const error = false;
112
+ // const workPlaceItemsError = workPlaceItems.some(v => v.items.length === 0);
113
+ // if (!error) {
114
+ // const avocadoConfig = window['AvocadoVideoInterviewConfig'];
115
+ // // 旧自定义能力
116
+ // if (type === 3 && !isWorkplace) {
117
+ // run({
118
+ // name: value,
119
+ // tag: value,
120
+ // token,
121
+ // mateData: {
122
+ // account: avocadoConfig?.account,
123
+ // enterpriseId: avocadoConfig?.enterpriseId,
124
+ // },
125
+ // });
126
+ // } else if (!workPlaceItemsError) {
127
+ // // 职场能力
128
+ // run({
129
+ // name: value,
130
+ // tag: value,
131
+ // token,
132
+ // workPlaceItems,
133
+ // mateData: {
134
+ // account: avocadoConfig?.account,
135
+ // enterpriseId: avocadoConfig?.enterpriseId,
136
+ // },
137
+ // });
138
+ // }
139
+ // }
140
+ // }, [run, token, value, isWorkplace, type, workPlaceItems]);
173
141
  var footer = useCallback(function () {
174
- return step === 1 ? (_jsx(Box, __assign({ display: "flex", padding: "12px 16px" }, { children: type === 1 ? (_jsx(_Fragment, {})) : (_jsx(Button, __assign({ variant: "outlined", color: "inherit", onClick: function () { return setStep(2); } }, { children: "\u7F16\u8F91" }))) }))) : (_jsxs(Box, __assign({ display: "flex", justifyContent: "flex-end", padding: "12px 16px" }, { children: [_jsx(Button, __assign({ sx: { mr: 1, fontWeight: 400 }, variant: "text", color: "inherit", onClick: onClose }, { children: "\u53D6\u6D88" })), _jsx(Button, __assign({ loading: loading, onClick: handleOk }, { children: "\u4FDD\u5B58" }))] })));
175
- }, [type, step, loading, setStep, handleOk, onClose]);
142
+ return step === 1 ? (_jsx(Box, __assign({ display: "flex", padding: "12px 16px" }, { children: type === 1 ? (_jsx(_Fragment, {})) : (_jsx(Button, __assign({ variant: "outlined", color: "inherit", onClick: function () { return setStep(2); } }, { children: "\u7F16\u8F91" }))) }))) : (_jsxs(Box, __assign({ display: "flex", justifyContent: "flex-end", padding: "12px 16px" }, { children: [_jsx(Button, __assign({ sx: { mr: 1, fontWeight: 400 }, variant: "text", color: "inherit", onClick: onClose }, { children: "\u53D6\u6D88" })), _jsx(Button, __assign({ loading: loading, onClick: formik.submitForm }, { children: "\u4FDD\u5B58" }))] })));
143
+ }, [step, type, onClose, loading, formik]);
144
+ useEffect(function () {
145
+ formik.setFieldValue('workPlaceItems', workPlaceItems);
146
+ }, [workPlaceItems]);
176
147
  useEffect(function () {
177
148
  setValue(name);
149
+ formik.setFieldValue('name', name);
178
150
  }, [name]);
179
151
  useEffect(function () {
180
152
  if (!open) {
181
153
  setValue('');
182
154
  setWorkPlaceItems([]);
183
155
  setStep(1);
184
- nameTextField.setError();
156
+ // nameTextField.setError();
185
157
  }
186
158
  // eslint-disable-next-line react-hooks/exhaustive-deps
187
159
  }, [open]);
@@ -200,7 +172,10 @@ var UpdateAbility = function (props) {
200
172
  useEffect(function () {
201
173
  setWorkPlaceItems(workPlaceItems);
202
174
  }, [workPlaceItems, setWorkPlaceItems]);
203
- return (_jsxs(Drawer, __assign({ className: "abilityDrawer", title: '能力详情', open: open, footer: footer, onClose: onClose }, { children: [_jsx(Box, __assign({ style: { width: '556px' } }, { children: step === 1 ? (_jsxs(Typography, __assign({ variant: "body1", fontWeight: "medium" }, { children: ["\u80FD\u529B\u540D\u79F0\uFF1A", value] }))) : (_jsxs(_Fragment, { children: [_jsx(Typography, __assign({ variant: "body2", color: "secondary" }, { children: "\u4F7F\u7528\u901A\u7528\u7684\u80FD\u529B\u540D\u79F0\uFF08\u4F8B\u5982\uFF1A\u9886\u5BFC\u529B\u3001\u5E94\u53D8\u80FD\u529B\u7B49\u5E38\u89C1\u8003\u6838\u9879\uFF09\u547D\u540D\u6709\u52A9\u4E8E\u63D0\u9AD8 AI \u8BC4\u4EF7\u53CA\u8BC4\u5206\u51C6\u786E\u6027\u3002" })), _jsx(TextField, __assign({}, nameTextField))] })) })), !(type === 3 && !isWorkplace) && (_jsxs(Box, __assign({ style: { width: '556px' } }, { children: [_jsx(Divider, { style: { margin: '24px 0' } }), _jsx(Typography, __assign({ variant: "body1", fontWeight: "medium", mb: 2 }, { children: "\u80FD\u529B\u6807\u51C6" })), showAiDefineDetail &&
204
- workPlaceItems.map(function (v) { return (_jsx(AbilityFormItem, { token: token, name: value, title: v.name, type: v.type, items: v.items, mode: mode, maxTextLength: v.type === 4 || v.type === 5 ? 300 : 100, canReplace: mode === 'edit' ? true : false, onChange: handleValue }, v.type)); })] })))] })));
175
+ return (_jsx(Drawer, __assign({ className: "abilityDrawer", title: '能力详情', open: open, footer: footer, onClose: onClose }, { children: _jsxs(Form, __assign({}, formik, { children: [_jsx(Box, __assign({ style: { width: '556px' } }, { children: step === 1 ? (_jsxs(Typography, __assign({ variant: "body1", fontWeight: "medium" }, { children: ["\u80FD\u529B\u540D\u79F0\uFF1A", value] }))) : (_jsxs(_Fragment, { children: [_jsx(Typography, __assign({ variant: "body2", color: "secondary" }, { children: "\u4F7F\u7528\u901A\u7528\u7684\u80FD\u529B\u540D\u79F0\uFF08\u4F8B\u5982\uFF1A\u9886\u5BFC\u529B\u3001\u5E94\u53D8\u80FD\u529B\u7B49\u5E38\u89C1\u8003\u6838\u9879\uFF09\u547D\u540D\u6709\u52A9\u4E8E\u63D0\u9AD8 AI \u8BC4\u4EF7\u53CA\u8BC4\u5206\u51C6\u786E\u6027\u3002" })), _jsx(FormItem, { name: "name", label: "\u80FD\u529B\u540D\u79F0", sx: { height: '48px', width: '100%', marginTop: '16px' }, max: ablilityNameLength, onKeyDown: function (event) {
176
+ if (event.key === 'Enter') {
177
+ event.preventDefault();
178
+ }
179
+ } })] })) })), !(type === 3 && !isWorkplace) && (_jsxs(Box, __assign({ style: { width: '556px' } }, { children: [_jsx(Divider, { style: { margin: '24px 0' } }), _jsx(Typography, __assign({ variant: "body1", fontWeight: "medium", mb: 2 }, { children: "\u80FD\u529B\u6807\u51C6" })), showAiDefineDetail && (_jsx(FieldArray, __assign({ name: "workPlaceItems" }, { children: function () { return (_jsx(Stack, { children: formik.values.workPlaceItems.map(function (item, index) { return (_jsx(Stack, { children: _jsx(AbilityFormItem, { token: token, name: value, title: item.name, type: item.type, items: item.items, mode: mode, index: index, item: item, maxTextLength: item.type === 4 || item.type === 5 ? 300 : 100, canReplace: mode === 'edit' ? true : false, onChange: handleValue }, item.type) }, index)); }) })); } })))] })))] })) })));
205
180
  };
206
181
  export default UpdateAbility;
@@ -93,12 +93,12 @@ var AiQuestionRoot = forwardRef(function (props, ref) {
93
93
  handleValues: handleValues,
94
94
  handleTemplate: function (steps) { return addModel(steps); },
95
95
  handleSubmit: function () { return __awaiter(void 0, void 0, void 0, function () {
96
- var _a, _b, name, token, questions, _c, mediaUrl, thumbUrl, appliedAllPosition, data, error_1;
96
+ var _a, _b, name, token, questions, aiModel, _c, mediaUrl, thumbUrl, appliedAllPosition, data, error_1;
97
97
  return __generator(this, function (_d) {
98
98
  switch (_d.label) {
99
99
  case 0: return [4 /*yield*/, handleValues()];
100
100
  case 1:
101
- _a = _d.sent(), _b = _a.data, name = _b.name, token = _b.token, questions = _b.steps, _c = _a.media, mediaUrl = _c.mediaUrl, thumbUrl = _c.thumbUrl, appliedAllPosition = _c.appliedAllPosition;
101
+ _a = _d.sent(), _b = _a.data, name = _b.name, token = _b.token, questions = _b.steps, aiModel = _b.aiModel, _c = _a.media, mediaUrl = _c.mediaUrl, thumbUrl = _c.thumbUrl, appliedAllPosition = _c.appliedAllPosition;
102
102
  if (!(questions === null || questions === void 0 ? void 0 : questions.length)) {
103
103
  Message.error('还未添加题目,请添加题目');
104
104
  return [2 /*return*/, Promise.reject()];
@@ -106,7 +106,7 @@ var AiQuestionRoot = forwardRef(function (props, ref) {
106
106
  _d.label = 2;
107
107
  case 2:
108
108
  _d.trys.push([2, 4, , 5]);
109
- return [4 /*yield*/, PostAiModelUpsert(__assign(__assign({ name: name, thirdToken: '' }, interviewRoomState), { introductoryVideoSetting: {}, selectAbilities: selctedAbilitys, token: token, questions: questions }))];
109
+ return [4 /*yield*/, PostAiModelUpsert(__assign(__assign({ name: name, thirdToken: '', aiModel: (props === null || props === void 0 ? void 0 : props.aiModel) || aiModel }, interviewRoomState), { introductoryVideoSetting: {}, selectAbilities: selctedAbilitys, token: token, questions: questions }))];
110
110
  case 3:
111
111
  data = (_d.sent()).data;
112
112
  return [2 /*return*/, Promise.resolve({
@@ -88,6 +88,6 @@ var CustomVideos = function (_a) {
88
88
  return (_jsxs(_Fragment, { children: [_jsx(Typography, __assign({ variant: "body2", fontWeight: "medium", mt: 3 }, { children: "\u5F15\u5BFC\u89C6\u9891" })), _jsxs(CustomUploadedImgRoot, __assign({ sx: { minHeight: 0 } }, { children: [mediaList === null || mediaList === void 0 ? void 0 : mediaList.map(function (_a, i) {
89
89
  var url = _a.url, selected = _a.selected;
90
90
  return (_jsx(UploadPreview, { src: "".concat(url, "?x-oss-process=video/snapshot,t_0,f_jpg"), style: { borderColor: selected ? '#4CAF50' : 'transparent' }, height: 100, alt: "", onClick: function () { return handleSelectVideo(i); }, onRemove: function () { return handleRemoveVideo(i); } }, url));
91
- }), loading && _jsx(Box, { height: 100, loading: { size: 24, loading: true, isMask: true } })] })), _jsxs(Stack, __assign({ direction: "row", alignItems: "center" }, { children: [_jsxs(CustomUploadButtonRoot, { children: [mediaList.length <= 5 && (_jsx(Upload, __assign({}, uploadProps, { children: _jsx(Button, __assign({ variant: "outlined", disabled: mediaList.length > 5, color: "inherit", icon: _jsx(AddIcon, {}) }, { children: "\u4E0A\u4F20\u89C6\u9891" })) }))), mediaList.length > 5 && (_jsx(Button, __assign({ variant: "outlined", disabled: mediaList.length > 5, color: "inherit", icon: _jsx(AddIcon, {}) }, { children: "\u4E0A\u4F20\u89C6\u9891" })))] }), _jsx(Tooltip, __assign({ title: "\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", placement: "bottom-start" }, { children: _jsx(Box, __assign({ display: "flex", alignItems: "center", sx: { ml: 1 } }, { children: _jsx(InfoOutlineIcon, { sx: { color: 'rgba(0, 0, 0, 0.56)', fontSize: 16 } }) })) }))] })), mediaList.length === 0 && (_jsx(Typography, __assign({ variant: "caption", color: "error" }, { children: "\u4E0A\u4F20\u89C6\u9891\u4E0D\u53EF\u4E3A\u7A7A" })))] }));
91
+ }), loading && _jsx(Box, { height: 100, loading: { size: 24, loading: true, isMask: true } })] })), _jsxs(Stack, __assign({ direction: "row", alignItems: "center" }, { children: [_jsxs(CustomUploadButtonRoot, { children: [mediaList.length < 5 && (_jsx(Upload, __assign({}, uploadProps, { children: _jsx(Button, __assign({ variant: "outlined", disabled: mediaList.length > 5, color: "inherit", icon: _jsx(AddIcon, {}) }, { children: "\u4E0A\u4F20\u89C6\u9891" })) }))), mediaList.length >= 5 && (_jsx(Button, __assign({ variant: "outlined", disabled: true, color: "inherit", icon: _jsx(AddIcon, {}) }, { children: "\u4E0A\u4F20\u89C6\u9891" })))] }), _jsx(Tooltip, __assign({ title: "\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", placement: "bottom-start" }, { children: _jsx(Box, __assign({ display: "flex", alignItems: "center", sx: { ml: 1 } }, { children: _jsx(InfoOutlineIcon, { sx: { color: 'rgba(0, 0, 0, 0.56)', fontSize: 16 } }) })) }))] })), mediaList.length === 0 && (_jsx(Typography, __assign({ variant: "caption", color: "error" }, { children: "\u4E0A\u4F20\u89C6\u9891\u4E0D\u53EF\u4E3A\u7A7A" })))] }));
92
92
  };
93
93
  export default CustomVideos;
@@ -13,6 +13,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { Box, CancelIcon, IconButton } from 'fbm-ui';
14
14
  var UploadPreview = function (_a) {
15
15
  var src = _a.src, style = _a.style, onClick = _a.onClick, onRemove = _a.onRemove, height = _a.height, alt = _a.alt, _b = _a.disabledRemove, disabledRemove = _b === void 0 ? false : _b;
16
- return (_jsxs(Box, { children: [_jsx("img", { src: src, height: height, style: style, alt: alt, onClick: onClick }), !disabledRemove && (_jsx(IconButton, __assign({ onClick: onRemove, size: "small", sx: { position: 'absolute', top: -14, right: -16 } }, { children: _jsx(CancelIcon, {}) })))] }));
16
+ return (_jsxs(Box, __assign({ sx: {
17
+ height: height,
18
+ '& .remove': {
19
+ display: 'none',
20
+ },
21
+ '&:hover .remove': {
22
+ display: 'block',
23
+ },
24
+ } }, { children: [_jsx("img", { src: src, height: height, style: style, alt: alt, onClick: onClick }), !disabledRemove && (_jsx(IconButton, __assign({ className: "remove", onClick: onRemove, size: "small", sx: { position: 'absolute', top: -14, right: -16 } }, { children: _jsx(CancelIcon, {}) })))] })));
17
25
  };
18
26
  export default UploadPreview;
@@ -184,7 +184,17 @@ var BootVideo = function (props) {
184
184
  }
185
185
  // eslint-disable-next-line react-hooks/exhaustive-deps
186
186
  }, [open]);
187
- return (_jsx(Dialog, __assign({ open: open, title: "\u5B9A\u5236\u9762\u8BD5\u95F4", okText: "\u786E\u8BA4", onClose: onClose, onOk: handleOk, width: 588 }, { children: _jsx(ScrollDialogContent, { children: _jsx(Box, __assign({ sx: { display: 'flex', justifyContent: 'space-between', width: '100%' } }, { children: _jsxs(Stack, __assign({ width: "100%" }, { 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(Select, { options: Options, value: broadcastType, onChange: function (e) {
187
+ return (_jsx(Dialog, __assign({ open: open, title: "\u5B9A\u5236\u9762\u8BD5\u95F4", okText: "\u786E\u8BA4", onClose: onClose, onOk: handleOk, width: 588,
188
+ // @ts-ignore
189
+ sx: {
190
+ '& .FuiDialog-content': {
191
+ pb: 4.5,
192
+ },
193
+ } }, { children: _jsx(ScrollDialogContent, { children: _jsx(Box, __assign({ sx: { display: 'flex', justifyContent: 'space-between', width: '100%' } }, { children: _jsxs(Stack, __assign({ width: "100%" }, { children: [_jsx(Typography, __assign({ fontSize: "14px", variant: "body1", fontWeight: 500 }, { children: "\u9762\u8BD5\u95F4\u4E92\u52A8\u65B9\u5F0F" })), _jsxs(RadioGroup, __assign({ sx: {
194
+ '& .MuiFormControlLabel-root': {
195
+ mr: 4.5,
196
+ },
197
+ }, 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(Select, { options: Options, value: broadcastType, onChange: function (e) {
188
198
  var _a;
189
199
  var value = e.target.value;
190
200
  setVirtualManList(__spreadArray([], __read(virtualManList.map(function (v) { return (__assign(__assign({}, v), { selected: v.type === value })); })), false));
@@ -193,11 +203,11 @@ var BootVideo = function (props) {
193
203
  // @ts-ignore
194
204
  aiInterviewerProfile: (_a = virtualManList.find(function (v) { return v.type === value; })) === null || _a === void 0 ? void 0 : _a.detail }));
195
205
  }
196
- }, sx: { width: 240, height: 'auto', mt: 1 } }), broadcastType === 3 && (_jsxs(Stack, { children: [_jsx(CustomVideos, { mediaList: (_a = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.detail) === null || _a === void 0 ? void 0 : _a.tutorialVideos, setMediaList: handleSetVideo }), _jsx(Typography, __assign({ variant: "body2", fontWeight: "medium", mt: 3, mb: 2 }, { children: "\u5F15\u5BFC\u89C6\u9891\u6587\u672C\u6846\u5185\u5BB9" })), _jsx(TextField, { multiline: true, error: (((_b = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.guidanceText) === null || _b === void 0 ? void 0 : _b.length) || 0) > 300, rows: 3, placeholder: "\u8BF7\u8F93\u5165\u6587\u672C\u6846\u5185\u5BB9\uFF0C\u82E5\u4E0D\u586B\uFF0C\u5219\u5728\u9762\u8BD5\u95F4\u4E0D\u5C55\u793A\u8BE5\u6587\u672C\u6846\u3002", value: virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.guidanceText, sx: { mb: 2 }, onChange: handleGuidanceText })] })), _jsx(Typography, __assign({ fontSize: "14px", variant: "body1", fontWeight: 500, mt: 3 }, { children: broadcastType !== 3 ? '面试官形象' : '面试官形象(播报题目)' })), broadcastType !== 3 && (_jsx(CustomUploadedImgRoot, { children: _jsx(Box, { children: _jsx("img", { src: (_c = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.detail) === null || _c === void 0 ? void 0 : _c.virtualHumanAvatar, style: {
206
+ }, sx: { width: 240, height: 'auto', mt: 1 } }), broadcastType === 3 && (_jsxs(Stack, { children: [_jsx(CustomVideos, { mediaList: (_a = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.detail) === null || _a === void 0 ? void 0 : _a.tutorialVideos, setMediaList: handleSetVideo }), _jsx(Typography, __assign({ variant: "body2", fontWeight: "medium", mt: 3, mb: 2 }, { children: "\u5F15\u5BFC\u89C6\u9891\u6587\u672C\u6846\u5185\u5BB9" })), _jsx(TextField, { multiline: true, error: (((_b = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.guidanceText) === null || _b === void 0 ? void 0 : _b.length) || 0) > 300, rows: 3, placeholder: "\u8BF7\u8F93\u5165\u6587\u672C\u6846\u5185\u5BB9\uFF0C\u82E5\u4E0D\u586B\uFF0C\u5219\u5728\u9762\u8BD5\u95F4\u4E0D\u5C55\u793A\u8BE5\u6587\u672C\u6846\u3002", value: virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.guidanceText, sx: { mb: 2 }, onChange: handleGuidanceText, max: 300 })] })), _jsx(Typography, __assign({ fontSize: "14px", variant: "body1", fontWeight: 500, mt: 3 }, { children: broadcastType !== 3 ? '面试官形象' : '面试官形象(播报题目)' })), broadcastType !== 3 && (_jsx(CustomUploadedImgRoot, { children: _jsx(Box, { children: _jsx("img", { src: (_c = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.detail) === null || _c === void 0 ? void 0 : _c.virtualHumanAvatar, style: {
197
207
  borderColor: 'transparent',
198
208
  }, height: 100, alt: "" }) }) })), broadcastType === 3 && (_jsx(CustomUploadedImgRoot, { children: (_e = (_d = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.detail) === null || _d === void 0 ? void 0 : _d.interviewerShows) === null || _e === void 0 ? void 0 : _e.map(function (human) { return (_jsxs(Box, { children: [_jsx("img", { src: human.virtualHumanAvatar, style: {
199
209
  borderColor: human.selected ? '#4CAF50' : 'transparent',
200
- }, height: 100, alt: "", onClick: function () { return handleSelectHumanType(human); } }), _jsx(Typography, __assign({ variant: "body2", textAlign: "center" }, { children: human.name }))] }, human.humanToken)); }) })), _jsx(Typography, __assign({ variant: "caption", flexWrap: "wrap", color: "disabled", mb: 3 }, { children: (virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.detail.desc) || ((_h = (_g = (_f = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.detail) === null || _f === void 0 ? void 0 : _f.interviewerShows) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.desc) })), broadcastType !== 3 && (_jsxs(Stack, { children: [_jsx(Typography, __assign({ variant: "body2", fontWeight: "medium", mb: 2 }, { children: "\u5F15\u5BFC\u89C6\u9891\u64AD\u62A5\u5185\u5BB9" })), _jsx(TextField, { multiline: true, error: (((_j = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.guidanceText) === null || _j === void 0 ? void 0 : _j.length) || 0) > 300, rows: 3, placeholder: "\u8BF7\u8F93\u5165\u6587\u672C\u6846\u5185\u5BB9\uFF0C\u82E5\u4E0D\u586B\uFF0C\u5219\u5728\u9762\u8BD5\u95F4\u4E0D\u5C55\u793A\u8BE5\u6587\u672C\u6846\u3002", value: virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.guidanceText, onChange: handleGuidanceText })] }))] })), 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) {
210
+ }, height: 100, alt: "", onClick: function () { return handleSelectHumanType(human); } }), _jsx(Typography, __assign({ variant: "body2", textAlign: "center" }, { children: human.name }))] }, human.humanToken)); }) })), _jsx(Typography, __assign({ variant: "caption", flexWrap: "wrap", color: "disabled", mb: 3 }, { children: (virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.detail.desc) || ((_h = (_g = (_f = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.detail) === null || _f === void 0 ? void 0 : _f.interviewerShows) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.desc) })), broadcastType !== 3 && (_jsxs(Stack, { children: [_jsx(Typography, __assign({ variant: "body2", fontWeight: "medium", mb: 2 }, { children: "\u5F15\u5BFC\u89C6\u9891\u64AD\u62A5\u5185\u5BB9" })), _jsx(TextField, { multiline: true, error: (((_j = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.guidanceText) === null || _j === void 0 ? void 0 : _j.length) || 0) > 300, rows: 3, placeholder: "\u8BF7\u8F93\u5165\u6587\u672C\u6846\u5185\u5BB9\uFF0C\u82E5\u4E0D\u586B\uFF0C\u5219\u5728\u9762\u8BD5\u95F4\u4E0D\u5C55\u793A\u8BE5\u6587\u672C\u6846\u3002", value: virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.guidanceText, onChange: handleGuidanceText, max: 300 })] }))] })), 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) {
201
211
  var videoUrl = _a.videoUrl, frameUrl = _a.frameUrl;
202
212
  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));
203
213
  }) }), _jsxs(Stack, __assign({ direction: "row", alignItems: "center" }, { children: [_jsxs(CustomUploadButtonRoot, { children: [mediaList.length <= 5 && (_jsx(Upload, __assign({}, uploadProps, { children: _jsx(Button, __assign({ variant: "outlined", disabled: mediaList.length > 5, color: "inherit", icon: _jsx(AddIcon, {}) }, { children: "\u4E0A\u4F20\u89C6\u9891" })) }))), mediaList.length > 5 && (_jsx(Button, __assign({ variant: "outlined", disabled: mediaList.length > 5, color: "inherit", icon: _jsx(AddIcon, {}) }, { children: "\u4E0A\u4F20\u89C6\u9891" })))] }), _jsx(Tooltip, __assign({ title: "\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", placement: "bottom-start" }, { children: _jsx(Box, __assign({ display: "flex", alignItems: "center", sx: { ml: 1 } }, { children: _jsx(InfoOutlineIcon, { sx: { color: 'rgba(0, 0, 0, 0.56)', fontSize: 16 } }) })) }))] }))] }))] })) })) }) })));
@@ -0,0 +1,4 @@
1
+ import { BootVideoProps } from './interface';
2
+ import { FC } from 'react';
3
+ declare const BootVideo: FC<BootVideoProps>;
4
+ export default BootVideo;
@@ -0,0 +1,109 @@
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 __read = (this && this.__read) || function (o, n) {
13
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
14
+ if (!m) return o;
15
+ var i = m.call(o), r, ar = [], e;
16
+ try {
17
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
18
+ }
19
+ catch (error) { e = { error: error }; }
20
+ finally {
21
+ try {
22
+ if (r && !r.done && (m = i["return"])) m.call(i);
23
+ }
24
+ finally { if (e) throw e.error; }
25
+ }
26
+ return ar;
27
+ };
28
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
29
+ import ScrollDialogContent from "../../../../components/ScrollDialogContent";
30
+ import DialogActions from '@mui/material/DialogActions';
31
+ import DialogContent from '@mui/material/DialogContent';
32
+ import { GetQuestionTemplate, ParseQuestionTemplate } from "../../../../services/ai-question";
33
+ import { useQuestionModelStore } from "../../../../store/ai-question/question-model-store";
34
+ import { DocumentIcon, DownloadIcon } from 'fbm-icons';
35
+ import { Box, Button, Dialog, Message, Typography } from 'fbm-ui';
36
+ import { DialogTitle, Divider } from 'fbm-ui/lib/mui';
37
+ import { saveAs } from 'file-saver';
38
+ import { useState } from 'react';
39
+ var BootVideo = function (props) {
40
+ var open = props.open, onClose = props.onClose;
41
+ var addModel = useQuestionModelStore(function (store) { return [store.addModel]; }).addModel;
42
+ var _a = __read(useState(0), 2), step = _a[0], setStep = _a[1];
43
+ var _b = __read(useState(''), 2), fileName = _b[0], setFileName = _b[1];
44
+ var _c = __read(useState({
45
+ countQuestion: 0,
46
+ countContent: 0,
47
+ steps: [],
48
+ }), 2), questionTemplate = _c[0], setQuestionTemplate = _c[1];
49
+ var handleOk = function () {
50
+ addModel(questionTemplate.steps);
51
+ onClose();
52
+ };
53
+ var handleQuestionImport = function (e) {
54
+ e.preventDefault();
55
+ var file = e.target.files[0];
56
+ console.log(file);
57
+ parseTemplate(file);
58
+ };
59
+ var dragQuestionImport = function (e) {
60
+ e.preventDefault();
61
+ var file = e.dataTransfer.files[0];
62
+ parseTemplate(file);
63
+ };
64
+ var parseTemplate = function (file) {
65
+ var formData = new FormData();
66
+ formData.append('files', file);
67
+ ParseQuestionTemplate(formData)
68
+ .then(function (resp) {
69
+ setFileName(file.name);
70
+ // @ts-ignore
71
+ setQuestionTemplate(resp.data);
72
+ setStep(1);
73
+ })
74
+ .catch(console.log);
75
+ };
76
+ var handleDowloadTemplate = function () {
77
+ GetQuestionTemplate()
78
+ .then(function (v) { return saveAs(v.data, '试卷模板.xlsx'); })
79
+ .catch(function (e) { return Message.error(e.toString()); });
80
+ };
81
+ return (_jsx(Dialog, __assign({ open: open, header: null, footer: null, okText: "\u786E\u8BA4", onClose: onClose, onOk: handleOk, width: 588,
82
+ // @ts-ignore
83
+ sx: {
84
+ '& .MuiPaper-root>.MuiBox-root, .FuiDialog-content': {
85
+ padding: 0,
86
+ margin: 0,
87
+ },
88
+ } }, { children: _jsxs(ScrollDialogContent, { children: [step === 0 && (_jsxs(Box, __assign({ sx: { display: 'flex', justifyContent: 'space-between', width: '100%' } }, { children: [_jsxs(Box, __assign({ bgcolor: "#E8F5E9", width: 228, flexGrow: 0, flexShrink: 0, pl: 4.5, pr: 2.75, pt: 11.25, height: 420 }, { children: [_jsx(Typography, __assign({ variant: "h6" }, { children: "1. \u9009\u62E9\u6A21\u677F" })), _jsxs(Typography, __assign({ variant: "body2", style: { marginTop: 24, marginBottom: 8 } }, { children: ["\u4F60\u53EF\u4EE5\u4E0B\u8F7D\u901A\u7528", _jsx("br", {}), " Excel \u6A21\u677F\u6587\u4EF6"] })), _jsx(Button, __assign({ variant: "contained", color: "primary", startIcon: _jsx(DownloadIcon, {}), onClick: handleDowloadTemplate }, { children: "\u4E0B\u8F7D\u901A\u7528\u6A21\u677F" }))] })), _jsxs(Box, __assign({ flexGrow: 1, display: "flex", flexDirection: "column", alignItems: "flex-end" }, { children: [_jsx(DialogContent, __assign({ sx: { boxSizing: 'border-box', width: '100%', py: 2 } }, { children: _jsxs(Box, { children: [_jsx(Box, __assign({ mb: 3, mt: 3.5 }, { children: _jsx(Typography, __assign({ variant: "h6" }, { children: "2. \u4E0A\u4F20\u586B\u5199\u5B8C\u6BD5\u7684Excel\u6587\u4EF6" })) })), _jsxs(Box, __assign({ mb: 4.75, height: 184, onDragOver: function (e) { return e.preventDefault(); }, onDrop: dragQuestionImport, sx: {
89
+ height: 166,
90
+ color: 'rgba(0, 0, 0, 0.6)',
91
+ border: '1px dashed #999999',
92
+ borderRadius: 0.5,
93
+ display: 'flex',
94
+ flexDirection: 'column',
95
+ justifyContent: 'center',
96
+ alignItems: 'center',
97
+ '& div': {
98
+ margin: '0.25rem',
99
+ },
100
+ } }, { children: [_jsx("div", { children: "\u5C06\u586B\u597D\u540E\u7684.xlsx\u6587\u4EF6\u62D6\u62FD\u81F3\u6B64\u5904" }), _jsx("div", { children: "\u6216" }), _jsx("div", { children: _jsxs(Button, __assign({ variant: "outlined",
101
+ // @ts-ignore
102
+ component: "label" }, { children: ["\u6D4F\u89C8\u6587\u4EF6", _jsx("input", { type: "file", name: "file", accept: ".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel", onChange: handleQuestionImport, style: { display: 'none' } })] })) })] }))] }) })), _jsxs(DialogActions, { children: [_jsx(Button, __assign({ variant: "text", onClick: onClose, color: "inherit" }, { children: "\u53D6\u6D88" })), _jsx(Button, __assign({ disabled: true }, { children: "\u7EE7\u7EED" }))] })] }))] }))), step === 1 && (_jsxs(Box, { children: [_jsx(DialogTitle, { children: "Excel \u5BFC\u5165" }), _jsxs(DialogContent, __assign({ sx: {
103
+ width: '100%',
104
+ boxSizing: 'border-box',
105
+ } }, { children: [_jsxs(Typography, __assign({ variant: "caption", color: "text.secondary", pb: 2, display: "block" }, { children: ["\u5F85\u5BFC\u5165", questionTemplate === null || questionTemplate === void 0 ? void 0 : questionTemplate.countQuestion, "\u9053\u9898\u76EE\uFF0C", questionTemplate === null || questionTemplate === void 0 ? void 0 : questionTemplate.countContent, "\u6761\u9762\u8BD5\u5185\u5BB9"] })), _jsxs(Box, { children: [_jsx(Divider, {}), _jsxs(Box, __assign({ display: "flex", justifyContent: "space-between", py: 2.5 }, { children: [_jsxs(Box, __assign({ display: "flex", alignItems: "center" }, { children: [_jsx(DocumentIcon, {}), " ", _jsx(Box, { children: fileName })] })), _jsx(Box, { children: _jsxs(Button, __assign({ variant: "outlined",
106
+ // @ts-ignore
107
+ component: "label" }, { children: ["\u66FF\u6362\u6587\u4EF6", _jsx("input", { type: "file", name: "file", accept: ".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel", onChange: handleQuestionImport, style: { display: 'none' } })] })) })] })), _jsx(Divider, {})] })] })), _jsxs(DialogActions, { children: [_jsx(Button, __assign({ variant: "text", onClick: onClose, color: "inherit" }, { children: "\u53D6\u6D88" })), _jsx(Button, __assign({ variant: "contained", color: "primary", onClick: handleOk }, { children: "\u5BFC\u5165" }))] })] }))] }) })));
108
+ };
109
+ export default BootVideo;
@@ -0,0 +1,8 @@
1
+ export interface BootVideoProps {
2
+ open: boolean;
3
+ onClose: () => void;
4
+ }
5
+ export interface MediaListProps {
6
+ videoUrl: string;
7
+ frameUrl: string;
8
+ }
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ export declare const CustomUploadCardRoot: import("@emotion/styled").StyledComponent<import("fbm-ui/lib/components/Box").BoxProps & {
3
+ children?: import("react").ReactNode;
4
+ } & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
5
+ export declare const CustomUploadCardTitle: import("@emotion/styled").StyledComponent<import("fbm-ui/lib/components/Box").BoxProps & {
6
+ children?: import("react").ReactNode;
7
+ } & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
8
+ export declare const CustomUploadButtonRoot: import("@emotion/styled").StyledComponent<import("fbm-ui/lib/components/Box").BoxProps & {
9
+ children?: import("react").ReactNode;
10
+ } & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
11
+ export declare const CustomUploadedImgRoot: import("@emotion/styled").StyledComponent<import("fbm-ui/lib/components/Box").BoxProps & {
12
+ children?: import("react").ReactNode;
13
+ } & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -0,0 +1,49 @@
1
+ import { Box, styled } from 'fbm-ui';
2
+ export var CustomUploadCardRoot = styled(Box)({
3
+ backgroundColor: '#fff',
4
+ border: '1px dashed #e0e0e0',
5
+ borderRadius: 4,
6
+ cursor: 'pointer',
7
+ height: 330,
8
+ width: 180,
9
+ margin: '0 auto',
10
+ display: 'flex',
11
+ alignItems: 'center',
12
+ justifyContent: 'center',
13
+ flexDirection: 'column',
14
+ '&:hover': {
15
+ backgroundColor: 'rgba(75,176,81,.04)',
16
+ },
17
+ });
18
+ export var CustomUploadCardTitle = styled(Box)({
19
+ display: 'flex',
20
+ alignItems: 'center',
21
+ justifyContent: 'center',
22
+ '& .MuiTypography-root': {
23
+ marginLeft: 8,
24
+ },
25
+ });
26
+ export var CustomUploadButtonRoot = styled(Box)({
27
+ display: 'flex',
28
+ alignItems: 'center',
29
+ justifyContent: 'center',
30
+ margin: '8px 0',
31
+ });
32
+ export var CustomUploadedImgRoot = styled(Box)({
33
+ minHeight: 100,
34
+ display: 'flex',
35
+ flexWrap: 'wrap',
36
+ alignItems: 'center',
37
+ padding: '8px 0',
38
+ boxSizing: 'content-box',
39
+ '& img, & div': {
40
+ boxSizing: 'border-box',
41
+ width: 56,
42
+ objectFit: 'cover',
43
+ // transition: 'all 0.3s ease 0s',
44
+ cursor: 'pointer',
45
+ border: '2px solid transparent',
46
+ borderRadius: 4,
47
+ marginRight: 4,
48
+ },
49
+ });
@@ -9,15 +9,36 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __read = (this && this.__read) || function (o, n) {
13
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
14
+ if (!m) return o;
15
+ var i = m.call(o), r, ar = [], e;
16
+ try {
17
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
18
+ }
19
+ catch (error) { e = { error: error }; }
20
+ finally {
21
+ try {
22
+ if (r && !r.done && (m = i["return"])) m.call(i);
23
+ }
24
+ finally { if (e) throw e.error; }
25
+ }
26
+ return ar;
27
+ };
12
28
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
29
+ import QuestionImport from '../QuestionImport';
13
30
  import { useQuestionModelStore } from "../../../../store/ai-question/question-model-store";
14
31
  import { getSecondToTime } from "../../../../utils/utils";
15
- import { Typography } from 'fbm-ui';
32
+ import { Button, Typography } from 'fbm-ui';
16
33
  import { Stack } from 'fbm-ui/lib/mui';
34
+ import { useState } from 'react';
17
35
  var QuestionHeader = function () {
18
36
  var questionModelData = useQuestionModelStore().questionModelData;
37
+ var _a = __read(useState(false), 2), open = _a[0], setOpen = _a[1];
19
38
  if (!questionModelData)
20
39
  return null;
21
- return (_jsxs(Stack, __assign({ width: "100%", direction: "row", spacing: 2, alignItems: "center" }, { children: [_jsxs(Typography, __assign({ variant: "body2", fontWeight: 500 }, { children: ["\u9884\u8BA1\u9762\u8BD5\u65F6\u957F\uFF1A", getSecondToTime((questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.duration) || 0)] })), _jsx(Typography, __assign({ variant: "caption", color: "secondary" }, { children: "\u62D6\u52A8\u8BD5\u9898\u5361\u7247\u53EF\u6539\u53D8\u8BD5\u9898\u987A\u5E8F" }))] })));
40
+ return (_jsxs(Stack, __assign({ width: "100%", direction: "row", alignItems: "center", justifyContent: "space-between" }, { children: [_jsxs(Stack, __assign({ direction: "row", spacing: 2, alignItems: "center" }, { children: [_jsxs(Typography, __assign({ variant: "body2", fontWeight: 500 }, { children: ["\u9884\u8BA1\u9762\u8BD5\u65F6\u957F\uFF1A", getSecondToTime((questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.duration) || 0)] })), _jsx(Typography, __assign({ variant: "caption", color: "secondary" }, { children: "\u62D6\u52A8\u8BD5\u9898\u5361\u7247\u53EF\u6539\u53D8\u8BD5\u9898\u987A\u5E8F" }))] })), _jsx(Button, __assign({ color: "inherit", variant: "outlined", onClick: function () { return setOpen(true); } }, { children: "\u5BFC\u5165\u9898\u76EE" })), open && (_jsx(QuestionImport, { open: open, onClose: function () {
41
+ setOpen(false);
42
+ } }))] })));
22
43
  };
23
44
  export default QuestionHeader;