eli-video-interview 1.2.41-alpha.25 → 1.2.41-alpha.26
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.
- package/esm/modules/ai-question/components/QuestionUpdate/FllowupSetting.js +15 -3
- package/esm/modules/ai-question/components/QuestionUpdate/FollowupKeyPoints.js +12 -7
- package/esm/modules/ai-question/components/QuestionUpdate/FollowupTarget.js +10 -5
- package/esm/modules/ai-question/components/QuestionUpdate/Form.js +1 -1
- package/esm/modules/ai-question/components/QuestionUpdate/VideoVoice.js +9 -8
- package/lib/modules/ai-question/components/QuestionUpdate/FllowupSetting.js +15 -3
- package/lib/modules/ai-question/components/QuestionUpdate/FollowupKeyPoints.js +12 -7
- package/lib/modules/ai-question/components/QuestionUpdate/FollowupTarget.js +10 -5
- package/lib/modules/ai-question/components/QuestionUpdate/Form.js +1 -1
- package/lib/modules/ai-question/components/QuestionUpdate/VideoVoice.js +9 -8
- package/package.json +1 -1
|
@@ -42,7 +42,7 @@ import { Stack, Tooltip } from 'fbm-ui/lib/mui';
|
|
|
42
42
|
import { useState } from 'react';
|
|
43
43
|
var formater = function (content, title) {
|
|
44
44
|
if (title === void 0) { title = ''; }
|
|
45
|
-
return (_jsxs(Stack, __assign({ spacing: 1 }, { children: [_jsx(Typography, __assign({ variant: "caption", color: "white" }, { children: "".concat(title, "\uFF1A") })), content.map(function (item, index) { return (_jsx(Typography, __assign({ variant: "caption", color: "white" }, { children: "".concat(index + 1, "\u3001").concat(item) }), index)); })] })));
|
|
45
|
+
return (_jsxs(Stack, __assign({ spacing: 1 }, { children: [_jsx(Typography, __assign({ variant: "caption", color: "white" }, { children: "".concat(title, "\uFF1A") })), content === null || content === void 0 ? void 0 : content.map(function (item, index) { return (_jsx(Typography, __assign({ variant: "caption", color: "white" }, { children: "".concat(index + 1, "\u3001").concat(item) }), index)); })] })));
|
|
46
46
|
};
|
|
47
47
|
var FllowupSetting = function (_a) {
|
|
48
48
|
var index = _a.index, form = _a.form;
|
|
@@ -55,14 +55,26 @@ var FllowupSetting = function (_a) {
|
|
|
55
55
|
var handleScorePointsChange = function (scorePoints) {
|
|
56
56
|
form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], __read(form.values.questions.map(function (q, i) { return (i === index ? __assign(__assign({}, q), { scorePoints: scorePoints }) : q); })), false) }));
|
|
57
57
|
};
|
|
58
|
-
|
|
58
|
+
var hasFollowUpGoals = (followUpGoals === null || followUpGoals === void 0 ? void 0 : followUpGoals.length) > 0;
|
|
59
|
+
var hasFolllowUpPoints = (scorePoints === null || scorePoints === void 0 ? void 0 : scorePoints.length) > 0;
|
|
60
|
+
return (_jsxs(Layout, { children: [_jsx(Stack, __assign({ spacing: 2, mb: 1, direction: "row", alignItems: "center", justifyContent: "space-between", mt: 0.375 }, { children: _jsxs(Stack, __assign({ spacing: 1, direction: "row", alignItems: "center" }, { children: [_jsx(Tooltip, __assign({ title: hasFolllowUpPoints ? formater(scorePoints, '得分点') : '暂未设置得分点' }, { children: _jsx(Chip, { color: hasFolllowUpPoints ? 'primary' : 'default', style: hasFolllowUpPoints
|
|
61
|
+
? {
|
|
62
|
+
backgroundColor: '#E8F5E9',
|
|
63
|
+
border: '1px solid transparent',
|
|
64
|
+
}
|
|
65
|
+
: {}, label: hasFolllowUpPoints ? "\u542B".concat(scorePoints.length, "\u6761\u9898\u76EE\u5F97\u5206\u70B9") : '添加题目得分点', onClick: function () {
|
|
59
66
|
if (content) {
|
|
60
67
|
setOpenKeyPoints(true);
|
|
61
68
|
}
|
|
62
69
|
else {
|
|
63
70
|
Message.error('面试内容为空,不能设置得分点');
|
|
64
71
|
}
|
|
65
|
-
} }) })), _jsx(Tooltip, __assign({ title:
|
|
72
|
+
} }) })), _jsx(Tooltip, __assign({ title: hasFollowUpGoals ? formater(followUpGoals, '目标') : '暂未设置追问目标' }, { children: _jsx(Chip, { color: hasFollowUpGoals ? 'primary' : 'default', label: hasFollowUpGoals ? "\u542B".concat(followUpGoals.length, "\u6761\u8FFD\u95EE\u76EE\u6807") : '添加追问目标', style: hasFollowUpGoals
|
|
73
|
+
? {
|
|
74
|
+
backgroundColor: '#E8F5E9',
|
|
75
|
+
border: '1px solid transparent',
|
|
76
|
+
}
|
|
77
|
+
: {}, onClick: function () {
|
|
66
78
|
if (content) {
|
|
67
79
|
setOpenTarget(true);
|
|
68
80
|
}
|
|
@@ -40,17 +40,18 @@ import { AddIcon, AiIcon, CloseIcon } from 'fbm-icons';
|
|
|
40
40
|
import { Box, Button, Dialog, IconButton, Message, TextField, Typography } from 'fbm-ui';
|
|
41
41
|
import { Stack } from 'fbm-ui/lib/mui';
|
|
42
42
|
import { useCallback, useState } from 'react';
|
|
43
|
+
var MAX_TEXT_LENGTH = 100;
|
|
43
44
|
var FollowupKeyPoints = function (_a) {
|
|
44
45
|
var followUpGoals = _a.followUpGoals, question = _a.question, open = _a.open, onClose = _a.onClose, onOk = _a.onOk;
|
|
45
|
-
var _b = __read(useState(followUpGoals || [
|
|
46
|
+
var _b = __read(useState(followUpGoals || []), 2), values = _b[0], setValues = _b[1];
|
|
46
47
|
var _c = __read(useState(false), 2), loading = _c[0], setLoading = _c[1];
|
|
47
48
|
var handleMakeFromAi = useCallback(function () {
|
|
48
49
|
setLoading(true);
|
|
49
50
|
PostAiModelGenerateByAI({ q: question })
|
|
50
51
|
.then(function (res) {
|
|
51
|
-
var _a = res, code = _a.code, _b = _a.data.
|
|
52
|
+
var _a = res, code = _a.code, _b = _a.data.list, list = _b === void 0 ? [] : _b, message = _a.message;
|
|
52
53
|
if (code === 0) {
|
|
53
|
-
setValues(__spreadArray(__spreadArray([], __read(values), false),
|
|
54
|
+
setValues(__spreadArray(__spreadArray([], __read(values), false), __read(list), false));
|
|
54
55
|
}
|
|
55
56
|
else {
|
|
56
57
|
return Promise.reject(message);
|
|
@@ -75,13 +76,17 @@ var FollowupKeyPoints = function (_a) {
|
|
|
75
76
|
return (_jsx(Dialog, __assign({ open: open,
|
|
76
77
|
// @ts-ignore
|
|
77
78
|
title: _jsxs(Stack, __assign({ direction: "row", spacing: 1 }, { children: [_jsx(Typography, __assign({ variant: "body1", fontWeight: 700 }, { children: "\u8BBE\u7F6E\u9898\u76EE\u5F97\u5206\u70B9" })), _jsx(Typography, __assign({ variant: "body2", color: "textSecondary" }, { children: "\uFF08\u6700\u591A\u6DFB\u52A03\u6761\uFF09" }))] })), size: "sm", onClose: onClose, okText: "\u786E\u8BA4", onOk: function () {
|
|
78
|
-
|
|
79
|
+
var filtered = values.filter(function (item) { return item.trim(); });
|
|
80
|
+
if (filtered.length > 3) {
|
|
79
81
|
return Message.error('最多添加3条得分点,请移除多余的得分点。');
|
|
80
82
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
var canUse = filtered.every(function (item) { return item.length <= MAX_TEXT_LENGTH; });
|
|
84
|
+
if (canUse) {
|
|
85
|
+
onOk(filtered);
|
|
86
|
+
onClose();
|
|
87
|
+
}
|
|
83
88
|
} }, { children: _jsxs(Stack, { children: [_jsx(Typography, __assign({ variant: "body2", color: "textSecondary", mb: 4 }, { children: question })), values === null || values === void 0 ? void 0 : values.map(function (item, index) {
|
|
84
|
-
return (_jsxs(Stack, __assign({ direction: "row", spacing: 1 }, { children: [_jsx(TextField, { max:
|
|
89
|
+
return (_jsxs(Stack, __assign({ direction: "row", spacing: 1 }, { children: [_jsx(TextField, { max: MAX_TEXT_LENGTH, error: item.length > MAX_TEXT_LENGTH, sx: { flexGrow: 1, height: 'auto' }, value: item, onChange: function (e) {
|
|
85
90
|
handleChange(index, e.target.value);
|
|
86
91
|
} }), _jsx(Box, __assign({ height: 84, pt: 1 }, { children: _jsx(IconButton, __assign({ size: "small", onClick: function () { return handleRemove(index); } }, { children: _jsx(CloseIcon, {}) })) }))] }), index));
|
|
87
92
|
}), _jsxs(Stack, __assign({ spacing: 1, direction: "row", alignItems: "center" }, { children: [_jsx(Button, __assign({ variant: "outlined", color: "inherit", startIcon: _jsx(AddIcon, {}), onClick: handleAdd }, { children: "\u6DFB\u52A0" })), _jsx(Button, __assign({ variant: "outlined", loading: loading, color: "inherit", startIcon: _jsx(AiIcon, {}), onClick: handleMakeFromAi }, { children: "AI\u751F\u6210" }))] }))] }) })));
|
|
@@ -39,9 +39,10 @@ import { AddIcon, CloseIcon } from 'fbm-icons';
|
|
|
39
39
|
import { Box, Button, Dialog, IconButton, Message, TextField, Typography } from 'fbm-ui';
|
|
40
40
|
import { Stack } from 'fbm-ui/lib/mui';
|
|
41
41
|
import { useCallback, useState } from 'react';
|
|
42
|
+
var MAX_TEXT_LENGTH = 100;
|
|
42
43
|
var FollowupTarget = function (_a) {
|
|
43
44
|
var scorePoints = _a.scorePoints, question = _a.question, open = _a.open, onClose = _a.onClose, onOk = _a.onOk;
|
|
44
|
-
var _b = __read(useState(scorePoints || [
|
|
45
|
+
var _b = __read(useState(scorePoints || []), 2), values = _b[0], setValues = _b[1];
|
|
45
46
|
var handleChange = useCallback(function (index, value) {
|
|
46
47
|
setValues(values.map(function (item, i) { return (i === index ? value : item); }));
|
|
47
48
|
}, [values]);
|
|
@@ -54,13 +55,17 @@ var FollowupTarget = function (_a) {
|
|
|
54
55
|
return (_jsx(Dialog, __assign({ open: open,
|
|
55
56
|
// @ts-ignore
|
|
56
57
|
title: _jsxs(Stack, __assign({ direction: "row", spacing: 1 }, { children: [_jsx(Typography, __assign({ variant: "body1", fontWeight: 700 }, { children: "\u8BBE\u7F6E\u8FFD\u95EE\u76EE\u6807" })), _jsx(Typography, __assign({ variant: "body2", color: "textSecondary" }, { children: "\uFF08\u6700\u591A\u6DFB\u52A03\u6761\uFF09" }))] })), size: "sm", onClose: onClose, okText: "\u786E\u8BA4", onOk: function () {
|
|
57
|
-
|
|
58
|
+
var filtered = values.filter(function (item) { return item.trim(); });
|
|
59
|
+
if (filtered.length > 3) {
|
|
58
60
|
return Message.error('最多添加3条追问目标,请移除多余的目标。');
|
|
59
61
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
var canUse = filtered.every(function (item) { return item.length <= MAX_TEXT_LENGTH; });
|
|
63
|
+
if (canUse) {
|
|
64
|
+
onOk(filtered);
|
|
65
|
+
onClose();
|
|
66
|
+
}
|
|
62
67
|
} }, { children: _jsxs(Stack, { children: [_jsx(Typography, __assign({ variant: "body2", color: "textSecondary", mb: 4 }, { children: question })), values === null || values === void 0 ? void 0 : values.map(function (item, index) {
|
|
63
|
-
return (_jsxs(Stack, __assign({ direction: "row", spacing: 1 }, { children: [_jsx(TextField, { max:
|
|
68
|
+
return (_jsxs(Stack, __assign({ direction: "row", spacing: 1 }, { children: [_jsx(TextField, { max: MAX_TEXT_LENGTH, error: item.length > MAX_TEXT_LENGTH, sx: { flexGrow: 1, height: 'auto' }, value: item, onChange: function (e) {
|
|
64
69
|
handleChange(index, e.target.value);
|
|
65
70
|
} }), _jsx(Box, __assign({ height: 84, pt: 1 }, { children: _jsx(IconButton, __assign({ size: "small", onClick: function () { return handleRemove(index); } }, { children: _jsx(CloseIcon, {}) })) }))] }), index));
|
|
66
71
|
}), _jsx(Stack, __assign({ spacing: 1, direction: "row", alignItems: "center" }, { children: _jsx(Button, __assign({ variant: "outlined", color: "inherit", startIcon: _jsx(AddIcon, {}), onClick: handleAdd }, { children: "\u6DFB\u52A0" })) }))] }) })));
|
|
@@ -168,7 +168,7 @@ var QuestionForm = forwardRef(function (props, ref) {
|
|
|
168
168
|
sx: { padding: 0 },
|
|
169
169
|
}, sx: { flexGrow: 1, height: 120 } }), form.values.questions.length > 1 && (_jsx(Box, __assign({ height: 84, pt: 1 }, { children: _jsx(IconButton, __assign({ size: "small", onClick: function () {
|
|
170
170
|
form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], __read(form.values.questions.filter(function (_, i) { return i !== index; })), false) }));
|
|
171
|
-
} }, { children: _jsx(CloseIcon, {}) })) })))] }), index), _jsx(FllowupSetting, { index: index, form: form })] })); });
|
|
171
|
+
} }, { children: _jsx(CloseIcon, {}) })) })))] }), index), aiShowType === ADD_QUESTION_TYPE.FREE && _jsx(FllowupSetting, { index: index, form: form })] })); });
|
|
172
172
|
} })) : (_jsx(VideoVoice, {}))), !preview && aiShowType === ADD_QUESTION_TYPE.SINGLECHIOCE && (
|
|
173
173
|
// @ts-ignore
|
|
174
174
|
_jsx(Box, { children: _jsx(FieldArray, { name: "questions", render: function () {
|
|
@@ -35,6 +35,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
35
35
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
36
36
|
};
|
|
37
37
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
38
|
+
import FllowupSetting from './FllowupSetting';
|
|
38
39
|
import VideoVoicePreview from './VideoVoicePreview';
|
|
39
40
|
import VideoVoiceUploader from './VideoVoiceUploader';
|
|
40
41
|
import { Box, CloseIcon, FormItem, IconButton } from 'fbm-ui';
|
|
@@ -53,14 +54,14 @@ var VideoVoice = function () {
|
|
|
53
54
|
form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], __read(questons), false) }));
|
|
54
55
|
}, videoUrl: q.videoUrl })), _jsx(VideoVoiceUploader, { index: index, questions: form.values.questions, setQuestions: function (qs) {
|
|
55
56
|
form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], __read(qs), false) }));
|
|
56
|
-
} })] })), _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: {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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: {
|
|
58
|
+
rows: 3,
|
|
59
|
+
multiline: true,
|
|
60
|
+
placeholder: '面试内容(系统将根据此内容向候选人进行语音播报)',
|
|
61
|
+
sx: { padding: 0 },
|
|
62
|
+
}, sx: { flexGrow: 1 } }), form.values.questions.length > 1 && (_jsx(Box, __assign({ height: 84, pt: 1 }, { children: _jsx(IconButton, __assign({ size: "small", onClick: function () {
|
|
63
|
+
form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], __read(form.values.questions.filter(function (_, i) { return i !== index; })), false) }));
|
|
64
|
+
} }, { children: _jsx(CloseIcon, {}) })) })))] })), _jsx(FllowupSetting, { index: index, form: form })] }))] }), index)); });
|
|
64
65
|
} }));
|
|
65
66
|
};
|
|
66
67
|
export default VideoVoice;
|
|
@@ -47,7 +47,7 @@ var mui_1 = require("fbm-ui/lib/mui");
|
|
|
47
47
|
var react_1 = require("react");
|
|
48
48
|
var formater = function (content, title) {
|
|
49
49
|
if (title === void 0) { title = ''; }
|
|
50
|
-
return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ spacing: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "white" }, { children: "".concat(title, "\uFF1A") })), content.map(function (item, index) { return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "white" }, { children: "".concat(index + 1, "\u3001").concat(item) }), index)); })] })));
|
|
50
|
+
return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ spacing: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "white" }, { children: "".concat(title, "\uFF1A") })), content === null || content === void 0 ? void 0 : content.map(function (item, index) { return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "white" }, { children: "".concat(index + 1, "\u3001").concat(item) }), index)); })] })));
|
|
51
51
|
};
|
|
52
52
|
var FllowupSetting = function (_a) {
|
|
53
53
|
var index = _a.index, form = _a.form;
|
|
@@ -60,14 +60,26 @@ var FllowupSetting = function (_a) {
|
|
|
60
60
|
var handleScorePointsChange = function (scorePoints) {
|
|
61
61
|
form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], __read(form.values.questions.map(function (q, i) { return (i === index ? __assign(__assign({}, q), { scorePoints: scorePoints }) : q); })), false) }));
|
|
62
62
|
};
|
|
63
|
-
|
|
63
|
+
var hasFollowUpGoals = (followUpGoals === null || followUpGoals === void 0 ? void 0 : followUpGoals.length) > 0;
|
|
64
|
+
var hasFolllowUpPoints = (scorePoints === null || scorePoints === void 0 ? void 0 : scorePoints.length) > 0;
|
|
65
|
+
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Layout, { children: [(0, jsx_runtime_1.jsx)(mui_1.Stack, __assign({ spacing: 2, mb: 1, direction: "row", alignItems: "center", justifyContent: "space-between", mt: 0.375 }, { children: (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ spacing: 1, direction: "row", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(mui_1.Tooltip, __assign({ title: hasFolllowUpPoints ? formater(scorePoints, '得分点') : '暂未设置得分点' }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Chip, { color: hasFolllowUpPoints ? 'primary' : 'default', style: hasFolllowUpPoints
|
|
66
|
+
? {
|
|
67
|
+
backgroundColor: '#E8F5E9',
|
|
68
|
+
border: '1px solid transparent',
|
|
69
|
+
}
|
|
70
|
+
: {}, label: hasFolllowUpPoints ? "\u542B".concat(scorePoints.length, "\u6761\u9898\u76EE\u5F97\u5206\u70B9") : '添加题目得分点', onClick: function () {
|
|
64
71
|
if (content) {
|
|
65
72
|
setOpenKeyPoints(true);
|
|
66
73
|
}
|
|
67
74
|
else {
|
|
68
75
|
fbm_ui_1.Message.error('面试内容为空,不能设置得分点');
|
|
69
76
|
}
|
|
70
|
-
} }) })), (0, jsx_runtime_1.jsx)(mui_1.Tooltip, __assign({ title:
|
|
77
|
+
} }) })), (0, jsx_runtime_1.jsx)(mui_1.Tooltip, __assign({ title: hasFollowUpGoals ? formater(followUpGoals, '目标') : '暂未设置追问目标' }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Chip, { color: hasFollowUpGoals ? 'primary' : 'default', label: hasFollowUpGoals ? "\u542B".concat(followUpGoals.length, "\u6761\u8FFD\u95EE\u76EE\u6807") : '添加追问目标', style: hasFollowUpGoals
|
|
78
|
+
? {
|
|
79
|
+
backgroundColor: '#E8F5E9',
|
|
80
|
+
border: '1px solid transparent',
|
|
81
|
+
}
|
|
82
|
+
: {}, onClick: function () {
|
|
71
83
|
if (content) {
|
|
72
84
|
setOpenTarget(true);
|
|
73
85
|
}
|
|
@@ -42,17 +42,18 @@ var fbm_icons_1 = require("fbm-icons");
|
|
|
42
42
|
var fbm_ui_1 = require("fbm-ui");
|
|
43
43
|
var mui_1 = require("fbm-ui/lib/mui");
|
|
44
44
|
var react_1 = require("react");
|
|
45
|
+
var MAX_TEXT_LENGTH = 100;
|
|
45
46
|
var FollowupKeyPoints = function (_a) {
|
|
46
47
|
var followUpGoals = _a.followUpGoals, question = _a.question, open = _a.open, onClose = _a.onClose, onOk = _a.onOk;
|
|
47
|
-
var _b = __read((0, react_1.useState)(followUpGoals || [
|
|
48
|
+
var _b = __read((0, react_1.useState)(followUpGoals || []), 2), values = _b[0], setValues = _b[1];
|
|
48
49
|
var _c = __read((0, react_1.useState)(false), 2), loading = _c[0], setLoading = _c[1];
|
|
49
50
|
var handleMakeFromAi = (0, react_1.useCallback)(function () {
|
|
50
51
|
setLoading(true);
|
|
51
52
|
(0, ai_question_1.PostAiModelGenerateByAI)({ q: question })
|
|
52
53
|
.then(function (res) {
|
|
53
|
-
var _a = res, code = _a.code, _b = _a.data.
|
|
54
|
+
var _a = res, code = _a.code, _b = _a.data.list, list = _b === void 0 ? [] : _b, message = _a.message;
|
|
54
55
|
if (code === 0) {
|
|
55
|
-
setValues(__spreadArray(__spreadArray([], __read(values), false),
|
|
56
|
+
setValues(__spreadArray(__spreadArray([], __read(values), false), __read(list), false));
|
|
56
57
|
}
|
|
57
58
|
else {
|
|
58
59
|
return Promise.reject(message);
|
|
@@ -77,13 +78,17 @@ var FollowupKeyPoints = function (_a) {
|
|
|
77
78
|
return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Dialog, __assign({ open: open,
|
|
78
79
|
// @ts-ignore
|
|
79
80
|
title: (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", spacing: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body1", fontWeight: 700 }, { children: "\u8BBE\u7F6E\u9898\u76EE\u5F97\u5206\u70B9" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "textSecondary" }, { children: "\uFF08\u6700\u591A\u6DFB\u52A03\u6761\uFF09" }))] })), size: "sm", onClose: onClose, okText: "\u786E\u8BA4", onOk: function () {
|
|
80
|
-
|
|
81
|
+
var filtered = values.filter(function (item) { return item.trim(); });
|
|
82
|
+
if (filtered.length > 3) {
|
|
81
83
|
return fbm_ui_1.Message.error('最多添加3条得分点,请移除多余的得分点。');
|
|
82
84
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
var canUse = filtered.every(function (item) { return item.length <= MAX_TEXT_LENGTH; });
|
|
86
|
+
if (canUse) {
|
|
87
|
+
onOk(filtered);
|
|
88
|
+
onClose();
|
|
89
|
+
}
|
|
85
90
|
} }, { children: (0, jsx_runtime_1.jsxs)(mui_1.Stack, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "textSecondary", mb: 4 }, { children: question })), values === null || values === void 0 ? void 0 : values.map(function (item, index) {
|
|
86
|
-
return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", spacing: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.TextField, { max:
|
|
91
|
+
return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", spacing: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.TextField, { max: MAX_TEXT_LENGTH, error: item.length > MAX_TEXT_LENGTH, sx: { flexGrow: 1, height: 'auto' }, value: item, onChange: function (e) {
|
|
87
92
|
handleChange(index, e.target.value);
|
|
88
93
|
} }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ height: 84, pt: 1 }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ size: "small", onClick: function () { return handleRemove(index); } }, { children: (0, jsx_runtime_1.jsx)(fbm_icons_1.CloseIcon, {}) })) }))] }), index));
|
|
89
94
|
}), (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ spacing: 1, direction: "row", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "outlined", color: "inherit", startIcon: (0, jsx_runtime_1.jsx)(fbm_icons_1.AddIcon, {}), onClick: handleAdd }, { children: "\u6DFB\u52A0" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "outlined", loading: loading, color: "inherit", startIcon: (0, jsx_runtime_1.jsx)(fbm_icons_1.AiIcon, {}), onClick: handleMakeFromAi }, { children: "AI\u751F\u6210" }))] }))] }) })));
|
|
@@ -41,9 +41,10 @@ var fbm_icons_1 = require("fbm-icons");
|
|
|
41
41
|
var fbm_ui_1 = require("fbm-ui");
|
|
42
42
|
var mui_1 = require("fbm-ui/lib/mui");
|
|
43
43
|
var react_1 = require("react");
|
|
44
|
+
var MAX_TEXT_LENGTH = 100;
|
|
44
45
|
var FollowupTarget = function (_a) {
|
|
45
46
|
var scorePoints = _a.scorePoints, question = _a.question, open = _a.open, onClose = _a.onClose, onOk = _a.onOk;
|
|
46
|
-
var _b = __read((0, react_1.useState)(scorePoints || [
|
|
47
|
+
var _b = __read((0, react_1.useState)(scorePoints || []), 2), values = _b[0], setValues = _b[1];
|
|
47
48
|
var handleChange = (0, react_1.useCallback)(function (index, value) {
|
|
48
49
|
setValues(values.map(function (item, i) { return (i === index ? value : item); }));
|
|
49
50
|
}, [values]);
|
|
@@ -56,13 +57,17 @@ var FollowupTarget = function (_a) {
|
|
|
56
57
|
return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Dialog, __assign({ open: open,
|
|
57
58
|
// @ts-ignore
|
|
58
59
|
title: (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", spacing: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body1", fontWeight: 700 }, { children: "\u8BBE\u7F6E\u8FFD\u95EE\u76EE\u6807" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "textSecondary" }, { children: "\uFF08\u6700\u591A\u6DFB\u52A03\u6761\uFF09" }))] })), size: "sm", onClose: onClose, okText: "\u786E\u8BA4", onOk: function () {
|
|
59
|
-
|
|
60
|
+
var filtered = values.filter(function (item) { return item.trim(); });
|
|
61
|
+
if (filtered.length > 3) {
|
|
60
62
|
return fbm_ui_1.Message.error('最多添加3条追问目标,请移除多余的目标。');
|
|
61
63
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
var canUse = filtered.every(function (item) { return item.length <= MAX_TEXT_LENGTH; });
|
|
65
|
+
if (canUse) {
|
|
66
|
+
onOk(filtered);
|
|
67
|
+
onClose();
|
|
68
|
+
}
|
|
64
69
|
} }, { children: (0, jsx_runtime_1.jsxs)(mui_1.Stack, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "textSecondary", mb: 4 }, { children: question })), values === null || values === void 0 ? void 0 : values.map(function (item, index) {
|
|
65
|
-
return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", spacing: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.TextField, { max:
|
|
70
|
+
return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", spacing: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.TextField, { max: MAX_TEXT_LENGTH, error: item.length > MAX_TEXT_LENGTH, sx: { flexGrow: 1, height: 'auto' }, value: item, onChange: function (e) {
|
|
66
71
|
handleChange(index, e.target.value);
|
|
67
72
|
} }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ height: 84, pt: 1 }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ size: "small", onClick: function () { return handleRemove(index); } }, { children: (0, jsx_runtime_1.jsx)(fbm_icons_1.CloseIcon, {}) })) }))] }), index));
|
|
68
73
|
}), (0, jsx_runtime_1.jsx)(mui_1.Stack, __assign({ spacing: 1, direction: "row", alignItems: "center" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "outlined", color: "inherit", startIcon: (0, jsx_runtime_1.jsx)(fbm_icons_1.AddIcon, {}), onClick: handleAdd }, { children: "\u6DFB\u52A0" })) }))] }) })));
|
|
@@ -173,7 +173,7 @@ var QuestionForm = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
173
173
|
sx: { padding: 0 },
|
|
174
174
|
}, sx: { flexGrow: 1, height: 120 } }), form.values.questions.length > 1 && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ height: 84, pt: 1 }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ size: "small", onClick: function () {
|
|
175
175
|
form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], __read(form.values.questions.filter(function (_, i) { return i !== index; })), false) }));
|
|
176
|
-
} }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.CloseIcon, {}) })) })))] }), index), (0, jsx_runtime_1.jsx)(FllowupSetting_1.default, { index: index, form: form })] })); });
|
|
176
|
+
} }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.CloseIcon, {}) })) })))] }), index), aiShowType === ai_question_1.ADD_QUESTION_TYPE.FREE && (0, jsx_runtime_1.jsx)(FllowupSetting_1.default, { index: index, form: form })] })); });
|
|
177
177
|
} })) : ((0, jsx_runtime_1.jsx)(VideoVoice_1.default, {}))), !preview && aiShowType === ai_question_1.ADD_QUESTION_TYPE.SINGLECHIOCE && (
|
|
178
178
|
// @ts-ignore
|
|
179
179
|
(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, { children: (0, jsx_runtime_1.jsx)(formik_1.FieldArray, { name: "questions", render: function () {
|
|
@@ -40,6 +40,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
42
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
43
|
+
var FllowupSetting_1 = __importDefault(require("./FllowupSetting"));
|
|
43
44
|
var VideoVoicePreview_1 = __importDefault(require("./VideoVoicePreview"));
|
|
44
45
|
var VideoVoiceUploader_1 = __importDefault(require("./VideoVoiceUploader"));
|
|
45
46
|
var fbm_ui_1 = require("fbm-ui");
|
|
@@ -58,14 +59,14 @@ var VideoVoice = function () {
|
|
|
58
59
|
form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], __read(questons), false) }));
|
|
59
60
|
}, videoUrl: q.videoUrl })), (0, jsx_runtime_1.jsx)(VideoVoiceUploader_1.default, { index: index, questions: form.values.questions, setQuestions: function (qs) {
|
|
60
61
|
form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], __read(qs), false) }));
|
|
61
|
-
} })] })), (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ flexGrow: 1, direction: "row", justifyContent: "space-between", spacing: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.FormItem, { required: true, name: "questions.".concat(index, ".content"), label: "\u9762\u8BD5\u5185\u5BB9", max: 300, placeholder: "\u9762\u8BD5\u5185\u5BB9\uFF08\u7CFB\u7EDF\u5C06\u6839\u636E\u6B64\u5185\u5BB9\u5411\u5019\u9009\u4EBA\u8FDB\u884C\u8BED\u97F3\u64AD\u62A5\uFF09", InputProps: {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
} })] })), (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ flexGrow: 1, justifyContent: "space-between", spacing: 3 }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ flexGrow: 1, direction: "row", justifyContent: "space-between", spacing: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.FormItem, { required: true, name: "questions.".concat(index, ".content"), label: "\u9762\u8BD5\u5185\u5BB9", max: 300, placeholder: "\u9762\u8BD5\u5185\u5BB9\uFF08\u7CFB\u7EDF\u5C06\u6839\u636E\u6B64\u5185\u5BB9\u5411\u5019\u9009\u4EBA\u8FDB\u884C\u8BED\u97F3\u64AD\u62A5\uFF09", InputProps: {
|
|
63
|
+
rows: 3,
|
|
64
|
+
multiline: true,
|
|
65
|
+
placeholder: '面试内容(系统将根据此内容向候选人进行语音播报)',
|
|
66
|
+
sx: { padding: 0 },
|
|
67
|
+
}, sx: { flexGrow: 1 } }), form.values.questions.length > 1 && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ height: 84, pt: 1 }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ size: "small", onClick: function () {
|
|
68
|
+
form.setValues(__assign(__assign({}, form.values), { questions: __spreadArray([], __read(form.values.questions.filter(function (_, i) { return i !== index; })), false) }));
|
|
69
|
+
} }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.CloseIcon, {}) })) })))] })), (0, jsx_runtime_1.jsx)(FllowupSetting_1.default, { index: index, form: form })] }))] }), index)); });
|
|
69
70
|
} }));
|
|
70
71
|
};
|
|
71
72
|
exports.default = VideoVoice;
|