eli-video-interview 1.1.6 → 1.1.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/LICENSE +1 -1
- package/esm/components/BigBallSvg/index.js +3 -3
- package/esm/components/BigBallSvg/styled.d.ts +3 -0
- package/esm/components/BigBallSvg/styled.js +28 -0
- package/esm/components/Charts/Chart.js +19 -25
- package/esm/components/Charts/ReportPie.d.ts +4 -0
- package/esm/components/Charts/ReportPie.js +135 -0
- package/esm/components/Charts/TemplatePie.d.ts +4 -0
- package/esm/components/Charts/TemplatePie.js +81 -0
- package/esm/components/Charts/const.d.ts +15 -380
- package/esm/components/Charts/const.js +15 -380
- package/esm/components/Charts/interface.d.ts +15 -0
- package/esm/components/RootProvider/index.d.ts +3 -0
- package/esm/components/RootProvider/index.js +27 -0
- package/esm/{modules/ai-report/components/ScoreReport/ScoreBigBall.d.ts → components/ScoreBigBall/index.d.ts} +0 -0
- package/esm/components/ScoreBigBall/index.js +26 -0
- package/esm/components/ScoreBigBall/interface.d.ts +7 -0
- package/esm/components/ScoreBigBall/interface.js +1 -0
- package/esm/components/ScoreBigBall/styled.d.ts +4 -0
- package/esm/components/ScoreBigBall/styled.js +12 -0
- package/esm/components/SvgIcon/index.d.ts +2 -2
- package/esm/components/SvgIcon/index.js +3 -2
- package/esm/components/SvgIcon/interface.d.ts +1 -0
- package/esm/index.d.ts +2 -0
- package/esm/index.js +2 -0
- package/esm/modules/ai-ability/Root.d.ts +3 -0
- package/esm/modules/ai-ability/Root.js +135 -0
- package/esm/modules/ai-ability/components/UpdateAbility/index.d.ts +4 -0
- package/esm/modules/ai-ability/components/UpdateAbility/index.js +114 -0
- package/esm/modules/ai-ability/components/UpdateAbility/interface.d.ts +7 -0
- package/esm/modules/ai-ability/components/UpdateAbility/interface.js +1 -0
- package/esm/modules/ai-ability/index.d.ts +2 -0
- package/esm/modules/ai-ability/index.js +7 -0
- package/esm/modules/ai-ability/interface.d.ts +15 -0
- package/esm/modules/ai-ability/interface.js +1 -0
- package/esm/modules/ai-ability/styled.d.ts +4 -0
- package/esm/modules/ai-ability/styled.js +6 -0
- package/esm/modules/ai-question/Root.js +7 -4
- package/esm/modules/ai-question/components/AiAnalysis/AnalysisItem.js +1 -1
- package/esm/modules/ai-question/components/AiAnalysis/MainPointsItem.js +1 -1
- package/esm/modules/ai-question/components/AiAnalysis/index.js +3 -3
- package/esm/modules/ai-question/components/AiAssessmentCriteria/index.js +1 -1
- package/esm/modules/ai-question/components/AiAssessmentCriteria/styled.d.ts +5 -5
- package/esm/modules/ai-question/components/AiAssessmentCriteria/styled.js +1 -1
- package/esm/modules/ai-question/components/BaseAccordion/index.js +2 -2
- package/esm/modules/ai-question/components/BaseAccordion/styled.js +7 -4
- package/esm/modules/ai-question/components/BootVideo/index.js +1 -1
- package/esm/modules/ai-question/components/QuestionModel/Item.js +4 -4
- package/esm/modules/ai-question/components/QuestionModel/Skeleton.js +1 -1
- package/esm/modules/ai-question/components/QuestionModel/index.js +23 -16
- package/esm/modules/ai-question/components/QuestionModel/styled.js +1 -1
- package/esm/modules/ai-question/components/QuestionPreview/styled.d.ts +3 -3
- package/esm/modules/ai-question/components/QuestionPreview/styled.js +2 -2
- package/esm/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +11 -8
- package/esm/modules/ai-question/components/QuestionTemplate/Skeleton.js +1 -1
- package/esm/modules/ai-question/components/QuestionTemplate/index.js +2 -10
- package/esm/modules/ai-question/components/QuestionUpdate/Form.js +10 -3
- package/esm/modules/ai-question/components/QuestionUpdate/VideoVoice.js +1 -1
- package/esm/modules/ai-question/components/QuestionUpdate/const.js +1 -1
- package/esm/modules/ai-question/components/QuestionUpdate/index.js +5 -3
- package/esm/modules/ai-question/components/QuestionUpdate/interface.d.ts +5 -1
- package/esm/modules/ai-question/index.d.ts +2 -2
- package/esm/modules/ai-question/index.js +2 -4
- package/esm/modules/ai-question/interface.d.ts +5 -3
- package/esm/modules/ai-question/useAiQuestion.d.ts +4 -2
- package/esm/modules/ai-question/useAiQuestion.js +3 -1
- package/esm/modules/ai-report/components/ScoreReport/Report.d.ts +2 -2
- package/esm/modules/ai-report/components/ScoreReport/Report.js +11 -29
- package/esm/modules/ai-report/components/ScoreReport/index.js +1 -1
- package/esm/modules/ai-report/components/ScoreReport/interface.d.ts +0 -7
- package/esm/modules/ai-report/components/ScoreReport/styled.d.ts +1 -4
- package/esm/modules/ai-report/components/ScoreReport/styled.js +1 -14
- package/esm/modules/ai-report/components/VideoQuestion/QuestionItem.js +10 -9
- package/esm/modules/ai-report/components/VideoQuestion/styled.d.ts +16 -16
- package/esm/modules/ai-report/components/VideoQuestion/styled.js +2 -1
- package/esm/modules/ai-report/index.d.ts +2 -2
- package/esm/modules/ai-report/index.js +2 -4
- package/esm/modules/ai-report/interface.d.ts +10 -1
- package/esm/modules/ai-report/useAiReport.d.ts +0 -1
- package/esm/modules/ai-template/Root.d.ts +4 -0
- package/esm/modules/ai-template/Root.js +48 -0
- package/esm/modules/ai-template/components/CapabilityModel/const.d.ts +47 -0
- package/esm/modules/ai-template/components/CapabilityModel/const.js +56 -0
- package/esm/modules/ai-template/components/CapabilityModel/index.d.ts +3 -0
- package/esm/modules/ai-template/components/CapabilityModel/index.js +27 -0
- package/esm/modules/ai-template/components/QuestionList/Item.d.ts +4 -0
- package/esm/modules/ai-template/components/QuestionList/Item.js +24 -0
- package/esm/modules/ai-template/components/QuestionList/index.d.ts +3 -0
- package/esm/modules/ai-template/components/QuestionList/index.js +20 -0
- package/esm/modules/ai-template/components/QuestionList/interface.d.ts +5 -0
- package/esm/modules/ai-template/components/QuestionList/interface.js +1 -0
- package/esm/modules/ai-template/components/TemplateHeader/index.d.ts +4 -0
- package/esm/modules/ai-template/components/TemplateHeader/index.js +18 -0
- package/esm/modules/ai-template/components/TemplateHeader/interface.d.ts +6 -0
- package/esm/modules/ai-template/components/TemplateHeader/interface.js +1 -0
- package/esm/modules/ai-template/components/TemplateList/index.d.ts +3 -0
- package/esm/modules/ai-template/components/TemplateList/index.js +96 -0
- package/esm/modules/ai-template/components/TemplateList/interface.d.ts +24 -0
- package/esm/modules/ai-template/components/TemplateList/interface.js +1 -0
- package/esm/modules/ai-template/components/TemplateList/styled.d.ts +37 -0
- package/esm/modules/ai-template/components/TemplateList/styled.js +77 -0
- package/esm/modules/ai-template/components/TemplateMenu/index.d.ts +3 -0
- package/esm/modules/ai-template/components/TemplateMenu/index.js +57 -0
- package/esm/modules/ai-template/components/TemplateMenu/interface.d.ts +12 -0
- package/esm/modules/ai-template/components/TemplateMenu/interface.js +1 -0
- package/esm/modules/ai-template/components/TemplateMenu/styled.d.ts +29 -0
- package/esm/modules/ai-template/components/TemplateMenu/styled.js +16 -0
- package/esm/modules/ai-template/index.d.ts +4 -0
- package/esm/modules/{ai-report/components/ScoreReport/RosePie.js → ai-template/index.js} +8 -7
- package/esm/modules/ai-template/interface.d.ts +24 -0
- package/esm/modules/ai-template/interface.js +1 -0
- package/esm/services/ai-ability.d.ts +12 -0
- package/esm/services/ai-ability.js +7 -0
- package/esm/services/ai-question.d.ts +0 -1
- package/esm/services/ai-question.js +1 -3
- package/esm/services/ai-template.d.ts +4 -0
- package/esm/services/ai-template.js +9 -0
- package/esm/store/ai-question/ai-analysis-store.js +2 -1
- package/esm/store/ai-question/global-store.d.ts +9 -6
- package/esm/store/ai-question/global-store.js +0 -1
- package/esm/store/ai-question/question-model-store.js +9 -7
- package/esm/store/ai-report/global-store.d.ts +3 -6
- package/esm/store/ai-report/global-store.js +4 -6
- package/esm/store/ai-template/global-store.d.ts +35 -0
- package/esm/store/ai-template/global-store.js +26 -0
- package/esm/utils/config.d.ts +1 -0
- package/esm/utils/interceptor.js +7 -2
- package/lib/components/BigBallSvg/index.js +2 -5
- package/lib/components/BigBallSvg/styled.d.ts +3 -0
- package/lib/components/BigBallSvg/styled.js +31 -0
- package/lib/components/Charts/Chart.js +41 -27
- package/lib/components/Charts/ReportPie.d.ts +4 -0
- package/lib/components/Charts/ReportPie.js +140 -0
- package/lib/components/Charts/TemplatePie.d.ts +4 -0
- package/lib/components/Charts/TemplatePie.js +86 -0
- package/lib/components/Charts/const.d.ts +15 -380
- package/lib/components/Charts/const.js +16 -381
- package/lib/components/Charts/interface.d.ts +15 -0
- package/lib/components/RootProvider/index.d.ts +3 -0
- package/lib/components/RootProvider/index.js +29 -0
- package/lib/{modules/ai-report/components/ScoreReport/ScoreBigBall.d.ts → components/ScoreBigBall/index.d.ts} +0 -0
- package/lib/components/ScoreBigBall/index.js +31 -0
- package/lib/components/ScoreBigBall/interface.d.ts +7 -0
- package/lib/components/ScoreBigBall/interface.js +2 -0
- package/lib/components/ScoreBigBall/styled.d.ts +4 -0
- package/lib/components/ScoreBigBall/styled.js +15 -0
- package/lib/components/SvgIcon/index.d.ts +2 -2
- package/lib/components/SvgIcon/index.js +26 -2
- package/lib/components/SvgIcon/interface.d.ts +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +5 -1
- package/lib/modules/ai-ability/Root.d.ts +3 -0
- package/lib/modules/ai-ability/Root.js +140 -0
- package/lib/modules/ai-ability/components/UpdateAbility/index.d.ts +4 -0
- package/lib/modules/ai-ability/components/UpdateAbility/index.js +116 -0
- package/lib/modules/ai-ability/components/UpdateAbility/interface.d.ts +7 -0
- package/lib/modules/ai-ability/components/UpdateAbility/interface.js +2 -0
- package/lib/modules/ai-ability/index.d.ts +2 -0
- package/lib/modules/ai-ability/index.js +12 -0
- package/lib/modules/ai-ability/interface.d.ts +15 -0
- package/lib/modules/ai-ability/interface.js +2 -0
- package/lib/modules/ai-ability/styled.d.ts +4 -0
- package/lib/modules/ai-ability/styled.js +9 -0
- package/lib/modules/ai-question/Root.js +7 -4
- package/lib/modules/ai-question/components/AiAnalysis/AnalysisItem.js +2 -2
- package/lib/modules/ai-question/components/AiAnalysis/MainPointsItem.js +2 -2
- package/lib/modules/ai-question/components/AiAnalysis/index.js +2 -2
- package/lib/modules/ai-question/components/AiAssessmentCriteria/index.js +7 -7
- package/lib/modules/ai-question/components/AiAssessmentCriteria/styled.d.ts +5 -5
- package/lib/modules/ai-question/components/AiAssessmentCriteria/styled.js +2 -2
- package/lib/modules/ai-question/components/BaseAccordion/index.js +5 -5
- package/lib/modules/ai-question/components/BaseAccordion/styled.js +7 -4
- package/lib/modules/ai-question/components/BootVideo/index.js +3 -3
- package/lib/modules/ai-question/components/QuestionModel/Item.js +3 -3
- package/lib/modules/ai-question/components/QuestionModel/Skeleton.js +2 -2
- package/lib/modules/ai-question/components/QuestionModel/index.js +23 -16
- package/lib/modules/ai-question/components/QuestionModel/styled.js +1 -1
- package/lib/modules/ai-question/components/QuestionPreview/styled.d.ts +3 -3
- package/lib/modules/ai-question/components/QuestionPreview/styled.js +3 -3
- package/lib/modules/ai-question/components/QuestionTemplate/AiEvaluation.js +11 -8
- package/lib/modules/ai-question/components/QuestionTemplate/Skeleton.js +2 -2
- package/lib/modules/ai-question/components/QuestionTemplate/index.js +1 -9
- package/lib/modules/ai-question/components/QuestionUpdate/Form.js +9 -2
- package/lib/modules/ai-question/components/QuestionUpdate/VideoVoice.js +2 -2
- package/lib/modules/ai-question/components/QuestionUpdate/const.js +1 -1
- package/lib/modules/ai-question/components/QuestionUpdate/index.js +7 -5
- package/lib/modules/ai-question/components/QuestionUpdate/interface.d.ts +5 -1
- package/lib/modules/ai-question/index.d.ts +2 -2
- package/lib/modules/ai-question/index.js +2 -4
- package/lib/modules/ai-question/interface.d.ts +5 -3
- package/lib/modules/ai-question/useAiQuestion.d.ts +4 -2
- package/lib/modules/ai-question/useAiQuestion.js +3 -1
- package/lib/modules/ai-report/components/ScoreReport/Report.d.ts +2 -2
- package/lib/modules/ai-report/components/ScoreReport/Report.js +8 -26
- package/lib/modules/ai-report/components/ScoreReport/index.js +3 -3
- package/lib/modules/ai-report/components/ScoreReport/interface.d.ts +0 -7
- package/lib/modules/ai-report/components/ScoreReport/styled.d.ts +1 -4
- package/lib/modules/ai-report/components/ScoreReport/styled.js +1 -14
- package/lib/modules/ai-report/components/VideoQuestion/QuestionItem.js +10 -9
- package/lib/modules/ai-report/components/VideoQuestion/styled.d.ts +16 -16
- package/lib/modules/ai-report/components/VideoQuestion/styled.js +3 -2
- package/lib/modules/ai-report/index.d.ts +2 -2
- package/lib/modules/ai-report/index.js +2 -4
- package/lib/modules/ai-report/interface.d.ts +10 -1
- package/lib/modules/ai-report/useAiReport.d.ts +0 -1
- package/lib/modules/ai-template/Root.d.ts +4 -0
- package/lib/modules/ai-template/Root.js +53 -0
- package/lib/modules/ai-template/components/CapabilityModel/const.d.ts +47 -0
- package/lib/modules/ai-template/components/CapabilityModel/const.js +59 -0
- package/lib/modules/ai-template/components/CapabilityModel/index.d.ts +3 -0
- package/lib/modules/ai-template/components/CapabilityModel/index.js +32 -0
- package/lib/modules/ai-template/components/QuestionList/Item.d.ts +4 -0
- package/lib/modules/ai-template/components/QuestionList/Item.js +26 -0
- package/lib/modules/ai-template/components/QuestionList/index.d.ts +3 -0
- package/lib/modules/ai-template/components/QuestionList/index.js +25 -0
- package/lib/modules/ai-template/components/QuestionList/interface.d.ts +5 -0
- package/lib/modules/ai-template/components/QuestionList/interface.js +2 -0
- package/lib/modules/ai-template/components/TemplateHeader/index.d.ts +4 -0
- package/lib/modules/ai-template/components/TemplateHeader/index.js +20 -0
- package/lib/modules/ai-template/components/TemplateHeader/interface.d.ts +6 -0
- package/lib/modules/ai-template/components/TemplateHeader/interface.js +2 -0
- package/lib/modules/ai-template/components/TemplateList/index.d.ts +3 -0
- package/lib/modules/ai-template/components/TemplateList/index.js +101 -0
- package/lib/modules/ai-template/components/TemplateList/interface.d.ts +24 -0
- package/lib/modules/ai-template/components/TemplateList/interface.js +2 -0
- package/lib/modules/ai-template/components/TemplateList/styled.d.ts +37 -0
- package/lib/modules/ai-template/components/TemplateList/styled.js +80 -0
- package/lib/modules/ai-template/components/TemplateMenu/index.d.ts +3 -0
- package/lib/modules/ai-template/components/TemplateMenu/index.js +59 -0
- package/lib/modules/ai-template/components/TemplateMenu/interface.d.ts +12 -0
- package/lib/modules/ai-template/components/TemplateMenu/interface.js +2 -0
- package/lib/modules/ai-template/components/TemplateMenu/styled.d.ts +29 -0
- package/lib/modules/ai-template/components/TemplateMenu/styled.js +19 -0
- package/lib/modules/ai-template/index.d.ts +4 -0
- package/lib/modules/{ai-report/components/ScoreReport/RosePie.js → ai-template/index.js} +8 -7
- package/lib/modules/ai-template/interface.d.ts +24 -0
- package/lib/modules/ai-template/interface.js +2 -0
- package/lib/services/ai-ability.d.ts +12 -0
- package/lib/services/ai-ability.js +13 -0
- package/lib/services/ai-question.d.ts +0 -1
- package/lib/services/ai-question.js +1 -4
- package/lib/services/ai-template.d.ts +4 -0
- package/lib/services/ai-template.js +16 -0
- package/lib/store/ai-question/ai-analysis-store.js +2 -1
- package/lib/store/ai-question/global-store.d.ts +9 -6
- package/lib/store/ai-question/global-store.js +0 -1
- package/lib/store/ai-question/question-model-store.js +9 -7
- package/lib/store/ai-report/global-store.d.ts +3 -6
- package/lib/store/ai-report/global-store.js +3 -5
- package/lib/store/ai-template/global-store.d.ts +35 -0
- package/lib/store/ai-template/global-store.js +29 -0
- package/lib/utils/config.d.ts +1 -0
- package/lib/utils/interceptor.js +7 -2
- package/package.json +18 -111
- package/esm/components/BigBallSvg/index.module.css +0 -37
- package/esm/modules/ai-question/components/QuestionTemplate/HistoryPattern.d.ts +0 -3
- package/esm/modules/ai-question/components/QuestionTemplate/HistoryPattern.js +0 -20
- package/esm/modules/ai-question/components/QuestionTemplate/styled.d.ts +0 -87
- package/esm/modules/ai-question/components/QuestionTemplate/styled.js +0 -33
- package/esm/modules/ai-report/components/ScoreReport/RosePie.d.ts +0 -4
- package/esm/modules/ai-report/components/ScoreReport/ScoreBigBall.js +0 -26
- package/esm/modules/ai-report/components/ScoreReport/const.d.ts +0 -34
- package/esm/modules/ai-report/components/ScoreReport/const.js +0 -77
- package/lib/components/BigBallSvg/index.module.css +0 -37
- package/lib/modules/ai-question/components/QuestionTemplate/HistoryPattern.d.ts +0 -3
- package/lib/modules/ai-question/components/QuestionTemplate/HistoryPattern.js +0 -25
- package/lib/modules/ai-question/components/QuestionTemplate/styled.d.ts +0 -87
- package/lib/modules/ai-question/components/QuestionTemplate/styled.js +0 -39
- package/lib/modules/ai-report/components/ScoreReport/RosePie.d.ts +0 -4
- package/lib/modules/ai-report/components/ScoreReport/ScoreBigBall.js +0 -31
- package/lib/modules/ai-report/components/ScoreReport/const.d.ts +0 -34
- package/lib/modules/ai-report/components/ScoreReport/const.js +0 -80
|
@@ -0,0 +1,135 @@
|
|
|
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (_) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
49
|
+
import { useCallback } from 'react';
|
|
50
|
+
import { Box, Button, Header, Table, Link, EditIcon, DeleteIcon, AddIcon, Message, confirm } from 'fbm-ui';
|
|
51
|
+
import { useRequest, useSetState } from 'ahooks';
|
|
52
|
+
import dayjs from 'dayjs';
|
|
53
|
+
import { PostQuestionCollectionList, PostQuestionCollectionDelete } from "../../services/ai-ability";
|
|
54
|
+
import { AbilityRoot } from './styled';
|
|
55
|
+
import UpdateAbility from './components/UpdateAbility';
|
|
56
|
+
var AiAbilityRoot = function () {
|
|
57
|
+
var _a = useSetState({ open: false, name: '', token: '' }), state = _a[0], setState = _a[1];
|
|
58
|
+
var _b = useRequest(PostQuestionCollectionList), data = _b.data, getList = _b.run, listLoading = _b.loading;
|
|
59
|
+
var deleteList = useRequest(PostQuestionCollectionDelete, {
|
|
60
|
+
manual: true,
|
|
61
|
+
onSuccess: function () {
|
|
62
|
+
Message.success('删除能力成功');
|
|
63
|
+
getList();
|
|
64
|
+
},
|
|
65
|
+
}).run;
|
|
66
|
+
var handleAdd = useCallback(function () {
|
|
67
|
+
setState({ open: true });
|
|
68
|
+
}, [setState]);
|
|
69
|
+
var handleEdit = useCallback(function (_a) {
|
|
70
|
+
var name = _a.name, token = _a.token;
|
|
71
|
+
setState({ open: true, name: name, token: token });
|
|
72
|
+
}, [setState]);
|
|
73
|
+
var handleDelete = useCallback(function (_a) {
|
|
74
|
+
var token = _a.token, used = _a.used, tag = _a.tag;
|
|
75
|
+
if (used) {
|
|
76
|
+
Message.error('有题目正在使用该能力标签,暂不支持删除');
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
confirm({
|
|
80
|
+
title: '确认删除?',
|
|
81
|
+
content: "\u786E\u8BA4\u5C06".concat(tag, "\u4ECE\u7CFB\u7EDF\u4E2D\u5220\u9664\u5417\uFF1F\u8BE5\u5220\u9664\u52A8\u4F5C\u65E0\u6CD5\u88AB\u64A4\u9500\u3002"),
|
|
82
|
+
okText: '删除',
|
|
83
|
+
okProps: {
|
|
84
|
+
color: 'error',
|
|
85
|
+
variant: 'contained',
|
|
86
|
+
},
|
|
87
|
+
onOk: function (_a) {
|
|
88
|
+
var onClose = _a.onClose;
|
|
89
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
90
|
+
return __generator(this, function (_b) {
|
|
91
|
+
deleteList(token);
|
|
92
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
93
|
+
return [2 /*return*/];
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}, [deleteList]);
|
|
100
|
+
var handleClose = useCallback(function () {
|
|
101
|
+
setState({ open: false, name: '', token: '' });
|
|
102
|
+
}, [setState]);
|
|
103
|
+
var columns = [
|
|
104
|
+
{
|
|
105
|
+
id: 'name',
|
|
106
|
+
label: '能力名称',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
id: 'updatedAt',
|
|
110
|
+
label: '最后更新时间',
|
|
111
|
+
render: function (_a) {
|
|
112
|
+
var cell = _a.cell, row = _a.row;
|
|
113
|
+
return _jsx(_Fragment, { children: row.type === 1 ? '-' : dayjs(cell * 1000).format('YYYY-MM-DD HH:mm:ss') });
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: 'mateData',
|
|
118
|
+
label: '最后更新人',
|
|
119
|
+
render: function (_a) {
|
|
120
|
+
var cell = _a.cell, row = _a.row;
|
|
121
|
+
return _jsx(_Fragment, { children: row.type === 1 ? '-' : cell === null || cell === void 0 ? void 0 : cell.account });
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: 'action',
|
|
126
|
+
label: '操作',
|
|
127
|
+
render: function (_a) {
|
|
128
|
+
var row = _a.row;
|
|
129
|
+
return row.type === 1 ? null : (_jsxs(_Fragment, { children: [_jsx(Link, { sx: { color: 'rgba(0, 0, 0, 0.56)', mr: 3, cursor: 'pointer' }, text: _jsx(EditIcon, {}), onClick: function () { return handleEdit(row); } }), _jsx(Link, { sx: { color: 'rgba(0, 0, 0, 0.56)', cursor: 'pointer' }, text: _jsx(DeleteIcon, {}), onClick: function () { return handleDelete(row); } })] }));
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
];
|
|
133
|
+
return (_jsxs(AbilityRoot, { children: [_jsx(UpdateAbility, __assign({}, state, { onClose: handleClose, onSuccess: getList })), _jsx(Header, { title: "\u8003\u5BDF\u80FD\u529B\u7BA1\u7406", renderAction: function () { return (_jsx(Button, __assign({ icon: _jsx(AddIcon, {}), onClick: handleAdd }, { children: "\u65B0\u589E\u80FD\u529B" }))); } }), _jsx(Box, __assign({ mt: 2, border: "1px solid rgba(0, 0, 0, 0.08)", borderRadius: 0.5, overflow: "hidden" }, { children: _jsx(Table, { emptyText: "\u6682\u65E0\u6570\u636E", loading: listLoading, data: data === null || data === void 0 ? void 0 : data.data.list, columns: columns }) }))] }));
|
|
134
|
+
};
|
|
135
|
+
export default AiAbilityRoot;
|
|
@@ -0,0 +1,114 @@
|
|
|
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (_) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
49
|
+
import { useEffect, useState, useCallback } from 'react';
|
|
50
|
+
import { Dialog, TextField, useTextField, Message } from 'fbm-ui';
|
|
51
|
+
import { useRequest } from 'ahooks';
|
|
52
|
+
import { PostQuestionCollectionUpsert } from "../../../../services/ai-ability";
|
|
53
|
+
var UpdateAbility = function (props) {
|
|
54
|
+
var open = props.open, _a = props.name, name = _a === void 0 ? '' : _a, token = props.token, onClose = props.onClose, onSuccess = props.onSuccess;
|
|
55
|
+
var _b = useState(''), value = _b[0], setValue = _b[1];
|
|
56
|
+
var _c = useRequest(PostQuestionCollectionUpsert, {
|
|
57
|
+
manual: true,
|
|
58
|
+
onSuccess: function () {
|
|
59
|
+
Message.success("".concat(token ? '编辑' : '新增', "\u80FD\u529B\u6210\u529F"));
|
|
60
|
+
onClose();
|
|
61
|
+
onSuccess();
|
|
62
|
+
},
|
|
63
|
+
}), run = _c.run, loading = _c.loading;
|
|
64
|
+
var nameTextField = useTextField({
|
|
65
|
+
value: value,
|
|
66
|
+
label: '能力名称',
|
|
67
|
+
required: true,
|
|
68
|
+
rules: [
|
|
69
|
+
{
|
|
70
|
+
required: true,
|
|
71
|
+
message: '请输入能力名称',
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
onChange: function (e) { return setValue(e.target.value); },
|
|
75
|
+
max: 7,
|
|
76
|
+
sx: {
|
|
77
|
+
height: '48px',
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
var handleOk = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
81
|
+
var error, avocadoConfig;
|
|
82
|
+
return __generator(this, function (_a) {
|
|
83
|
+
switch (_a.label) {
|
|
84
|
+
case 0: return [4 /*yield*/, nameTextField.handleValidate()];
|
|
85
|
+
case 1:
|
|
86
|
+
error = _a.sent();
|
|
87
|
+
if (!error) {
|
|
88
|
+
avocadoConfig = window['AvocadoVideoInterviewConfig'];
|
|
89
|
+
run({
|
|
90
|
+
name: value,
|
|
91
|
+
tag: value,
|
|
92
|
+
token: token,
|
|
93
|
+
mateData: {
|
|
94
|
+
account: avocadoConfig === null || avocadoConfig === void 0 ? void 0 : avocadoConfig.account,
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return [2 /*return*/];
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}); }, [nameTextField, run, token, value]);
|
|
102
|
+
useEffect(function () {
|
|
103
|
+
setValue(name);
|
|
104
|
+
}, [name]);
|
|
105
|
+
useEffect(function () {
|
|
106
|
+
if (!open) {
|
|
107
|
+
setValue('');
|
|
108
|
+
nameTextField.setError();
|
|
109
|
+
}
|
|
110
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
111
|
+
}, [open]);
|
|
112
|
+
return (_jsx(Dialog, __assign({ title: token ? '编辑能力' : '新增能力', open: open, okText: token ? '保存' : '新建', okProps: { loading: loading }, onClose: onClose, onOk: handleOk }, { children: _jsx(TextField, __assign({}, nameTextField)) })));
|
|
113
|
+
};
|
|
114
|
+
export default UpdateAbility;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import RootProvider from "../../components/RootProvider";
|
|
3
|
+
import AiAbilityRoot from './Root';
|
|
4
|
+
var AiAbility = function () {
|
|
5
|
+
return (_jsx(RootProvider, { children: _jsx(AiAbilityRoot, {}) }));
|
|
6
|
+
};
|
|
7
|
+
export default AiAbility;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface QuestionCollectionList {
|
|
2
|
+
name: string;
|
|
3
|
+
token: string;
|
|
4
|
+
tag: string;
|
|
5
|
+
type: 1 | 3;
|
|
6
|
+
sort: number;
|
|
7
|
+
updatedAt: number;
|
|
8
|
+
}
|
|
9
|
+
export interface QuestionCollectionListData {
|
|
10
|
+
list: QuestionCollectionList[];
|
|
11
|
+
total: number;
|
|
12
|
+
}
|
|
13
|
+
export interface QuestionCollectionListRes {
|
|
14
|
+
data: QuestionCollectionListData;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const AbilityRoot: import("@emotion/styled").StyledComponent<import("fbm-ui/lib/components/Box").BoxProps & {
|
|
3
|
+
children?: import("react").ReactNode;
|
|
4
|
+
} & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -52,6 +52,7 @@ import { useAiQuestionStore } from "../../store/ai-question/global-store";
|
|
|
52
52
|
import { AiAnalysisStoreProvider } from "../../store/ai-question/ai-analysis-store";
|
|
53
53
|
import { getQuestionModelStore } from "../../store/ai-question/question-model-store";
|
|
54
54
|
import { useBootVideoStore, getBootVideoStore } from "../../store/ai-question/boot-video-store";
|
|
55
|
+
import { useQuestionModelStore } from "../../store/ai-question/question-model-store";
|
|
55
56
|
import { PostAiModelUpsert } from "../../services/ai-question";
|
|
56
57
|
import QuestionTemplate from './components/QuestionTemplate';
|
|
57
58
|
import QuestionModel from './components/QuestionModel';
|
|
@@ -60,6 +61,7 @@ import QuestionUpdate from './components/QuestionUpdate';
|
|
|
60
61
|
var AiQuestionRoot = forwardRef(function (props, ref) {
|
|
61
62
|
var updateState = useAiQuestionStore().updateState;
|
|
62
63
|
var updateBootVideo = useBootVideoStore().updateBootVideo;
|
|
64
|
+
var addModel = useQuestionModelStore(function (store) { return [store.addModel]; }).addModel;
|
|
63
65
|
var handleValues = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
64
66
|
var questionModelData, _a, mediaUrl, thumbUrl, appliedAllPosition, steps;
|
|
65
67
|
return __generator(this, function (_b) {
|
|
@@ -85,6 +87,7 @@ var AiQuestionRoot = forwardRef(function (props, ref) {
|
|
|
85
87
|
}); };
|
|
86
88
|
useImperativeHandle(ref, function () { return ({
|
|
87
89
|
handleValues: handleValues,
|
|
90
|
+
handleTemplate: function (steps) { return addModel(steps); },
|
|
88
91
|
handleSubmit: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
89
92
|
var _a, _b, name, token, questions, _c, mediaUrl, thumbUrl, appliedAllPosition, data, error_1;
|
|
90
93
|
return __generator(this, function (_d) {
|
|
@@ -128,14 +131,14 @@ var AiQuestionRoot = forwardRef(function (props, ref) {
|
|
|
128
131
|
height: '100%',
|
|
129
132
|
position: 'relative',
|
|
130
133
|
} }, { children: [_jsx(QuestionPreview, {}), _jsx(AiAnalysisStoreProvider, { children: _jsx(QuestionUpdate, {}) }), _jsx(Box, __assign({ sx: {
|
|
131
|
-
|
|
134
|
+
flex: '1 0',
|
|
132
135
|
height: '100%',
|
|
133
136
|
overflow: 'auto',
|
|
134
|
-
} }, { children: _jsx(
|
|
135
|
-
|
|
137
|
+
} }, { children: _jsx(QuestionModel, {}) })), _jsx(Box, __assign({ sx: {
|
|
138
|
+
width: '256px',
|
|
136
139
|
height: '100%',
|
|
137
140
|
overflow: 'auto',
|
|
138
|
-
} }, { children: _jsx(
|
|
141
|
+
} }, { children: _jsx(QuestionTemplate, {}) }))] })));
|
|
139
142
|
});
|
|
140
143
|
AiQuestionRoot.displayName = 'AiQuestionRoot';
|
|
141
144
|
export default memo(AiQuestionRoot);
|
|
@@ -13,7 +13,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
import { useCallback } from 'react';
|
|
14
14
|
import update from 'immutability-helper';
|
|
15
15
|
import { Box, Typography, IconButton, CloseIcon, Input, InfoIcon, Tooltip, Select } from 'fbm-ui';
|
|
16
|
-
import { ListItem, ListItemText } from '
|
|
16
|
+
import { ListItem, ListItemText } from 'fbm-ui/lib/mui';
|
|
17
17
|
import { useAiAnalysisStore } from "../../../../store/ai-question/ai-analysis-store";
|
|
18
18
|
import { willOrNotOptions } from './const';
|
|
19
19
|
import MainPoints from './MainPoints';
|
|
@@ -21,7 +21,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
21
21
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
22
|
import { useCallback } from 'react';
|
|
23
23
|
import { Box, IconButton, CloseIcon, TextField, Select, FormItem } from 'fbm-ui';
|
|
24
|
-
import { MenuItem } from '
|
|
24
|
+
import { MenuItem } from 'fbm-ui/lib/mui';
|
|
25
25
|
import { useAiAnalysisStore } from "../../../../store/ai-question/ai-analysis-store";
|
|
26
26
|
import { HIGH_BRIGHT_COLOR } from './const';
|
|
27
27
|
var MainPointsItem = function (props) {
|
|
@@ -11,8 +11,8 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
13
|
import { useCallback, useState } from 'react';
|
|
14
|
-
import { Box, Typography, Button, AddIcon } from 'fbm-ui';
|
|
15
|
-
import {
|
|
14
|
+
import { Box, Typography, Button, Checkbox, AddIcon } from 'fbm-ui';
|
|
15
|
+
import { List, Divider } from 'fbm-ui/lib/mui';
|
|
16
16
|
import { useAiAnalysisStore } from "../../../../store/ai-question/ai-analysis-store";
|
|
17
17
|
import { LANGUAGE_NAMES } from '../AiAssessmentCriteria/const';
|
|
18
18
|
import AiAssessmentCriteria from '../AiAssessmentCriteria';
|
|
@@ -30,6 +30,6 @@ var AiAnalysis = function () {
|
|
|
30
30
|
setAiAnalysisOpen(true);
|
|
31
31
|
}
|
|
32
32
|
}, [language, updateState]);
|
|
33
|
-
return (_jsxs(Box, { children: [aiAnalysisOpen && _jsx(AiAssessmentCriteria, { open: aiAnalysisOpen, onClose: function () { return setAiAnalysisOpen(false); } }), _jsxs(Box, __assign({ display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: [_jsxs(Box, __assign({ display: "flex", alignItems: "center"
|
|
33
|
+
return (_jsxs(Box, { children: [aiAnalysisOpen && _jsx(AiAssessmentCriteria, { open: aiAnalysisOpen, onClose: function () { return setAiAnalysisOpen(false); } }), _jsxs(Box, __assign({ display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: [_jsxs(Box, __assign({ display: "flex", alignItems: "center", ml: "1px" }, { children: [_jsx(Checkbox, { checked: isOpenAiAnalysis, label: _jsx(Typography, __assign({ variant: "body2" }, { children: "\u5F00\u542FAI\u5206\u6790" })), onChange: handleAiSwitch }), isOpenAiAnalysis && (_jsxs(Typography, __assign({ variant: "caption", color: "secondary" }, { children: ["\u8BED\u79CD\uFF1A", language && LANGUAGE_NAMES[language]] })))] })), isOpenAiAnalysis && aiAbilities.length > 0 && (_jsx(Typography, __assign({ variant: "caption", display: "block", width: 122 }, { children: "\u6743\u91CD\uFF1A" })))] })), isOpenAiAnalysis && (_jsxs(_Fragment, { children: [aiAbilities.length ? (_jsx(List, { children: aiAbilities.map(function (item, index) { return (_jsx(AnalysisItem, __assign({ index: index }, item), item.token)); }) })) : (_jsx(Typography, __assign({ variant: "body2", color: "secondary", sx: { mt: 1, mb: 1 } }, { children: "\u672A\u9009\u62E9 AI \u8BC4\u5206\u7EF4\u5EA6,\u6D4B\u8BD5\u62A5\u544A\u4E0D\u4F1A\u5BF9\u5019\u9009\u4EBA\u8FDB\u884C\u8BC4\u5206" }))), _jsx(Divider, { sx: { mb: 1 } }), _jsx(Button, __assign({ variant: "text", color: "inherit", icon: _jsx(AddIcon, {}), onClick: function () { return setAiAnalysisOpen(true); } }, { children: "\u6DFB\u52A0AI\u5206\u6790\u7EF4\u5EA6" }))] }))] }));
|
|
34
34
|
};
|
|
35
35
|
export default AiAnalysis;
|
|
@@ -12,7 +12,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { useEffect, useCallback, useState } from 'react';
|
|
14
14
|
import { Dialog, Loading, Typography, RadioGroup, Radio, Checkbox } from 'fbm-ui';
|
|
15
|
-
import { Box, FormControl, FormLabel, List, ListItemIcon, ListItemText } from '
|
|
15
|
+
import { Box, FormControl, FormLabel, List, ListItemIcon, ListItemText } from 'fbm-ui/lib/mui';
|
|
16
16
|
import { useRequest, useSetState } from 'ahooks';
|
|
17
17
|
import { groupCategory } from './utils';
|
|
18
18
|
import { CATEGORY_TYPE, LANGUAGE_TYPE } from "../../../../enum/ai-question";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const ListItemButtonRoot: import("@emotion/styled").StyledComponent<import("
|
|
3
|
-
action?: import("react").Ref<import("
|
|
2
|
+
export declare const ListItemButtonRoot: import("@emotion/styled").StyledComponent<import("fbm-ui/lib/mui").ListItemButtonBaseProps & Omit<{
|
|
3
|
+
action?: import("react").Ref<import("fbm-ui/lib/mui").ButtonBaseActions> | undefined;
|
|
4
4
|
centerRipple?: boolean | undefined;
|
|
5
5
|
children?: import("react").ReactNode;
|
|
6
|
-
classes?: Partial<import("
|
|
6
|
+
classes?: Partial<import("fbm-ui/lib/mui").ButtonBaseClasses> | undefined;
|
|
7
7
|
disabled?: boolean | undefined;
|
|
8
8
|
disableRipple?: boolean | undefined;
|
|
9
9
|
disableTouchRipple?: boolean | undefined;
|
|
@@ -11,9 +11,9 @@ export declare const ListItemButtonRoot: import("@emotion/styled").StyledCompone
|
|
|
11
11
|
focusVisibleClassName?: string | undefined;
|
|
12
12
|
LinkComponent?: import("react").ElementType<any> | undefined;
|
|
13
13
|
onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
|
|
14
|
-
sx?: import("@mui/system").SxProps<import("
|
|
14
|
+
sx?: import("@mui/system").SxProps<import("fbm-ui/lib/mui").Theme> | undefined;
|
|
15
15
|
tabIndex?: number | undefined;
|
|
16
16
|
TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
|
|
17
17
|
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
18
18
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
19
|
-
}, "children" | "
|
|
19
|
+
}, "children" | "style" | "className" | "tabIndex" | "classes" | "alignItems" | "sx" | "disabled" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "autoFocus" | "selected" | "dense" | "disableGutters" | "divider"> & import("@mui/system").MUIStyledCommonProps<import("fbm-ui/lib/mui").Theme>, {}, {}>;
|
|
@@ -12,7 +12,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
13
|
import { useCallback, useEffect, useState, useRef, memo } from 'react';
|
|
14
14
|
import { Box, Button, confirm } from 'fbm-ui';
|
|
15
|
-
import { List, ListItem, ListItemText, Accordion, AccordionSummary, AccordionDetails } from '
|
|
15
|
+
import { List, ListItem, ListItemText, Accordion, AccordionSummary, AccordionDetails } from 'fbm-ui/lib/mui';
|
|
16
16
|
import { useHover, useDebounceFn } from 'ahooks';
|
|
17
17
|
import { ExpandMore, Done } from '@mui/icons-material';
|
|
18
18
|
import { useQuestionPreviewStore } from "../../../../store/ai-question/question-preview-store";
|
|
@@ -91,7 +91,7 @@ var BaseAccordion = function (props) {
|
|
|
91
91
|
var isUsed = questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.steps.find(function (step) { return step.originToken === token; });
|
|
92
92
|
return (_jsx(ListItem, __assign({ secondaryAction: [
|
|
93
93
|
isUsed && _jsx(Done, {}, "icon"),
|
|
94
|
-
_jsx(Button, __assign({ variant: "outlined", color: "inherit", size: "small", onClick: function () { return handleUseQuestion(item); } }, { children: "\u4F7F\u7528" }), "
|
|
94
|
+
_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"),
|
|
95
95
|
], onMouseOver: function () { return handleMouseOver(item); } }, { children: _jsx(ListItemText, { primary: name, secondary: isShowDesc && category ? category[0] : '' }) }), token));
|
|
96
96
|
}) })), isPaging && (_jsx(Button, __assign({ variant: "text", sx: { width: '100%', justifyContent: 'start', color: '#576B95' }, onClick: handleShowAll }, { children: "\u5C55\u793A\u5168\u90E8" })))] })] })) })) }));
|
|
97
97
|
};
|
|
@@ -27,10 +27,13 @@ export var AccordionRoot = styled(Box)(function (_a) {
|
|
|
27
27
|
color: theme.palette.primary.main,
|
|
28
28
|
},
|
|
29
29
|
'& .MuiButton-root': {
|
|
30
|
-
display: 'none',
|
|
31
30
|
background: '#fff',
|
|
31
|
+
},
|
|
32
|
+
'& .secondary-action-buttons': {
|
|
33
|
+
display: 'none',
|
|
32
34
|
position: 'absolute',
|
|
33
|
-
|
|
35
|
+
justifyContent: 'flex-end',
|
|
36
|
+
width: 100,
|
|
34
37
|
height: 24,
|
|
35
38
|
top: 0,
|
|
36
39
|
bottom: 0,
|
|
@@ -41,8 +44,8 @@ export var AccordionRoot = styled(Box)(function (_a) {
|
|
|
41
44
|
'& .MuiListItem-root:hover': {
|
|
42
45
|
background: 'rgba(0, 0, 0, 0.04)',
|
|
43
46
|
'& .MuiListItemSecondaryAction-root': {
|
|
44
|
-
'& .
|
|
45
|
-
display: '
|
|
47
|
+
'& .secondary-action-buttons': {
|
|
48
|
+
display: 'flex',
|
|
46
49
|
},
|
|
47
50
|
},
|
|
48
51
|
},
|
|
@@ -22,7 +22,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
22
22
|
import { useState, useCallback, useEffect } from 'react';
|
|
23
23
|
import { Box, Dialog, Upload, Typography, Button, AddIcon, Tooltip, InfoIcon, Message, Checkbox } from 'fbm-ui';
|
|
24
24
|
import { useRequest, useSetState } from 'ahooks';
|
|
25
|
-
import { Divider } from '
|
|
25
|
+
import { Divider } from 'fbm-ui/lib/mui';
|
|
26
26
|
import SvgIcon from "../../../../components/SvgIcon";
|
|
27
27
|
import ScrollDialogContent from "../../../../components/ScrollDialogContent";
|
|
28
28
|
import { PostCommonUpload } from "../../../../services/ai-question";
|
|
@@ -22,15 +22,15 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
24
|
import { useCallback, memo } from 'react';
|
|
25
|
-
import { Box, Chip, Input, Typography, IconButton, DragIndicatorIcon, EditIcon, DeleteIcon, confirm } from 'fbm-ui';
|
|
26
|
-
import { Paper
|
|
25
|
+
import { Box, Chip, Input, Typography, IconButton, DragIndicatorIcon, EditIcon, DeleteIcon, Switch, confirm } from 'fbm-ui';
|
|
26
|
+
import { Paper } from 'fbm-ui/lib/mui';
|
|
27
27
|
import { useQuestionModelStore } from "../../../../store/ai-question/question-model-store";
|
|
28
28
|
import { useUpdateQuestionStore } from "../../../../store/ai-question/question-update-store";
|
|
29
29
|
import { getSecondToTime } from "../../../../utils/utils";
|
|
30
30
|
import { TEST_TYPE_READONLY, DISABLED_REPEAT_TYPE, IS_AI_ANALYSIS } from "../../../../constants/ai-question";
|
|
31
31
|
var QuestionModelListItem = function (props) {
|
|
32
32
|
var index = props.index, disabledWeight = props.disabledWeight, steps = props.steps, step = __rest(props, ["index", "disabledWeight", "steps"]);
|
|
33
|
-
var token = step.token, name = step.name, desc = step.desc, duration = step.duration, weight = step.weight, type = step.type, aiShowType = step.aiShowType, answerStatus = step.answerStatus, category = step.category;
|
|
33
|
+
var token = step.token, name = step.name, desc = step.desc, duration = step.duration, weight = step.weight, type = step.type, aiShowType = step.aiShowType, aiType = step.aiType, answerStatus = step.answerStatus, category = step.category;
|
|
34
34
|
var isAiAnalysis = IS_AI_ANALYSIS(step);
|
|
35
35
|
var _a = useQuestionModelStore(), editModel = _a.editModel, removeModel = _a.removeModel, updateModelWeight = _a.updateModelWeight;
|
|
36
36
|
var updateQuestionState = useUpdateQuestionStore().updateQuestionState;
|
|
@@ -67,6 +67,6 @@ var QuestionModelListItem = function (props) {
|
|
|
67
67
|
console.log(answerStatus);
|
|
68
68
|
editModel(__assign(__assign({}, step), { answerStatus: answerStatus === 2 ? 1 : 2 }), index);
|
|
69
69
|
}, [editModel, answerStatus, step, index]);
|
|
70
|
-
return (_jsxs(Paper, __assign({ variant: "outlined", sx: { display: 'block', mt: 2 } }, { children: [_jsxs(Box, __assign({ display: "flex", borderBottom:
|
|
70
|
+
return (_jsxs(Paper, __assign({ variant: "outlined", sx: { display: 'block', mt: 2 } }, { children: [_jsxs(Box, __assign({ display: "flex", borderBottom: isAiAnalysis ? '1px solid rgba(0, 0, 0, 0.08)' : 'none' }, { children: [_jsx(Box, __assign({ width: 40, display: "flex", alignItems: "center", justifyContent: "center", sx: { cursor: 'move' } }, { children: _jsx(DragIndicatorIcon, { className: "dragHandle" }) })), _jsxs(Box, __assign({ flex: "1 0", padding: "16px 0" }, { children: [_jsxs(Box, __assign({ display: "flex", justifyContent: "space-between" }, { children: [_jsxs(Box, __assign({ flex: "1 0", display: "flex", alignItems: "center" }, { children: [_jsx(Typography, __assign({ variant: "subtitle1" }, { children: name })), category === null || category === void 0 ? void 0 : category.map(function (label) { return label && _jsx(Chip, { color: "default", label: label, size: "medium", sx: { ml: 1 } }, label); }), aiType === 2 && _jsx(Chip, { variant: "filled", color: "primary", label: "AI\u8BC4\u5206", size: "medium", sx: { ml: 1 } }), _jsx(Typography, __assign({ sx: { ml: 2 }, variant: "body2", color: "secondary" }, { children: getSecondToTime(Number(duration)) }))] })), _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, {}) }))] }))] })), _jsxs(Box, __assign({ mt: 1, display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: [_jsx(Typography, __assign({ variant: "body2", color: "secondary" }, { children: desc })), !DISABLED_REPEAT_TYPE.includes(type) && (_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 }))] }))] }))] })), isAiAnalysis && (_jsxs(Box, __assign({ display: "flex", alignItems: "center", padding: "3px 0 3px 40px" }, { children: [_jsx(Typography, __assign({ variant: "body2" }, { children: "\u6743\u91CD\u5360\u6BD4\uFF1A" })), _jsx(Input, { sx: { width: 82 }, size: "small", value: weight, endAdornment: "%", disabled: disabledWeight, onChange: handleWeightChange, onBlur: handleWeightBlur })] })))] })));
|
|
71
71
|
};
|
|
72
72
|
export default memo(QuestionModelListItem);
|
|
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { Box, Stack, Skeleton, Paper } from '
|
|
13
|
+
import { Box, Stack, Skeleton, Paper } from 'fbm-ui/lib/mui';
|
|
14
14
|
var QuestionModelSkeleton = function () {
|
|
15
15
|
return (_jsxs(Box, { children: [_jsxs(Stack, __assign({ direction: "row", alignItems: "center", spacing: 2, sx: { mb: 3 } }, { children: [_jsx(Skeleton, { variant: "text", width: 120, height: 28 }), _jsx(Skeleton, { variant: "text", width: 120, height: 18 })] })), _jsxs(Stack, __assign({ spacing: 3 }, { children: [_jsxs(Paper, __assign({ elevation: 2, sx: { height: 80, padding: 3 } }, { children: [_jsx(Skeleton, { variant: "text", width: 128, height: 8, sx: { mb: 3 } }), _jsx(Skeleton, { variant: "text", width: 360, height: 8 })] })), _jsxs(Paper, __assign({ elevation: 2, sx: { height: 80, padding: 3 } }, { children: [_jsx(Skeleton, { variant: "text", width: 128, height: 8, sx: { mb: 3 } }), _jsx(Skeleton, { variant: "text", width: 360, height: 8 })] }))] }))] }));
|
|
16
16
|
};
|
|
@@ -23,9 +23,9 @@ import QuestionModelList from './List';
|
|
|
23
23
|
import Skeleton from './Skeleton';
|
|
24
24
|
var Question = function () {
|
|
25
25
|
var isDefaultAdded = useRef(false);
|
|
26
|
-
var _a = useAiQuestionStore(), token = _a.token, name = _a.name, onLoad = _a.onLoad;
|
|
27
|
-
var aiEvaluationData = useQuestionTemplateStore().aiEvaluationData;
|
|
28
|
-
var _b = useQuestionModelStore(), questionModelData = _b.questionModelData, updateModel = _b.updateModel, addModel = _b.addModel;
|
|
26
|
+
var _a = useAiQuestionStore(function (store) { return [store.token, store.name, store.templateList]; }), token = _a.token, name = _a.name, templateList = _a.templateList, onLoad = _a.onLoad;
|
|
27
|
+
var aiEvaluationData = useQuestionTemplateStore(function (store) { return [store.aiEvaluationData]; }).aiEvaluationData;
|
|
28
|
+
var _b = useQuestionModelStore(function (store) { return [store.questionModelData]; }), questionModelData = _b.questionModelData, updateModel = _b.updateModel, addModel = _b.addModel;
|
|
29
29
|
var _c = useRequest(function () { return PostAiModelDetails(token); }, {
|
|
30
30
|
manual: true,
|
|
31
31
|
onSuccess: function (_a) {
|
|
@@ -43,22 +43,29 @@ var Question = function () {
|
|
|
43
43
|
}
|
|
44
44
|
}, [name, token, postAiModelDetails, updateModel]);
|
|
45
45
|
useEffect(function () {
|
|
46
|
-
if (!(questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.steps.length) &&
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
if (!(questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.steps.length) && !token) {
|
|
47
|
+
if (templateList === null || templateList === void 0 ? void 0 : templateList.length) {
|
|
48
|
+
setTimeout(function () {
|
|
49
|
+
addModel(templateList);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
else if (aiEvaluationData.length && !isDefaultAdded.current) {
|
|
53
|
+
setTimeout(function () {
|
|
54
|
+
var defaultStep = [];
|
|
55
|
+
aiEvaluationData[0].list.forEach(function (_a) {
|
|
56
|
+
var list = _a.list;
|
|
57
|
+
list.forEach(function (item) {
|
|
58
|
+
if (item.isDefault) {
|
|
59
|
+
defaultStep.push(__assign(__assign(__assign({}, defaultQuestionParams), item), { originToken: item.token }));
|
|
60
|
+
}
|
|
61
|
+
});
|
|
55
62
|
});
|
|
63
|
+
isDefaultAdded.current = true;
|
|
64
|
+
addModel(defaultStep);
|
|
56
65
|
});
|
|
57
|
-
|
|
58
|
-
addModel(defaultStep);
|
|
59
|
-
});
|
|
66
|
+
}
|
|
60
67
|
}
|
|
61
|
-
}, [token, aiEvaluationData, questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.steps, addModel]);
|
|
68
|
+
}, [token, aiEvaluationData, questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.steps, templateList, addModel]);
|
|
62
69
|
return (_jsx(QuestionModelRoot, { children: loading ? (_jsx(Skeleton, {})) : (_jsxs(_Fragment, { children: [_jsx(QuestionModelHeader, {}), _jsx(QuestionModelList, {})] })) }));
|
|
63
70
|
};
|
|
64
71
|
export default Question;
|