eli-video-interview 1.2.42-alpha.44 → 1.2.42-alpha.46

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.
@@ -22,6 +22,7 @@ export interface AiAbility extends AiAbilityDetail {
22
22
  token: string;
23
23
  selected?: boolean;
24
24
  type: number;
25
+ child?: AiAbility[];
25
26
  }
26
27
  export declare type AiAbilityItemProps = AiAbility;
27
28
  export interface AiAbilityListData {
@@ -109,7 +109,7 @@ var AiQuestionRoot = forwardRef(function (props, ref) {
109
109
  _d.label = 2;
110
110
  case 2:
111
111
  _d.trys.push([2, 4, , 5]);
112
- return [4 /*yield*/, PostAiModelUpsert(__assign(__assign({ name: name, thirdToken: '', aiModel: (props === null || props === void 0 ? void 0 : props.aiModel) || aiModel }, interviewRoomState), { introductoryVideoSetting: {}, selectAbilities: selctedAbilitys, token: token, questions: questions.map(function (item, i) { return (__assign(__assign({}, item), { selfIntroOpt: i > 2 ? item.selfIntroOpt : 0 })); }) }))];
112
+ return [4 /*yield*/, PostAiModelUpsert(__assign(__assign({ name: name, thirdToken: '', aiModel: (props === null || props === void 0 ? void 0 : props.aiModel) || aiModel }, interviewRoomState), { introductoryVideoSetting: {}, selectAbilities: selctedAbilitys, token: token, questions: questions.map(function (item, i) { return (__assign(__assign({}, item), { selfIntroOpt: i < 2 ? item.selfIntroOpt : 0 })); }) }))];
113
113
  case 3:
114
114
  data = (_d.sent()).data;
115
115
  return [2 /*return*/, Promise.resolve({
@@ -14,13 +14,15 @@ import { willOrNotOptions } from './const';
14
14
  import MainPoints from './MainPoints';
15
15
  import { useAiAnalysisStore } from "../../../../store/ai-question/ai-analysis-store";
16
16
  import { Box, Chip, CloseIcon, IconButton, InfoIcon, Input, Select, Tooltip, Typography } from 'fbm-ui';
17
- import { ListItem, ListItemText } from 'fbm-ui/lib/mui';
17
+ import { ListItem, ListItemText, Stack } from 'fbm-ui/lib/mui';
18
18
  import update from 'immutability-helper';
19
19
  import { useCallback } from 'react';
20
20
  var AnalysisItem = function (props) {
21
21
  var _a;
22
- 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;
23
- var _c = useAiAnalysisStore(function (store) { return [store.aiAbilities]; }), aiAbilities = _c.aiAbilities, updateAiAbilities = _c.updateAiAbilities, updateAiAbilitiesWeight = _c.updateAiAbilitiesWeight, removeAiAbilities = _c.removeAiAbilities;
22
+ 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, child = props.child;
23
+ var _c = useAiAnalysisStore(function (store) { return [
24
+ store.aiAbilities,
25
+ ]; }), aiAbilities = _c.aiAbilities, updateAiAbilities = _c.updateAiAbilities, updateAiAbilitiesWeight = _c.updateAiAbilitiesWeight, removeAiAbilities = _c.removeAiAbilities, updateAiAbilitiesChildWeight = _c.updateAiAbilitiesChildWeight;
24
26
  var desc = props.desc || props.name;
25
27
  var NotUsedAilibity = ['英文能力', '游戏测评'];
26
28
  if (abilityType === 2 && !isWorkplace) {
@@ -39,6 +41,12 @@ var AnalysisItem = function (props) {
39
41
  var value = _a.target.value;
40
42
  updateAiAbilitiesWeight(value, index);
41
43
  }, [updateAiAbilitiesWeight, index]);
42
- return (_jsxs(Box, { children: [_jsxs(ListItem, __assign({ sx: { pl: 0, pr: 4 }, secondaryAction: _jsx(IconButton, __assign({ size: "small", sx: { position: 'relative', left: 16 }, onClick: handleRemove }, { children: _jsx(CloseIcon, {}) })) }, { children: [_jsx(ListItemText, { children: _jsxs(Box, __assign({ display: "flex", alignItems: "center" }, { children: [_jsx(Typography, __assign({ variant: "subtitle2", style: { maxWidth: '158px', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' } }, { children: name })), abilityType === 2 && !isWorkplace ? (_jsx(Typography, __assign({ variant: "body2", style: { color: 'RGBA(0, 0, 0, 0.26)', fontSize: 12 }, ml: 1 }, { children: desc }))) : (_jsxs(_Fragment, { children: [abilityType === 2 && isWorkplace && type === 3 && _jsx(Chip, { color: 'primary', label: '自定义', size: "small", sx: { ml: 1 } }), _jsx(Tooltip, __assign({ title: "".concat(desc), placement: "bottom-start" }, { children: _jsx(Box, __assign({ display: "flex", alignItems: "center", sx: { ml: 1 } }, { children: _jsx(InfoIcon, { sx: { color: 'rgba(0, 0, 0, 0.26)', fontSize: 16 } }) })) }))] })), type === 8 && (_jsx(Select, { sx: { width: 150, ml: 1 }, options: willOrNotOptions, value: (_a = JSON.parse(extra)) === null || _a === void 0 ? void 0 : _a.expect, size: "small", onChange: handleWillOrNotChange }))] })) }), (abilityType === 1 || (abilityType === 2 && isWorkplace)) && (_jsx(Input, { sx: { width: 84, mr: 1 }, value: weight, disabled: index === aiAbilities.length - 1, size: "small", endAdornment: "%", onChange: handleWeightChange }))] })), type === 6 && _jsx(MainPoints, { extra: extra, index: index })] }));
44
+ return (_jsxs(Box, { children: [_jsxs(ListItem, __assign({ sx: { pl: 0, pr: 4 }, secondaryAction: _jsx(IconButton, __assign({ size: "small", sx: { position: 'relative', left: 16 }, onClick: handleRemove }, { children: _jsx(CloseIcon, {}) })) }, { children: [_jsx(ListItemText, { children: _jsxs(Box, __assign({ display: "flex", alignItems: "center" }, { children: [_jsx(Typography, __assign({ variant: "subtitle2", style: { maxWidth: '158px', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' } }, { children: name })), abilityType === 2 && !isWorkplace ? (_jsx(Typography, __assign({ variant: "body2", style: { color: 'RGBA(0, 0, 0, 0.26)', fontSize: 12 }, ml: 1 }, { children: desc }))) : (_jsxs(_Fragment, { children: [abilityType === 2 && isWorkplace && type === 3 && _jsx(Chip, { color: 'primary', label: '自定义', size: "small", sx: { ml: 1 } }), _jsx(Tooltip, __assign({ title: "".concat(desc), placement: "bottom-start" }, { children: _jsx(Box, __assign({ display: "flex", alignItems: "center", sx: { ml: 1 } }, { children: _jsx(InfoIcon, { sx: { color: 'rgba(0, 0, 0, 0.26)', fontSize: 16 } }) })) }))] })), type === 8 && (_jsx(Select, { sx: { width: 150, ml: 1 }, options: willOrNotOptions, value: (_a = JSON.parse(extra)) === null || _a === void 0 ? void 0 : _a.expect, size: "small", onChange: handleWillOrNotChange }))] })) }), (abilityType === 1 || (abilityType === 2 && isWorkplace)) && (_jsx(Input, { sx: { width: 84, mr: 1 }, value: weight, disabled: index === aiAbilities.length - 1, size: "small", endAdornment: "%", onChange: handleWeightChange }))] })), _jsx(Stack, __assign({ sx: {
45
+ backgroundColor: 'rgba(0, 0, 0, 0.04)',
46
+ pl: 4,
47
+ } }, { children: child === null || child === void 0 ? void 0 : child.map(function (item, index) { return (_jsxs(ListItem, __assign({ sx: { pl: 0, pr: 4 } }, { children: [_jsx(ListItemText, { children: _jsx(Box, __assign({ display: "flex", alignItems: "center" }, { children: _jsx(Typography, __assign({ variant: "subtitle2", style: { maxWidth: '158px', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' } }, { children: item.name })) })) }), _jsx(Input, { sx: { width: 84, mr: 1 }, value: item.weight, disabled: index === child.length - 1, size: "small", endAdornment: "%", onChange: function (_a) {
48
+ var value = _a.target.value;
49
+ return updateAiAbilitiesChildWeight(value, index, index);
50
+ } })] }), item.token)); }) })), type === 6 && _jsx(MainPoints, { extra: extra, index: index })] }));
43
51
  };
44
52
  export default AnalysisItem;
@@ -8,6 +8,7 @@ export interface AiAbilityItem extends BaseAiAbilityParams {
8
8
  groupId?: number;
9
9
  groupName?: string;
10
10
  isNotCompute?: boolean;
11
+ child?: AiAbilityItem[];
11
12
  }
12
13
  export interface WorkplaceItem {
13
14
  token: string;
@@ -148,7 +148,7 @@ var QuestionForm = forwardRef(function (props, ref) {
148
148
  onValuesChange === null || onValuesChange === void 0 ? void 0 : onValuesChange(form.values);
149
149
  }, [form.values, onValuesChange]);
150
150
  return (_jsxs(_Fragment, { children: [_jsxs(Form, __assign({}, form, { children: [_jsx(FormItem, { required: true, disabled: preview, name: "name", label: "\u6807\u9898", placeholder: "\u6807\u9898\uFF08\u7528\u4E8E\u7CFB\u7EDF\u7BA1\u7406\uFF09", max: 15 }), _jsxs(Box, __assign({ display: "flex" }, { children: [!preview && aiShowType === ADD_QUESTION_TYPE.FREE && (_jsx(FormItem, __assign({ sx: { flex: '1 0', mr: 1 }, required: true, disabled: preview, name: "broadcastType", label: "\u64AD\u62A5\u65B9\u5F0F" }, { children: _jsx(Select, { placeholder: "\u64AD\u62A5\u65B9\u5F0F", options: broadcastModeOptions }) }))), !preview && (_jsx(FormItem, __assign({ style: { flex: '1 0' }, disabled: preview, name: "category", label: "\u8003\u5BDF\u80FD\u529B" }, { children: _jsx(Autocomplete, { placeholder: "\u8003\u5BDF\u80FD\u529B", options: aiAbilityList.map(function (_a) {
151
- var tag = _a.tag, token = _a.token, isWorkplace = _a.isWorkplace, define = _a.define, type = _a.type;
151
+ var tag = _a.tag, token = _a.token, isWorkplace = _a.isWorkplace, define = _a.define, type = _a.type, child = _a.child;
152
152
  return ({
153
153
  label: tag,
154
154
  value: tag,
@@ -158,6 +158,7 @@ var QuestionForm = forwardRef(function (props, ref) {
158
158
  token: token,
159
159
  define: define,
160
160
  isWorkplace: isWorkplace,
161
+ child: child,
161
162
  });
162
163
  }), onChange: handleCategoryChange }) })))] })), aiShowType !== ADD_QUESTION_TYPE.SINGLECHIOCE &&
163
164
  ((form === null || form === void 0 ? void 0 : form.values.broadcastType) === 1 || preview ? (_jsx(FieldArray, { name: "questions", render: function () {
@@ -85,6 +85,6 @@ var RandomQuestion = function (_a) {
85
85
  mr: 0,
86
86
  }, checked: ((_b = item === null || item === void 0 ? void 0 : item.videoBroadcast) === null || _b === void 0 ? void 0 : _b.videoRetry) === 1, label: _jsx(Typography, __assign({ variant: "body2" }, { children: "\u5141\u8BB8\u91CD\u590D\u542C\u9898" })), onChange: function (e, checked) { return handleVideoBroadcastChange('videoRetry', checked); } }), _jsx(Checkbox, { sx: {
87
87
  mr: 0,
88
- }, checked: ((_c = item === null || item === void 0 ? void 0 : item.videoBroadcast) === null || _c === void 0 ? void 0 : _c.videoSkip) === 1, label: _jsx(Typography, __assign({ variant: "body2" }, { children: "\u5141\u8BB8\u8DF3\u8FC7" })), onChange: function (e, checked) { return handleVideoBroadcastChange('videoSkip', checked); } })] }))), item.type === 1 && item.aiShowType === 1 && (_jsx(Checkbox, { checked: item === null || item === void 0 ? void 0 : item.enableScoreOptimization, label: _jsxs(Typography, __assign({ variant: "body2", display: "flex" }, { children: ["\u56DE\u7B54\u8FC7\u77ED\u6263\u5206", _jsx(Tooltip, __assign({ title: "\u82E5\u5B57\u6570\u5C0F\u4E8E\u7B49\u4E8E80\u65F6\uFF0C\u5BF9AI\u5206\u6570\u8FDB\u884C\u4E00\u5B9A\u7684\u51CF\u5C11\uFF0C\u6700\u5C11\n\u51CF10\u5206\uFF0C\u6700\u9AD8\u51CF40\u5206\uFF0C\u6309\u7167\u5B57\u6570\u9010\u51CF\u3002" }, { children: _jsx("span", __assign({ style: { display: 'flex', alignItems: 'center', marginLeft: '8px' } }, { children: _jsx(InfoIcon, { sx: { fontSize: 14, color: 'rgba(0, 0, 0, 0.26)' } }) })) }))] })), onChange: handleEnableScoreOptimizationStatus })), questionState.aiShowType === 1 && questionState.index < 2 && (_jsx(Checkbox, { checked: !!item.selfIntroOpt, label: _jsxs(Typography, __assign({ variant: "body2", display: "flex" }, { children: ["\u81EA\u6211\u4ECB\u7ECD", _jsx(Tooltip, __assign({ title: "\u52FE\u9009\u4E3A\u81EA\u6211\u4ECB\u7ECD\u9898\u540E,\u5C06\u5BF9\u5019\u9009\u4EBA\u56DE\u7B54\u4E2D\u7684\u59D3\u540D\u8FDB\u884C\u4FEE\u6B63\u3002" }, { children: _jsx("span", __assign({ style: { display: 'flex', alignItems: 'center', marginLeft: '8px' } }, { children: _jsx(InfoIcon, { sx: { fontSize: 14, color: 'rgba(0, 0, 0, 0.26)' } }) })) }))] })), onChange: handleSelfIntrosChange }))] }))] })), open && _jsx(SelectQuestion, { token: category === null || category === void 0 ? void 0 : category.token, open: open, onClose: function () { return setOpen(false); }, onOk: onAddRandomQuestion })] }));
88
+ }, checked: ((_c = item === null || item === void 0 ? void 0 : item.videoBroadcast) === null || _c === void 0 ? void 0 : _c.videoSkip) === 1, label: _jsx(Typography, __assign({ variant: "body2" }, { children: "\u5141\u8BB8\u8DF3\u8FC7" })), onChange: function (e, checked) { return handleVideoBroadcastChange('videoSkip', checked); } })] }))), questionState.aiShowType === 1 && questionState.index < 2 && (_jsx(Checkbox, { checked: !!item.selfIntroOpt, label: _jsxs(Typography, __assign({ variant: "body2", display: "flex" }, { children: ["\u81EA\u6211\u4ECB\u7ECD", _jsx(Tooltip, __assign({ title: "\u52FE\u9009\u4E3A\u81EA\u6211\u4ECB\u7ECD\u9898\u540E,\u5C06\u5BF9\u5019\u9009\u4EBA\u56DE\u7B54\u4E2D\u7684\u59D3\u540D\u8FDB\u884C\u4FEE\u6B63\u3002" }, { children: _jsx("span", __assign({ style: { display: 'flex', alignItems: 'center', marginLeft: '8px' } }, { children: _jsx(InfoIcon, { sx: { fontSize: 14, color: 'rgba(0, 0, 0, 0.26)' } }) })) }))] })), onChange: handleSelfIntrosChange }))] }))] })), open && _jsx(SelectQuestion, { token: category === null || category === void 0 ? void 0 : category.token, open: open, onClose: function () { return setOpen(false); }, onOk: onAddRandomQuestion })] }));
89
89
  };
90
90
  export default RandomQuestion;
@@ -133,7 +133,9 @@ var QuestionUpdate = function () {
133
133
  // 职场能力中不参与AI分析的提交时,过滤掉
134
134
  var newAiAbilities = aiAbilities
135
135
  .map(function (i) {
136
+ var _a;
136
137
  i.isNotCompute = true;
138
+ i.child = (_a = i.child) === null || _a === void 0 ? void 0 : _a.map(function (v) { return (__assign(__assign({}, v), { weight: Number(v.weight) || 0 })); });
137
139
  if (i.type === 6) {
138
140
  var extra_1 = {};
139
141
  var extraJson = JSON.parse(i.extra);
@@ -266,7 +268,6 @@ var QuestionUpdate = function () {
266
268
  else {
267
269
  curAiAbilities.unshift(CurWorkPlaceAiAbility);
268
270
  }
269
- console.log('curAiAbilities', curAiAbilities, inInit);
270
271
  updateAiAbilities(curAiAbilities, inInit);
271
272
  }, [questionCollectionList, aiAbilities, updateAiAbilities]);
272
273
  var handleCategoryChange = useCallback(function (value) {
@@ -11,6 +11,7 @@ export declare const useAiAnalysisStore: (depsFn?: import("hox/es/types").DepsFn
11
11
  updateState: (params: Partial<AnalysisStateParams>) => void;
12
12
  updateAiAbilities: (data: AiAbilityItem[], inInit?: any) => void;
13
13
  updateAiAbilitiesWeight: (value: string, index: number) => void;
14
+ updateAiAbilitiesChildWeight: (value: string, index: number, childIndex: number) => void;
14
15
  removeAiAbilities: (index: number) => void;
15
16
  updateWorkplaces: (data: WorkplaceItem[]) => void;
16
17
  setKeyPointAnalysisError: import("react").Dispatch<import("react").SetStateAction<number[]>>;
@@ -22,6 +23,7 @@ export declare const useAiAnalysisStore: (depsFn?: import("hox/es/types").DepsFn
22
23
  updateState: (params: Partial<AnalysisStateParams>) => void;
23
24
  updateAiAbilities: (data: AiAbilityItem[], inInit?: any) => void;
24
25
  updateAiAbilitiesWeight: (value: string, index: number) => void;
26
+ updateAiAbilitiesChildWeight: (value: string, index: number, childIndex: number) => void;
25
27
  removeAiAbilities: (index: number) => void;
26
28
  updateWorkplaces: (data: WorkplaceItem[]) => void;
27
29
  setKeyPointAnalysisError: import("react").Dispatch<import("react").SetStateAction<number[]>>;
@@ -127,6 +127,30 @@ export var useAiAnalysisStore = (_a = __read(createStore(function () {
127
127
  computeWeight(newAiAbilities);
128
128
  }
129
129
  }, [aiAbilities, computeWeight]);
130
+ var updateAiAbilitiesChildWeight = useCallback(function (value, index, childIndex) {
131
+ var _a, _b, _c;
132
+ var formatValue = formatNumberDecimal(value);
133
+ var child = aiAbilities[index].child;
134
+ var curOriginalWeight = Number(child === null || child === void 0 ? void 0 : child[childIndex].weight);
135
+ var disabledWeight = Number(child === null || child === void 0 ? void 0 : child[(child === null || child === void 0 ? void 0 : child.length) - 1].weight);
136
+ var maxInputValue = computeDecimalValue((curOriginalWeight + disabledWeight).toString());
137
+ if (Number(formatValue) <= maxInputValue) {
138
+ var childLength = (child === null || child === void 0 ? void 0 : child.length) || 0;
139
+ // 如果 child 的长度大于 2,则修改最后一个子项的 weight
140
+ var updateLastChild = childLength > 1
141
+ ? (_a = {},
142
+ _a[childLength - 1] = {
143
+ weight: { $set: maxInputValue - Number(formatValue) },
144
+ },
145
+ _a) : {};
146
+ var newAiAbilities = update(aiAbilities, (_b = {},
147
+ _b[index] = {
148
+ child: __assign((_c = {}, _c[childIndex] = { weight: { $set: formatValue } }, _c), updateLastChild),
149
+ },
150
+ _b));
151
+ setAiAbilities(newAiAbilities);
152
+ }
153
+ }, [aiAbilities]);
130
154
  /**
131
155
  * 删除AI分析维度
132
156
  */
@@ -166,6 +190,7 @@ export var useAiAnalysisStore = (_a = __read(createStore(function () {
166
190
  updateState: updateState,
167
191
  updateAiAbilities: updateAiAbilities,
168
192
  updateAiAbilitiesWeight: updateAiAbilitiesWeight,
193
+ updateAiAbilitiesChildWeight: updateAiAbilitiesChildWeight,
169
194
  removeAiAbilities: removeAiAbilities,
170
195
  updateWorkplaces: updateWorkplaces,
171
196
  setKeyPointAnalysisError: setKeyPointAnalysisError,
@@ -22,6 +22,7 @@ export interface AiAbility extends AiAbilityDetail {
22
22
  token: string;
23
23
  selected?: boolean;
24
24
  type: number;
25
+ child?: AiAbility[];
25
26
  }
26
27
  export declare type AiAbilityItemProps = AiAbility;
27
28
  export interface AiAbilityListData {
@@ -114,7 +114,7 @@ var AiQuestionRoot = (0, react_1.forwardRef)(function (props, ref) {
114
114
  _d.label = 2;
115
115
  case 2:
116
116
  _d.trys.push([2, 4, , 5]);
117
- return [4 /*yield*/, (0, ai_question_1.PostAiModelUpsert)(__assign(__assign({ name: name, thirdToken: '', aiModel: (props === null || props === void 0 ? void 0 : props.aiModel) || aiModel }, interviewRoomState), { introductoryVideoSetting: {}, selectAbilities: selctedAbilitys, token: token, questions: questions.map(function (item, i) { return (__assign(__assign({}, item), { selfIntroOpt: i > 2 ? item.selfIntroOpt : 0 })); }) }))];
117
+ return [4 /*yield*/, (0, ai_question_1.PostAiModelUpsert)(__assign(__assign({ name: name, thirdToken: '', aiModel: (props === null || props === void 0 ? void 0 : props.aiModel) || aiModel }, interviewRoomState), { introductoryVideoSetting: {}, selectAbilities: selctedAbilitys, token: token, questions: questions.map(function (item, i) { return (__assign(__assign({}, item), { selfIntroOpt: i < 2 ? item.selfIntroOpt : 0 })); }) }))];
118
118
  case 3:
119
119
  data = (_d.sent()).data;
120
120
  return [2 /*return*/, Promise.resolve({
@@ -24,8 +24,10 @@ var immutability_helper_1 = __importDefault(require("immutability-helper"));
24
24
  var react_1 = require("react");
25
25
  var AnalysisItem = function (props) {
26
26
  var _a;
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;
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, child = props.child;
28
+ var _c = (0, ai_analysis_store_1.useAiAnalysisStore)(function (store) { return [
29
+ store.aiAbilities,
30
+ ]; }), aiAbilities = _c.aiAbilities, updateAiAbilities = _c.updateAiAbilities, updateAiAbilitiesWeight = _c.updateAiAbilitiesWeight, removeAiAbilities = _c.removeAiAbilities, updateAiAbilitiesChildWeight = _c.updateAiAbilitiesChildWeight;
29
31
  var desc = props.desc || props.name;
30
32
  var NotUsedAilibity = ['英文能力', '游戏测评'];
31
33
  if (abilityType === 2 && !isWorkplace) {
@@ -44,6 +46,12 @@ var AnalysisItem = function (props) {
44
46
  var value = _a.target.value;
45
47
  updateAiAbilitiesWeight(value, index);
46
48
  }, [updateAiAbilitiesWeight, 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({ size: "small", 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", style: { maxWidth: '158px', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' } }, { 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.jsxs)(jsx_runtime_1.Fragment, { children: [abilityType === 2 && isWorkplace && type === 3 && (0, jsx_runtime_1.jsx)(fbm_ui_1.Chip, { color: 'primary', label: '自定义', size: "small", sx: { ml: 1 } }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: "".concat(desc), placement: "bottom-start" }, { 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 })] }));
49
+ 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({ size: "small", 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", style: { maxWidth: '158px', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' } }, { 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.jsxs)(jsx_runtime_1.Fragment, { children: [abilityType === 2 && isWorkplace && type === 3 && (0, jsx_runtime_1.jsx)(fbm_ui_1.Chip, { color: 'primary', label: '自定义', size: "small", sx: { ml: 1 } }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: "".concat(desc), placement: "bottom-start" }, { 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 }))] })), (0, jsx_runtime_1.jsx)(mui_1.Stack, __assign({ sx: {
50
+ backgroundColor: 'rgba(0, 0, 0, 0.04)',
51
+ pl: 4,
52
+ } }, { children: child === null || child === void 0 ? void 0 : child.map(function (item, index) { return ((0, jsx_runtime_1.jsxs)(mui_1.ListItem, __assign({ sx: { pl: 0, pr: 4 } }, { children: [(0, jsx_runtime_1.jsx)(mui_1.ListItemText, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ display: "flex", alignItems: "center" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "subtitle2", style: { maxWidth: '158px', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' } }, { children: item.name })) })) }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Input, { sx: { width: 84, mr: 1 }, value: item.weight, disabled: index === child.length - 1, size: "small", endAdornment: "%", onChange: function (_a) {
53
+ var value = _a.target.value;
54
+ return updateAiAbilitiesChildWeight(value, index, index);
55
+ } })] }), item.token)); }) })), type === 6 && (0, jsx_runtime_1.jsx)(MainPoints_1.default, { extra: extra, index: index })] }));
48
56
  };
49
57
  exports.default = AnalysisItem;
@@ -8,6 +8,7 @@ export interface AiAbilityItem extends BaseAiAbilityParams {
8
8
  groupId?: number;
9
9
  groupName?: string;
10
10
  isNotCompute?: boolean;
11
+ child?: AiAbilityItem[];
11
12
  }
12
13
  export interface WorkplaceItem {
13
14
  token: string;
@@ -153,7 +153,7 @@ var QuestionForm = (0, react_1.forwardRef)(function (props, ref) {
153
153
  onValuesChange === null || onValuesChange === void 0 ? void 0 : onValuesChange(form.values);
154
154
  }, [form.values, onValuesChange]);
155
155
  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: aiAbilityList.map(function (_a) {
156
- var tag = _a.tag, token = _a.token, isWorkplace = _a.isWorkplace, define = _a.define, type = _a.type;
156
+ var tag = _a.tag, token = _a.token, isWorkplace = _a.isWorkplace, define = _a.define, type = _a.type, child = _a.child;
157
157
  return ({
158
158
  label: tag,
159
159
  value: tag,
@@ -163,6 +163,7 @@ var QuestionForm = (0, react_1.forwardRef)(function (props, ref) {
163
163
  token: token,
164
164
  define: define,
165
165
  isWorkplace: isWorkplace,
166
+ child: child,
166
167
  });
167
168
  }), onChange: handleCategoryChange }) })))] })), aiShowType !== ai_question_1.ADD_QUESTION_TYPE.SINGLECHIOCE &&
168
169
  ((form === null || form === void 0 ? void 0 : form.values.broadcastType) === 1 || preview ? ((0, jsx_runtime_1.jsx)(formik_1.FieldArray, { name: "questions", render: function () {
@@ -90,6 +90,6 @@ var RandomQuestion = function (_a) {
90
90
  mr: 0,
91
91
  }, checked: ((_b = item === null || item === void 0 ? void 0 : item.videoBroadcast) === null || _b === void 0 ? void 0 : _b.videoRetry) === 1, label: (0, jsx_runtime_1.jsx)(mui_1.Typography, __assign({ variant: "body2" }, { children: "\u5141\u8BB8\u91CD\u590D\u542C\u9898" })), onChange: function (e, checked) { return handleVideoBroadcastChange('videoRetry', checked); } }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Checkbox, { sx: {
92
92
  mr: 0,
93
- }, checked: ((_c = item === null || item === void 0 ? void 0 : item.videoBroadcast) === null || _c === void 0 ? void 0 : _c.videoSkip) === 1, label: (0, jsx_runtime_1.jsx)(mui_1.Typography, __assign({ variant: "body2" }, { children: "\u5141\u8BB8\u8DF3\u8FC7" })), onChange: function (e, checked) { return handleVideoBroadcastChange('videoSkip', checked); } })] }))), item.type === 1 && item.aiShowType === 1 && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Checkbox, { checked: item === null || item === void 0 ? void 0 : item.enableScoreOptimization, label: (0, jsx_runtime_1.jsxs)(mui_1.Typography, __assign({ variant: "body2", display: "flex" }, { children: ["\u56DE\u7B54\u8FC7\u77ED\u6263\u5206", (0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: "\u82E5\u5B57\u6570\u5C0F\u4E8E\u7B49\u4E8E80\u65F6\uFF0C\u5BF9AI\u5206\u6570\u8FDB\u884C\u4E00\u5B9A\u7684\u51CF\u5C11\uFF0C\u6700\u5C11\n\u51CF10\u5206\uFF0C\u6700\u9AD8\u51CF40\u5206\uFF0C\u6309\u7167\u5B57\u6570\u9010\u51CF\u3002" }, { children: (0, jsx_runtime_1.jsx)("span", __assign({ style: { display: 'flex', alignItems: 'center', marginLeft: '8px' } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.InfoIcon, { sx: { fontSize: 14, color: 'rgba(0, 0, 0, 0.26)' } }) })) }))] })), onChange: handleEnableScoreOptimizationStatus })), questionState.aiShowType === 1 && questionState.index < 2 && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Checkbox, { checked: !!item.selfIntroOpt, label: (0, jsx_runtime_1.jsxs)(mui_1.Typography, __assign({ variant: "body2", display: "flex" }, { children: ["\u81EA\u6211\u4ECB\u7ECD", (0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: "\u52FE\u9009\u4E3A\u81EA\u6211\u4ECB\u7ECD\u9898\u540E,\u5C06\u5BF9\u5019\u9009\u4EBA\u56DE\u7B54\u4E2D\u7684\u59D3\u540D\u8FDB\u884C\u4FEE\u6B63\u3002" }, { children: (0, jsx_runtime_1.jsx)("span", __assign({ style: { display: 'flex', alignItems: 'center', marginLeft: '8px' } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.InfoIcon, { sx: { fontSize: 14, color: 'rgba(0, 0, 0, 0.26)' } }) })) }))] })), onChange: handleSelfIntrosChange }))] }))] })), open && (0, jsx_runtime_1.jsx)(SelectQuestion_1.default, { token: category === null || category === void 0 ? void 0 : category.token, open: open, onClose: function () { return setOpen(false); }, onOk: onAddRandomQuestion })] }));
93
+ }, checked: ((_c = item === null || item === void 0 ? void 0 : item.videoBroadcast) === null || _c === void 0 ? void 0 : _c.videoSkip) === 1, label: (0, jsx_runtime_1.jsx)(mui_1.Typography, __assign({ variant: "body2" }, { children: "\u5141\u8BB8\u8DF3\u8FC7" })), onChange: function (e, checked) { return handleVideoBroadcastChange('videoSkip', checked); } })] }))), questionState.aiShowType === 1 && questionState.index < 2 && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Checkbox, { checked: !!item.selfIntroOpt, label: (0, jsx_runtime_1.jsxs)(mui_1.Typography, __assign({ variant: "body2", display: "flex" }, { children: ["\u81EA\u6211\u4ECB\u7ECD", (0, jsx_runtime_1.jsx)(fbm_ui_1.Tooltip, __assign({ title: "\u52FE\u9009\u4E3A\u81EA\u6211\u4ECB\u7ECD\u9898\u540E,\u5C06\u5BF9\u5019\u9009\u4EBA\u56DE\u7B54\u4E2D\u7684\u59D3\u540D\u8FDB\u884C\u4FEE\u6B63\u3002" }, { children: (0, jsx_runtime_1.jsx)("span", __assign({ style: { display: 'flex', alignItems: 'center', marginLeft: '8px' } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.InfoIcon, { sx: { fontSize: 14, color: 'rgba(0, 0, 0, 0.26)' } }) })) }))] })), onChange: handleSelfIntrosChange }))] }))] })), open && (0, jsx_runtime_1.jsx)(SelectQuestion_1.default, { token: category === null || category === void 0 ? void 0 : category.token, open: open, onClose: function () { return setOpen(false); }, onOk: onAddRandomQuestion })] }));
94
94
  };
95
95
  exports.default = RandomQuestion;
@@ -138,7 +138,9 @@ var QuestionUpdate = function () {
138
138
  // 职场能力中不参与AI分析的提交时,过滤掉
139
139
  var newAiAbilities = aiAbilities
140
140
  .map(function (i) {
141
+ var _a;
141
142
  i.isNotCompute = true;
143
+ i.child = (_a = i.child) === null || _a === void 0 ? void 0 : _a.map(function (v) { return (__assign(__assign({}, v), { weight: Number(v.weight) || 0 })); });
142
144
  if (i.type === 6) {
143
145
  var extra_1 = {};
144
146
  var extraJson = JSON.parse(i.extra);
@@ -271,7 +273,6 @@ var QuestionUpdate = function () {
271
273
  else {
272
274
  curAiAbilities.unshift(CurWorkPlaceAiAbility);
273
275
  }
274
- console.log('curAiAbilities', curAiAbilities, inInit);
275
276
  updateAiAbilities(curAiAbilities, inInit);
276
277
  }, [questionCollectionList, aiAbilities, updateAiAbilities]);
277
278
  var handleCategoryChange = (0, react_1.useCallback)(function (value) {
@@ -11,6 +11,7 @@ export declare const useAiAnalysisStore: (depsFn?: import("hox/es/types").DepsFn
11
11
  updateState: (params: Partial<AnalysisStateParams>) => void;
12
12
  updateAiAbilities: (data: AiAbilityItem[], inInit?: any) => void;
13
13
  updateAiAbilitiesWeight: (value: string, index: number) => void;
14
+ updateAiAbilitiesChildWeight: (value: string, index: number, childIndex: number) => void;
14
15
  removeAiAbilities: (index: number) => void;
15
16
  updateWorkplaces: (data: WorkplaceItem[]) => void;
16
17
  setKeyPointAnalysisError: import("react").Dispatch<import("react").SetStateAction<number[]>>;
@@ -22,6 +23,7 @@ export declare const useAiAnalysisStore: (depsFn?: import("hox/es/types").DepsFn
22
23
  updateState: (params: Partial<AnalysisStateParams>) => void;
23
24
  updateAiAbilities: (data: AiAbilityItem[], inInit?: any) => void;
24
25
  updateAiAbilitiesWeight: (value: string, index: number) => void;
26
+ updateAiAbilitiesChildWeight: (value: string, index: number, childIndex: number) => void;
25
27
  removeAiAbilities: (index: number) => void;
26
28
  updateWorkplaces: (data: WorkplaceItem[]) => void;
27
29
  setKeyPointAnalysisError: import("react").Dispatch<import("react").SetStateAction<number[]>>;
@@ -133,6 +133,30 @@ exports.useAiAnalysisStore = (_a = __read((0, hox_1.createStore)(function () {
133
133
  computeWeight(newAiAbilities);
134
134
  }
135
135
  }, [aiAbilities, computeWeight]);
136
+ var updateAiAbilitiesChildWeight = (0, react_1.useCallback)(function (value, index, childIndex) {
137
+ var _a, _b, _c;
138
+ var formatValue = (0, utils_1.formatNumberDecimal)(value);
139
+ var child = aiAbilities[index].child;
140
+ var curOriginalWeight = Number(child === null || child === void 0 ? void 0 : child[childIndex].weight);
141
+ var disabledWeight = Number(child === null || child === void 0 ? void 0 : child[(child === null || child === void 0 ? void 0 : child.length) - 1].weight);
142
+ var maxInputValue = (0, utils_1.computeDecimalValue)((curOriginalWeight + disabledWeight).toString());
143
+ if (Number(formatValue) <= maxInputValue) {
144
+ var childLength = (child === null || child === void 0 ? void 0 : child.length) || 0;
145
+ // 如果 child 的长度大于 2,则修改最后一个子项的 weight
146
+ var updateLastChild = childLength > 1
147
+ ? (_a = {},
148
+ _a[childLength - 1] = {
149
+ weight: { $set: maxInputValue - Number(formatValue) },
150
+ },
151
+ _a) : {};
152
+ var newAiAbilities = (0, immutability_helper_1.default)(aiAbilities, (_b = {},
153
+ _b[index] = {
154
+ child: __assign((_c = {}, _c[childIndex] = { weight: { $set: formatValue } }, _c), updateLastChild),
155
+ },
156
+ _b));
157
+ setAiAbilities(newAiAbilities);
158
+ }
159
+ }, [aiAbilities]);
136
160
  /**
137
161
  * 删除AI分析维度
138
162
  */
@@ -172,6 +196,7 @@ exports.useAiAnalysisStore = (_a = __read((0, hox_1.createStore)(function () {
172
196
  updateState: updateState,
173
197
  updateAiAbilities: updateAiAbilities,
174
198
  updateAiAbilitiesWeight: updateAiAbilitiesWeight,
199
+ updateAiAbilitiesChildWeight: updateAiAbilitiesChildWeight,
175
200
  removeAiAbilities: removeAiAbilities,
176
201
  updateWorkplaces: updateWorkplaces,
177
202
  setKeyPointAnalysisError: setKeyPointAnalysisError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eli-video-interview",
3
- "version": "1.2.42-alpha.44",
3
+ "version": "1.2.42-alpha.46",
4
4
  "description": "鳄梨科技 AI视频面试 React SDK",
5
5
  "author": "鳄梨科技",
6
6
  "license": "MIT",