eli-video-interview 1.9.2 → 1.9.4

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.
@@ -31,7 +31,7 @@ import ScoreSlider from '../WorkPlaces/ScoreSlider';
31
31
  import WorkPlace from '../WorkPlaces/WorkPlace';
32
32
  import { useAiReportStore } from "../../../../store/ai-report/global-store";
33
33
  import AiHeaderTitle from "../../../../components/AiHeaderTitleV2";
34
- import { Chip, EditIcon, IconButton, Typography } from 'fbm-ui';
34
+ import { EditIcon, IconButton, Typography } from 'fbm-ui';
35
35
  import { Box, Collapse, Stack } from 'fbm-ui/lib/mui';
36
36
  import { memo, useCallback, useState } from 'react';
37
37
  var BORDER = '1px solid rgba(0, 0, 0, 0.08)';
@@ -78,9 +78,14 @@ var Index = function () {
78
78
  updateReportResult(__assign(__assign({}, reportResult), { globalDimensions: list }));
79
79
  onScoreChange === null || onScoreChange === void 0 ? void 0 : onScoreChange({ flowStepToken: (_a = list[index]) === null || _a === void 0 ? void 0 : _a.token, type: 1, score: score });
80
80
  }, [onScoreChange, reportResult, updateReportResult]);
81
+ // 人工改评价:保存成功后把新文案写回 store,表格里的「一句话评价」立刻更新(不用刷新页面)
82
+ var handleAnswerChange = useCallback(function (index, answer) {
83
+ var list = ((reportResult === null || reportResult === void 0 ? void 0 : reportResult.globalDimensions) || []).map(function (item, i) { return (i === index ? __assign(__assign({}, item), { answer: answer }) : item); });
84
+ updateReportResult(__assign(__assign({}, reportResult), { globalDimensions: list }));
85
+ }, [reportResult, updateReportResult]);
81
86
  if (!showAiDimension || globalDimensions.length === 0) {
82
87
  return null;
83
88
  }
84
- return (_jsx(ReportSectionFrame, __assign({ sx: { mt: 2, mb: 2 } }, { children: _jsxs(Box, __assign({ id: "report-global-dimension" }, { children: [_jsx(AiHeaderTitle, { name: "\u5168\u5C40\u7EF4\u5EA6" }), _jsx(Box, __assign({ mx: 1, mt: 2 }, { children: _jsx(Box, __assign({ sx: { border: BORDER, borderRadius: 2, overflow: 'hidden' } }, { children: _jsxs("table", __assign({ style: { width: '100%', borderCollapse: 'collapse', fontSize: 13, color: 'rgba(0, 0, 0, 0.86)' } }, { children: [_jsx("thead", { children: _jsxs("tr", __assign({ style: { background: 'rgba(0, 0, 0, 0.02)' } }, { children: [_jsx("th", __assign({ style: __assign(__assign({}, thStyle), { width: 150 }) }, { children: "\u7EF4\u5EA6" })), _jsx("th", __assign({ style: __assign(__assign({}, thStyle), { width: 88 }) }, { children: "\u6765\u6E90" })), _jsx("th", __assign({ style: __assign(__assign({}, thStyle), { width: 76 }) }, { children: "\u6743\u91CD" })), _jsx("th", __assign({ style: __assign(__assign({}, thStyle), { width: 96 }) }, { children: "\u5F97\u5206" })), _jsx("th", __assign({ style: thStyle }, { children: "\u4E00\u53E5\u8BDD\u8BC4\u4EF7" })), _jsx("th", __assign({ style: __assign(__assign({}, thStyle), { width: 56, textAlign: 'center' }) }, { children: "\u64CD\u4F5C" }))] })) }), globalDimensions.map(function (v, index) { return (_jsxs("tbody", { children: [_jsxs("tr", __assign({ style: { borderTop: BORDER } }, { children: [_jsx("td", __assign({ style: __assign(__assign({}, tdNowrapStyle), { fontWeight: 500 }) }, { children: v.name })), _jsx("td", __assign({ style: tdNowrapStyle }, { children: _jsx(Chip, { color: "success", label: "\u5168\u5C40", size: "small" }) })), _jsxs("td", __assign({ style: __assign(__assign({}, tdNowrapStyle), { color: TEXT_MUTED }) }, { children: [v.weight, "%"] })), _jsxs("td", __assign({ style: tdNowrapStyle }, { children: [_jsx(Box, __assign({ component: "span", sx: { color: SCORE_COLOR[v.scoreLevel] || 'rgba(0, 0, 0, 0.86)', fontWeight: 600 } }, { children: v.score })), _jsx(Box, __assign({ component: "span", sx: { color: TEXT_MUTED, ml: 0.5, fontSize: 12 } }, { children: v.scoreText }))] })), _jsx("td", __assign({ style: __assign(__assign({}, tdStyle), { color: 'rgba(0, 0, 0, 0.6)' }) }, { children: v.answer })), _jsx("td", __assign({ style: __assign(__assign({}, tdStyle), { textAlign: 'center' }) }, { children: canEditAiDimension && (_jsx(IconButton, __assign({ size: "small", onClick: function () { return setExpandedIndex(expandedIndex === index ? -1 : index); } }, { children: _jsx(EditIcon, {}) }))) }))] })), _jsx("tr", { children: _jsx("td", __assign({ colSpan: 6, style: { padding: 0 } }, { children: _jsx(Collapse, __assign({ in: expandedIndex === index }, { children: _jsxs(Box, __assign({ sx: { px: 2, pt: 1.5, pb: 2, bgcolor: '#FAFBFA', borderTop: BORDER } }, { children: [_jsxs(Typography, __assign({ variant: "caption", color: "textSecondary", display: "block", mb: 1 }, { children: ["\u8BC4\u4EF7\u6807\u51C6\uFF1A", v.define || '—'] })), _jsx(ScoreSlider, { width: "100%", isShowLabel: true, score: v.score, scoreText: v.scoreText, scoreLevel: v.scoreLevel, valueLabelDisplay: "auto", onChangeCommitted: function (score) { return handleScoreChange(index, score); } }), _jsx(Stack, __assign({ mt: 1.5 }, { children: _jsx(WorkPlace, { thirdOrderID: orderToken, token: v.token, canEdit: canEditAiDimension, answer: v.answer, mode: "show" }) }))] })) })) })) })] }, v.token || v.name)); })] })) })) }))] })) })));
89
+ return (_jsx(ReportSectionFrame, __assign({ sx: { mt: 2, mb: 2 } }, { children: _jsxs(Box, __assign({ id: "report-global-dimension" }, { children: [_jsx(AiHeaderTitle, { name: "\u5168\u5C40\u7EF4\u5EA6" }), _jsx(Box, __assign({ mx: 1, mt: 2 }, { children: _jsx(Box, __assign({ sx: { border: BORDER, borderRadius: 2, overflow: 'hidden' } }, { children: _jsxs("table", __assign({ style: { width: '100%', borderCollapse: 'collapse', fontSize: 13, color: 'rgba(0, 0, 0, 0.86)' } }, { children: [_jsx("thead", { children: _jsxs("tr", __assign({ style: { background: 'rgba(0, 0, 0, 0.02)' } }, { children: [_jsx("th", __assign({ style: __assign(__assign({}, thStyle), { width: 170 }) }, { children: "\u7EF4\u5EA6" })), _jsx("th", __assign({ style: __assign(__assign({}, thStyle), { width: 80 }) }, { children: "\u6743\u91CD" })), _jsx("th", __assign({ style: __assign(__assign({}, thStyle), { width: 100 }) }, { children: "\u5F97\u5206" })), _jsx("th", __assign({ style: thStyle }, { children: "\u4E00\u53E5\u8BDD\u8BC4\u4EF7" })), _jsx("th", __assign({ style: __assign(__assign({}, thStyle), { width: 56, textAlign: 'center' }) }, { children: "\u64CD\u4F5C" }))] })) }), globalDimensions.map(function (v, index) { return (_jsxs("tbody", { children: [_jsxs("tr", __assign({ style: { borderTop: BORDER } }, { children: [_jsx("td", __assign({ style: __assign(__assign({}, tdNowrapStyle), { fontWeight: 500 }) }, { children: v.name })), _jsxs("td", __assign({ style: __assign(__assign({}, tdNowrapStyle), { color: TEXT_MUTED }) }, { children: [v.weight, "%"] })), _jsxs("td", __assign({ style: tdNowrapStyle }, { children: [_jsx(Box, __assign({ component: "span", sx: { color: SCORE_COLOR[v.scoreLevel] || 'rgba(0, 0, 0, 0.86)', fontWeight: 600 } }, { children: v.score })), _jsx(Box, __assign({ component: "span", sx: { color: TEXT_MUTED, ml: 0.5, fontSize: 12 } }, { children: v.scoreText }))] })), _jsx("td", __assign({ style: __assign(__assign({}, tdStyle), { color: 'rgba(0, 0, 0, 0.6)' }) }, { children: v.answer })), _jsx("td", __assign({ style: __assign(__assign({}, tdStyle), { textAlign: 'center' }) }, { children: canEditAiDimension && (_jsx(IconButton, __assign({ size: "small", onClick: function () { return setExpandedIndex(expandedIndex === index ? -1 : index); } }, { children: _jsx(EditIcon, {}) }))) }))] })), _jsx("tr", { children: _jsx("td", __assign({ colSpan: 5, style: { padding: 0 } }, { children: _jsx(Collapse, __assign({ in: expandedIndex === index }, { children: _jsxs(Box, __assign({ sx: { px: 2, pt: 1.5, pb: 2, bgcolor: '#FAFBFA', borderTop: BORDER } }, { children: [_jsxs(Typography, __assign({ variant: "caption", color: "textSecondary", display: "block", mb: 1 }, { children: ["\u8BC4\u4EF7\u6807\u51C6\uFF1A", v.define || '—'] })), _jsx(ScoreSlider, { width: "100%", isShowLabel: true, score: v.score, scoreText: v.scoreText, scoreLevel: v.scoreLevel, valueLabelDisplay: "auto", onChangeCommitted: function (score) { return handleScoreChange(index, score); } }), _jsx(Stack, __assign({ mt: 1.5 }, { children: _jsx(WorkPlace, { thirdOrderID: orderToken, token: v.token, canEdit: canEditAiDimension, answer: v.answer, mode: "show", onSaved: function (answer) { return handleAnswerChange(index, answer); } }) }))] })) })) })) })] }, v.token || v.name)); })] })) })) }))] })) })));
85
90
  };
86
91
  export default memo(Index);
@@ -7,6 +7,8 @@ interface WorkplaceProps {
7
7
  mode?: Mode;
8
8
  canEdit?: boolean;
9
9
  thirdOrderID: string;
10
+ /** 人工改评价保存成功后回调,宿主用它把新文案同步到 store(否则表格里的旧文案要刷新页面才变) */
11
+ onSaved?: (answer: string) => void;
10
12
  }
11
13
  declare const Evaluate: React.FC<WorkplaceProps>;
12
14
  export default Evaluate;
@@ -31,7 +31,7 @@ import { Button, confirm, EditIcon, FormItem, IconButton, Typography } from 'fbm
31
31
  import { Box, Stack } from 'fbm-ui/lib/mui';
32
32
  import { useCallback, useEffect, useState } from 'react';
33
33
  var Evaluate = function (_a) {
34
- var answer = _a.answer, token = _a.token, thirdOrderID = _a.thirdOrderID, bgcolor = _a.bgcolor, _b = _a.mode, mode = _b === void 0 ? 'show' : _b, _c = _a.canEdit, canEdit = _c === void 0 ? 'true' : _c;
34
+ var answer = _a.answer, token = _a.token, thirdOrderID = _a.thirdOrderID, bgcolor = _a.bgcolor, _b = _a.mode, mode = _b === void 0 ? 'show' : _b, _c = _a.canEdit, canEdit = _c === void 0 ? 'true' : _c, onSaved = _a.onSaved;
35
35
  var _d = __read(useState(answer), 2), content = _d[0], setContent = _d[1];
36
36
  var _e = __read(useState('show'), 2), internalMode = _e[0], setInternalMode = _e[1];
37
37
  var handleChange = useCallback(function (e) {
@@ -57,10 +57,16 @@ var Evaluate = function (_a) {
57
57
  thirdOrderID: thirdOrderID,
58
58
  answer: content,
59
59
  };
60
- PostAiInterviewWorkplace(data).then(handleModeChange).then(onClose).catch(console.log);
60
+ PostAiInterviewWorkplace(data)
61
+ .then(function () {
62
+ handleModeChange();
63
+ onSaved === null || onSaved === void 0 ? void 0 : onSaved(content);
64
+ })
65
+ .then(onClose)
66
+ .catch(console.log);
61
67
  },
62
68
  });
63
- }, [token, content, handleModeChange]);
69
+ }, [token, content, handleModeChange, onSaved, thirdOrderID]);
64
70
  useEffect(function () {
65
71
  setInternalMode(mode);
66
72
  }, [mode]);
@@ -74,9 +74,14 @@ var Index = function () {
74
74
  updateReportResult(__assign(__assign({}, reportResult), { globalDimensions: list }));
75
75
  onScoreChange === null || onScoreChange === void 0 ? void 0 : onScoreChange({ flowStepToken: (_a = list[index]) === null || _a === void 0 ? void 0 : _a.token, type: 1, score: score });
76
76
  }, [onScoreChange, reportResult, updateReportResult]);
77
+ // 人工改评价:保存成功后把新文案写回 store,表格里的「一句话评价」立刻更新(不用刷新页面)
78
+ var handleAnswerChange = useCallback(function (index, answer) {
79
+ var list = ((reportResult === null || reportResult === void 0 ? void 0 : reportResult.globalDimensions) || []).map(function (item, i) { return (i === index ? __assign(__assign({}, item), { answer: answer }) : item); });
80
+ updateReportResult(__assign(__assign({}, reportResult), { globalDimensions: list }));
81
+ }, [reportResult, updateReportResult]);
77
82
  if (!showAiDimension || globalDimensions.length === 0) {
78
83
  return null;
79
84
  }
80
- return (_jsxs(Box, __assign({ id: "report-global-dimension", px: 2, mt: 3 }, { children: [_jsx(Box, __assign({ mb: 1.5 }, { children: _jsx(ModuleTitle, { title: "\u5168\u5C40\u7EF4\u5EA6", iconVariant: "dimension" }) })), _jsx(Box, __assign({ sx: { border: BORDER, borderRadius: 2, overflow: 'hidden' } }, { children: _jsxs("table", __assign({ style: { width: '100%', borderCollapse: 'collapse', fontSize: 13, color: 'rgba(0, 0, 0, 0.86)' } }, { children: [_jsx("thead", { children: _jsxs("tr", __assign({ style: { background: 'rgba(0, 0, 0, 0.02)' } }, { children: [_jsx("th", __assign({ style: thStyle }, { children: "\u7EF4\u5EA6" })), _jsx("th", __assign({ style: thStyle }, { children: "\u6765\u6E90" })), _jsx("th", __assign({ style: thStyle }, { children: "\u6743\u91CD" })), _jsx("th", __assign({ style: thStyle }, { children: "\u5F97\u5206" })), _jsx("th", __assign({ style: thStyle }, { children: "\u4E00\u53E5\u8BDD\u8BC4\u4EF7" })), _jsx("th", __assign({ style: __assign(__assign({}, thStyle), { width: 56, textAlign: 'center' }) }, { children: "\u64CD\u4F5C" }))] })) }), globalDimensions.map(function (v, index) { return (_jsxs("tbody", { children: [_jsxs("tr", __assign({ style: { borderTop: BORDER } }, { children: [_jsx("td", __assign({ style: __assign(__assign({}, tdStyle), { fontWeight: 500 }) }, { children: v.name })), _jsx("td", __assign({ style: tdStyle }, { children: _jsx(Chip, { color: "success", label: "\u5168\u5C40", size: "small" }) })), _jsxs("td", __assign({ style: __assign(__assign({}, tdStyle), { color: TEXT_MUTED }) }, { children: [v.weight, "%"] })), _jsxs("td", __assign({ style: tdStyle }, { children: [_jsx(Box, __assign({ component: "span", sx: { color: SCORE_COLOR[v.scoreLevel] || 'rgba(0, 0, 0, 0.86)', fontWeight: 600 } }, { children: v.score })), _jsx(Box, __assign({ component: "span", sx: { color: TEXT_MUTED, ml: 0.5, fontSize: 12 } }, { children: v.scoreText }))] })), _jsx("td", __assign({ style: __assign(__assign({}, tdStyle), { color: 'rgba(0, 0, 0, 0.6)' }) }, { children: v.answer })), _jsx("td", __assign({ style: __assign(__assign({}, tdStyle), { textAlign: 'center' }) }, { children: canEditAiDimension && (_jsx(IconButton, __assign({ size: "small", onClick: function () { return setExpandedIndex(expandedIndex === index ? -1 : index); } }, { children: _jsx(EditIcon, {}) }))) }))] })), _jsx("tr", { children: _jsx("td", __assign({ colSpan: 6, style: { padding: 0 } }, { children: _jsx(Collapse, __assign({ in: expandedIndex === index }, { children: _jsxs(Box, __assign({ sx: { px: 2, pt: 1.5, pb: 2, bgcolor: '#FAFBFA', borderTop: BORDER } }, { children: [_jsxs(Typography, __assign({ variant: "caption", color: "textSecondary", display: "block", mb: 1 }, { children: ["\u8BC4\u4EF7\u6807\u51C6\uFF1A", v.define || '—'] })), _jsx(ScoreSlider, { width: "100%", isShowLabel: true, score: v.score, scoreText: v.scoreText, scoreLevel: v.scoreLevel, valueLabelDisplay: "auto", onChangeCommitted: function (score) { return handleScoreChange(index, score); } }), _jsx(Stack, __assign({ mt: 1.5 }, { children: _jsx(WorkPlace, { thirdOrderID: orderToken, token: v.token, canEdit: canEditAiDimension, answer: v.answer, mode: "show" }) }))] })) })) })) })] }, v.token || v.name)); })] })) }))] })));
85
+ return (_jsxs(Box, __assign({ id: "report-global-dimension", px: 2, mt: 3 }, { children: [_jsx(Box, __assign({ mb: 1.5 }, { children: _jsx(ModuleTitle, { title: "\u5168\u5C40\u7EF4\u5EA6", iconVariant: "dimension" }) })), _jsx(Box, __assign({ sx: { border: BORDER, borderRadius: 2, overflow: 'hidden' } }, { children: _jsxs("table", __assign({ style: { width: '100%', borderCollapse: 'collapse', fontSize: 13, color: 'rgba(0, 0, 0, 0.86)' } }, { children: [_jsx("thead", { children: _jsxs("tr", __assign({ style: { background: 'rgba(0, 0, 0, 0.02)' } }, { children: [_jsx("th", __assign({ style: thStyle }, { children: "\u7EF4\u5EA6" })), _jsx("th", __assign({ style: thStyle }, { children: "\u6765\u6E90" })), _jsx("th", __assign({ style: thStyle }, { children: "\u6743\u91CD" })), _jsx("th", __assign({ style: thStyle }, { children: "\u5F97\u5206" })), _jsx("th", __assign({ style: thStyle }, { children: "\u4E00\u53E5\u8BDD\u8BC4\u4EF7" })), _jsx("th", __assign({ style: __assign(__assign({}, thStyle), { width: 56, textAlign: 'center' }) }, { children: "\u64CD\u4F5C" }))] })) }), globalDimensions.map(function (v, index) { return (_jsxs("tbody", { children: [_jsxs("tr", __assign({ style: { borderTop: BORDER } }, { children: [_jsx("td", __assign({ style: __assign(__assign({}, tdStyle), { fontWeight: 500 }) }, { children: v.name })), _jsx("td", __assign({ style: tdStyle }, { children: _jsx(Chip, { color: "success", label: "\u5168\u5C40", size: "small" }) })), _jsxs("td", __assign({ style: __assign(__assign({}, tdStyle), { color: TEXT_MUTED }) }, { children: [v.weight, "%"] })), _jsxs("td", __assign({ style: tdStyle }, { children: [_jsx(Box, __assign({ component: "span", sx: { color: SCORE_COLOR[v.scoreLevel] || 'rgba(0, 0, 0, 0.86)', fontWeight: 600 } }, { children: v.score })), _jsx(Box, __assign({ component: "span", sx: { color: TEXT_MUTED, ml: 0.5, fontSize: 12 } }, { children: v.scoreText }))] })), _jsx("td", __assign({ style: __assign(__assign({}, tdStyle), { color: 'rgba(0, 0, 0, 0.6)' }) }, { children: v.answer })), _jsx("td", __assign({ style: __assign(__assign({}, tdStyle), { textAlign: 'center' }) }, { children: canEditAiDimension && (_jsx(IconButton, __assign({ size: "small", onClick: function () { return setExpandedIndex(expandedIndex === index ? -1 : index); } }, { children: _jsx(EditIcon, {}) }))) }))] })), _jsx("tr", { children: _jsx("td", __assign({ colSpan: 6, style: { padding: 0 } }, { children: _jsx(Collapse, __assign({ in: expandedIndex === index }, { children: _jsxs(Box, __assign({ sx: { px: 2, pt: 1.5, pb: 2, bgcolor: '#FAFBFA', borderTop: BORDER } }, { children: [_jsxs(Typography, __assign({ variant: "caption", color: "textSecondary", display: "block", mb: 1 }, { children: ["\u8BC4\u4EF7\u6807\u51C6\uFF1A", v.define || '—'] })), _jsx(ScoreSlider, { width: "100%", isShowLabel: true, score: v.score, scoreText: v.scoreText, scoreLevel: v.scoreLevel, valueLabelDisplay: "auto", onChangeCommitted: function (score) { return handleScoreChange(index, score); } }), _jsx(Stack, __assign({ mt: 1.5 }, { children: _jsx(WorkPlace, { thirdOrderID: orderToken, token: v.token, canEdit: canEditAiDimension, answer: v.answer, mode: "show", onSaved: function (answer) { return handleAnswerChange(index, answer); } }) }))] })) })) })) })] }, v.token || v.name)); })] })) }))] })));
81
86
  };
82
87
  export default memo(Index);
@@ -7,6 +7,8 @@ interface WorkplaceProps {
7
7
  mode?: Mode;
8
8
  canEdit?: boolean;
9
9
  thirdOrderID: string;
10
+ /** 人工改评价保存成功后回调,宿主用它把新文案同步到 store(否则表格里的旧文案要刷新页面才变) */
11
+ onSaved?: (answer: string) => void;
10
12
  }
11
13
  declare const Evaluate: React.FC<WorkplaceProps>;
12
14
  export default Evaluate;
@@ -31,7 +31,7 @@ import { Button, confirm, EditIcon, FormItem, IconButton, Typography } from 'fbm
31
31
  import { Box, Stack } from 'fbm-ui/lib/mui';
32
32
  import { useCallback, useEffect, useState } from 'react';
33
33
  var Evaluate = function (_a) {
34
- var answer = _a.answer, token = _a.token, thirdOrderID = _a.thirdOrderID, bgcolor = _a.bgcolor, _b = _a.mode, mode = _b === void 0 ? 'show' : _b, _c = _a.canEdit, canEdit = _c === void 0 ? 'true' : _c;
34
+ var answer = _a.answer, token = _a.token, thirdOrderID = _a.thirdOrderID, bgcolor = _a.bgcolor, _b = _a.mode, mode = _b === void 0 ? 'show' : _b, _c = _a.canEdit, canEdit = _c === void 0 ? 'true' : _c, onSaved = _a.onSaved;
35
35
  var _d = __read(useState(answer), 2), content = _d[0], setContent = _d[1];
36
36
  var _e = __read(useState('show'), 2), internalMode = _e[0], setInternalMode = _e[1];
37
37
  var handleChange = useCallback(function (e) {
@@ -57,10 +57,16 @@ var Evaluate = function (_a) {
57
57
  thirdOrderID: thirdOrderID,
58
58
  answer: content,
59
59
  };
60
- PostAiInterviewWorkplace(data).then(handleModeChange).then(onClose).catch(console.log);
60
+ PostAiInterviewWorkplace(data)
61
+ .then(function () {
62
+ handleModeChange();
63
+ onSaved === null || onSaved === void 0 ? void 0 : onSaved(content);
64
+ })
65
+ .then(onClose)
66
+ .catch(console.log);
61
67
  },
62
68
  });
63
- }, [token, content, handleModeChange]);
69
+ }, [token, content, handleModeChange, onSaved, thirdOrderID]);
64
70
  useEffect(function () {
65
71
  setInternalMode(mode);
66
72
  }, [mode]);
@@ -83,9 +83,14 @@ var Index = function () {
83
83
  updateReportResult(__assign(__assign({}, reportResult), { globalDimensions: list }));
84
84
  onScoreChange === null || onScoreChange === void 0 ? void 0 : onScoreChange({ flowStepToken: (_a = list[index]) === null || _a === void 0 ? void 0 : _a.token, type: 1, score: score });
85
85
  }, [onScoreChange, reportResult, updateReportResult]);
86
+ // 人工改评价:保存成功后把新文案写回 store,表格里的「一句话评价」立刻更新(不用刷新页面)
87
+ var handleAnswerChange = (0, react_1.useCallback)(function (index, answer) {
88
+ var list = ((reportResult === null || reportResult === void 0 ? void 0 : reportResult.globalDimensions) || []).map(function (item, i) { return (i === index ? __assign(__assign({}, item), { answer: answer }) : item); });
89
+ updateReportResult(__assign(__assign({}, reportResult), { globalDimensions: list }));
90
+ }, [reportResult, updateReportResult]);
86
91
  if (!showAiDimension || globalDimensions.length === 0) {
87
92
  return null;
88
93
  }
89
- return ((0, jsx_runtime_1.jsx)(styled_1.ReportSectionFrame, __assign({ sx: { mt: 2, mb: 2 } }, { children: (0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ id: "report-global-dimension" }, { children: [(0, jsx_runtime_1.jsx)(AiHeaderTitleV2_1.default, { name: "\u5168\u5C40\u7EF4\u5EA6" }), (0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ mx: 1, mt: 2 }, { children: (0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ sx: { border: BORDER, borderRadius: 2, overflow: 'hidden' } }, { children: (0, jsx_runtime_1.jsxs)("table", __assign({ style: { width: '100%', borderCollapse: 'collapse', fontSize: 13, color: 'rgba(0, 0, 0, 0.86)' } }, { children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)("tr", __assign({ style: { background: 'rgba(0, 0, 0, 0.02)' } }, { children: [(0, jsx_runtime_1.jsx)("th", __assign({ style: __assign(__assign({}, thStyle), { width: 150 }) }, { children: "\u7EF4\u5EA6" })), (0, jsx_runtime_1.jsx)("th", __assign({ style: __assign(__assign({}, thStyle), { width: 88 }) }, { children: "\u6765\u6E90" })), (0, jsx_runtime_1.jsx)("th", __assign({ style: __assign(__assign({}, thStyle), { width: 76 }) }, { children: "\u6743\u91CD" })), (0, jsx_runtime_1.jsx)("th", __assign({ style: __assign(__assign({}, thStyle), { width: 96 }) }, { children: "\u5F97\u5206" })), (0, jsx_runtime_1.jsx)("th", __assign({ style: thStyle }, { children: "\u4E00\u53E5\u8BDD\u8BC4\u4EF7" })), (0, jsx_runtime_1.jsx)("th", __assign({ style: __assign(__assign({}, thStyle), { width: 56, textAlign: 'center' }) }, { children: "\u64CD\u4F5C" }))] })) }), globalDimensions.map(function (v, index) { return ((0, jsx_runtime_1.jsxs)("tbody", { children: [(0, jsx_runtime_1.jsxs)("tr", __assign({ style: { borderTop: BORDER } }, { children: [(0, jsx_runtime_1.jsx)("td", __assign({ style: __assign(__assign({}, tdNowrapStyle), { fontWeight: 500 }) }, { children: v.name })), (0, jsx_runtime_1.jsx)("td", __assign({ style: tdNowrapStyle }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Chip, { color: "success", label: "\u5168\u5C40", size: "small" }) })), (0, jsx_runtime_1.jsxs)("td", __assign({ style: __assign(__assign({}, tdNowrapStyle), { color: TEXT_MUTED }) }, { children: [v.weight, "%"] })), (0, jsx_runtime_1.jsxs)("td", __assign({ style: tdNowrapStyle }, { children: [(0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ component: "span", sx: { color: SCORE_COLOR[v.scoreLevel] || 'rgba(0, 0, 0, 0.86)', fontWeight: 600 } }, { children: v.score })), (0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ component: "span", sx: { color: TEXT_MUTED, ml: 0.5, fontSize: 12 } }, { children: v.scoreText }))] })), (0, jsx_runtime_1.jsx)("td", __assign({ style: __assign(__assign({}, tdStyle), { color: 'rgba(0, 0, 0, 0.6)' }) }, { children: v.answer })), (0, jsx_runtime_1.jsx)("td", __assign({ style: __assign(__assign({}, tdStyle), { textAlign: 'center' }) }, { children: canEditAiDimension && ((0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ size: "small", onClick: function () { return setExpandedIndex(expandedIndex === index ? -1 : index); } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.EditIcon, {}) }))) }))] })), (0, jsx_runtime_1.jsx)("tr", { children: (0, jsx_runtime_1.jsx)("td", __assign({ colSpan: 6, style: { padding: 0 } }, { children: (0, jsx_runtime_1.jsx)(mui_1.Collapse, __assign({ in: expandedIndex === index }, { children: (0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ sx: { px: 2, pt: 1.5, pb: 2, bgcolor: '#FAFBFA', borderTop: BORDER } }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "textSecondary", display: "block", mb: 1 }, { children: ["\u8BC4\u4EF7\u6807\u51C6\uFF1A", v.define || '—'] })), (0, jsx_runtime_1.jsx)(ScoreSlider_1.default, { width: "100%", isShowLabel: true, score: v.score, scoreText: v.scoreText, scoreLevel: v.scoreLevel, valueLabelDisplay: "auto", onChangeCommitted: function (score) { return handleScoreChange(index, score); } }), (0, jsx_runtime_1.jsx)(mui_1.Stack, __assign({ mt: 1.5 }, { children: (0, jsx_runtime_1.jsx)(WorkPlace_1.default, { thirdOrderID: orderToken, token: v.token, canEdit: canEditAiDimension, answer: v.answer, mode: "show" }) }))] })) })) })) })] }, v.token || v.name)); })] })) })) }))] })) })));
94
+ return ((0, jsx_runtime_1.jsx)(styled_1.ReportSectionFrame, __assign({ sx: { mt: 2, mb: 2 } }, { children: (0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ id: "report-global-dimension" }, { children: [(0, jsx_runtime_1.jsx)(AiHeaderTitleV2_1.default, { name: "\u5168\u5C40\u7EF4\u5EA6" }), (0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ mx: 1, mt: 2 }, { children: (0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ sx: { border: BORDER, borderRadius: 2, overflow: 'hidden' } }, { children: (0, jsx_runtime_1.jsxs)("table", __assign({ style: { width: '100%', borderCollapse: 'collapse', fontSize: 13, color: 'rgba(0, 0, 0, 0.86)' } }, { children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)("tr", __assign({ style: { background: 'rgba(0, 0, 0, 0.02)' } }, { children: [(0, jsx_runtime_1.jsx)("th", __assign({ style: __assign(__assign({}, thStyle), { width: 170 }) }, { children: "\u7EF4\u5EA6" })), (0, jsx_runtime_1.jsx)("th", __assign({ style: __assign(__assign({}, thStyle), { width: 80 }) }, { children: "\u6743\u91CD" })), (0, jsx_runtime_1.jsx)("th", __assign({ style: __assign(__assign({}, thStyle), { width: 100 }) }, { children: "\u5F97\u5206" })), (0, jsx_runtime_1.jsx)("th", __assign({ style: thStyle }, { children: "\u4E00\u53E5\u8BDD\u8BC4\u4EF7" })), (0, jsx_runtime_1.jsx)("th", __assign({ style: __assign(__assign({}, thStyle), { width: 56, textAlign: 'center' }) }, { children: "\u64CD\u4F5C" }))] })) }), globalDimensions.map(function (v, index) { return ((0, jsx_runtime_1.jsxs)("tbody", { children: [(0, jsx_runtime_1.jsxs)("tr", __assign({ style: { borderTop: BORDER } }, { children: [(0, jsx_runtime_1.jsx)("td", __assign({ style: __assign(__assign({}, tdNowrapStyle), { fontWeight: 500 }) }, { children: v.name })), (0, jsx_runtime_1.jsxs)("td", __assign({ style: __assign(__assign({}, tdNowrapStyle), { color: TEXT_MUTED }) }, { children: [v.weight, "%"] })), (0, jsx_runtime_1.jsxs)("td", __assign({ style: tdNowrapStyle }, { children: [(0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ component: "span", sx: { color: SCORE_COLOR[v.scoreLevel] || 'rgba(0, 0, 0, 0.86)', fontWeight: 600 } }, { children: v.score })), (0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ component: "span", sx: { color: TEXT_MUTED, ml: 0.5, fontSize: 12 } }, { children: v.scoreText }))] })), (0, jsx_runtime_1.jsx)("td", __assign({ style: __assign(__assign({}, tdStyle), { color: 'rgba(0, 0, 0, 0.6)' }) }, { children: v.answer })), (0, jsx_runtime_1.jsx)("td", __assign({ style: __assign(__assign({}, tdStyle), { textAlign: 'center' }) }, { children: canEditAiDimension && ((0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ size: "small", onClick: function () { return setExpandedIndex(expandedIndex === index ? -1 : index); } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.EditIcon, {}) }))) }))] })), (0, jsx_runtime_1.jsx)("tr", { children: (0, jsx_runtime_1.jsx)("td", __assign({ colSpan: 5, style: { padding: 0 } }, { children: (0, jsx_runtime_1.jsx)(mui_1.Collapse, __assign({ in: expandedIndex === index }, { children: (0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ sx: { px: 2, pt: 1.5, pb: 2, bgcolor: '#FAFBFA', borderTop: BORDER } }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "textSecondary", display: "block", mb: 1 }, { children: ["\u8BC4\u4EF7\u6807\u51C6\uFF1A", v.define || '—'] })), (0, jsx_runtime_1.jsx)(ScoreSlider_1.default, { width: "100%", isShowLabel: true, score: v.score, scoreText: v.scoreText, scoreLevel: v.scoreLevel, valueLabelDisplay: "auto", onChangeCommitted: function (score) { return handleScoreChange(index, score); } }), (0, jsx_runtime_1.jsx)(mui_1.Stack, __assign({ mt: 1.5 }, { children: (0, jsx_runtime_1.jsx)(WorkPlace_1.default, { thirdOrderID: orderToken, token: v.token, canEdit: canEditAiDimension, answer: v.answer, mode: "show", onSaved: function (answer) { return handleAnswerChange(index, answer); } }) }))] })) })) })) })] }, v.token || v.name)); })] })) })) }))] })) })));
90
95
  };
91
96
  exports.default = (0, react_1.memo)(Index);
@@ -7,6 +7,8 @@ interface WorkplaceProps {
7
7
  mode?: Mode;
8
8
  canEdit?: boolean;
9
9
  thirdOrderID: string;
10
+ /** 人工改评价保存成功后回调,宿主用它把新文案同步到 store(否则表格里的旧文案要刷新页面才变) */
11
+ onSaved?: (answer: string) => void;
10
12
  }
11
13
  declare const Evaluate: React.FC<WorkplaceProps>;
12
14
  export default Evaluate;
@@ -33,7 +33,7 @@ var fbm_ui_1 = require("fbm-ui");
33
33
  var mui_1 = require("fbm-ui/lib/mui");
34
34
  var react_1 = require("react");
35
35
  var Evaluate = function (_a) {
36
- var answer = _a.answer, token = _a.token, thirdOrderID = _a.thirdOrderID, bgcolor = _a.bgcolor, _b = _a.mode, mode = _b === void 0 ? 'show' : _b, _c = _a.canEdit, canEdit = _c === void 0 ? 'true' : _c;
36
+ var answer = _a.answer, token = _a.token, thirdOrderID = _a.thirdOrderID, bgcolor = _a.bgcolor, _b = _a.mode, mode = _b === void 0 ? 'show' : _b, _c = _a.canEdit, canEdit = _c === void 0 ? 'true' : _c, onSaved = _a.onSaved;
37
37
  var _d = __read((0, react_1.useState)(answer), 2), content = _d[0], setContent = _d[1];
38
38
  var _e = __read((0, react_1.useState)('show'), 2), internalMode = _e[0], setInternalMode = _e[1];
39
39
  var handleChange = (0, react_1.useCallback)(function (e) {
@@ -59,10 +59,16 @@ var Evaluate = function (_a) {
59
59
  thirdOrderID: thirdOrderID,
60
60
  answer: content,
61
61
  };
62
- (0, ai_report_1.PostAiInterviewWorkplace)(data).then(handleModeChange).then(onClose).catch(console.log);
62
+ (0, ai_report_1.PostAiInterviewWorkplace)(data)
63
+ .then(function () {
64
+ handleModeChange();
65
+ onSaved === null || onSaved === void 0 ? void 0 : onSaved(content);
66
+ })
67
+ .then(onClose)
68
+ .catch(console.log);
63
69
  },
64
70
  });
65
- }, [token, content, handleModeChange]);
71
+ }, [token, content, handleModeChange, onSaved, thirdOrderID]);
66
72
  (0, react_1.useEffect)(function () {
67
73
  setInternalMode(mode);
68
74
  }, [mode]);
@@ -79,9 +79,14 @@ var Index = function () {
79
79
  updateReportResult(__assign(__assign({}, reportResult), { globalDimensions: list }));
80
80
  onScoreChange === null || onScoreChange === void 0 ? void 0 : onScoreChange({ flowStepToken: (_a = list[index]) === null || _a === void 0 ? void 0 : _a.token, type: 1, score: score });
81
81
  }, [onScoreChange, reportResult, updateReportResult]);
82
+ // 人工改评价:保存成功后把新文案写回 store,表格里的「一句话评价」立刻更新(不用刷新页面)
83
+ var handleAnswerChange = (0, react_1.useCallback)(function (index, answer) {
84
+ var list = ((reportResult === null || reportResult === void 0 ? void 0 : reportResult.globalDimensions) || []).map(function (item, i) { return (i === index ? __assign(__assign({}, item), { answer: answer }) : item); });
85
+ updateReportResult(__assign(__assign({}, reportResult), { globalDimensions: list }));
86
+ }, [reportResult, updateReportResult]);
82
87
  if (!showAiDimension || globalDimensions.length === 0) {
83
88
  return null;
84
89
  }
85
- return ((0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ id: "report-global-dimension", px: 2, mt: 3 }, { children: [(0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ mb: 1.5 }, { children: (0, jsx_runtime_1.jsx)(ModuleTitle_1.ModuleTitle, { title: "\u5168\u5C40\u7EF4\u5EA6", iconVariant: "dimension" }) })), (0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ sx: { border: BORDER, borderRadius: 2, overflow: 'hidden' } }, { children: (0, jsx_runtime_1.jsxs)("table", __assign({ style: { width: '100%', borderCollapse: 'collapse', fontSize: 13, color: 'rgba(0, 0, 0, 0.86)' } }, { children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)("tr", __assign({ style: { background: 'rgba(0, 0, 0, 0.02)' } }, { children: [(0, jsx_runtime_1.jsx)("th", __assign({ style: thStyle }, { children: "\u7EF4\u5EA6" })), (0, jsx_runtime_1.jsx)("th", __assign({ style: thStyle }, { children: "\u6765\u6E90" })), (0, jsx_runtime_1.jsx)("th", __assign({ style: thStyle }, { children: "\u6743\u91CD" })), (0, jsx_runtime_1.jsx)("th", __assign({ style: thStyle }, { children: "\u5F97\u5206" })), (0, jsx_runtime_1.jsx)("th", __assign({ style: thStyle }, { children: "\u4E00\u53E5\u8BDD\u8BC4\u4EF7" })), (0, jsx_runtime_1.jsx)("th", __assign({ style: __assign(__assign({}, thStyle), { width: 56, textAlign: 'center' }) }, { children: "\u64CD\u4F5C" }))] })) }), globalDimensions.map(function (v, index) { return ((0, jsx_runtime_1.jsxs)("tbody", { children: [(0, jsx_runtime_1.jsxs)("tr", __assign({ style: { borderTop: BORDER } }, { children: [(0, jsx_runtime_1.jsx)("td", __assign({ style: __assign(__assign({}, tdStyle), { fontWeight: 500 }) }, { children: v.name })), (0, jsx_runtime_1.jsx)("td", __assign({ style: tdStyle }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Chip, { color: "success", label: "\u5168\u5C40", size: "small" }) })), (0, jsx_runtime_1.jsxs)("td", __assign({ style: __assign(__assign({}, tdStyle), { color: TEXT_MUTED }) }, { children: [v.weight, "%"] })), (0, jsx_runtime_1.jsxs)("td", __assign({ style: tdStyle }, { children: [(0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ component: "span", sx: { color: SCORE_COLOR[v.scoreLevel] || 'rgba(0, 0, 0, 0.86)', fontWeight: 600 } }, { children: v.score })), (0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ component: "span", sx: { color: TEXT_MUTED, ml: 0.5, fontSize: 12 } }, { children: v.scoreText }))] })), (0, jsx_runtime_1.jsx)("td", __assign({ style: __assign(__assign({}, tdStyle), { color: 'rgba(0, 0, 0, 0.6)' }) }, { children: v.answer })), (0, jsx_runtime_1.jsx)("td", __assign({ style: __assign(__assign({}, tdStyle), { textAlign: 'center' }) }, { children: canEditAiDimension && ((0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ size: "small", onClick: function () { return setExpandedIndex(expandedIndex === index ? -1 : index); } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.EditIcon, {}) }))) }))] })), (0, jsx_runtime_1.jsx)("tr", { children: (0, jsx_runtime_1.jsx)("td", __assign({ colSpan: 6, style: { padding: 0 } }, { children: (0, jsx_runtime_1.jsx)(mui_1.Collapse, __assign({ in: expandedIndex === index }, { children: (0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ sx: { px: 2, pt: 1.5, pb: 2, bgcolor: '#FAFBFA', borderTop: BORDER } }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "textSecondary", display: "block", mb: 1 }, { children: ["\u8BC4\u4EF7\u6807\u51C6\uFF1A", v.define || '—'] })), (0, jsx_runtime_1.jsx)(ScoreSlider_1.default, { width: "100%", isShowLabel: true, score: v.score, scoreText: v.scoreText, scoreLevel: v.scoreLevel, valueLabelDisplay: "auto", onChangeCommitted: function (score) { return handleScoreChange(index, score); } }), (0, jsx_runtime_1.jsx)(mui_1.Stack, __assign({ mt: 1.5 }, { children: (0, jsx_runtime_1.jsx)(WorkPlace_1.default, { thirdOrderID: orderToken, token: v.token, canEdit: canEditAiDimension, answer: v.answer, mode: "show" }) }))] })) })) })) })] }, v.token || v.name)); })] })) }))] })));
90
+ return ((0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ id: "report-global-dimension", px: 2, mt: 3 }, { children: [(0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ mb: 1.5 }, { children: (0, jsx_runtime_1.jsx)(ModuleTitle_1.ModuleTitle, { title: "\u5168\u5C40\u7EF4\u5EA6", iconVariant: "dimension" }) })), (0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ sx: { border: BORDER, borderRadius: 2, overflow: 'hidden' } }, { children: (0, jsx_runtime_1.jsxs)("table", __assign({ style: { width: '100%', borderCollapse: 'collapse', fontSize: 13, color: 'rgba(0, 0, 0, 0.86)' } }, { children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)("tr", __assign({ style: { background: 'rgba(0, 0, 0, 0.02)' } }, { children: [(0, jsx_runtime_1.jsx)("th", __assign({ style: thStyle }, { children: "\u7EF4\u5EA6" })), (0, jsx_runtime_1.jsx)("th", __assign({ style: thStyle }, { children: "\u6765\u6E90" })), (0, jsx_runtime_1.jsx)("th", __assign({ style: thStyle }, { children: "\u6743\u91CD" })), (0, jsx_runtime_1.jsx)("th", __assign({ style: thStyle }, { children: "\u5F97\u5206" })), (0, jsx_runtime_1.jsx)("th", __assign({ style: thStyle }, { children: "\u4E00\u53E5\u8BDD\u8BC4\u4EF7" })), (0, jsx_runtime_1.jsx)("th", __assign({ style: __assign(__assign({}, thStyle), { width: 56, textAlign: 'center' }) }, { children: "\u64CD\u4F5C" }))] })) }), globalDimensions.map(function (v, index) { return ((0, jsx_runtime_1.jsxs)("tbody", { children: [(0, jsx_runtime_1.jsxs)("tr", __assign({ style: { borderTop: BORDER } }, { children: [(0, jsx_runtime_1.jsx)("td", __assign({ style: __assign(__assign({}, tdStyle), { fontWeight: 500 }) }, { children: v.name })), (0, jsx_runtime_1.jsx)("td", __assign({ style: tdStyle }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Chip, { color: "success", label: "\u5168\u5C40", size: "small" }) })), (0, jsx_runtime_1.jsxs)("td", __assign({ style: __assign(__assign({}, tdStyle), { color: TEXT_MUTED }) }, { children: [v.weight, "%"] })), (0, jsx_runtime_1.jsxs)("td", __assign({ style: tdStyle }, { children: [(0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ component: "span", sx: { color: SCORE_COLOR[v.scoreLevel] || 'rgba(0, 0, 0, 0.86)', fontWeight: 600 } }, { children: v.score })), (0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ component: "span", sx: { color: TEXT_MUTED, ml: 0.5, fontSize: 12 } }, { children: v.scoreText }))] })), (0, jsx_runtime_1.jsx)("td", __assign({ style: __assign(__assign({}, tdStyle), { color: 'rgba(0, 0, 0, 0.6)' }) }, { children: v.answer })), (0, jsx_runtime_1.jsx)("td", __assign({ style: __assign(__assign({}, tdStyle), { textAlign: 'center' }) }, { children: canEditAiDimension && ((0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ size: "small", onClick: function () { return setExpandedIndex(expandedIndex === index ? -1 : index); } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.EditIcon, {}) }))) }))] })), (0, jsx_runtime_1.jsx)("tr", { children: (0, jsx_runtime_1.jsx)("td", __assign({ colSpan: 6, style: { padding: 0 } }, { children: (0, jsx_runtime_1.jsx)(mui_1.Collapse, __assign({ in: expandedIndex === index }, { children: (0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ sx: { px: 2, pt: 1.5, pb: 2, bgcolor: '#FAFBFA', borderTop: BORDER } }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "textSecondary", display: "block", mb: 1 }, { children: ["\u8BC4\u4EF7\u6807\u51C6\uFF1A", v.define || '—'] })), (0, jsx_runtime_1.jsx)(ScoreSlider_1.default, { width: "100%", isShowLabel: true, score: v.score, scoreText: v.scoreText, scoreLevel: v.scoreLevel, valueLabelDisplay: "auto", onChangeCommitted: function (score) { return handleScoreChange(index, score); } }), (0, jsx_runtime_1.jsx)(mui_1.Stack, __assign({ mt: 1.5 }, { children: (0, jsx_runtime_1.jsx)(WorkPlace_1.default, { thirdOrderID: orderToken, token: v.token, canEdit: canEditAiDimension, answer: v.answer, mode: "show", onSaved: function (answer) { return handleAnswerChange(index, answer); } }) }))] })) })) })) })] }, v.token || v.name)); })] })) }))] })));
86
91
  };
87
92
  exports.default = (0, react_1.memo)(Index);
@@ -7,6 +7,8 @@ interface WorkplaceProps {
7
7
  mode?: Mode;
8
8
  canEdit?: boolean;
9
9
  thirdOrderID: string;
10
+ /** 人工改评价保存成功后回调,宿主用它把新文案同步到 store(否则表格里的旧文案要刷新页面才变) */
11
+ onSaved?: (answer: string) => void;
10
12
  }
11
13
  declare const Evaluate: React.FC<WorkplaceProps>;
12
14
  export default Evaluate;
@@ -33,7 +33,7 @@ var fbm_ui_1 = require("fbm-ui");
33
33
  var mui_1 = require("fbm-ui/lib/mui");
34
34
  var react_1 = require("react");
35
35
  var Evaluate = function (_a) {
36
- var answer = _a.answer, token = _a.token, thirdOrderID = _a.thirdOrderID, bgcolor = _a.bgcolor, _b = _a.mode, mode = _b === void 0 ? 'show' : _b, _c = _a.canEdit, canEdit = _c === void 0 ? 'true' : _c;
36
+ var answer = _a.answer, token = _a.token, thirdOrderID = _a.thirdOrderID, bgcolor = _a.bgcolor, _b = _a.mode, mode = _b === void 0 ? 'show' : _b, _c = _a.canEdit, canEdit = _c === void 0 ? 'true' : _c, onSaved = _a.onSaved;
37
37
  var _d = __read((0, react_1.useState)(answer), 2), content = _d[0], setContent = _d[1];
38
38
  var _e = __read((0, react_1.useState)('show'), 2), internalMode = _e[0], setInternalMode = _e[1];
39
39
  var handleChange = (0, react_1.useCallback)(function (e) {
@@ -59,10 +59,16 @@ var Evaluate = function (_a) {
59
59
  thirdOrderID: thirdOrderID,
60
60
  answer: content,
61
61
  };
62
- (0, ai_report_1.PostAiInterviewWorkplace)(data).then(handleModeChange).then(onClose).catch(console.log);
62
+ (0, ai_report_1.PostAiInterviewWorkplace)(data)
63
+ .then(function () {
64
+ handleModeChange();
65
+ onSaved === null || onSaved === void 0 ? void 0 : onSaved(content);
66
+ })
67
+ .then(onClose)
68
+ .catch(console.log);
63
69
  },
64
70
  });
65
- }, [token, content, handleModeChange]);
71
+ }, [token, content, handleModeChange, onSaved, thirdOrderID]);
66
72
  (0, react_1.useEffect)(function () {
67
73
  setInternalMode(mode);
68
74
  }, [mode]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eli-video-interview",
3
- "version": "1.9.2",
3
+ "version": "1.9.4",
4
4
  "description": "鳄梨科技 AI视频面试 React SDK",
5
5
  "author": "鳄梨科技",
6
6
  "license": "MIT",