eli-video-interview 1.2.14 → 1.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/modules/ai-report/components/ScoreReport/Bar.js +7 -7
- package/esm/modules/ai-report/components/VideoQuestion/ScoreSlider.js +2 -6
- package/lib/modules/ai-report/components/ScoreReport/Bar.js +7 -7
- package/lib/modules/ai-report/components/VideoQuestion/ScoreSlider.js +1 -5
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@ import { useAiReportStore } from "../../../../store/ai-report/global-store";
|
|
|
17
17
|
import { rankPercent } from '../../utils';
|
|
18
18
|
var Bar = function () {
|
|
19
19
|
var _a = useState(1), currentRank = _a[0], setCurrentRank = _a[1];
|
|
20
|
-
var _b = useState('
|
|
20
|
+
var _b = useState(''), text = _b[0], setText = _b[1];
|
|
21
21
|
var _c = useAiReportStore(function (store) { return [store.reportResult, store.scoreRankIntervals]; }), reportResult = _c.reportResult, scoreRankIntervals = _c.scoreRankIntervals, reportRank = _c.reportRank;
|
|
22
22
|
var _d = (reportResult || {}).score, score = _d === void 0 ? 0 : _d;
|
|
23
23
|
useEffect(function () {
|
|
@@ -25,12 +25,12 @@ var Bar = function () {
|
|
|
25
25
|
if (floatInterval) {
|
|
26
26
|
var rank = floatInterval.rank;
|
|
27
27
|
setCurrentRank(rank);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
}
|
|
29
|
+
if (reportRank === null || reportRank === void 0 ? void 0 : reportRank.total) {
|
|
30
|
+
setText("\u51FB\u8D25\u4E86".concat(rankPercent((reportRank === null || reportRank === void 0 ? void 0 : reportRank.rank) || 0, (reportRank === null || reportRank === void 0 ? void 0 : reportRank.total) || 0).toFixed(0), "%\u5019\u9009\u4EBA"));
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
setText('');
|
|
34
34
|
}
|
|
35
35
|
}, [score, reportRank, scoreRankIntervals]);
|
|
36
36
|
if (!scoreRankIntervals || (scoreRankIntervals === null || scoreRankIntervals === void 0 ? void 0 : scoreRankIntervals.length) === 0)
|
|
@@ -12,9 +12,8 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { useCallback, useEffect, useState } from 'react';
|
|
14
14
|
import { Tooltip, Typography } from 'fbm-ui';
|
|
15
|
-
import { scoreRankIntervalColors } from "../../../../constants/ai-report";
|
|
16
15
|
import { useAiReportStore } from "../../../../store/ai-report/global-store";
|
|
17
|
-
import { AiScoreRoot,
|
|
16
|
+
import { AiScoreRoot, ScoreSliderRoot, StyledSlider } from './styled';
|
|
18
17
|
var ScoreSlider = function (props) {
|
|
19
18
|
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;
|
|
20
19
|
var aiScore = originScore.toFixed(0);
|
|
@@ -26,9 +25,6 @@ var ScoreSlider = function (props) {
|
|
|
26
25
|
useEffect(function () {
|
|
27
26
|
setScore(Number(finalScore.toFixed(0)));
|
|
28
27
|
}, [finalScore]);
|
|
29
|
-
return (_jsxs(ScoreSliderRoot, __assign({ width: width }, { children: [isShowScoreRank && (
|
|
30
|
-
var rank = _a.rank, _b = _a.scoreRankIntervals, startRankProportion = _b.startRankProportion, endRankProportion = _b.endRankProportion, _c = _a.score, startScore = _c.startScore, endScore = _c.endScore;
|
|
31
|
-
return (_jsx(Tooltip, __assign({ title: "\u524D".concat(startRankProportion * 100, "%-").concat(endRankProportion * 100, "%"), placement: "top" }, { children: _jsx(RankingRoot, { sx: { width: "".concat(endScore - startScore, "%"), left: "".concat(startScore, "%"), bgcolor: scoreRankIntervalColors[index] } }) }), rank));
|
|
32
|
-
}), _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: 80, flexShrink: 0, textAlign: "right", variant: "body2" }, { children: [score, "\u5206"] })))] })));
|
|
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: 80, flexShrink: 0, textAlign: "right", variant: "body2" }, { children: [score, "\u5206"] })))] })));
|
|
33
29
|
};
|
|
34
30
|
export default ScoreSlider;
|
|
@@ -19,7 +19,7 @@ var global_store_1 = require("../../../../store/ai-report/global-store");
|
|
|
19
19
|
var utils_1 = require("../../utils");
|
|
20
20
|
var Bar = function () {
|
|
21
21
|
var _a = (0, react_1.useState)(1), currentRank = _a[0], setCurrentRank = _a[1];
|
|
22
|
-
var _b = (0, react_1.useState)('
|
|
22
|
+
var _b = (0, react_1.useState)(''), text = _b[0], setText = _b[1];
|
|
23
23
|
var _c = (0, global_store_1.useAiReportStore)(function (store) { return [store.reportResult, store.scoreRankIntervals]; }), reportResult = _c.reportResult, scoreRankIntervals = _c.scoreRankIntervals, reportRank = _c.reportRank;
|
|
24
24
|
var _d = (reportResult || {}).score, score = _d === void 0 ? 0 : _d;
|
|
25
25
|
(0, react_1.useEffect)(function () {
|
|
@@ -27,12 +27,12 @@ var Bar = function () {
|
|
|
27
27
|
if (floatInterval) {
|
|
28
28
|
var rank = floatInterval.rank;
|
|
29
29
|
setCurrentRank(rank);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
}
|
|
31
|
+
if (reportRank === null || reportRank === void 0 ? void 0 : reportRank.total) {
|
|
32
|
+
setText("\u51FB\u8D25\u4E86".concat((0, utils_1.rankPercent)((reportRank === null || reportRank === void 0 ? void 0 : reportRank.rank) || 0, (reportRank === null || reportRank === void 0 ? void 0 : reportRank.total) || 0).toFixed(0), "%\u5019\u9009\u4EBA"));
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
setText('');
|
|
36
36
|
}
|
|
37
37
|
}, [score, reportRank, scoreRankIntervals]);
|
|
38
38
|
if (!scoreRankIntervals || (scoreRankIntervals === null || scoreRankIntervals === void 0 ? void 0 : scoreRankIntervals.length) === 0)
|
|
@@ -14,7 +14,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
15
|
var react_1 = require("react");
|
|
16
16
|
var fbm_ui_1 = require("fbm-ui");
|
|
17
|
-
var ai_report_1 = require("../../../../constants/ai-report");
|
|
18
17
|
var global_store_1 = require("../../../../store/ai-report/global-store");
|
|
19
18
|
var styled_1 = require("./styled");
|
|
20
19
|
var ScoreSlider = function (props) {
|
|
@@ -28,9 +27,6 @@ var ScoreSlider = function (props) {
|
|
|
28
27
|
(0, react_1.useEffect)(function () {
|
|
29
28
|
setScore(Number(finalScore.toFixed(0)));
|
|
30
29
|
}, [finalScore]);
|
|
31
|
-
return ((0, jsx_runtime_1.jsxs)(styled_1.ScoreSliderRoot, __assign({ width: width }, { children: [isShowScoreRank && ((0, jsx_runtime_1.
|
|
32
|
-
var rank = _a.rank, _b = _a.scoreRankIntervals, startRankProportion = _b.startRankProportion, endRankProportion = _b.endRankProportion, _c = _a.score, startScore = _c.startScore, endScore = _c.endScore;
|
|
33
|
-
return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: "\u524D".concat(startRankProportion * 100, "%-").concat(endRankProportion * 100, "%"), placement: "top" }, { children: (0, jsx_runtime_1.jsx)(styled_1.RankingRoot, { sx: { width: "".concat(endScore - startScore, "%"), left: "".concat(startScore, "%"), bgcolor: ai_report_1.scoreRankIntervalColors[index] } }) }), rank));
|
|
34
|
-
}), (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: 80, flexShrink: 0, textAlign: "right", variant: "body2" }, { children: [score, "\u5206"] })))] })));
|
|
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: 80, flexShrink: 0, textAlign: "right", variant: "body2" }, { children: [score, "\u5206"] })))] })));
|
|
35
31
|
};
|
|
36
32
|
exports.default = ScoreSlider;
|