eli-video-interview 1.6.5 → 1.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/components/Charts/ReportPie.js +5 -5
- package/esm/modules/ai-report/components/ScoreReport/styled.d.ts +1 -1
- package/esm/modules/ai-report-v2/components/ScoreReport/styled.d.ts +1 -1
- package/esm/modules/ai-report-v3/Root.js +3 -3
- package/esm/modules/ai-report-v3/components/AIEvaluate/Evaluate.js +67 -12
- package/esm/modules/ai-report-v3/components/AIEvaluate/Graph.d.ts +1 -1
- package/esm/modules/ai-report-v3/components/AIEvaluate/Graph.js +198 -66
- package/esm/modules/ai-report-v3/components/AIEvaluate/index.js +2 -2
- package/esm/modules/ai-report-v3/components/CheatRisk/CheatRisk.js +77 -26
- package/esm/modules/ai-report-v3/components/Form/Form.js +1 -1
- package/esm/modules/ai-report-v3/components/ModuleTitle.d.ts +3 -1
- package/esm/modules/ai-report-v3/components/ModuleTitle.js +19 -8
- package/esm/modules/ai-report-v3/components/ScoreReport/styled.d.ts +1 -1
- package/esm/modules/ai-report-v3/components/SectionTabs/SectionTabs.js +1 -1
- package/esm/modules/ai-report-v3/components/V3Header/V3Header.d.ts +2 -1
- package/esm/modules/ai-report-v3/components/V3Header/V3Header.js +18 -49
- package/esm/modules/ai-report-v3/components/VideoQuestion/QuestionItem.js +50 -18
- package/esm/modules/ai-report-v3/components/VideoQuestion/index.js +4 -3
- package/esm/modules/ai-report-v3/interface.d.ts +4 -0
- package/esm/modules/ai-report-v3/useAiReport.d.ts +1 -0
- package/esm/modules/ai-template/components/TemplateList/styled.d.ts +1 -1
- package/esm/utils/interceptor.js +35 -0
- package/lib/components/Charts/ReportPie.js +5 -5
- package/lib/modules/ai-report/components/ScoreReport/styled.d.ts +1 -1
- package/lib/modules/ai-report-v2/components/ScoreReport/styled.d.ts +1 -1
- package/lib/modules/ai-report-v3/Root.js +3 -3
- package/lib/modules/ai-report-v3/components/AIEvaluate/Evaluate.js +65 -10
- package/lib/modules/ai-report-v3/components/AIEvaluate/Graph.d.ts +1 -1
- package/lib/modules/ai-report-v3/components/AIEvaluate/Graph.js +198 -66
- package/lib/modules/ai-report-v3/components/AIEvaluate/index.js +1 -1
- package/lib/modules/ai-report-v3/components/CheatRisk/CheatRisk.js +76 -25
- package/lib/modules/ai-report-v3/components/Form/Form.js +1 -1
- package/lib/modules/ai-report-v3/components/ModuleTitle.d.ts +3 -1
- package/lib/modules/ai-report-v3/components/ModuleTitle.js +19 -8
- package/lib/modules/ai-report-v3/components/ScoreReport/styled.d.ts +1 -1
- package/lib/modules/ai-report-v3/components/SectionTabs/SectionTabs.js +1 -1
- package/lib/modules/ai-report-v3/components/V3Header/V3Header.d.ts +2 -1
- package/lib/modules/ai-report-v3/components/V3Header/V3Header.js +18 -49
- package/lib/modules/ai-report-v3/components/VideoQuestion/QuestionItem.js +50 -18
- package/lib/modules/ai-report-v3/components/VideoQuestion/index.js +4 -3
- package/lib/modules/ai-report-v3/interface.d.ts +4 -0
- package/lib/modules/ai-report-v3/useAiReport.d.ts +1 -0
- package/lib/modules/ai-template/components/TemplateList/styled.d.ts +1 -1
- package/lib/utils/interceptor.js +35 -0
- package/package.json +1 -1
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __values = (this && this.__values) || function(o) {
|
|
3
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
4
|
+
if (m) return m.call(o);
|
|
5
|
+
if (o && typeof o.length === "number") return {
|
|
6
|
+
next: function () {
|
|
7
|
+
if (o && i >= o.length) o = void 0;
|
|
8
|
+
return { value: o && o[i++], done: !o };
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
12
|
+
};
|
|
2
13
|
var __read = (this && this.__read) || function (o, n) {
|
|
3
14
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
15
|
if (!m) return o;
|
|
@@ -33,46 +44,75 @@ function setupCanvas(canvas) {
|
|
|
33
44
|
// Good: Array<number>;
|
|
34
45
|
// Best: Array<number>;
|
|
35
46
|
// }
|
|
36
|
-
var MAX_WIDTH =
|
|
37
|
-
var MAX_HEIGHT =
|
|
47
|
+
var MAX_WIDTH = 354;
|
|
48
|
+
var MAX_HEIGHT = 18;
|
|
49
|
+
// 底部"更多考核维度"提示胶囊(设计稿「容器 14851」,画进 canvas 而非 HTML)
|
|
50
|
+
var CAPTION_TEXT = '更多考核维度请展开上方综合评价查看详情';
|
|
51
|
+
var CAPTION_HEIGHT = 20;
|
|
52
|
+
// 粗略估算文本像素宽(与下方绘制所用 sans-serif 接近;中文宽、拉丁/数字窄)
|
|
53
|
+
var estimateTextWidth = function (s, cjkW, latinW) {
|
|
54
|
+
var e_1, _a;
|
|
55
|
+
if (cjkW === void 0) { cjkW = 14; }
|
|
56
|
+
if (latinW === void 0) { latinW = 7.5; }
|
|
57
|
+
var w = 0;
|
|
58
|
+
try {
|
|
59
|
+
for (var s_1 = __values(s), s_1_1 = s_1.next(); !s_1_1.done; s_1_1 = s_1.next()) {
|
|
60
|
+
var ch = s_1_1.value;
|
|
61
|
+
w += /[ -鿿-]/.test(ch) ? cjkW : latinW;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
65
|
+
finally {
|
|
66
|
+
try {
|
|
67
|
+
if (s_1_1 && !s_1_1.done && (_a = s_1.return)) _a.call(s_1);
|
|
68
|
+
}
|
|
69
|
+
finally { if (e_1) throw e_1.error; }
|
|
70
|
+
}
|
|
71
|
+
return w;
|
|
72
|
+
};
|
|
38
73
|
var levelOrder = ['Bad', 'Good', 'Best'];
|
|
39
|
-
|
|
74
|
+
// 表头三段宽度(设计稿 176:89:89,铺满轨道 MAX_WIDTH)
|
|
75
|
+
var LEVEL_WIDTHS = {
|
|
76
|
+
Bad: (MAX_WIDTH * (176 / 354)) | 0,
|
|
77
|
+
Good: (MAX_WIDTH * (89 / 354)) | 0,
|
|
78
|
+
Best: MAX_WIDTH - ((MAX_WIDTH * (176 / 354)) | 0) - ((MAX_WIDTH * (89 / 354)) | 0),
|
|
79
|
+
};
|
|
40
80
|
var levelConf = {
|
|
41
81
|
Bad: {
|
|
42
82
|
label: '欠佳',
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
color: [229, 115, 115],
|
|
83
|
+
fontColor: '#FFFFFF',
|
|
84
|
+
color: [98, 156, 255],
|
|
46
85
|
gradient: ['#629CFF', 'rgba(75,141,255,0.08)'],
|
|
47
86
|
scoreGradient: ['#4B87F0', '#D2E2FF'],
|
|
48
87
|
backgroundColor: 'rgba(98,156,255,0.15)',
|
|
49
|
-
shadowColor: 'rgba(98,
|
|
88
|
+
shadowColor: 'rgba(98,156,255,0.4)',
|
|
89
|
+
textColor: '#2E6ED8',
|
|
50
90
|
endScore: 60,
|
|
51
|
-
pointColor: ['RGB(
|
|
91
|
+
pointColor: ['RGB(98, 156, 255)', 'RGB(98, 156, 255)'],
|
|
52
92
|
},
|
|
53
93
|
Good: {
|
|
54
94
|
label: '适中',
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
color: [255, 183, 77],
|
|
95
|
+
fontColor: '#ffffff',
|
|
96
|
+
color: [0, 217, 157],
|
|
58
97
|
gradient: ['#00D99D', '#CBFFF1'],
|
|
59
98
|
scoreGradient: ['#0ACB96', '#65FFD4'],
|
|
60
99
|
backgroundColor: 'rgba(0,217,157,0.15)',
|
|
61
|
-
shadowColor: 'rgba(0,
|
|
100
|
+
shadowColor: 'rgba(0,217,157,0.4)',
|
|
101
|
+
textColor: '#0A9E71',
|
|
62
102
|
endScore: 80,
|
|
63
|
-
pointColor: ['RGB(
|
|
103
|
+
pointColor: ['RGB(0, 217, 157)', 'RGB(0, 217, 157)'],
|
|
64
104
|
},
|
|
65
105
|
Best: {
|
|
66
106
|
label: '优秀',
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
color: [0, 217, 157],
|
|
107
|
+
fontColor: '#ffffff',
|
|
108
|
+
color: [255, 153, 3],
|
|
70
109
|
gradient: ['#FF9903', 'rgba(255,218,165,0.29)'],
|
|
71
110
|
scoreGradient: ['#FF9903', '#FFDF9D'],
|
|
72
|
-
shadowColor: 'rgba(255, 153, 3, 0.40)',
|
|
73
111
|
backgroundColor: 'rgba(255,183,77,0.15)',
|
|
112
|
+
shadowColor: 'rgba(255,153,3,0.4)',
|
|
113
|
+
textColor: '#E07E00',
|
|
74
114
|
endScore: 100,
|
|
75
|
-
pointColor: ['RGB(
|
|
115
|
+
pointColor: ['RGB(255, 153, 3)', 'RGB(255, 153, 3)'],
|
|
76
116
|
},
|
|
77
117
|
};
|
|
78
118
|
var tipEl = document.createElement('div');
|
|
@@ -90,34 +130,28 @@ function isInPath(x, y, rect, ctx) {
|
|
|
90
130
|
}
|
|
91
131
|
var drawTop = function (layout, ctx) {
|
|
92
132
|
// 设置全局样式
|
|
93
|
-
var leftLableWidth = layout.leftLableWidth,
|
|
133
|
+
var leftLableWidth = layout.leftLableWidth, shiftY = layout.shiftY, dashEndY = layout.dashEndY;
|
|
134
|
+
ctx.font = '14px sans-serif';
|
|
94
135
|
var offset = leftLableWidth;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
var gradientFill = ctx.createLinearGradient(0, 0, 0, 25);
|
|
136
|
+
levelOrder.forEach(function (level) {
|
|
137
|
+
var width = LEVEL_WIDTHS[level];
|
|
138
|
+
var _a = levelConf[level], gradient = _a.gradient, label = _a.label, fontColor = _a.fontColor;
|
|
139
|
+
// 绘制渐变背景(设计稿 180deg:上=主色,下=淡色过渡)
|
|
140
|
+
var gradientFill = ctx.createLinearGradient(0, shiftY, 0, shiftY + 25);
|
|
101
141
|
gradientFill.addColorStop(0, gradient[0]);
|
|
102
142
|
gradientFill.addColorStop(1, gradient[1]);
|
|
103
143
|
ctx.fillStyle = gradientFill;
|
|
104
|
-
ctx.fillRect(offset,
|
|
105
|
-
//
|
|
144
|
+
ctx.fillRect(offset, shiftY, width, 25);
|
|
145
|
+
// 绘制标签文本(置于色带中上,避开底部透明渐变区)
|
|
106
146
|
var labelWidth = measureTextWidth(ctx, label);
|
|
107
147
|
ctx.fillStyle = fontColor;
|
|
108
|
-
ctx.fillText(label, offset + width / 2 - labelWidth / 2,
|
|
109
|
-
//
|
|
110
|
-
drawVerticalDashedLine(ctx, offset - 1,
|
|
111
|
-
|
|
112
|
-
ctx.fillStyle = '#4CAF50';
|
|
113
|
-
ctx.fillText("".concat(levelOrderScore[i]), offset - (i === 0 ? 5 : 9), scoreTextY);
|
|
114
|
-
offset += width + 1;
|
|
115
|
-
// 绘制结束的虚线和文本 '100'
|
|
116
|
-
if (i === levelOrder.length - 1) {
|
|
117
|
-
drawVerticalDashedLine(ctx, offset - 2, 0, lineEndY, 2, 2);
|
|
118
|
-
ctx.fillText('100', offset - 2 - 24, scoreTextY);
|
|
119
|
-
}
|
|
148
|
+
ctx.fillText(label, offset + width / 2 - labelWidth / 2, shiftY + 16);
|
|
149
|
+
// 绘制垂直虚线(色带分隔 → 末条底部下方 dashEndY)
|
|
150
|
+
drawVerticalDashedLine(ctx, offset - 1, shiftY + 25, dashEndY, 2, 2);
|
|
151
|
+
offset += width;
|
|
120
152
|
});
|
|
153
|
+
// 右端收口虚线
|
|
154
|
+
drawVerticalDashedLine(ctx, offset - 1, shiftY + 25, dashEndY, 2, 2);
|
|
121
155
|
};
|
|
122
156
|
var truncateString = function (str) { return (str.length > 7 ? "".concat(str.slice(0, 6), "...") : str); };
|
|
123
157
|
var drawLable = function (lable, x, y, ctx) {
|
|
@@ -128,7 +162,7 @@ function drawVerticalDashedLine(ctx, x, startY, endY, dashLength, gapLength) {
|
|
|
128
162
|
if (dashLength === void 0) { dashLength = 2; }
|
|
129
163
|
if (gapLength === void 0) { gapLength = 1; }
|
|
130
164
|
ctx.lineWidth = 1;
|
|
131
|
-
ctx.strokeStyle = 'rgba(
|
|
165
|
+
ctx.strokeStyle = 'rgba(153, 153, 153, 0.35)';
|
|
132
166
|
ctx.beginPath();
|
|
133
167
|
ctx.setLineDash([dashLength, gapLength]);
|
|
134
168
|
ctx.moveTo(x, startY);
|
|
@@ -165,35 +199,43 @@ function getLevel(score) {
|
|
|
165
199
|
}
|
|
166
200
|
exports.getLevel = getLevel;
|
|
167
201
|
var drawScore = function (layout, ctx, config, rect, score) {
|
|
168
|
-
var
|
|
202
|
+
var text = "".concat(score);
|
|
203
|
+
ctx.save();
|
|
204
|
+
// 渐变数据条(设计稿 90deg:左=强色 0% → 右=淡色 100%),圆角胶囊
|
|
205
|
+
var gradient = ctx.createLinearGradient(rect.x, 0, rect.x + rect.width, 0);
|
|
169
206
|
gradient.addColorStop(0, config.scoreGradient[0]);
|
|
170
207
|
gradient.addColorStop(1, config.scoreGradient[1]);
|
|
171
208
|
ctx.fillStyle = gradient;
|
|
172
|
-
// // 设置阴影
|
|
173
209
|
ctx.shadowOffsetX = 0;
|
|
174
210
|
ctx.shadowOffsetY = 4;
|
|
175
211
|
ctx.shadowBlur = 6;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
ctx.
|
|
212
|
+
ctx.shadowColor = config.shadowColor;
|
|
213
|
+
var barRadius = rect.height / 2;
|
|
214
|
+
drawRoundedRect(rect.x, rect.y, rect.width, rect.height, barRadius, true, false, ctx);
|
|
215
|
+
ctx.restore();
|
|
216
|
+
// 分数数字直接放在条末端右侧(无圆形背景,颜色取该档主色加深保证可读)
|
|
217
|
+
ctx.save();
|
|
218
|
+
ctx.font = 'bold 13px sans-serif';
|
|
219
|
+
var textW = measureTextWidth(ctx, text);
|
|
220
|
+
ctx.fillStyle = config.textColor || '#333';
|
|
221
|
+
ctx.textAlign = 'left';
|
|
222
|
+
ctx.textBaseline = 'middle';
|
|
223
|
+
ctx.fillText(text, rect.x + rect.width + 6, rect.y + rect.height / 2 + 1);
|
|
224
|
+
ctx.restore();
|
|
225
|
+
return textW;
|
|
183
226
|
};
|
|
184
227
|
var draw = function (layout, dimensions, pathRef, ctx) {
|
|
185
228
|
ctx.font = '14px sans-serif';
|
|
186
229
|
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
|
|
230
|
+
var shiftY = layout.shiftY;
|
|
187
231
|
dimensions.forEach(function (v, i) {
|
|
188
232
|
var config = getLevel(v.score);
|
|
189
|
-
// 绘制圆角矩形
|
|
190
|
-
var borderRadius = 12;
|
|
191
233
|
var x = layout.leftLableWidth;
|
|
192
|
-
var y =
|
|
193
|
-
//
|
|
234
|
+
var y = shiftY + 46 + layout.itemSpacing * i;
|
|
235
|
+
// 轨道胶囊背景(设计稿「条状图*条背景」:本档淡色 + 全圆角)
|
|
194
236
|
ctx.fillStyle = config.backgroundColor;
|
|
195
|
-
drawRoundedRect(x, y, MAX_WIDTH, MAX_HEIGHT,
|
|
196
|
-
var endPointY =
|
|
237
|
+
drawRoundedRect(x, y, MAX_WIDTH, MAX_HEIGHT, MAX_HEIGHT / 2, true, false, ctx);
|
|
238
|
+
var endPointY = shiftY + 46 + 14 + layout.itemSpacing * i; // TOP_OFFSET是顶部偏移,14是文字相对矩形的偏移
|
|
197
239
|
drawLable(v.name, 0, endPointY, ctx);
|
|
198
240
|
pathRef.push({ x: 0, y: y, width: layout.leftLableWidth, height: 22, tips: "".concat(v.name, ": ").concat(v.score) });
|
|
199
241
|
var score = v.score === 0 ? 0 : Math.max(v.score, 4);
|
|
@@ -206,21 +248,91 @@ var draw = function (layout, dimensions, pathRef, ctx) {
|
|
|
206
248
|
});
|
|
207
249
|
drawTop(layout, ctx);
|
|
208
250
|
};
|
|
251
|
+
// 底部提示胶囊:浅绿圆角胶囊(#EBFCF7, 淡青描边) + 居中青色(#0087B4)文字(y 为胶囊顶)
|
|
252
|
+
var drawCaption = function (ctx, canvasWidth, y) {
|
|
253
|
+
var width = Math.min(440, canvasWidth - 24);
|
|
254
|
+
var height = CAPTION_HEIGHT;
|
|
255
|
+
var x = (canvasWidth - width) / 2;
|
|
256
|
+
ctx.save();
|
|
257
|
+
ctx.fillStyle = '#EBFCF7';
|
|
258
|
+
ctx.strokeStyle = 'rgba(0,135,180,0.1)';
|
|
259
|
+
ctx.lineWidth = 1;
|
|
260
|
+
drawRoundedRect(x, y, width, height, height / 2, true, true, ctx);
|
|
261
|
+
ctx.font = '12px sans-serif';
|
|
262
|
+
ctx.textAlign = 'center';
|
|
263
|
+
ctx.textBaseline = 'middle';
|
|
264
|
+
ctx.fillStyle = '#0087B4';
|
|
265
|
+
ctx.fillText(CAPTION_TEXT, canvasWidth / 2, y + height / 2);
|
|
266
|
+
ctx.restore();
|
|
267
|
+
};
|
|
268
|
+
// 刻度值:欠佳|适中 分界=60、适中|优秀 分界=80、优秀满格(右端线)=100
|
|
269
|
+
var drawScaleTicks = function (ctx, opts) {
|
|
270
|
+
var y = opts.y, x60 = opts.x60, x80 = opts.x80, xRight = opts.xRight;
|
|
271
|
+
ctx.save();
|
|
272
|
+
ctx.font = '11px sans-serif';
|
|
273
|
+
ctx.textBaseline = 'middle';
|
|
274
|
+
ctx.fillStyle = 'rgba(102,102,102,0.78)';
|
|
275
|
+
ctx.textAlign = 'center';
|
|
276
|
+
ctx.fillText('60', x60, y);
|
|
277
|
+
ctx.fillText('80', x80, y);
|
|
278
|
+
ctx.textAlign = 'right';
|
|
279
|
+
ctx.fillText('100', xRight - 3, y); // 右端线:右对齐向内收,避免出画布
|
|
280
|
+
ctx.restore();
|
|
281
|
+
};
|
|
209
282
|
var Graph = function (_a) {
|
|
210
283
|
var _b = _a.items, items = _b === void 0 ? [] : _b;
|
|
211
284
|
var ref = (0, react_1.useRef)(null);
|
|
212
285
|
var pathRef = (0, react_1.useRef)([]);
|
|
213
286
|
var _c = __read((0, react_1.useState)(), 2), ctx = _c[0], setCtx = _c[1];
|
|
214
|
-
//
|
|
215
|
-
var ITEM_SPACING =
|
|
216
|
-
var TOP_OFFSET =
|
|
217
|
-
var
|
|
218
|
-
var
|
|
219
|
-
var
|
|
287
|
+
// ---- 垂直布局常量(条图 → 刻度 → 胶囊 的紧凑垂直流)----
|
|
288
|
+
var ITEM_SPACING = 28; // 相邻条间距
|
|
289
|
+
var TOP_OFFSET = 46; // 条顶相对内容顶 shiftY 的偏移
|
|
290
|
+
var CANVAS_HEIGHT = 300; // 与右侧饼图等高(内容不足时保持,超出按流增高)
|
|
291
|
+
var DASH_TAIL = 8; // 刻度虚线超出最后一条条底的长度
|
|
292
|
+
var TICK_LINE = 14; // 刻度数值行高
|
|
293
|
+
var GAP_CAPTION = 8; // 刻度数 → 提示胶囊间距
|
|
294
|
+
var CAPTION_PAD_BOTTOM = 12; // 胶囊下方留白
|
|
295
|
+
// 条形区域高度(shiftY 内容顶 → 最后一条条底)
|
|
296
|
+
var contentHeight = (0, react_1.useMemo)(function () {
|
|
297
|
+
if (items.length === 0)
|
|
298
|
+
return 0;
|
|
299
|
+
return TOP_OFFSET + (items.length - 1) * ITEM_SPACING + MAX_HEIGHT;
|
|
300
|
+
}, [items]);
|
|
301
|
+
// 可见内容块高度(条图 → 刻度 → 胶囊),不含外留白
|
|
302
|
+
var bodyHeight = contentHeight + DASH_TAIL + TICK_LINE + GAP_CAPTION + CAPTION_HEIGHT;
|
|
303
|
+
// 画布高:≥300,且内容上下各保留 ≥CAPTION_PAD_BOTTOM 的对称留白
|
|
304
|
+
var canvasHeight = (0, react_1.useMemo)(function () { return Math.max(CANVAS_HEIGHT, bodyHeight + 2 * CAPTION_PAD_BOTTOM); }, [bodyHeight]);
|
|
305
|
+
// 内容块在画布内垂直居中 → 上留白 = 下留白
|
|
306
|
+
var shiftY = (0, react_1.useMemo)(function () {
|
|
307
|
+
if (bodyHeight <= 0)
|
|
308
|
+
return 0;
|
|
309
|
+
return Math.max(0, Math.round((canvasHeight - bodyHeight) / 2));
|
|
310
|
+
}, [bodyHeight, canvasHeight]);
|
|
311
|
+
var dashEndY = shiftY + contentHeight + DASH_TAIL; // 虚线终点 = 末条条底 + DASH_TAIL
|
|
312
|
+
var tickMidY = shiftY + contentHeight + DASH_TAIL + Math.round(TICK_LINE / 2);
|
|
313
|
+
var captionY = shiftY + contentHeight + DASH_TAIL + TICK_LINE + GAP_CAPTION; // 胶囊顶
|
|
314
|
+
// 左标签列宽度贴合最长维度名,压缩文字与条形之间留白
|
|
315
|
+
var leftLabelWidth = (0, react_1.useMemo)(function () {
|
|
220
316
|
if (items.length === 0)
|
|
221
317
|
return 0;
|
|
222
|
-
|
|
318
|
+
var mx = 0;
|
|
319
|
+
items.forEach(function (it) { return (mx = Math.max(mx, estimateTextWidth(truncateString(it.name)))); });
|
|
320
|
+
return Math.min(Math.round(mx) + 18, 210);
|
|
223
321
|
}, [items]);
|
|
322
|
+
// 右边界:默认=色带/轨道右端(leftLabelWidth+MAX_WIDTH)。仅当某条高分条形末端的分数字(条尾+6px+数字宽)超出轨道时顺延,避免满格数字被裁。
|
|
323
|
+
var rightmostX = (0, react_1.useMemo)(function () {
|
|
324
|
+
var end = leftLabelWidth + MAX_WIDTH;
|
|
325
|
+
items.forEach(function (it) {
|
|
326
|
+
var s = it.score || 0;
|
|
327
|
+
var barWidth = s === 0 ? 0 : (MAX_WIDTH * Math.min(Math.max(s, 4), 100)) / 100;
|
|
328
|
+
var numEnd = leftLabelWidth + barWidth + 6 + estimateTextWidth("".concat(s));
|
|
329
|
+
if (numEnd > end)
|
|
330
|
+
end = numEnd;
|
|
331
|
+
});
|
|
332
|
+
return end;
|
|
333
|
+
}, [items, leftLabelWidth]);
|
|
334
|
+
// 画布宽紧贴内容,只留 6px 尾余(替代原固定 +48px 右留白)
|
|
335
|
+
var canvasWidth = Math.round(rightmostX + 6);
|
|
224
336
|
(0, react_1.useEffect)(function () {
|
|
225
337
|
if (items.length === 0)
|
|
226
338
|
return;
|
|
@@ -245,15 +357,35 @@ var Graph = function (_a) {
|
|
|
245
357
|
(0, react_1.useEffect)(function () {
|
|
246
358
|
if (ctx) {
|
|
247
359
|
var layout = {
|
|
248
|
-
leftLableWidth:
|
|
360
|
+
leftLableWidth: leftLabelWidth,
|
|
249
361
|
topLableHeight: 40,
|
|
250
362
|
itemSpacing: ITEM_SPACING,
|
|
251
|
-
height:
|
|
363
|
+
height: contentHeight,
|
|
364
|
+
shiftY: shiftY,
|
|
365
|
+
dashEndY: dashEndY,
|
|
252
366
|
};
|
|
253
367
|
pathRef.current = [];
|
|
254
368
|
draw(layout, items, pathRef.current, ctx);
|
|
369
|
+
drawScaleTicks(ctx, {
|
|
370
|
+
y: tickMidY,
|
|
371
|
+
x60: leftLabelWidth + LEVEL_WIDTHS.Bad,
|
|
372
|
+
x80: leftLabelWidth + LEVEL_WIDTHS.Bad + LEVEL_WIDTHS.Good,
|
|
373
|
+
xRight: leftLabelWidth + MAX_WIDTH,
|
|
374
|
+
});
|
|
375
|
+
drawCaption(ctx, canvasWidth, captionY);
|
|
255
376
|
}
|
|
256
|
-
}, [
|
|
377
|
+
}, [
|
|
378
|
+
ctx,
|
|
379
|
+
items,
|
|
380
|
+
contentHeight,
|
|
381
|
+
shiftY,
|
|
382
|
+
leftLabelWidth,
|
|
383
|
+
canvasWidth,
|
|
384
|
+
ITEM_SPACING,
|
|
385
|
+
dashEndY,
|
|
386
|
+
tickMidY,
|
|
387
|
+
captionY,
|
|
388
|
+
]);
|
|
257
389
|
var handleMouseMove = (0, react_1.useCallback)(function (e) {
|
|
258
390
|
if (ctx) {
|
|
259
391
|
var p = pathRef.current.find(function (p) { return isInPath(e.nativeEvent.offsetX, e.nativeEvent.offsetY, p, ctx); });
|
|
@@ -268,6 +400,6 @@ var Graph = function (_a) {
|
|
|
268
400
|
}
|
|
269
401
|
}
|
|
270
402
|
}, [ctx, pathRef]);
|
|
271
|
-
return (0, jsx_runtime_1.jsx)("canvas", { ref: ref, onMouseOut: function () { return (tipEl.style.display = 'none'); }, onMouseMove: handleMouseMove, style: { width:
|
|
403
|
+
return ((0, jsx_runtime_1.jsx)("canvas", { ref: ref, onMouseOut: function () { return (tipEl.style.display = 'none'); }, onMouseMove: handleMouseMove, style: { width: canvasWidth, height: canvasHeight } }));
|
|
272
404
|
};
|
|
273
405
|
exports.default = (0, react_1.memo)(Graph);
|
|
@@ -32,6 +32,6 @@ var Index = function () {
|
|
|
32
32
|
}, [collection]);
|
|
33
33
|
if (!showAiDimension)
|
|
34
34
|
return null;
|
|
35
|
-
return ((0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ id: "report-evaluate", sx: { px: 2, mt:
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ id: "report-evaluate", sx: { px: 2, mt: 1.5 } }, { children: (0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ component: mui_1.Paper, elevation: 0, bgcolor: "transparent", mb: 3 }, { children: (0, jsx_runtime_1.jsxs)(mui_1.Stack, { children: [workplaceEvaluation && ((0, jsx_runtime_1.jsx)(Evaluate_1.default, { orderToken: orderToken, canEdit: canEditAiDimension, evaluation: workplaceEvaluation, title: "\u7EFC\u5408\u8BC4\u4EF7", mode: "show" })), collection.length > 0 && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", alignItems: "center", justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ flex: 1, minWidth: 0, sx: { display: 'flex', alignItems: 'center', justifyContent: 'center' } }, { children: (0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ sx: { display: 'inline-flex', flexDirection: 'column', alignItems: 'center' } }, { children: (0, jsx_runtime_1.jsx)(Graph_1.default, { items: items }) })) })), (0, jsx_runtime_1.jsx)(Report_1.default, {})] })) }))] }) })) })));
|
|
36
36
|
};
|
|
37
37
|
exports.default = (0, react_1.memo)(Index);
|
|
@@ -10,35 +10,86 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
14
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
|
-
if (!m) return o;
|
|
16
|
-
var i = m.call(o), r, ar = [], e;
|
|
17
|
-
try {
|
|
18
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
19
|
-
}
|
|
20
|
-
catch (error) { e = { error: error }; }
|
|
21
|
-
finally {
|
|
22
|
-
try {
|
|
23
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
24
|
-
}
|
|
25
|
-
finally { if (e) throw e.error; }
|
|
26
|
-
}
|
|
27
|
-
return ar;
|
|
28
|
-
};
|
|
29
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
14
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
31
15
|
var mui_1 = require("fbm-ui/lib/mui");
|
|
32
16
|
var fbm_ui_1 = require("fbm-ui");
|
|
33
|
-
var
|
|
34
|
-
//
|
|
17
|
+
var global_store_1 = require("../../../../store/ai-report/global-store");
|
|
18
|
+
// 报告头部与"作弊风险"章节共用的风险标签名(命中其一即视为存在面试过程风险)
|
|
19
|
+
var RISK_TAG_NAMES = ['疑似读稿', '疑似作弊', '面试切屏'];
|
|
20
|
+
// 作弊检测详情表(仅命中风险时展示;"有风险"文案取自蓝湖,未命中的行第三列统一"暂无风险")
|
|
21
|
+
var CHEAT_ROWS = [
|
|
22
|
+
{
|
|
23
|
+
name: '疑似读稿',
|
|
24
|
+
detail: '根据候选人面试回答过程的眼神表现,以及回答内容,候选人有读背稿的嫌疑,也有可能候选人的眼神变化只是在思考。',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: '面试切屏',
|
|
28
|
+
detail: '候选人面试答题过程中有切屏的动作,可能是去查阅资料,也有可能是系统其他应用弹窗导致。',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: '疑似作弊',
|
|
32
|
+
detail: '面试过程眼神、回答内容、面试行为综合诊断,候选人可能有作弊的嫌疑。',
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
// 单个风险标签胶囊(橙色警示样式,紧凑小号)
|
|
36
|
+
var RiskPill = function (_a) {
|
|
37
|
+
var name = _a.name;
|
|
38
|
+
return ((0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ sx: {
|
|
39
|
+
display: 'inline-flex',
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
gap: 0.5,
|
|
42
|
+
bgcolor: '#FFF7E6',
|
|
43
|
+
color: '#FA8C16',
|
|
44
|
+
border: '1px solid #FFD591',
|
|
45
|
+
borderRadius: '999px',
|
|
46
|
+
height: 20,
|
|
47
|
+
px: '8px',
|
|
48
|
+
fontSize: 12,
|
|
49
|
+
lineHeight: 1,
|
|
50
|
+
whiteSpace: 'nowrap',
|
|
51
|
+
} }, { children: [(0, jsx_runtime_1.jsxs)("svg", __assign({ width: "12", height: "12", viewBox: "0 0 24 24", fill: "none" }, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M12 3 1.5 21h21L12 3Z", fill: "#FA8C16" }), (0, jsx_runtime_1.jsx)("rect", { x: "11", y: "9", width: "2", height: "5", rx: "1", fill: "#fff" }), (0, jsx_runtime_1.jsx)("rect", { x: "11", y: "15.5", width: "2", height: "2", rx: "1", fill: "#fff" })] })), name] })));
|
|
52
|
+
};
|
|
53
|
+
// 表格里的风险评估徽标
|
|
54
|
+
var RiskBadge = function (_a) {
|
|
55
|
+
var has = _a.has;
|
|
56
|
+
return ((0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ sx: __assign({ display: 'inline-flex', alignItems: 'center', px: 1, py: 0.25, borderRadius: '999px', fontSize: 12, fontWeight: 500, whiteSpace: 'nowrap' }, (has
|
|
57
|
+
? { color: '#FA8C16', bgcolor: '#FFF7E6', border: '1px solid #FFD591' }
|
|
58
|
+
: { color: '#52C41A', bgcolor: '#EAFBEA', border: '1px solid #B7EB8F' })) }, { children: has ? '有风险' : '无风险' })));
|
|
59
|
+
};
|
|
60
|
+
// 作弊检测详情表(不带头标题行,仅表格)
|
|
61
|
+
var COL_W1 = 118; // 检测项目列宽
|
|
62
|
+
var COL_W2 = 130; // 风险评估列宽
|
|
63
|
+
var TEXT_COLOR = 'rgba(0,0,0,0.85)'; // 表格文字:比 0.6 深、不纯黑
|
|
64
|
+
var CheatDetailTable = function (_a) {
|
|
65
|
+
var hitNames = _a.hitNames;
|
|
66
|
+
return ((0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ sx: { mt: 2, borderRadius: 2, overflow: 'hidden', border: '1px solid rgba(0,191,255,0.05)', bgcolor: '#fff' } }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", sx: { background: 'rgba(0,191,255,0.04)', px: 1.5, py: 0.75, alignItems: 'center' } }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ sx: { width: COL_W1, flexShrink: 0, textAlign: 'center', color: TEXT_COLOR, fontSize: 12, fontWeight: 600 } }, { children: "\u68C0\u6D4B\u9879\u76EE" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ sx: { width: COL_W2, flexShrink: 0, textAlign: 'center', color: TEXT_COLOR, fontSize: 12, fontWeight: 600 } }, { children: "\u98CE\u9669\u8BC4\u4F30" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ sx: { flex: 1, textAlign: 'center', color: TEXT_COLOR, fontSize: 12, fontWeight: 600 } }, { children: "\u8BE6\u60C5\u8BF4\u660E" }))] })), CHEAT_ROWS.map(function (row, i) {
|
|
67
|
+
var hit = hitNames.has(row.name);
|
|
68
|
+
return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", sx: {
|
|
69
|
+
px: 1.5,
|
|
70
|
+
py: 0.75,
|
|
71
|
+
alignItems: 'center',
|
|
72
|
+
borderTop: '1px solid #F2F4F6',
|
|
73
|
+
bgcolor: i % 2 ? '#FAFCFE' : '#fff',
|
|
74
|
+
} }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ sx: { width: COL_W1, flexShrink: 0, textAlign: 'center', color: TEXT_COLOR, fontSize: 12 } }, { children: row.name })), (0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ sx: { width: COL_W2, flexShrink: 0, display: 'flex', justifyContent: 'center' } }, { children: (0, jsx_runtime_1.jsx)(RiskBadge, { has: hit }) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ sx: { flex: 1, textAlign: 'center', color: TEXT_COLOR, fontSize: 12, lineHeight: '20px' } }, { children: hit ? row.detail : '暂无风险' }))] }), row.name));
|
|
75
|
+
})] })));
|
|
76
|
+
};
|
|
35
77
|
var CheatRisk = function () {
|
|
36
|
-
var _a
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
78
|
+
var _a;
|
|
79
|
+
var store = (0, global_store_1.useAiReportStore)();
|
|
80
|
+
var v3AssetBase = store.v3AssetBase || '';
|
|
81
|
+
var reportResult = store.reportResult || {};
|
|
82
|
+
var interviewCheat = store.interviewCheat;
|
|
83
|
+
var _b = reportResult.screenSwitchCount, screenSwitchCount = _b === void 0 ? 0 : _b, _c = reportResult.candidateInfo, candidateInfo = _c === void 0 ? {} : _c, _d = reportResult.tags, reportTags = _d === void 0 ? [] : _d;
|
|
84
|
+
// 与报告头部同源取标签:候选人信息卡标签优先,兜底报告级标签
|
|
85
|
+
var tagList = ((_a = candidateInfo === null || candidateInfo === void 0 ? void 0 : candidateInfo.tags) === null || _a === void 0 ? void 0 : _a.length) ? candidateInfo.tags : reportTags;
|
|
86
|
+
var hitNames = new Set((tagList || []).map(function (t) { return t === null || t === void 0 ? void 0 : t.name; }).filter(function (n) { return Boolean(n); }));
|
|
87
|
+
var riskTags = (tagList || []).filter(function (t) { return RISK_TAG_NAMES.includes(t === null || t === void 0 ? void 0 : t.name); });
|
|
88
|
+
// 命中风险标签 或 旧字段(isCheat/切屏次数) 均视为有风险
|
|
89
|
+
var hasRisk = riskTags.length > 0 || !!(interviewCheat === null || interviewCheat === void 0 ? void 0 : interviewCheat.isCheat) || screenSwitchCount > 0;
|
|
90
|
+
var fallbackInfo = (interviewCheat === null || interviewCheat === void 0 ? void 0 : interviewCheat.info) || '面试过程中可能存在作弊行为,请结合面试视频核对。';
|
|
91
|
+
return ((0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ id: "report-risk", px: 2, mt: 3 }, { children: [(0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ sx: { display: 'flex', alignItems: 'center' } }, { children: v3AssetBase && (0, jsx_runtime_1.jsx)("img", { src: "".concat(v3AssetBase, "/risk_title.png"), alt: "\u4F5C\u5F0A\u98CE\u9669", width: 94, height: 28, style: { flexShrink: 0 } }) })), hasRisk ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ sx: { bgcolor: 'rgba(0,191,255,0.03)', borderRadius: 2, p: 2, mt: 2 } }, { children: riskTags.length > 0 ? ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", alignItems: "center", flexWrap: "wrap", gap: 1 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ sx: { color: '#1890FF', fontSize: 14, fontWeight: 600 } }, { children: "\u9762\u8BD5\u8FC7\u7A0B\u98CE\u9669" })), riskTags.map(function (t) { return ((0, jsx_runtime_1.jsx)(RiskPill, { name: t.name }, t.token || t.name)); })] }))) : ((0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ sx: { color: 'rgba(0,0,0,0.6)', fontSize: 14 } }, { children: fallbackInfo }))) })), (0, jsx_runtime_1.jsx)(CheatDetailTable, { hitNames: hitNames })] })) : (
|
|
92
|
+
/* 无风险(蓝湖「AI面试报告 v16」定义):作弊风险评估 + 无风险(不显示表格) */
|
|
93
|
+
(0, jsx_runtime_1.jsxs)(mui_1.Box, __assign({ sx: { bgcolor: '#F0F8FB', borderRadius: 2, p: 2, mt: 2 } }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ sx: { color: '#1890FF', fontSize: 14, fontWeight: 600 } }, { children: ["\u4F5C\u5F0A\u98CE\u9669\u8BC4\u4F30\uFF1A", (0, jsx_runtime_1.jsx)("span", __assign({ style: { color: '#52C41A', fontWeight: 600 } }, { children: "\u65E0\u98CE\u9669" }))] })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ sx: { color: 'rgba(0,0,0,0.6)', fontSize: 14, mt: 1 } }, { children: "\u672A\u53D1\u73B0\u660E\u786E\u4F5C\u5F0A\u98CE\u9669\uFF0C\u8BF7\u7ED3\u5408\u9762\u8BD5\u89C6\u9891\u7EE7\u7EED\u6838\u5BF9\u3002" }))] })))] })));
|
|
43
94
|
};
|
|
44
95
|
exports.default = CheatRisk;
|
|
@@ -65,7 +65,7 @@ var template = (_a = {},
|
|
|
65
65
|
_a);
|
|
66
66
|
var Form = function (_a) {
|
|
67
67
|
var answers = _a.answers, _b = _a.customProcessName, customProcessName = _b === void 0 ? '资料收集' : _b;
|
|
68
|
-
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ px: 2, mt: 3 }, { children: [(0, jsx_runtime_1.jsx)(ModuleTitle_1.ModuleTitle, { title: customProcessName }), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ mt: 1.5, border: "1px solid #E7F4EC", borderRadius: 2, overflow: "hidden" }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", sx: { background: '#EBFCF7' } }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ width: 52, flexShrink: 0, py: 1, px: 1.5 }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", fontWeight: 700, sx: { color: '#00996B', fontSize: 14, lineHeight: '22px' } }, { children: "\u5E8F\u53F7" })) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ flex: 1, minWidth: 0, py: 1, px: 1.5 }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", fontWeight: 700, sx: { color: '#00996B', fontSize: 14, lineHeight: '22px' } }, { children: "\u9898\u76EE" })) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ flex: 1, minWidth: 0, py: 1, px: 1.5 }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", fontWeight: 700, sx: { color: '#00996B', fontSize: 14, lineHeight: '22px' } }, { children: "\u56DE\u7B54" })) }))] })), answers === null || answers === void 0 ? void 0 : answers.map(function (answer, index) {
|
|
68
|
+
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ px: 2, mt: 3 }, { children: [(0, jsx_runtime_1.jsx)(ModuleTitle_1.ModuleTitle, { title: customProcessName, iconVariant: "person" }), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ mt: 1.5, border: "1px solid #E7F4EC", borderRadius: 2, overflow: "hidden" }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", sx: { background: '#EBFCF7' } }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ width: 52, flexShrink: 0, py: 1, px: 1.5 }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", fontWeight: 700, sx: { color: '#00996B', fontSize: 14, lineHeight: '22px' } }, { children: "\u5E8F\u53F7" })) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ flex: 1, minWidth: 0, py: 1, px: 1.5 }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", fontWeight: 700, sx: { color: '#00996B', fontSize: 14, lineHeight: '22px' } }, { children: "\u9898\u76EE" })) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ flex: 1, minWidth: 0, py: 1, px: 1.5 }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", fontWeight: 700, sx: { color: '#00996B', fontSize: 14, lineHeight: '22px' } }, { children: "\u56DE\u7B54" })) }))] })), answers === null || answers === void 0 ? void 0 : answers.map(function (answer, index) {
|
|
69
69
|
var _a;
|
|
70
70
|
return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", borderTop: "1px solid #F0F6F2" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ width: 52, flexShrink: 0, p: 1.5 }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", sx: { color: 'rgba(0,0,0,0.6)', fontSize: 14 } }, { children: index + 1 })) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ flex: 1, minWidth: 0, p: 1.5 }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", sx: { color: 'rgba(0,0,0,0.6)', fontSize: 14 } }, { children: answer.formTypeKey })) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ flex: 1, minWidth: 0, p: 1.5 }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", sx: { color: 'rgba(0,0,0,0.6)', fontSize: 14 } }, { children: (_a = template[answer.formTypeId]) === null || _a === void 0 ? void 0 : _a.call(template, answer) })) }))] }), index));
|
|
71
71
|
})] }))] })));
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const ModuleTitle: ({ title, action }: {
|
|
2
|
+
export declare const ModuleTitle: ({ title, action, icon, iconVariant, }: {
|
|
3
3
|
title: React.ReactNode;
|
|
4
4
|
action?: React.ReactNode;
|
|
5
|
+
icon?: string | undefined;
|
|
6
|
+
iconVariant?: "doc" | "person" | "shield" | undefined;
|
|
5
7
|
}) => JSX.Element;
|
|
@@ -15,14 +15,25 @@ exports.ModuleTitle = void 0;
|
|
|
15
15
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
16
|
var fbm_ui_1 = require("fbm-ui");
|
|
17
17
|
var mui_1 = require("fbm-ui/lib/mui");
|
|
18
|
+
// 章节标题:绿色圆角图标盒(设计稿切片 icon 或默认绿色盒) + 加粗标题
|
|
19
|
+
// 设计稿章节头 = 绿色圆角方块图标 + 深色加粗标题,无下划线(避免牛客风)
|
|
18
20
|
var ModuleTitle = function (_a) {
|
|
19
|
-
var title = _a.title, action = _a.action;
|
|
20
|
-
return ((0, jsx_runtime_1.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
var title = _a.title, action = _a.action, icon = _a.icon, iconVariant = _a.iconVariant;
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ sx: { position: 'relative' } }, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", alignItems: "center", spacing: 1 }, { children: [icon ? ((0, jsx_runtime_1.jsx)("img", { src: icon, alt: "", width: 24, height: 24, style: { flexShrink: 0 } })) : ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ sx: {
|
|
23
|
+
width: 26,
|
|
24
|
+
height: 26,
|
|
25
|
+
borderRadius: '7px',
|
|
26
|
+
flexShrink: 0,
|
|
27
|
+
background: 'linear-gradient(158deg, #5EE2B8 2.38%, #41C446 97.38%)',
|
|
28
|
+
display: 'flex',
|
|
29
|
+
alignItems: 'center',
|
|
30
|
+
justifyContent: 'center',
|
|
31
|
+
} }, { children: iconVariant === 'person' ? (
|
|
32
|
+
// 资料收集:人形剪影
|
|
33
|
+
(0, jsx_runtime_1.jsxs)("svg", __assign({ width: "16", height: "16", viewBox: "0 0 24 24", fill: "none" }, { children: [(0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "8", r: "3.6", fill: "#fff" }), (0, jsx_runtime_1.jsx)("path", { d: "M4 20c.8-4 4-6 8-6s7.2 2 8 6", stroke: "#fff", strokeWidth: "2", strokeLinecap: "round" })] }))) : iconVariant === 'shield' ? (
|
|
34
|
+
// 作弊风险:盾牌 + 感叹号
|
|
35
|
+
(0, jsx_runtime_1.jsxs)("svg", __assign({ width: "16", height: "16", viewBox: "0 0 24 24", fill: "none" }, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M12 2.5 5 5v6c0 4.5 3 8 7 9.5 4-1.5 7-5 7-9.5V5l-7-2.5Z", fill: "#fff" }), (0, jsx_runtime_1.jsx)("rect", { x: "11", y: "6.6", width: "2", height: "5.4", rx: "1", fill: "#41C446" }), (0, jsx_runtime_1.jsx)("rect", { x: "11", y: "13.6", width: "2", height: "2.4", rx: "1", fill: "#41C446" })] }))) : (
|
|
36
|
+
// 默认/面试详情:文档 + 双横线
|
|
37
|
+
(0, jsx_runtime_1.jsxs)("svg", __assign({ width: "16", height: "16", viewBox: "0 0 24 24", fill: "none" }, { children: [(0, jsx_runtime_1.jsx)("rect", { x: "5", y: "3", width: "14", height: "18", rx: "2.5", fill: "#fff" }), (0, jsx_runtime_1.jsx)("rect", { x: "8.5", y: "7", width: "7", height: "1.8", rx: "0.9", fill: "#41C446" }), (0, jsx_runtime_1.jsx)("rect", { x: "8.5", y: "11", width: "7", height: "1.8", rx: "0.9", fill: "#41C446" }), (0, jsx_runtime_1.jsx)("rect", { x: "8.5", y: "15", width: "4.5", height: "1.8", rx: "0.9", fill: "#41C446" })] }))) }))), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ fontWeight: 700, sx: { color: 'rgba(0,0,0,0.86)', fontSize: 18, lineHeight: '24px' } }, { children: title }))] })), action && (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ sx: { position: 'absolute', top: 0, right: 0 } }, { children: action }))] })) }));
|
|
27
38
|
};
|
|
28
39
|
exports.ModuleTitle = ModuleTitle;
|