eli-video-interview 1.2.42-alpha.9 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/components/AiHeaderTitle/index.js +2 -10
- package/esm/components/AiHeaderTitleV2/index.d.ts +4 -0
- package/esm/components/AiHeaderTitleV2/index.js +39 -0
- package/esm/components/AiHeaderTitleV2/interface.d.ts +4 -0
- package/esm/components/AiHeaderTitleV2/interface.js +1 -0
- package/esm/components/Charts/ReportPie.js +13 -3
- package/esm/components/Charts/const.js +3 -3
- package/esm/components/ScoreBigBall/index.js +1 -1
- package/esm/constants/ai-question.d.ts +1 -1
- package/esm/constants/ai-question.js +3 -3
- package/esm/enum/ai-question.d.ts +11 -1
- package/esm/enum/ai-question.js +10 -0
- package/esm/modules/ai-ability/components/AbilityFormItem/index.js +11 -46
- package/esm/modules/ai-ability/components/AddAbility/index.js +2 -20
- package/esm/modules/ai-ability/components/UpdateAbility/index.js +6 -37
- package/esm/modules/ai-ability-select/Root.js +4 -2
- package/esm/modules/ai-ability-select/components/AiAbilityItem/AiAbilityDetail.d.ts +2 -2
- package/esm/modules/ai-ability-select/components/AiAbilityItem/AiAbilityDetail.js +2 -1
- package/esm/modules/ai-ability-select/components/AiAbilityItem/index.d.ts +2 -2
- package/esm/modules/ai-ability-select/components/AiAbilityItem/index.js +4 -4
- package/esm/modules/ai-ability-select/components/AiAbilityList/index.js +14 -2
- package/esm/modules/ai-ability-select/interface.d.ts +1 -0
- package/esm/modules/ai-question/Root.js +14 -14
- package/esm/modules/ai-question/components/AiAnalysis/AnalysisItem.js +13 -4
- package/esm/modules/ai-question/components/AiAssessmentCriteria/const.d.ts +43 -0
- package/esm/modules/ai-question/components/AiAssessmentCriteria/const.js +45 -2
- package/esm/modules/ai-question/components/AiAssessmentCriteria/index.js +39 -42
- package/esm/modules/ai-question/components/AiAssessmentCriteria/interface.d.ts +1 -0
- package/esm/modules/ai-question/components/BaseAccordion/index.js +4 -4
- package/esm/modules/ai-question/components/BaseAccordion/interface.d.ts +3 -0
- package/esm/modules/ai-question/components/BootVideo/index.js +12 -5
- package/esm/modules/ai-question/components/QuestionImport/index.js +2 -2
- package/esm/modules/ai-question/components/QuestionModel/Item.js +3 -3
- package/esm/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +6 -2
- package/esm/modules/ai-question/components/QuestionTemplate/index.js +1 -1
- package/esm/modules/ai-question/components/QuestionUpdate/AudioUploader.d.ts +6 -0
- package/esm/modules/ai-question/components/QuestionUpdate/AudioUploader.js +74 -0
- package/esm/modules/ai-question/components/QuestionUpdate/Form.js +19 -7
- package/esm/modules/ai-question/components/QuestionUpdate/RandomQuestion.js +13 -3
- package/esm/modules/ai-question/components/QuestionUpdate/VideoVoice.js +2 -2
- package/esm/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.d.ts +2 -1
- package/esm/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.js +4 -4
- package/esm/modules/ai-question/components/QuestionUpdate/const.js +3 -1
- package/esm/modules/ai-question/components/QuestionUpdate/index.js +3 -2
- package/esm/modules/ai-question/components/QuestionUpdate/interface.d.ts +6 -1
- package/esm/modules/ai-report/Root.js +6 -3
- package/esm/modules/ai-report/components/VideoQuestion/Video.d.ts +27 -0
- package/esm/modules/ai-report/components/VideoQuestion/Video.js +208 -0
- package/esm/modules/ai-report/interface.d.ts +2 -0
- package/esm/modules/ai-report/useAiReport.d.ts +2 -0
- package/esm/modules/ai-report/useAiReport.js +3 -1
- package/esm/modules/ai-report-v2/Root.d.ts +2 -2
- package/esm/modules/ai-report-v2/Root.js +18 -11
- package/esm/modules/ai-report-v2/components/AIEvaluate/Evaluate.d.ts +2 -4
- package/esm/modules/ai-report-v2/components/AIEvaluate/Evaluate.js +20 -20
- package/esm/modules/ai-report-v2/components/AIEvaluate/Graph.d.ts +13 -0
- package/esm/modules/ai-report-v2/components/AIEvaluate/Graph.js +86 -24
- package/esm/modules/ai-report-v2/components/AIEvaluate/index.d.ts +2 -2
- package/esm/modules/ai-report-v2/components/AIEvaluate/index.js +11 -7
- package/esm/modules/ai-report-v2/components/Candidate/Interface.d.ts +3 -0
- package/esm/modules/ai-report-v2/components/Candidate/Podium.js +2 -2
- package/esm/modules/ai-report-v2/components/Form/Form.js +34 -13
- package/esm/modules/ai-report-v2/components/Form/Nps.d.ts +1 -1
- package/esm/modules/ai-report-v2/components/Form/Nps.js +2 -0
- package/esm/modules/ai-report-v2/components/NotFinish/index.js +13 -5
- package/esm/modules/ai-report-v2/components/ReportHeader/ReportHeader.d.ts +4 -2
- package/esm/modules/ai-report-v2/components/ReportHeader/ReportHeader.js +28 -10
- package/esm/modules/ai-report-v2/components/Suggestion/index.js +1 -1
- package/esm/modules/ai-report-v2/components/VideoQuestion/Evaluate.d.ts +11 -0
- package/esm/modules/ai-report-v2/components/VideoQuestion/Evaluate.js +79 -0
- package/esm/modules/ai-report-v2/components/VideoQuestion/QuestionItem.js +49 -32
- package/esm/modules/ai-report-v2/components/VideoQuestion/Workplaces.d.ts +9 -5
- package/esm/modules/ai-report-v2/components/VideoQuestion/Workplaces.js +71 -6
- package/esm/modules/ai-report-v2/components/VideoQuestion/index.d.ts +6 -3
- package/esm/modules/ai-report-v2/components/VideoQuestion/index.js +6 -4
- package/esm/modules/ai-report-v2/components/VideoQuestion/interface.d.ts +1 -0
- package/esm/modules/ai-report-v2/components/VideoQuestion/styled.js +2 -2
- package/esm/modules/ai-report-v2/components/WorkPlaces/index.js +1 -1
- package/esm/modules/ai-report-v2/components/styled.d.ts +4 -1
- package/esm/modules/ai-report-v2/components/styled.js +14 -3
- package/esm/modules/ai-report-v2/interface.d.ts +4 -1
- package/esm/modules/ai-report-v2/useAiReport.d.ts +4 -0
- package/esm/modules/ai-report-v2/useAiReport.js +3 -1
- package/esm/modules/ai-report-v2/useAiReportVersion.d.ts +5 -0
- package/esm/modules/ai-report-v2/useAiReportVersion.js +37 -0
- package/esm/services/ai-report.d.ts +10 -0
- package/esm/services/ai-report.js +2 -0
- package/esm/store/ai-question/ai-analysis-store.d.ts +3 -1
- package/esm/store/ai-question/ai-analysis-store.js +26 -1
- package/esm/store/ai-report/global-store.d.ts +3 -0
- package/lib/components/AiHeaderTitle/index.js +1 -9
- package/lib/components/AiHeaderTitleV2/index.d.ts +4 -0
- package/lib/components/AiHeaderTitleV2/index.js +41 -0
- package/lib/components/AiHeaderTitleV2/interface.d.ts +4 -0
- package/lib/components/AiHeaderTitleV2/interface.js +2 -0
- package/lib/components/Charts/ReportPie.js +13 -3
- package/lib/components/Charts/const.js +3 -3
- package/lib/components/ScoreBigBall/index.js +1 -1
- package/lib/constants/ai-question.d.ts +1 -1
- package/lib/constants/ai-question.js +3 -3
- package/lib/enum/ai-question.d.ts +11 -1
- package/lib/enum/ai-question.js +10 -0
- package/lib/modules/ai-ability/components/AbilityFormItem/index.js +13 -45
- package/lib/modules/ai-ability/components/AddAbility/index.js +2 -20
- package/lib/modules/ai-ability/components/UpdateAbility/index.js +6 -37
- package/lib/modules/ai-ability-select/Root.js +4 -2
- package/lib/modules/ai-ability-select/components/AiAbilityItem/AiAbilityDetail.d.ts +2 -2
- package/lib/modules/ai-ability-select/components/AiAbilityItem/AiAbilityDetail.js +2 -1
- package/lib/modules/ai-ability-select/components/AiAbilityItem/index.d.ts +2 -2
- package/lib/modules/ai-ability-select/components/AiAbilityItem/index.js +4 -4
- package/lib/modules/ai-ability-select/components/AiAbilityList/index.js +14 -2
- package/lib/modules/ai-ability-select/interface.d.ts +1 -0
- package/lib/modules/ai-question/Root.js +14 -14
- package/lib/modules/ai-question/components/AiAnalysis/AnalysisItem.js +12 -3
- package/lib/modules/ai-question/components/AiAssessmentCriteria/const.d.ts +43 -0
- package/lib/modules/ai-question/components/AiAssessmentCriteria/const.js +46 -3
- package/lib/modules/ai-question/components/AiAssessmentCriteria/index.js +36 -39
- package/lib/modules/ai-question/components/AiAssessmentCriteria/interface.d.ts +1 -0
- package/lib/modules/ai-question/components/BaseAccordion/index.js +4 -4
- package/lib/modules/ai-question/components/BaseAccordion/interface.d.ts +3 -0
- package/lib/modules/ai-question/components/BootVideo/index.js +12 -5
- package/lib/modules/ai-question/components/QuestionImport/index.js +2 -2
- package/lib/modules/ai-question/components/QuestionModel/Item.js +3 -3
- package/lib/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +5 -1
- package/lib/modules/ai-question/components/QuestionTemplate/index.js +1 -1
- package/lib/modules/ai-question/components/QuestionUpdate/AudioUploader.d.ts +6 -0
- package/lib/modules/ai-question/components/QuestionUpdate/AudioUploader.js +76 -0
- package/lib/modules/ai-question/components/QuestionUpdate/Form.js +20 -8
- package/lib/modules/ai-question/components/QuestionUpdate/RandomQuestion.js +12 -2
- package/lib/modules/ai-question/components/QuestionUpdate/VideoVoice.js +2 -2
- package/lib/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.d.ts +2 -1
- package/lib/modules/ai-question/components/QuestionUpdate/VideoVoiceUploader.js +4 -4
- package/lib/modules/ai-question/components/QuestionUpdate/const.js +3 -1
- package/lib/modules/ai-question/components/QuestionUpdate/index.js +3 -2
- package/lib/modules/ai-question/components/QuestionUpdate/interface.d.ts +6 -1
- package/lib/modules/ai-report/Root.js +6 -3
- package/lib/modules/ai-report/components/VideoQuestion/Video.d.ts +27 -0
- package/lib/modules/ai-report/components/VideoQuestion/Video.js +213 -0
- package/lib/modules/ai-report/interface.d.ts +2 -0
- package/lib/modules/ai-report/useAiReport.d.ts +2 -0
- package/lib/modules/ai-report/useAiReport.js +6 -1
- package/lib/modules/ai-report-v2/Root.d.ts +2 -2
- package/lib/modules/ai-report-v2/Root.js +16 -9
- package/lib/modules/ai-report-v2/components/AIEvaluate/Evaluate.d.ts +2 -4
- package/lib/modules/ai-report-v2/components/AIEvaluate/Evaluate.js +17 -17
- package/lib/modules/ai-report-v2/components/AIEvaluate/Graph.d.ts +13 -0
- package/lib/modules/ai-report-v2/components/AIEvaluate/Graph.js +88 -23
- package/lib/modules/ai-report-v2/components/AIEvaluate/index.d.ts +2 -2
- package/lib/modules/ai-report-v2/components/AIEvaluate/index.js +11 -7
- package/lib/modules/ai-report-v2/components/Candidate/Interface.d.ts +3 -0
- package/lib/modules/ai-report-v2/components/Candidate/Podium.js +1 -1
- package/lib/modules/ai-report-v2/components/Form/Form.js +34 -13
- package/lib/modules/ai-report-v2/components/Form/Nps.d.ts +1 -1
- package/lib/modules/ai-report-v2/components/Form/Nps.js +2 -0
- package/lib/modules/ai-report-v2/components/NotFinish/index.js +12 -4
- package/lib/modules/ai-report-v2/components/ReportHeader/ReportHeader.d.ts +4 -2
- package/lib/modules/ai-report-v2/components/ReportHeader/ReportHeader.js +27 -9
- package/lib/modules/ai-report-v2/components/Suggestion/index.js +2 -2
- package/lib/modules/ai-report-v2/components/VideoQuestion/Evaluate.d.ts +11 -0
- package/lib/modules/ai-report-v2/components/VideoQuestion/Evaluate.js +81 -0
- package/lib/modules/ai-report-v2/components/VideoQuestion/QuestionItem.js +46 -29
- package/lib/modules/ai-report-v2/components/VideoQuestion/Workplaces.d.ts +9 -5
- package/lib/modules/ai-report-v2/components/VideoQuestion/Workplaces.js +69 -4
- package/lib/modules/ai-report-v2/components/VideoQuestion/index.d.ts +6 -3
- package/lib/modules/ai-report-v2/components/VideoQuestion/index.js +6 -4
- package/lib/modules/ai-report-v2/components/VideoQuestion/interface.d.ts +1 -0
- package/lib/modules/ai-report-v2/components/VideoQuestion/styled.js +2 -2
- package/lib/modules/ai-report-v2/components/WorkPlaces/index.js +2 -2
- package/lib/modules/ai-report-v2/components/styled.d.ts +4 -1
- package/lib/modules/ai-report-v2/components/styled.js +18 -4
- package/lib/modules/ai-report-v2/interface.d.ts +4 -1
- package/lib/modules/ai-report-v2/useAiReport.d.ts +4 -0
- package/lib/modules/ai-report-v2/useAiReport.js +6 -1
- package/lib/modules/ai-report-v2/useAiReportVersion.d.ts +5 -0
- package/lib/modules/ai-report-v2/useAiReportVersion.js +41 -0
- package/lib/services/ai-report.d.ts +10 -0
- package/lib/services/ai-report.js +5 -1
- package/lib/store/ai-question/ai-analysis-store.d.ts +3 -1
- package/lib/store/ai-question/ai-analysis-store.js +26 -1
- package/lib/store/ai-report/global-store.d.ts +3 -0
- package/package.json +4 -2
|
@@ -3,6 +3,16 @@ export declare const LANGUAGE_NAMES: {
|
|
|
3
3
|
2: string;
|
|
4
4
|
3: string;
|
|
5
5
|
4: string;
|
|
6
|
+
5: string;
|
|
7
|
+
6: string;
|
|
8
|
+
7: string;
|
|
9
|
+
8: string;
|
|
10
|
+
9: string;
|
|
11
|
+
10: string;
|
|
12
|
+
11: string;
|
|
13
|
+
12: string;
|
|
14
|
+
13: string;
|
|
15
|
+
14: string;
|
|
6
16
|
};
|
|
7
17
|
export declare const CATEGORY_NAME: {
|
|
8
18
|
1: string;
|
|
@@ -16,10 +26,43 @@ export declare const SERVER_LANGUAGE_TYPE: {
|
|
|
16
26
|
12: number;
|
|
17
27
|
11: number;
|
|
18
28
|
13: number;
|
|
29
|
+
19: number;
|
|
30
|
+
20: number;
|
|
31
|
+
21: number;
|
|
32
|
+
22: number;
|
|
33
|
+
23: number;
|
|
34
|
+
24: number;
|
|
35
|
+
25: number;
|
|
36
|
+
26: number;
|
|
37
|
+
27: number;
|
|
38
|
+
28: number;
|
|
19
39
|
};
|
|
20
40
|
export declare const LANGUAGE_SHOW_NAME: {
|
|
21
41
|
2: string;
|
|
22
42
|
13: string;
|
|
23
43
|
12: string;
|
|
24
44
|
11: string;
|
|
45
|
+
19: string;
|
|
46
|
+
20: string;
|
|
47
|
+
};
|
|
48
|
+
export declare const LANGUAGE_SHOW_NAMES: {
|
|
49
|
+
1: string;
|
|
50
|
+
2: string;
|
|
51
|
+
3: string;
|
|
52
|
+
4: string;
|
|
53
|
+
5: string;
|
|
54
|
+
6: string;
|
|
55
|
+
7: string;
|
|
56
|
+
8: string;
|
|
57
|
+
9: string;
|
|
58
|
+
10: string;
|
|
59
|
+
11: string;
|
|
60
|
+
12: string;
|
|
61
|
+
13: string;
|
|
62
|
+
14: string;
|
|
25
63
|
};
|
|
64
|
+
export declare const LANGUAGE_SHOW_NAMES_ORDER: number[];
|
|
65
|
+
export declare const VOICE_LANGUAGE_OPTIONS: {
|
|
66
|
+
value: number;
|
|
67
|
+
label: any;
|
|
68
|
+
}[];
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
var _a, _b;
|
|
2
2
|
import { CATEGORY_TYPE, LANGUAGE_TYPE } from "../../../../enum/ai-question";
|
|
3
|
-
var MANDARIN = LANGUAGE_TYPE.MANDARIN, CANTONESE = LANGUAGE_TYPE.CANTONESE, JAPANESE = LANGUAGE_TYPE.JAPANESE, ENGLISH = LANGUAGE_TYPE.ENGLISH;
|
|
3
|
+
var MANDARIN = LANGUAGE_TYPE.MANDARIN, CANTONESE = LANGUAGE_TYPE.CANTONESE, JAPANESE = LANGUAGE_TYPE.JAPANESE, ENGLISH = LANGUAGE_TYPE.ENGLISH, KOREAN = LANGUAGE_TYPE.KOREAN, SPANISH = LANGUAGE_TYPE.SPANISH, ITALIAN = LANGUAGE_TYPE.ITALIAN, RUSSIAN = LANGUAGE_TYPE.RUSSIAN, FRENCH = LANGUAGE_TYPE.FRENCH, GERMAN = LANGUAGE_TYPE.GERMAN, THAILAND = LANGUAGE_TYPE.THAILAND, VIETNAMESE = LANGUAGE_TYPE.VIETNAMESE, INDONESIAN = LANGUAGE_TYPE.INDONESIAN, SWAHILI = LANGUAGE_TYPE.SWAHILI;
|
|
4
4
|
var LANGUAGE = CATEGORY_TYPE.LANGUAGE, SEMANTICS = CATEGORY_TYPE.SEMANTICS, EXPRESSION = CATEGORY_TYPE.EXPRESSION, FORM = CATEGORY_TYPE.FORM, LANGUAGE_ABILITY = CATEGORY_TYPE.LANGUAGE_ABILITY;
|
|
5
5
|
export var LANGUAGE_NAMES = {
|
|
6
6
|
1: '中文-普通话',
|
|
7
7
|
2: '日语',
|
|
8
8
|
3: '英语',
|
|
9
9
|
4: '中文-粤语',
|
|
10
|
+
5: '韩语',
|
|
11
|
+
6: '西班牙语',
|
|
12
|
+
7: '意大利语',
|
|
13
|
+
8: '俄语',
|
|
14
|
+
9: '法语',
|
|
15
|
+
10: '德语',
|
|
16
|
+
11: '泰语',
|
|
17
|
+
12: '越南语',
|
|
18
|
+
13: '印尼语',
|
|
19
|
+
14: '斯瓦希里语',
|
|
10
20
|
};
|
|
11
21
|
export var CATEGORY_NAME = (_a = {},
|
|
12
|
-
_a[LANGUAGE] = '
|
|
22
|
+
_a[LANGUAGE] = '候选人语种',
|
|
13
23
|
_a[SEMANTICS] = '语意',
|
|
14
24
|
_a[EXPRESSION] = '表达',
|
|
15
25
|
_a[FORM] = '形象',
|
|
@@ -20,6 +30,16 @@ export var SERVER_LANGUAGE_TYPE = (_b = {},
|
|
|
20
30
|
_b[JAPANESE] = 2,
|
|
21
31
|
_b[ENGLISH] = 3,
|
|
22
32
|
_b[CANTONESE] = 4,
|
|
33
|
+
_b[KOREAN] = 5,
|
|
34
|
+
_b[SPANISH] = 6,
|
|
35
|
+
_b[ITALIAN] = 7,
|
|
36
|
+
_b[RUSSIAN] = 8,
|
|
37
|
+
_b[FRENCH] = 9,
|
|
38
|
+
_b[GERMAN] = 10,
|
|
39
|
+
_b[THAILAND] = 11,
|
|
40
|
+
_b[VIETNAMESE] = 12,
|
|
41
|
+
_b[INDONESIAN] = 13,
|
|
42
|
+
_b[SWAHILI] = 14,
|
|
23
43
|
_b);
|
|
24
44
|
// 由于语种value 和 name的映射不对应,这里用于前端显示 AI基础能力 中文|英文表达
|
|
25
45
|
export var LANGUAGE_SHOW_NAME = {
|
|
@@ -27,4 +47,27 @@ export var LANGUAGE_SHOW_NAME = {
|
|
|
27
47
|
13: '中文',
|
|
28
48
|
12: '日语',
|
|
29
49
|
11: '英文',
|
|
50
|
+
19: '韩语',
|
|
51
|
+
20: '西班牙',
|
|
30
52
|
};
|
|
53
|
+
export var LANGUAGE_SHOW_NAMES = {
|
|
54
|
+
1: '普通话',
|
|
55
|
+
2: '日语',
|
|
56
|
+
3: '英语',
|
|
57
|
+
4: '粤语',
|
|
58
|
+
5: '韩语',
|
|
59
|
+
6: '西班牙语',
|
|
60
|
+
7: '意大利语',
|
|
61
|
+
8: '俄语',
|
|
62
|
+
9: '法语',
|
|
63
|
+
10: '德语',
|
|
64
|
+
11: '泰语',
|
|
65
|
+
12: '越南语',
|
|
66
|
+
13: '印尼语',
|
|
67
|
+
14: '斯瓦希里语',
|
|
68
|
+
};
|
|
69
|
+
export var LANGUAGE_SHOW_NAMES_ORDER = [1, 4, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];
|
|
70
|
+
export var VOICE_LANGUAGE_OPTIONS = LANGUAGE_SHOW_NAMES_ORDER.map(function (ord) { return ({
|
|
71
|
+
value: ord,
|
|
72
|
+
label: LANGUAGE_SHOW_NAMES[ord],
|
|
73
|
+
}); });
|
|
@@ -35,15 +35,15 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
35
35
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
36
36
|
};
|
|
37
37
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
38
|
-
import { CATEGORY_NAME, LANGUAGE_SHOW_NAME, SERVER_LANGUAGE_TYPE } from './const';
|
|
38
|
+
import { CATEGORY_NAME, LANGUAGE_SHOW_NAME, SERVER_LANGUAGE_TYPE, VOICE_LANGUAGE_OPTIONS } from './const';
|
|
39
39
|
import { groupCategory } from './utils';
|
|
40
40
|
import ScrollDialogContent from "../../../../components/ScrollDialogContent";
|
|
41
41
|
import { CATEGORY_TYPE, LANGUAGE_TYPE } from "../../../../enum/ai-question";
|
|
42
42
|
import { PostAiAbilities } from "../../../../services/ai-question";
|
|
43
43
|
import { useAiAnalysisStore } from "../../../../store/ai-question/ai-analysis-store";
|
|
44
44
|
import { useRequest, useSetState } from 'ahooks';
|
|
45
|
-
import { Checkbox, Dialog, Loading,
|
|
46
|
-
import { Box, Divider, FormControl, FormLabel } from 'fbm-ui/lib/mui';
|
|
45
|
+
import { Checkbox, Dialog, Loading, Select, Typography } from 'fbm-ui';
|
|
46
|
+
import { Box, Divider, FormControl, FormLabel, Stack } from 'fbm-ui/lib/mui';
|
|
47
47
|
import { useCallback, useEffect, useState } from 'react';
|
|
48
48
|
var MANDARIN = LANGUAGE_TYPE.MANDARIN, CANTONESE = LANGUAGE_TYPE.CANTONESE;
|
|
49
49
|
var AiAssessmentCriteria = function (props) {
|
|
@@ -51,9 +51,10 @@ var AiAssessmentCriteria = function (props) {
|
|
|
51
51
|
var _a = useAiAnalysisStore(function (store) { return [store.aiAbilities, store.analysisState]; }), aiAbilities = _a.aiAbilities, analysisState = _a.analysisState, updateState = _a.updateState, updateAiAbilities = _a.updateAiAbilities;
|
|
52
52
|
var _b = __read(useState([]), 2), groupData = _b[0], setGroupData = _b[1];
|
|
53
53
|
var _c = __read(useState(1), 2), language = _c[0], setLanguage = _c[1];
|
|
54
|
-
var _d = __read(useState(
|
|
55
|
-
var _e = __read(useState(
|
|
56
|
-
var _f = __read(
|
|
54
|
+
var _d = __read(useState(1), 2), voiceLanguage = _d[0], setVoiceLanguage = _d[1];
|
|
55
|
+
var _e = __read(useState(false), 2), checkedChinese = _e[0], setCheckedChinese = _e[1];
|
|
56
|
+
var _f = __read(useState([]), 2), relatedAbilities = _f[0], setRelatedAbilities = _f[1];
|
|
57
|
+
var _g = __read(useSetState({}), 2), checkAbilities = _g[0], setCheckAbilities = _g[1];
|
|
57
58
|
var loading = useRequest(PostAiAbilities, {
|
|
58
59
|
manual: false,
|
|
59
60
|
onSuccess: function (_a) {
|
|
@@ -64,6 +65,7 @@ var AiAssessmentCriteria = function (props) {
|
|
|
64
65
|
return SERVER_LANGUAGE_TYPE[type] === (analysisState.language || language);
|
|
65
66
|
}) || {}, type = _b.type, relatedAbilities = _b.relatedAbilities;
|
|
66
67
|
setRelatedAbilities(relatedAbilities);
|
|
68
|
+
setVoiceLanguage(analysisState.voiceLanguage || 1);
|
|
67
69
|
setLanguage(type || language);
|
|
68
70
|
setCheckedChinese([MANDARIN, CANTONESE].includes(type || language));
|
|
69
71
|
setGroupData(ret);
|
|
@@ -82,6 +84,7 @@ var AiAssessmentCriteria = function (props) {
|
|
|
82
84
|
}, [setCheckAbilities]);
|
|
83
85
|
var onLanguageChange = function (_a, list) {
|
|
84
86
|
var value = _a.target.value;
|
|
87
|
+
console.log('value', value, list);
|
|
85
88
|
var language = Number(value === '0' ? MANDARIN : value);
|
|
86
89
|
var item = list.find(function (_a) {
|
|
87
90
|
var type = _a.type;
|
|
@@ -93,7 +96,6 @@ var AiAssessmentCriteria = function (props) {
|
|
|
93
96
|
fixSetCheckAbilities((_a = {}, _a[key] = undefined, _a));
|
|
94
97
|
}
|
|
95
98
|
});
|
|
96
|
-
console.log(language);
|
|
97
99
|
setLanguage(language);
|
|
98
100
|
setCheckedChinese([MANDARIN, CANTONESE].includes(language));
|
|
99
101
|
setRelatedAbilities(item === null || item === void 0 ? void 0 : item.relatedAbilities);
|
|
@@ -102,47 +104,42 @@ var AiAssessmentCriteria = function (props) {
|
|
|
102
104
|
updateAiAbilities(__spreadArray(__spreadArray([], __read(aiAbilities.filter(function (v) { return v.isWorkplace; })), false), __read(Object.values(checkAbilities)
|
|
103
105
|
.filter(function (item) { return item; })
|
|
104
106
|
.sort(function (a, b) { return ((a === null || a === void 0 ? void 0 : a.sort) && (b === null || b === void 0 ? void 0 : b.sort) ? (a === null || a === void 0 ? void 0 : a.sort) - (b === null || b === void 0 ? void 0 : b.sort) : 0); })), false));
|
|
105
|
-
updateState({ language: SERVER_LANGUAGE_TYPE[language], aiSwitch: 1 });
|
|
107
|
+
updateState({ language: SERVER_LANGUAGE_TYPE[language], aiSwitch: 1, voiceLanguage: voiceLanguage });
|
|
106
108
|
onClose();
|
|
107
|
-
}, [checkAbilities, aiAbilities, language, onClose, updateAiAbilities, updateState]);
|
|
109
|
+
}, [checkAbilities, aiAbilities, language, onClose, updateAiAbilities, updateState, voiceLanguage]);
|
|
108
110
|
useEffect(function () {
|
|
109
111
|
aiAbilities.forEach(function (item) {
|
|
110
112
|
var _a;
|
|
111
113
|
return fixSetCheckAbilities((_a = {}, _a[item.type] = item, _a));
|
|
112
114
|
});
|
|
113
115
|
}, [aiAbilities, fixSetCheckAbilities]);
|
|
114
|
-
return (_jsx(Dialog, __assign({ open: open, title: "\u9009\u62E9 AI \u8003\u6838\u7EF4\u5EA6", size: "sm", okText: "\u786E\u8BA4", onClose: onClose, onOk: handleOk }, { children: _jsx(ScrollDialogContent, { children: loading ? (_jsx(Box, __assign({ height: 400 }, { children: _jsx(Loading, { size: 40 }) }))) : (
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
})
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
var
|
|
134
|
-
return (_jsx(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
} }), _jsx(Typography, __assign({ variant: "caption", color: "secondary", ml: "26px" }, { children: isLanguageAbility ? '' : desc }))] }), token));
|
|
143
|
-
}
|
|
144
|
-
return null;
|
|
145
|
-
}) }))] }, "".concat(name, "-").concat(type)));
|
|
146
|
-
})) }) })));
|
|
116
|
+
return (_jsx(Dialog, __assign({ open: open, title: "\u9009\u62E9 AI \u8003\u6838\u7EF4\u5EA6", size: "sm", okText: "\u786E\u8BA4", onClose: onClose, onOk: handleOk }, { children: _jsx(ScrollDialogContent, { children: loading ? (_jsx(Box, __assign({ height: 400 }, { children: _jsx(Loading, { size: 40 }) }))) : (_jsxs(_Fragment, { children: [_jsxs(Stack, __assign({ spacing: 1, mb: 2 }, { children: [_jsxs(Stack, __assign({ spacing: 1, direction: "row", alignItems: "center" }, { children: [_jsx(Typography, __assign({ variant: "body1", fontWeight: 500 }, { children: "\u9898\u76EE\u8BED\u79CD" })), _jsx(Typography, __assign({ variant: "caption", color: "secondary" }, { children: "\u4EE5\u6240\u9009\u8BED\u8A00\u8FDB\u884C\u8BFB\u9898" }))] })), _jsx(Select, { onChange: function (e) { return setVoiceLanguage(Number(e.target.value)); }, value: voiceLanguage, options: VOICE_LANGUAGE_OPTIONS, sx: {
|
|
117
|
+
width: 240,
|
|
118
|
+
} })] })), groupData.map(function (_a) {
|
|
119
|
+
var name = _a.name, type = _a.type, list = _a.list;
|
|
120
|
+
return (_jsxs(Box, { children: [(list.filter(function (_a) {
|
|
121
|
+
var type = _a.type;
|
|
122
|
+
return relatedAbilities === null || relatedAbilities === void 0 ? void 0 : relatedAbilities.includes(type);
|
|
123
|
+
}).length > 0 || type === CATEGORY_TYPE.LANGUAGE) && (_jsx(FormControl, { children: _jsx(FormLabel, __assign({ component: "legend", style: { fontSize: 14, fontWeight: 400, color: 'rgba(0,0,0,0.86)' } }, { children: _jsxs(Stack, __assign({ spacing: 1, direction: "row", alignItems: "center" }, { children: [type === CATEGORY_TYPE.LANGUAGE ? (_jsx(Typography, __assign({ style: { fontSize: 16, fontWeight: 500 } }, { children: name }))) : (_jsx(Typography, { children: type === CATEGORY_TYPE.EXPRESSION ? LANGUAGE_SHOW_NAME[language] + name : name })), type === CATEGORY_TYPE.LANGUAGE && (_jsx(Typography, __assign({ variant: "caption", color: "textSecondary", sx: { ml: 1 } }, { children: "\u4EE5\u6240\u9009\u8BED\u8A00\u8BC6\u522B\u5019\u9009\u4EBA\u56DE\u7B54\u5185\u5BB9\u5E76\u8F6C\u6362\u6587\u5B57" })))] })) })) })), type === CATEGORY_TYPE.LANGUAGE ? (_jsxs(Box, { children: [_jsx(Select, { onChange: function (e) { return onLanguageChange(e, list); }, value: language, options: list.map(function (_a) {
|
|
124
|
+
var type = _a.type, name = _a.name;
|
|
125
|
+
return ({
|
|
126
|
+
value: type,
|
|
127
|
+
label: name,
|
|
128
|
+
});
|
|
129
|
+
}), sx: {
|
|
130
|
+
width: 240,
|
|
131
|
+
mt: 1,
|
|
132
|
+
} }), _jsx(Divider, { sx: { mb: 1 } }), _jsx(FormControl, { children: _jsx(FormLabel, __assign({ component: "legend", style: { fontSize: 16, color: 'rgba(0,0,0,0.86)', fontWeight: 500, marginBottom: 16 } }, { children: "AI\u57FA\u7840\u80FD\u529B" })) })] })) : (_jsx(_Fragment, { children: list.map(function (item) {
|
|
133
|
+
var name = item.name, desc = item.desc, type = item.type, token = item.token;
|
|
134
|
+
if (relatedAbilities === null || relatedAbilities === void 0 ? void 0 : relatedAbilities.includes(type)) {
|
|
135
|
+
var isLanguageAbility = [14, 15].includes(type);
|
|
136
|
+
return (_jsxs(Box, __assign({ padding: "4px 0 4px 4px", display: "flex", flexDirection: "column" }, { children: [_jsx(Checkbox, { checked: !!checkAbilities[type], label: isLanguageAbility ? desc : name, onChange: function (e, checked) {
|
|
137
|
+
var _a;
|
|
138
|
+
return fixSetCheckAbilities((_a = {}, _a[type] = checked ? item : undefined, _a));
|
|
139
|
+
} }), _jsx(Typography, __assign({ variant: "caption", color: "secondary", ml: "26px" }, { children: isLanguageAbility ? '' : desc }))] }), token));
|
|
140
|
+
}
|
|
141
|
+
return null;
|
|
142
|
+
}) }))] }, "".concat(name, "-").concat(type)));
|
|
143
|
+
})] })) }) })));
|
|
147
144
|
};
|
|
148
145
|
export default AiAssessmentCriteria;
|
|
@@ -41,7 +41,7 @@ import { Accordion, AccordionDetails, AccordionSummary, List, ListItem, ListItem
|
|
|
41
41
|
import { memo, useCallback, useEffect, useRef, useState } from 'react';
|
|
42
42
|
var LANGUAGE_TYPE_LIST = [LANGUAGE_TYPE.MANDARIN, LANGUAGE_TYPE.CANTONESE, LANGUAGE_TYPE.JAPANESE, LANGUAGE_TYPE.ENGLISH];
|
|
43
43
|
var BaseAccordion = function (props) {
|
|
44
|
-
var name = props.name, positionName = props.positionName, list = props.list, index = props.index, isShowOnlyAITest = props.isShowOnlyAITest, _a = props.isShowDesc, isShowDesc = _a === void 0 ? false : _a, _b = props.isShowSummaryAction, isShowSummaryAction = _b === void 0 ? false : _b, _c = props.isShowConfirm, isShowConfirm = _c === void 0 ? false : _c, _d = props.isShowPreview, isShowPreview = _d === void 0 ? true : _d, _e = props.isNew, isNew = _e === void 0 ? false : _e, _f = props.isOem, isOem = _f === void 0 ? false : _f;
|
|
44
|
+
var name = props.name, positionName = props.positionName, list = props.list, index = props.index, isShowOnlyAITest = props.isShowOnlyAITest, _a = props.isShowDesc, isShowDesc = _a === void 0 ? false : _a, _b = props.isShowSummaryAction, isShowSummaryAction = _b === void 0 ? false : _b, _c = props.isShowConfirm, isShowConfirm = _c === void 0 ? false : _c, _d = props.isShowPreview, isShowPreview = _d === void 0 ? true : _d, _e = props.isNew, isNew = _e === void 0 ? false : _e, _f = props.isOem, isOem = _f === void 0 ? false : _f, expanded = props.expanded, token = props.token, onExpandedChange = props.onExpandedChange;
|
|
45
45
|
var ref = useRef(null);
|
|
46
46
|
var isHovering = useHover(ref);
|
|
47
47
|
var updatePreview = useQuestionPreviewStore().updatePreview;
|
|
@@ -104,7 +104,7 @@ var BaseAccordion = function (props) {
|
|
|
104
104
|
setQuestionsList(filterList);
|
|
105
105
|
}
|
|
106
106
|
}, [list, isShowOnlyAITest, isOem]);
|
|
107
|
-
return (_jsx(_Fragment, { children: questionsList.length > 0 && (_jsx(AccordionRoot, { children: _jsxs(Accordion, __assign({ defaultExpanded: index === 0 }, { children: [_jsx(AccordionSummary, __assign({ expandIcon: _jsx(ExpandMore, {}), sx: {
|
|
107
|
+
return (_jsx(_Fragment, { children: questionsList.length > 0 && (_jsx(AccordionRoot, { children: _jsxs(Accordion, __assign({ defaultExpanded: index === 0, expanded: expanded === token, onChange: onExpandedChange(token) }, { children: [_jsx(AccordionSummary, __assign({ expandIcon: _jsx(ExpandMore, {}), sx: {
|
|
108
108
|
'&:after': {
|
|
109
109
|
content: "".concat(isNew ? 'url(//webcdn.fbmms.cn/assets/XXRf/bdUI9qZoTx-l2k_OHTotn)' : '" "'),
|
|
110
110
|
position: 'absolute',
|
|
@@ -113,13 +113,13 @@ var BaseAccordion = function (props) {
|
|
|
113
113
|
width: 38,
|
|
114
114
|
height: 16,
|
|
115
115
|
},
|
|
116
|
-
} }, { children: _jsxs(Box, __assign({ flex: "1 0", display: "flex", justifyContent: "space-between", alignItems: "center", overflow: "hidden" }, { children: [_jsxs(Box, __assign({ flex: "1 0", overflow: "hidden" }, { children: [_jsx(AccordionTitle, { children: positionName || name }), positionName && _jsxs(AccordionSubTitle, __assign({ color: "secondary" }, { children: ["\u6B65\u9AA4\uFF1A", name] }))] })), isShowSummaryAction && (_jsx(Button, __assign({ sx: { mr: 1, flexShrink: 0, height: 24 }, variant: "outlined", color: "inherit", size: "small", onClick: handleUseAllQuestion }, { children: "\u4F7F\u7528" })))] })) })), _jsxs(AccordionDetails, { children: [_jsx(List, __assign({ ref: ref }, { children: questionsList.map(function (item) {
|
|
116
|
+
} }, { children: _jsxs(Box, __assign({ flex: "1 0", display: "flex", justifyContent: "space-between", alignItems: "center", overflow: "hidden" }, { children: [_jsxs(Box, __assign({ flex: "1 0", overflow: "hidden" }, { children: [_jsx(AccordionTitle, { children: positionName || name }), positionName && _jsxs(AccordionSubTitle, __assign({ color: "secondary" }, { children: ["\u6B65\u9AA4\uFF1A", name] }))] })), isShowSummaryAction && (_jsx(Button, __assign({ sx: { mr: 1, flexShrink: 0, height: 24 }, variant: "outlined", color: "inherit", size: "small", onClick: handleUseAllQuestion }, { children: "\u4F7F\u7528" })))] })) })), expanded === token && (_jsxs(AccordionDetails, { children: [_jsx(List, __assign({ ref: ref }, { children: questionsList.map(function (item) {
|
|
117
117
|
var token = item.token, name = item.name, category = item.category;
|
|
118
118
|
var isUsed = questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.steps.find(function (step) { return step.originToken === token; });
|
|
119
119
|
return (_jsx(ListItem, __assign({ secondaryAction: [
|
|
120
120
|
isUsed && _jsx(Done, {}, "icon"),
|
|
121
121
|
_jsx(Box, __assign({ className: "secondary-action-buttons" }, { children: _jsx(Button, __assign({ variant: "outlined", color: "inherit", size: "small", onClick: function () { return handleUseQuestion(item); } }, { children: "\u4F7F\u7528" })) }), "buttons"),
|
|
122
122
|
], onMouseOver: function () { return handleMouseOver(item); } }, { children: _jsx(ListItemText, { primary: name, secondary: isShowDesc && category ? category[0] : '' }) }), token));
|
|
123
|
-
}) })), isPaging && (_jsx(Button, __assign({ variant: "text", sx: { width: '100%', justifyContent: 'start', color: '#576B95' }, onClick: handleShowAll }, { children: "\u5C55\u793A\u5168\u90E8" })))] })] })) })) }));
|
|
123
|
+
}) })), isPaging && (_jsx(Button, __assign({ variant: "text", sx: { width: '100%', justifyContent: 'start', color: '#576B95' }, onClick: handleShowAll }, { children: "\u5C55\u793A\u5168\u90E8" })))] }))] })) })) }));
|
|
124
124
|
};
|
|
125
125
|
export default memo(BaseAccordion);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { AiEvaluationDataList } from '../QuestionTemplate/interface';
|
|
2
3
|
export interface BaseAccordionProps extends AiEvaluationDataList {
|
|
3
4
|
index?: number;
|
|
@@ -7,4 +8,6 @@ export interface BaseAccordionProps extends AiEvaluationDataList {
|
|
|
7
8
|
isShowSummaryAction?: boolean;
|
|
8
9
|
isShowConfirm?: boolean;
|
|
9
10
|
isOem?: boolean;
|
|
11
|
+
expanded: string | false;
|
|
12
|
+
onExpandedChange: (panel: string) => (event: React.SyntheticEvent, expanded: boolean) => void;
|
|
10
13
|
}
|
|
@@ -52,6 +52,7 @@ var Options = [
|
|
|
52
52
|
{ label: '小面播报', value: 1 },
|
|
53
53
|
{ label: '虚拟人播报', value: 2 },
|
|
54
54
|
{ label: '自定义播报', value: 3 },
|
|
55
|
+
{ label: '新虚拟人播报(支持追问)', value: 4 },
|
|
55
56
|
];
|
|
56
57
|
var BootVideo = function (props) {
|
|
57
58
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -243,17 +244,23 @@ var BootVideo = function (props) {
|
|
|
243
244
|
mr: 4.5,
|
|
244
245
|
},
|
|
245
246
|
}, defaultValue: "outlined", onChange: handleInteractTypeChange, value: interviewRoomState.interactType }, { children: [_jsx(Radio, { value: 1, label: "\u4F20\u7EDF\u8BFB\u9898\u6A21\u5F0F" }), _jsx(Radio, { value: 2, label: "AI\u9762\u8BD5\u5B98\u5BF9\u8BDD\u6A21\u5F0F" })] })), interviewRoomState.interactType === 2 && (_jsxs(_Fragment, { children: [_jsx(Select, { options: Options, value: broadcastType, onChange: function (e) {
|
|
246
|
-
var _a;
|
|
247
|
+
var _a, _b, _c;
|
|
247
248
|
var value = e.target.value;
|
|
248
|
-
|
|
249
|
-
|
|
249
|
+
var newVirtualManList = virtualManList.map(function (v) { return (__assign(__assign({}, v), { selected: v.type === value })); });
|
|
250
|
+
setVirtualManList(__spreadArray([], __read(newVirtualManList), false));
|
|
251
|
+
if (![3, 4].includes(value)) {
|
|
250
252
|
setInterviewRoomState(__assign(__assign({}, interviewRoomState), {
|
|
251
253
|
// @ts-ignore
|
|
252
254
|
aiInterviewerProfile: (_a = virtualManList.find(function (v) { return v.type === value; })) === null || _a === void 0 ? void 0 : _a.detail }));
|
|
253
255
|
}
|
|
254
|
-
|
|
256
|
+
else {
|
|
257
|
+
setInterviewRoomState(__assign(__assign({}, interviewRoomState), {
|
|
258
|
+
// @ts-ignore
|
|
259
|
+
aiInterviewerProfile: ((_c = (_b = virtualManList.find(function (v) { return v.type === value; })) === null || _b === void 0 ? void 0 : _b.detail.interviewerShows) === null || _c === void 0 ? void 0 : _c.find(function (v) { return v.selected; })) || (virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.detail) }));
|
|
260
|
+
}
|
|
261
|
+
}, sx: { width: 240, height: 'auto', mt: 1 } }), broadcastType === 3 && (_jsxs(Stack, { children: [_jsx(CustomVideos, { mediaList: virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.detail, setMediaList: handleSetVideo }), _jsx(Typography, __assign({ variant: "body2", fontWeight: "medium", mt: 3, mb: 2 }, { children: "\u5F15\u5BFC\u89C6\u9891\u6587\u672C\u6846\u5185\u5BB9" })), _jsx(TextField, { multiline: true, error: (((_a = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.guidanceText) === null || _a === void 0 ? void 0 : _a.length) || 0) > 300, rows: 3, placeholder: "\u8BF7\u8F93\u5165\u6587\u672C\u6846\u5185\u5BB9\uFF0C\u82E5\u4E0D\u586B\uFF0C\u5219\u5728\u9762\u8BD5\u95F4\u4E0D\u5C55\u793A\u8BE5\u6587\u672C\u6846\u3002", value: virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.guidanceText, sx: { mb: 2 }, onChange: handleGuidanceText, max: 300 })] })), _jsx(Typography, __assign({ fontSize: "14px", variant: "body1", fontWeight: 500, mt: 3 }, { children: ![3, 4].includes(broadcastType) ? '面试官形象' : '面试官形象(播报题目)' })), ![3, 4].includes(broadcastType) && (_jsx(CustomUploadedImgRoot, { children: _jsx(Box, { children: _jsx("img", { src: (_b = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.detail) === null || _b === void 0 ? void 0 : _b.virtualHumanAvatar, style: {
|
|
255
262
|
borderColor: 'transparent',
|
|
256
|
-
}, height: 100, alt: "" }) }) })), broadcastType
|
|
263
|
+
}, height: 100, alt: "" }) }) })), [3, 4].includes(broadcastType) && (_jsx(CustomUploadedImgRoot, { children: (_d = (_c = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.detail) === null || _c === void 0 ? void 0 : _c.interviewerShows) === null || _d === void 0 ? void 0 : _d.map(function (human) { return (_jsxs(Box, { children: [_jsx("img", { src: human.virtualHumanAvatar, style: {
|
|
257
264
|
borderColor: human.selected ? '#4CAF50' : 'transparent',
|
|
258
265
|
}, height: 100, alt: "", onClick: function () { return handleSelectHumanType(human); } }), _jsx(Typography, __assign({ variant: "body2", textAlign: "center" }, { children: human.name }))] }, human.humanToken)); }) })), _jsx(Typography, __assign({ variant: "caption", flexWrap: "wrap", color: "disabled", mb: 3 }, { children: (virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.detail.desc) || ((_g = (_f = (_e = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.detail) === null || _e === void 0 ? void 0 : _e.interviewerShows) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.desc) })), broadcastType !== 3 && (_jsxs(Stack, { children: [_jsx(Typography, __assign({ variant: "body2", fontWeight: "medium", mb: 2 }, { children: "\u5F15\u5BFC\u89C6\u9891\u64AD\u62A5\u5185\u5BB9" })), _jsx(TextField, { multiline: true, error: (((_h = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.guidanceText) === null || _h === void 0 ? void 0 : _h.length) || 0) > 300, rows: 3, placeholder: "\u8BF7\u8F93\u5165\u6587\u672C\u6846\u5185\u5BB9\uFF0C\u82E5\u4E0D\u586B\uFF0C\u5219\u5728\u9762\u8BD5\u95F4\u4E0D\u5C55\u793A\u8BE5\u6587\u672C\u6846\u3002", value: virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.guidanceText, onChange: handleGuidanceText, max: 300 })] }))] })), interviewRoomState.interactType === 1 && (_jsxs(Stack, { children: [_jsxs(Stack, { children: [_jsx(Typography, __assign({ fontSize: "14px", variant: "body1", fontWeight: 500, mt: 2, mb: 1 }, { children: "\u5F15\u5BFC\u89C6\u9891" })), _jsx(Typography, __assign({ variant: "caption", mb: 2 }, { children: "\u79FB\u52A8\u7AEF" })), _jsxs(CustomUploadedImgRoot, { children: [mediaList.map(function (_a) {
|
|
259
266
|
var videoUrl = _a.videoUrl, frameUrl = _a.frameUrl;
|
|
@@ -72,7 +72,7 @@ var BootVideo = function (props) {
|
|
|
72
72
|
// @ts-ignore
|
|
73
73
|
var _a = (resp === null || resp === void 0 ? void 0 : resp.data) || {}, _b = _a.countQuestion, countQuestion = _b === void 0 ? 0 : _b, _c = _a.countContent, countContent = _c === void 0 ? 0 : _c, _d = _a.steps, steps = _d === void 0 ? [] : _d;
|
|
74
74
|
if (countQuestion > 100) {
|
|
75
|
-
Message.error('一次最多导入
|
|
75
|
+
Message.error('一次最多导入600条数据');
|
|
76
76
|
}
|
|
77
77
|
else {
|
|
78
78
|
setQuestionTemplate({ countQuestion: countQuestion, countContent: countContent, steps: steps.map(function (v) { return (__assign(__assign({}, v), { token: uniqueId(), uniqueId: uniqueId() })); }) });
|
|
@@ -93,7 +93,7 @@ var BootVideo = function (props) {
|
|
|
93
93
|
padding: 0,
|
|
94
94
|
margin: 0,
|
|
95
95
|
},
|
|
96
|
-
} }, { children: _jsxs(ScrollDialogContent, { children: [step === 0 && (_jsxs(Box, __assign({ sx: { display: 'flex', justifyContent: 'space-between', width: '100%' } }, { children: [_jsxs(Box, __assign({ bgcolor: "#E8F5E9", width: 228, flexGrow: 0, flexShrink: 0, pl: 4.5, pr: 2.75, pt: 11.25, height: 420 }, { children: [_jsx(Typography, __assign({ variant: "h6", fontWeight: 500 }, { children: "1. \u9009\u62E9\u6A21\u677F" })), _jsx(Typography, __assign({ variant: "body2", style: { marginTop: 24, marginBottom: 8 } }, { children: "\u4E00\u6B21\u6700\u591A\u5BFC\
|
|
96
|
+
} }, { children: _jsxs(ScrollDialogContent, { children: [step === 0 && (_jsxs(Box, __assign({ sx: { display: 'flex', justifyContent: 'space-between', width: '100%' } }, { children: [_jsxs(Box, __assign({ bgcolor: "#E8F5E9", width: 228, flexGrow: 0, flexShrink: 0, pl: 4.5, pr: 2.75, pt: 11.25, height: 420 }, { children: [_jsx(Typography, __assign({ variant: "h6", fontWeight: 500 }, { children: "1. \u9009\u62E9\u6A21\u677F" })), _jsx(Typography, __assign({ variant: "body2", style: { marginTop: 24, marginBottom: 8 } }, { children: "\u4E00\u6B21\u6700\u591A\u5BFC\u5165600\u6761\u6570\u636E" })), _jsx(Button, __assign({ variant: "contained", color: "primary", startIcon: _jsx(DownloadIcon, {}), onClick: handleDowloadTemplate }, { children: "\u4E0B\u8F7D\u901A\u7528\u6A21\u677F" }))] })), _jsxs(Box, __assign({ flexGrow: 1, display: "flex", flexDirection: "column", alignItems: "flex-end" }, { children: [_jsx(DialogContent, __assign({ sx: { boxSizing: 'border-box', width: '100%', py: 2 } }, { children: _jsxs(Box, { children: [_jsx(Box, __assign({ mb: 3, mt: 3.5 }, { children: _jsx(Typography, __assign({ variant: "h6", fontWeight: 500 }, { children: "2. \u4E0A\u4F20\u586B\u5199\u5B8C\u6BD5\u7684Excel\u6587\u4EF6" })) })), _jsxs(Box, __assign({ mb: 4.75, height: 184, onDragOver: function (e) { return e.preventDefault(); }, onDrop: dragQuestionImport, sx: {
|
|
97
97
|
height: 166,
|
|
98
98
|
color: 'rgba(0, 0, 0, 0.6)',
|
|
99
99
|
border: '1px dashed #999999',
|
|
@@ -60,11 +60,11 @@ var options = __spreadArray(__spreadArray([], __read(__spreadArray([], __read(Ar
|
|
|
60
60
|
{ label: '直到充分为止', value: -1 },
|
|
61
61
|
], false);
|
|
62
62
|
var QuestionModelListItem = function (props) {
|
|
63
|
-
var
|
|
63
|
+
var _a = useInterviewRoomStore(), interactionMethods = _a.interactionMethods, interactType = _a.interactType;
|
|
64
64
|
var index = props.index, disabledWeight = props.disabledWeight, steps = props.steps, step = __rest(props, ["index", "disabledWeight", "steps"]);
|
|
65
65
|
var token = step.token, name = step.name, questions = step.questions, duration = step.duration, weight = step.weight, type = step.type, aiShowType = step.aiShowType, aiType = step.aiType, answerStatus = step.answerStatus, category = step.category, isOpenAIFollowUp = step.isOpenAIFollowUp, followUpMaximum = step.followUpMaximum;
|
|
66
66
|
var isAiAnalysis = IS_AI_ANALYSIS(step);
|
|
67
|
-
var
|
|
67
|
+
var _b = useQuestionModelStore(), editModel = _b.editModel, removeModel = _b.removeModel, updateModelWeight = _b.updateModelWeight;
|
|
68
68
|
var updateQuestionState = useUpdateQuestionStore().updateQuestionState;
|
|
69
69
|
var handleEdit = useCallback(function () {
|
|
70
70
|
updateQuestionState({ open: true, token: token, index: index, aiShowType: aiShowType, item: step });
|
|
@@ -113,6 +113,6 @@ var QuestionModelListItem = function (props) {
|
|
|
113
113
|
}, [questions]);
|
|
114
114
|
return (_jsxs(Paper, __assign({ variant: "outlined", sx: { display: 'block', mt: 2 } }, { children: [_jsx(Box, __assign({ display: "flex", borderBottom: !DISABLED_REPEAT_TYPE.includes(type) || isAiAnalysis ? '1px solid rgba(0, 0, 0, 0.08)' : 'none' }, { children: _jsxs(Box, __assign({ flex: "1 0", padding: "8px 0px 16px 16px" }, { children: [_jsxs(Box, __assign({ display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: [_jsxs(Typography, __assign({ variant: "body2", color: "primary.main", fontWeight: "medium" }, { children: ["\u9898\u76EE", index + 1] })), _jsx(Box, __assign({ width: 40, display: "flex", alignItems: "center", justifyContent: "center", sx: { cursor: 'move' } }, { children: _jsx(DragHandleIcon, { className: "dragHandle" }) })), _jsxs(Box, __assign({ width: 62, mr: 1, textAlign: "right" }, { children: [!TEST_TYPE_READONLY.includes(type) && (_jsx(IconButton, __assign({ size: "small", onClick: handleEdit }, { children: _jsx(EditIcon, {}) }))), _jsx(IconButton, __assign({ size: "small", onClick: handleRemove }, { children: _jsx(DeleteIcon, {}) }))] }))] })), _jsx(Box, __assign({ display: "flex", justifyContent: "space-between" }, { children: _jsxs(Box, __assign({ flex: "1 0", display: "flex", alignItems: "center" }, { children: [_jsxs(Typography, __assign({ variant: "body2", color: "primary.main", fontWeight: "medium", mr: 0.5 }, { children: ["[", QUESTION_TYPE_TITLE_MAP[aiShowType], "]"] })), _jsx(Typography, __assign({ variant: "subtitle1" }, { children: name })), category === null || category === void 0 ? void 0 : category.map(function (label) {
|
|
115
115
|
return label && (_jsx(Tooltip, __assign({ title: "".concat(label), placement: "bottom" }, { children: _jsx(Chip, { color: "default", label: label, size: "medium", sx: { ml: 1, maxWidth: '158px', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' } }, label) })));
|
|
116
|
-
}), aiType === 2 && _jsx(Chip, { variant: "filled", color: "primary", label: "AI\u8BC4\u5206", size: "medium", sx: { ml: 1 } }), (questions === null || questions === void 0 ? void 0 : questions.length) > 1 && _jsx(Chip, { variant: "filled", color: "warning", label: "\u5185\u5BB9\u968F\u673A", size: "medium", sx: { ml: 1 } })] })) })), _jsxs(Box, __assign({ mt: 1, pr: 2, display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: [_jsx(Typography, __assign({ variant: "body2", color: "secondary" }, { children: formatQuestion })), _jsxs(Typography, __assign({ sx: { ml: 2, flexShrink: 0 }, variant: "caption", color: "secondary", alignSelf: "flex-end" }, { children: ["\u56DE\u7B54\u65F6\u957F:\u00A0", getSecondToTime(Number(duration))] }))] }))] })) })), (!DISABLED_REPEAT_TYPE.includes(type) || isAiAnalysis) && (_jsxs(Stack, __assign({ direction: "row", justifyContent: "space-between", spacing: 1, height: 42 }, { children: [_jsx(Box, __assign({ display: "flex", alignItems: "center", padding: "3px 0 3px 16px" }, { children: isAiAnalysis && (_jsxs(_Fragment, { children: [_jsx(Typography, __assign({ variant: "body2", sx: { flexShrink: 0 } }, { children: "\u6743\u91CD\u5360\u6BD4\uFF1A" })), _jsx(Input, { sx: { width: 92 }, size: "small", value: weight, endAdornment: _jsx(Typography, __assign({ variant: "caption", color: "textSecondary" }, { children: "%" })), disabled: disabledWeight, onChange: handleWeightChange, onBlur: handleWeightBlur }), _jsx(Tooltip, __assign({ title: "AI\u6D4B\u8BC4\u9898\u53EF\u4EE5\u8BBE\u7F6E\u6743\u91CD\uFF0C\u7CFB\u7EDF\u5BF9\u5019\u9009\u4EBA\u89C6\u9891\u9762\u8BD5\u7ED3\u679C\u4F1A\u52A0\u5165\u6743\u91CD\u8FDB\u884C\u8BA1\u7B97\uFF0C\u5F97\u51FAAI\u89C6\u9891\u9762\u8BD5\u5F97\u5206\u3002\u8BBE\u7F6E\u540E5\u5206\u949F\u8D77\u6548" }, { children: _jsx("span", __assign({ style: { display: 'flex', alignItems: 'center', marginLeft: '8px' } }, { children: _jsx(InfoIcon, { sx: { fontSize: 14, color: 'rgba(0, 0, 0, 0.26)' } }) })) }))] })) })), !DISABLED_REPEAT_TYPE.includes(type) && (_jsxs(Stack, __assign({ direction: "row" }, { children: [_jsx(Switch, { sx: { flexShrink: 0, ml: 2, mr: 2 }, size: "small", checked: answerStatus === 1, label: _jsx(Typography, __assign({ fontSize: 12, lineHeight: 1.5, color: "rgba(0, 0, 0, 0.56)" }, { children: "\u5141\u8BB8\u91CD\u590D\u7B54\u9898" })), onChange: handleAnswerStatus }), IS_AI_FOLLOW_UP(step, interactionMethods) && (_jsx(Switch, { sx: { flexShrink: 0, mr: 2 }, size: "small", checked: isOpenAIFollowUp, label: _jsxs(Stack, __assign({ direction: "row", alignItems: "center", spacing: 1 }, { children: [_jsx(Typography, __assign({ fontSize: 12, lineHeight: 1.5, color: "rgba(0, 0, 0, 0.56)" }, { children: "\u56DE\u7B54\u4E0D\u5145\u5206\u65F6\u8FFD\u95EE" })), isOpenAIFollowUp && (_jsx(Select, { sx: { height: 'auto', width: 134 }, size: "small", value: followUpMaximum, options: options, onChange: handleOpenAIFollowUpMaximum }))] })), onChange: handleOpenAIFollowUpStatus }))] })))] })))] })));
|
|
116
|
+
}), aiType === 2 && _jsx(Chip, { variant: "filled", color: "primary", label: "AI\u8BC4\u5206", size: "medium", sx: { ml: 1 } }), (questions === null || questions === void 0 ? void 0 : questions.length) > 1 && _jsx(Chip, { variant: "filled", color: "warning", label: "\u5185\u5BB9\u968F\u673A", size: "medium", sx: { ml: 1 } })] })) })), _jsxs(Box, __assign({ mt: 1, pr: 2, display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: [_jsx(Typography, __assign({ variant: "body2", color: "secondary" }, { children: formatQuestion })), _jsxs(Typography, __assign({ sx: { ml: 2, flexShrink: 0 }, variant: "caption", color: "secondary", alignSelf: "flex-end" }, { children: ["\u56DE\u7B54\u65F6\u957F:\u00A0", getSecondToTime(Number(duration))] }))] }))] })) })), (!DISABLED_REPEAT_TYPE.includes(type) || isAiAnalysis) && (_jsxs(Stack, __assign({ direction: "row", justifyContent: "space-between", spacing: 1, height: 42 }, { children: [_jsx(Box, __assign({ display: "flex", alignItems: "center", padding: "3px 0 3px 16px" }, { children: isAiAnalysis && (_jsxs(_Fragment, { children: [_jsx(Typography, __assign({ variant: "body2", sx: { flexShrink: 0 } }, { children: "\u6743\u91CD\u5360\u6BD4\uFF1A" })), _jsx(Input, { sx: { width: 92 }, size: "small", value: weight, endAdornment: _jsx(Typography, __assign({ variant: "caption", color: "textSecondary" }, { children: "%" })), disabled: disabledWeight, onChange: handleWeightChange, onBlur: handleWeightBlur }), _jsx(Tooltip, __assign({ title: "AI\u6D4B\u8BC4\u9898\u53EF\u4EE5\u8BBE\u7F6E\u6743\u91CD\uFF0C\u7CFB\u7EDF\u5BF9\u5019\u9009\u4EBA\u89C6\u9891\u9762\u8BD5\u7ED3\u679C\u4F1A\u52A0\u5165\u6743\u91CD\u8FDB\u884C\u8BA1\u7B97\uFF0C\u5F97\u51FAAI\u89C6\u9891\u9762\u8BD5\u5F97\u5206\u3002\u8BBE\u7F6E\u540E5\u5206\u949F\u8D77\u6548" }, { children: _jsx("span", __assign({ style: { display: 'flex', alignItems: 'center', marginLeft: '8px' } }, { children: _jsx(InfoIcon, { sx: { fontSize: 14, color: 'rgba(0, 0, 0, 0.26)' } }) })) }))] })) })), !DISABLED_REPEAT_TYPE.includes(type) && (_jsxs(Stack, __assign({ direction: "row" }, { children: [_jsx(Switch, { sx: { flexShrink: 0, ml: 2, mr: 2 }, size: "small", checked: answerStatus === 1, label: _jsx(Typography, __assign({ fontSize: 12, lineHeight: 1.5, color: "rgba(0, 0, 0, 0.56)" }, { children: "\u5141\u8BB8\u91CD\u590D\u7B54\u9898" })), onChange: handleAnswerStatus }), IS_AI_FOLLOW_UP(step, interactionMethods, interactType) && (_jsx(Switch, { sx: { flexShrink: 0, mr: 2 }, size: "small", checked: isOpenAIFollowUp, label: _jsxs(Stack, __assign({ direction: "row", alignItems: "center", spacing: 1 }, { children: [_jsx(Typography, __assign({ fontSize: 12, lineHeight: 1.5, color: "rgba(0, 0, 0, 0.56)" }, { children: "\u56DE\u7B54\u4E0D\u5145\u5206\u65F6\u8FFD\u95EE" })), isOpenAIFollowUp && (_jsx(Select, { sx: { height: 'auto', width: 134 }, size: "small", value: followUpMaximum, options: options, onChange: handleOpenAIFollowUpMaximum }))] })), onChange: handleOpenAIFollowUpStatus }))] })))] })))] })));
|
|
117
117
|
};
|
|
118
118
|
export default memo(QuestionModelListItem);
|
|
@@ -40,7 +40,7 @@ import { uniqueId } from "../../../../utils/utils";
|
|
|
40
40
|
import { useSetState } from 'ahooks';
|
|
41
41
|
import { AddIcon, Box, Button, LayerOutlineIcon, MicIcon, Popover, RadioCheckedIcon, SMSOneIcon, Typography } from 'fbm-ui';
|
|
42
42
|
import { List, ListItem, ListItemButton, ListItemIcon, ListItemText } from 'fbm-ui/lib/mui';
|
|
43
|
-
import { useCallback } from 'react';
|
|
43
|
+
import { useCallback, useState } from 'react';
|
|
44
44
|
var ICONS = (_a = {},
|
|
45
45
|
_a[ADD_QUESTION_TYPE.FREE] = _jsx(SMSOneIcon, { color: "secondary" }),
|
|
46
46
|
_a[ADD_QUESTION_TYPE.LANGUAGE] = _jsx(MicIcon, { color: "secondary" }),
|
|
@@ -59,6 +59,10 @@ var AiEvaluation = function (_a) {
|
|
|
59
59
|
showOnlyAITest: false,
|
|
60
60
|
}), 2), state = _b[0], setState = _b[1];
|
|
61
61
|
var addQuestionOpen = state.addQuestionOpen, showOnlyAITest = state.showOnlyAITest;
|
|
62
|
+
var _c = __read(useState(false), 2), expanded = _c[0], setExpanded = _c[1];
|
|
63
|
+
var handleExpandedChange = function (panel) { return function (event, isExpanded) {
|
|
64
|
+
setExpanded(isExpanded ? panel : false);
|
|
65
|
+
}; };
|
|
62
66
|
var handleClickAdd = useCallback(function (aiShowType) {
|
|
63
67
|
setState({ addQuestionOpen: false });
|
|
64
68
|
updateQuestionState({
|
|
@@ -77,7 +81,7 @@ var AiEvaluation = function (_a) {
|
|
|
77
81
|
var name = _a.name, list = _a.list;
|
|
78
82
|
return (_jsxs(Box, { children: [_jsx(Typography, __assign({ fontSize: 12, lineHeight: 1.5, weight: "500", mb: 2 }, { children: name })), list
|
|
79
83
|
.filter(function (v) { return !isEdit || !v.isNew || selctedAbilitys.includes(v.token); })
|
|
80
|
-
.map(function (item, i) { return (_jsx(BaseAccordion, __assign({ index: i, isOem: isOem, isShowOnlyAITest: showOnlyAITest, isShowDesc: index !== 0, isShowSummaryAction: index !== 0, isShowConfirm: index !== 0 }, item), item.
|
|
84
|
+
.map(function (item, i) { return (_jsx(BaseAccordion, __assign({ index: i, isOem: isOem, isShowOnlyAITest: showOnlyAITest, isShowDesc: index !== 0, isShowSummaryAction: index !== 0, isShowConfirm: index !== 0, expanded: expanded, onExpandedChange: handleExpandedChange }, item), item.token)); })] }, name));
|
|
81
85
|
})] }));
|
|
82
86
|
};
|
|
83
87
|
export default AiEvaluation;
|
|
@@ -25,7 +25,7 @@ var QuestionTemplate = function (_a) {
|
|
|
25
25
|
var enterprise = useEnterpriseStore().enterprise;
|
|
26
26
|
var loading = useRequest(function () { return PostAiModelQuestions(__assign({ extraAbilityTokens: selctedAbilitys }, enterprise)); }, {
|
|
27
27
|
manual: false,
|
|
28
|
-
refreshDeps: [selctedAbilitys, enterprise],
|
|
28
|
+
refreshDeps: [JSON.stringify(selctedAbilitys), JSON.stringify(enterprise)],
|
|
29
29
|
onSuccess: function (_a) {
|
|
30
30
|
var data = _a.data;
|
|
31
31
|
return updateAiEvaluationData(data);
|
|
@@ -0,0 +1,74 @@
|
|
|
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
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
13
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
14
|
+
if (!m) return o;
|
|
15
|
+
var i = m.call(o), r, ar = [], e;
|
|
16
|
+
try {
|
|
17
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
18
|
+
}
|
|
19
|
+
catch (error) { e = { error: error }; }
|
|
20
|
+
finally {
|
|
21
|
+
try {
|
|
22
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
23
|
+
}
|
|
24
|
+
finally { if (e) throw e.error; }
|
|
25
|
+
}
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
29
|
+
import { PostCommonUpload } from "../../../../services/ai-question";
|
|
30
|
+
import { isExceedMaxFileSize } from "../../../../utils/utils";
|
|
31
|
+
import { useRequest } from 'ahooks';
|
|
32
|
+
import { Box, Button, Message, Typography, Upload, UploadIcon } from 'fbm-ui';
|
|
33
|
+
import { CircularProgress, Stack } from 'fbm-ui/lib/mui';
|
|
34
|
+
var ACCEPT_AUDIO_TYPES = '.mp3,.wav,audio/mpeg,audio/wav,audio/x-wav';
|
|
35
|
+
var AUDIO_FILE_EXT_REG = /\.(mp3|wav)$/i;
|
|
36
|
+
var AudioUploader = function (_a) {
|
|
37
|
+
var audioUrl = _a.audioUrl, onChange = _a.onChange;
|
|
38
|
+
var _b = useRequest(PostCommonUpload, {
|
|
39
|
+
manual: true,
|
|
40
|
+
onSuccess: function (_a) {
|
|
41
|
+
var data = _a.data;
|
|
42
|
+
var _b = __read(data, 1), firstData = _b[0];
|
|
43
|
+
onChange === null || onChange === void 0 ? void 0 : onChange((firstData === null || firstData === void 0 ? void 0 : firstData.url) || '');
|
|
44
|
+
},
|
|
45
|
+
}), loading = _b.loading, postCommonUpload = _b.run;
|
|
46
|
+
var uploadProps = {
|
|
47
|
+
type: 'custom',
|
|
48
|
+
showUploadList: false,
|
|
49
|
+
accept: ACCEPT_AUDIO_TYPES,
|
|
50
|
+
customRequest: function (_a) {
|
|
51
|
+
var file = _a.file;
|
|
52
|
+
var fileName = (file === null || file === void 0 ? void 0 : file.name) || '';
|
|
53
|
+
var fileType = (file === null || file === void 0 ? void 0 : file.type) || '';
|
|
54
|
+
var isValidType = AUDIO_FILE_EXT_REG.test(fileName) || ['audio/mpeg', 'audio/wav', 'audio/x-wav'].includes(fileType);
|
|
55
|
+
if (!isValidType) {
|
|
56
|
+
Message.error('仅支持上传MP3、WAV格式录音文件');
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (isExceedMaxFileSize(file.size)) {
|
|
60
|
+
Message.error('录音文件大小超过20MB,请重新上传');
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
var formData = new FormData();
|
|
64
|
+
formData.append('files', file);
|
|
65
|
+
postCommonUpload(formData);
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
return (_jsxs(Box, __assign({ mt: 1.5 }, { children: [_jsxs(Stack, __assign({ direction: "row", spacing: 1.5, alignItems: "center" }, { children: [_jsx(Upload, __assign({}, uploadProps, { children: _jsx(Button, __assign({ variant: "outlined", color: "inherit", size: "small", icon: !loading ? _jsx(UploadIcon, {}) : undefined }, { children: loading ? (_jsxs(Stack, __assign({ direction: "row", spacing: 1, alignItems: "center" }, { children: [_jsx(CircularProgress, { size: 16, color: "inherit" }), _jsx("span", { children: "\u4E0A\u4F20\u4E2D..." })] }))) : ('上传录音') })) })), audioUrl && (_jsxs(_Fragment, { children: [_jsx("audio", { controls: true, src: audioUrl, style: {
|
|
69
|
+
width: 300,
|
|
70
|
+
maxWidth: '100%',
|
|
71
|
+
height: 35,
|
|
72
|
+
} }), _jsx(Button, __assign({ variant: "text", color: "error", size: "small", onClick: function () { return onChange === null || onChange === void 0 ? void 0 : onChange(''); } }, { children: "\u5220\u9664" }))] }))] })), _jsx(Typography, __assign({ variant: "caption", color: "text.secondary", display: "block", mt: 1 }, { children: "\u652F\u6301MP3\u3001WAV\u683C\u5F0F, \u6700\u592720MB" }))] })));
|
|
73
|
+
};
|
|
74
|
+
export default AudioUploader;
|