eli-video-interview 1.2.42-alpha.3 → 1.2.42-alpha.30

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.
Files changed (95) hide show
  1. package/esm/components/AiHeaderTitle/index.js +1 -8
  2. package/esm/components/AiHeaderTitleV2/index.d.ts +4 -0
  3. package/esm/components/AiHeaderTitleV2/index.js +28 -0
  4. package/esm/components/AiHeaderTitleV2/interface.d.ts +4 -0
  5. package/esm/components/AiHeaderTitleV2/interface.js +1 -0
  6. package/esm/components/Charts/ReportPie.js +13 -3
  7. package/esm/components/Charts/const.js +6 -6
  8. package/esm/components/ScoreBigBall/index.js +1 -1
  9. package/esm/modules/ai-report/Root.js +6 -3
  10. package/esm/modules/ai-report/interface.d.ts +6 -0
  11. package/esm/modules/ai-report/useAiReport.d.ts +2 -0
  12. package/esm/modules/ai-report/useAiReport.js +3 -1
  13. package/esm/modules/ai-report-v2/Root.js +28 -15
  14. package/esm/modules/ai-report-v2/components/AIEvaluate/Evaluate.js +16 -2
  15. package/esm/modules/ai-report-v2/components/AIEvaluate/Graph.d.ts +12 -0
  16. package/esm/modules/ai-report-v2/components/AIEvaluate/Graph.js +17 -14
  17. package/esm/modules/ai-report-v2/components/AIEvaluate/index.js +2 -2
  18. package/esm/modules/ai-report-v2/components/Candidate/Candidate.js +14 -3
  19. package/esm/modules/ai-report-v2/components/Candidate/Interface.d.ts +3 -0
  20. package/esm/modules/ai-report-v2/components/Candidate/Podium.js +2 -2
  21. package/esm/modules/ai-report-v2/components/Form/Form.js +21 -9
  22. package/esm/modules/ai-report-v2/components/Form/Forms.d.ts +3 -3
  23. package/esm/modules/ai-report-v2/components/Form/Forms.js +4 -4
  24. package/esm/modules/ai-report-v2/components/Form/Nps.d.ts +1 -1
  25. package/esm/modules/ai-report-v2/components/Form/Nps.js +2 -0
  26. package/esm/modules/ai-report-v2/components/ReportHeader/ReportHeader.d.ts +6 -2
  27. package/esm/modules/ai-report-v2/components/ReportHeader/ReportHeader.js +34 -11
  28. package/esm/modules/ai-report-v2/components/Suggestion/index.js +1 -1
  29. package/esm/modules/ai-report-v2/components/VideoQuestion/Abilities.js +1 -1
  30. package/esm/modules/ai-report-v2/components/VideoQuestion/QuestionItem.js +26 -24
  31. package/esm/modules/ai-report-v2/components/VideoQuestion/ScoreSlider.js +1 -1
  32. package/esm/modules/ai-report-v2/components/VideoQuestion/Workplaces.js +1 -1
  33. package/esm/modules/ai-report-v2/components/VideoQuestion/index.d.ts +6 -3
  34. package/esm/modules/ai-report-v2/components/VideoQuestion/index.js +6 -4
  35. package/esm/modules/ai-report-v2/components/VideoQuestion/interface.d.ts +1 -0
  36. package/esm/modules/ai-report-v2/components/VideoQuestion/styled.js +2 -2
  37. package/esm/modules/ai-report-v2/components/WorkPlaces/index.js +1 -1
  38. package/esm/modules/ai-report-v2/components/styled.d.ts +2 -1
  39. package/esm/modules/ai-report-v2/components/styled.js +28 -5
  40. package/esm/modules/ai-report-v2/interface.d.ts +9 -2
  41. package/esm/modules/ai-report-v2/useAiReport.d.ts +5 -1
  42. package/esm/modules/ai-report-v2/useAiReport.js +3 -1
  43. package/esm/modules/ai-report-v2/useAiReportVersion.d.ts +5 -0
  44. package/esm/modules/ai-report-v2/useAiReportVersion.js +37 -0
  45. package/esm/services/ai-report.d.ts +1 -0
  46. package/esm/services/ai-report.js +1 -0
  47. package/esm/store/ai-report/global-store.d.ts +3 -0
  48. package/lib/components/AiHeaderTitle/index.js +1 -8
  49. package/lib/components/AiHeaderTitleV2/index.d.ts +4 -0
  50. package/lib/components/AiHeaderTitleV2/index.js +30 -0
  51. package/lib/components/AiHeaderTitleV2/interface.d.ts +4 -0
  52. package/lib/components/AiHeaderTitleV2/interface.js +2 -0
  53. package/lib/components/Charts/ReportPie.js +13 -3
  54. package/lib/components/Charts/const.js +6 -6
  55. package/lib/components/ScoreBigBall/index.js +1 -1
  56. package/lib/modules/ai-report/Root.js +6 -3
  57. package/lib/modules/ai-report/interface.d.ts +6 -0
  58. package/lib/modules/ai-report/useAiReport.d.ts +2 -0
  59. package/lib/modules/ai-report/useAiReport.js +6 -1
  60. package/lib/modules/ai-report-v2/Root.js +28 -15
  61. package/lib/modules/ai-report-v2/components/AIEvaluate/Evaluate.js +16 -2
  62. package/lib/modules/ai-report-v2/components/AIEvaluate/Graph.d.ts +12 -0
  63. package/lib/modules/ai-report-v2/components/AIEvaluate/Graph.js +18 -13
  64. package/lib/modules/ai-report-v2/components/AIEvaluate/index.js +2 -2
  65. package/lib/modules/ai-report-v2/components/Candidate/Candidate.js +12 -1
  66. package/lib/modules/ai-report-v2/components/Candidate/Interface.d.ts +3 -0
  67. package/lib/modules/ai-report-v2/components/Candidate/Podium.js +1 -1
  68. package/lib/modules/ai-report-v2/components/Form/Form.js +21 -9
  69. package/lib/modules/ai-report-v2/components/Form/Forms.d.ts +3 -3
  70. package/lib/modules/ai-report-v2/components/Form/Forms.js +4 -4
  71. package/lib/modules/ai-report-v2/components/Form/Nps.d.ts +1 -1
  72. package/lib/modules/ai-report-v2/components/Form/Nps.js +2 -0
  73. package/lib/modules/ai-report-v2/components/ReportHeader/ReportHeader.d.ts +6 -2
  74. package/lib/modules/ai-report-v2/components/ReportHeader/ReportHeader.js +34 -11
  75. package/lib/modules/ai-report-v2/components/Suggestion/index.js +2 -2
  76. package/lib/modules/ai-report-v2/components/VideoQuestion/Abilities.js +1 -1
  77. package/lib/modules/ai-report-v2/components/VideoQuestion/QuestionItem.js +23 -21
  78. package/lib/modules/ai-report-v2/components/VideoQuestion/ScoreSlider.js +1 -1
  79. package/lib/modules/ai-report-v2/components/VideoQuestion/Workplaces.js +1 -1
  80. package/lib/modules/ai-report-v2/components/VideoQuestion/index.d.ts +6 -3
  81. package/lib/modules/ai-report-v2/components/VideoQuestion/index.js +6 -4
  82. package/lib/modules/ai-report-v2/components/VideoQuestion/interface.d.ts +1 -0
  83. package/lib/modules/ai-report-v2/components/VideoQuestion/styled.js +2 -2
  84. package/lib/modules/ai-report-v2/components/WorkPlaces/index.js +2 -2
  85. package/lib/modules/ai-report-v2/components/styled.d.ts +2 -1
  86. package/lib/modules/ai-report-v2/components/styled.js +29 -6
  87. package/lib/modules/ai-report-v2/interface.d.ts +9 -2
  88. package/lib/modules/ai-report-v2/useAiReport.d.ts +5 -1
  89. package/lib/modules/ai-report-v2/useAiReport.js +6 -1
  90. package/lib/modules/ai-report-v2/useAiReportVersion.d.ts +5 -0
  91. package/lib/modules/ai-report-v2/useAiReportVersion.js +41 -0
  92. package/lib/services/ai-report.d.ts +1 -0
  93. package/lib/services/ai-report.js +3 -1
  94. package/lib/store/ai-report/global-store.d.ts +3 -0
  95. package/package.json +1 -1
@@ -14,13 +14,6 @@ import SvgIcon from "../SvgIcon";
14
14
  import { Box, Typography } from 'fbm-ui';
15
15
  var AiHeaderTitle = function (_a) {
16
16
  var name = _a.name;
17
- return (_jsxs(Box, __assign({ display: "inline-flex", sx: {
18
- pl: 3,
19
- color: '#009D56',
20
- pt: 0.5,
21
- background: 'url(//webcdn.fbmms.cn/assets/yt-b/yf2BqqIlr8Xtb8N2o44t1) no-repeat center center',
22
- backgroundSize: 'contain',
23
- width: 24 + (56 / 4) * name.length + 84,
24
- } }, { children: [_jsx(SvgIcon, { name: "AI" }), _jsx(Typography, __assign({ variant: "h6" }, { children: name }))] })));
17
+ return (_jsxs(Box, __assign({ display: "inline-flex" }, { children: [_jsx(SvgIcon, { name: "AI" }), _jsx(Typography, __assign({ variant: "h6", fontWeight: "medium", sx: { fontWeight: 500 }, ml: 1 }, { children: name }))] })));
25
18
  };
26
19
  export default AiHeaderTitle;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { AiHeaderProps } from './interface';
3
+ declare const AiHeaderTitle: React.FC<AiHeaderProps>;
4
+ export default AiHeaderTitle;
@@ -0,0 +1,28 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { DinTypography } from "../../modules/ai-report-v2/components/styled";
14
+ import { Stack } from 'fbm-ui/lib/mui';
15
+ var AiHeaderTitle = function (_a) {
16
+ var name = _a.name;
17
+ return (_jsxs(Stack, __assign({ display: "inline-flex", direction: "row", spacing: 1, sx: {
18
+ pl: 3,
19
+ height: 40,
20
+ color: '#009D56',
21
+ background: 'url(//webcdn.fbmms.cn/assets/yt-b/yf2BqqIlr8Xtb8N2o44t1) no-repeat center center',
22
+ backgroundSize: 'contain',
23
+ width: 24 + (56 / 4) * name.length + 84,
24
+ dispoly: 'flex',
25
+ alignItems: 'center',
26
+ } }, { children: [_jsx("img", { src: "//webcdn.fbmms.cn/assets/7Vj-/P5j2FTojTq7M3W7clK6tX", alt: "", style: { width: 32, height: 20 } }), _jsx(DinTypography, __assign({ variant: "h6", color: "inherit" }, { children: name }))] })));
27
+ };
28
+ export default AiHeaderTitle;
@@ -0,0 +1,4 @@
1
+ export interface AiHeaderProps {
2
+ name: string;
3
+ style?: any;
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -50,6 +50,16 @@ var formateTitle = function (originalTitle) {
50
50
  var _a = __read(originalTitle.match(regex), 2), no = _a[1];
51
51
  return "\u7B2C".concat(no, "\u9898");
52
52
  };
53
+ var getLevel = function (score) {
54
+ switch (true) {
55
+ case score >= 80:
56
+ return 3;
57
+ case score >= 60:
58
+ return 2;
59
+ default:
60
+ return 1;
61
+ }
62
+ };
53
63
  var ReportPie = function (props) {
54
64
  var id = props.id, _a = props.source, source = _a === void 0 ? [] : _a;
55
65
  var scores = source.map(function (_a) {
@@ -125,15 +135,15 @@ var ReportPie = function (props) {
125
135
  formatter: function (_a) {
126
136
  var _b;
127
137
  var value = _a.value, dataIndex = _a.dataIndex;
128
- return ((_b = data[dataIndex]) === null || _b === void 0 ? void 0 : _b.weight) || 0;
138
+ return "".concat(((_b = data[dataIndex]) === null || _b === void 0 ? void 0 : _b.weight.toFixed(2).replace(/\.00$/, '')) || 0, "%");
129
139
  },
130
140
  fontSize: 14,
131
141
  },
132
142
  itemStyle: {
133
143
  color: function (_a) {
134
144
  var _b;
135
- var level = _a.data.level;
136
- return (_b = levelMapping[level]) === null || _b === void 0 ? void 0 : _b.itemColor;
145
+ var avgScore = _a.data.avgScore;
146
+ return (_b = levelMapping[getLevel(avgScore)]) === null || _b === void 0 ? void 0 : _b.itemColor;
137
147
  },
138
148
  shadowBlur: 4,
139
149
  shadowColor: 'rgba(0, 0, 0, 0.16)',
@@ -1,17 +1,17 @@
1
1
  export var levelMapping = {
2
2
  3: {
3
3
  text: '优秀',
4
- itemColor: 'rgb(0, 217, 157)',
5
- color: 'rgb(0, 217, 157)',
4
+ itemColor: 'rgba(255, 153,2)',
5
+ color: 'rgb(255, 153, 3)',
6
6
  },
7
7
  2: {
8
8
  text: '适中',
9
- itemColor: 'rgb(166, 234, 193)',
10
- color: 'rgba(0, 0, 0, 0.86)',
9
+ itemColor: 'rgba(0, 217,157)',
10
+ color: 'rgba(0, 217, 157)',
11
11
  },
12
12
  1: {
13
13
  text: '欠佳',
14
- itemColor: 'rgb(239, 154, 154)',
15
- color: 'rgb(255, 108, 108)',
14
+ itemColor: 'rgba(99, 156,255)',
15
+ color: 'rgb(98, 156, 255)',
16
16
  },
17
17
  };
@@ -15,7 +15,7 @@ import BigBallSvg from "../BigBallSvg";
15
15
  import { formatScore } from "../../utils/utils";
16
16
  var ScoreBigBall = function (_a) {
17
17
  var score = _a.score, status = _a.status, _b = _a.width, width = _b === void 0 ? 80 : _b, _c = _a.height, height = _c === void 0 ? 80 : _c, _d = _a.fontSize, fontSize = _d === void 0 ? 20 : _d;
18
- return (_jsxs(_Fragment, { children: [_jsxs(ScoreBigBallRoot, __assign({ width: width, height: height, sx: { backgroundColor: status === 1 ? '#fbfbfb' : 'rgba(59, 203, 120, 0.1)' } }, { children: [status !== 1 && _jsx(BigBallSvg, {}), status === 1 && (_jsx("div", __assign({ style: { color: 'rgba(0,0,0,0.26)', fontSize: '12px' } }, { children: _jsx("span", { children: "\u5019\u9009\u4EBA\u672A\u4F5C\u7B54" }) }))), status === 2 && (_jsx("div", __assign({ style: { color: '#40be47' } }, { children: _jsx("span", { children: "\u8BA1\u7B97\u4E2D..." }) }))), status === 3 && (_jsxs("div", __assign({ style: { color: '#40be47' } }, { children: [_jsx("span", __assign({ style: { fontFamily: 'DIN Alternate Bold', fontSize: fontSize, fontWeight: 'bold' } }, { children: formatScore(score) > 100 ? 100 : formatScore(score) })), _jsx("span", __assign({ style: { marginLeft: '2px', fontSize: '12px' } }, { children: "\u5206" }))] })))] })), status === 2 && (_jsx("div", { style: {
18
+ return (_jsxs(_Fragment, { children: [_jsxs(ScoreBigBallRoot, __assign({ width: width, height: height, sx: { backgroundColor: status === 1 ? '#fbfbfb' : 'rgba(59, 203, 120, 0.1)' } }, { children: [status !== 1 && _jsx(BigBallSvg, {}), status === 1 && (_jsx("div", __assign({ style: { color: 'rgba(0,0,0,0.26)', fontSize: '12px' } }, { children: _jsx("span", { children: "\u5019\u9009\u4EBA\u672A\u4F5C\u7B54" }) }))), status === 2 && (_jsx("div", __assign({ style: { color: '#40be47' } }, { children: _jsx("span", { children: "\u8BA1\u7B97\u4E2D..." }) }))), status === 3 && (_jsxs("div", __assign({ style: { color: '#40be47' } }, { children: [_jsx("span", __assign({ style: { fontFamily: 'MiSans TC', fontSize: fontSize, fontWeight: 'bold' } }, { children: formatScore(score) > 100 ? 100 : formatScore(score) })), _jsx("span", __assign({ style: { marginLeft: '2px', fontSize: '12px' } }, { children: "\u5206" }))] })))] })), status === 2 && (_jsx("div", { style: {
19
19
  position: 'absolute',
20
20
  top: 0,
21
21
  right: 0,
@@ -25,7 +25,7 @@ import { Box, Button, confirm, Message, Paper, Typography } from 'fbm-ui';
25
25
  import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
26
26
  var NO_ANSWER = INTERVIEW_STATUS.NO_ANSWER, FAILED = INTERVIEW_STATUS.FAILED, IN_CALCULATION = INTERVIEW_STATUS.IN_CALCULATION;
27
27
  var AiReportRoot = forwardRef(function (props, ref) {
28
- var token = props.token, customScore = props.customScore, reminderSent = props.reminderSent, operableButtons = props.operableButtons, onLoad = props.onLoad, onSendReminderClick = props.onSendReminderClick;
28
+ var token = props.token, customScore = props.customScore, reminderSent = props.reminderSent, operableButtons = props.operableButtons, onLoad = props.onLoad, onSendReminderClick = props.onSendReminderClick, reloadReportVersion = props.reloadReportVersion;
29
29
  var firstLoad = useRef(true);
30
30
  var _a = useAiReportStore(), updateState = _a.updateState, updateReportResult = _a.updateReportResult, reportResult = _a.reportResult;
31
31
  var _b = reportResult || {}, _c = _b.collection, collection = _c === void 0 ? [] : _c, _d = _b.workplaces, workplaces = _d === void 0 ? [] : _d, _e = _b.model, model = _e === void 0 ? 'standard' : _e, _f = _b.hasProVersion, hasProVersion = _f === void 0 ? false : _f, _g = _b.isSimulated, isSimulated = _g === void 0 ? false : _g;
@@ -50,8 +50,11 @@ var AiReportRoot = forwardRef(function (props, ref) {
50
50
  }), data = _h.data, loading = _h.loading, postAiInterviewResult = _h.run;
51
51
  var status = (data === null || data === void 0 ? void 0 : data.data.list[0].status) || NO_ANSWER;
52
52
  var handleRefreshSuccess = useCallback(function () {
53
- postAiInterviewResult();
54
- }, [postAiInterviewResult]);
53
+ reloadReportVersion === null || reloadReportVersion === void 0 ? void 0 : reloadReportVersion();
54
+ if (!reloadReportVersion) {
55
+ postAiInterviewResult();
56
+ }
57
+ }, [postAiInterviewResult, reloadReportVersion]);
55
58
  var handleSwitchReportModel = useCallback(function () {
56
59
  var SwithAction = function () {
57
60
  SwitchReportModel({
@@ -25,6 +25,7 @@ export interface Collection {
25
25
  level: number;
26
26
  rank: number;
27
27
  total: number;
28
+ avgScore: number;
28
29
  }
29
30
  export interface AnalysisResult {
30
31
  text: string;
@@ -44,6 +45,9 @@ export interface AnalysisResult {
44
45
  }
45
46
  export interface Answer {
46
47
  videoUrl: string;
48
+ media: {
49
+ durationTime: number;
50
+ };
47
51
  analysisResult: AnalysisResult;
48
52
  }
49
53
  export interface Ability {
@@ -58,6 +62,7 @@ export interface Ability {
58
62
  }
59
63
  export interface ScoreInfo {
60
64
  weight: number | string;
65
+ workplaceName: string;
61
66
  workplaceEvaluation: string;
62
67
  originScore: number;
63
68
  finalScore: number;
@@ -194,6 +199,7 @@ export interface AiReportProps {
194
199
  rank: number;
195
200
  };
196
201
  customInterviewDimRankMap?: CustomInterviewDimRankMap;
202
+ reloadReportVersion?: () => void;
197
203
  onLoad?: (values: AiReportLoadedValues) => void;
198
204
  onExportReportClick?: () => void;
199
205
  onScoreChange?: (scoreState?: ScoreManualUpdateState) => void;
@@ -1,6 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import { AiReportProps, AiReportRef } from './interface';
3
3
  export declare const useAiReport: (props: AiReportProps) => {
4
+ version: number;
5
+ reloadReportVersion: () => void;
4
6
  handleRefresh?: (() => void) | undefined;
5
7
  token: string;
6
8
  customScore?: number | undefined;
@@ -9,8 +9,10 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ import useAiReportVersion from '../ai-report-v2/useAiReportVersion';
12
13
  import { useRef } from 'react';
13
14
  export var useAiReport = function (props) {
14
15
  var ref = useRef();
15
- return __assign(__assign({ ref: ref }, props), ref === null || ref === void 0 ? void 0 : ref.current);
16
+ var reportVersion = useAiReportVersion(props.token);
17
+ return __assign(__assign(__assign({ ref: ref }, props), ref === null || ref === void 0 ? void 0 : ref.current), reportVersion);
16
18
  };
@@ -19,15 +19,15 @@ import { PostAiInterviewResult } from "../../services/ai-report";
19
19
  import { useAiReportStore } from "../../store/ai-report/global-store";
20
20
  import { useRequest } from 'ahooks';
21
21
  import { Box, Button, Paper, Typography } from 'fbm-ui';
22
+ import { Stack } from 'fbm-ui/lib/mui';
22
23
  import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
23
- var NO_ANSWER = INTERVIEW_STATUS.NO_ANSWER, FAILED = INTERVIEW_STATUS.FAILED, IN_CALCULATION = INTERVIEW_STATUS.IN_CALCULATION;
24
+ var NO_ANSWER = INTERVIEW_STATUS.NO_ANSWER;
24
25
  var AiReportRoot = forwardRef(function (props, ref) {
25
- var token = props.token, customScore = props.customScore, reminderSent = props.reminderSent, operableButtons = props.operableButtons, onLoad = props.onLoad, onSendReminderClick = props.onSendReminderClick, fetchFormReuslt = props.fetchFormReuslt, fetchCandidateInfo = props.fetchCandidateInfo;
26
+ var token = props.token, customScore = props.customScore, reminderSent = props.reminderSent, operableButtons = props.operableButtons, onLoad = props.onLoad, onSendReminderClick = props.onSendReminderClick, fetchFormResult = props.fetchFormResult, fetchCandidateInfo = props.fetchCandidateInfo, fetchReportUrl = props.fetchReportUrl, isExportPdf = props.isExportPdf;
26
27
  var firstLoad = useRef(true);
27
- // @ts-ignore
28
28
  var _a = useAiReportStore(), updateState = _a.updateState, updateReportResult = _a.updateReportResult, reportResult = _a.reportResult;
29
- // const { collection = [], workplaces = [], model = 'standard', hasProVersion = false, isSimulated = false } = reportResult || {};
30
- var _b = useRequest(function () { return PostAiInterviewResult([token]); }, {
29
+ var _b = (reportResult || {}).collection, collection = _b === void 0 ? [] : _b;
30
+ var _c = useRequest(function () { return PostAiInterviewResult([token]); }, {
31
31
  manual: true,
32
32
  onSuccess: function (_a) {
33
33
  var list = _a.data.list;
@@ -45,7 +45,7 @@ var AiReportRoot = forwardRef(function (props, ref) {
45
45
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(__assign({ pageStepIndexes: pageStepIndexes_1 }, result));
46
46
  }
47
47
  },
48
- }), data = _b.data, loading = _b.loading, postAiInterviewResult = _b.run;
48
+ }), data = _c.data, loading = _c.loading, postAiInterviewResult = _c.run;
49
49
  var status = (data === null || data === void 0 ? void 0 : data.data.list[0].status) || NO_ANSWER;
50
50
  var handleRefreshSuccess = useCallback(function () {
51
51
  postAiInterviewResult();
@@ -61,21 +61,34 @@ var AiReportRoot = forwardRef(function (props, ref) {
61
61
  useEffect(function () {
62
62
  updateState(props);
63
63
  // eslint-disable-next-line react-hooks/exhaustive-deps
64
- }, [props]);
64
+ }, [JSON.stringify(props)]);
65
65
  var aiReportResult = useMemo(function () {
66
66
  if (status === NO_ANSWER) {
67
67
  return (_jsxs(Box, __assign({ width: "100%", display: "flex", alignItems: "center", justifyContent: "center", flexDirection: "column", style: { marginTop: '149px' } }, { children: [_jsx(Box, { children: _jsx("img", { src: "//webcdn.fbmms.cn/web/saas/asset/image/CandidateInfoEmpty.png", alt: "", style: { width: '140px', height: '140px' } }) }), _jsx(Box, __assign({ mt: 2 }, { children: _jsx(Typography, __assign({ variant: "body1", color: "textPrimary", style: { fontWeight: '500' } }, { children: "\u8BE5\u5019\u9009\u4EBA\u5C1A\u672A\u5F00\u59CB\u9762\u8BD5" })) })), (operableButtons === null || operableButtons === void 0 ? void 0 : operableButtons.includes('sendReminder')) && (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ style: { marginTop: '2px' } }, { children: _jsx(Typography, __assign({ variant: "body2", color: "textSecondary" }, { children: "\u82E5\u957F\u65F6\u95F4\u672A\u5F00\u59CB\uFF0C\u5EFA\u8BAE\u4F60\u7ED9\u5019\u9009\u4EBA\u53D1\u9001\u77ED\u4FE1\u63D0\u9192" })) })), _jsx(Box, __assign({ mt: 2 }, { children: _jsx(Button, __assign({ size: "large", variant: "outlined", color: "primary", disabled: reminderSent, onClick: onSendReminderClick }, { children: reminderSent ? '已提醒' : '发送提醒' })) }))] }))] })));
68
68
  }
69
69
  else {
70
- return (_jsxs(Box, __assign({ pb: 3, sx: {
71
- background: '#F0F9FF',
72
- backgroundImage: "url('//webcdn.fbmms.cn/assets/9kTa/pmsfSOeFx_7jhhsV9f_ta')",
73
- backgroundSize: 'contain',
74
- backgroundRepeat: 'no-repeat',
75
- backgroundPosition: 'center top',
76
- } }, { children: [_jsx(NotFinish, {}), _jsx(ReportHeader, { customScore: customScore, onRefreshSuccess: handleRefreshSuccess, fetchCandidateInfo: fetchCandidateInfo }), _jsx(FormReport, { fetchFormReuslt: fetchFormReuslt }), _jsx(Paper, __assign({ variant: "outlined", sx: { zIndex: 1, position: 'relative', mx: 2, borderRadius: 4 } }, { children: _jsx(VideoQuestion, {}) }))] })));
70
+ return (_jsxs(Stack, { children: [_jsx(NotFinish, {}), _jsxs(Box, __assign({ pb: 3, sx: {
71
+ background: '#F0F9FF',
72
+ backgroundImage: "url('//webcdn.fbmms.cn/assets/9kTa/pmsfSOeFx_7jhhsV9f_ta')",
73
+ backgroundSize: 'contain',
74
+ backgroundRepeat: 'no-repeat',
75
+ backgroundPosition: 'center top',
76
+ paddingTop: (collection === null || collection === void 0 ? void 0 : collection.length) > 0 ? 0 : 3,
77
+ } }, { children: [(collection === null || collection === void 0 ? void 0 : collection.length) > 0 && (_jsx(ReportHeader, { customScore: customScore, onRefreshSuccess: handleRefreshSuccess, fetchCandidateInfo: fetchCandidateInfo, status: status, fetchReportUrl: fetchReportUrl })), _jsx(FormReport, { fetchFormResult: fetchFormResult }), _jsx(Paper, __assign({ variant: "outlined", sx: { zIndex: 1, position: 'relative', mx: 2, borderRadius: 4 } }, { children: _jsx(VideoQuestion, { isExportPdf: isExportPdf }) }))] }))] }));
77
78
  }
78
- }, [status, operableButtons, reminderSent, onSendReminderClick, customScore, handleRefreshSuccess, fetchCandidateInfo, fetchFormReuslt]);
79
+ }, [
80
+ status,
81
+ operableButtons,
82
+ reminderSent,
83
+ onSendReminderClick,
84
+ collection === null || collection === void 0 ? void 0 : collection.length,
85
+ customScore,
86
+ handleRefreshSuccess,
87
+ fetchCandidateInfo,
88
+ fetchReportUrl,
89
+ fetchFormResult,
90
+ isExportPdf,
91
+ ]);
79
92
  return (_jsx(Box, __assign({ loading: firstLoad.current && loading, sx: { width: '100%', minHeight: '618px', height: '100%', margin: '0 auto', overflow: 'auto' } }, { children: aiReportResult })));
80
93
  });
81
94
  AiReportRoot.displayName = 'AiReportRoot';
@@ -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 title = _a.title, evaluations = _a.evaluations, token = _a.token, field = _a.field, _b = _a.mode, mode = _b === void 0 ? 'show' : _b, _c = _a.canEdit, canEdit = _c === void 0 ? 'true' : _c;
34
+ var title = _a.title, evaluations = _a.evaluations, token = _a.token, field = _a.field, _b = _a.mode, mode = _b === void 0 ? 'show' : _b, _c = _a.canEdit, canEdit = _c === void 0 ? 'false' : _c;
35
35
  var _d = __read(useState(evaluations), 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) {
@@ -74,7 +74,21 @@ var Evaluate = function (_a) {
74
74
  boxShadow: ' 0px 2px 6px 0px rgba(91,108,95,0.15)',
75
75
  padding: '8px 24px',
76
76
  borderRadius: 1.5,
77
- } }, { children: [_jsxs(Stack, __assign({ direction: "row", alignItems: "center", justifyContent: "space-between" }, { children: [_jsx(Typography, __assign({ variant: "body2", fontWeight: "medium" }, { children: title })), canEdit && (_jsx(IconButton, __assign({ onClick: handleModeChange }, { children: _jsx(EditIcon, {}) })))] })), internalMode === 'edit' && (_jsxs(Box, __assign({ width: 1, pr: 2 }, { children: [_jsx(FormItem, { sx: { height: 'auto', pr: 0 }, multiline: true, rows: 3.5, required: true, name: "name", placeholder: "", value: content, onChange: handleChange }), _jsxs(Stack, __assign({ boxSizing: "border-box", mr: 2, mt: 1, spacing: 1, direction: "row", width: 1, justifyContent: "flex-end" }, { children: [_jsx(Button, __assign({ size: "medium", variant: "text", color: "secondary", onClick: function () {
77
+ } }, { children: [_jsxs(Stack, __assign({ direction: "row", alignItems: "center", justifyContent: "space-between", height: 36, mb: 1 }, { children: [_jsx(Box, __assign({ sx: {
78
+ position: 'relative',
79
+ '&:after': {
80
+ position: 'absolute',
81
+ width: 'calc(100% - 2px)',
82
+ background: ' linear-gradient( 90deg, #FFE5A9 0%, #FFB300 100%)',
83
+ left: -3,
84
+ bottom: 2,
85
+ height: 5,
86
+ content: '""',
87
+ color: 'rgba(0, 0, 0, 0.54)',
88
+ display: 'inline-block',
89
+ margin: '0 4px',
90
+ },
91
+ } }, { children: _jsx(Typography, __assign({ fontWeight: "medium", zIndex: 1, sx: { position: 'relative', zIndex: 1 } }, { children: title })) })), canEdit && (_jsx(IconButton, __assign({ onClick: handleModeChange }, { children: _jsx(EditIcon, {}) })))] })), internalMode === 'edit' && (_jsxs(Box, __assign({ width: 1, pr: 2 }, { children: [_jsx(FormItem, { sx: { height: 'auto', pr: 0 }, multiline: true, rows: 3.5, required: true, name: "name", placeholder: "", value: content, onChange: handleChange }), _jsxs(Stack, __assign({ boxSizing: "border-box", mr: 2, mt: 1, spacing: 1, direction: "row", width: 1, justifyContent: "flex-end" }, { children: [_jsx(Button, __assign({ size: "medium", variant: "text", color: "secondary", onClick: function () {
78
92
  handleModeChange();
79
93
  // setContent(evaluations?.join('\n'));
80
94
  } }, { children: "\u53D6\u6D88" })), _jsx(Button, __assign({ size: "medium", onClick: handleSubmit }, { children: "\u4FDD\u5B58" }))] }))] }))), internalMode === 'show' && (_jsx(Typography, __assign({ variant: "body2", color: "textSecondary", sx: { whiteSpace: 'pre-wrap' } }, { children: content })))] })));
@@ -3,6 +3,18 @@ interface Dimension {
3
3
  name: string;
4
4
  score: number;
5
5
  }
6
+ export declare function getLevel(score: any): {
7
+ label: string;
8
+ width: number;
9
+ fontColor: string;
10
+ color: number[];
11
+ gradient: string[];
12
+ scoreGradient: string[];
13
+ backgroundColor: string;
14
+ shadowColor: string;
15
+ endScore: number;
16
+ pointColor: string[];
17
+ };
6
18
  interface GraphProps {
7
19
  items: Array<Dimension>;
8
20
  }
@@ -83,7 +83,6 @@ function isInPath(x, y, tx, ty, ctx) {
83
83
  var drawTop = function (layout, ctx) {
84
84
  // 设置全局样式
85
85
  var leftLableWidth = layout.leftLableWidth, height = layout.height, topLableHeight = layout.topLableHeight;
86
- ctx.font = '16px sans-serif';
87
86
  var offset = leftLableWidth;
88
87
  levelOrder.forEach(function (level, i) {
89
88
  var _a = levelConf[level], width = _a.width, gradient = _a.gradient, label = _a.label, fontColor = _a.fontColor;
@@ -97,23 +96,23 @@ var drawTop = function (layout, ctx) {
97
96
  var labelWidth = measureTextWidth(ctx, label);
98
97
  ctx.fillStyle = fontColor;
99
98
  ctx.fillText(label, offset + width / 2 - labelWidth / 2, 18);
100
- console.log(offset);
101
99
  // 绘制垂直虚线
102
- drawVerticalDashedLine(ctx, offset - 1, 0, height + topLableHeight - 50, 2, 2);
100
+ drawVerticalDashedLine(ctx, offset - 1, 0, height + topLableHeight - 54, 2, 2);
103
101
  // 绘制分数文本
104
102
  ctx.fillStyle = '#4CAF50';
105
- ctx.fillText("".concat(levelOrderScore[i]), offset - (i === 0 ? 4 : 8), height + topLableHeight - 40);
103
+ ctx.fillText("".concat(levelOrderScore[i]), offset - (i === 0 ? 5 : 9), height + topLableHeight - 40);
106
104
  offset += width + 1;
107
105
  // 绘制结束的虚线和文本 '100'
108
106
  if (i === levelOrder.length - 1) {
109
- drawVerticalDashedLine(ctx, offset - 2, 0, height + topLableHeight - 50, 2, 2);
110
- ctx.fillText('100', offset - 2 - 8, height + topLableHeight - 40);
107
+ drawVerticalDashedLine(ctx, offset - 2, 0, height + topLableHeight - 54, 2, 2);
108
+ ctx.fillText('100', offset - 2 - 10, height + topLableHeight - 40);
111
109
  }
112
110
  });
113
111
  };
112
+ var truncateString = function (str) { return (str.length > 7 ? "".concat(str.slice(0, 6), "...") : str); };
114
113
  var drawLable = function (lable, x, y, ctx) {
115
114
  ctx.fillStyle = 'rgba(66, 66, 66, 0.86)';
116
- ctx.fillText(lable, x, y + 5);
115
+ ctx.fillText(truncateString(lable), x, y + 5);
117
116
  };
118
117
  function drawVerticalDashedLine(ctx, x, startY, endY, dashLength, gapLength) {
119
118
  if (dashLength === void 0) { dashLength = 2; }
@@ -143,7 +142,7 @@ var drawRoundedRect = function (x, y, width, height, r, fill, stroke, ctx) {
143
142
  }
144
143
  ctx.restore();
145
144
  };
146
- function getLevel(score) {
145
+ export function getLevel(score) {
147
146
  if (score < 60) {
148
147
  return levelConf.Bad;
149
148
  }
@@ -168,12 +167,14 @@ var drawScore = function (layout, ctx, config, rect, score) {
168
167
  var borderRadius = 12;
169
168
  drawRoundedRect(rect.x, rect.y, rect.width, rect.height, borderRadius, true, false, ctx);
170
169
  ctx.fillStyle = score < 10 ? '#0D67FF' : '#fff';
171
- ctx.fillText("".concat(score), layout.leftLableWidth + rect.width + (score < 10 ? 4 : -24), rect.y + 18);
170
+ var scoreWidth = measureTextWidth(ctx, "".concat(score));
171
+ ctx.fillText("".concat(score), layout.leftLableWidth + rect.width + (score < 10 ? 4 : -scoreWidth - 4), rect.y + 18);
172
172
  };
173
173
  var draw = function (layout, dimensions, pathRef, ctx) {
174
+ ctx.font = '16px sans-serif';
174
175
  ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
175
- drawTop(layout, ctx);
176
176
  dimensions.forEach(function (v, i) {
177
+ var _a;
177
178
  var config = getLevel(v.score);
178
179
  // 绘制圆角矩形
179
180
  var borderRadius = 12;
@@ -183,21 +184,23 @@ var draw = function (layout, dimensions, pathRef, ctx) {
183
184
  ctx.fillStyle = config.backgroundColor;
184
185
  drawRoundedRect(x, y, MAX_WIDTH, MAX_HEIGHT, borderRadius, true, false, ctx);
185
186
  var endPointY = 65 + layout.itemSpacing * i;
186
- drawLable(v.name, 10, endPointY, ctx);
187
+ drawLable(v.name, 0, endPointY, ctx);
188
+ var score = (_a = v.score) !== null && _a !== void 0 ? _a : (v.score < 4 ? 4 : v.score);
187
189
  drawScore(layout, ctx, config, {
188
190
  x: layout.leftLableWidth,
189
191
  y: y,
190
- width: MAX_WIDTH * (v.score / 100),
192
+ width: MAX_WIDTH * (score / 100),
191
193
  height: MAX_HEIGHT,
192
194
  }, v.score);
193
195
  });
196
+ drawTop(layout, ctx);
194
197
  };
195
198
  var Graph = function (_a) {
196
199
  var _b = _a.items, items = _b === void 0 ? [] : _b;
197
200
  var ref = useRef(null);
198
201
  var pathRef = useRef([]);
199
202
  var _c = __read(useState(), 2), ctx = _c[0], setCtx = _c[1];
200
- var height = useMemo(function () { return 36 * items.length + 40 + 30; }, [items]);
203
+ var height = useMemo(function () { return 36 * items.length + 50 + 35; }, [items]);
201
204
  useEffect(function () {
202
205
  if (items.length === 0)
203
206
  return;
@@ -216,7 +219,7 @@ var Graph = function (_a) {
216
219
  useEffect(function () {
217
220
  if (ctx) {
218
221
  var layout = {
219
- leftLableWidth: 120,
222
+ leftLableWidth: 140,
220
223
  topLableHeight: 40,
221
224
  itemSpacing: 40,
222
225
  height: height,
@@ -20,10 +20,10 @@ var Index = function () {
20
20
  var _b = (reportResult || {}).collection, collection = _b === void 0 ? [] : _b;
21
21
  var items = collection.map(function (item) { return ({
22
22
  name: item.name,
23
- score: item.score,
23
+ score: item.avgScore,
24
24
  }); });
25
25
  if (!showAiDimension)
26
26
  return null;
27
- return (_jsx(Box, __assign({ id: "report-evaluate", px: 2, mt: 2, width: 1 }, { children: _jsx(Box, __assign({ component: Paper, elevation: 0, bgcolor: "transparent", mb: 2, pb: 2 }, { children: _jsxs(Stack, { children: [_jsxs(Stack, __assign({ direction: "row", alignItems: "center", justifyContent: "space-between" }, { children: [_jsx(Box, __assign({ mt: 2, flex: 1 }, { children: _jsx(Graph, { items: items }) })), _jsx(Report, {})] })), (reportResult === null || reportResult === void 0 ? void 0 : reportResult.workplaceEvaluation) && (_jsx(Evaluate, { token: "", canEdit: canEditAiDimension, evaluations: reportResult === null || reportResult === void 0 ? void 0 : reportResult.workplaceEvaluation, title: "\u8BC4\u4EF7\u5185\u5BB9", field: "evaluations", mode: "show" }))] }) })) })));
27
+ return (_jsx(Box, __assign({ id: "report-evaluate", px: 2, width: 1 }, { children: _jsx(Box, __assign({ component: Paper, elevation: 0, bgcolor: "transparent", mb: 3 }, { children: _jsxs(Stack, { children: [_jsxs(Stack, __assign({ direction: "row", alignItems: "center", justifyContent: "space-between" }, { children: [_jsx(Box, __assign({ mt: 2, flex: 1 }, { children: _jsx(Graph, { items: items }) })), _jsx(Report, {})] })), (reportResult === null || reportResult === void 0 ? void 0 : reportResult.workplaceEvaluation) && (_jsx(Evaluate, { token: "", canEdit: canEditAiDimension, evaluations: reportResult === null || reportResult === void 0 ? void 0 : reportResult.workplaceEvaluation, title: "\u7EFC\u5408\u8BC4\u4EF7", field: "evaluations", mode: "show" }))] }) })) })));
28
28
  };
29
29
  export default Index;
@@ -27,11 +27,16 @@ var __read = (this && this.__read) || function (o, n) {
27
27
  };
28
28
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
29
29
  import { DinTypography, ReportAvatar, ReportTag } from '../styled';
30
- import { Message, Typography } from 'fbm-ui';
30
+ import { useAiReportStore } from "../../../../store/ai-report/global-store";
31
+ import { getSecondToTime } from "../../../../utils/utils";
32
+ import { Box, Message, Typography } from 'fbm-ui';
31
33
  import { Stack } from 'fbm-ui/lib/mui';
32
- import { memo, useEffect, useState } from 'react';
34
+ import { memo, useEffect, useMemo, useState } from 'react';
33
35
  var Form = function (_a) {
34
36
  var fetchCandidateInfo = _a.fetchCandidateInfo;
37
+ var reportResult = useAiReportStore(function (store) { return [store.reportResult]; }).reportResult;
38
+ var steps = (reportResult || {}).steps;
39
+ var duration = useMemo(function () { return getSecondToTime((steps === null || steps === void 0 ? void 0 : steps.reduce(function (acc, cur) { return acc + cur.answer.media.durationTime; }, 0)) || 0); }, [steps]);
35
40
  var _b = __read(useState({ name: '', mobile: '', processName: '', positionName: '', avatar: '', tags: [] }), 2), data = _b[0], setData = _b[1];
36
41
  useEffect(function () {
37
42
  if (fetchCandidateInfo) {
@@ -39,6 +44,12 @@ var Form = function (_a) {
39
44
  }
40
45
  }, [fetchCandidateInfo]);
41
46
  var name = data.name, mobile = data.mobile, positionName = data.positionName, avatar = data.avatar, tags = data.tags;
42
- return (_jsxs(Stack, __assign({ direction: "row" }, { children: [_jsx(ReportAvatar, { sx: { mx: 3 }, avatar: avatar }), _jsxs(Stack, __assign({ spacing: 1 }, { children: [_jsx(DinTypography, __assign({ sx: { fontSize: 18 } }, { children: positionName })), _jsxs(Typography, __assign({ variant: "body1" }, { children: [name, " ", mobile] })), _jsx(Stack, __assign({ direction: "row" }, { children: tags === null || tags === void 0 ? void 0 : tags.map(function (tag) { return (_jsx(ReportTag, { children: tag.name }, tag.token)); }) })), _jsx(Typography, { children: "\u9762\u8BD5\u65F6\u957F\uFF1A12\u520632\u79D2" })] }))] })));
47
+ return (_jsxs(Stack, __assign({ direction: "row", minHeight: 221, mt: 13.25 }, { children: [_jsx(ReportAvatar, { sx: { mx: 3 }, avatar: avatar }), _jsxs(Stack, __assign({ spacing: 1 }, { children: [_jsx(DinTypography, __assign({ sx: { fontSize: 18 } }, { children: positionName })), _jsxs(Typography, __assign({ variant: "body1" }, { children: [name, " ", mobile] })), _jsx(Box, __assign({ sx: {
48
+ display: 'flex',
49
+ flexWrap: 'wrap',
50
+ gap: '8px',
51
+ alignItems: 'flex-start',
52
+ width: '450px',
53
+ } }, { children: tags === null || tags === void 0 ? void 0 : tags.map(function (tag) { return (_jsx(ReportTag, { children: tag.name }, tag.token)); }) })), _jsxs(Typography, { children: ["\u9762\u8BD5\u65F6\u957F\uFF1A", duration] })] }))] })));
43
54
  };
44
55
  export default memo(Form);
@@ -10,4 +10,7 @@ interface Tag {
10
10
  name: string;
11
11
  token: string;
12
12
  }
13
+ export interface AiReportUrl {
14
+ url: string;
15
+ }
13
16
  export {};
@@ -27,7 +27,7 @@ var __read = (this && this.__read) || function (o, n) {
27
27
  };
28
28
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
29
29
  import { rankPercent } from '../../utils';
30
- import { BeatProgressBar, Podium } from '../styled';
30
+ import { BeatProgressBar, DinTypography, Podium } from '../styled';
31
31
  import { useAiReportStore } from "../../../../store/ai-report/global-store";
32
32
  import { Typography } from 'fbm-ui';
33
33
  import { Stack } from 'fbm-ui/lib/mui';
@@ -45,6 +45,6 @@ var Form = function () {
45
45
  setText('');
46
46
  }
47
47
  }, [score, reportRank, scoreRankIntervals, progress]);
48
- return (_jsx(Podium, { children: _jsxs(Stack, __assign({ direction: "row", position: "relative", bottom: -128, left: 88 }, { children: [_jsxs(Stack, __assign({ spacing: 1, direction: "row", justifyContent: "center", width: 300 }, { children: [_jsx(Typography, __assign({ sx: { fontSize: 100, fontWeight: 'bold', lineHeight: 1 }, color: "inherit" }, { children: score })), _jsx(Typography, __assign({ variant: "h5", color: "inherit", sx: { fontSize: 30, fontWeight: 'bold', alignSelf: 'flex-end' } }, { children: "\u5206" }))] })), (reportRank === null || reportRank === void 0 ? void 0 : reportRank.total) !== 0 && (_jsxs(Stack, __assign({ spacing: 1 }, { children: [_jsxs(Typography, __assign({ color: "inherit", fontWeight: 500 }, { children: [text, "\u00A0"] })), _jsx(BeatProgressBar, { children: _jsx("div", { className: "progress-bar-fill", style: { width: "".concat(progress, "%") } }) })] })))] })) }));
48
+ return (_jsx(Podium, { children: _jsxs(Stack, __assign({ direction: "row", position: "relative", bottom: -146, left: 88, spacing: 1.5 }, { children: [_jsxs(Stack, __assign({ spacing: 1, direction: "row", justifyContent: "center", width: 300 }, { children: [_jsx(DinTypography, __assign({ sx: { fontSize: 100, fontWeight: 'bold', lineHeight: 1 }, color: "inherit" }, { children: score })), _jsx(DinTypography, __assign({ variant: "h5", color: "inherit", sx: { fontSize: 30, fontWeight: 'bold', alignSelf: 'flex-end', mb: '12px !important' } }, { children: "\u5206" }))] })), (reportRank === null || reportRank === void 0 ? void 0 : reportRank.total) !== 0 && (_jsxs(Stack, __assign({ spacing: 1, mt: 6.25 }, { children: [_jsxs(Typography, __assign({ color: "inherit", fontWeight: 500, mt: 5 }, { children: [text, "\u00A0"] })), _jsx(BeatProgressBar, { children: _jsx("div", { className: "progress-bar-fill", style: { width: "".concat(progress, "%") } }) })] })))] })) }));
49
49
  };
50
50
  export default Form;
@@ -11,10 +11,10 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  var _a;
13
13
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
14
+ import { DinTypography } from '../styled';
14
15
  import Nps from './Nps';
15
16
  import { PhotoProvider, PhotoView } from "../../../../components/react-photo-view";
16
17
  import dayjs from 'dayjs';
17
- import { EditIcon } from 'fbm-icons';
18
18
  import { Box, Paper, Typography } from 'fbm-ui';
19
19
  import { Stack } from 'fbm-ui/lib/mui';
20
20
  export var QUESTION_TYPE;
@@ -29,8 +29,8 @@ export var QUESTION_TYPE;
29
29
  QUESTION_TYPE[QUESTION_TYPE["NPS"] = 9] = "NPS";
30
30
  })(QUESTION_TYPE || (QUESTION_TYPE = {}));
31
31
  var Image = function (answer) {
32
- var _a, _b;
33
- return (_jsx(PhotoProvider, __assign({ maskOpacity: 0.5 }, { children: (_b = (_a = answer.formAnswer) === null || _a === void 0 ? void 0 : _a.files) === null || _b === void 0 ? void 0 : _b.map(function (url) { return (_jsx(PhotoView, __assign({ src: url }, { children: _jsx("img", { src: url, alt: url, width: 48, height: 32 }) }), url)); }) })));
32
+ var _a, _b, _c;
33
+ return (_jsx(PhotoProvider, __assign({ maskOpacity: 0.5 }, { children: (_c = (_b = (_a = answer.formAnswer) === null || _a === void 0 ? void 0 : _a.files) === null || _b === void 0 ? void 0 : _b.filter(function (v) { return v; })) === null || _c === void 0 ? void 0 : _c.map(function (url) { return (_jsx(PhotoView, __assign({ src: url }, { children: _jsx("img", { src: url, alt: url, width: 48, height: 32 }) }), url)); }) })));
34
34
  };
35
35
  var fillBlanks = function (answer) { var _a, _b; return _jsx(Typography, __assign({ variant: "body2" }, { children: (_b = (_a = answer === null || answer === void 0 ? void 0 : answer.formAnswer) === null || _a === void 0 ? void 0 : _a.answer) === null || _b === void 0 ? void 0 : _b.join(',') })); };
36
36
  var Choice = function (answer) {
@@ -46,7 +46,12 @@ var template = (_a = {},
46
46
  _a[QUESTION_TYPE.RADIO] = Choice,
47
47
  _a[QUESTION_TYPE.CHECKBOX] = Choice,
48
48
  _a[QUESTION_TYPE.ESSAY_QUESTION] = function (answer) { var _a; return (_a = answer === null || answer === void 0 ? void 0 : answer.formAnswer) === null || _a === void 0 ? void 0 : _a.answer; },
49
- _a[QUESTION_TYPE.TIME] = function (answer) { var _a, _b; return ((_a = answer === null || answer === void 0 ? void 0 : answer.formAnswer) === null || _a === void 0 ? void 0 : _a.dateTime) && dayjs(Number((_b = answer === null || answer === void 0 ? void 0 : answer.formAnswer) === null || _b === void 0 ? void 0 : _b.dateTime) * 1000).format('YYYY年MM月DD日'); },
49
+ _a[QUESTION_TYPE.TIME] = function (answer) {
50
+ var _a, _b, _c;
51
+ return ((_a = answer === null || answer === void 0 ? void 0 : answer.formAnswer) === null || _a === void 0 ? void 0 : _a.dateTime) &&
52
+ !isNaN((_b = answer === null || answer === void 0 ? void 0 : answer.formAnswer) === null || _b === void 0 ? void 0 : _b.dateTime) &&
53
+ dayjs(Number((_c = answer === null || answer === void 0 ? void 0 : answer.formAnswer) === null || _c === void 0 ? void 0 : _c.dateTime) * 1000).format('YYYY年MM月DD日');
54
+ },
50
55
  _a[QUESTION_TYPE.SCHOOL] = function (answer) { var _a; return (_a = answer === null || answer === void 0 ? void 0 : answer.formAnswer) === null || _a === void 0 ? void 0 : _a.answer; },
51
56
  _a[QUESTION_TYPE.FILL_BLANKS] = fillBlanks,
52
57
  _a[QUESTION_TYPE.NPS] = Nps,
@@ -54,16 +59,23 @@ var template = (_a = {},
54
59
  _a);
55
60
  var Form = function (_a) {
56
61
  var answers = _a.answers, _b = _a.customProcessName, customProcessName = _b === void 0 ? '资料收集' : _b;
57
- return (_jsxs(Box, __assign({ component: Paper, m: 3, pt: 2 }, { children: [_jsxs(Typography, __assign({ variant: "h6", sx: {
62
+ return (_jsxs(Box, __assign({ component: Paper, m: 3, pt: 2 }, { children: [_jsxs(Box, __assign({ display: "flex", sx: {
63
+ height: 40,
58
64
  pl: 3,
65
+ pr: 4,
59
66
  color: '#009D56',
60
67
  background: 'url(//webcdn.fbmms.cn/assets/yt-b/yf2BqqIlr8Xtb8N2o44t1) no-repeat center center',
61
68
  backgroundSize: 'contain',
62
- width: 24 + (56 / 4) * customProcessName.length + 84,
69
+ width: 'fit-content',
70
+ overflow: 'hidden',
63
71
  mb: 2,
64
- display: 'flex',
65
72
  alignItems: 'center',
66
- } }, { children: [_jsx(EditIcon, {}), customProcessName] })), _jsxs(Stack, __assign({ p: 3, pt: 0 }, { children: [_jsxs(Stack, __assign({ direction: "row", sx: {
73
+ } }, { children: [_jsx("img", { className: "MuiSvgIcon-root", src: "//webcdn.fbmms.cn/assets/Vj2m/QMPCkdJ4uQYCS0ovOtKJ5", alt: "", width: 20, height: 20 }), _jsx(DinTypography, __assign({ variant: "h6", sx: {
74
+ ml: 1,
75
+ color: '#009D56',
76
+ lineHeight: '24px',
77
+ width: 'auto',
78
+ } }, { children: customProcessName }))] })), _jsxs(Stack, __assign({ p: 3, pt: 0 }, { children: [_jsxs(Stack, __assign({ direction: "row", sx: {
67
79
  background: '#E5FDE6',
68
80
  color: '#009D56',
69
81
  borderRadius: 20,
@@ -77,7 +89,7 @@ var Form = function (_a) {
77
89
  return (_jsxs(_Fragment, { children: [_jsxs(Stack, __assign({ direction: "row", sx: {
78
90
  py: 1,
79
91
  px: 2,
80
- } }, { children: [_jsxs(Typography, __assign({ variant: "body2", sx: { width: 52 } }, { children: [index + 1, " -", answer.formTypeId] })), _jsx(Typography, __assign({ variant: "body2", flex: 1, mr: 7 }, { children: answer.formTypeKey })), _jsx(Typography, __assign({ variant: "body2", flex: 1 }, { children: (_a = template[answer.formTypeId]) === null || _a === void 0 ? void 0 : _a.call(template, answer) }))] }), index), _jsx(Box, { sx: { background: '#fff', height: 2, mx: 1 } })] }));
92
+ } }, { children: [_jsx(Typography, __assign({ variant: "body2", sx: { width: 52 } }, { children: index + 1 })), _jsx(Typography, __assign({ variant: "body2", flex: 1, mr: 7 }, { children: answer.formTypeKey })), _jsx(Typography, __assign({ variant: "body2", flex: 1 }, { children: (_a = template[answer.formTypeId]) === null || _a === void 0 ? void 0 : _a.call(template, answer) }))] }), index), _jsx(Box, { sx: { background: '#fff', height: 2, mx: 1 } })] }));
81
93
  }) }))] }))] })));
82
94
  };
83
95
  export default Form;
@@ -1,9 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { FormReports } from './interface';
3
3
  export interface FormsProps {
4
- fetchFormReuslt: () => Promise<FormReports>;
4
+ fetchFormResult: () => Promise<FormReports>;
5
5
  }
6
- declare const Forms: ({ fetchFormReuslt }: {
7
- fetchFormReuslt: any;
6
+ declare const Forms: ({ fetchFormResult }: {
7
+ fetchFormResult: any;
8
8
  }) => JSX.Element;
9
9
  export default Forms;