eli-video-interview 1.2.41-alpha.11 → 1.2.41-alpha.13
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/constants/ai-report.d.ts +5 -0
- package/esm/constants/ai-report.js +5 -0
- package/esm/modules/ai-ability/components/AbilityFormItem/AbilityFormItem.d.ts +14 -0
- package/esm/modules/ai-ability/components/AbilityFormItem/AbilityFormItem.js +145 -0
- package/esm/modules/ai-ability/components/AbilityFormItem/index.d.ts +2 -0
- package/esm/modules/ai-ability/components/AbilityFormItem/index.js +16 -5
- package/esm/modules/ai-ability/components/AddAbility/index.js +127 -101
- package/esm/modules/ai-ability/components/UpdateAbility/index.js +77 -106
- package/esm/modules/ai-report/Root.js +54 -10
- package/esm/modules/ai-report/components/AIEvaluate/index.js +1 -1
- package/esm/modules/ai-report/components/ScoreReport/Bar.d.ts +4 -1
- package/esm/modules/ai-report/components/ScoreReport/Bar.js +11 -9
- package/esm/modules/ai-report/components/ScoreReport/RecommendIcon.d.ts +3 -0
- package/esm/modules/ai-report/components/ScoreReport/RecommendIcon.js +17 -0
- package/esm/modules/ai-report/components/ScoreReport/Score.js +49 -9
- package/esm/modules/ai-report/components/ScoreReport/Tips.d.ts +3 -0
- package/esm/modules/ai-report/components/ScoreReport/Tips.js +18 -0
- package/esm/modules/ai-report/components/ScoreReport/index.js +8 -9
- package/esm/modules/ai-report/components/ScoreReport/interface.d.ts +3 -0
- package/esm/modules/ai-report/components/ScoreReport/styled.js +2 -4
- package/esm/modules/ai-report/components/Suggestion/index.js +2 -2
- package/esm/modules/ai-report/components/VideoQuestion/index.js +2 -2
- package/esm/modules/ai-report/components/WorkPlaces/index.js +3 -3
- package/esm/modules/ai-report/interface.d.ts +2 -0
- package/esm/services/ai-report.d.ts +5 -0
- package/esm/services/ai-report.js +1 -0
- package/lib/constants/ai-report.d.ts +5 -0
- package/lib/constants/ai-report.js +6 -1
- package/lib/modules/ai-ability/components/AbilityFormItem/AbilityFormItem.d.ts +14 -0
- package/lib/modules/ai-ability/components/AbilityFormItem/AbilityFormItem.js +147 -0
- package/lib/modules/ai-ability/components/AbilityFormItem/index.d.ts +2 -0
- package/lib/modules/ai-ability/components/AbilityFormItem/index.js +14 -3
- package/lib/modules/ai-ability/components/AddAbility/index.js +149 -100
- package/lib/modules/ai-ability/components/UpdateAbility/index.js +97 -103
- package/lib/modules/ai-report/Root.js +51 -7
- package/lib/modules/ai-report/components/AIEvaluate/index.js +1 -1
- package/lib/modules/ai-report/components/ScoreReport/Bar.d.ts +4 -1
- package/lib/modules/ai-report/components/ScoreReport/Bar.js +10 -8
- package/lib/modules/ai-report/components/ScoreReport/RecommendIcon.d.ts +3 -0
- package/lib/modules/ai-report/components/ScoreReport/RecommendIcon.js +22 -0
- package/lib/modules/ai-report/components/ScoreReport/Score.js +47 -7
- package/lib/modules/ai-report/components/ScoreReport/Tips.d.ts +3 -0
- package/lib/modules/ai-report/components/ScoreReport/Tips.js +20 -0
- package/lib/modules/ai-report/components/ScoreReport/index.js +5 -6
- package/lib/modules/ai-report/components/ScoreReport/interface.d.ts +3 -0
- package/lib/modules/ai-report/components/ScoreReport/styled.js +2 -4
- package/lib/modules/ai-report/components/Suggestion/index.js +1 -1
- package/lib/modules/ai-report/components/VideoQuestion/index.js +1 -1
- package/lib/modules/ai-report/components/WorkPlaces/index.js +2 -2
- package/lib/modules/ai-report/interface.d.ts +2 -0
- package/lib/services/ai-report.d.ts +5 -0
- package/lib/services/ai-report.js +3 -1
- package/package.json +5 -3
|
@@ -9,42 +9,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (_) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
12
|
var __read = (this && this.__read) || function (o, n) {
|
|
49
13
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
50
14
|
if (!m) return o;
|
|
@@ -62,12 +26,23 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
62
26
|
return ar;
|
|
63
27
|
};
|
|
64
28
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
30
|
+
import * as Yup from 'yup';
|
|
65
31
|
import { InitialValues } from '../../const';
|
|
66
32
|
import AbilityFormItem from '../AbilityFormItem';
|
|
67
33
|
import { GetAbilityDetail, PostQuestionCollectionUpsert } from "../../../../services/ai-ability";
|
|
68
34
|
import { useRequest } from 'ahooks';
|
|
69
|
-
import { Box, Button, Divider, Drawer,
|
|
35
|
+
import { Box, Button, Divider, Drawer, Form, FormItem, Message, Typography, useForm } from 'fbm-ui';
|
|
36
|
+
import { Stack } from 'fbm-ui/lib/mui';
|
|
37
|
+
import { FieldArray } from 'formik';
|
|
70
38
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
39
|
+
var validationSchema = Yup.object().shape({
|
|
40
|
+
name: Yup.string().required('能力名称不能为空'),
|
|
41
|
+
workPlaceItems: Yup.array().of(Yup.object().shape({
|
|
42
|
+
name: Yup.string().required(''),
|
|
43
|
+
items: Yup.array().of(Yup.string().required('')),
|
|
44
|
+
})),
|
|
45
|
+
});
|
|
71
46
|
var UpdateAbility = function (props) {
|
|
72
47
|
var open = props.open, _a = props.type, type = _a === void 0 ? 1 : _a, isWorkplace = props.isWorkplace, _b = props.name, name = _b === void 0 ? '' : _b, ablilityNameLength = props.ablilityNameLength, token = props.token, onClose = props.onClose, onSuccess = props.onSuccess;
|
|
73
48
|
var _c = __read(useState(''), 2), value = _c[0], setValue = _c[1];
|
|
@@ -75,8 +50,27 @@ var UpdateAbility = function (props) {
|
|
|
75
50
|
var _e = __read(useState('show'), 2), mode = _e[0], setMode = _e[1];
|
|
76
51
|
var firstLoad = useRef(true);
|
|
77
52
|
var _f = __read(useState(false), 2), showAiDefineDetail = _f[0], setShowAiDefineDetail = _f[1];
|
|
78
|
-
// const [submitDisabled, setSubmitDisabled] = useState<boolean>(true);
|
|
79
53
|
var _g = __read(useState(InitialValues.workPlaceItems), 2), workPlaceItems = _g[0], setWorkPlaceItems = _g[1];
|
|
54
|
+
var formik = useForm({
|
|
55
|
+
initialValues: { name: '', workPlaceItems: [] },
|
|
56
|
+
validationSchema: validationSchema,
|
|
57
|
+
validateOnChange: true,
|
|
58
|
+
onSubmit: function (values) {
|
|
59
|
+
// 处理表单提交逻辑
|
|
60
|
+
console.log(values);
|
|
61
|
+
var avocadoConfig = window['AvocadoVideoInterviewConfig'];
|
|
62
|
+
run({
|
|
63
|
+
name: values.name,
|
|
64
|
+
tag: values.name,
|
|
65
|
+
token: token,
|
|
66
|
+
workPlaceItems: values.workPlaceItems,
|
|
67
|
+
mateData: {
|
|
68
|
+
account: avocadoConfig === null || avocadoConfig === void 0 ? void 0 : avocadoConfig.account,
|
|
69
|
+
enterpriseId: avocadoConfig === null || avocadoConfig === void 0 ? void 0 : avocadoConfig.enterpriseId,
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
});
|
|
80
74
|
var _h = useRequest(PostQuestionCollectionUpsert, {
|
|
81
75
|
manual: true,
|
|
82
76
|
onSuccess: function () {
|
|
@@ -87,7 +81,7 @@ var UpdateAbility = function (props) {
|
|
|
87
81
|
onError: function (err) {
|
|
88
82
|
console.log(err);
|
|
89
83
|
if ((err === null || err === void 0 ? void 0 : err.code) === -1211) {
|
|
90
|
-
|
|
84
|
+
formik.errors.name = '能力名称不能重复';
|
|
91
85
|
}
|
|
92
86
|
},
|
|
93
87
|
}), run = _h.run, loading = _h.loading;
|
|
@@ -106,82 +100,60 @@ var UpdateAbility = function (props) {
|
|
|
106
100
|
}
|
|
107
101
|
},
|
|
108
102
|
}).run;
|
|
109
|
-
var nameTextField = useTextField({
|
|
110
|
-
value: value,
|
|
111
|
-
label: '能力名称',
|
|
112
|
-
required: true,
|
|
113
|
-
rules: [
|
|
114
|
-
{
|
|
115
|
-
required: true,
|
|
116
|
-
message: '能力名称不能为空',
|
|
117
|
-
},
|
|
118
|
-
],
|
|
119
|
-
onChange: function (e) { return setValue(e.target.value); },
|
|
120
|
-
max: ablilityNameLength,
|
|
121
|
-
sx: {
|
|
122
|
-
height: '48px',
|
|
123
|
-
width: '100%',
|
|
124
|
-
marginTop: '16px',
|
|
125
|
-
},
|
|
126
|
-
});
|
|
127
103
|
var handleValue = useCallback(function (v) {
|
|
128
|
-
|
|
129
|
-
workPlaceItems.splice(index, 1, v);
|
|
130
|
-
|
|
131
|
-
setWorkPlaceItems(list);
|
|
104
|
+
// const index = workPlaceItems.findIndex(ele => ele.type === v.type);
|
|
105
|
+
// workPlaceItems.splice(index, 1, v);
|
|
106
|
+
// const list = workPlaceItems;
|
|
107
|
+
// setWorkPlaceItems(list);
|
|
132
108
|
}, [workPlaceItems]);
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
},
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
return [2 /*return*/];
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
}); }, [nameTextField, run, token, value, isWorkplace, type, workPlaceItems]);
|
|
109
|
+
// const handleOk = useCallback(async () => {
|
|
110
|
+
// // const error = await nameTextField.handleValidate();
|
|
111
|
+
// const error = false;
|
|
112
|
+
// const workPlaceItemsError = workPlaceItems.some(v => v.items.length === 0);
|
|
113
|
+
// if (!error) {
|
|
114
|
+
// const avocadoConfig = window['AvocadoVideoInterviewConfig'];
|
|
115
|
+
// // 旧自定义能力
|
|
116
|
+
// if (type === 3 && !isWorkplace) {
|
|
117
|
+
// run({
|
|
118
|
+
// name: value,
|
|
119
|
+
// tag: value,
|
|
120
|
+
// token,
|
|
121
|
+
// mateData: {
|
|
122
|
+
// account: avocadoConfig?.account,
|
|
123
|
+
// enterpriseId: avocadoConfig?.enterpriseId,
|
|
124
|
+
// },
|
|
125
|
+
// });
|
|
126
|
+
// } else if (!workPlaceItemsError) {
|
|
127
|
+
// // 职场能力
|
|
128
|
+
// run({
|
|
129
|
+
// name: value,
|
|
130
|
+
// tag: value,
|
|
131
|
+
// token,
|
|
132
|
+
// workPlaceItems,
|
|
133
|
+
// mateData: {
|
|
134
|
+
// account: avocadoConfig?.account,
|
|
135
|
+
// enterpriseId: avocadoConfig?.enterpriseId,
|
|
136
|
+
// },
|
|
137
|
+
// });
|
|
138
|
+
// }
|
|
139
|
+
// }
|
|
140
|
+
// }, [run, token, value, isWorkplace, type, workPlaceItems]);
|
|
173
141
|
var footer = useCallback(function () {
|
|
174
|
-
return step === 1 ? (_jsx(Box, __assign({ display: "flex", padding: "12px 16px" }, { children: type === 1 ? (_jsx(_Fragment, {})) : (_jsx(Button, __assign({ variant: "outlined", color: "inherit", onClick: function () { return setStep(2); } }, { children: "\u7F16\u8F91" }))) }))) : (_jsxs(Box, __assign({ display: "flex", justifyContent: "flex-end", padding: "12px 16px" }, { children: [_jsx(Button, __assign({ sx: { mr: 1, fontWeight: 400 }, variant: "text", color: "inherit", onClick: onClose }, { children: "\u53D6\u6D88" })), _jsx(Button, __assign({ loading: loading, onClick:
|
|
175
|
-
}, [
|
|
142
|
+
return step === 1 ? (_jsx(Box, __assign({ display: "flex", padding: "12px 16px" }, { children: type === 1 ? (_jsx(_Fragment, {})) : (_jsx(Button, __assign({ variant: "outlined", color: "inherit", onClick: function () { return setStep(2); } }, { children: "\u7F16\u8F91" }))) }))) : (_jsxs(Box, __assign({ display: "flex", justifyContent: "flex-end", padding: "12px 16px" }, { children: [_jsx(Button, __assign({ sx: { mr: 1, fontWeight: 400 }, variant: "text", color: "inherit", onClick: onClose }, { children: "\u53D6\u6D88" })), _jsx(Button, __assign({ loading: loading, onClick: formik.submitForm }, { children: "\u4FDD\u5B58" }))] })));
|
|
143
|
+
}, [step, type, onClose, loading, formik]);
|
|
144
|
+
useEffect(function () {
|
|
145
|
+
formik.setFieldValue('workPlaceItems', workPlaceItems);
|
|
146
|
+
}, [workPlaceItems]);
|
|
176
147
|
useEffect(function () {
|
|
177
148
|
setValue(name);
|
|
149
|
+
formik.setFieldValue('name', name);
|
|
178
150
|
}, [name]);
|
|
179
151
|
useEffect(function () {
|
|
180
152
|
if (!open) {
|
|
181
153
|
setValue('');
|
|
182
154
|
setWorkPlaceItems([]);
|
|
183
155
|
setStep(1);
|
|
184
|
-
nameTextField.setError();
|
|
156
|
+
// nameTextField.setError();
|
|
185
157
|
}
|
|
186
158
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
187
159
|
}, [open]);
|
|
@@ -200,7 +172,6 @@ var UpdateAbility = function (props) {
|
|
|
200
172
|
useEffect(function () {
|
|
201
173
|
setWorkPlaceItems(workPlaceItems);
|
|
202
174
|
}, [workPlaceItems, setWorkPlaceItems]);
|
|
203
|
-
return (
|
|
204
|
-
workPlaceItems.map(function (v) { return (_jsx(AbilityFormItem, { token: token, name: value, title: v.name, type: v.type, items: v.items, mode: mode, maxTextLength: v.type === 4 || v.type === 5 ? 300 : 100, canReplace: mode === 'edit' ? true : false, onChange: handleValue }, v.type)); })] })))] })));
|
|
175
|
+
return (_jsx(Drawer, __assign({ className: "abilityDrawer", title: '能力详情', open: open, footer: footer, onClose: onClose }, { children: _jsxs(Form, __assign({}, formik, { children: [_jsx(Box, __assign({ style: { width: '556px' } }, { children: step === 1 ? (_jsxs(Typography, __assign({ variant: "body1", fontWeight: "medium" }, { children: ["\u80FD\u529B\u540D\u79F0\uFF1A", value] }))) : (_jsxs(_Fragment, { children: [_jsx(Typography, __assign({ variant: "body2", color: "secondary" }, { children: "\u4F7F\u7528\u901A\u7528\u7684\u80FD\u529B\u540D\u79F0\uFF08\u4F8B\u5982\uFF1A\u9886\u5BFC\u529B\u3001\u5E94\u53D8\u80FD\u529B\u7B49\u5E38\u89C1\u8003\u6838\u9879\uFF09\u547D\u540D\u6709\u52A9\u4E8E\u63D0\u9AD8 AI \u8BC4\u4EF7\u53CA\u8BC4\u5206\u51C6\u786E\u6027\u3002" })), _jsx(FormItem, { name: "name", label: "\u80FD\u529B\u540D\u79F0", sx: { height: '48px', width: '100%', marginTop: '16px' }, max: ablilityNameLength })] })) })), !(type === 3 && !isWorkplace) && (_jsxs(Box, __assign({ style: { width: '556px' } }, { children: [_jsx(Divider, { style: { margin: '24px 0' } }), _jsx(Typography, __assign({ variant: "body1", fontWeight: "medium", mb: 2 }, { children: "\u80FD\u529B\u6807\u51C6" })), showAiDefineDetail && (_jsx(FieldArray, __assign({ name: "workPlaceItems" }, { children: function () { return (_jsx(Stack, { children: formik.values.workPlaceItems.map(function (item, index) { return (_jsx(Stack, { children: _jsx(AbilityFormItem, { token: token, name: value, title: item.name, type: item.type, items: item.items, mode: mode, index: index, item: item, maxTextLength: item.type === 4 || item.type === 5 ? 300 : 100, canReplace: mode === 'edit' ? true : false, onChange: handleValue }, item.type) }, index)); }) })); } })))] })))] })) })));
|
|
205
176
|
};
|
|
206
177
|
export default UpdateAbility;
|
|
@@ -9,26 +9,27 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx,
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
13
|
import AIEvaluate from './components/AIEvaluate';
|
|
14
14
|
import NotFinish from './components/NotFinish';
|
|
15
15
|
import ScoreReport from './components/ScoreReport';
|
|
16
|
+
import Report from './components/ScoreReport/Report';
|
|
16
17
|
import Suggestion from './components/Suggestion';
|
|
17
18
|
import VideoQuestion from './components/VideoQuestion';
|
|
18
19
|
import WorkPlaces from './components/WorkPlaces';
|
|
19
20
|
import { INTERVIEW_STATUS } from "../../enum/ai-report";
|
|
20
|
-
import { PostAiInterviewResult } from "../../services/ai-report";
|
|
21
|
+
import { PostAiInterviewResult, SwitchReportModel } from "../../services/ai-report";
|
|
21
22
|
import { useAiReportStore } from "../../store/ai-report/global-store";
|
|
22
23
|
import { useRequest } from 'ahooks';
|
|
23
|
-
import { Box, Button, Typography } from 'fbm-ui';
|
|
24
|
+
import { Box, Button, confirm, Message, Paper, Typography } from 'fbm-ui';
|
|
24
25
|
import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
|
25
|
-
var NO_ANSWER = INTERVIEW_STATUS.NO_ANSWER;
|
|
26
|
+
var NO_ANSWER = INTERVIEW_STATUS.NO_ANSWER, FAILED = INTERVIEW_STATUS.FAILED, IN_CALCULATION = INTERVIEW_STATUS.IN_CALCULATION;
|
|
26
27
|
var AiReportRoot = forwardRef(function (props, ref) {
|
|
27
28
|
var token = props.token, customScore = props.customScore, reminderSent = props.reminderSent, operableButtons = props.operableButtons, onLoad = props.onLoad, onSendReminderClick = props.onSendReminderClick;
|
|
28
29
|
var firstLoad = useRef(true);
|
|
29
30
|
var _a = useAiReportStore(), updateState = _a.updateState, updateReportResult = _a.updateReportResult, reportResult = _a.reportResult;
|
|
30
|
-
var _b = reportResult || {}, _c = _b.collection, collection = _c === void 0 ? [] : _c, _d = _b.workplaces, workplaces = _d === void 0 ? [] : _d;
|
|
31
|
-
var
|
|
31
|
+
var _b = reportResult || {}, _c = _b.collection, collection = _c === void 0 ? [] : _c, _d = _b.workplaces, workplaces = _d === void 0 ? [] : _d, _e = _b.model, model = _e === void 0 ? 'standard' : _e, _f = _b.hasProVersion, hasProVersion = _f === void 0 ? false : _f;
|
|
32
|
+
var _g = useRequest(function () { return PostAiInterviewResult([token]); }, {
|
|
32
33
|
manual: true,
|
|
33
34
|
onSuccess: function (_a) {
|
|
34
35
|
var list = _a.data.list;
|
|
@@ -46,11 +47,44 @@ var AiReportRoot = forwardRef(function (props, ref) {
|
|
|
46
47
|
onLoad === null || onLoad === void 0 ? void 0 : onLoad(__assign({ pageStepIndexes: pageStepIndexes_1 }, result));
|
|
47
48
|
}
|
|
48
49
|
},
|
|
49
|
-
}), data =
|
|
50
|
+
}), data = _g.data, loading = _g.loading, postAiInterviewResult = _g.run;
|
|
50
51
|
var status = (data === null || data === void 0 ? void 0 : data.data.list[0].status) || NO_ANSWER;
|
|
51
52
|
var handleRefreshSuccess = useCallback(function () {
|
|
52
53
|
postAiInterviewResult();
|
|
53
54
|
}, [postAiInterviewResult]);
|
|
55
|
+
var handleSwitchReportModel = useCallback(function () {
|
|
56
|
+
var SwithAction = function () {
|
|
57
|
+
SwitchReportModel({
|
|
58
|
+
thirdOrderID: token,
|
|
59
|
+
model: model === 'standard' ? 'pro' : 'standard',
|
|
60
|
+
})
|
|
61
|
+
.then(function () {
|
|
62
|
+
postAiInterviewResult();
|
|
63
|
+
})
|
|
64
|
+
.catch(function () {
|
|
65
|
+
Message.error('升级报告失败,请重试。');
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
if (model === 'standard' && !hasProVersion) {
|
|
69
|
+
confirm({
|
|
70
|
+
title: '确认使用增值服务',
|
|
71
|
+
content: (_jsxs(Typography, __assign({ color: "textSecondary", sx: { display: 'inline' } }, { children: ["\u4E13\u4E1A\u7248\u62A5\u544A\u4EE5\u9AD8\u7EA7AI\u6280\u672F\u63D0\u4F9B\u66F4\u7CBE\u51C6\u8BC4\u4F30\uFF0C\u5C5E\u589E\u503C\u4EA7\u54C1\uFF0C\u6BCF\u4E13\u4E1A\u7248\u62A5\u544A\u6309\u6807\u51C6\u72482\u4EBA\u6B21\u8BA1\u8D39\uFF0C\u4EC5\u9996\u6B21\u5207\u6362\u6536\u8D39\u3002\u9ED8\u8BA4\u63D0\u4F9B\u6807\u51C6\u7248\uFF0C\u54A8\u8BE2\u5BA2\u6237\u987E\u95EE\u4E86\u89E3\u8D44\u8D39\u4F18\u60E0\u3002", _jsx(Typography, __assign({ fontWeight: "medium", sx: { display: 'inline' } }, { children: "\u672C\u6B21\u64CD\u4F5C\u5C06\u6D88\u80172\u4EBA \u6B21\uFF0C\u662F\u5426\u786E\u8BA4\uFF1F" }))] }))),
|
|
72
|
+
okText: '确认',
|
|
73
|
+
okProps: {
|
|
74
|
+
color: 'primary',
|
|
75
|
+
variant: 'contained',
|
|
76
|
+
},
|
|
77
|
+
onOk: function (_a) {
|
|
78
|
+
var onClose = _a.onClose;
|
|
79
|
+
SwithAction();
|
|
80
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
SwithAction();
|
|
86
|
+
}
|
|
87
|
+
}, [token, model, postAiInterviewResult]);
|
|
54
88
|
useImperativeHandle(ref, function () { return ({
|
|
55
89
|
handleRefresh: function () { return postAiInterviewResult(); },
|
|
56
90
|
}); });
|
|
@@ -68,10 +102,20 @@ var AiReportRoot = forwardRef(function (props, ref) {
|
|
|
68
102
|
return (_jsxs(Box, __assign({ width: "100%", display: "flex", alignItems: "center", justifyContent: "center", flexDirection: "column", style: { marginTop: '149px' } }, { children: [_jsx(Box, { children: _jsx("img", { src: "//webcdn.fbmms.cn/web/saas/asset/image/CandidateInfoEmpty.png", alt: "", style: { width: '140px', height: '140px' } }) }), _jsx(Box, __assign({ mt: 2 }, { children: _jsx(Typography, __assign({ variant: "body1", color: "textPrimary", style: { fontWeight: '500' } }, { children: "\u8BE5\u5019\u9009\u4EBA\u5C1A\u672A\u5F00\u59CB\u9762\u8BD5" })) })), (operableButtons === null || operableButtons === void 0 ? void 0 : operableButtons.includes('sendReminder')) && (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ style: { marginTop: '2px' } }, { children: _jsx(Typography, __assign({ variant: "body2", color: "textSecondary" }, { children: "\u82E5\u957F\u65F6\u95F4\u672A\u5F00\u59CB\uFF0C\u5EFA\u8BAE\u4F60\u7ED9\u5019\u9009\u4EBA\u53D1\u9001\u77ED\u4FE1\u63D0\u9192" })) })), _jsx(Box, __assign({ mt: 2 }, { children: _jsx(Button, __assign({ size: "large", variant: "outlined", color: "primary", disabled: reminderSent, onClick: onSendReminderClick }, { children: reminderSent ? '已提醒' : '发送提醒' })) }))] }))] })));
|
|
69
103
|
}
|
|
70
104
|
else {
|
|
71
|
-
return (_jsxs(Box, { children: [_jsx(NotFinish, {}), (collection === null || collection === void 0 ? void 0 : collection.length) > 0 && _jsx(ScoreReport, { customScore: customScore, onRefreshSuccess: handleRefreshSuccess }), (workplaces === null || workplaces === void 0 ? void 0 : workplaces.length) > 0 && _jsx(WorkPlaces, {}), (collection === null || collection === void 0 ? void 0 : collection.length) > 0 && _jsx(AIEvaluate, {}), _jsx(Suggestion, {}), _jsx(VideoQuestion, {})] }));
|
|
105
|
+
return (_jsxs(Box, __assign({ pb: 3 }, { children: [_jsx(NotFinish, {}), (collection === null || collection === void 0 ? void 0 : collection.length) > 0 && (_jsx(ScoreReport, { customScore: customScore, onRefreshSuccess: handleRefreshSuccess, onSwitchReportModel: handleSwitchReportModel })), _jsxs(Paper, __assign({ variant: "outlined", sx: { mt: -10, zIndex: 1, position: 'relative', mx: 2, borderRadius: 4 } }, { children: [![FAILED, IN_CALCULATION].includes(status) && _jsx(Report, {}), (workplaces === null || workplaces === void 0 ? void 0 : workplaces.length) > 0 && _jsx(WorkPlaces, {}), (collection === null || collection === void 0 ? void 0 : collection.length) > 0 && _jsx(AIEvaluate, {}), _jsx(Suggestion, {}), _jsx(VideoQuestion, {})] }))] })));
|
|
72
106
|
}
|
|
73
|
-
}, [
|
|
74
|
-
|
|
107
|
+
}, [
|
|
108
|
+
status,
|
|
109
|
+
operableButtons,
|
|
110
|
+
reminderSent,
|
|
111
|
+
onSendReminderClick,
|
|
112
|
+
collection,
|
|
113
|
+
customScore,
|
|
114
|
+
handleRefreshSuccess,
|
|
115
|
+
handleSwitchReportModel,
|
|
116
|
+
workplaces,
|
|
117
|
+
]);
|
|
118
|
+
return (_jsx(Box, __assign({ loading: firstLoad.current && loading, sx: { width: '100%', minHeight: '618px', height: '100%', margin: '0 auto', overflow: 'auto' } }, { children: aiReportResult })));
|
|
75
119
|
});
|
|
76
120
|
AiReportRoot.displayName = 'AiReportRoot';
|
|
77
121
|
export default memo(AiReportRoot);
|
|
@@ -46,7 +46,7 @@ var Index = function () {
|
|
|
46
46
|
// }, [expand]);
|
|
47
47
|
if (!showAiDimension || ((_a = reportResult === null || reportResult === void 0 ? void 0 : reportResult.evaluations) === null || _a === void 0 ? void 0 : _a.length) === 0)
|
|
48
48
|
return null;
|
|
49
|
-
return (_jsxs(Box, __assign({ id: "report-evaluate",
|
|
49
|
+
return (_jsxs(Box, __assign({ id: "report-evaluate", px: 2, mt: 2 }, { children: [_jsxs(Stack, __assign({ direction: "row", height: 56, alignItems: "center", spacing: 1, marginBottom: 1 }, { children: [_jsx(AiHeaderTitle, { name: "AI\u57FA\u7840\u80FD\u529B" }), _jsx(Tooltip, __assign({ title: _jsxs("span", { children: ["\u7ED3\u679C\u8BF4\u660E\uFF1A", _jsx("br", {}), "AI\u57FA\u7840\u80FD\u529B\u4ECE\u8BED\u901F\u3001\u666E\u901A\u8BDD\u3001\u8BED\u8A00\u6D41\u7545\u5EA6\u3001\u8981\u70B9\u5206\u6790\u5339\u914D\u5EA6\u3001\u8BED\u8A00\u4E30\u5BCC\u5EA6\u3001\u5F62\u8C61\u516D\u4E2A\u7EF4\u5EA6\u5BF9\u5019\u9009\u4EBA\u5728\u9762\u8BD5\u4E2D\u7684\u56DE\u7B54\u8868\u73B0\u8FDB\u884C\u8BC4\u4EF7\uFF0C\u6BCF\u4E2A\u7EF4\u5EA6\u5206\u4E3A\u4E09\u4E2A\u6863\uFF0C\u5206\u522B\u4E3A\uFF1A\u524D30%\u4EE3\u8868\u4F18\u79C0\u3001\u4E2D\u95F430%~70%\u4EE3\u8868\u9002\u4E2D\u3001\u540E30%\u4EE3\u8868\u6B20\u4F73\u3002", _jsx("br", {}), "\u6BCF\u4E2A\u80FD\u529B\u7684\u4E09\u6863\u7684\u5206\u6570\u503C\u4F9D\u636E\u5168\u56FD\u5927\u6570\u636E\u7EDF\u8BA1\u800C\u5B9A\u3002\u6839\u636E\u5019\u9009\u4EBA\u5F53\u524DAI\u89C6\u9891\u6B65\u9AA4\u4E0B\u7684\u6BCF\u4E2A\u80FD\u529B\u7684\u5E73\u5747\u5206\u6765\u786E\u5B9A\u6BCF\u4E2A\u80FD\u529B\u7684\u8BC4\u4EF7\u3002\u76F8\u540C\u7684\u5F97\u5206\uFF0C\u6210\u7EE9\u5148\u51FA\u7684\u6392\u540D\u9760\u524D\u3002"] }) }, { children: _jsx(Box, __assign({ display: "flex", alignItems: "center" }, { children: _jsx(InfoOutlineIcon, { sx: { fontSize: '16px' } }) })) }))] })), _jsxs(Collapse, __assign({ in: expand }, { children: [(_b = reportResult === null || reportResult === void 0 ? void 0 : reportResult.evaluations) === null || _b === void 0 ? void 0 : _b.map(function (v) {
|
|
50
50
|
var _a;
|
|
51
51
|
var c = customInterviewDimRankMap === null || customInterviewDimRankMap === void 0 ? void 0 : customInterviewDimRankMap[v.evaluationToken];
|
|
52
52
|
var rank = rankPercent((c === null || c === void 0 ? void 0 : c.rank) || (v === null || v === void 0 ? void 0 : v.rank), (c === null || c === void 0 ? void 0 : c.total) || (v === null || v === void 0 ? void 0 : v.total));
|
|
@@ -27,15 +27,16 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
27
27
|
};
|
|
28
28
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
29
29
|
import { rankPercent } from '../../utils';
|
|
30
|
-
import {
|
|
30
|
+
import { scoreRankIntervalModeColors } from "../../../../constants/ai-report";
|
|
31
31
|
import { useAiReportStore } from "../../../../store/ai-report/global-store";
|
|
32
32
|
import { Box, Typography } from 'fbm-ui';
|
|
33
33
|
import { useEffect, useState } from 'react';
|
|
34
|
-
var Bar = function () {
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
34
|
+
var Bar = function (_a) {
|
|
35
|
+
var _b = _a.model, model = _b === void 0 ? 'standard' : _b;
|
|
36
|
+
var _c = __read(useState(1), 2), currentRank = _c[0], setCurrentRank = _c[1];
|
|
37
|
+
var _d = __read(useState(''), 2), text = _d[0], setText = _d[1];
|
|
38
|
+
var _e = useAiReportStore(function (store) { return [store.reportResult, store.scoreRankIntervals]; }), reportResult = _e.reportResult, scoreRankIntervals = _e.scoreRankIntervals, reportRank = _e.reportRank;
|
|
39
|
+
var _f = (reportResult || {}).score, score = _f === void 0 ? 0 : _f;
|
|
39
40
|
useEffect(function () {
|
|
40
41
|
var floatInterval = scoreRankIntervals === null || scoreRankIntervals === void 0 ? void 0 : scoreRankIntervals.find(function (interval) { return score >= interval.score.startScore && score <= interval.score.endScore; });
|
|
41
42
|
if (floatInterval) {
|
|
@@ -51,13 +52,14 @@ var Bar = function () {
|
|
|
51
52
|
}, [score, reportRank, scoreRankIntervals]);
|
|
52
53
|
if (!scoreRankIntervals || (scoreRankIntervals === null || scoreRankIntervals === void 0 ? void 0 : scoreRankIntervals.length) === 0)
|
|
53
54
|
return null;
|
|
54
|
-
return (_jsxs(Box, { children: [_jsxs(Typography, __assign({ variant: "body2", flexShrink: 0 }, { children: [text, "\u00A0"] })), _jsx(Box, __assign({ display: "flex", alignItems: "center", sx: { height: 12, mt: 0.5 } }, { children: scoreRankIntervals === null || scoreRankIntervals === void 0 ? void 0 : scoreRankIntervals.map(function (_a, index) {
|
|
55
|
-
var
|
|
55
|
+
return (_jsxs(Box, { children: [_jsxs(Typography, __assign({ color: "inherit", variant: "body2", flexShrink: 0 }, { children: [text, "\u00A0"] })), _jsx(Box, __assign({ display: "flex", alignItems: "center", sx: { height: 12, mt: 0.5 } }, { children: scoreRankIntervals === null || scoreRankIntervals === void 0 ? void 0 : scoreRankIntervals.map(function (_a, index) {
|
|
56
|
+
var _b;
|
|
57
|
+
var rank = _a.rank, _c = _a.scoreRankIntervals, startRankProportion = _c.startRankProportion, endRankProportion = _c.endRankProportion;
|
|
56
58
|
return [
|
|
57
59
|
_jsx(Box, { sx: {
|
|
58
60
|
width: "".concat((endRankProportion - startRankProportion) * 100, "%"),
|
|
59
61
|
height: currentRank === rank ? 'calc(100% + 4px)' : '100%',
|
|
60
|
-
background:
|
|
62
|
+
background: (_b = scoreRankIntervalModeColors === null || scoreRankIntervalModeColors === void 0 ? void 0 : scoreRankIntervalModeColors[model]) === null || _b === void 0 ? void 0 : _b[index],
|
|
61
63
|
border: '1px solid rgb(255, 255, 255)',
|
|
62
64
|
} }, rank),
|
|
63
65
|
];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import SvgIcon from '@mui/material/SvgIcon';
|
|
14
|
+
var RecommendIcon = function (props) {
|
|
15
|
+
return (_jsx(SvgIcon, __assign({}, props, { viewBox: "0 0 120 120" }, { children: _jsx("path", { d: "M84.407 24.379a2.648 2.648 0 0 1 1.186 2.298c-.131 4.575 3.655 8.601 8.247 8.731a2.656 2.656 0 0 1 2.415 3.58 8.473 8.473 0 0 0 .119 6.286 8.543 8.543 0 0 0 4.889 4.634 2.656 2.656 0 0 1 .898 4.42 8.43 8.43 0 0 0-.343 12.008 2.656 2.656 0 0 1-.82 4.238 8.472 8.472 0 0 0-4.362 4.53 8.42 8.42 0 0 0 .18 6.733 2.656 2.656 0 0 1-2.491 3.764 8.427 8.427 0 0 0-8.73 8.246 2.65 2.65 0 0 1-3.58 2.415 8.473 8.473 0 0 0-6.287.118 8.405 8.405 0 0 0-4.475 4.49 2.642 2.642 0 0 1-.73 1.389c-1.045 1.044-2.746 1.16-3.775-.02l-.085-.084c-1.79-1.79-3.916-2.676-6.164-2.678a8.475 8.475 0 0 0-5.831 2.345 2.659 2.659 0 0 1-4.24-.82 8.487 8.487 0 0 0-4.53-4.362 8.42 8.42 0 0 0-6.733.178 2.656 2.656 0 0 1-3.763-2.49c.133-4.577-3.66-8.602-8.248-8.732a2.651 2.651 0 0 1-2.415-3.58 8.473 8.473 0 0 0-.119-6.286 8.546 8.546 0 0 0-4.889-4.634 2.656 2.656 0 0 1-.898-4.42 8.432 8.432 0 0 0 .344-12.007 2.656 2.656 0 0 1 .82-4.24 8.424 8.424 0 0 0 4.182-11.262 2.656 2.656 0 0 1 2.49-3.764 8.427 8.427 0 0 0 8.731-8.246 2.65 2.65 0 0 1 3.58-2.415 8.436 8.436 0 0 0 10.919-5.007 2.663 2.663 0 0 1 1.96-1.679 2.702 2.702 0 0 1 2.461.782l.011.011c1.79 1.79 3.914 2.675 6.166 2.677a8.472 8.472 0 0 0 5.832-2.346 2.661 2.661 0 0 1 4.239.825 8.426 8.426 0 0 0 11.26 4.181 2.648 2.648 0 0 1 2.58.193Zm-3.778 5.706c-2.532.45-5.14.172-7.522-.798a13.723 13.723 0 0 1-5.704-4.315 13.705 13.705 0 0 1-14.178-.216 13.626 13.626 0 0 1-5.884 4.757 13.68 13.68 0 0 1-7.086.978 13.68 13.68 0 0 1-3.564 6.205 13.624 13.624 0 0 1-6.613 3.671c.45 2.532.174 5.139-.796 7.52a13.672 13.672 0 0 1-4.319 5.71 13.706 13.706 0 0 1 1.87 6.903 13.627 13.627 0 0 1-2.085 7.278 13.683 13.683 0 0 1 5.742 12.965 13.667 13.667 0 0 1 6.203 3.563 13.627 13.627 0 0 1 3.674 6.615c2.532-.45 5.14-.173 7.522.798 2.25.911 4.218 2.4 5.706 4.317a13.705 13.705 0 0 1 14.176.214 13.618 13.618 0 0 1 5.884-4.757 13.68 13.68 0 0 1 7.088-.98 13.664 13.664 0 0 1 3.562-6.203 13.624 13.624 0 0 1 6.61-3.675c-.45-2.532-.174-5.14.797-7.522a13.67 13.67 0 0 1 4.32-5.702 13.705 13.705 0 0 1 .215-14.185 13.683 13.683 0 0 1-5.74-12.963c-4.839-1.274-8.771-5.36-9.878-10.178Zm-37.034 47.32a2.656 2.656 0 1 1-3.756 3.756 2.656 2.656 0 0 1 3.756-3.757Zm5.635 5.634a2.656 2.656 0 1 1-3.756 3.756 2.656 2.656 0 0 1 3.756-3.756ZM36.77 71.082a2.656 2.656 0 1 1-1.376 5.132 2.656 2.656 0 0 1 1.376-5.132ZM50.819 33.61a1.328 1.328 0 0 1-.318 2.278 26.351 26.351 0 0 0-8.786 5.833 26.491 26.491 0 0 0-5.835 8.784 1.328 1.328 0 0 1-2.46-.996 29.024 29.024 0 0 1 6.417-9.666 28.977 28.977 0 0 1 9.666-6.417c.44-.178.942-.108 1.316.184Zm36.508 36.428.094.11c.294.388.353.905.153 1.349a29.024 29.024 0 0 1-6.417 9.666 28.977 28.977 0 0 1-9.666 6.417 1.323 1.323 0 0 1-1.728-.732 1.328 1.328 0 0 1 .73-1.73 26.351 26.351 0 0 0 8.786-5.833 26.491 26.491 0 0 0 5.835-8.784 1.328 1.328 0 0 1 2.307-.353Zm-13.559 3.55-1.473 1.473-3.756-1.172 2.9 2.9-1.593 1.593-3.44-3.441-1.263 1.262c-1.457 1.458-2.329 1.458-4.027 0l-.917-.766 1.082-2.134 1.082.902c.661.54.827.466 1.307-.015l.992-.992-3.53-3.531 1.592-1.593 3.531 3.531.406-.405 2.464.901-4.433-4.433 1.578-1.577 7.498 7.498ZM58.171 45.97l1.352 2.043c-.766.466-1.547.887-2.329 1.248l1.939 1.938 1.307-2.029 1.818 1.638-1.397 2.119 2.239 2.239-1.698 1.698-2.435-2.435-1.487 1.488 2.194 2.194-1.608 1.608-2.194-2.194-1.518 1.517 2.194 2.194-1.668 1.668-2.194-2.194-1.532 1.533 2.795 2.795-1.683 1.683-8.295-8.295 7.048-7.047-.526.105.856-2.78c.33-.06.646-.135.962-.21l-.631-.63-1.863 1.862c.3.15.57.3.841.421l-.796 1.037-.782 1.022-1.142-.601-3.621 3.62c-1.337 1.338-2.104 1.443-3.591.286l-1.097-.856 1.217-2.3 1.007.767c.45.36.826.196 1.232-.21l2.54-2.54c-.872-.42-1.624-.871-2.195-1.111l1.458-2.24c.721.391 1.623.932 2.614 1.473l2.405-2.404-1.398-1.397 1.848-1.849 1.398 1.398 2.103-2.104 1.698 1.848-2.028 2.029 1.052 1.052-1.142 1.142c1.728-.526 3.125-1.202 4.733-2.24Zm16.844 17.175 1.698 1.848-.766.766 3.185 3.186-1.653 1.652-3.185-3.185-.676.676-1.773-1.773.676-.676-2.885-2.885-.376.376.917 1.427-.752.3 6.657 6.657-1.623 1.623-7.483-7.483c-1.112.3-2.179.526-3.32.616l-6.191 6.19-1.728-1.727 4.432-4.433a27.952 27.952 0 0 1-2.509-.285l.857-2.66c2.193.42 4.282.466 6.31.15l-2.479-2.48 1.623-1.622 3.471 3.471.736-.285-.991-.992.646-.646-3.186-3.186 1.653-1.653 3.186 3.186.841-.842 1.728 1.879-.766.766 2.885 2.885.841-.841Zm-24.207-4.313-1.788-1.788-1.533 1.533 1.789 1.788 1.532-1.533Zm3.186-3.185-1.788-1.789-1.518 1.518 1.788 1.788 1.518-1.517Zm3.095-3.096-1.788-1.788-1.488 1.488 1.789 1.788 1.487-1.488Zm29.701-7.073a2.656 2.656 0 1 1-3.756 3.757 2.656 2.656 0 0 1 3.756-3.757Zm-5.635-5.634A2.656 2.656 0 1 1 77.4 43.6a2.656 2.656 0 0 1 3.756-3.756Zm-6.825-6.322a2.656 2.656 0 1 1-1.375 5.131 2.656 2.656 0 0 1 1.375-5.131Z", fill: "currentColor", fillRule: "evenodd" }) })));
|
|
16
|
+
};
|
|
17
|
+
export default RecommendIcon;
|
|
@@ -25,22 +25,38 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
25
25
|
}
|
|
26
26
|
return ar;
|
|
27
27
|
};
|
|
28
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
29
29
|
import RankingRange from '../RankingRange';
|
|
30
30
|
import Bar from './Bar';
|
|
31
|
+
import RecommendIcon from './RecommendIcon';
|
|
31
32
|
import { RefreshIconRoot, ScoreTypography, ScoreUnitTypography } from './styled';
|
|
33
|
+
import Tips from './Tips';
|
|
32
34
|
import { useAiReportStore } from "../../../../store/ai-report/global-store";
|
|
33
35
|
import { formatScore } from "../../../../utils/utils";
|
|
34
36
|
import dayjs from 'dayjs';
|
|
35
|
-
import {
|
|
37
|
+
import { SwitchIcon } from 'fbm-icons';
|
|
38
|
+
import { Box, Button, DownloadIcon, InfoOutlineIcon, Popover, Typography } from 'fbm-ui';
|
|
39
|
+
import { Stack } from 'fbm-ui/lib/mui';
|
|
36
40
|
import { useEffect, useState } from 'react';
|
|
41
|
+
var BackgroundImage = {
|
|
42
|
+
pro: 'https://webcdn.fbmms.cn/assets/DPXE/Oj-k12zdt9HuOrcEECDsm',
|
|
43
|
+
standard: 'https://webcdn.fbmms.cn/assets/S3uM/nAU25qJa6bVmZVHpcb11G',
|
|
44
|
+
};
|
|
45
|
+
var Colors = {
|
|
46
|
+
pro: '#86350F',
|
|
47
|
+
standard: '#4caf50',
|
|
48
|
+
};
|
|
49
|
+
var SwitchTitle = {
|
|
50
|
+
standard: '升级为高级版',
|
|
51
|
+
pro: '切换为标准版',
|
|
52
|
+
};
|
|
37
53
|
var Score = function (_a) {
|
|
38
|
-
var customScore = _a.customScore, loading = _a.loading, onRefresh = _a.onRefresh;
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
var
|
|
54
|
+
var customScore = _a.customScore, loading = _a.loading, onRefresh = _a.onRefresh, onSwitchReportModel = _a.onSwitchReportModel, _b = _a.model, model = _b === void 0 ? 'standard' : _b;
|
|
55
|
+
var _c = __read(useState(false), 2), openRankingRange = _c[0], setOpenRankingRange = _c[1];
|
|
56
|
+
var _d = __read(useState(false), 2), openRefresh = _d[0], setOpenRefresh = _d[1];
|
|
57
|
+
var _e = useAiReportStore(function (store) { return [store.reportResult, store.operableButtons]; }), reportResult = _e.reportResult, operableButtons = _e.operableButtons, onExportReportClick = _e.onExportReportClick;
|
|
58
|
+
var _f = reportResult || {}, score = _f.score, createTime = _f.createTime;
|
|
59
|
+
var _g = __read(useState(score || 0), 2), feScore = _g[0], setScore = _g[1];
|
|
44
60
|
useEffect(function () {
|
|
45
61
|
if (typeof customScore === 'number' && customScore > -1) {
|
|
46
62
|
setScore(customScore);
|
|
@@ -52,6 +68,30 @@ var Score = function (_a) {
|
|
|
52
68
|
setOpenRefresh(false);
|
|
53
69
|
}, [loading, customScore, score]);
|
|
54
70
|
var content = (_jsxs(Box, __assign({ padding: 2 }, { children: [_jsx(Typography, __assign({ variant: "body1", color: "secondary" }, { children: "\u5237\u65B0\u540E\u5C06\u6309\u6700\u65B0\u7B97\u5206\u89C4\u5219\u8BA1\u7B97\uFF0C\u662F\u5426\u786E\u8BA4\u5237\u65B0" })), _jsx(Box, __assign({ paddingTop: 1, textAlign: "right" }, { children: _jsx(Button, __assign({ loading: loading, onClick: onRefresh }, { children: "\u5237\u65B0" })) }))] })));
|
|
55
|
-
return (_jsxs(
|
|
71
|
+
return (_jsxs(Stack, __assign({ display: "flex", sx: {
|
|
72
|
+
px: 3,
|
|
73
|
+
height: 280,
|
|
74
|
+
background: "url('".concat(BackgroundImage[model], "') no-repeat center center / contain"),
|
|
75
|
+
} }, { children: [model === 'pro' && (_jsx(Box, __assign({ display: "flex", alignItems: "center", justifyContent: "center", width: 92, height: 30, sx: {
|
|
76
|
+
position: 'absolute',
|
|
77
|
+
top: 0,
|
|
78
|
+
left: 0,
|
|
79
|
+
backgroundColor: Colors[model],
|
|
80
|
+
borderBottomRightRadius: 16,
|
|
81
|
+
} }, { children: _jsx(Typography, __assign({ variant: "body2", fontWeight: "medium", color: "white" }, { children: "\u9AD8\u7CBE\u51C6\u5EA6" })) }))), _jsx(RankingRange, { open: openRankingRange, onClose: function () { return setOpenRankingRange(false); } }), _jsx(Stack, __assign({ direction: "row", py: 2, justifyContent: "flex-end", spacing: 1, alignContent: "center", color: Colors[model] }, { children: (operableButtons === null || operableButtons === void 0 ? void 0 : operableButtons.includes('export')) && (_jsxs(_Fragment, { children: [_jsx(Button, __assign({ variant: "outlined", size: "small", icon: _jsx(DownloadIcon, {}), sx: {
|
|
82
|
+
ml: 1,
|
|
83
|
+
color: 'inherit',
|
|
84
|
+
borderColor: 'inherit',
|
|
85
|
+
'&:hover': {
|
|
86
|
+
borderColor: 'inherit',
|
|
87
|
+
},
|
|
88
|
+
}, onClick: onExportReportClick }, { children: "\u5BFC\u51FA\u62A5\u544A" })), _jsx(Button, __assign({ variant: "outlined", size: "small", icon: _jsx(SwitchIcon, {}), sx: {
|
|
89
|
+
ml: 1,
|
|
90
|
+
color: 'inherit',
|
|
91
|
+
borderColor: 'inherit',
|
|
92
|
+
'&:hover': {
|
|
93
|
+
borderColor: 'inherit',
|
|
94
|
+
},
|
|
95
|
+
}, onClick: onSwitchReportModel }, { children: SwitchTitle[model] })), _jsx(Popover, __assign({ arrow: false, content: Tips }, { children: _jsx(InfoOutlineIcon, { htmlColor: "inherit", sx: { cursor: 'pointer' } }) }))] })) })), _jsxs(Box, __assign({ display: "flex", alignItems: "center", height: 80, color: Colors[model] }, { children: [_jsxs(Stack, __assign({ direction: "row", alignItems: "center" }, { children: [_jsx(ScoreTypography, __assign({ color: "inherit" }, { children: formatScore(feScore || 0) })), _jsx(ScoreUnitTypography, __assign({ color: "inherit", sx: { alignSelf: 'flex-end' } }, { children: "\u5206" }))] })), _jsx(Box, __assign({ width: 200, ml: 5, color: Colors[model] }, { children: _jsx(Bar, { model: model }) }))] })), _jsxs(Stack, __assign({ direction: "row", justifyContent: "space-between", color: Colors[model] }, { children: [_jsxs(Box, __assign({ display: "flex", alignItems: "center", mt: 1, sx: { alignSelf: 'flex-start' } }, { children: [(operableButtons === null || operableButtons === void 0 ? void 0 : operableButtons.includes('refresh')) && (_jsx(Popover, __assign({ open: openRefresh, content: content, onClickAway: function () { return setOpenRefresh(false); } }, { children: _jsx(RefreshIconRoot, { htmlColor: "inherit", onClick: function () { return setOpenRefresh(true); } }) }))), _jsxs(Typography, __assign({ variant: "caption", color: "inherit", ml: 0.5 }, { children: ["\u62A5\u544A\u751F\u6210\u4E8E ", dayjs(createTime && createTime * 1000).format('YYYY-MM-DD HH:mm')] })), (operableButtons === null || operableButtons === void 0 ? void 0 : operableButtons.includes('scoreRank')) && (_jsx(Typography, __assign({ color: "inherit", sx: { textDecoration: 'underline', cursor: 'pointer', ml: 1.5 }, onClick: function () { return setOpenRankingRange(true); } }, { children: "\u6392\u540D\u533A\u95F4\u8BBE\u7F6E" })))] })), _jsx(Box, __assign({ width: 120, height: 120, sx: { marginTop: -3 } }, { children: !!feScore && feScore >= 80 && _jsx(RecommendIcon, { size: 120, sx: { width: 120, height: 120 }, htmlColor: Colors[model] }) }))] }))] })));
|
|
56
96
|
};
|
|
57
97
|
export default Score;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { Typography } from 'fbm-ui';
|
|
14
|
+
import { Stack } from 'fbm-ui/lib/mui';
|
|
15
|
+
var Tips = function () {
|
|
16
|
+
return (_jsxs(Stack, __assign({ width: 588, spacing: 3, pl: 3, pr: 2, py: 3 }, { children: [_jsxs(Stack, __assign({ spacing: 2.5 }, { children: [_jsx(Typography, __assign({ color: "textSecondary" }, { children: "\u4E13\u4E1A\u7248\u8BF4\u660E" })), _jsx(Typography, __assign({ fontWeight: "medium" }, { children: "\u6CE8\u610F\uFF1A\u4E13\u4E1A\u7248\u62A5\u544A\u4EE5\u9AD8\u7EA7AI\u6280\u672F\u63D0\u4F9B\u66F4\u7CBE\u51C6\u8BC4\u4F30\uFF0C\u5C5E\u589E\u503C\u4EA7\u54C1\uFF0C\u6BCF\u4E13\u4E1A\u7248\u62A5\u544A\u6309\u6807\u51C6\u72482\u4EBA\u6B21\u8BA1\u8D39\uFF0C\u4EC5\u9996\u6B21\u5347\u7EA7\u6536\u8D39\u3002\u9ED8\u8BA4\u63D0\u4F9B\u6807\u51C6\u7248\uFF0C\u54A8\u8BE2\u5BA2\u6237\u987E\u95EE\u4E86\u89E3\u8D44\u8D39\u4F18\u60E0\u3002" }))] })), _jsxs(Stack, __assign({ spacing: 2.5 }, { children: [_jsx(Typography, __assign({ fontWeight: "medium" }, { children: "\u62A5\u544A\u8BF4\u660E" })), _jsxs(Stack, __assign({ spacing: 0.5 }, { children: [_jsx(Typography, __assign({ variant: "body2", color: "textSecondary" }, { children: "1.\u4E13\u4E1A\u7248\u62A5\u544A\u91C7\u7528\u4E86\u66F4\u4E3A\u9AD8\u7EA7\u7684AI\u7B97\u6CD5\u548C\u6280\u672F\uFF0C\u5728\u62E9\u4F18\u548C\u7565\u6C70\u65B9\u9762\u90FD\u80FD\u505A\u5230\u66F4\u9AD8\u51C6\u786E\u5EA6\u3002" })), _jsx(Typography, __assign({ variant: "body2", color: "textSecondary" }, { children: "2.\u5728\u6807\u51C6\u6D4B\u8BD5\u96C6\u4E2D\u7ECF\u8FC7\u591A\u6B21\u6D4B\u8BD5\u5F97\u51FA\uFF0C\u5982\u679C\u9898\u76EE\u8003\u6838\u7684\u80FD\u529B\u7684\u540D\u79F0\u548C\u80FD\u529B\u7684\u8BC4\u5206\u5173\u952E\u70B9\u5185\u5BB9\u66F4\u8D34\u5408\u9898\u76EE\u5185\u5BB9\uFF0C\u6253\u5206\u51C6\u786E\u5EA6\u4E5F\u4F1A\u66F4\u9AD8\u3002\u5728\u76F8\u540C\u7684\u80FD\u529B\u540D\u79F0\u548C\u8BC4\u5206\u5173\u952E\u70B9\u65F6\uFF0C\u4E13\u4E1A\u7248\u8F83\u6807\u51C6\u7248\u7684\u5206\u6570\u51C6\u786E\u5EA6\u63D0\u534721%\u3002" })), _jsx(Typography, __assign({ variant: "body2", color: "textSecondary" }, { children: "3.\u6807\u51C6\u6D4B\u8BD5\u96C6\u4E2D\u91C7\u7528\u7EBF\u4E0A\u771F\u5B9E\u6570\u636E\uFF0C\u4E14\u4FDD\u8BC1\u6570\u636E\u7684\u591A\u6837\u5316\uFF0C\u9002\u7528\u4E8E\u5404\u79CD\u62DB\u8058\u573A\u666F\u3002" })), _jsx(Typography, __assign({ variant: "body2", color: "textSecondary" }, { children: "4.\u4E0B\u9762\u6848\u4F8B\u80FD\u591F\u5E2E\u52A9\u7406\u89E3\u4E24\u4E2A\u7248\u672C\u7684\u5DEE\u5F02\uFF1A" })), _jsx(Typography, __assign({ variant: "body2", color: "textSecondary" }, { children: "\u95EE\u9898\uFF1A\u8BF7\u5206\u4EAB\u4E00\u4E0B\u60A8\u7684\u804C\u4E1A\u89C4\u5212\u548C\u76EE\u6807\uFF1F" })), _jsx(Typography, __assign({ variant: "body2", color: "textSecondary" }, { children: "\u5019\u9009\u4EBA\u56DE\u7B54\uFF1A\u9996\u5148\u662F\u5165\u804C\u4E00\u4EFD\u8DDF\u6211\u4E13\u4E1A\u76F8\u5173\u7684\u3002 \u5DE5\u4F5C\uFF0C\u7136\u540E\u3002 \u5728\u63A5\u4E0B\u6765\u7684\u51E0\u5E74\u3002 \u6728\u95E8\u3002 \u5C31\u662F\u7A33\u6B65\u5DE5\u4F5C\uFF0C\u7136\u540E\u6709\u6240\u5B66\u4E60\uFF0C\u7136\u540E\u6709\u6240\u6536\u83B7\u3002 \u5E76\u4E14\u3002 \u719F\u6089\u7684\u4E86\u89E3\u3002 \u6211\u6240\u5DE5\u4F5C\u7684\u6A21\u5757\u7684\u3002 \u6240\u6709\u6D41\u7A0B\uFF0C\u5E76\u4E14\u80FD\u5728\u5176\u4E2D\u83B7\u5F97\u4E00\u4E9B\u77E5\u8BC6" })), _jsx(Typography, __assign({ variant: "body2", color: "textSecondary" }, { children: "\u8003\u5BDF\u80FD\u529B\uFF1A\u804C\u4E1A\u89C4\u5212\u80FD\u529B" })), _jsx(Typography, __assign({ variant: "body2", color: "textSecondary" }, { children: "\u8BC4\u5206\u5173\u952E\u70B9\uFF1A\u9700\u8981\u5305\u542B\u5177\u4F53\u7684\u5DE5\u4F5C\u5B89\u6392\u7EC6\u8282\u3002\u5982\u679C\u5019\u9009\u4EBA\u7684\u89C4\u5212\u4E0D\u5177\u6709\u660E\u786E\u6027\u548C\u5B9E\u9645\u6027\uFF0C\u5219\u5C06\u5206\u6570\u6263\u51CF\u523070\u5206\u4EE5\u4E0B\uFF1B" }))] }))] })), _jsxs(Stack, __assign({ direction: "row", spacing: 2 }, { children: [_jsxs(Stack, __assign({ p: 2, flex: 1, spacing: 1, sx: { backgroundColor: '#FAFAFA', borderRadius: 2 } }, { children: [_jsx(Typography, __assign({ variant: "body2" }, { children: "\u57FA\u7840\u7248\uFF1A70\u5206" })), _jsx(Typography, __assign({ variant: "body2", color: "textSecondary" }, { children: "\u5019\u9009\u4EBA\u7684\u56DE\u7B54\u7F3A\u4E4F\u660E\u786E\u6027\u548C\u5B9E\u9645\u6027\uFF0C\u8868\u8FBE\u80FD\u529B\u4E5F\u8F83\u5DEE\uFF0C\u6CA1\u6709\u63D0\u4F9B\u5177\u4F53\u7684\u5DE5\u4F5C\u5B89\u6392\u7EC6\u8282\u3002\u9700\u8981\u5728\u8FD9\u65B9\u9762\u8FDB\u884C\u6539\u8FDB\u3002" }))] })), _jsxs(Stack, __assign({ p: 2, flex: 1, spacing: 1, sx: { backgroundColor: '#FAFAFA', borderRadius: 2 } }, { children: [_jsx(Typography, __assign({ variant: "body2" }, { children: "\u4E13\u4E1A\u7248\uFF1A60\u5206" })), _jsxs(Typography, __assign({ variant: "body2", color: "textSecondary" }, { children: ["\u5019\u9009\u4EBA\u7684\u56DE\u7B54\u867D\u7136\u8868\u8FBE\u4E86\u5BF9\u804C\u4E1A\u89C4\u5212\u7684\u4E00\u4E9B\u7406\u89E3\uFF0C\u4F46\u662F\u5728\u5B8C\u6574\u5EA6\u3001\u903B\u8F91\u6027\u548C\u8868\u8FBE\u80FD\u529B\u4E0A\u90FD\u5B58\u5728\u4E00\u5B9A\u7684\u95EE\u9898\uFF0C\u6CA1\u6709\u660E\u786E\u7684\u53D1\u5C55\u610F\u613F\u548C\u5BF9\u884C\u4E1A\u7684\u7406\u89E3\uFF0C\u4E5F\u6CA1\u6709\u8868\u73B0\u51FA\u5BF9\u751F\u6D3B\u7684\u70ED\u7231\u548C\u79EF\u6781\u7684\u6001\u5EA6\u3002", ' '] }))] }))] }))] })));
|
|
17
|
+
};
|
|
18
|
+
export default Tips;
|