eli-video-interview 1.2.20 → 1.2.25
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/assets/icons/AI.svg +1 -0
- package/esm/components/AiHeaderTitle/index.d.ts +4 -0
- package/esm/components/AiHeaderTitle/index.js +19 -0
- package/esm/components/AiHeaderTitle/interface.d.ts +4 -0
- package/esm/components/AiHeaderTitle/interface.js +1 -0
- package/esm/modules/ai-ability/interface.d.ts +1 -0
- package/esm/modules/ai-question/components/AiAnalysis/AnalysisItem.d.ts +1 -1
- package/esm/modules/ai-question/components/AiAnalysis/AnalysisItem.js +12 -7
- package/esm/modules/ai-question/components/AiAnalysis/index.js +9 -17
- package/esm/modules/ai-question/components/AiAssessmentCriteria/const.d.ts +6 -0
- package/esm/modules/ai-question/components/AiAssessmentCriteria/const.js +7 -0
- package/esm/modules/ai-question/components/AiAssessmentCriteria/index.d.ts +1 -1
- package/esm/modules/ai-question/components/AiAssessmentCriteria/index.js +24 -23
- package/esm/modules/ai-question/components/AiAssessmentCriteria/interface.d.ts +6 -0
- package/esm/modules/ai-question/components/QuestionModel/index.js +6 -6
- package/esm/modules/ai-question/components/QuestionUpdate/Form.d.ts +1 -1
- package/esm/modules/ai-question/components/QuestionUpdate/Form.js +19 -10
- package/esm/modules/ai-question/components/QuestionUpdate/index.js +41 -8
- package/esm/modules/ai-question/interface.d.ts +2 -0
- package/esm/modules/ai-report/Root.js +7 -5
- package/esm/modules/ai-report/components/AIEvaluate/index.js +10 -9
- package/esm/modules/ai-report/components/ScoreReport/Report.js +13 -5
- package/esm/modules/ai-report/components/Suggestion/Suggestion.d.ts +4 -0
- package/esm/modules/ai-report/components/Suggestion/Suggestion.js +29 -0
- package/esm/modules/ai-report/components/Suggestion/index.d.ts +2 -0
- package/esm/modules/ai-report/components/Suggestion/index.js +27 -0
- package/esm/modules/ai-report/components/VideoQuestion/Abilities.d.ts +1 -1
- package/esm/modules/ai-report/components/VideoQuestion/Abilities.js +5 -5
- package/esm/modules/ai-report/components/VideoQuestion/QuestionItem.d.ts +1 -1
- package/esm/modules/ai-report/components/VideoQuestion/QuestionItem.js +9 -9
- package/esm/modules/ai-report/components/VideoQuestion/index.js +4 -3
- package/esm/modules/ai-report/components/WorkPlaces/ScoreSlider.d.ts +4 -0
- package/esm/modules/ai-report/components/WorkPlaces/ScoreSlider.js +24 -0
- package/esm/modules/ai-report/components/WorkPlaces/WorkPlace.d.ts +11 -0
- package/esm/modules/ai-report/components/WorkPlaces/WorkPlace.js +55 -0
- package/esm/modules/ai-report/components/WorkPlaces/index.d.ts +2 -0
- package/esm/modules/ai-report/components/WorkPlaces/index.js +67 -0
- package/esm/modules/ai-report/components/WorkPlaces/interface.d.ts +7 -0
- package/esm/modules/ai-report/components/WorkPlaces/interface.js +1 -0
- package/esm/modules/ai-report/components/WorkPlaces/styled.d.ts +62 -0
- package/esm/modules/ai-report/components/WorkPlaces/styled.js +27 -0
- package/esm/modules/ai-report/interface.d.ts +38 -0
- package/esm/services/ai-ability.d.ts +1 -0
- package/esm/services/ai-report.d.ts +5 -0
- package/esm/services/ai-report.js +4 -0
- package/esm/store/ai-ability/question-ability-store.d.ts +12 -0
- package/esm/store/ai-ability/question-ability-store.js +10 -0
- package/esm/store/ai-question/ai-analysis-store.d.ts +7 -3
- package/esm/store/ai-question/ai-analysis-store.js +24 -10
- package/lib/assets/icons/AI.svg +1 -0
- package/lib/components/AiHeaderTitle/index.d.ts +4 -0
- package/lib/components/AiHeaderTitle/index.js +24 -0
- package/lib/components/AiHeaderTitle/interface.d.ts +4 -0
- package/lib/components/AiHeaderTitle/interface.js +2 -0
- package/lib/modules/ai-ability/interface.d.ts +1 -0
- package/lib/modules/ai-question/components/AiAnalysis/AnalysisItem.d.ts +1 -1
- package/lib/modules/ai-question/components/AiAnalysis/AnalysisItem.js +12 -7
- package/lib/modules/ai-question/components/AiAnalysis/index.js +8 -16
- package/lib/modules/ai-question/components/AiAssessmentCriteria/const.d.ts +6 -0
- package/lib/modules/ai-question/components/AiAssessmentCriteria/const.js +8 -1
- package/lib/modules/ai-question/components/AiAssessmentCriteria/index.d.ts +1 -1
- package/lib/modules/ai-question/components/AiAssessmentCriteria/index.js +24 -23
- package/lib/modules/ai-question/components/AiAssessmentCriteria/interface.d.ts +6 -0
- package/lib/modules/ai-question/components/QuestionModel/index.js +6 -6
- package/lib/modules/ai-question/components/QuestionUpdate/Form.d.ts +1 -1
- package/lib/modules/ai-question/components/QuestionUpdate/Form.js +19 -10
- package/lib/modules/ai-question/components/QuestionUpdate/index.js +41 -8
- package/lib/modules/ai-question/interface.d.ts +2 -0
- package/lib/modules/ai-report/Root.js +7 -5
- package/lib/modules/ai-report/components/AIEvaluate/index.js +9 -8
- package/lib/modules/ai-report/components/ScoreReport/Report.js +13 -5
- package/lib/modules/ai-report/components/Suggestion/Suggestion.d.ts +4 -0
- package/lib/modules/ai-report/components/Suggestion/Suggestion.js +31 -0
- package/lib/modules/ai-report/components/Suggestion/index.d.ts +2 -0
- package/lib/modules/ai-report/components/Suggestion/index.js +32 -0
- package/lib/modules/ai-report/components/VideoQuestion/Abilities.d.ts +1 -1
- package/lib/modules/ai-report/components/VideoQuestion/Abilities.js +5 -5
- package/lib/modules/ai-report/components/VideoQuestion/QuestionItem.d.ts +1 -1
- package/lib/modules/ai-report/components/VideoQuestion/QuestionItem.js +9 -9
- package/lib/modules/ai-report/components/VideoQuestion/index.js +4 -3
- package/lib/modules/ai-report/components/WorkPlaces/ScoreSlider.d.ts +4 -0
- package/lib/modules/ai-report/components/WorkPlaces/ScoreSlider.js +26 -0
- package/lib/modules/ai-report/components/WorkPlaces/WorkPlace.d.ts +11 -0
- package/lib/modules/ai-report/components/WorkPlaces/WorkPlace.js +57 -0
- package/lib/modules/ai-report/components/WorkPlaces/index.d.ts +2 -0
- package/lib/modules/ai-report/components/WorkPlaces/index.js +72 -0
- package/lib/modules/ai-report/components/WorkPlaces/interface.d.ts +7 -0
- package/lib/modules/ai-report/components/WorkPlaces/interface.js +2 -0
- package/lib/modules/ai-report/components/WorkPlaces/styled.d.ts +62 -0
- package/lib/modules/ai-report/components/WorkPlaces/styled.js +30 -0
- package/lib/modules/ai-report/interface.d.ts +38 -0
- package/lib/services/ai-ability.d.ts +1 -0
- package/lib/services/ai-report.d.ts +5 -0
- package/lib/services/ai-report.js +6 -1
- package/lib/store/ai-ability/question-ability-store.d.ts +12 -0
- package/lib/store/ai-ability/question-ability-store.js +13 -0
- package/lib/store/ai-question/ai-analysis-store.d.ts +7 -3
- package/lib/store/ai-question/ai-analysis-store.js +24 -10
- package/package.json +1 -1
|
@@ -10,25 +10,27 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
var _a;
|
|
13
|
-
import {
|
|
13
|
+
import { useUpdateQuestionStore } from "./question-update-store";
|
|
14
|
+
import { computeDecimalValue, formatNumberDecimal, uniqueId } from "../../utils/utils";
|
|
14
15
|
import { useSetState } from 'ahooks';
|
|
15
16
|
import { createStore } from 'hox';
|
|
16
17
|
import update from 'immutability-helper';
|
|
17
|
-
import {
|
|
18
|
-
import { computeDecimalValue, formatNumberDecimal, uniqueId } from "../../utils/utils";
|
|
18
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
19
19
|
var defaultAnalysisState = { aiSwitch: 2, language: 1 };
|
|
20
20
|
export var useAiAnalysisStore = (_a = createStore(function () {
|
|
21
21
|
var questionState = useUpdateQuestionStore(function (store) { return [store.questionState]; }).questionState;
|
|
22
22
|
var _a = useState([]), aiAbilities = _a[0], setAiAbilities = _a[1];
|
|
23
|
-
var _b =
|
|
24
|
-
var _c =
|
|
23
|
+
var _b = useState([]), workplaces = _b[0], setWorkplaces = _b[1];
|
|
24
|
+
var _c = useSetState(defaultAnalysisState), analysisState = _c[0], setState = _c[1];
|
|
25
|
+
var _d = useState([]), keyPointAnalysisError = _d[0], setKeyPointAnalysisError = _d[1];
|
|
25
26
|
var updateState = function (params) { return setState(params); };
|
|
26
27
|
/**
|
|
27
28
|
* 权重值计算
|
|
28
29
|
* @param steps 模型数据
|
|
29
30
|
*/
|
|
30
|
-
var computeWeight = useCallback(function (data, inInit) {
|
|
31
|
+
var computeWeight = useCallback(function (data, inInit, isWorkplaceChange) {
|
|
31
32
|
if (inInit === void 0) { inInit = false; }
|
|
33
|
+
if (isWorkplaceChange === void 0) { isWorkplaceChange = false; }
|
|
32
34
|
var weightList = data.filter(function (_a) {
|
|
33
35
|
var isNotCompute = _a.isNotCompute;
|
|
34
36
|
return !isNotCompute;
|
|
@@ -44,7 +46,7 @@ export var useAiAnalysisStore = (_a = createStore(function () {
|
|
|
44
46
|
}).reduce(function (pv, i) { return pv + i; }, 0);
|
|
45
47
|
var getWeight = function (_a) {
|
|
46
48
|
var token = _a.token, weight = _a.weight;
|
|
47
|
-
if (weightsLen <= 1 && !inInit) {
|
|
49
|
+
if (weightsLen <= 1 && !inInit && isWorkplaceChange) {
|
|
48
50
|
var dataLength = data.length;
|
|
49
51
|
var averageWeight = Math.floor((100 / dataLength) * 100) / 100;
|
|
50
52
|
var disableWeight = 100 - Math.floor(averageWeight * (dataLength - 1) * 100) / 100;
|
|
@@ -59,7 +61,7 @@ export var useAiAnalysisStore = (_a = createStore(function () {
|
|
|
59
61
|
return [
|
|
60
62
|
i,
|
|
61
63
|
1,
|
|
62
|
-
__assign(__assign({}, item), { isNotCompute: false, weight: getWeight(item) }),
|
|
64
|
+
__assign(__assign({}, item), { isNotCompute: false, weight: isWorkplaceChange ? item.weight : getWeight(item) }),
|
|
63
65
|
];
|
|
64
66
|
});
|
|
65
67
|
setAiAbilities(update(data, { $splice: $splice }));
|
|
@@ -67,8 +69,9 @@ export var useAiAnalysisStore = (_a = createStore(function () {
|
|
|
67
69
|
/**
|
|
68
70
|
* 更新AI分析维度
|
|
69
71
|
*/
|
|
70
|
-
var updateAiAbilities = useCallback(function (data, inInit) {
|
|
72
|
+
var updateAiAbilities = useCallback(function (data, inInit, isWorkplaceChange) {
|
|
71
73
|
if (inInit === void 0) { inInit = false; }
|
|
74
|
+
if (isWorkplaceChange === void 0) { isWorkplaceChange = false; }
|
|
72
75
|
console.log(data);
|
|
73
76
|
data.forEach(function (item) {
|
|
74
77
|
if (item.isNotCompute === undefined) {
|
|
@@ -82,8 +85,11 @@ export var useAiAnalysisStore = (_a = createStore(function () {
|
|
|
82
85
|
item.extra = JSON.stringify({ expect: 'positive' });
|
|
83
86
|
}
|
|
84
87
|
}
|
|
88
|
+
if (item.abilityType === 2) {
|
|
89
|
+
// setWorkplaces([item]);
|
|
90
|
+
}
|
|
85
91
|
});
|
|
86
|
-
computeWeight(data, inInit);
|
|
92
|
+
computeWeight(data, inInit, isWorkplaceChange);
|
|
87
93
|
}, [computeWeight]);
|
|
88
94
|
/**
|
|
89
95
|
* 更新AI分析维度权重
|
|
@@ -111,6 +117,12 @@ export var useAiAnalysisStore = (_a = createStore(function () {
|
|
|
111
117
|
setAiAbilities(newAiAbilities);
|
|
112
118
|
}
|
|
113
119
|
}, [aiAbilities, computeWeight]);
|
|
120
|
+
/**
|
|
121
|
+
* 更新考察能力分析维度
|
|
122
|
+
*/
|
|
123
|
+
var updateWorkplaces = useCallback(function (data) {
|
|
124
|
+
setWorkplaces(data);
|
|
125
|
+
}, [setWorkplaces]);
|
|
114
126
|
useEffect(function () {
|
|
115
127
|
if (!questionState.open) {
|
|
116
128
|
setTimeout(function () {
|
|
@@ -122,12 +134,14 @@ export var useAiAnalysisStore = (_a = createStore(function () {
|
|
|
122
134
|
}, [questionState.open, setState]);
|
|
123
135
|
return {
|
|
124
136
|
aiAbilities: aiAbilities,
|
|
137
|
+
workplaces: workplaces,
|
|
125
138
|
analysisState: analysisState,
|
|
126
139
|
keyPointAnalysisError: keyPointAnalysisError,
|
|
127
140
|
updateState: updateState,
|
|
128
141
|
updateAiAbilities: updateAiAbilities,
|
|
129
142
|
updateAiAbilitiesWeight: updateAiAbilitiesWeight,
|
|
130
143
|
removeAiAbilities: removeAiAbilities,
|
|
144
|
+
updateWorkplaces: updateWorkplaces,
|
|
131
145
|
setKeyPointAnalysisError: setKeyPointAnalysisError,
|
|
132
146
|
};
|
|
133
147
|
}), _a[0]), AiAnalysisStoreProvider = _a[1];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><defs><linearGradient id="a" x1="36.62%" x2="71.052%" y1="76.01%" y2="4.425%"><stop offset="0%" stop-color="#00B768"/><stop offset="39%" stop-color="#00AF62"/><stop offset="100%" stop-color="#009953"/><stop offset="100%" stop-color="#009953"/></linearGradient></defs><g fill="none" transform="translate(3 7.16)"><rect width="3.109" height="8.176" x="18.116" y="4.824" fill="#00D97C" rx="1.554"/><path fill="#00D97C" d="M21.4330891 1.95993177 21.4367129 1.93267091C21.4403366 1.90483003 21.4433564 1.87466908 21.4457722 1.84798824L21.4457722 1.82072738C21.4457722 1.78476624 21.4500001 1.74822509 21.4500001 1.71168394L21.4500001 1.71168394C21.4502442 1.01957447 21.0163106.395484118 20.3505677.130462712 19.6848249-.134558695 18.9184003.0116886167 18.4087228.50100097 17.8990452.990313327 17.7465029 1.72631363 18.0222352 2.36576189 18.2979675 3.00521015 18.947665 3.42215785 19.6683358 3.42215789L19.6683358 3.42215789 19.6683358 4.1645813C19.8960264 4.05611788 21.1945274 3.17855021 21.4167824 2.03997429 21.4236272 2.01329345 21.4290628 1.98661261 21.4330891 1.95993177ZM15.4605889 10.719948 9.60706759.98260094C9.24145617.374932483 8.56614784.000646522375 7.83536873.000646522375 7.10458966.000646522375 6.42928134.374932483 6.06366994.98260094L5.39026133 2.1037763 5.39026133 2.1037763 4.64920987 3.33515515C4.92547127 2.86174873 5.4452855 2.56740188 6.01035444 2.56440169 6.57542336 2.5614015 7.09859463 2.8502107 7.3802895 3.32065469L7.3802895 3.32065469 12.7367568 12.2303157C13.0172603 12.6974945 13.5359784 12.9854694 14.0975151 12.9857635 14.6590517 12.9860566 15.178096 12.6986244 15.4591292 12.2317392 15.7401622 11.7648541 15.7404885 11.1894469 15.4599849 10.7222681L15.4605889 10.719948Z"/><path fill="url(#a)" d="M7.37968551,3.32065469 C7.09841787,2.85095068 6.57638695,2.56226386 6.01219476,2.56439864 C5.44800258,2.56658124 4.92838341,2.85925359 4.65102173,3.33109501 L1.83840835,8.01126263 C1.83808295,8.0127936 1.83808295,8.01437187 1.83840835,8.01590276 L0.210148599,10.719948 C-0.0703549557,11.1871269 -0.0700287417,11.762534 0.21100436,12.2294192 C0.49203746,12.6963044 1.01108183,12.9837366 1.57261848,12.9834434 C2.13415513,12.9831493 2.65287327,12.6951745 2.9333768,12.2279956 L7.83506677,4.07409845 L7.38089343,3.32007467 L7.37968551,3.32065469 Z"/></g></svg>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
+
var SvgIcon_1 = __importDefault(require("../SvgIcon"));
|
|
19
|
+
var fbm_ui_1 = require("fbm-ui");
|
|
20
|
+
var AiHeaderTitle = function (_a) {
|
|
21
|
+
var name = _a.name;
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "inline-flex" }, { children: [(0, jsx_runtime_1.jsx)(SvgIcon_1.default, { name: "AI" }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "h6", fontWeight: "medium", sx: { fontWeight: 500 }, ml: 1 }, { children: name }))] })));
|
|
23
|
+
};
|
|
24
|
+
exports.default = AiHeaderTitle;
|
|
@@ -15,17 +15,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
-
var
|
|
18
|
+
var const_1 = require("./const");
|
|
19
|
+
var MainPoints_1 = __importDefault(require("./MainPoints"));
|
|
20
|
+
var ai_analysis_store_1 = require("../../../../store/ai-question/ai-analysis-store");
|
|
19
21
|
var fbm_ui_1 = require("fbm-ui");
|
|
20
22
|
var mui_1 = require("fbm-ui/lib/mui");
|
|
21
23
|
var immutability_helper_1 = __importDefault(require("immutability-helper"));
|
|
22
|
-
var
|
|
23
|
-
var const_1 = require("./const");
|
|
24
|
-
var MainPoints_1 = __importDefault(require("./MainPoints"));
|
|
24
|
+
var react_1 = require("react");
|
|
25
25
|
var AnalysisItem = function (props) {
|
|
26
26
|
var _a;
|
|
27
|
-
var name = props.name,
|
|
28
|
-
var
|
|
27
|
+
var name = props.name, weight = props.weight, type = props.type, extra = props.extra, index = props.index, _b = props.abilityType, abilityType = _b === void 0 ? 1 : _b, isWorkplace = props.isWorkplace;
|
|
28
|
+
var _c = (0, ai_analysis_store_1.useAiAnalysisStore)(function (store) { return [store.aiAbilities]; }), aiAbilities = _c.aiAbilities, updateAiAbilities = _c.updateAiAbilities, updateAiAbilitiesWeight = _c.updateAiAbilitiesWeight, removeAiAbilities = _c.removeAiAbilities;
|
|
29
|
+
var desc = props.desc || props.name;
|
|
30
|
+
var NotUsedAilibity = ['英文能力', '游戏测评'];
|
|
31
|
+
if (abilityType === 2 && !isWorkplace) {
|
|
32
|
+
desc = "".concat(NotUsedAilibity.includes(name) ? name : '自定义能力', "\u4E0D\u80FD\u53C2\u4E0EAI\u5206\u6790");
|
|
33
|
+
}
|
|
29
34
|
var handleRemove = (0, react_1.useCallback)(function () {
|
|
30
35
|
removeAiAbilities(index);
|
|
31
36
|
}, [index, removeAiAbilities]);
|
|
@@ -39,6 +44,6 @@ var AnalysisItem = function (props) {
|
|
|
39
44
|
var value = _a.target.value;
|
|
40
45
|
updateAiAbilitiesWeight(value, index);
|
|
41
46
|
}, [updateAiAbilitiesWeight, index]);
|
|
42
|
-
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsxs)(mui_1.ListItem, __assign({ sx: { pl: 0, pr: 4 }, secondaryAction: (0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ sx: { position: 'relative', left: 16 }, onClick: handleRemove }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.CloseIcon, {}) })) }, { children: [(0, jsx_runtime_1.jsx)(mui_1.ListItemText, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "subtitle2" }, { children: name })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: "".concat(desc) }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", sx: { ml: 1 } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.InfoIcon, { sx: { color: 'rgba(0, 0, 0, 0.26)', fontSize: 16 } }) })) })), type === 8 && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Select, { sx: { width: 150, ml: 1 }, options: const_1.willOrNotOptions, value: (_a = JSON.parse(extra)) === null || _a === void 0 ? void 0 : _a.expect, size: "small", onChange: handleWillOrNotChange }))] })) }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Input, { sx: { width: 84, mr: 1 }, value: weight, disabled: index === aiAbilities.length - 1, size: "small", endAdornment: "%", onChange: handleWeightChange })] })), type === 6 && (0, jsx_runtime_1.jsx)(MainPoints_1.default, { extra: extra, index: index })] }));
|
|
47
|
+
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsxs)(mui_1.ListItem, __assign({ sx: { pl: 0, pr: 4 }, secondaryAction: (0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ sx: { position: 'relative', left: 16 }, onClick: handleRemove }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.CloseIcon, {}) })) }, { children: [(0, jsx_runtime_1.jsx)(mui_1.ListItemText, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "subtitle2" }, { children: name })), abilityType === 2 && !isWorkplace ? ((0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", style: { color: 'RGBA(0, 0, 0, 0.26)', fontSize: 12 }, ml: 1 }, { children: desc }))) : ((0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: "".concat(desc) }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", sx: { ml: 1 } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.InfoIcon, { sx: { color: 'rgba(0, 0, 0, 0.26)', fontSize: 16 } }) })) }))), type === 8 && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Select, { sx: { width: 150, ml: 1 }, options: const_1.willOrNotOptions, value: (_a = JSON.parse(extra)) === null || _a === void 0 ? void 0 : _a.expect, size: "small", onChange: handleWillOrNotChange }))] })) }), (abilityType === 1 || (abilityType === 2 && isWorkplace)) && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Input, { sx: { width: 84, mr: 1 }, value: weight, disabled: index === aiAbilities.length - 1, size: "small", endAdornment: "%", onChange: handleWeightChange }))] })), type === 6 && (0, jsx_runtime_1.jsx)(MainPoints_1.default, { extra: extra, index: index })] }));
|
|
43
48
|
};
|
|
44
49
|
exports.default = AnalysisItem;
|
|
@@ -15,26 +15,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
-
var react_1 = require("react");
|
|
19
|
-
var fbm_ui_1 = require("fbm-ui");
|
|
20
|
-
var mui_1 = require("fbm-ui/lib/mui");
|
|
21
|
-
var ai_analysis_store_1 = require("../../../../store/ai-question/ai-analysis-store");
|
|
22
18
|
var AiAssessmentCriteria_1 = __importDefault(require("../AiAssessmentCriteria"));
|
|
23
19
|
var const_1 = require("../AiAssessmentCriteria/const");
|
|
24
20
|
var AnalysisItem_1 = __importDefault(require("./AnalysisItem"));
|
|
21
|
+
var ai_analysis_store_1 = require("../../../../store/ai-question/ai-analysis-store");
|
|
22
|
+
var fbm_ui_1 = require("fbm-ui");
|
|
23
|
+
var mui_1 = require("fbm-ui/lib/mui");
|
|
24
|
+
var react_1 = require("react");
|
|
25
25
|
var AiAnalysis = function () {
|
|
26
|
-
var _a = (0, ai_analysis_store_1.useAiAnalysisStore)(function (store) { return [store.aiAbilities, store.analysisState]; }), aiAbilities = _a.aiAbilities, analysisState = _a.analysisState
|
|
26
|
+
var _a = (0, ai_analysis_store_1.useAiAnalysisStore)(function (store) { return [store.aiAbilities, store.analysisState]; }), aiAbilities = _a.aiAbilities, analysisState = _a.analysisState;
|
|
27
27
|
var _b = (0, react_1.useState)(false), aiAnalysisOpen = _b[0], setAiAnalysisOpen = _b[1];
|
|
28
|
-
var
|
|
29
|
-
var isOpenAiAnalysis =
|
|
30
|
-
|
|
31
|
-
if (language !== undefined) {
|
|
32
|
-
updateState({ aiSwitch: checked ? 1 : 2 });
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
setAiAnalysisOpen(true);
|
|
36
|
-
}
|
|
37
|
-
}, [language, updateState]);
|
|
38
|
-
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [aiAnalysisOpen && (0, jsx_runtime_1.jsx)(AiAssessmentCriteria_1.default, { open: aiAnalysisOpen, onClose: function () { return setAiAnalysisOpen(false); } }), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", ml: "1px" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Checkbox, { checked: isOpenAiAnalysis, label: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2" }, { children: "\u5F00\u542FAI\u5206\u6790" })), onChange: handleAiSwitch }), isOpenAiAnalysis && ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "secondary" }, { children: ["\u8BED\u79CD\uFF1A", language && const_1.LANGUAGE_NAMES[language]] })))] })), isOpenAiAnalysis && aiAbilities.length > 0 && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "caption", display: "block", width: 122 }, { children: "\u6743\u91CD\uFF1A" })))] })), isOpenAiAnalysis && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [aiAbilities.length ? ((0, jsx_runtime_1.jsx)(mui_1.List, { children: aiAbilities.map(function (item, index) { return ((0, jsx_runtime_1.jsx)(AnalysisItem_1.default, __assign({ index: index }, item), item.token)); }) })) : ((0, jsx_runtime_1.jsx)(fbm_ui_1.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" }))), (0, jsx_runtime_1.jsx)(mui_1.Divider, { sx: { mb: 1 } }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "text", color: "inherit", icon: (0, jsx_runtime_1.jsx)(fbm_ui_1.AddIcon, {}), onClick: function () { return setAiAnalysisOpen(true); } }, { children: "\u6DFB\u52A0AI\u5206\u6790\u7EF4\u5EA6" }))] }))] }));
|
|
28
|
+
var language = analysisState.language;
|
|
29
|
+
var isOpenAiAnalysis = aiAbilities.length > 0;
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [aiAnalysisOpen && (0, jsx_runtime_1.jsx)(AiAssessmentCriteria_1.default, { open: aiAnalysisOpen, onClose: function () { return setAiAnalysisOpen(false); } }), isOpenAiAnalysis && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "subtitle1" }, { children: "\u6743\u91CD\u8BBE\u7F6E" })), language && const_1.LANGUAGE_NAMES[language] && ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "secondary", ml: "8px" }, { children: ["\u8BED\u79CD\uFF1A", language && const_1.LANGUAGE_NAMES[language]] })))] })) }))), aiAbilities.length > 0 && ((0, jsx_runtime_1.jsx)(mui_1.List, { children: aiAbilities.map(function (item, index) { return ((0, jsx_runtime_1.jsx)(AnalysisItem_1.default, __assign({ index: index }, item), item.token)); }) })), (0, jsx_runtime_1.jsx)(mui_1.Divider, { sx: { mb: 1 } }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "text", color: "inherit", icon: (0, jsx_runtime_1.jsx)(fbm_ui_1.AddIcon, {}), onClick: function () { return setAiAnalysisOpen(true); } }, { children: "\u6DFB\u52A0AI\u5206\u6790\u7EF4\u5EA6" }))] }));
|
|
39
31
|
};
|
|
40
32
|
exports.default = AiAnalysis;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a, _b;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.SERVER_LANGUAGE_TYPE = exports.CATEGORY_NAME = exports.LANGUAGE_NAMES = void 0;
|
|
4
|
+
exports.LANGUAGE_SHOW_NAME = exports.SERVER_LANGUAGE_TYPE = exports.CATEGORY_NAME = exports.LANGUAGE_NAMES = void 0;
|
|
5
5
|
var ai_question_1 = require("../../../../enum/ai-question");
|
|
6
6
|
var MANDARIN = ai_question_1.LANGUAGE_TYPE.MANDARIN, CANTONESE = ai_question_1.LANGUAGE_TYPE.CANTONESE, JAPANESE = ai_question_1.LANGUAGE_TYPE.JAPANESE, ENGLISH = ai_question_1.LANGUAGE_TYPE.ENGLISH;
|
|
7
7
|
var LANGUAGE = ai_question_1.CATEGORY_TYPE.LANGUAGE, SEMANTICS = ai_question_1.CATEGORY_TYPE.SEMANTICS, EXPRESSION = ai_question_1.CATEGORY_TYPE.EXPRESSION, FORM = ai_question_1.CATEGORY_TYPE.FORM, LANGUAGE_ABILITY = ai_question_1.CATEGORY_TYPE.LANGUAGE_ABILITY;
|
|
@@ -24,3 +24,10 @@ exports.SERVER_LANGUAGE_TYPE = (_b = {},
|
|
|
24
24
|
_b[ENGLISH] = 3,
|
|
25
25
|
_b[CANTONESE] = 4,
|
|
26
26
|
_b);
|
|
27
|
+
// 由于语种value 和 name的映射不对应,这里用于前端显示 AI基础能力 中文|英文表达
|
|
28
|
+
exports.LANGUAGE_SHOW_NAME = {
|
|
29
|
+
2: '中文',
|
|
30
|
+
13: '中文',
|
|
31
|
+
12: '日语',
|
|
32
|
+
11: '英文',
|
|
33
|
+
};
|
|
@@ -15,16 +15,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var mui_1 = require("fbm-ui/lib/mui");
|
|
21
|
-
var ahooks_1 = require("ahooks");
|
|
18
|
+
var const_1 = require("./const");
|
|
19
|
+
var utils_1 = require("./utils");
|
|
22
20
|
var ScrollDialogContent_1 = __importDefault(require("../../../../components/ScrollDialogContent"));
|
|
23
21
|
var ai_question_1 = require("../../../../enum/ai-question");
|
|
24
22
|
var ai_question_2 = require("../../../../services/ai-question");
|
|
25
23
|
var ai_analysis_store_1 = require("../../../../store/ai-question/ai-analysis-store");
|
|
26
|
-
var
|
|
27
|
-
var
|
|
24
|
+
var ahooks_1 = require("ahooks");
|
|
25
|
+
var fbm_ui_1 = require("fbm-ui");
|
|
26
|
+
var mui_1 = require("fbm-ui/lib/mui");
|
|
27
|
+
var react_1 = require("react");
|
|
28
28
|
var MANDARIN = ai_question_1.LANGUAGE_TYPE.MANDARIN, CANTONESE = ai_question_1.LANGUAGE_TYPE.CANTONESE;
|
|
29
29
|
var AiAssessmentCriteria = function (props) {
|
|
30
30
|
var open = props.open, onClose = props.onClose;
|
|
@@ -62,6 +62,7 @@ var AiAssessmentCriteria = function (props) {
|
|
|
62
62
|
setCheckAbilities((_a = {}, _a[key] = undefined, _a));
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
|
+
console.log(language);
|
|
65
66
|
setLanguage(language);
|
|
66
67
|
setCheckedChinese([MANDARIN, CANTONESE].includes(language));
|
|
67
68
|
setRelatedAbilities(item === null || item === void 0 ? void 0 : item.relatedAbilities);
|
|
@@ -84,23 +85,23 @@ var AiAssessmentCriteria = function (props) {
|
|
|
84
85
|
return ((0, jsx_runtime_1.jsxs)(mui_1.Box, { children: [(list.filter(function (_a) {
|
|
85
86
|
var type = _a.type;
|
|
86
87
|
return relatedAbilities === null || relatedAbilities === void 0 ? void 0 : relatedAbilities.includes(type);
|
|
87
|
-
}).length > 0 || type === ai_question_1.CATEGORY_TYPE.LANGUAGE) && ((0, jsx_runtime_1.jsx)(mui_1.FormControl, { children: (0, jsx_runtime_1.jsxs)(mui_1.FormLabel, __assign({ component: "legend", style: { fontSize: 14, color: 'rgba(0,0,0,0.86)' } }, { children: [name, type === ai_question_1.CATEGORY_TYPE.LANGUAGE && ((0, jsx_runtime_1.jsx)(fbm_ui_1.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 === ai_question_1.CATEGORY_TYPE.LANGUAGE ? ((0, jsx_runtime_1.jsxs)(fbm_ui_1.RadioGroup, __assign({ sx: { mb: 1, ml: '4px' }, row: false, value: language, onChange: function (e) { return onLanguageChange(e, list); } }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Radio, { value: "0", RadioProps: { checked: checkedChinese }, label: "\u4E2D\u6587" }), (0, jsx_runtime_1.jsx)(fbm_ui_1.RadioGroup, __assign({ value: language, sx: { ml: 3 }, onChange: function (e) { return onLanguageChange(e, list); } }, { children: list
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
88
|
+
}).length > 0 || type === ai_question_1.CATEGORY_TYPE.LANGUAGE) && ((0, jsx_runtime_1.jsx)(mui_1.FormControl, { children: (0, jsx_runtime_1.jsxs)(mui_1.FormLabel, __assign({ component: "legend", style: { fontSize: 14, fontWeight: 400, color: 'rgba(0,0,0,0.86)' } }, { children: [type === ai_question_1.CATEGORY_TYPE.LANGUAGE ? ((0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ style: { fontSize: 16, fontWeight: 500 } }, { children: name }))) : ((0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, { children: type === ai_question_1.CATEGORY_TYPE.EXPRESSION ? const_1.LANGUAGE_SHOW_NAME[language] + name : name })), type === ai_question_1.CATEGORY_TYPE.LANGUAGE && ((0, jsx_runtime_1.jsx)(fbm_ui_1.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 === ai_question_1.CATEGORY_TYPE.LANGUAGE ? ((0, jsx_runtime_1.jsxs)(mui_1.Box, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.RadioGroup, __assign({ sx: { mb: 1, ml: '4px' }, row: false, value: language, onChange: function (e) { return onLanguageChange(e, list); } }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Radio, { value: "0", RadioProps: { checked: checkedChinese }, label: "\u4E2D\u6587" }), (0, jsx_runtime_1.jsx)(fbm_ui_1.RadioGroup, __assign({ value: language, sx: { ml: 3 }, onChange: function (e) { return onLanguageChange(e, list); } }, { children: list
|
|
89
|
+
.filter(function (_a) {
|
|
90
|
+
var type = _a.type;
|
|
91
|
+
return [MANDARIN, CANTONESE].includes(type);
|
|
92
|
+
})
|
|
93
|
+
.map(function (_a) {
|
|
94
|
+
var name = _a.name, type = _a.type, token = _a.token;
|
|
95
|
+
return checkedChinese && (0, jsx_runtime_1.jsx)(fbm_ui_1.Radio, { value: type, label: name }, token);
|
|
96
|
+
}) })), list
|
|
97
|
+
.filter(function (_a) {
|
|
98
|
+
var type = _a.type;
|
|
99
|
+
return ![MANDARIN, CANTONESE].includes(type);
|
|
100
|
+
})
|
|
101
|
+
.map(function (_a) {
|
|
102
|
+
var name = _a.name, type = _a.type, token = _a.token;
|
|
103
|
+
return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Radio, { value: type, label: name }, token));
|
|
104
|
+
})] })), (0, jsx_runtime_1.jsx)(mui_1.Divider, { sx: { mb: 1 } }), (0, jsx_runtime_1.jsx)(mui_1.FormControl, { children: (0, jsx_runtime_1.jsx)(mui_1.FormLabel, __assign({ component: "legend", style: { fontSize: 16, color: 'rgba(0,0,0,0.86)', fontWeight: 500, marginBottom: 16 } }, { children: "AI\u57FA\u7840\u80FD\u529B" })) })] })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: list.map(function (item) {
|
|
104
105
|
var name = item.name, desc = item.desc, type = item.type, token = item.token;
|
|
105
106
|
if (relatedAbilities === null || relatedAbilities === void 0 ? void 0 : relatedAbilities.includes(type)) {
|
|
106
107
|
var isLanguageAbility = [14, 15].includes(type);
|
|
@@ -9,6 +9,12 @@ export interface AiAbilityItem extends BaseAiAbilityParams {
|
|
|
9
9
|
groupName?: string;
|
|
10
10
|
isNotCompute?: boolean;
|
|
11
11
|
}
|
|
12
|
+
export interface WorkplaceItem {
|
|
13
|
+
token: string;
|
|
14
|
+
name: string;
|
|
15
|
+
weight: number | string;
|
|
16
|
+
isWorkplace?: boolean;
|
|
17
|
+
}
|
|
12
18
|
export declare type GroupCategoryRet = Array<{
|
|
13
19
|
name: string;
|
|
14
20
|
type: number;
|
|
@@ -15,17 +15,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
-
var react_1 = require("react");
|
|
19
|
-
var ahooks_1 = require("ahooks");
|
|
20
|
-
var ai_question_1 = require("../../../../services/ai-question");
|
|
21
|
-
var global_store_1 = require("../../../../store/ai-question/global-store");
|
|
22
|
-
var question_model_store_1 = require("../../../../store/ai-question/question-model-store");
|
|
23
|
-
var question_template_store_1 = require("../../../../store/ai-question/question-template-store");
|
|
24
18
|
var const_1 = require("../QuestionUpdate/const");
|
|
25
19
|
var Header_1 = __importDefault(require("./Header"));
|
|
26
20
|
var List_1 = __importDefault(require("./List"));
|
|
27
21
|
var Skeleton_1 = __importDefault(require("./Skeleton"));
|
|
28
22
|
var styled_1 = require("./styled");
|
|
23
|
+
var ai_question_1 = require("../../../../services/ai-question");
|
|
24
|
+
var global_store_1 = require("../../../../store/ai-question/global-store");
|
|
25
|
+
var question_model_store_1 = require("../../../../store/ai-question/question-model-store");
|
|
26
|
+
var question_template_store_1 = require("../../../../store/ai-question/question-template-store");
|
|
27
|
+
var ahooks_1 = require("ahooks");
|
|
28
|
+
var react_1 = require("react");
|
|
29
29
|
var Question = function () {
|
|
30
30
|
var isDefaultAdded = (0, react_1.useRef)(false);
|
|
31
31
|
var _a = (0, global_store_1.useAiQuestionStore)(function (store) { return [store.token, store.name, store.templateList]; }), token = _a.token, name = _a.name, templateList = _a.templateList, onLoad = _a.onLoad;
|
|
@@ -51,16 +51,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
51
51
|
};
|
|
52
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
53
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
54
|
-
var react_1 = require("react");
|
|
55
|
-
var fbm_ui_1 = require("fbm-ui");
|
|
56
|
-
var ahooks_1 = require("ahooks");
|
|
57
|
-
var ai_question_1 = require("../../../../enum/ai-question");
|
|
58
|
-
var ai_ability_1 = require("../../../../services/ai-ability");
|
|
59
54
|
var AiAnalysis_1 = __importDefault(require("../AiAnalysis"));
|
|
60
55
|
var const_1 = require("./const");
|
|
61
56
|
var VideoVoice_1 = __importDefault(require("./VideoVoice"));
|
|
57
|
+
var question_ability_store_1 = require("../../../../store/ai-ability/question-ability-store");
|
|
58
|
+
var ai_question_1 = require("../../../../enum/ai-question");
|
|
59
|
+
var ai_ability_1 = require("../../../../services/ai-ability");
|
|
60
|
+
var ahooks_1 = require("ahooks");
|
|
61
|
+
var fbm_ui_1 = require("fbm-ui");
|
|
62
|
+
var react_1 = require("react");
|
|
62
63
|
var QuestionForm = (0, react_1.forwardRef)(function (props, ref) {
|
|
63
64
|
var aiShowType = props.aiShowType, initialValues = props.initialValues, values = props.values, preview = props.preview, onValuesChange = props.onValuesChange, onSubmit = props.onSubmit;
|
|
65
|
+
var _a = (0, question_ability_store_1.useQuestionCollectionListStore)(function (store) { return [store.questionCollectionList]; }), questionCollectionList = _a.questionCollectionList, updateQuestionCollectionList = _a.updateQuestionCollectionList;
|
|
64
66
|
var data = (0, ahooks_1.useRequest)(ai_ability_1.PostQuestionCollectionList, { manual: preview }).data;
|
|
65
67
|
var form = (0, fbm_ui_1.useForm)({
|
|
66
68
|
initialValues: initialValues,
|
|
@@ -83,15 +85,22 @@ var QuestionForm = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
83
85
|
}); });
|
|
84
86
|
(0, react_1.useEffect)(function () {
|
|
85
87
|
values && form.setValues(values);
|
|
88
|
+
updateQuestionCollectionList((data === null || data === void 0 ? void 0 : data.data.list) || []);
|
|
86
89
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
87
|
-
}, [values]);
|
|
90
|
+
}, [values, data]);
|
|
88
91
|
(0, react_1.useEffect)(function () {
|
|
89
|
-
console.log(form.values);
|
|
92
|
+
// console.log(form.values);
|
|
90
93
|
onValuesChange === null || onValuesChange === void 0 ? void 0 : onValuesChange(form.values);
|
|
91
94
|
}, [form.values, onValuesChange]);
|
|
92
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Form, __assign({}, form, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.FormItem, { required: true, disabled: preview, name: "name", label: "\u6807\u9898", placeholder: "\u6807\u9898\uFF08\u7528\u4E8E\u7CFB\u7EDF\u7BA1\u7406\uFF09", max: 15 }), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex" }, { children: [!preview && aiShowType === ai_question_1.ADD_QUESTION_TYPE.FREE && ((0, jsx_runtime_1.jsx)(fbm_ui_1.FormItem, __assign({ sx: { flex: '1 0', mr: 1 }, required: true, disabled: preview, name: "broadcastType", label: "\u64AD\u62A5\u65B9\u5F0F" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Select, { placeholder: "\u64AD\u62A5\u65B9\u5F0F", options: const_1.broadcastModeOptions }) }))), !preview && ((0, jsx_runtime_1.jsx)(fbm_ui_1.FormItem, __assign({ style: { flex: '1 0' }, disabled: preview, name: "category", label: "\u8003\u5BDF\u80FD\u529B" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Autocomplete, { placeholder: "\u8003\u5BDF\u80FD\u529B", options:
|
|
93
|
-
var tag = _a.tag;
|
|
94
|
-
return ({
|
|
95
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Form, __assign({}, form, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.FormItem, { required: true, disabled: preview, name: "name", label: "\u6807\u9898", placeholder: "\u6807\u9898\uFF08\u7528\u4E8E\u7CFB\u7EDF\u7BA1\u7406\uFF09", max: 15 }), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex" }, { children: [!preview && aiShowType === ai_question_1.ADD_QUESTION_TYPE.FREE && ((0, jsx_runtime_1.jsx)(fbm_ui_1.FormItem, __assign({ sx: { flex: '1 0', mr: 1 }, required: true, disabled: preview, name: "broadcastType", label: "\u64AD\u62A5\u65B9\u5F0F" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Select, { placeholder: "\u64AD\u62A5\u65B9\u5F0F", options: const_1.broadcastModeOptions }) }))), !preview && ((0, jsx_runtime_1.jsx)(fbm_ui_1.FormItem, __assign({ style: { flex: '1 0' }, disabled: preview, name: "category", label: "\u8003\u5BDF\u80FD\u529B" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Autocomplete, { placeholder: "\u8003\u5BDF\u80FD\u529B", options: questionCollectionList.map(function (_a) {
|
|
96
|
+
var tag = _a.tag, token = _a.token, isWorkplace = _a.isWorkplace;
|
|
97
|
+
return ({
|
|
98
|
+
label: tag,
|
|
99
|
+
value: tag,
|
|
100
|
+
name: tag,
|
|
101
|
+
token: token,
|
|
102
|
+
isWorkplace: isWorkplace,
|
|
103
|
+
});
|
|
95
104
|
}) }) })))] })), form.values.broadcastType === 1 || preview ? ((0, jsx_runtime_1.jsx)(fbm_ui_1.FormItem, { required: true, disabled: preview, name: "desc", label: "\u9762\u8BD5\u5185\u5BB9", max: 300, placeholder: "\u9762\u8BD5\u5185\u5BB9\uFF08\u7CFB\u7EDF\u5C06\u6839\u636E\u6B64\u5185\u5BB9\u5411\u5019\u9009\u4EBA\u8FDB\u884C\u8BED\u97F3\u64AD\u62A5\uFF09" })) : ((0, jsx_runtime_1.jsx)(VideoVoice_1.default, {})), aiShowType === ai_question_1.ADD_QUESTION_TYPE.LANGUAGE && ((0, jsx_runtime_1.jsx)(fbm_ui_1.FormItem, { sx: { height: 'auto', mb: 2 }, required: true, name: "readText", label: "\u6717\u8BFB\u5185\u5BB9", max: 240, InputProps: {
|
|
96
105
|
rows: 3,
|
|
97
106
|
multiline: true,
|
|
@@ -62,16 +62,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
62
62
|
};
|
|
63
63
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
64
64
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
65
|
-
var
|
|
66
|
-
var
|
|
67
|
-
var mui_1 = require("fbm-ui/lib/mui");
|
|
65
|
+
var const_1 = require("./const");
|
|
66
|
+
var Form_1 = __importDefault(require("./Form"));
|
|
68
67
|
var ScrollDialogContent_1 = __importDefault(require("../../../../components/ScrollDialogContent"));
|
|
69
68
|
var ai_question_1 = require("../../../../enum/ai-question");
|
|
70
69
|
var ai_analysis_store_1 = require("../../../../store/ai-question/ai-analysis-store");
|
|
71
70
|
var question_model_store_1 = require("../../../../store/ai-question/question-model-store");
|
|
72
71
|
var question_update_store_1 = require("../../../../store/ai-question/question-update-store");
|
|
73
|
-
var
|
|
74
|
-
var
|
|
72
|
+
var fbm_ui_1 = require("fbm-ui");
|
|
73
|
+
var mui_1 = require("fbm-ui/lib/mui");
|
|
74
|
+
var react_1 = require("react");
|
|
75
75
|
var QuestionUpdate = function () {
|
|
76
76
|
var _a;
|
|
77
77
|
var formRef = (0, react_1.useRef)();
|
|
@@ -81,6 +81,7 @@ var QuestionUpdate = function () {
|
|
|
81
81
|
var _e = (0, ai_analysis_store_1.useAiAnalysisStore)(function (store) { return [
|
|
82
82
|
store.aiAbilities,
|
|
83
83
|
store.analysisState,
|
|
84
|
+
store.workplaces,
|
|
84
85
|
]; }), aiAbilities = _e.aiAbilities, analysisState = _e.analysisState, setKeyPointAnalysisError = _e.setKeyPointAnalysisError, updateAiAbilities = _e.updateAiAbilities, updateState = _e.updateState;
|
|
85
86
|
var open = questionState.open, item = questionState.item, aiShowType = questionState.aiShowType, token = questionState.token, index = questionState.index;
|
|
86
87
|
var initialValues = {
|
|
@@ -90,7 +91,7 @@ var QuestionUpdate = function () {
|
|
|
90
91
|
readText: (_a = item === null || item === void 0 ? void 0 : item.extra) === null || _a === void 0 ? void 0 : _a.readText,
|
|
91
92
|
prepareTime: item === null || item === void 0 ? void 0 : item.prepareTime,
|
|
92
93
|
duration: item === null || item === void 0 ? void 0 : item.duration,
|
|
93
|
-
category: (item === null || item === void 0 ? void 0 : item.category) ? { label: item === null || item === void 0 ? void 0 : item.category[0], value: item === null || item === void 0 ? void 0 : item.category[0] } : { label: '', value: '' },
|
|
94
|
+
category: (item === null || item === void 0 ? void 0 : item.category) ? { label: (item === null || item === void 0 ? void 0 : item.category[0]) || '', value: (item === null || item === void 0 ? void 0 : item.category[0]) || '' } : { label: '', value: '' },
|
|
94
95
|
};
|
|
95
96
|
var CustomHeader = function () {
|
|
96
97
|
var content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(mui_1.MenuItem, __assign({ sx: { backgroundColor: aiShowType === ai_question_1.ADD_QUESTION_TYPE.FREE ? 'rgba(76, 175, 80, 0.08)' : 'rgba(255, 255, 255, 1)' }, onClick: function () {
|
|
@@ -198,13 +199,45 @@ var QuestionUpdate = function () {
|
|
|
198
199
|
}
|
|
199
200
|
});
|
|
200
201
|
}); }, [getModelParams, item === null || item === void 0 ? void 0 : item.videoBroadcast.videoUrl, token, editModel, index, addModel, updateQuestionState]);
|
|
202
|
+
var handleValuesChange = (0, react_1.useCallback)(function (value) {
|
|
203
|
+
var curAiAbilities = item.aiAbilities;
|
|
204
|
+
// 勘察能力为发生变化
|
|
205
|
+
var WorkplaceIndex = curAiAbilities.findIndex(function (v) { var _a; return v.name === ((_a = value.category) === null || _a === void 0 ? void 0 : _a.label); });
|
|
206
|
+
if (WorkplaceIndex > -1) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
// 考察能力更改
|
|
210
|
+
if (value.category && value.category.label) {
|
|
211
|
+
var isInit = true;
|
|
212
|
+
// 考察能力是否包含在AI能力
|
|
213
|
+
var workplaceTypeIndex = curAiAbilities.findIndex(function (v) { return v.abilityType === 2; });
|
|
214
|
+
var isNotCompute = !value.category.isWorkplace;
|
|
215
|
+
var CurWorkPlaceItem = workplaceTypeIndex > -1
|
|
216
|
+
? __assign(__assign(__assign({}, curAiAbilities[workplaceTypeIndex]), value.category), { isNotCompute: isNotCompute }) : __assign(__assign({ abilityType: 2 }, value.category), { weight: 0, isNotCompute: isNotCompute, name: value.category.label, isWorkplace: true });
|
|
217
|
+
isInit = CurWorkPlaceItem.weight === 0 || workplaceTypeIndex === -1;
|
|
218
|
+
curAiAbilities.splice(0, 1, CurWorkPlaceItem);
|
|
219
|
+
// console.log('curAiAbilities', curAiAbilities);
|
|
220
|
+
updateAiAbilities(curAiAbilities, isInit);
|
|
221
|
+
}
|
|
222
|
+
else if (!value.category || !value.category.label) {
|
|
223
|
+
// 考察能力删除
|
|
224
|
+
curAiAbilities = item.aiAbilities.filter(function (v) { return v.abilityType === 1; });
|
|
225
|
+
updateAiAbilities(curAiAbilities);
|
|
226
|
+
}
|
|
227
|
+
}, [item.aiAbilities, updateAiAbilities]);
|
|
201
228
|
(0, react_1.useEffect)(function () {
|
|
229
|
+
var _a;
|
|
202
230
|
if (open) {
|
|
203
231
|
updateState({ language: item.language, aiSwitch: item.aiSwitch });
|
|
204
232
|
updateAiAbilities(item.aiAbilities, true);
|
|
205
233
|
}
|
|
234
|
+
// 删除职场呢能力时
|
|
235
|
+
var WorkplaceIndex = aiAbilities.findIndex(function (v) { return v.abilityType === 1; });
|
|
236
|
+
if (WorkplaceIndex === -1) {
|
|
237
|
+
(_a = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _a === void 0 ? void 0 : _a.setFormValues({ category: { label: '', value: '' } });
|
|
238
|
+
}
|
|
206
239
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
207
|
-
}, [open]);
|
|
208
|
-
return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Dialog, __assign({ open: open, header: CustomHeader, size: "sm", okText: "\u786E\u8BA4", onClose: handleClose, onOk: handleOk }, { children: (0, jsx_runtime_1.jsx)(ScrollDialogContent_1.default, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ sx: { mt: 1 } }, { children: (0, jsx_runtime_1.jsx)(Form_1.default, { ref: formRef, initialValues: initialValues, aiShowType: aiShowType, onSubmit: handleSubmit }) })) }) })));
|
|
240
|
+
}, [open, item.aiAbilities]);
|
|
241
|
+
return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Dialog, __assign({ open: open, header: CustomHeader, size: "sm", okText: "\u786E\u8BA4", onClose: handleClose, onOk: handleOk }, { children: (0, jsx_runtime_1.jsx)(ScrollDialogContent_1.default, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ sx: { mt: 1 } }, { children: (0, jsx_runtime_1.jsx)(Form_1.default, { ref: formRef, initialValues: initialValues, aiShowType: aiShowType, onSubmit: handleSubmit, onValuesChange: handleValuesChange }) })) }) })));
|
|
209
242
|
};
|
|
210
243
|
exports.default = QuestionUpdate;
|