eli-video-interview 1.2.29-beta.3 → 1.2.29
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-ability/Root.js +1 -1
- package/esm/modules/ai-ability/components/AbilityFormItem/index.d.ts +2 -1
- package/esm/modules/ai-ability/components/AbilityFormItem/index.js +12 -10
- package/esm/modules/ai-ability/components/AddAbility/index.js +4 -32
- package/esm/modules/ai-ability/components/UpdateAbility/index.js +6 -41
- package/esm/modules/ai-ability/const.d.ts +8 -0
- package/esm/modules/ai-ability/const.js +34 -0
- package/esm/modules/ai-ability/interface.d.ts +1 -1
- package/esm/modules/ai-question/components/AiAnalysis/AnalysisItem.js +2 -2
- package/esm/modules/ai-question/components/QuestionUpdate/Form.js +3 -1
- package/esm/modules/ai-question/components/QuestionUpdate/index.js +2 -2
- package/esm/modules/ai-template/components/TemplateHeader/index.js +1 -1
- package/lib/modules/ai-ability/Root.js +1 -1
- package/lib/modules/ai-ability/components/AbilityFormItem/index.d.ts +2 -1
- package/lib/modules/ai-ability/components/AbilityFormItem/index.js +12 -10
- package/lib/modules/ai-ability/components/AddAbility/index.js +4 -32
- package/lib/modules/ai-ability/components/UpdateAbility/index.js +6 -41
- package/lib/modules/ai-ability/const.d.ts +8 -0
- package/lib/modules/ai-ability/const.js +37 -0
- package/lib/modules/ai-ability/interface.d.ts +1 -1
- package/lib/modules/ai-question/components/AiAnalysis/AnalysisItem.js +2 -2
- package/lib/modules/ai-question/components/QuestionUpdate/Form.js +3 -1
- package/lib/modules/ai-question/components/QuestionUpdate/index.js +2 -2
- package/lib/modules/ai-template/components/TemplateHeader/index.js +1 -1
- package/package.json +1 -1
|
@@ -138,7 +138,7 @@ var AiAbilityRoot = function () {
|
|
|
138
138
|
label: '操作',
|
|
139
139
|
render: function (_a) {
|
|
140
140
|
var row = _a.row;
|
|
141
|
-
return row.type === 1 ? (_jsx(Tooltip, __assign({ title: "\u80FD\u529B\u8BE6\u60C5" }, { children: _jsx(Link, { sx: { color: 'rgba(0, 0, 0, 0.56)', mr: 3, cursor: 'pointer' }, text: _jsx(DocumentIcon, {}), onClick: function () { return handleEdit(row); } }) }))) : (_jsxs(_Fragment, { children: [_jsx(Tooltip, __assign({ title: "\u80FD\u529B\u8BE6\u60C5" }, { children: _jsx(Link, { sx: { color: 'rgba(0, 0, 0, 0.56)', mr: 3, cursor: 'pointer' }, text: _jsx(DocumentIcon, {}), onClick: function () { return handleEdit(row); } }) })), _jsx(Link, { sx: { color: 'rgba(0, 0, 0, 0.56)', cursor: 'pointer' }, text: _jsx(DeleteIcon, {}), onClick: function () { return handleDelete(row); } })] }));
|
|
141
|
+
return row.type === 1 ? (_jsx(Tooltip, __assign({ title: "\u80FD\u529B\u8BE6\u60C5" }, { children: _jsx(Link, { sx: { color: 'rgba(0, 0, 0, 0.56)', mr: 3, cursor: 'pointer' }, text: _jsx(DocumentIcon, {}), onClick: function () { return handleEdit(row); } }) }))) : (_jsxs(_Fragment, { children: [_jsx(Tooltip, __assign({ title: "\u80FD\u529B\u8BE6\u60C5" }, { children: _jsx(Link, { sx: { color: 'rgba(0, 0, 0, 0.56)', mr: 3, cursor: 'pointer' }, text: _jsx(DocumentIcon, {}), onClick: function () { return handleEdit(row); } }) })), _jsx(Tooltip, __assign({ title: "\u5220\u9664" }, { children: _jsx(Link, { sx: { color: 'rgba(0, 0, 0, 0.56)', cursor: 'pointer' }, text: _jsx(DeleteIcon, {}), onClick: function () { return handleDelete(row); } }) }))] }));
|
|
142
142
|
},
|
|
143
143
|
},
|
|
144
144
|
];
|
|
@@ -4,9 +4,10 @@ interface AbilityFormItemProps {
|
|
|
4
4
|
title: string;
|
|
5
5
|
name: string;
|
|
6
6
|
type: number;
|
|
7
|
-
|
|
7
|
+
items?: string[];
|
|
8
8
|
mode: string;
|
|
9
9
|
canReplace?: boolean;
|
|
10
|
+
maxTextLength?: number;
|
|
10
11
|
onChange?: (v: any) => void;
|
|
11
12
|
}
|
|
12
13
|
declare const AbilityFormItem: React.FC<AbilityFormItemProps>;
|
|
@@ -52,21 +52,22 @@ import { Button, RefreshIcon, TextField, Typography, useTextField } from 'fbm-ui
|
|
|
52
52
|
import { Box, Stack } from 'fbm-ui/lib/mui';
|
|
53
53
|
import { useCallback, useEffect, useState } from 'react';
|
|
54
54
|
var AbilityFormItem = function (_a) {
|
|
55
|
-
var token = _a.token, title = _a.title, name = _a.name, type = _a.type, _b = _a.
|
|
56
|
-
var
|
|
57
|
-
var
|
|
58
|
-
var
|
|
55
|
+
var token = _a.token, title = _a.title, name = _a.name, type = _a.type, _b = _a.items, items = _b === void 0 ? [] : _b, _c = _a.mode, mode = _c === void 0 ? 'show' : _c, _d = _a.canReplace, canReplace = _d === void 0 ? false : _d, _e = _a.maxTextLength, maxTextLength = _e === void 0 ? 100 : _e, onChange = _a.onChange;
|
|
56
|
+
var _f = useState(items.length ? items.join('\n') : ''), content = _f[0], setContent = _f[1];
|
|
57
|
+
var _g = useState(mode), internalMode = _g[0], setMode = _g[1];
|
|
58
|
+
var _h = useRequest(GetAiDefine, {
|
|
59
59
|
manual: true,
|
|
60
60
|
onSuccess: function (_a) {
|
|
61
61
|
var data = _a.data;
|
|
62
62
|
var _b = data.list, list = _b === void 0 ? [] : _b;
|
|
63
|
-
var defineRes = list[0].items
|
|
64
|
-
setContent(defineRes);
|
|
63
|
+
var defineRes = list[0].items;
|
|
64
|
+
setContent(defineRes.length ? defineRes.join('\n') : '');
|
|
65
|
+
nameTextField.setError();
|
|
65
66
|
},
|
|
66
67
|
onError: function (err) {
|
|
67
68
|
console.log(err);
|
|
68
69
|
},
|
|
69
|
-
}), PostAiDefine =
|
|
70
|
+
}), PostAiDefine = _h.run, loading = _h.loading;
|
|
70
71
|
var handleChange = useCallback(function (e) {
|
|
71
72
|
var value = e.target.value;
|
|
72
73
|
setContent(value);
|
|
@@ -88,11 +89,11 @@ var AbilityFormItem = function (_a) {
|
|
|
88
89
|
rules: [
|
|
89
90
|
{
|
|
90
91
|
required: true,
|
|
91
|
-
message: "
|
|
92
|
+
message: "".concat(title, "\u4E0D\u80FD\u4E3A\u7A7A"),
|
|
92
93
|
},
|
|
93
94
|
],
|
|
94
95
|
onChange: handleChange,
|
|
95
|
-
max:
|
|
96
|
+
max: maxTextLength,
|
|
96
97
|
rows: 3,
|
|
97
98
|
multiline: true,
|
|
98
99
|
sx: {
|
|
@@ -103,10 +104,11 @@ var AbilityFormItem = function (_a) {
|
|
|
103
104
|
setMode(mode);
|
|
104
105
|
}, [mode]);
|
|
105
106
|
useEffect(function () {
|
|
107
|
+
var resItems = content.split('\n');
|
|
106
108
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
107
109
|
name: title,
|
|
108
110
|
type: type,
|
|
109
|
-
items: content ?
|
|
111
|
+
items: content ? resItems : [],
|
|
110
112
|
});
|
|
111
113
|
// nameTextField.handleValidate();
|
|
112
114
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -46,6 +46,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
49
|
+
import { InitialValues } from '../../const';
|
|
49
50
|
import AbilityFormItem from '../AbilityFormItem';
|
|
50
51
|
import { PostQuestionCollectionUpsert } from "../../../../services/ai-ability";
|
|
51
52
|
import { useRequest } from 'ahooks';
|
|
@@ -56,36 +57,7 @@ var AddAbility = function (props) {
|
|
|
56
57
|
var _c = useState(''), value = _c[0], setValue = _c[1];
|
|
57
58
|
var _d = useState(1), step = _d[0], setStep = _d[1];
|
|
58
59
|
var _e = useState(false), stepLoading = _e[0], setStepLoading = _e[1];
|
|
59
|
-
var
|
|
60
|
-
workPlaceItems: [
|
|
61
|
-
{
|
|
62
|
-
name: '能力定义',
|
|
63
|
-
type: 1,
|
|
64
|
-
answer: '',
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
name: '次表现-优秀表现',
|
|
68
|
-
type: 2,
|
|
69
|
-
answer: '',
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
name: '优次表现-较差表现',
|
|
73
|
-
type: 3,
|
|
74
|
-
answer: '',
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: '考察建议-面试题目',
|
|
78
|
-
type: 4,
|
|
79
|
-
answer: '',
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
name: '考察建议-评分关键点',
|
|
83
|
-
type: 5,
|
|
84
|
-
answer: '',
|
|
85
|
-
},
|
|
86
|
-
],
|
|
87
|
-
};
|
|
88
|
-
var _f = useState(initialValues.workPlaceItems), workPlaceItems = _f[0], setWorkPlaceItems = _f[1];
|
|
60
|
+
var _f = useState(InitialValues.workPlaceItems), workPlaceItems = _f[0], setWorkPlaceItems = _f[1];
|
|
89
61
|
var _g = useRequest(PostQuestionCollectionUpsert, {
|
|
90
62
|
manual: true,
|
|
91
63
|
onSuccess: function () {
|
|
@@ -101,7 +73,7 @@ var AddAbility = function (props) {
|
|
|
101
73
|
rules: [
|
|
102
74
|
{
|
|
103
75
|
required: true,
|
|
104
|
-
message: '
|
|
76
|
+
message: '能力名称不能为空',
|
|
105
77
|
},
|
|
106
78
|
],
|
|
107
79
|
onChange: function (e) { return setValue(e.target.value); },
|
|
@@ -173,6 +145,6 @@ var AddAbility = function (props) {
|
|
|
173
145
|
}
|
|
174
146
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
175
147
|
}, [open]);
|
|
176
|
-
return (_jsx(Drawer, __assign({ className: "abilityDrawer", title: '新增能力', open: open, footer: footer, onClose: onClose }, { children: step === 1 ? (_jsxs(Box, __assign({ style: { width: '556px' } }, { 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))] }))) : (_jsxs(Box, __assign({ style: { width: '556px' } }, { children: [_jsx(Typography, __assign({ variant: "body1", fontWeight: "medium", mb: 2 }, { children: "\u80FD\u529B\u6807\u51C6" })), _jsxs(Typography, __assign({ variant: "body2", color: "secondary", mb: 2 }, { children: ["\u6839\u636E\u60A8\u8F93\u5165\u7684\u80FD\u529B\u540D\u79F0\u300C", _jsx("span", __assign({ style: { color: '#4CAF50', fontWeight: '500' } }, { children: value })), "\u300D\uFF0C\u5E2E\u60A8\u81EA\u52A8\u751F\u6210\u5173\u4E8E\u8BE5\u80FD\u529B\u7684\u5B9A\u4E49\u5185\u5BB9\u3001\u4F18\u6B21\u8868\u73B0\u4EE5\u53CA\u8003\u5BDF\u5EFA\u8BAE\u5185\u5BB9\uFF0C\u786E\u5B9A\u540E\u5C06\u4F1A\u6309\u7167\u8BE5\u6807\u51C6\u751F\u6210AI\u62A5\u544A\u3002"] })),
|
|
148
|
+
return (_jsx(Drawer, __assign({ className: "abilityDrawer", title: '新增能力', open: open, footer: footer, onClose: onClose }, { children: step === 1 ? (_jsxs(Box, __assign({ style: { width: '556px' } }, { 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))] }))) : (_jsxs(Box, __assign({ style: { width: '556px' } }, { children: [_jsx(Typography, __assign({ variant: "body1", fontWeight: "medium", mb: 2 }, { children: "\u80FD\u529B\u6807\u51C6" })), _jsxs(Typography, __assign({ variant: "body2", color: "secondary", mb: 2 }, { children: ["\u6839\u636E\u60A8\u8F93\u5165\u7684\u80FD\u529B\u540D\u79F0\u300C", _jsx("span", __assign({ style: { color: '#4CAF50', fontWeight: '500' } }, { children: value })), "\u300D\uFF0C\u5E2E\u60A8\u81EA\u52A8\u751F\u6210\u5173\u4E8E\u8BE5\u80FD\u529B\u7684\u5B9A\u4E49\u5185\u5BB9\u3001\u4F18\u6B21\u8868\u73B0\u4EE5\u53CA\u8003\u5BDF\u5EFA\u8BAE\u5185\u5BB9\uFF0C\u786E\u5B9A\u540E\u5C06\u4F1A\u6309\u7167\u8BE5\u6807\u51C6\u751F\u6210AI\u62A5\u544A\u3002"] })), InitialValues.workPlaceItems.map(function (v) { return (_jsx(AbilityFormItem, { name: value, title: v.name, type: v.type, items: v.items, mode: "edit", maxTextLength: v.type === 4 || v.type === 5 ? 300 : 100, canReplace: true, onChange: handleValue }, v.type)); })] }))) })));
|
|
177
149
|
};
|
|
178
150
|
export default AddAbility;
|
|
@@ -46,45 +46,12 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
49
|
+
import { InitialValues } from '../../const';
|
|
49
50
|
import AbilityFormItem from '../AbilityFormItem';
|
|
50
51
|
import { GetAbilityDetail, PostQuestionCollectionUpsert } from "../../../../services/ai-ability";
|
|
51
52
|
import { useRequest } from 'ahooks';
|
|
52
53
|
import { Box, Button, Divider, Drawer, Message, TextField, Typography, useTextField } from 'fbm-ui';
|
|
53
54
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
54
|
-
var initialValues = {
|
|
55
|
-
workPlaceItems: [
|
|
56
|
-
{
|
|
57
|
-
name: '能力定义',
|
|
58
|
-
type: 1,
|
|
59
|
-
answer: '',
|
|
60
|
-
items: [],
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
name: '次表现-优秀表现',
|
|
64
|
-
type: 2,
|
|
65
|
-
answer: '',
|
|
66
|
-
items: [],
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
name: '优次表现-较差表现',
|
|
70
|
-
type: 3,
|
|
71
|
-
answer: '',
|
|
72
|
-
items: [],
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
name: '考察建议-面试题目',
|
|
76
|
-
type: 4,
|
|
77
|
-
answer: '',
|
|
78
|
-
items: [],
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
name: '考察建议-评分关键点',
|
|
82
|
-
type: 5,
|
|
83
|
-
answer: '',
|
|
84
|
-
items: [],
|
|
85
|
-
},
|
|
86
|
-
],
|
|
87
|
-
};
|
|
88
55
|
var UpdateAbility = function (props) {
|
|
89
56
|
var open = props.open, _a = props.type, type = _a === void 0 ? 1 : _a, isWorkplace = props.isWorkplace, _b = props.name, name = _b === void 0 ? '' : _b, token = props.token, onClose = props.onClose, onSuccess = props.onSuccess;
|
|
90
57
|
var _c = useState(''), value = _c[0], setValue = _c[1];
|
|
@@ -93,7 +60,7 @@ var UpdateAbility = function (props) {
|
|
|
93
60
|
var firstLoad = useRef(true);
|
|
94
61
|
var _f = useState(false), showAiDefineDetail = _f[0], setShowAiDefineDetail = _f[1];
|
|
95
62
|
// const [submitDisabled, setSubmitDisabled] = useState<boolean>(true);
|
|
96
|
-
var _g = useState(
|
|
63
|
+
var _g = useState(InitialValues.workPlaceItems), workPlaceItems = _g[0], setWorkPlaceItems = _g[1];
|
|
97
64
|
var _h = useRequest(PostQuestionCollectionUpsert, {
|
|
98
65
|
manual: true,
|
|
99
66
|
onSuccess: function () {
|
|
@@ -105,12 +72,10 @@ var UpdateAbility = function (props) {
|
|
|
105
72
|
var getAbilityDetail = useRequest(GetAbilityDetail, {
|
|
106
73
|
manual: true,
|
|
107
74
|
onSuccess: function (_a) {
|
|
108
|
-
var _b
|
|
75
|
+
var _b;
|
|
109
76
|
var list = _a.data.list;
|
|
110
77
|
if (list.length) {
|
|
111
|
-
var res = (
|
|
112
|
-
return __assign(__assign({}, element), { answer: element.items[0] || '' });
|
|
113
|
-
});
|
|
78
|
+
var res = (_b = list[0]) === null || _b === void 0 ? void 0 : _b.workPlaceItems;
|
|
114
79
|
firstLoad.current = false;
|
|
115
80
|
if (res === null || res === void 0 ? void 0 : res.length) {
|
|
116
81
|
setWorkPlaceItems(res);
|
|
@@ -126,7 +91,7 @@ var UpdateAbility = function (props) {
|
|
|
126
91
|
rules: [
|
|
127
92
|
{
|
|
128
93
|
required: true,
|
|
129
|
-
message: '
|
|
94
|
+
message: '能力名称不能为空',
|
|
130
95
|
},
|
|
131
96
|
],
|
|
132
97
|
onChange: function (e) { return setValue(e.target.value); },
|
|
@@ -214,6 +179,6 @@ var UpdateAbility = function (props) {
|
|
|
214
179
|
setWorkPlaceItems(workPlaceItems);
|
|
215
180
|
}, [workPlaceItems, setWorkPlaceItems]);
|
|
216
181
|
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 &&
|
|
217
|
-
workPlaceItems.map(function (v) { return (_jsx(AbilityFormItem, { token: token, name: value, title: v.name, type: v.type,
|
|
182
|
+
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)); })] })))] })));
|
|
218
183
|
};
|
|
219
184
|
export default UpdateAbility;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export var InitialValues = {
|
|
2
|
+
workPlaceItems: [
|
|
3
|
+
{
|
|
4
|
+
name: '能力定义',
|
|
5
|
+
type: 1,
|
|
6
|
+
items: [],
|
|
7
|
+
maxTextLength: 100,
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
name: '优次表现-优秀表现',
|
|
11
|
+
type: 2,
|
|
12
|
+
items: [],
|
|
13
|
+
maxTextLength: 100,
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: '优次表现-较差表现',
|
|
17
|
+
type: 3,
|
|
18
|
+
items: [],
|
|
19
|
+
maxTextLength: 100,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: '考察建议-面试题目',
|
|
23
|
+
type: 4,
|
|
24
|
+
items: [],
|
|
25
|
+
maxTextLength: 300,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: '考察建议-评分关键点',
|
|
29
|
+
type: 5,
|
|
30
|
+
items: [],
|
|
31
|
+
maxTextLength: 300,
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
};
|
|
@@ -7,6 +7,7 @@ export interface QuestionCollectionList {
|
|
|
7
7
|
updatedAt: number;
|
|
8
8
|
used: boolean;
|
|
9
9
|
isWorkplace: boolean;
|
|
10
|
+
define?: string;
|
|
10
11
|
workPlaceItems?: AiDefineItem[];
|
|
11
12
|
}
|
|
12
13
|
export interface QuestionCollectionListData {
|
|
@@ -28,7 +29,6 @@ export interface AbilityProps {
|
|
|
28
29
|
export interface AiDefineItem {
|
|
29
30
|
name: string;
|
|
30
31
|
type: number;
|
|
31
|
-
answer?: string;
|
|
32
32
|
items: string[];
|
|
33
33
|
}
|
|
34
34
|
export interface AiDefineData {
|
|
@@ -24,7 +24,7 @@ var AnalysisItem = function (props) {
|
|
|
24
24
|
var desc = props.desc || props.name;
|
|
25
25
|
var NotUsedAilibity = ['英文能力', '游戏测评'];
|
|
26
26
|
if (abilityType === 2 && !isWorkplace) {
|
|
27
|
-
desc = "".concat(NotUsedAilibity.includes(name) ? name : '
|
|
27
|
+
desc = "".concat(NotUsedAilibity.includes(name) ? name : '该能力', "\u4E0D\u80FD\u53C2\u4E0EAI\u5206\u6790");
|
|
28
28
|
}
|
|
29
29
|
var handleRemove = useCallback(function () {
|
|
30
30
|
removeAiAbilities(index);
|
|
@@ -39,6 +39,6 @@ var AnalysisItem = function (props) {
|
|
|
39
39
|
var value = _a.target.value;
|
|
40
40
|
updateAiAbilitiesWeight(value, index);
|
|
41
41
|
}, [updateAiAbilitiesWeight, index]);
|
|
42
|
-
return (_jsxs(Box, { children: [_jsxs(ListItem, __assign({ sx: { pl: 0, pr: 4 }, secondaryAction: _jsx(IconButton, __assign({ sx: { position: 'relative', left: 16 }, onClick: handleRemove }, { children: _jsx(CloseIcon, {}) })) }, { children: [_jsx(ListItemText, { children: _jsxs(Box, __assign({ display: "flex", alignItems: "center" }, { children: [_jsx(Typography, __assign({ variant: "subtitle2" }, { children: name })), abilityType === 2 && !isWorkplace ? (_jsx(Typography, __assign({ variant: "body2", style: { color: 'RGBA(0, 0, 0, 0.26)', fontSize: 12 }, ml: 1 }, { children: desc }))) : (_jsxs(_Fragment, { children: [abilityType === 2 && isWorkplace && _jsx(Chip, { color: 'primary', label: '自定义', size: "small", sx: { ml: 1 } }), _jsx(Tooltip, __assign({ title: "".concat(desc) }, { children: _jsx(Box, __assign({ display: "flex", alignItems: "center", sx: { ml: 1 } }, { children: _jsx(InfoIcon, { sx: { color: 'rgba(0, 0, 0, 0.26)', fontSize: 16 } }) })) }))] })), type === 8 && (_jsx(Select, { sx: { width: 150, ml: 1 }, options: willOrNotOptions, value: (_a = JSON.parse(extra)) === null || _a === void 0 ? void 0 : _a.expect, size: "small", onChange: handleWillOrNotChange }))] })) }), (abilityType === 1 || (abilityType === 2 && isWorkplace)) && (_jsx(Input, { sx: { width: 84, mr: 1 }, value: weight, disabled: index === aiAbilities.length - 1, size: "small", endAdornment: "%", onChange: handleWeightChange }))] })), type === 6 && _jsx(MainPoints, { extra: extra, index: index })] }));
|
|
42
|
+
return (_jsxs(Box, { children: [_jsxs(ListItem, __assign({ sx: { pl: 0, pr: 4 }, secondaryAction: _jsx(IconButton, __assign({ sx: { position: 'relative', left: 16 }, onClick: handleRemove }, { children: _jsx(CloseIcon, {}) })) }, { children: [_jsx(ListItemText, { children: _jsxs(Box, __assign({ display: "flex", alignItems: "center" }, { children: [_jsx(Typography, __assign({ variant: "subtitle2" }, { children: name })), abilityType === 2 && !isWorkplace ? (_jsx(Typography, __assign({ variant: "body2", style: { color: 'RGBA(0, 0, 0, 0.26)', fontSize: 12 }, ml: 1 }, { children: desc }))) : (_jsxs(_Fragment, { children: [abilityType === 2 && isWorkplace && type === 3 && _jsx(Chip, { color: 'primary', label: '自定义', size: "small", sx: { ml: 1 } }), _jsx(Tooltip, __assign({ title: "".concat(desc), placement: "right" }, { children: _jsx(Box, __assign({ display: "flex", alignItems: "center", sx: { ml: 1 } }, { children: _jsx(InfoIcon, { sx: { color: 'rgba(0, 0, 0, 0.26)', fontSize: 16 } }) })) }))] })), type === 8 && (_jsx(Select, { sx: { width: 150, ml: 1 }, options: willOrNotOptions, value: (_a = JSON.parse(extra)) === null || _a === void 0 ? void 0 : _a.expect, size: "small", onChange: handleWillOrNotChange }))] })) }), (abilityType === 1 || (abilityType === 2 && isWorkplace)) && (_jsx(Input, { sx: { width: 84, mr: 1 }, value: weight, disabled: index === aiAbilities.length - 1, size: "small", endAdornment: "%", onChange: handleWeightChange }))] })), type === 6 && _jsx(MainPoints, { extra: extra, index: index })] }));
|
|
43
43
|
};
|
|
44
44
|
export default AnalysisItem;
|
|
@@ -91,12 +91,14 @@ var QuestionForm = forwardRef(function (props, ref) {
|
|
|
91
91
|
onValuesChange === null || onValuesChange === void 0 ? void 0 : onValuesChange(form.values);
|
|
92
92
|
}, [form.values, onValuesChange]);
|
|
93
93
|
return (_jsxs(_Fragment, { children: [_jsxs(Form, __assign({}, form, { children: [_jsx(FormItem, { required: true, disabled: preview, name: "name", label: "\u6807\u9898", placeholder: "\u6807\u9898\uFF08\u7528\u4E8E\u7CFB\u7EDF\u7BA1\u7406\uFF09", max: 15 }), _jsxs(Box, __assign({ display: "flex" }, { children: [!preview && aiShowType === ADD_QUESTION_TYPE.FREE && (_jsx(FormItem, __assign({ sx: { flex: '1 0', mr: 1 }, required: true, disabled: preview, name: "broadcastType", label: "\u64AD\u62A5\u65B9\u5F0F" }, { children: _jsx(Select, { placeholder: "\u64AD\u62A5\u65B9\u5F0F", options: broadcastModeOptions }) }))), !preview && (_jsx(FormItem, __assign({ style: { flex: '1 0' }, disabled: preview, name: "category", label: "\u8003\u5BDF\u80FD\u529B" }, { children: _jsx(Autocomplete, { placeholder: "\u8003\u5BDF\u80FD\u529B", options: questionCollectionList.map(function (_a) {
|
|
94
|
-
var tag = _a.tag, token = _a.token, isWorkplace = _a.isWorkplace;
|
|
94
|
+
var tag = _a.tag, token = _a.token, isWorkplace = _a.isWorkplace, define = _a.define, type = _a.type;
|
|
95
95
|
return ({
|
|
96
96
|
label: tag,
|
|
97
97
|
value: tag,
|
|
98
98
|
name: tag,
|
|
99
|
+
type: type,
|
|
99
100
|
token: token,
|
|
101
|
+
define: define,
|
|
100
102
|
isWorkplace: isWorkplace,
|
|
101
103
|
});
|
|
102
104
|
}), onChange: handleCategoryChange }) })))] })), form.values.broadcastType === 1 || preview ? (_jsx(FormItem, { required: true, disabled: preview, name: "desc", 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" })) : (_jsx(VideoVoice, {})), aiShowType === ADD_QUESTION_TYPE.LANGUAGE && (_jsx(FormItem, { sx: { height: 'auto', mb: 2 }, required: true, name: "readText", label: "\u6717\u8BFB\u5185\u5BB9", max: 240, InputProps: {
|
|
@@ -102,7 +102,7 @@ var QuestionUpdate = function () {
|
|
|
102
102
|
(_a = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _a === void 0 ? void 0 : _a.setFormValues({ broadcastType: defaultQuestionParams.broadcastType });
|
|
103
103
|
updateQuestionState({ aiShowType: ADD_QUESTION_TYPE.LANGUAGE });
|
|
104
104
|
} }, { children: _jsx(Typography, __assign({ variant: "body2" }, { children: "\u8DDF\u8BFB\u80FD\u529B" })) }))] }));
|
|
105
|
-
return (_jsxs(Box, __assign({ display: "flex", alignItems: "center", height: 56 }, { children: [_jsx(Typography, __assign({ variant: "subtitle1" }, { children: aiShowType === ADD_QUESTION_TYPE.FREE ? '自由作答' : '跟读能力' })), _jsx(Popover, __assign({ open: switchTypeOpen, content: content, onClickAway: function () { return setSwitchTypeOpen(false); } }, { children: _jsx(Button, __assign({ variant: "text", size: "small", sx: { fontSize: 12, color: 'rgb(87, 107, 149)' }, onClick: function () { return setSwitchTypeOpen(true); } }, { children: "\u5207\u6362\u9898\u578B" })) }))] })));
|
|
105
|
+
return (_jsxs(Box, __assign({ display: "flex", alignItems: "center", height: 56 }, { children: [_jsx(Typography, __assign({ ml: 3, variant: "subtitle1" }, { children: aiShowType === ADD_QUESTION_TYPE.FREE ? '自由作答' : '跟读能力' })), _jsx(Popover, __assign({ open: switchTypeOpen, content: content, onClickAway: function () { return setSwitchTypeOpen(false); } }, { children: _jsx(Button, __assign({ variant: "text", size: "small", sx: { fontSize: 12, color: 'rgb(87, 107, 149)' }, onClick: function () { return setSwitchTypeOpen(true); } }, { children: "\u5207\u6362\u9898\u578B" })) }))] })));
|
|
106
106
|
};
|
|
107
107
|
var getModelParams = useCallback(function (values, isSubmit) {
|
|
108
108
|
return new Promise(function (resolve, reject) {
|
|
@@ -210,7 +210,7 @@ var QuestionUpdate = function () {
|
|
|
210
210
|
var CurWorkplace = questionCollectionList.find(function (v) { return v.name === curSelectWorkPlace.label; }) || {};
|
|
211
211
|
var CurWorkPlaceAiAbility = __assign(__assign(__assign({}, curSelectWorkPlace), CurWorkplace), { abilityType: 2, weight: 0, sort: 0 });
|
|
212
212
|
inInit = workplaceTypeIndex === -1;
|
|
213
|
-
CurWorkPlaceAiAbility.desc = CurWorkPlaceAiAbility.name;
|
|
213
|
+
CurWorkPlaceAiAbility.desc = CurWorkPlaceAiAbility.define ? CurWorkPlaceAiAbility.define : CurWorkPlaceAiAbility.name;
|
|
214
214
|
// console.log('CurWorkPlaceAiAbility', CurWorkPlaceAiAbility);
|
|
215
215
|
// 添加和修改
|
|
216
216
|
if (workplaceTypeIndex > -1) {
|
|
@@ -13,6 +13,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
import { Box, CloseIcon, IconButton, KeyboardArrowLeftIcon, Typography } from 'fbm-ui';
|
|
14
14
|
var TemplateHeader = function (_a) {
|
|
15
15
|
var name = _a.name, onClose = _a.onClose, onSearch = _a.onSearch, onBack = _a.onBack;
|
|
16
|
-
return name ? (_jsxs(Box, __assign({ display: "flex", alignItems: "center", justifyContent: "space-between", pt: 1, pb: 1.5, mb: 1 }, { children: [_jsxs(Box, __assign({ display: "flex", alignItems: "center", right: 16 }, { children: [_jsx(IconButton, __assign({ onClick: onBack }, { children: _jsx(KeyboardArrowLeftIcon, {}) })), _jsx(Typography, __assign({ variant: "body1", weight: "500", ml: 1 }, { children: name }))] })), _jsx(IconButton, __assign({ onClick: onClose }, { children: _jsx(CloseIcon, {}) }))] }))) : (_jsxs(Box, __assign({ display: "flex", alignItems: "center", justifyContent: "space-between", pt: 1, pb: 1.5, mb: 1 }, { children: [_jsxs(Typography, __assign({ variant: "body1", weight: "500" }, { children: ["\u5C97\u4F4D\u6A21\u7248\u5E93", _jsx(Typography, __assign({ variant: "caption", color: "secondary" }, { children: "\uFF08\u6A21\u7248\u5E93\u53EF\u591A\u6B21\u4F7F\u7528\uFF09" }))] })), _jsx(IconButton, __assign({ onClick: onClose }, { children: _jsx(CloseIcon, {}) }))] })));
|
|
16
|
+
return name ? (_jsxs(Box, __assign({ display: "flex", alignItems: "center", justifyContent: "space-between", pt: 1, pb: 1.5, mb: 1 }, { children: [_jsxs(Box, __assign({ display: "flex", alignItems: "center", right: 16 }, { children: [_jsx(IconButton, __assign({ onClick: onBack }, { children: _jsx(KeyboardArrowLeftIcon, {}) })), _jsx(Typography, __assign({ variant: "body1", weight: "500", ml: 1 }, { children: name }))] })), _jsx(IconButton, __assign({ onClick: onClose }, { children: _jsx(CloseIcon, {}) }))] }))) : (_jsxs(Box, __assign({ display: "flex", alignItems: "center", justifyContent: "space-between", pt: 1, pb: 1.5, mb: 1 }, { children: [_jsxs(Typography, __assign({ variant: "body1", weight: "500", ml: 3 }, { children: ["\u5C97\u4F4D\u6A21\u7248\u5E93", _jsx(Typography, __assign({ variant: "caption", color: "secondary" }, { children: "\uFF08\u6A21\u7248\u5E93\u53EF\u591A\u6B21\u4F7F\u7528\uFF09" }))] })), _jsx(IconButton, __assign({ onClick: onClose }, { children: _jsx(CloseIcon, {}) }))] })));
|
|
17
17
|
};
|
|
18
18
|
export default TemplateHeader;
|
|
@@ -143,7 +143,7 @@ var AiAbilityRoot = function () {
|
|
|
143
143
|
label: '操作',
|
|
144
144
|
render: function (_a) {
|
|
145
145
|
var row = _a.row;
|
|
146
|
-
return row.type === 1 ? ((0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: "\u80FD\u529B\u8BE6\u60C5" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Link, { sx: { color: 'rgba(0, 0, 0, 0.56)', mr: 3, cursor: 'pointer' }, text: (0, jsx_runtime_1.jsx)(fbm_ui_1.DocumentIcon, {}), onClick: function () { return handleEdit(row); } }) }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: "\u80FD\u529B\u8BE6\u60C5" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Link, { sx: { color: 'rgba(0, 0, 0, 0.56)', mr: 3, cursor: 'pointer' }, text: (0, jsx_runtime_1.jsx)(fbm_ui_1.DocumentIcon, {}), onClick: function () { return handleEdit(row); } }) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Link, { sx: { color: 'rgba(0, 0, 0, 0.56)', cursor: 'pointer' }, text: (0, jsx_runtime_1.jsx)(fbm_ui_1.DeleteIcon, {}), onClick: function () { return handleDelete(row); } })] }));
|
|
146
|
+
return row.type === 1 ? ((0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: "\u80FD\u529B\u8BE6\u60C5" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Link, { sx: { color: 'rgba(0, 0, 0, 0.56)', mr: 3, cursor: 'pointer' }, text: (0, jsx_runtime_1.jsx)(fbm_ui_1.DocumentIcon, {}), onClick: function () { return handleEdit(row); } }) }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: "\u80FD\u529B\u8BE6\u60C5" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Link, { sx: { color: 'rgba(0, 0, 0, 0.56)', mr: 3, cursor: 'pointer' }, text: (0, jsx_runtime_1.jsx)(fbm_ui_1.DocumentIcon, {}), onClick: function () { return handleEdit(row); } }) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: "\u5220\u9664" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Link, { sx: { color: 'rgba(0, 0, 0, 0.56)', cursor: 'pointer' }, text: (0, jsx_runtime_1.jsx)(fbm_ui_1.DeleteIcon, {}), onClick: function () { return handleDelete(row); } }) }))] }));
|
|
147
147
|
},
|
|
148
148
|
},
|
|
149
149
|
];
|
|
@@ -4,9 +4,10 @@ interface AbilityFormItemProps {
|
|
|
4
4
|
title: string;
|
|
5
5
|
name: string;
|
|
6
6
|
type: number;
|
|
7
|
-
|
|
7
|
+
items?: string[];
|
|
8
8
|
mode: string;
|
|
9
9
|
canReplace?: boolean;
|
|
10
|
+
maxTextLength?: number;
|
|
10
11
|
onChange?: (v: any) => void;
|
|
11
12
|
}
|
|
12
13
|
declare const AbilityFormItem: React.FC<AbilityFormItemProps>;
|
|
@@ -54,21 +54,22 @@ var fbm_ui_1 = require("fbm-ui");
|
|
|
54
54
|
var mui_1 = require("fbm-ui/lib/mui");
|
|
55
55
|
var react_1 = require("react");
|
|
56
56
|
var AbilityFormItem = function (_a) {
|
|
57
|
-
var token = _a.token, title = _a.title, name = _a.name, type = _a.type, _b = _a.
|
|
58
|
-
var
|
|
59
|
-
var
|
|
60
|
-
var
|
|
57
|
+
var token = _a.token, title = _a.title, name = _a.name, type = _a.type, _b = _a.items, items = _b === void 0 ? [] : _b, _c = _a.mode, mode = _c === void 0 ? 'show' : _c, _d = _a.canReplace, canReplace = _d === void 0 ? false : _d, _e = _a.maxTextLength, maxTextLength = _e === void 0 ? 100 : _e, onChange = _a.onChange;
|
|
58
|
+
var _f = (0, react_1.useState)(items.length ? items.join('\n') : ''), content = _f[0], setContent = _f[1];
|
|
59
|
+
var _g = (0, react_1.useState)(mode), internalMode = _g[0], setMode = _g[1];
|
|
60
|
+
var _h = (0, ahooks_1.useRequest)(ai_ability_1.GetAiDefine, {
|
|
61
61
|
manual: true,
|
|
62
62
|
onSuccess: function (_a) {
|
|
63
63
|
var data = _a.data;
|
|
64
64
|
var _b = data.list, list = _b === void 0 ? [] : _b;
|
|
65
|
-
var defineRes = list[0].items
|
|
66
|
-
setContent(defineRes);
|
|
65
|
+
var defineRes = list[0].items;
|
|
66
|
+
setContent(defineRes.length ? defineRes.join('\n') : '');
|
|
67
|
+
nameTextField.setError();
|
|
67
68
|
},
|
|
68
69
|
onError: function (err) {
|
|
69
70
|
console.log(err);
|
|
70
71
|
},
|
|
71
|
-
}), PostAiDefine =
|
|
72
|
+
}), PostAiDefine = _h.run, loading = _h.loading;
|
|
72
73
|
var handleChange = (0, react_1.useCallback)(function (e) {
|
|
73
74
|
var value = e.target.value;
|
|
74
75
|
setContent(value);
|
|
@@ -90,11 +91,11 @@ var AbilityFormItem = function (_a) {
|
|
|
90
91
|
rules: [
|
|
91
92
|
{
|
|
92
93
|
required: true,
|
|
93
|
-
message: "
|
|
94
|
+
message: "".concat(title, "\u4E0D\u80FD\u4E3A\u7A7A"),
|
|
94
95
|
},
|
|
95
96
|
],
|
|
96
97
|
onChange: handleChange,
|
|
97
|
-
max:
|
|
98
|
+
max: maxTextLength,
|
|
98
99
|
rows: 3,
|
|
99
100
|
multiline: true,
|
|
100
101
|
sx: {
|
|
@@ -105,10 +106,11 @@ var AbilityFormItem = function (_a) {
|
|
|
105
106
|
setMode(mode);
|
|
106
107
|
}, [mode]);
|
|
107
108
|
(0, react_1.useEffect)(function () {
|
|
109
|
+
var resItems = content.split('\n');
|
|
108
110
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
109
111
|
name: title,
|
|
110
112
|
type: type,
|
|
111
|
-
items: content ?
|
|
113
|
+
items: content ? resItems : [],
|
|
112
114
|
});
|
|
113
115
|
// nameTextField.handleValidate();
|
|
114
116
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -51,6 +51,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
51
51
|
};
|
|
52
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
53
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
54
|
+
var const_1 = require("../../const");
|
|
54
55
|
var AbilityFormItem_1 = __importDefault(require("../AbilityFormItem"));
|
|
55
56
|
var ai_ability_1 = require("../../../../services/ai-ability");
|
|
56
57
|
var ahooks_1 = require("ahooks");
|
|
@@ -61,36 +62,7 @@ var AddAbility = function (props) {
|
|
|
61
62
|
var _c = (0, react_1.useState)(''), value = _c[0], setValue = _c[1];
|
|
62
63
|
var _d = (0, react_1.useState)(1), step = _d[0], setStep = _d[1];
|
|
63
64
|
var _e = (0, react_1.useState)(false), stepLoading = _e[0], setStepLoading = _e[1];
|
|
64
|
-
var
|
|
65
|
-
workPlaceItems: [
|
|
66
|
-
{
|
|
67
|
-
name: '能力定义',
|
|
68
|
-
type: 1,
|
|
69
|
-
answer: '',
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
name: '次表现-优秀表现',
|
|
73
|
-
type: 2,
|
|
74
|
-
answer: '',
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: '优次表现-较差表现',
|
|
78
|
-
type: 3,
|
|
79
|
-
answer: '',
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
name: '考察建议-面试题目',
|
|
83
|
-
type: 4,
|
|
84
|
-
answer: '',
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
name: '考察建议-评分关键点',
|
|
88
|
-
type: 5,
|
|
89
|
-
answer: '',
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
};
|
|
93
|
-
var _f = (0, react_1.useState)(initialValues.workPlaceItems), workPlaceItems = _f[0], setWorkPlaceItems = _f[1];
|
|
65
|
+
var _f = (0, react_1.useState)(const_1.InitialValues.workPlaceItems), workPlaceItems = _f[0], setWorkPlaceItems = _f[1];
|
|
94
66
|
var _g = (0, ahooks_1.useRequest)(ai_ability_1.PostQuestionCollectionUpsert, {
|
|
95
67
|
manual: true,
|
|
96
68
|
onSuccess: function () {
|
|
@@ -106,7 +78,7 @@ var AddAbility = function (props) {
|
|
|
106
78
|
rules: [
|
|
107
79
|
{
|
|
108
80
|
required: true,
|
|
109
|
-
message: '
|
|
81
|
+
message: '能力名称不能为空',
|
|
110
82
|
},
|
|
111
83
|
],
|
|
112
84
|
onChange: function (e) { return setValue(e.target.value); },
|
|
@@ -178,6 +150,6 @@ var AddAbility = function (props) {
|
|
|
178
150
|
}
|
|
179
151
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
180
152
|
}, [open]);
|
|
181
|
-
return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Drawer, __assign({ className: "abilityDrawer", title: '新增能力', open: open, footer: footer, onClose: onClose }, { children: step === 1 ? ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ style: { width: '556px' } }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.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" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.TextField, __assign({}, nameTextField))] }))) : ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ style: { width: '556px' } }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body1", fontWeight: "medium", mb: 2 }, { children: "\u80FD\u529B\u6807\u51C6" })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "secondary", mb: 2 }, { children: ["\u6839\u636E\u60A8\u8F93\u5165\u7684\u80FD\u529B\u540D\u79F0\u300C", (0, jsx_runtime_1.jsx)("span", __assign({ style: { color: '#4CAF50', fontWeight: '500' } }, { children: value })), "\u300D\uFF0C\u5E2E\u60A8\u81EA\u52A8\u751F\u6210\u5173\u4E8E\u8BE5\u80FD\u529B\u7684\u5B9A\u4E49\u5185\u5BB9\u3001\u4F18\u6B21\u8868\u73B0\u4EE5\u53CA\u8003\u5BDF\u5EFA\u8BAE\u5185\u5BB9\uFF0C\u786E\u5B9A\u540E\u5C06\u4F1A\u6309\u7167\u8BE5\u6807\u51C6\u751F\u6210AI\u62A5\u544A\u3002"] })),
|
|
153
|
+
return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Drawer, __assign({ className: "abilityDrawer", title: '新增能力', open: open, footer: footer, onClose: onClose }, { children: step === 1 ? ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ style: { width: '556px' } }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.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" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.TextField, __assign({}, nameTextField))] }))) : ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ style: { width: '556px' } }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body1", fontWeight: "medium", mb: 2 }, { children: "\u80FD\u529B\u6807\u51C6" })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "secondary", mb: 2 }, { children: ["\u6839\u636E\u60A8\u8F93\u5165\u7684\u80FD\u529B\u540D\u79F0\u300C", (0, jsx_runtime_1.jsx)("span", __assign({ style: { color: '#4CAF50', fontWeight: '500' } }, { children: value })), "\u300D\uFF0C\u5E2E\u60A8\u81EA\u52A8\u751F\u6210\u5173\u4E8E\u8BE5\u80FD\u529B\u7684\u5B9A\u4E49\u5185\u5BB9\u3001\u4F18\u6B21\u8868\u73B0\u4EE5\u53CA\u8003\u5BDF\u5EFA\u8BAE\u5185\u5BB9\uFF0C\u786E\u5B9A\u540E\u5C06\u4F1A\u6309\u7167\u8BE5\u6807\u51C6\u751F\u6210AI\u62A5\u544A\u3002"] })), const_1.InitialValues.workPlaceItems.map(function (v) { return ((0, jsx_runtime_1.jsx)(AbilityFormItem_1.default, { name: value, title: v.name, type: v.type, items: v.items, mode: "edit", maxTextLength: v.type === 4 || v.type === 5 ? 300 : 100, canReplace: true, onChange: handleValue }, v.type)); })] }))) })));
|
|
182
154
|
};
|
|
183
155
|
exports.default = AddAbility;
|
|
@@ -51,45 +51,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
51
51
|
};
|
|
52
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
53
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
54
|
+
var const_1 = require("../../const");
|
|
54
55
|
var AbilityFormItem_1 = __importDefault(require("../AbilityFormItem"));
|
|
55
56
|
var ai_ability_1 = require("../../../../services/ai-ability");
|
|
56
57
|
var ahooks_1 = require("ahooks");
|
|
57
58
|
var fbm_ui_1 = require("fbm-ui");
|
|
58
59
|
var react_1 = require("react");
|
|
59
|
-
var initialValues = {
|
|
60
|
-
workPlaceItems: [
|
|
61
|
-
{
|
|
62
|
-
name: '能力定义',
|
|
63
|
-
type: 1,
|
|
64
|
-
answer: '',
|
|
65
|
-
items: [],
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
name: '次表现-优秀表现',
|
|
69
|
-
type: 2,
|
|
70
|
-
answer: '',
|
|
71
|
-
items: [],
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
name: '优次表现-较差表现',
|
|
75
|
-
type: 3,
|
|
76
|
-
answer: '',
|
|
77
|
-
items: [],
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: '考察建议-面试题目',
|
|
81
|
-
type: 4,
|
|
82
|
-
answer: '',
|
|
83
|
-
items: [],
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
name: '考察建议-评分关键点',
|
|
87
|
-
type: 5,
|
|
88
|
-
answer: '',
|
|
89
|
-
items: [],
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
};
|
|
93
60
|
var UpdateAbility = function (props) {
|
|
94
61
|
var open = props.open, _a = props.type, type = _a === void 0 ? 1 : _a, isWorkplace = props.isWorkplace, _b = props.name, name = _b === void 0 ? '' : _b, token = props.token, onClose = props.onClose, onSuccess = props.onSuccess;
|
|
95
62
|
var _c = (0, react_1.useState)(''), value = _c[0], setValue = _c[1];
|
|
@@ -98,7 +65,7 @@ var UpdateAbility = function (props) {
|
|
|
98
65
|
var firstLoad = (0, react_1.useRef)(true);
|
|
99
66
|
var _f = (0, react_1.useState)(false), showAiDefineDetail = _f[0], setShowAiDefineDetail = _f[1];
|
|
100
67
|
// const [submitDisabled, setSubmitDisabled] = useState<boolean>(true);
|
|
101
|
-
var _g = (0, react_1.useState)(
|
|
68
|
+
var _g = (0, react_1.useState)(const_1.InitialValues.workPlaceItems), workPlaceItems = _g[0], setWorkPlaceItems = _g[1];
|
|
102
69
|
var _h = (0, ahooks_1.useRequest)(ai_ability_1.PostQuestionCollectionUpsert, {
|
|
103
70
|
manual: true,
|
|
104
71
|
onSuccess: function () {
|
|
@@ -110,12 +77,10 @@ var UpdateAbility = function (props) {
|
|
|
110
77
|
var getAbilityDetail = (0, ahooks_1.useRequest)(ai_ability_1.GetAbilityDetail, {
|
|
111
78
|
manual: true,
|
|
112
79
|
onSuccess: function (_a) {
|
|
113
|
-
var _b
|
|
80
|
+
var _b;
|
|
114
81
|
var list = _a.data.list;
|
|
115
82
|
if (list.length) {
|
|
116
|
-
var res = (
|
|
117
|
-
return __assign(__assign({}, element), { answer: element.items[0] || '' });
|
|
118
|
-
});
|
|
83
|
+
var res = (_b = list[0]) === null || _b === void 0 ? void 0 : _b.workPlaceItems;
|
|
119
84
|
firstLoad.current = false;
|
|
120
85
|
if (res === null || res === void 0 ? void 0 : res.length) {
|
|
121
86
|
setWorkPlaceItems(res);
|
|
@@ -131,7 +96,7 @@ var UpdateAbility = function (props) {
|
|
|
131
96
|
rules: [
|
|
132
97
|
{
|
|
133
98
|
required: true,
|
|
134
|
-
message: '
|
|
99
|
+
message: '能力名称不能为空',
|
|
135
100
|
},
|
|
136
101
|
],
|
|
137
102
|
onChange: function (e) { return setValue(e.target.value); },
|
|
@@ -219,6 +184,6 @@ var UpdateAbility = function (props) {
|
|
|
219
184
|
setWorkPlaceItems(workPlaceItems);
|
|
220
185
|
}, [workPlaceItems, setWorkPlaceItems]);
|
|
221
186
|
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Drawer, __assign({ className: "abilityDrawer", title: '能力详情', open: open, footer: footer, onClose: onClose }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ style: { width: '556px' } }, { children: step === 1 ? ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body1", fontWeight: "medium" }, { children: ["\u80FD\u529B\u540D\u79F0\uFF1A", value] }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.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" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.TextField, __assign({}, nameTextField))] })) })), !(type === 3 && !isWorkplace) && ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ style: { width: '556px' } }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Divider, { style: { margin: '24px 0' } }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body1", fontWeight: "medium", mb: 2 }, { children: "\u80FD\u529B\u6807\u51C6" })), showAiDefineDetail &&
|
|
222
|
-
workPlaceItems.map(function (v) { return ((0, jsx_runtime_1.jsx)(AbilityFormItem_1.default, { token: token, name: value, title: v.name, type: v.type,
|
|
187
|
+
workPlaceItems.map(function (v) { return ((0, jsx_runtime_1.jsx)(AbilityFormItem_1.default, { 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)); })] })))] })));
|
|
223
188
|
};
|
|
224
189
|
exports.default = UpdateAbility;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InitialValues = void 0;
|
|
4
|
+
exports.InitialValues = {
|
|
5
|
+
workPlaceItems: [
|
|
6
|
+
{
|
|
7
|
+
name: '能力定义',
|
|
8
|
+
type: 1,
|
|
9
|
+
items: [],
|
|
10
|
+
maxTextLength: 100,
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: '优次表现-优秀表现',
|
|
14
|
+
type: 2,
|
|
15
|
+
items: [],
|
|
16
|
+
maxTextLength: 100,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: '优次表现-较差表现',
|
|
20
|
+
type: 3,
|
|
21
|
+
items: [],
|
|
22
|
+
maxTextLength: 100,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: '考察建议-面试题目',
|
|
26
|
+
type: 4,
|
|
27
|
+
items: [],
|
|
28
|
+
maxTextLength: 300,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: '考察建议-评分关键点',
|
|
32
|
+
type: 5,
|
|
33
|
+
items: [],
|
|
34
|
+
maxTextLength: 300,
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
};
|
|
@@ -7,6 +7,7 @@ export interface QuestionCollectionList {
|
|
|
7
7
|
updatedAt: number;
|
|
8
8
|
used: boolean;
|
|
9
9
|
isWorkplace: boolean;
|
|
10
|
+
define?: string;
|
|
10
11
|
workPlaceItems?: AiDefineItem[];
|
|
11
12
|
}
|
|
12
13
|
export interface QuestionCollectionListData {
|
|
@@ -28,7 +29,6 @@ export interface AbilityProps {
|
|
|
28
29
|
export interface AiDefineItem {
|
|
29
30
|
name: string;
|
|
30
31
|
type: number;
|
|
31
|
-
answer?: string;
|
|
32
32
|
items: string[];
|
|
33
33
|
}
|
|
34
34
|
export interface AiDefineData {
|
|
@@ -29,7 +29,7 @@ var AnalysisItem = function (props) {
|
|
|
29
29
|
var desc = props.desc || props.name;
|
|
30
30
|
var NotUsedAilibity = ['英文能力', '游戏测评'];
|
|
31
31
|
if (abilityType === 2 && !isWorkplace) {
|
|
32
|
-
desc = "".concat(NotUsedAilibity.includes(name) ? name : '
|
|
32
|
+
desc = "".concat(NotUsedAilibity.includes(name) ? name : '该能力', "\u4E0D\u80FD\u53C2\u4E0EAI\u5206\u6790");
|
|
33
33
|
}
|
|
34
34
|
var handleRemove = (0, react_1.useCallback)(function () {
|
|
35
35
|
removeAiAbilities(index);
|
|
@@ -44,6 +44,6 @@ var AnalysisItem = function (props) {
|
|
|
44
44
|
var value = _a.target.value;
|
|
45
45
|
updateAiAbilitiesWeight(value, index);
|
|
46
46
|
}, [updateAiAbilitiesWeight, index]);
|
|
47
|
-
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsxs)(mui_1.ListItem, __assign({ sx: { pl: 0, pr: 4 }, secondaryAction: (0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ sx: { position: 'relative', left: 16 }, onClick: handleRemove }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.CloseIcon, {}) })) }, { children: [(0, jsx_runtime_1.jsx)(mui_1.ListItemText, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "subtitle2" }, { children: name })), abilityType === 2 && !isWorkplace ? ((0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", style: { color: 'RGBA(0, 0, 0, 0.26)', fontSize: 12 }, ml: 1 }, { children: desc }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [abilityType === 2 && isWorkplace && (0, jsx_runtime_1.jsx)(fbm_ui_1.Chip, { color: 'primary', label: '自定义', size: "small", sx: { ml: 1 } }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: "".concat(desc) }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", sx: { ml: 1 } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.InfoIcon, { sx: { color: 'rgba(0, 0, 0, 0.26)', fontSize: 16 } }) })) }))] })), type === 8 && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Select, { sx: { width: 150, ml: 1 }, options: const_1.willOrNotOptions, value: (_a = JSON.parse(extra)) === null || _a === void 0 ? void 0 : _a.expect, size: "small", onChange: handleWillOrNotChange }))] })) }), (abilityType === 1 || (abilityType === 2 && isWorkplace)) && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Input, { sx: { width: 84, mr: 1 }, value: weight, disabled: index === aiAbilities.length - 1, size: "small", endAdornment: "%", onChange: handleWeightChange }))] })), type === 6 && (0, jsx_runtime_1.jsx)(MainPoints_1.default, { extra: extra, index: index })] }));
|
|
47
|
+
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsxs)(mui_1.ListItem, __assign({ sx: { pl: 0, pr: 4 }, secondaryAction: (0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ sx: { position: 'relative', left: 16 }, onClick: handleRemove }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.CloseIcon, {}) })) }, { children: [(0, jsx_runtime_1.jsx)(mui_1.ListItemText, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "subtitle2" }, { children: name })), abilityType === 2 && !isWorkplace ? ((0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", style: { color: 'RGBA(0, 0, 0, 0.26)', fontSize: 12 }, ml: 1 }, { children: desc }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [abilityType === 2 && isWorkplace && type === 3 && (0, jsx_runtime_1.jsx)(fbm_ui_1.Chip, { color: 'primary', label: '自定义', size: "small", sx: { ml: 1 } }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: "".concat(desc), placement: "right" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", sx: { ml: 1 } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.InfoIcon, { sx: { color: 'rgba(0, 0, 0, 0.26)', fontSize: 16 } }) })) }))] })), type === 8 && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Select, { sx: { width: 150, ml: 1 }, options: const_1.willOrNotOptions, value: (_a = JSON.parse(extra)) === null || _a === void 0 ? void 0 : _a.expect, size: "small", onChange: handleWillOrNotChange }))] })) }), (abilityType === 1 || (abilityType === 2 && isWorkplace)) && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Input, { sx: { width: 84, mr: 1 }, value: weight, disabled: index === aiAbilities.length - 1, size: "small", endAdornment: "%", onChange: handleWeightChange }))] })), type === 6 && (0, jsx_runtime_1.jsx)(MainPoints_1.default, { extra: extra, index: index })] }));
|
|
48
48
|
};
|
|
49
49
|
exports.default = AnalysisItem;
|
|
@@ -96,12 +96,14 @@ var QuestionForm = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
96
96
|
onValuesChange === null || onValuesChange === void 0 ? void 0 : onValuesChange(form.values);
|
|
97
97
|
}, [form.values, onValuesChange]);
|
|
98
98
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Form, __assign({}, form, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.FormItem, { required: true, disabled: preview, name: "name", label: "\u6807\u9898", placeholder: "\u6807\u9898\uFF08\u7528\u4E8E\u7CFB\u7EDF\u7BA1\u7406\uFF09", max: 15 }), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex" }, { children: [!preview && aiShowType === ai_question_1.ADD_QUESTION_TYPE.FREE && ((0, jsx_runtime_1.jsx)(fbm_ui_1.FormItem, __assign({ sx: { flex: '1 0', mr: 1 }, required: true, disabled: preview, name: "broadcastType", label: "\u64AD\u62A5\u65B9\u5F0F" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Select, { placeholder: "\u64AD\u62A5\u65B9\u5F0F", options: const_1.broadcastModeOptions }) }))), !preview && ((0, jsx_runtime_1.jsx)(fbm_ui_1.FormItem, __assign({ style: { flex: '1 0' }, disabled: preview, name: "category", label: "\u8003\u5BDF\u80FD\u529B" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Autocomplete, { placeholder: "\u8003\u5BDF\u80FD\u529B", options: questionCollectionList.map(function (_a) {
|
|
99
|
-
var tag = _a.tag, token = _a.token, isWorkplace = _a.isWorkplace;
|
|
99
|
+
var tag = _a.tag, token = _a.token, isWorkplace = _a.isWorkplace, define = _a.define, type = _a.type;
|
|
100
100
|
return ({
|
|
101
101
|
label: tag,
|
|
102
102
|
value: tag,
|
|
103
103
|
name: tag,
|
|
104
|
+
type: type,
|
|
104
105
|
token: token,
|
|
106
|
+
define: define,
|
|
105
107
|
isWorkplace: isWorkplace,
|
|
106
108
|
});
|
|
107
109
|
}), onChange: handleCategoryChange }) })))] })), form.values.broadcastType === 1 || preview ? ((0, jsx_runtime_1.jsx)(fbm_ui_1.FormItem, { required: true, disabled: preview, name: "desc", 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" })) : ((0, jsx_runtime_1.jsx)(VideoVoice_1.default, {})), aiShowType === ai_question_1.ADD_QUESTION_TYPE.LANGUAGE && ((0, jsx_runtime_1.jsx)(fbm_ui_1.FormItem, { sx: { height: 'auto', mb: 2 }, required: true, name: "readText", label: "\u6717\u8BFB\u5185\u5BB9", max: 240, InputProps: {
|
|
@@ -107,7 +107,7 @@ var QuestionUpdate = function () {
|
|
|
107
107
|
(_a = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _a === void 0 ? void 0 : _a.setFormValues({ broadcastType: const_1.defaultQuestionParams.broadcastType });
|
|
108
108
|
updateQuestionState({ aiShowType: ai_question_1.ADD_QUESTION_TYPE.LANGUAGE });
|
|
109
109
|
} }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2" }, { children: "\u8DDF\u8BFB\u80FD\u529B" })) }))] }));
|
|
110
|
-
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", height: 56 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "subtitle1" }, { children: aiShowType === ai_question_1.ADD_QUESTION_TYPE.FREE ? '自由作答' : '跟读能力' })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Popover, __assign({ open: switchTypeOpen, content: content, onClickAway: function () { return setSwitchTypeOpen(false); } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "text", size: "small", sx: { fontSize: 12, color: 'rgb(87, 107, 149)' }, onClick: function () { return setSwitchTypeOpen(true); } }, { children: "\u5207\u6362\u9898\u578B" })) }))] })));
|
|
110
|
+
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", height: 56 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ ml: 3, variant: "subtitle1" }, { children: aiShowType === ai_question_1.ADD_QUESTION_TYPE.FREE ? '自由作答' : '跟读能力' })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Popover, __assign({ open: switchTypeOpen, content: content, onClickAway: function () { return setSwitchTypeOpen(false); } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "text", size: "small", sx: { fontSize: 12, color: 'rgb(87, 107, 149)' }, onClick: function () { return setSwitchTypeOpen(true); } }, { children: "\u5207\u6362\u9898\u578B" })) }))] })));
|
|
111
111
|
};
|
|
112
112
|
var getModelParams = (0, react_1.useCallback)(function (values, isSubmit) {
|
|
113
113
|
return new Promise(function (resolve, reject) {
|
|
@@ -215,7 +215,7 @@ var QuestionUpdate = function () {
|
|
|
215
215
|
var CurWorkplace = questionCollectionList.find(function (v) { return v.name === curSelectWorkPlace.label; }) || {};
|
|
216
216
|
var CurWorkPlaceAiAbility = __assign(__assign(__assign({}, curSelectWorkPlace), CurWorkplace), { abilityType: 2, weight: 0, sort: 0 });
|
|
217
217
|
inInit = workplaceTypeIndex === -1;
|
|
218
|
-
CurWorkPlaceAiAbility.desc = CurWorkPlaceAiAbility.name;
|
|
218
|
+
CurWorkPlaceAiAbility.desc = CurWorkPlaceAiAbility.define ? CurWorkPlaceAiAbility.define : CurWorkPlaceAiAbility.name;
|
|
219
219
|
// console.log('CurWorkPlaceAiAbility', CurWorkPlaceAiAbility);
|
|
220
220
|
// 添加和修改
|
|
221
221
|
if (workplaceTypeIndex > -1) {
|
|
@@ -15,6 +15,6 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
15
15
|
var fbm_ui_1 = require("fbm-ui");
|
|
16
16
|
var TemplateHeader = function (_a) {
|
|
17
17
|
var name = _a.name, onClose = _a.onClose, onSearch = _a.onSearch, onBack = _a.onBack;
|
|
18
|
-
return name ? ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", justifyContent: "space-between", pt: 1, pb: 1.5, mb: 1 }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", right: 16 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ onClick: onBack }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.KeyboardArrowLeftIcon, {}) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body1", weight: "500", ml: 1 }, { children: name }))] })), (0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ onClick: onClose }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.CloseIcon, {}) }))] }))) : ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", justifyContent: "space-between", pt: 1, pb: 1.5, mb: 1 }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body1", weight: "500" }, { children: ["\u5C97\u4F4D\u6A21\u7248\u5E93", (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "secondary" }, { children: "\uFF08\u6A21\u7248\u5E93\u53EF\u591A\u6B21\u4F7F\u7528\uFF09" }))] })), (0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ onClick: onClose }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.CloseIcon, {}) }))] })));
|
|
18
|
+
return name ? ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", justifyContent: "space-between", pt: 1, pb: 1.5, mb: 1 }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", right: 16 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ onClick: onBack }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.KeyboardArrowLeftIcon, {}) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body1", weight: "500", ml: 1 }, { children: name }))] })), (0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ onClick: onClose }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.CloseIcon, {}) }))] }))) : ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", justifyContent: "space-between", pt: 1, pb: 1.5, mb: 1 }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body1", weight: "500", ml: 3 }, { children: ["\u5C97\u4F4D\u6A21\u7248\u5E93", (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "secondary" }, { children: "\uFF08\u6A21\u7248\u5E93\u53EF\u591A\u6B21\u4F7F\u7528\uFF09" }))] })), (0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ onClick: onClose }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.CloseIcon, {}) }))] })));
|
|
19
19
|
};
|
|
20
20
|
exports.default = TemplateHeader;
|