eli-video-interview 1.2.41-alpha.35 → 1.2.41-alpha.36

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 (29) hide show
  1. package/esm/constants/ai-question.d.ts +1 -0
  2. package/esm/constants/ai-question.js +1 -0
  3. package/esm/modules/ai-question/Root.js +20 -26
  4. package/esm/modules/ai-question/components/BootVideo/CustomVideos.js +63 -25
  5. package/esm/modules/ai-question/components/BootVideo/index.js +56 -18
  6. package/esm/modules/ai-question/components/BootVideo/interface.d.ts +1 -0
  7. package/esm/modules/ai-question/components/BootVideo/styled.d.ts +3 -1
  8. package/esm/modules/ai-question/components/BootVideo/styled.js +20 -17
  9. package/esm/modules/ai-question/components/QuestionUpdate/VideoVoice.js +19 -10
  10. package/esm/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.d.ts +2 -1
  11. package/esm/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.js +15 -10
  12. package/esm/modules/ai-question/interface.d.ts +2 -0
  13. package/esm/store/ai-question/boot-video-store.d.ts +3 -0
  14. package/esm/store/ai-question/boot-video-store.js +1 -0
  15. package/lib/constants/ai-question.d.ts +1 -0
  16. package/lib/constants/ai-question.js +1 -0
  17. package/lib/modules/ai-question/Root.js +19 -25
  18. package/lib/modules/ai-question/components/BootVideo/CustomVideos.js +62 -24
  19. package/lib/modules/ai-question/components/BootVideo/index.js +56 -18
  20. package/lib/modules/ai-question/components/BootVideo/interface.d.ts +1 -0
  21. package/lib/modules/ai-question/components/BootVideo/styled.d.ts +3 -1
  22. package/lib/modules/ai-question/components/BootVideo/styled.js +20 -17
  23. package/lib/modules/ai-question/components/QuestionUpdate/VideoVoice.js +19 -10
  24. package/lib/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.d.ts +2 -1
  25. package/lib/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.js +13 -8
  26. package/lib/modules/ai-question/interface.d.ts +2 -0
  27. package/lib/store/ai-question/boot-video-store.d.ts +3 -0
  28. package/lib/store/ai-question/boot-video-store.js +1 -0
  29. package/package.json +1 -1
@@ -28,6 +28,7 @@ export declare const DEFAULT_GUIDE_VIDEO_THUMB_URL = "https://public-static-asse
28
28
  export declare const DEFAULT_GUIDE_VIDEO: {
29
29
  videoUrl: string;
30
30
  frameUrl: string;
31
+ loading: boolean;
31
32
  }[];
32
33
  export declare const DEFAULT_VITUAL_HUMAN_LIST: never[];
33
34
  export declare const InteractiveModes: {
@@ -57,6 +57,7 @@ export var DEFAULT_GUIDE_VIDEO = [
57
57
  {
58
58
  videoUrl: DEFAULT_GUIDE_VIDEO_URL,
59
59
  frameUrl: DEFAULT_GUIDE_VIDEO_THUMB_URL,
60
+ loading: false,
60
61
  },
61
62
  ];
62
63
  export var DEFAULT_VITUAL_HUMAN_LIST = [
@@ -53,7 +53,7 @@ import QuestionUpdate from './components/QuestionUpdate';
53
53
  import { useAiAbilityListStore } from "../../store/ai-ability-select/question-ability-store";
54
54
  import { PostAiModelUpsert } from "../../services/ai-question";
55
55
  import { AiAnalysisStoreProvider } from "../../store/ai-question/ai-analysis-store";
56
- import { useBootVideoStore } from "../../store/ai-question/boot-video-store";
56
+ import { getBootVideoStore, useBootVideoStore } from "../../store/ai-question/boot-video-store";
57
57
  import { useAiQuestionStore } from "../../store/ai-question/global-store";
58
58
  import { useInterviewRoomStore } from "../../store/ai-question/interview-room-store";
59
59
  import { getQuestionModelStore } from "../../store/ai-question/question-model-store";
@@ -62,15 +62,15 @@ import { Box, Message } from 'fbm-ui';
62
62
  import { forwardRef, memo, useEffect, useImperativeHandle } from 'react';
63
63
  var AiQuestionRoot = forwardRef(function (props, ref) {
64
64
  var updateState = useAiQuestionStore().updateState;
65
- var _a = useBootVideoStore(), mediaUrl = _a.mediaUrl, thumbUrl = _a.thumbUrl, appliedAllPosition = _a.appliedAllPosition, updateBootVideo = _a.updateBootVideo;
65
+ var updateBootVideo = useBootVideoStore().updateBootVideo;
66
66
  var interviewRoomState = useInterviewRoomStore().interviewRoomState;
67
67
  var addModel = useQuestionModelStore(function (store) { return [store.addModel]; }).addModel;
68
68
  var selctedAbilitys = useAiAbilityListStore().selctedAbilitys;
69
- console.log(mediaUrl, thumbUrl);
70
69
  var handleValues = function () { return __awaiter(void 0, void 0, void 0, function () {
71
- var questionModelData, steps;
72
- return __generator(this, function (_a) {
70
+ var questionModelData, _a, mediaUrl, thumbUrl, appliedAllPosition, steps;
71
+ return __generator(this, function (_b) {
73
72
  questionModelData = (getQuestionModelStore() || {}).questionModelData;
73
+ _a = getBootVideoStore() || {}, mediaUrl = _a.mediaUrl, thumbUrl = _a.thumbUrl, appliedAllPosition = _a.appliedAllPosition;
74
74
  steps = questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.steps.map(function (item) {
75
75
  item.weight = Number(item.weight);
76
76
  item.aiAbilities = item.aiAbilities.map(function (aiAbility) {
@@ -93,37 +93,31 @@ 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, _c, _d, _e, name, token, questions, aiModel, _f, mediaUrl, thumbUrl, appliedAllPosition, data, error_1;
97
- return __generator(this, function (_g) {
98
- switch (_g.label) {
99
- case 0:
100
- _b = (_a = console).log;
101
- _c = ['handleSubmit'];
102
- return [4 /*yield*/, handleValues()];
96
+ var _a, _b, name, token, questions, aiModel, _c, mediaUrl, thumbUrl, appliedAllPosition, data, error_1;
97
+ return __generator(this, function (_d) {
98
+ switch (_d.label) {
99
+ case 0: return [4 /*yield*/, handleValues()];
103
100
  case 1:
104
- _b.apply(_a, _c.concat([_g.sent()]));
105
- return [4 /*yield*/, handleValues()];
106
- case 2:
107
- _d = _g.sent(), _e = _d.data, name = _e.name, token = _e.token, questions = _e.steps, aiModel = _e.aiModel, _f = _d.media, mediaUrl = _f.mediaUrl, thumbUrl = _f.thumbUrl, appliedAllPosition = _f.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;
108
102
  if (!(questions === null || questions === void 0 ? void 0 : questions.length)) {
109
103
  Message.error('还未添加题目,请添加题目');
110
104
  return [2 /*return*/, Promise.reject()];
111
105
  }
112
- _g.label = 3;
113
- case 3:
114
- _g.trys.push([3, 5, , 6]);
106
+ _d.label = 2;
107
+ case 2:
108
+ _d.trys.push([2, 4, , 5]);
115
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 }))];
116
- case 4:
117
- data = (_g.sent()).data;
110
+ case 3:
111
+ data = (_d.sent()).data;
118
112
  return [2 /*return*/, Promise.resolve({
119
113
  code: 0,
120
114
  data: __assign(__assign({}, data), { mediaUrl: mediaUrl, thumbUrl: thumbUrl, appliedAllPosition: appliedAllPosition }),
121
115
  message: '保存成功',
122
116
  })];
123
- case 5:
124
- error_1 = _g.sent();
117
+ case 4:
118
+ error_1 = _d.sent();
125
119
  return [2 /*return*/, Promise.resolve(error_1)];
126
- case 6: return [2 /*return*/];
120
+ case 5: return [2 /*return*/];
127
121
  }
128
122
  });
129
123
  }); },
@@ -131,8 +125,8 @@ var AiQuestionRoot = forwardRef(function (props, ref) {
131
125
  useEffect(function () {
132
126
  updateState(props);
133
127
  if (props === null || props === void 0 ? void 0 : props.mediaList) {
134
- var _a = (props === null || props === void 0 ? void 0 : props.mediaList[0]) || {}, mediaUrl_1 = _a.url, thumbUrl_1 = _a.thumbUrl;
135
- updateBootVideo({ mediaUrl: mediaUrl_1, thumbUrl: thumbUrl_1 });
128
+ var _a = (props === null || props === void 0 ? void 0 : props.mediaList[0]) || {}, mediaUrl = _a.url, thumbUrl = _a.thumbUrl;
129
+ updateBootVideo({ mediaUrl: mediaUrl, thumbUrl: thumbUrl });
136
130
  }
137
131
  // eslint-disable-next-line react-hooks/exhaustive-deps
138
132
  }, [props]);
@@ -34,7 +34,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
34
34
  }
35
35
  return to.concat(ar || Array.prototype.slice.call(from));
36
36
  };
37
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
37
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
38
38
  import { CustomUploadButtonRoot, CustomUploadedImgRoot } from './styled';
39
39
  import UploadPreview from './UploadPreview';
40
40
  import { PostCommonUpload } from "../../../../services/ai-question";
@@ -45,49 +45,87 @@ import { Stack, Tooltip } from 'fbm-ui/lib/mui';
45
45
  import { useCallback } from 'react';
46
46
  var CustomVideos = function (_a) {
47
47
  var mediaList = _a.mediaList, setMediaList = _a.setMediaList;
48
- var _b = useRequest(PostCommonUpload, {
48
+ var tutorialVideos = mediaList.tutorialVideos, _b = mediaList.pcTutorialVideos, pcTutorialVideos = _b === void 0 ? [] : _b;
49
+ var _c = useRequest(function (type, formData) { return PostCommonUpload(formData); }, {
49
50
  manual: true,
50
- onSuccess: function (_a) {
51
+ onSuccess: function (_a, params) {
51
52
  var data = _a.data;
52
53
  var _b = __read(data, 1), item = _b[0];
53
- setMediaList(__spreadArray(__spreadArray([], __read(mediaList.map(function (v) { return (__assign(__assign({}, v), { selected: false })); })), false), [
54
- {
55
- url: item.url,
56
- selected: true,
57
- },
58
- ], false));
54
+ var isMobile = params[0] === 'mobile';
55
+ setMediaList({
56
+ tutorialVideos: isMobile
57
+ ? __spreadArray(__spreadArray([], __read(tutorialVideos.map(function (v) { return (__assign(__assign({}, v), { selected: false })); })), false), [
58
+ {
59
+ url: item.url,
60
+ selected: true,
61
+ },
62
+ ], false) : tutorialVideos,
63
+ pcTutorialVideos: !isMobile
64
+ ? __spreadArray(__spreadArray([], __read(pcTutorialVideos.map(function (v) { return (__assign(__assign({}, v), { selected: false })); })), false), [{ url: item.url, selected: true }], false) : pcTutorialVideos,
65
+ });
59
66
  },
60
- }), loading = _b.loading, postCommonUpload = _b.run;
67
+ }), loading = _c.loading, postCommonUpload = _c.run;
68
+ var _d = useRequest(function (type, formData) { return PostCommonUpload(formData); }, {
69
+ manual: true,
70
+ onSuccess: function (_a, params) {
71
+ var data = _a.data;
72
+ var _b = __read(data, 1), item = _b[0];
73
+ var isMobile = params[0] === 'mobile';
74
+ setMediaList({
75
+ tutorialVideos: isMobile
76
+ ? __spreadArray(__spreadArray([], __read(tutorialVideos.map(function (v) { return (__assign(__assign({}, v), { selected: false })); })), false), [
77
+ {
78
+ url: item.url,
79
+ selected: true,
80
+ },
81
+ ], false) : tutorialVideos,
82
+ pcTutorialVideos: !isMobile
83
+ ? __spreadArray(__spreadArray([], __read(pcTutorialVideos.map(function (v) { return (__assign(__assign({}, v), { selected: false })); })), false), [{ url: item.url, selected: true }], false) : pcTutorialVideos,
84
+ });
85
+ },
86
+ }), loadingPc = _d.loading, postPcCommonUpload = _d.run;
61
87
  var uploadProps = {
62
88
  type: 'custom',
63
89
  showUploadList: false,
64
90
  accept: '.mp4,.mov,.m4v,.3gp,.avi,.webm',
65
91
  maxCount: 7,
66
92
  customRequest: function (_a) {
67
- var file = _a.file;
68
- console.log('customRequest file', file);
93
+ var file = _a.file, action = _a.action;
69
94
  if (isExceedMaxVideoFileSize(file.size)) {
70
95
  Message.error('视频大小超过500M,请重新上传!');
71
96
  }
72
97
  else {
73
98
  var formData = new FormData();
74
99
  formData.append('files', file);
75
- postCommonUpload(formData);
100
+ if (action === 'mobile')
101
+ postCommonUpload(action, formData);
102
+ if (action === 'pc')
103
+ postPcCommonUpload(action, formData);
76
104
  }
77
105
  },
78
106
  };
79
- var handleSelectVideo = useCallback(function (i) {
80
- setMediaList(__spreadArray([], __read(mediaList.map(function (v, ii) { return (__assign(__assign({}, v), { selected: i === ii })); })), false));
81
- }, [mediaList, setMediaList]);
82
- var handleRemoveVideo = useCallback(function (index) {
83
- var newMediaList = __spreadArray([], __read(mediaList), false);
84
- newMediaList.splice(index, 1);
85
- setMediaList(newMediaList);
86
- }, [mediaList, setMediaList]);
107
+ var handleSelectVideo = useCallback(function (i, type) {
108
+ if (type === void 0) { type = 'mobile'; }
109
+ var isMobile = type === 'mobile';
110
+ setMediaList({
111
+ tutorialVideos: isMobile ? __spreadArray([], __read(tutorialVideos.map(function (v, ii) { return (__assign(__assign({}, v), { selected: i === ii })); })), false) : tutorialVideos,
112
+ pcTutorialVideos: !isMobile ? __spreadArray([], __read(pcTutorialVideos.map(function (v, ii) { return (__assign(__assign({}, v), { selected: i === ii })); })), false) : pcTutorialVideos,
113
+ });
114
+ }, [tutorialVideos, pcTutorialVideos, setMediaList]);
115
+ var handleRemoveVideo = useCallback(function (i, type) {
116
+ if (type === void 0) { type = 'mobile'; }
117
+ setMediaList({
118
+ tutorialVideos: type === 'mobile' ? tutorialVideos.filter(function (_, ii) { return ii !== i; }) : tutorialVideos,
119
+ pcTutorialVideos: type !== 'mobile' ? pcTutorialVideos.filter(function (_, ii) { return ii !== i; }) : pcTutorialVideos,
120
+ });
121
+ }, [tutorialVideos, pcTutorialVideos, setMediaList]);
87
122
  console.log(mediaList);
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
- var url = _a.url, selected = _a.selected;
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: 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" })))] }));
123
+ return (_jsxs(Stack, { children: [_jsxs(Stack, { children: [_jsx(Typography, __assign({ variant: "body2", fontWeight: "medium", mt: 3 }, { children: "\u5F15\u5BFC\u89C6\u9891" })), _jsx(Typography, __assign({ variant: "caption" }, { children: "\u79FB\u52A8\u7AEF" })), _jsxs(CustomUploadedImgRoot, __assign({ sx: { minHeight: 0 } }, { children: [tutorialVideos === null || tutorialVideos === void 0 ? void 0 : tutorialVideos.map(function (_a, i) {
124
+ var url = _a.url, selected = _a.selected;
125
+ 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));
126
+ }), loading && _jsx(Box, { height: 100, loading: { size: 24, loading: true, isMask: true } })] })), _jsxs(Stack, __assign({ direction: "row", alignItems: "center" }, { children: [_jsxs(CustomUploadButtonRoot, { children: [(tutorialVideos === null || tutorialVideos === void 0 ? void 0 : tutorialVideos.length) < 5 && (_jsx(Upload, __assign({}, uploadProps, { action: "mobile" }, { children: _jsx(Button, __assign({ variant: "outlined", disabled: (tutorialVideos === null || tutorialVideos === void 0 ? void 0 : tutorialVideos.length) > 5, color: "inherit", icon: _jsx(AddIcon, {}) }, { children: "\u4E0A\u4F20\u89C6\u9891" })) }))), (tutorialVideos === null || tutorialVideos === void 0 ? void 0 : tutorialVideos.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 } }) })) }))] })), (tutorialVideos === null || tutorialVideos === void 0 ? void 0 : tutorialVideos.length) === 0 && (_jsx(Typography, __assign({ variant: "caption", color: "error" }, { children: "\u4E0A\u4F20\u89C6\u9891\u4E0D\u53EF\u4E3A\u7A7A" })))] }), _jsxs(Stack, { children: [_jsx(Typography, __assign({ variant: "caption" }, { children: "\u7535\u8111\u7AEF" })), _jsxs(CustomUploadedImgRoot, __assign({ sx: { minHeight: 0 } }, { children: [pcTutorialVideos === null || pcTutorialVideos === void 0 ? void 0 : pcTutorialVideos.map(function (_a, i) {
127
+ var url = _a.url, selected = _a.selected;
128
+ 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, 'pc'); }, onRemove: function () { return handleRemoveVideo(i, 'pc'); } }, url));
129
+ }), loadingPc && _jsx(Box, { height: 100, loading: { size: 24, loading: true, isMask: true } })] })), _jsxs(Stack, __assign({ direction: "row", alignItems: "center" }, { children: [_jsxs(CustomUploadButtonRoot, { children: [(pcTutorialVideos === null || pcTutorialVideos === void 0 ? void 0 : pcTutorialVideos.length) < 5 && (_jsx(Upload, __assign({}, uploadProps, { action: "pc" }, { children: _jsx(Button, __assign({ variant: "outlined", disabled: (pcTutorialVideos === null || pcTutorialVideos === void 0 ? void 0 : pcTutorialVideos.length) > 5, color: "inherit", icon: _jsx(AddIcon, {}) }, { children: "\u4E0A\u4F20\u89C6\u9891" })) }))), (pcTutorialVideos === null || pcTutorialVideos === void 0 ? void 0 : pcTutorialVideos.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 } }) })) }))] })), (pcTutorialVideos === null || pcTutorialVideos === void 0 ? void 0 : pcTutorialVideos.length) === 0 && (_jsx(Typography, __assign({ variant: "caption", color: "error" }, { children: "\u4E0A\u4F20\u89C6\u9891\u4E0D\u53EF\u4E3A\u7A7A" })))] })] }));
92
130
  };
93
131
  export default CustomVideos;
@@ -54,15 +54,17 @@ var Options = [
54
54
  { label: '自定义播报', value: 3 },
55
55
  ];
56
56
  var BootVideo = function (props) {
57
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
57
+ var _a, _b, _c, _d, _e, _f, _g, _h;
58
58
  var open = props.open, onClose = props.onClose;
59
- var _k = useInterviewRoomStore(), interactType = _k.interactType, aiInterviewerProfile = _k.aiInterviewerProfile, updateInterviewRoom = _k.updateInterviewRoom, interactionMethods = _k.interactionMethods;
60
- var _l = __read(useState({ interactType: interactType, aiInterviewerProfile: aiInterviewerProfile, interactionMethods: interactionMethods }), 2), interviewRoomState = _l[0], setInterviewRoomState = _l[1];
61
- var _m = __read(useState(interactionMethods || DEFAULT_VITUAL_HUMAN_LIST), 2), virtualManList = _m[0], setVirtualManList = _m[1];
62
- var _o = useBootVideoStore(), mediaUrl = _o.mediaUrl, thumbUrl = _o.thumbUrl, updateBootVideo = _o.updateBootVideo;
63
- var _p = __read(useState(DEFAULT_GUIDE_VIDEO), 2), mediaList = _p[0], setMediaList = _p[1];
64
- var _q = __read(useSetState({ mediaUrl: mediaUrl, thumbUrl: thumbUrl, appliedAllPosition: false }), 2), mediaState = _q[0], setMediaState = _q[1];
65
- var postCommonUpload = useRequest(PostCommonUpload, {
59
+ var _j = useInterviewRoomStore(), interactType = _j.interactType, aiInterviewerProfile = _j.aiInterviewerProfile, updateInterviewRoom = _j.updateInterviewRoom, interactionMethods = _j.interactionMethods;
60
+ var _k = __read(useState({ interactType: interactType, aiInterviewerProfile: aiInterviewerProfile, interactionMethods: interactionMethods }), 2), interviewRoomState = _k[0], setInterviewRoomState = _k[1];
61
+ var _l = __read(useState(interactionMethods || DEFAULT_VITUAL_HUMAN_LIST), 2), virtualManList = _l[0], setVirtualManList = _l[1];
62
+ var _m = useBootVideoStore(), pcUrl = _m.pcUrl, mediaUrl = _m.mediaUrl, thumbUrl = _m.thumbUrl, updateBootVideo = _m.updateBootVideo;
63
+ // 传统引导视频
64
+ var _o = __read(useState(DEFAULT_GUIDE_VIDEO), 2), mediaList = _o[0], setMediaList = _o[1];
65
+ var _p = __read(useState(DEFAULT_GUIDE_VIDEO), 2), pcMediaList = _p[0], setPcMediaList = _p[1];
66
+ var _q = __read(useSetState({ pcUrl: pcUrl, mediaUrl: mediaUrl, thumbUrl: thumbUrl, appliedAllPosition: false }), 2), mediaState = _q[0], setMediaState = _q[1];
67
+ var _r = useRequest(PostCommonUpload, {
66
68
  manual: true,
67
69
  onSuccess: function (_a) {
68
70
  var data = _a.data;
@@ -75,9 +77,25 @@ var BootVideo = function (props) {
75
77
  frameUrl: item.mineExtra.firstFrameUrl,
76
78
  },
77
79
  ]);
78
- setMediaState({ mediaUrl: item.url, thumbUrl: item.mineExtra.firstFrameUrl });
80
+ setMediaState({ pcUrl: pcUrl, mediaUrl: item.url, thumbUrl: item.mineExtra.firstFrameUrl });
79
81
  },
80
- }).run;
82
+ }), loading = _r.loading, postCommonUpload = _r.run;
83
+ var _s = useRequest(PostCommonUpload, {
84
+ manual: true,
85
+ onSuccess: function (_a) {
86
+ var data = _a.data;
87
+ var _b = __read(data, 1), item = _b[0];
88
+ var OfficialMedia = pcMediaList[0];
89
+ setPcMediaList([
90
+ OfficialMedia,
91
+ {
92
+ videoUrl: item.url,
93
+ frameUrl: item.mineExtra.firstFrameUrl,
94
+ },
95
+ ]);
96
+ setMediaState({ pcUrl: item.url, mediaUrl: mediaUrl, thumbUrl: item.mineExtra.firstFrameUrl });
97
+ },
98
+ }), pcLoading = _s.loading, postPCCommonUpload = _s.run;
81
99
  var getAiInterviewerProfileList = useRequest(GetAiInterviewerProfileList, {
82
100
  manual: true,
83
101
  onSuccess: function (_a) {
@@ -88,13 +106,12 @@ var BootVideo = function (props) {
88
106
  },
89
107
  }).run;
90
108
  var handleSelectVideo = useCallback(function (mediaUrl, thumbUrl) {
91
- console.log('handleSelectVideo', mediaUrl, thumbUrl);
92
109
  setMediaState({ mediaUrl: mediaUrl, thumbUrl: thumbUrl });
93
110
  }, [setMediaState]);
94
111
  var handleSetVideo = useCallback(function (data) {
95
112
  setVirtualManList(virtualManList.map(function (v) {
96
113
  if (v.selected) {
97
- return __assign(__assign({}, v), { detail: __assign(__assign({}, v.detail), { tutorialVideos: data }) });
114
+ return __assign(__assign({}, v), { detail: __assign(__assign({}, v.detail), data) });
98
115
  }
99
116
  return v;
100
117
  }));
@@ -159,6 +176,24 @@ var BootVideo = function (props) {
159
176
  }
160
177
  },
161
178
  };
179
+ var pcUploadProps = {
180
+ type: 'custom',
181
+ showUploadList: false,
182
+ accept: '.mp4,.mov,.m4v,.3gp,.avi,.webm',
183
+ maxCount: 7,
184
+ customRequest: function (_a) {
185
+ var file = _a.file;
186
+ console.log('customRequest file', file);
187
+ if (isExceedMaxVideoFileSize(file.size)) {
188
+ Message.error('视频大小超过500M,请重新上传!');
189
+ }
190
+ else {
191
+ var formData = new FormData();
192
+ formData.append('files', file);
193
+ postPCCommonUpload(formData);
194
+ }
195
+ },
196
+ };
162
197
  var handleGuidanceText = useCallback(function (e) {
163
198
  setVirtualManList(virtualManList.map(function (v) {
164
199
  if (v.selected) {
@@ -205,13 +240,16 @@ var BootVideo = function (props) {
205
240
  // @ts-ignore
206
241
  aiInterviewerProfile: (_a = virtualManList.find(function (v) { return v.type === value; })) === null || _a === void 0 ? void 0 : _a.detail }));
207
242
  }
208
- }, 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: {
243
+ }, sx: { width: 240, height: 'auto', mt: 1 } }), broadcastType === 3 && (_jsxs(Stack, { children: [_jsx(CustomVideos, { mediaList: virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.detail, 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: (((_a = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.guidanceText) === null || _a === void 0 ? void 0 : _a.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: (_b = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.detail) === null || _b === void 0 ? void 0 : _b.virtualHumanAvatar, style: {
209
244
  borderColor: 'transparent',
210
- }, 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: {
245
+ }, height: 100, alt: "" }) }) })), broadcastType === 3 && (_jsx(CustomUploadedImgRoot, { children: (_d = (_c = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.detail) === null || _c === void 0 ? void 0 : _c.interviewerShows) === null || _d === void 0 ? void 0 : _d.map(function (human) { return (_jsxs(Box, { children: [_jsx("img", { src: human.virtualHumanAvatar, style: {
211
246
  borderColor: human.selected ? '#4CAF50' : 'transparent',
212
- }, 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) {
213
- var videoUrl = _a.videoUrl, frameUrl = _a.frameUrl;
214
- 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));
215
- }) }), _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 } }) })) })), _jsx(Box, __assign({ ml: 2 }, { children: _jsx(Checkbox, { checked: mediaState.appliedAllPosition, label: _jsx(Typography, __assign({ variant: "body2" }, { children: "\u5E94\u7528\u5230\u6240\u6709AI\u89C6\u9891" })), onChange: function (e, checked) { return setMediaState({ appliedAllPosition: checked }); } }) }))] }))] }))] })) })) }) })));
247
+ }, 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) || ((_g = (_f = (_e = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.detail) === null || _e === void 0 ? void 0 : _e.interviewerShows) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.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: (((_h = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.guidanceText) === null || _h === void 0 ? void 0 : _h.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(Stack, { children: [_jsxs(Stack, { children: [_jsx(Typography, __assign({ fontSize: "14px", variant: "body1", fontWeight: 500, mt: 2, mb: 1 }, { children: "\u5F15\u5BFC\u89C6\u9891" })), _jsx(Typography, __assign({ variant: "caption", mb: 2 }, { children: "\u79FB\u52A8\u7AEF" })), _jsxs(CustomUploadedImgRoot, { children: [mediaList.map(function (_a) {
248
+ var videoUrl = _a.videoUrl, frameUrl = _a.frameUrl;
249
+ 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));
250
+ }), 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 } }) })) }))] }))] }), _jsxs(Stack, { children: [_jsx(Typography, __assign({ variant: "caption", mb: 2 }, { children: "\u7535\u8111\u7AEF" })), _jsxs(CustomUploadedImgRoot, __assign({ platform: "pc" }, { children: [pcMediaList.map(function (_a) {
251
+ var videoUrl = _a.videoUrl, frameUrl = _a.frameUrl;
252
+ return (_jsx(Box, { children: _jsx("img", { src: frameUrl, style: { borderColor: (mediaState === null || mediaState === void 0 ? void 0 : mediaState.pcUrl) === videoUrl ? '#4CAF50' : 'transparent' }, height: 100, alt: "", onClick: function () { return handleSelectVideo(videoUrl, frameUrl); } }) }, videoUrl));
253
+ }), pcLoading && _jsx(Box, { height: 100, loading: { size: 24, loading: true, isMask: true } })] })), _jsxs(Stack, __assign({ direction: "row", alignItems: "center" }, { children: [_jsxs(CustomUploadButtonRoot, { children: [pcMediaList.length <= 5 && (_jsx(Upload, __assign({}, pcUploadProps, { children: _jsx(Button, __assign({ variant: "outlined", disabled: mediaList.length > 5, color: "inherit", icon: _jsx(AddIcon, {}) }, { children: "\u4E0A\u4F20\u89C6\u9891" })) }))), pcMediaList.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 } }) })) })), _jsx(Box, __assign({ ml: 2 }, { children: _jsx(Checkbox, { checked: mediaState.appliedAllPosition, label: _jsx(Typography, __assign({ variant: "body2" }, { children: "\u5E94\u7528\u5230\u6240\u6709AI\u89C6\u9891" })), onChange: function (e, checked) { return setMediaState({ appliedAllPosition: checked }); } }) }))] }))] })] }))] })) })) }) })));
216
254
  };
217
255
  export default BootVideo;
@@ -5,4 +5,5 @@ export interface BootVideoProps {
5
5
  export interface MediaListProps {
6
6
  videoUrl: string;
7
7
  frameUrl: string;
8
+ loading?: boolean;
8
9
  }
@@ -10,4 +10,6 @@ export declare const CustomUploadButtonRoot: import("@emotion/styled").StyledCom
10
10
  } & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
11
11
  export declare const CustomUploadedImgRoot: import("@emotion/styled").StyledComponent<import("fbm-ui/lib/components/Box").BoxProps & {
12
12
  children?: import("react").ReactNode;
13
- } & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
13
+ } & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
14
+ platform?: "mobile" | "pc" | undefined;
15
+ }, {}, {}>;
@@ -29,21 +29,24 @@ export var CustomUploadButtonRoot = styled(Box)({
29
29
  justifyContent: 'center',
30
30
  margin: '8px 0',
31
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
- },
32
+ export var CustomUploadedImgRoot = styled(Box)(function (_a) {
33
+ var _b = _a.platform, platform = _b === void 0 ? 'mobile' : _b;
34
+ return ({
35
+ minHeight: "".concat(platform === 'mobile' ? 100 : 90, "px"),
36
+ display: 'flex',
37
+ flexWrap: 'wrap',
38
+ alignItems: 'center',
39
+ // padding: '8px 0',
40
+ boxSizing: 'content-box',
41
+ '& img, & div': {
42
+ boxSizing: 'border-box',
43
+ width: "".concat(platform === 'mobile' ? 56 : 160, "px"),
44
+ objectFit: 'cover',
45
+ // transition: 'all 0.3s ease 0s',
46
+ cursor: 'pointer',
47
+ border: '2px solid transparent',
48
+ borderRadius: 4,
49
+ marginRight: 4,
50
+ },
51
+ });
49
52
  });
@@ -45,16 +45,25 @@ var VideoVoice = function () {
45
45
  return (_jsx(FieldArray, { name: "questions", render: function (_a) {
46
46
  var _b;
47
47
  var form = _a.form;
48
- return (_b = form.values.questions) === null || _b === void 0 ? void 0 : _b.map(function (q, index) { return (_jsxs(Box, __assign({ display: "flex", mb: 3 }, { children: [_jsxs(Box, __assign({ width: 96, height: 96, mr: 2, textAlign: "center", overflow: "hidden", sx: {
49
- borderRadius: 2,
50
- border: '1px dashed rgba(0,0,0, 0.08)',
51
- } }, { children: [q.videoUrl && (_jsx(VideoVoicePreview, { onDel: function () {
52
- var questons = __spreadArray([], __read(form.values.questions), false);
53
- questons[index] = __assign(__assign({}, questons[index]), { videoUrl: '' });
54
- form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], __read(questons), false) }));
55
- }, videoUrl: q.videoUrl })), _jsx(VideoVoiceUploader, { index: index, questions: form.values.questions, setQuestions: function (qs) {
56
- form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], __read(qs), false) }));
57
- } })] })), _jsxs(Stack, __assign({ flexGrow: 1, justifyContent: "space-between", spacing: 3 }, { children: [_jsxs(Stack, __assign({ flexGrow: 1, direction: "row", justifyContent: "space-between", spacing: 1 }, { children: [_jsx(FormItem, { required: true, name: "questions.".concat(index, ".content"), label: "\u9762\u8BD5\u5185\u5BB9", max: 300, placeholder: "\u9762\u8BD5\u5185\u5BB9\uFF08\u7CFB\u7EDF\u5C06\u6839\u636E\u6B64\u5185\u5BB9\u5411\u5019\u9009\u4EBA\u8FDB\u884C\u8BED\u97F3\u64AD\u62A5\uFF09", InputProps: {
48
+ return (_b = form.values.questions) === null || _b === void 0 ? void 0 : _b.map(function (q, index) { return (_jsxs(Box, __assign({ display: "flex", mb: 3 }, { children: [_jsxs(Stack, __assign({ spacing: 2, width: 96, mr: 2 }, { children: [_jsxs(Box, __assign({ textAlign: "center", overflow: "hidden", height: 57, sx: {
49
+ borderRadius: 2,
50
+ border: '1px dashed rgba(0,0,0, 0.08)',
51
+ } }, { children: [q.videoUrl && (_jsx(VideoVoicePreview, { onDel: function () {
52
+ var questons = __spreadArray([], __read(form.values.questions), false);
53
+ questons[index] = __assign(__assign({}, questons[index]), { videoUrl: '' });
54
+ form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], __read(questons), false) }));
55
+ }, videoUrl: q.videoUrl })), _jsx(VideoVoiceUploader, { index: index, questions: form.values.questions, setQuestions: function (qs) {
56
+ form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], __read(qs), false) }));
57
+ } })] })), _jsxs(Box, __assign({ textAlign: "center", overflow: "hidden", height: 57, sx: {
58
+ borderRadius: 2,
59
+ border: '1px dashed rgba(0,0,0, 0.08)',
60
+ } }, { children: [q.videoURLWide && (_jsx(VideoVoicePreview, { onDel: function () {
61
+ var questons = __spreadArray([], __read(form.values.questions), false);
62
+ questons[index] = __assign(__assign({}, questons[index]), { videoURLWide: '' });
63
+ form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], __read(questons), false) }));
64
+ }, videoUrl: q.videoURLWide })), _jsx(VideoVoiceUploader, { index: index, type: "pc", questions: form.values.questions, setQuestions: function (qs) {
65
+ form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], __read(qs), false) }));
66
+ } })] }))] })), _jsxs(Stack, __assign({ flexGrow: 1, justifyContent: "space-between", spacing: 3 }, { children: [_jsxs(Stack, __assign({ flexGrow: 1, direction: "row", justifyContent: "space-between", spacing: 1 }, { children: [_jsx(FormItem, { required: true, name: "questions.".concat(index, ".content"), label: "\u9762\u8BD5\u5185\u5BB9", max: 300, placeholder: "\u9762\u8BD5\u5185\u5BB9\uFF08\u7CFB\u7EDF\u5C06\u6839\u636E\u6B64\u5185\u5BB9\u5411\u5019\u9009\u4EBA\u8FDB\u884C\u8BED\u97F3\u64AD\u62A5\uFF09", InputProps: {
58
67
  rows: 3,
59
68
  multiline: true,
60
69
  placeholder: '面试内容(系统将根据此内容向候选人进行语音播报)',
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
- declare const VideoVoiceUploader: ({ index, questions, setQuestions }: {
2
+ declare const VideoVoiceUploader: ({ index, questions, setQuestions, type }: {
3
3
  index: any;
4
4
  questions: any;
5
5
  setQuestions: any;
6
+ type?: string | undefined;
6
7
  }) => JSX.Element;
7
8
  export default VideoVoiceUploader;
@@ -34,23 +34,23 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
34
34
  }
35
35
  return to.concat(ar || Array.prototype.slice.call(from));
36
36
  };
37
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
37
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
38
38
  import { PostCommonUpload } from "../../../../services/ai-question";
39
39
  import { isExceedMaxVideoFileSize } from "../../../../utils/utils";
40
40
  import { useRequest } from 'ahooks';
41
41
  import { Message, Typography, Upload, UploadIcon } from 'fbm-ui';
42
- import { Stack } from 'fbm-ui/lib/mui';
42
+ import { CircularProgress, Stack } from 'fbm-ui/lib/mui';
43
43
  var VideoVoiceUploader = function (_a) {
44
- var index = _a.index, questions = _a.questions, setQuestions = _a.setQuestions;
45
- var _b = useRequest(PostCommonUpload, {
44
+ var index = _a.index, questions = _a.questions, setQuestions = _a.setQuestions, _b = _a.type, type = _b === void 0 ? 'mobile' : _b;
45
+ var _c = useRequest(PostCommonUpload, {
46
46
  manual: true,
47
47
  onSuccess: function (_a) {
48
48
  var data = _a.data;
49
49
  var _b = __read(data, 1), firstData = _b[0];
50
- questions[index] = __assign(__assign({}, questions[index]), { videoUrl: firstData.url });
50
+ questions[index] = __assign(__assign({}, questions[index]), (type === 'mobile' ? { videoUrl: firstData.url } : { videoURLWide: firstData.url }));
51
51
  setQuestions(__spreadArray([], __read(questions), false));
52
52
  },
53
- }), loading = _b.loading, postCommonUpload = _b.run;
53
+ }), loading = _c.loading, postCommonUpload = _c.run;
54
54
  var uploadProps = {
55
55
  type: 'custom',
56
56
  showUploadList: false,
@@ -67,10 +67,15 @@ var VideoVoiceUploader = function (_a) {
67
67
  }
68
68
  },
69
69
  };
70
- return (_jsx(Upload, __assign({}, uploadProps, { children: _jsxs(Stack, __assign({ justifyContent: "center", alignItems: "center", color: "text.secondary", sx: {
70
+ return (_jsx(Upload, __assign({}, uploadProps, {
71
+ // @ts-ignore
72
+ sx: {
73
+ width: '100%',
74
+ height: '100%',
75
+ } }, { children: _jsxs(Stack, __assign({ justifyContent: "center", alignItems: "center", color: "text.secondary", sx: {
71
76
  cursor: 'pointer',
72
- width: 94,
73
- height: 94,
74
- } }, { children: [!loading && (_jsxs(_Fragment, { children: [_jsx(UploadIcon, { color: "inherit" }), _jsx(Typography, __assign({ variant: "caption", color: "inherit" }, { children: "\u4E0A\u4F20\u89C6\u9891" }))] })), loading && _jsx(Typography, __assign({ variant: "caption" }, { children: "\u4E0A\u4F20\u4E2D..." }))] })) })));
77
+ width: '100%',
78
+ height: '100%',
79
+ } }, { children: [!loading && (_jsxs(Stack, __assign({ justifyContent: "center", alignItems: "center" }, { children: [_jsx(UploadIcon, { color: "inherit" }), _jsx(Typography, __assign({ variant: "caption", color: "inherit" }, { children: "\u4E0A\u4F20\u89C6\u9891" }))] }))), loading && (_jsxs(Stack, __assign({ justifyContent: "center", alignItems: "center" }, { children: [_jsx(CircularProgress, { size: 24, color: "inherit" }), _jsx(Typography, __assign({ variant: "caption" }, { children: "\u4E0A\u4F20\u4E2D..." }))] })))] })) })));
75
80
  };
76
81
  export default VideoVoiceUploader;
@@ -41,6 +41,7 @@ export interface SaveAiModelDataRes {
41
41
  data: SaveAiModelData;
42
42
  }
43
43
  export interface Media {
44
+ pcUrl?: string;
44
45
  mediaUrl?: string;
45
46
  thumbUrl?: string;
46
47
  appliedAllPosition?: boolean;
@@ -109,6 +110,7 @@ export interface Detail {
109
110
  xmSoundUrl?: string;
110
111
  desc?: string;
111
112
  tutorialVideos?: TutorialVideo[];
113
+ pcTutorialVideos?: TutorialVideo[];
112
114
  interviewerShows?: InterviewerShow[];
113
115
  }
114
116
  export interface TutorialVideo {
@@ -1,16 +1,19 @@
1
1
  import { Media } from '@/modules/ai-question/interface';
2
2
  export declare const useBootVideoStore: (depsFn?: import("hox/es/types").DepsFn<{
3
3
  updateBootVideo: (params: Media) => void;
4
+ pcUrl?: string | undefined;
4
5
  mediaUrl?: string | undefined;
5
6
  thumbUrl?: string | undefined;
6
7
  appliedAllPosition?: boolean | undefined;
7
8
  }> | undefined) => {
8
9
  updateBootVideo: (params: Media) => void;
10
+ pcUrl?: string | undefined;
9
11
  mediaUrl?: string | undefined;
10
12
  thumbUrl?: string | undefined;
11
13
  appliedAllPosition?: boolean | undefined;
12
14
  }, getBootVideoStore: () => {
13
15
  updateBootVideo: (params: Media) => void;
16
+ pcUrl?: string | undefined;
14
17
  mediaUrl?: string | undefined;
15
18
  thumbUrl?: string | undefined;
16
19
  appliedAllPosition?: boolean | undefined;
@@ -31,6 +31,7 @@ import { createGlobalStore } from 'hox';
31
31
  import { useState } from 'react';
32
32
  export var useBootVideoStore = (_a = __read(createGlobalStore(function () {
33
33
  var _a = __read(useState({
34
+ pcUrl: DEFAULT_GUIDE_VIDEO_URL,
34
35
  mediaUrl: DEFAULT_GUIDE_VIDEO_URL,
35
36
  thumbUrl: DEFAULT_GUIDE_VIDEO_THUMB_URL,
36
37
  appliedAllPosition: false,
@@ -28,6 +28,7 @@ export declare const DEFAULT_GUIDE_VIDEO_THUMB_URL = "https://public-static-asse
28
28
  export declare const DEFAULT_GUIDE_VIDEO: {
29
29
  videoUrl: string;
30
30
  frameUrl: string;
31
+ loading: boolean;
31
32
  }[];
32
33
  export declare const DEFAULT_VITUAL_HUMAN_LIST: never[];
33
34
  export declare const InteractiveModes: {
@@ -60,6 +60,7 @@ exports.DEFAULT_GUIDE_VIDEO = [
60
60
  {
61
61
  videoUrl: exports.DEFAULT_GUIDE_VIDEO_URL,
62
62
  frameUrl: exports.DEFAULT_GUIDE_VIDEO_THUMB_URL,
63
+ loading: false,
63
64
  },
64
65
  ];
65
66
  exports.DEFAULT_VITUAL_HUMAN_LIST = [