eli-video-interview 1.2.33 → 1.2.34-beta.0
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/components/Charts/ReportPie.js +5 -1
- package/esm/modules/ai-ability/Root.d.ts +3 -2
- package/esm/modules/ai-ability/Root.js +10 -9
- package/esm/modules/ai-ability/components/AddAbility/index.js +3 -3
- package/esm/modules/ai-ability/components/UpdateAbility/index.js +3 -3
- package/esm/modules/ai-ability/index.d.ts +3 -2
- package/esm/modules/ai-ability/index.js +13 -2
- package/esm/modules/ai-ability/interface.d.ts +4 -0
- package/esm/modules/ai-question/components/AiAnalysis/AnalysisItem.js +1 -1
- package/esm/modules/ai-question/components/QuestionModel/Item.d.ts +1 -1
- package/esm/modules/ai-question/components/QuestionModel/Item.js +6 -4
- package/esm/modules/ai-report/components/VideoQuestion/Abilities.js +1 -1
- package/esm/modules/ai-report/components/VideoQuestion/ScoreSlider.d.ts +1 -1
- package/esm/modules/ai-report/components/VideoQuestion/ScoreSlider.js +6 -5
- package/esm/modules/ai-report/components/WorkPlaces/index.js +2 -1
- package/lib/components/Charts/ReportPie.js +5 -1
- package/lib/modules/ai-ability/Root.d.ts +3 -2
- package/lib/modules/ai-ability/Root.js +10 -9
- package/lib/modules/ai-ability/components/AddAbility/index.js +3 -3
- package/lib/modules/ai-ability/components/UpdateAbility/index.js +3 -3
- package/lib/modules/ai-ability/index.d.ts +3 -2
- package/lib/modules/ai-ability/index.js +13 -2
- package/lib/modules/ai-ability/interface.d.ts +4 -0
- package/lib/modules/ai-question/components/AiAnalysis/AnalysisItem.js +1 -1
- package/lib/modules/ai-question/components/QuestionModel/Item.d.ts +1 -1
- package/lib/modules/ai-question/components/QuestionModel/Item.js +6 -4
- package/lib/modules/ai-report/components/VideoQuestion/Abilities.js +1 -1
- package/lib/modules/ai-report/components/VideoQuestion/ScoreSlider.d.ts +1 -1
- package/lib/modules/ai-report/components/VideoQuestion/ScoreSlider.js +6 -5
- package/lib/modules/ai-report/components/WorkPlaces/index.js +2 -1
- package/package.json +1 -1
|
@@ -25,8 +25,12 @@ import { levelMapping } from './const';
|
|
|
25
25
|
import Chart from "./Chart";
|
|
26
26
|
var formateTitle = function (originalTitle) {
|
|
27
27
|
var regex = /(\d+?)[.](.+)/;
|
|
28
|
-
if (!regex.test(originalTitle))
|
|
28
|
+
if (!regex.test(originalTitle)) {
|
|
29
|
+
if (originalTitle.length > 7) {
|
|
30
|
+
originalTitle = "".concat(originalTitle.slice(0, 6), "...");
|
|
31
|
+
}
|
|
29
32
|
return originalTitle;
|
|
33
|
+
}
|
|
30
34
|
var _a = originalTitle.match(regex), no = _a[1];
|
|
31
35
|
return "\u7B2C".concat(no, "\u9898");
|
|
32
36
|
};
|
|
@@ -54,16 +54,17 @@ import { useRequest, useSetState } from 'ahooks';
|
|
|
54
54
|
import dayjs from 'dayjs';
|
|
55
55
|
import { AddIcon, Box, Button, confirm, DeleteIcon, DocumentIcon, Header, Link, Message, Table, Tooltip } from 'fbm-ui';
|
|
56
56
|
import { useCallback, useState } from 'react';
|
|
57
|
-
var AiAbilityRoot = function () {
|
|
58
|
-
var _a =
|
|
57
|
+
var AiAbilityRoot = function (_a) {
|
|
58
|
+
var _b = _a.ablilityNameLength, ablilityNameLength = _b === void 0 ? 30 : _b;
|
|
59
|
+
var _c = useSetState({
|
|
59
60
|
name: '',
|
|
60
61
|
token: '',
|
|
61
62
|
type: 3,
|
|
62
63
|
isWorkplace: false,
|
|
63
|
-
}), state =
|
|
64
|
-
var
|
|
65
|
-
var
|
|
66
|
-
var
|
|
64
|
+
}), state = _c[0], setState = _c[1];
|
|
65
|
+
var _d = useState(false), AddAbilityOpen = _d[0], setAddAbilityOpen = _d[1];
|
|
66
|
+
var _e = useState(false), UpdateAbilityOpen = _e[0], setUpdateAbilityOpen = _e[1];
|
|
67
|
+
var _f = useRequest(PostQuestionCollectionList), data = _f.data, getList = _f.run, listLoading = _f.loading;
|
|
67
68
|
var deleteList = useRequest(PostQuestionCollectionDelete, {
|
|
68
69
|
manual: true,
|
|
69
70
|
onSuccess: function () {
|
|
@@ -130,7 +131,7 @@ var AiAbilityRoot = function () {
|
|
|
130
131
|
label: '最后更新人',
|
|
131
132
|
render: function (_a) {
|
|
132
133
|
var cell = _a.cell, row = _a.row;
|
|
133
|
-
return _jsx(_Fragment, { children: row.type === 1 ? '-' : cell === null || cell === void 0 ? void 0 : cell.account });
|
|
134
|
+
return _jsx(_Fragment, { children: row.type === 1 ? '-' : (cell === null || cell === void 0 ? void 0 : cell.account) || '-' });
|
|
134
135
|
},
|
|
135
136
|
},
|
|
136
137
|
{
|
|
@@ -138,10 +139,10 @@ var AiAbilityRoot = function () {
|
|
|
138
139
|
label: '操作',
|
|
139
140
|
render: function (_a) {
|
|
140
141
|
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(
|
|
142
|
+
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(Box, __assign({ minWidth: "80px" }, { 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
143
|
},
|
|
143
144
|
},
|
|
144
145
|
];
|
|
145
|
-
return (_jsxs(AbilityRoot, { children: [AddAbilityOpen && _jsx(AddAbility, __assign({}, state, { open: AddAbilityOpen, onClose: handleClose, onSuccess: getList })), UpdateAbilityOpen && _jsx(UpdateAbility, __assign({}, state, { open: UpdateAbilityOpen, onClose: handleClose, onSuccess: getList })), _jsx(Header, { title: "\u8003\u5BDF\u80FD\u529B\u7BA1\u7406", renderAction: function () { return (_jsx(Button, __assign({ icon: _jsx(AddIcon, {}), onClick: handleAdd }, { children: "\u65B0\u589E\u80FD\u529B" }))); } }), _jsx(Box, __assign({ mt: 2, border: "1px solid rgba(0, 0, 0, 0.08)", borderRadius: 0.5, overflow: "hidden" }, { children: _jsx(Table, { emptyText: "\u6682\u65E0\u6570\u636E", nameText: "\u8003\u5BDF\u80FD\u529B", loading: listLoading, data: data === null || data === void 0 ? void 0 : data.data.list, columns: columns }) }))] }));
|
|
146
|
+
return (_jsxs(AbilityRoot, { children: [AddAbilityOpen && (_jsx(AddAbility, __assign({}, state, { open: AddAbilityOpen, ablilityNameLength: ablilityNameLength, onClose: handleClose, onSuccess: getList }))), UpdateAbilityOpen && (_jsx(UpdateAbility, __assign({}, state, { open: UpdateAbilityOpen, ablilityNameLength: ablilityNameLength, onClose: handleClose, onSuccess: getList }))), _jsx(Header, { title: "\u8003\u5BDF\u80FD\u529B\u7BA1\u7406", renderAction: function () { return (_jsx(Button, __assign({ icon: _jsx(AddIcon, {}), onClick: handleAdd }, { children: "\u65B0\u589E\u80FD\u529B" }))); } }), _jsx(Box, __assign({ mt: 2, border: "1px solid rgba(0, 0, 0, 0.08)", borderRadius: 0.5, overflow: "hidden" }, { children: _jsx(Table, { emptyText: "\u6682\u65E0\u6570\u636E", nameText: "\u8003\u5BDF\u80FD\u529B", loading: listLoading, data: data === null || data === void 0 ? void 0 : data.data.list, columns: columns }) }))] }));
|
|
146
147
|
};
|
|
147
148
|
export default AiAbilityRoot;
|
|
@@ -52,7 +52,7 @@ import { useRequest } from 'ahooks';
|
|
|
52
52
|
import { Box, Button, Drawer, Message, TextField, Typography, useTextField } from 'fbm-ui';
|
|
53
53
|
import { useCallback, useEffect, useState } from 'react';
|
|
54
54
|
var AddAbility = function (props) {
|
|
55
|
-
var open = props.open, _a = props.name, name = _a === void 0 ? '' : _a, _b = props.type, type = _b === void 0 ? 3 : _b, token = props.token, onClose = props.onClose, onSuccess = props.onSuccess;
|
|
55
|
+
var open = props.open, _a = props.name, name = _a === void 0 ? '' : _a, _b = props.type, type = _b === void 0 ? 3 : _b, ablilityNameLength = props.ablilityNameLength, token = props.token, onClose = props.onClose, onSuccess = props.onSuccess;
|
|
56
56
|
var _c = useState(''), value = _c[0], setValue = _c[1];
|
|
57
57
|
var _d = useState(1), step = _d[0], setStep = _d[1];
|
|
58
58
|
// const [stepLoading, setStepLoading] = useState<boolean>(false);
|
|
@@ -122,10 +122,10 @@ var AddAbility = function (props) {
|
|
|
122
122
|
},
|
|
123
123
|
],
|
|
124
124
|
onChange: function (e) { return setValue(e.target.value); },
|
|
125
|
-
max:
|
|
125
|
+
max: ablilityNameLength,
|
|
126
126
|
sx: {
|
|
127
127
|
height: '48px',
|
|
128
|
-
width: '
|
|
128
|
+
width: '100%',
|
|
129
129
|
marginTop: '16px',
|
|
130
130
|
},
|
|
131
131
|
});
|
|
@@ -53,7 +53,7 @@ import { useRequest } from 'ahooks';
|
|
|
53
53
|
import { Box, Button, Divider, Drawer, Message, TextField, Typography, useTextField } from 'fbm-ui';
|
|
54
54
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
55
55
|
var UpdateAbility = function (props) {
|
|
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;
|
|
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, ablilityNameLength = props.ablilityNameLength, token = props.token, onClose = props.onClose, onSuccess = props.onSuccess;
|
|
57
57
|
var _c = useState(''), value = _c[0], setValue = _c[1];
|
|
58
58
|
var _d = useState(1), step = _d[0], setStep = _d[1];
|
|
59
59
|
var _e = useState('show'), mode = _e[0], setMode = _e[1];
|
|
@@ -101,10 +101,10 @@ var UpdateAbility = function (props) {
|
|
|
101
101
|
},
|
|
102
102
|
],
|
|
103
103
|
onChange: function (e) { return setValue(e.target.value); },
|
|
104
|
-
max:
|
|
104
|
+
max: ablilityNameLength,
|
|
105
105
|
sx: {
|
|
106
106
|
height: '48px',
|
|
107
|
-
width: '
|
|
107
|
+
width: '100%',
|
|
108
108
|
marginTop: '16px',
|
|
109
109
|
},
|
|
110
110
|
});
|
|
@@ -1,7 +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
|
+
};
|
|
1
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
13
|
import AiAbilityRoot from './Root';
|
|
3
14
|
import RootProvider from "../../components/RootProvider";
|
|
4
|
-
var AiAbility = function () {
|
|
5
|
-
return (_jsx(RootProvider, { children: _jsx(AiAbilityRoot, {}) }));
|
|
15
|
+
var AiAbility = function (props) {
|
|
16
|
+
return (_jsx(RootProvider, { children: _jsx(AiAbilityRoot, __assign({}, props)) }));
|
|
6
17
|
};
|
|
7
18
|
export default AiAbility;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export interface AiAbilityProps {
|
|
2
|
+
ablilityNameLength?: number;
|
|
3
|
+
}
|
|
1
4
|
export interface QuestionCollectionList {
|
|
2
5
|
name: string;
|
|
3
6
|
token: string;
|
|
@@ -23,6 +26,7 @@ export interface AbilityProps {
|
|
|
23
26
|
isWorkplace?: boolean;
|
|
24
27
|
name?: string;
|
|
25
28
|
token?: string;
|
|
29
|
+
ablilityNameLength?: number;
|
|
26
30
|
onClose: () => void;
|
|
27
31
|
onSuccess: () => void;
|
|
28
32
|
}
|
|
@@ -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 && workplaceType === 3 && _jsx(Chip, { color: 'primary', label: '自定义', size: "small", sx: { ml: 1 } }), _jsx(Tooltip, __assign({ title: "".concat(desc), placement: "
|
|
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", style: { maxWidth: '158px', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' } }, { 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 && workplaceType === 3 && _jsx(Chip, { color: 'primary', label: '自定义', size: "small", sx: { ml: 1 } }), _jsx(Tooltip, __assign({ title: "".concat(desc), placement: "bottom-start" }, { 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;
|
|
@@ -21,13 +21,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
-
import { memo, useCallback } from 'react';
|
|
25
|
-
import { Box, Chip, confirm, DeleteIcon, DragIndicatorIcon, EditIcon, IconButton, Input, Switch, Typography } from 'fbm-ui';
|
|
26
|
-
import { Paper } from 'fbm-ui/lib/mui';
|
|
27
24
|
import { DISABLED_REPEAT_TYPE, IS_AI_ANALYSIS, TEST_TYPE_READONLY } from "../../../../constants/ai-question";
|
|
28
25
|
import { useQuestionModelStore } from "../../../../store/ai-question/question-model-store";
|
|
29
26
|
import { useUpdateQuestionStore } from "../../../../store/ai-question/question-update-store";
|
|
30
27
|
import { getSecondToTime } from "../../../../utils/utils";
|
|
28
|
+
import { Box, Chip, confirm, DeleteIcon, DragIndicatorIcon, EditIcon, IconButton, Input, Switch, Tooltip, Typography } from 'fbm-ui';
|
|
29
|
+
import { Paper } from 'fbm-ui/lib/mui';
|
|
30
|
+
import { memo, useCallback } from 'react';
|
|
31
31
|
var QuestionModelListItem = function (props) {
|
|
32
32
|
var index = props.index, disabledWeight = props.disabledWeight, steps = props.steps, step = __rest(props, ["index", "disabledWeight", "steps"]);
|
|
33
33
|
var token = step.token, name = step.name, desc = step.desc, duration = step.duration, weight = step.weight, type = step.type, aiShowType = step.aiShowType, aiType = step.aiType, answerStatus = step.answerStatus, category = step.category;
|
|
@@ -67,6 +67,8 @@ var QuestionModelListItem = function (props) {
|
|
|
67
67
|
console.log(answerStatus);
|
|
68
68
|
editModel(__assign(__assign({}, step), { answerStatus: answerStatus === 2 ? 1 : 2 }), index);
|
|
69
69
|
}, [editModel, answerStatus, step, index]);
|
|
70
|
-
return (_jsxs(Paper, __assign({ variant: "outlined", sx: { display: 'block', mt: 2 } }, { children: [_jsxs(Box, __assign({ display: "flex", borderBottom: isAiAnalysis ? '1px solid rgba(0, 0, 0, 0.08)' : 'none' }, { children: [_jsx(Box, __assign({ width: 40, display: "flex", alignItems: "center", justifyContent: "center", sx: { cursor: 'move' } }, { children: _jsx(DragIndicatorIcon, { className: "dragHandle" }) })), _jsxs(Box, __assign({ flex: "1 0", padding: "16px 0" }, { children: [_jsxs(Box, __assign({ display: "flex", justifyContent: "space-between" }, { children: [_jsxs(Box, __assign({ flex: "1 0", display: "flex", alignItems: "center" }, { children: [_jsx(Typography, __assign({ variant: "subtitle1" }, { children: name })), category === null || category === void 0 ? void 0 : category.map(function (label) {
|
|
70
|
+
return (_jsxs(Paper, __assign({ variant: "outlined", sx: { display: 'block', mt: 2 } }, { children: [_jsxs(Box, __assign({ display: "flex", borderBottom: isAiAnalysis ? '1px solid rgba(0, 0, 0, 0.08)' : 'none' }, { children: [_jsx(Box, __assign({ width: 40, display: "flex", alignItems: "center", justifyContent: "center", sx: { cursor: 'move' } }, { children: _jsx(DragIndicatorIcon, { className: "dragHandle" }) })), _jsxs(Box, __assign({ flex: "1 0", padding: "16px 0" }, { children: [_jsxs(Box, __assign({ display: "flex", justifyContent: "space-between" }, { children: [_jsxs(Box, __assign({ flex: "1 0", display: "flex", alignItems: "center" }, { children: [_jsx(Typography, __assign({ variant: "subtitle1" }, { children: name })), category === null || category === void 0 ? void 0 : category.map(function (label) {
|
|
71
|
+
return label && (_jsx(Tooltip, __assign({ title: "".concat(label), placement: "bottom" }, { children: _jsx(Chip, { color: "default", label: label, size: "medium", sx: { ml: 1, maxWidth: '158px', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' } }, label) })));
|
|
72
|
+
}), aiType === 2 && _jsx(Chip, { variant: "filled", color: "primary", label: "AI\u8BC4\u5206", size: "medium", sx: { ml: 1 } }), _jsx(Typography, __assign({ sx: { ml: 2 }, variant: "body2", color: "secondary" }, { children: getSecondToTime(Number(duration)) }))] })), _jsxs(Box, __assign({ width: 62, mr: 1, textAlign: "right" }, { children: [!TEST_TYPE_READONLY.includes(type) && (_jsx(IconButton, __assign({ size: "small", onClick: handleEdit }, { children: _jsx(EditIcon, {}) }))), _jsx(IconButton, __assign({ size: "small", onClick: handleRemove }, { children: _jsx(DeleteIcon, {}) }))] }))] })), _jsxs(Box, __assign({ mt: 1, display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: [_jsx(Typography, __assign({ variant: "body2", color: "secondary" }, { children: desc })), !DISABLED_REPEAT_TYPE.includes(type) && (_jsx(Switch, { sx: { flexShrink: 0, ml: 2, mr: 2 }, size: "small", checked: answerStatus === 1, label: _jsx(Typography, __assign({ fontSize: 12, lineHeight: 1.5, color: "rgba(0, 0, 0, 0.56)" }, { children: "\u5141\u8BB8\u91CD\u590D\u7B54\u9898" })), onChange: handleAnswerStatus }))] }))] }))] })), isAiAnalysis && (_jsxs(Box, __assign({ display: "flex", alignItems: "center", padding: "3px 0 3px 40px" }, { children: [_jsx(Typography, __assign({ variant: "body2" }, { children: "\u6743\u91CD\u5360\u6BD4\uFF1A" })), _jsx(Input, { sx: { width: 82 }, size: "small", value: weight, endAdornment: "%", disabled: disabledWeight, onChange: handleWeightChange, onBlur: handleWeightBlur })] })))] })));
|
|
71
73
|
};
|
|
72
74
|
export default memo(QuestionModelListItem);
|
|
@@ -34,7 +34,7 @@ var Abilities = function (_a) {
|
|
|
34
34
|
return (_jsxs(Box, __assign({ mt: 1 }, { children: [_jsx(Typography, __assign({ variant: "body2", color: "secondary", mb: 1 }, { children: "\u5206\u503C\u8BA1\u7B97\u89C4\u5219\uFF1A\u7EFC\u5408\u8BC4\u5206=AI\u8BC4\u5206*\u5355\u9898\u6743\u91CD" })), _jsx(Box, __assign({ mt: 3 }, { children: steps &&
|
|
35
35
|
steps[stepIndex].scoreInfo.abilities.map(function (_a, index) {
|
|
36
36
|
var name = _a.name, originScore = _a.originScore, finalScore = _a.finalScore;
|
|
37
|
-
return (_jsxs(Box, { children: [_jsx(Typography, __assign({ variant: "body2" }, { children: name })), _jsx(ScoreSlider, { width:
|
|
37
|
+
return (_jsxs(Box, { children: [_jsx(Typography, __assign({ variant: "body2" }, { children: name })), _jsx(ScoreSlider, { width: 420, isShowLabel: true, originScore: originScore, finalScore: finalScore, valueLabelDisplay: "auto", onChangeCommitted: function (score) { return handleChangeCommitted(score, index, 'ability'); } })] }, name));
|
|
38
38
|
}) }))] })));
|
|
39
39
|
};
|
|
40
40
|
export default Abilities;
|
|
@@ -10,21 +10,22 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
14
|
-
import { Tooltip, Typography } from 'fbm-ui';
|
|
15
|
-
import { useAiReportStore } from "../../../../store/ai-report/global-store";
|
|
16
13
|
import { AiScoreRoot, ScoreSliderRoot, StyledSlider } from './styled';
|
|
14
|
+
// import { scoreRankIntervalColors } from '@constants/ai-report';
|
|
15
|
+
import { useAiReportStore } from "../../../../store/ai-report/global-store";
|
|
16
|
+
import { Tooltip, Typography } from 'fbm-ui';
|
|
17
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
17
18
|
var ScoreSlider = function (props) {
|
|
18
19
|
var _a = props.width, width = _a === void 0 ? 320 : _a, originScore = props.originScore, finalScore = props.finalScore, _b = props.valueLabelDisplay, valueLabelDisplay = _b === void 0 ? 'on' : _b, _c = props.isShowLabel, isShowLabel = _c === void 0 ? false : _c, _d = props.isShowScoreRank, isShowScoreRank = _d === void 0 ? false : _d, onChangeCommitted = props.onChangeCommitted;
|
|
19
20
|
var aiScore = originScore.toFixed(0);
|
|
20
21
|
var _e = useState(0), score = _e[0], setScore = _e[1];
|
|
21
|
-
var
|
|
22
|
+
var disabledScore = useAiReportStore(function (store) { return [store.disabledScore, store.scoreRankIntervals]; }).disabledScore;
|
|
22
23
|
var handleScoreChange = useCallback(function (e, v) {
|
|
23
24
|
!disabledScore && setScore(v);
|
|
24
25
|
}, [disabledScore]);
|
|
25
26
|
useEffect(function () {
|
|
26
27
|
setScore(Number(finalScore.toFixed(0)));
|
|
27
28
|
}, [finalScore]);
|
|
28
|
-
return (_jsxs(ScoreSliderRoot, __assign({ width: width }, { children: [isShowScoreRank && (_jsx(_Fragment, { children: _jsx(Tooltip, __assign({ title: "AI\u5F97\u5206\uFF1A".concat(aiScore), placement: "top" }, { children: _jsx(AiScoreRoot, { sx: { left: "calc(".concat(aiScore, "% - 12px)") } }) })) })), _jsx(StyledSlider, { valueLabelDisplay: valueLabelDisplay, value: score, onChange: handleScoreChange, onChangeCommitted: function () { return onChangeCommitted(score); } }), isShowLabel && (_jsxs(Typography, __assign({ width:
|
|
29
|
+
return (_jsxs(ScoreSliderRoot, __assign({ width: width }, { children: [isShowScoreRank && (_jsx(_Fragment, { children: _jsx(Tooltip, __assign({ title: "AI\u5F97\u5206\uFF1A".concat(aiScore), placement: "top" }, { children: _jsx(AiScoreRoot, { sx: { left: "calc(".concat(aiScore, "% - 12px)") } }) })) })), _jsx(StyledSlider, { valueLabelDisplay: valueLabelDisplay, value: score, onChange: handleScoreChange, onChangeCommitted: function () { return onChangeCommitted(score); } }), isShowLabel && (_jsxs(Typography, __assign({ width: 70, flexShrink: 0, textAlign: "right", variant: "body2" }, { children: [score, "\u5206"] })))] })));
|
|
29
30
|
};
|
|
30
31
|
export default ScoreSlider;
|
|
@@ -23,6 +23,7 @@ var TagTitle = styled(Box)(function (bgcolor) { return ({
|
|
|
23
23
|
padding: '0 16px',
|
|
24
24
|
minWidth: 100,
|
|
25
25
|
height: 32,
|
|
26
|
+
flexGrow: 1,
|
|
26
27
|
display: 'inline-block',
|
|
27
28
|
textAlign: 'center',
|
|
28
29
|
backgroundColor: bgcolor[200],
|
|
@@ -62,7 +63,7 @@ var Index = function () {
|
|
|
62
63
|
if (!showAiDimension)
|
|
63
64
|
return null;
|
|
64
65
|
return (_jsxs(Box, __assign({ id: "report-workplace", component: Paper, variant: "outlined", px: 2, mt: 2 }, { children: [_jsx(Stack, __assign({ direction: "row", height: 56, alignItems: "center", spacing: 1, marginBottom: 1 }, { children: _jsx(AiHeaderTitle, { name: "\u804C\u573A\u80FD\u529B\u8868\u73B0" }) })), _jsx(Collapse, __assign({ in: true }, { children: (_a = reportResult === null || reportResult === void 0 ? void 0 : reportResult.workplaces) === null || _a === void 0 ? void 0 : _a.map(function (v, idx) {
|
|
65
|
-
return (_jsxs(Box, __assign({ component: Paper, variant: "outlined", elevation: 0, mb: 2, pb: 2, pr: 2 }, { children: [_jsxs(Box, __assign({ display: "flex", justifyContent: "space-between", alignItems: "center" }, { children: [_jsxs(Box, __assign({ display: "flex", alignItems: "center",
|
|
66
|
+
return (_jsxs(Box, __assign({ component: Paper, variant: "outlined", elevation: 0, mb: 2, pb: 2, pr: 2 }, { children: [_jsxs(Box, __assign({ display: "flex", mb: 2, mt: 1, justifyContent: "space-between", alignItems: "center" }, { children: [_jsxs(Box, __assign({ display: "flex", alignItems: "center", maxWidth: "calc(100% - 90px)" }, { children: [_jsx(TagTitle, __assign({ bgcolor: ColorIndexMap[idx % 3][200] }, { children: _jsx(Typography, __assign({ variant: "subtitle1", fontWeight: "medium", style: { lineHeight: '32px', color: '#fff', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' } }, { children: v.dimensionName })) })), v.dimensionType === 3 && _jsx(Chip, { color: 'primary', label: '自定义', size: "small", sx: { ml: 1 } })] })), _jsx(Tooltip, __assign({ title: _jsxs("span", { children: ["\u9AD8\u5206\u8868\u73B0\uFF1A", v.abilityExpression.good, _jsx("br", {}), "\u4F4E\u5206\u8868\u73B0\uFF1A", v.abilityExpression.bad] }) }, { children: _jsxs(Box, __assign({ display: "flex", alignItems: "center" }, { children: [_jsx(Typography, __assign({ variant: "body2", style: { lineHeight: '32px' }, mr: 1 }, { children: "\u4F18\u6B21\u8868\u73B0" })), _jsx(InfoOutlineIcon, { sx: { fontSize: '16px' } })] })) }))] })), _jsx(Typography, __assign({ variant: "body2", color: "secondary", ml: 2, style: { background: '#F5F5F5', borderRadius: 4, padding: 8 } }, { children: v.define })), _jsxs(Stack, __assign({ pl: 2 }, { children: [_jsx(Box, __assign({ mt: 2 }, { children: _jsx(ScoreSlider, { width: "100%", isShowLabel: true, score: v.score, scoreText: v.scoreText, scoreLevel: v.scoreLevel }) })), _jsx(Stack, __assign({ spacing: 2 }, { children: _jsx(WorkPlace, { token: v.token, canEdit: canEditAiDimension, answer: v.answer, mode: "show", bgcolor: ColorIndexMap[idx % 3][50] }) }))] }))] }), v.token));
|
|
66
67
|
}) }))] })));
|
|
67
68
|
};
|
|
68
69
|
export default Index;
|
|
@@ -30,8 +30,12 @@ var const_1 = require("./const");
|
|
|
30
30
|
var Chart_1 = __importDefault(require("./Chart"));
|
|
31
31
|
var formateTitle = function (originalTitle) {
|
|
32
32
|
var regex = /(\d+?)[.](.+)/;
|
|
33
|
-
if (!regex.test(originalTitle))
|
|
33
|
+
if (!regex.test(originalTitle)) {
|
|
34
|
+
if (originalTitle.length > 7) {
|
|
35
|
+
originalTitle = "".concat(originalTitle.slice(0, 6), "...");
|
|
36
|
+
}
|
|
34
37
|
return originalTitle;
|
|
38
|
+
}
|
|
35
39
|
var _a = originalTitle.match(regex), no = _a[1];
|
|
36
40
|
return "\u7B2C".concat(no, "\u9898");
|
|
37
41
|
};
|
|
@@ -59,16 +59,17 @@ var ahooks_1 = require("ahooks");
|
|
|
59
59
|
var dayjs_1 = __importDefault(require("dayjs"));
|
|
60
60
|
var fbm_ui_1 = require("fbm-ui");
|
|
61
61
|
var react_1 = require("react");
|
|
62
|
-
var AiAbilityRoot = function () {
|
|
63
|
-
var _a =
|
|
62
|
+
var AiAbilityRoot = function (_a) {
|
|
63
|
+
var _b = _a.ablilityNameLength, ablilityNameLength = _b === void 0 ? 30 : _b;
|
|
64
|
+
var _c = (0, ahooks_1.useSetState)({
|
|
64
65
|
name: '',
|
|
65
66
|
token: '',
|
|
66
67
|
type: 3,
|
|
67
68
|
isWorkplace: false,
|
|
68
|
-
}), state =
|
|
69
|
-
var
|
|
70
|
-
var
|
|
71
|
-
var
|
|
69
|
+
}), state = _c[0], setState = _c[1];
|
|
70
|
+
var _d = (0, react_1.useState)(false), AddAbilityOpen = _d[0], setAddAbilityOpen = _d[1];
|
|
71
|
+
var _e = (0, react_1.useState)(false), UpdateAbilityOpen = _e[0], setUpdateAbilityOpen = _e[1];
|
|
72
|
+
var _f = (0, ahooks_1.useRequest)(ai_ability_1.PostQuestionCollectionList), data = _f.data, getList = _f.run, listLoading = _f.loading;
|
|
72
73
|
var deleteList = (0, ahooks_1.useRequest)(ai_ability_1.PostQuestionCollectionDelete, {
|
|
73
74
|
manual: true,
|
|
74
75
|
onSuccess: function () {
|
|
@@ -135,7 +136,7 @@ var AiAbilityRoot = function () {
|
|
|
135
136
|
label: '最后更新人',
|
|
136
137
|
render: function (_a) {
|
|
137
138
|
var cell = _a.cell, row = _a.row;
|
|
138
|
-
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: row.type === 1 ? '-' : cell === null || cell === void 0 ? void 0 : cell.account });
|
|
139
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: row.type === 1 ? '-' : (cell === null || cell === void 0 ? void 0 : cell.account) || '-' });
|
|
139
140
|
},
|
|
140
141
|
},
|
|
141
142
|
{
|
|
@@ -143,10 +144,10 @@ var AiAbilityRoot = function () {
|
|
|
143
144
|
label: '操作',
|
|
144
145
|
render: function (_a) {
|
|
145
146
|
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)(
|
|
147
|
+
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)(fbm_ui_1.Box, __assign({ minWidth: "80px" }, { 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
148
|
},
|
|
148
149
|
},
|
|
149
150
|
];
|
|
150
|
-
return ((0, jsx_runtime_1.jsxs)(styled_1.AbilityRoot, { children: [AddAbilityOpen && (0, jsx_runtime_1.jsx)(AddAbility_1.default, __assign({}, state, { open: AddAbilityOpen, onClose: handleClose, onSuccess: getList })), UpdateAbilityOpen && (0, jsx_runtime_1.jsx)(UpdateAbility_1.default, __assign({}, state, { open: UpdateAbilityOpen, onClose: handleClose, onSuccess: getList })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Header, { title: "\u8003\u5BDF\u80FD\u529B\u7BA1\u7406", renderAction: function () { return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ icon: (0, jsx_runtime_1.jsx)(fbm_ui_1.AddIcon, {}), onClick: handleAdd }, { children: "\u65B0\u589E\u80FD\u529B" }))); } }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ mt: 2, border: "1px solid rgba(0, 0, 0, 0.08)", borderRadius: 0.5, overflow: "hidden" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Table, { emptyText: "\u6682\u65E0\u6570\u636E", nameText: "\u8003\u5BDF\u80FD\u529B", loading: listLoading, data: data === null || data === void 0 ? void 0 : data.data.list, columns: columns }) }))] }));
|
|
151
|
+
return ((0, jsx_runtime_1.jsxs)(styled_1.AbilityRoot, { children: [AddAbilityOpen && ((0, jsx_runtime_1.jsx)(AddAbility_1.default, __assign({}, state, { open: AddAbilityOpen, ablilityNameLength: ablilityNameLength, onClose: handleClose, onSuccess: getList }))), UpdateAbilityOpen && ((0, jsx_runtime_1.jsx)(UpdateAbility_1.default, __assign({}, state, { open: UpdateAbilityOpen, ablilityNameLength: ablilityNameLength, onClose: handleClose, onSuccess: getList }))), (0, jsx_runtime_1.jsx)(fbm_ui_1.Header, { title: "\u8003\u5BDF\u80FD\u529B\u7BA1\u7406", renderAction: function () { return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ icon: (0, jsx_runtime_1.jsx)(fbm_ui_1.AddIcon, {}), onClick: handleAdd }, { children: "\u65B0\u589E\u80FD\u529B" }))); } }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ mt: 2, border: "1px solid rgba(0, 0, 0, 0.08)", borderRadius: 0.5, overflow: "hidden" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Table, { emptyText: "\u6682\u65E0\u6570\u636E", nameText: "\u8003\u5BDF\u80FD\u529B", loading: listLoading, data: data === null || data === void 0 ? void 0 : data.data.list, columns: columns }) }))] }));
|
|
151
152
|
};
|
|
152
153
|
exports.default = AiAbilityRoot;
|
|
@@ -57,7 +57,7 @@ var ahooks_1 = require("ahooks");
|
|
|
57
57
|
var fbm_ui_1 = require("fbm-ui");
|
|
58
58
|
var react_1 = require("react");
|
|
59
59
|
var AddAbility = function (props) {
|
|
60
|
-
var open = props.open, _a = props.name, name = _a === void 0 ? '' : _a, _b = props.type, type = _b === void 0 ? 3 : _b, token = props.token, onClose = props.onClose, onSuccess = props.onSuccess;
|
|
60
|
+
var open = props.open, _a = props.name, name = _a === void 0 ? '' : _a, _b = props.type, type = _b === void 0 ? 3 : _b, ablilityNameLength = props.ablilityNameLength, token = props.token, onClose = props.onClose, onSuccess = props.onSuccess;
|
|
61
61
|
var _c = (0, react_1.useState)(''), value = _c[0], setValue = _c[1];
|
|
62
62
|
var _d = (0, react_1.useState)(1), step = _d[0], setStep = _d[1];
|
|
63
63
|
// const [stepLoading, setStepLoading] = useState<boolean>(false);
|
|
@@ -127,10 +127,10 @@ var AddAbility = function (props) {
|
|
|
127
127
|
},
|
|
128
128
|
],
|
|
129
129
|
onChange: function (e) { return setValue(e.target.value); },
|
|
130
|
-
max:
|
|
130
|
+
max: ablilityNameLength,
|
|
131
131
|
sx: {
|
|
132
132
|
height: '48px',
|
|
133
|
-
width: '
|
|
133
|
+
width: '100%',
|
|
134
134
|
marginTop: '16px',
|
|
135
135
|
},
|
|
136
136
|
});
|
|
@@ -58,7 +58,7 @@ var ahooks_1 = require("ahooks");
|
|
|
58
58
|
var fbm_ui_1 = require("fbm-ui");
|
|
59
59
|
var react_1 = require("react");
|
|
60
60
|
var UpdateAbility = function (props) {
|
|
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;
|
|
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, ablilityNameLength = props.ablilityNameLength, token = props.token, onClose = props.onClose, onSuccess = props.onSuccess;
|
|
62
62
|
var _c = (0, react_1.useState)(''), value = _c[0], setValue = _c[1];
|
|
63
63
|
var _d = (0, react_1.useState)(1), step = _d[0], setStep = _d[1];
|
|
64
64
|
var _e = (0, react_1.useState)('show'), mode = _e[0], setMode = _e[1];
|
|
@@ -106,10 +106,10 @@ var UpdateAbility = function (props) {
|
|
|
106
106
|
},
|
|
107
107
|
],
|
|
108
108
|
onChange: function (e) { return setValue(e.target.value); },
|
|
109
|
-
max:
|
|
109
|
+
max: ablilityNameLength,
|
|
110
110
|
sx: {
|
|
111
111
|
height: '48px',
|
|
112
|
-
width: '
|
|
112
|
+
width: '100%',
|
|
113
113
|
marginTop: '16px',
|
|
114
114
|
},
|
|
115
115
|
});
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
2
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
15
|
};
|
|
@@ -6,7 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
18
|
var Root_1 = __importDefault(require("./Root"));
|
|
8
19
|
var RootProvider_1 = __importDefault(require("../../components/RootProvider"));
|
|
9
|
-
var AiAbility = function () {
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)(RootProvider_1.default, { children: (0, jsx_runtime_1.jsx)(Root_1.default, {}) }));
|
|
20
|
+
var AiAbility = function (props) {
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)(RootProvider_1.default, { children: (0, jsx_runtime_1.jsx)(Root_1.default, __assign({}, props)) }));
|
|
11
22
|
};
|
|
12
23
|
exports.default = AiAbility;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export interface AiAbilityProps {
|
|
2
|
+
ablilityNameLength?: number;
|
|
3
|
+
}
|
|
1
4
|
export interface QuestionCollectionList {
|
|
2
5
|
name: string;
|
|
3
6
|
token: string;
|
|
@@ -23,6 +26,7 @@ export interface AbilityProps {
|
|
|
23
26
|
isWorkplace?: boolean;
|
|
24
27
|
name?: string;
|
|
25
28
|
token?: string;
|
|
29
|
+
ablilityNameLength?: number;
|
|
26
30
|
onClose: () => void;
|
|
27
31
|
onSuccess: () => void;
|
|
28
32
|
}
|
|
@@ -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 && workplaceType === 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: "
|
|
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", style: { maxWidth: '158px', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' } }, { 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 && workplaceType === 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: "bottom-start" }, { 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;
|
|
@@ -23,13 +23,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
26
|
-
var react_1 = require("react");
|
|
27
|
-
var fbm_ui_1 = require("fbm-ui");
|
|
28
|
-
var mui_1 = require("fbm-ui/lib/mui");
|
|
29
26
|
var ai_question_1 = require("../../../../constants/ai-question");
|
|
30
27
|
var question_model_store_1 = require("../../../../store/ai-question/question-model-store");
|
|
31
28
|
var question_update_store_1 = require("../../../../store/ai-question/question-update-store");
|
|
32
29
|
var utils_1 = require("../../../../utils/utils");
|
|
30
|
+
var fbm_ui_1 = require("fbm-ui");
|
|
31
|
+
var mui_1 = require("fbm-ui/lib/mui");
|
|
32
|
+
var react_1 = require("react");
|
|
33
33
|
var QuestionModelListItem = function (props) {
|
|
34
34
|
var index = props.index, disabledWeight = props.disabledWeight, steps = props.steps, step = __rest(props, ["index", "disabledWeight", "steps"]);
|
|
35
35
|
var token = step.token, name = step.name, desc = step.desc, duration = step.duration, weight = step.weight, type = step.type, aiShowType = step.aiShowType, aiType = step.aiType, answerStatus = step.answerStatus, category = step.category;
|
|
@@ -69,6 +69,8 @@ var QuestionModelListItem = function (props) {
|
|
|
69
69
|
console.log(answerStatus);
|
|
70
70
|
editModel(__assign(__assign({}, step), { answerStatus: answerStatus === 2 ? 1 : 2 }), index);
|
|
71
71
|
}, [editModel, answerStatus, step, index]);
|
|
72
|
-
return ((0, jsx_runtime_1.jsxs)(mui_1.Paper, __assign({ variant: "outlined", sx: { display: 'block', mt: 2 } }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", borderBottom: isAiAnalysis ? '1px solid rgba(0, 0, 0, 0.08)' : 'none' }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ width: 40, display: "flex", alignItems: "center", justifyContent: "center", sx: { cursor: 'move' } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.DragIndicatorIcon, { className: "dragHandle" }) })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ flex: "1 0", padding: "16px 0" }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ flex: "1 0", display: "flex", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "subtitle1" }, { children: name })), category === null || category === void 0 ? void 0 : category.map(function (label) {
|
|
72
|
+
return ((0, jsx_runtime_1.jsxs)(mui_1.Paper, __assign({ variant: "outlined", sx: { display: 'block', mt: 2 } }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", borderBottom: isAiAnalysis ? '1px solid rgba(0, 0, 0, 0.08)' : 'none' }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ width: 40, display: "flex", alignItems: "center", justifyContent: "center", sx: { cursor: 'move' } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.DragIndicatorIcon, { className: "dragHandle" }) })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ flex: "1 0", padding: "16px 0" }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ flex: "1 0", display: "flex", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "subtitle1" }, { children: name })), category === null || category === void 0 ? void 0 : category.map(function (label) {
|
|
73
|
+
return label && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: "".concat(label), placement: "bottom" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Chip, { color: "default", label: label, size: "medium", sx: { ml: 1, maxWidth: '158px', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' } }, label) })));
|
|
74
|
+
}), aiType === 2 && (0, jsx_runtime_1.jsx)(fbm_ui_1.Chip, { variant: "filled", color: "primary", label: "AI\u8BC4\u5206", size: "medium", sx: { ml: 1 } }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ sx: { ml: 2 }, variant: "body2", color: "secondary" }, { children: (0, utils_1.getSecondToTime)(Number(duration)) }))] })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ width: 62, mr: 1, textAlign: "right" }, { children: [!ai_question_1.TEST_TYPE_READONLY.includes(type) && ((0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ size: "small", onClick: handleEdit }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.EditIcon, {}) }))), (0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ size: "small", onClick: handleRemove }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.DeleteIcon, {}) }))] }))] })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ mt: 1, display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "secondary" }, { children: desc })), !ai_question_1.DISABLED_REPEAT_TYPE.includes(type) && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Switch, { sx: { flexShrink: 0, ml: 2, mr: 2 }, size: "small", checked: answerStatus === 1, label: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ fontSize: 12, lineHeight: 1.5, color: "rgba(0, 0, 0, 0.56)" }, { children: "\u5141\u8BB8\u91CD\u590D\u7B54\u9898" })), onChange: handleAnswerStatus }))] }))] }))] })), isAiAnalysis && ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", padding: "3px 0 3px 40px" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2" }, { children: "\u6743\u91CD\u5360\u6BD4\uFF1A" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Input, { sx: { width: 82 }, size: "small", value: weight, endAdornment: "%", disabled: disabledWeight, onChange: handleWeightChange, onBlur: handleWeightBlur })] })))] })));
|
|
73
75
|
};
|
|
74
76
|
exports.default = (0, react_1.memo)(QuestionModelListItem);
|
|
@@ -39,7 +39,7 @@ var Abilities = function (_a) {
|
|
|
39
39
|
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ mt: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "secondary", mb: 1 }, { children: "\u5206\u503C\u8BA1\u7B97\u89C4\u5219\uFF1A\u7EFC\u5408\u8BC4\u5206=AI\u8BC4\u5206*\u5355\u9898\u6743\u91CD" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ mt: 3 }, { children: steps &&
|
|
40
40
|
steps[stepIndex].scoreInfo.abilities.map(function (_a, index) {
|
|
41
41
|
var name = _a.name, originScore = _a.originScore, finalScore = _a.finalScore;
|
|
42
|
-
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2" }, { children: name })), (0, jsx_runtime_1.jsx)(ScoreSlider_1.default, { width:
|
|
42
|
+
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2" }, { children: name })), (0, jsx_runtime_1.jsx)(ScoreSlider_1.default, { width: 420, isShowLabel: true, originScore: originScore, finalScore: finalScore, valueLabelDisplay: "auto", onChangeCommitted: function (score) { return handleChangeCommitted(score, index, 'ability'); } })] }, name));
|
|
43
43
|
}) }))] })));
|
|
44
44
|
};
|
|
45
45
|
exports.default = Abilities;
|
|
@@ -12,21 +12,22 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
|
-
var react_1 = require("react");
|
|
16
|
-
var fbm_ui_1 = require("fbm-ui");
|
|
17
|
-
var global_store_1 = require("../../../../store/ai-report/global-store");
|
|
18
15
|
var styled_1 = require("./styled");
|
|
16
|
+
// import { scoreRankIntervalColors } from '@constants/ai-report';
|
|
17
|
+
var global_store_1 = require("../../../../store/ai-report/global-store");
|
|
18
|
+
var fbm_ui_1 = require("fbm-ui");
|
|
19
|
+
var react_1 = require("react");
|
|
19
20
|
var ScoreSlider = function (props) {
|
|
20
21
|
var _a = props.width, width = _a === void 0 ? 320 : _a, originScore = props.originScore, finalScore = props.finalScore, _b = props.valueLabelDisplay, valueLabelDisplay = _b === void 0 ? 'on' : _b, _c = props.isShowLabel, isShowLabel = _c === void 0 ? false : _c, _d = props.isShowScoreRank, isShowScoreRank = _d === void 0 ? false : _d, onChangeCommitted = props.onChangeCommitted;
|
|
21
22
|
var aiScore = originScore.toFixed(0);
|
|
22
23
|
var _e = (0, react_1.useState)(0), score = _e[0], setScore = _e[1];
|
|
23
|
-
var
|
|
24
|
+
var disabledScore = (0, global_store_1.useAiReportStore)(function (store) { return [store.disabledScore, store.scoreRankIntervals]; }).disabledScore;
|
|
24
25
|
var handleScoreChange = (0, react_1.useCallback)(function (e, v) {
|
|
25
26
|
!disabledScore && setScore(v);
|
|
26
27
|
}, [disabledScore]);
|
|
27
28
|
(0, react_1.useEffect)(function () {
|
|
28
29
|
setScore(Number(finalScore.toFixed(0)));
|
|
29
30
|
}, [finalScore]);
|
|
30
|
-
return ((0, jsx_runtime_1.jsxs)(styled_1.ScoreSliderRoot, __assign({ width: width }, { children: [isShowScoreRank && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: "AI\u5F97\u5206\uFF1A".concat(aiScore), placement: "top" }, { children: (0, jsx_runtime_1.jsx)(styled_1.AiScoreRoot, { sx: { left: "calc(".concat(aiScore, "% - 12px)") } }) })) })), (0, jsx_runtime_1.jsx)(styled_1.StyledSlider, { valueLabelDisplay: valueLabelDisplay, value: score, onChange: handleScoreChange, onChangeCommitted: function () { return onChangeCommitted(score); } }), isShowLabel && ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ width:
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)(styled_1.ScoreSliderRoot, __assign({ width: width }, { children: [isShowScoreRank && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: "AI\u5F97\u5206\uFF1A".concat(aiScore), placement: "top" }, { children: (0, jsx_runtime_1.jsx)(styled_1.AiScoreRoot, { sx: { left: "calc(".concat(aiScore, "% - 12px)") } }) })) })), (0, jsx_runtime_1.jsx)(styled_1.StyledSlider, { valueLabelDisplay: valueLabelDisplay, value: score, onChange: handleScoreChange, onChangeCommitted: function () { return onChangeCommitted(score); } }), isShowLabel && ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ width: 70, flexShrink: 0, textAlign: "right", variant: "body2" }, { children: [score, "\u5206"] })))] })));
|
|
31
32
|
};
|
|
32
33
|
exports.default = ScoreSlider;
|
|
@@ -28,6 +28,7 @@ var TagTitle = (0, fbm_ui_1.styled)(mui_1.Box)(function (bgcolor) { return ({
|
|
|
28
28
|
padding: '0 16px',
|
|
29
29
|
minWidth: 100,
|
|
30
30
|
height: 32,
|
|
31
|
+
flexGrow: 1,
|
|
31
32
|
display: 'inline-block',
|
|
32
33
|
textAlign: 'center',
|
|
33
34
|
backgroundColor: bgcolor[200],
|
|
@@ -67,7 +68,7 @@ var Index = function () {
|
|
|
67
68
|
if (!showAiDimension)
|
|
68
69
|
return null;
|
|
69
70
|
return ((0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ id: "report-workplace", component: mui_1.Paper, variant: "outlined", px: 2, mt: 2 }, { children: [(0, jsx_runtime_1.jsx)(mui_1.Stack, __assign({ direction: "row", height: 56, alignItems: "center", spacing: 1, marginBottom: 1 }, { children: (0, jsx_runtime_1.jsx)(AiHeaderTitle_1.default, { name: "\u804C\u573A\u80FD\u529B\u8868\u73B0" }) })), (0, jsx_runtime_1.jsx)(mui_1.Collapse, __assign({ in: true }, { children: (_a = reportResult === null || reportResult === void 0 ? void 0 : reportResult.workplaces) === null || _a === void 0 ? void 0 : _a.map(function (v, idx) {
|
|
70
|
-
return ((0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ component: mui_1.Paper, variant: "outlined", elevation: 0, mb: 2, pb: 2, pr: 2 }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ display: "flex", justifyContent: "space-between", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ display: "flex", alignItems: "center",
|
|
71
|
+
return ((0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ component: mui_1.Paper, variant: "outlined", elevation: 0, mb: 2, pb: 2, pr: 2 }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ display: "flex", mb: 2, mt: 1, justifyContent: "space-between", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ display: "flex", alignItems: "center", maxWidth: "calc(100% - 90px)" }, { children: [(0, jsx_runtime_1.jsx)(TagTitle, __assign({ bgcolor: ColorIndexMap[idx % 3][200] }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "subtitle1", fontWeight: "medium", style: { lineHeight: '32px', color: '#fff', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' } }, { children: v.dimensionName })) })), v.dimensionType === 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: (0, jsx_runtime_1.jsxs)("span", { children: ["\u9AD8\u5206\u8868\u73B0\uFF1A", v.abilityExpression.good, (0, jsx_runtime_1.jsx)("br", {}), "\u4F4E\u5206\u8868\u73B0\uFF1A", v.abilityExpression.bad] }) }, { children: (0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ display: "flex", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", style: { lineHeight: '32px' }, mr: 1 }, { children: "\u4F18\u6B21\u8868\u73B0" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.InfoOutlineIcon, { sx: { fontSize: '16px' } })] })) }))] })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "secondary", ml: 2, style: { background: '#F5F5F5', borderRadius: 4, padding: 8 } }, { children: v.define })), (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ pl: 2 }, { children: [(0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ mt: 2 }, { children: (0, jsx_runtime_1.jsx)(ScoreSlider_1.default, { width: "100%", isShowLabel: true, score: v.score, scoreText: v.scoreText, scoreLevel: v.scoreLevel }) })), (0, jsx_runtime_1.jsx)(mui_1.Stack, __assign({ spacing: 2 }, { children: (0, jsx_runtime_1.jsx)(WorkPlace_1.default, { token: v.token, canEdit: canEditAiDimension, answer: v.answer, mode: "show", bgcolor: ColorIndexMap[idx % 3][50] }) }))] }))] }), v.token));
|
|
71
72
|
}) }))] })));
|
|
72
73
|
};
|
|
73
74
|
exports.default = Index;
|