eli-video-interview 1.2.29-beta.2 → 1.2.29-beta.3

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.
Files changed (85) hide show
  1. package/esm/components/BigBallSvg/styled.d.ts +2 -2
  2. package/esm/components/ScoreBigBall/styled.d.ts +1 -1
  3. package/esm/components/ScrollDialogContent/index.d.ts +1 -1
  4. package/esm/components/VideoPreview/styled.d.ts +3 -3
  5. package/esm/index.d.ts +0 -1
  6. package/esm/index.js +0 -1
  7. package/esm/modules/ai-ability/Root.js +29 -17
  8. package/esm/modules/ai-ability/components/AbilityFormItem/index.d.ts +13 -0
  9. package/esm/modules/ai-ability/components/AbilityFormItem/index.js +126 -0
  10. package/esm/modules/ai-ability/components/AddAbility/index.d.ts +4 -0
  11. package/esm/modules/ai-ability/components/AddAbility/index.js +178 -0
  12. package/esm/modules/ai-ability/components/UpdateAbility/index.d.ts +2 -2
  13. package/esm/modules/ai-ability/components/UpdateAbility/index.js +125 -21
  14. package/esm/modules/ai-ability/index.js +1 -1
  15. package/esm/modules/ai-ability/interface.d.ts +27 -0
  16. package/esm/modules/ai-ability/styled.d.ts +4 -1
  17. package/esm/modules/ai-ability/styled.js +5 -1
  18. package/esm/modules/ai-question/components/AiAnalysis/AnalysisItem.js +3 -3
  19. package/esm/modules/ai-question/components/AiAssessmentCriteria/styled.d.ts +1 -1
  20. package/esm/modules/ai-question/components/BaseAccordion/styled.d.ts +3 -3
  21. package/esm/modules/ai-question/components/BootVideo/styled.d.ts +4 -4
  22. package/esm/modules/ai-question/components/QuestionModel/styled.d.ts +1 -1
  23. package/esm/modules/ai-question/components/QuestionPreview/styled.d.ts +2 -2
  24. package/esm/modules/ai-report/components/MenuAnchor/index.d.ts +3 -3
  25. package/esm/modules/ai-report/components/MenuAnchor/index.js +103 -8
  26. package/esm/modules/ai-report/components/RankingRange/styled.d.ts +2 -2
  27. package/esm/modules/ai-report/components/ScoreReport/styled.d.ts +5 -5
  28. package/esm/modules/ai-report/components/VideoQuestion/styled.d.ts +7 -7
  29. package/esm/modules/ai-report/components/WorkPlaces/index.js +2 -3
  30. package/esm/modules/ai-report/components/WorkPlaces/styled.d.ts +4 -4
  31. package/esm/modules/ai-report/index.js +1 -0
  32. package/esm/modules/ai-report/interface.d.ts +10 -0
  33. package/esm/modules/ai-template/components/TemplateList/styled.d.ts +10 -10
  34. package/esm/modules/ai-template/components/TemplateMenu/styled.d.ts +4 -4
  35. package/esm/services/ai-ability.d.ts +12 -3
  36. package/esm/services/ai-ability.js +5 -2
  37. package/lib/components/BigBallSvg/styled.d.ts +2 -2
  38. package/lib/components/ScoreBigBall/styled.d.ts +1 -1
  39. package/lib/components/ScrollDialogContent/index.d.ts +1 -1
  40. package/lib/components/VideoPreview/styled.d.ts +3 -3
  41. package/lib/index.d.ts +0 -1
  42. package/lib/index.js +1 -3
  43. package/lib/modules/ai-ability/Root.js +29 -17
  44. package/lib/modules/ai-ability/components/AbilityFormItem/index.d.ts +13 -0
  45. package/lib/modules/ai-ability/components/AbilityFormItem/index.js +128 -0
  46. package/lib/modules/ai-ability/components/AddAbility/index.d.ts +4 -0
  47. package/lib/modules/ai-ability/components/AddAbility/index.js +183 -0
  48. package/lib/modules/ai-ability/components/UpdateAbility/index.d.ts +2 -2
  49. package/lib/modules/ai-ability/components/UpdateAbility/index.js +127 -20
  50. package/lib/modules/ai-ability/index.js +1 -1
  51. package/lib/modules/ai-ability/interface.d.ts +27 -0
  52. package/lib/modules/ai-ability/styled.d.ts +4 -1
  53. package/lib/modules/ai-ability/styled.js +5 -1
  54. package/lib/modules/ai-question/components/AiAnalysis/AnalysisItem.js +1 -1
  55. package/lib/modules/ai-question/components/AiAssessmentCriteria/styled.d.ts +1 -1
  56. package/lib/modules/ai-question/components/BaseAccordion/styled.d.ts +3 -3
  57. package/lib/modules/ai-question/components/BootVideo/styled.d.ts +4 -4
  58. package/lib/modules/ai-question/components/QuestionModel/styled.d.ts +1 -1
  59. package/lib/modules/ai-question/components/QuestionPreview/styled.d.ts +2 -2
  60. package/lib/modules/ai-report/components/MenuAnchor/index.d.ts +3 -3
  61. package/lib/modules/ai-report/components/MenuAnchor/index.js +101 -9
  62. package/lib/modules/ai-report/components/RankingRange/styled.d.ts +2 -2
  63. package/lib/modules/ai-report/components/ScoreReport/styled.d.ts +5 -5
  64. package/lib/modules/ai-report/components/VideoQuestion/styled.d.ts +7 -7
  65. package/lib/modules/ai-report/components/WorkPlaces/index.js +1 -2
  66. package/lib/modules/ai-report/components/WorkPlaces/styled.d.ts +4 -4
  67. package/lib/modules/ai-report/index.js +1 -0
  68. package/lib/modules/ai-report/interface.d.ts +10 -0
  69. package/lib/modules/ai-template/components/TemplateList/styled.d.ts +10 -10
  70. package/lib/modules/ai-template/components/TemplateMenu/styled.d.ts +4 -4
  71. package/lib/services/ai-ability.d.ts +12 -3
  72. package/lib/services/ai-ability.js +9 -4
  73. package/package.json +1 -1
  74. package/esm/modules/ai-ability/components/UpdateAbility/interface.d.ts +0 -7
  75. package/esm/modules/ai-ability/components/UpdateAbility/interface.js +0 -1
  76. package/esm/modules/ai-report/components/MenuAnchor/MenuAnchor.d.ts +0 -4
  77. package/esm/modules/ai-report/components/MenuAnchor/MenuAnchor.js +0 -106
  78. package/esm/modules/ai-report/components/MenuAnchor/interface.d.ts +0 -10
  79. package/esm/modules/ai-report/components/MenuAnchor/interface.js +0 -1
  80. package/lib/modules/ai-ability/components/UpdateAbility/interface.d.ts +0 -7
  81. package/lib/modules/ai-ability/components/UpdateAbility/interface.js +0 -2
  82. package/lib/modules/ai-report/components/MenuAnchor/MenuAnchor.d.ts +0 -4
  83. package/lib/modules/ai-report/components/MenuAnchor/MenuAnchor.js +0 -108
  84. package/lib/modules/ai-report/components/MenuAnchor/interface.d.ts +0 -10
  85. package/lib/modules/ai-report/components/MenuAnchor/interface.js +0 -2
@@ -0,0 +1,183 @@
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ return new (P || (P = Promise))(function (resolve, reject) {
16
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20
+ });
21
+ };
22
+ var __generator = (this && this.__generator) || function (thisArg, body) {
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
+ function verb(n) { return function (v) { return step([n, v]); }; }
26
+ function step(op) {
27
+ if (f) throw new TypeError("Generator is already executing.");
28
+ while (_) try {
29
+ 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;
30
+ if (y = 0, t) op = [op[0] & 2, t.value];
31
+ switch (op[0]) {
32
+ case 0: case 1: t = op; break;
33
+ case 4: _.label++; return { value: op[1], done: false };
34
+ case 5: _.label++; y = op[1]; op = [0]; continue;
35
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
+ default:
37
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
+ if (t[2]) _.ops.pop();
42
+ _.trys.pop(); continue;
43
+ }
44
+ op = body.call(thisArg, _);
45
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
+ }
48
+ };
49
+ var __importDefault = (this && this.__importDefault) || function (mod) {
50
+ return (mod && mod.__esModule) ? mod : { "default": mod };
51
+ };
52
+ Object.defineProperty(exports, "__esModule", { value: true });
53
+ var jsx_runtime_1 = require("react/jsx-runtime");
54
+ var AbilityFormItem_1 = __importDefault(require("../AbilityFormItem"));
55
+ var ai_ability_1 = require("../../../../services/ai-ability");
56
+ var ahooks_1 = require("ahooks");
57
+ var fbm_ui_1 = require("fbm-ui");
58
+ var react_1 = require("react");
59
+ var AddAbility = function (props) {
60
+ var open = props.open, _a = props.name, name = _a === void 0 ? '' : _a, _b = props.type, type = _b === void 0 ? 3 : _b, token = props.token, onClose = props.onClose, onSuccess = props.onSuccess;
61
+ var _c = (0, react_1.useState)(''), value = _c[0], setValue = _c[1];
62
+ var _d = (0, react_1.useState)(1), step = _d[0], setStep = _d[1];
63
+ var _e = (0, react_1.useState)(false), stepLoading = _e[0], setStepLoading = _e[1];
64
+ var initialValues = {
65
+ workPlaceItems: [
66
+ {
67
+ name: '能力定义',
68
+ type: 1,
69
+ answer: '',
70
+ },
71
+ {
72
+ name: '次表现-优秀表现',
73
+ type: 2,
74
+ answer: '',
75
+ },
76
+ {
77
+ name: '优次表现-较差表现',
78
+ type: 3,
79
+ answer: '',
80
+ },
81
+ {
82
+ name: '考察建议-面试题目',
83
+ type: 4,
84
+ answer: '',
85
+ },
86
+ {
87
+ name: '考察建议-评分关键点',
88
+ type: 5,
89
+ answer: '',
90
+ },
91
+ ],
92
+ };
93
+ var _f = (0, react_1.useState)(initialValues.workPlaceItems), workPlaceItems = _f[0], setWorkPlaceItems = _f[1];
94
+ var _g = (0, ahooks_1.useRequest)(ai_ability_1.PostQuestionCollectionUpsert, {
95
+ manual: true,
96
+ onSuccess: function () {
97
+ fbm_ui_1.Message.success('新增能力成功');
98
+ onClose();
99
+ onSuccess();
100
+ },
101
+ }), run = _g.run, loading = _g.loading;
102
+ var nameTextField = (0, fbm_ui_1.useTextField)({
103
+ value: value,
104
+ label: '能力名称',
105
+ required: true,
106
+ rules: [
107
+ {
108
+ required: true,
109
+ message: '请输入能力名称',
110
+ },
111
+ ],
112
+ onChange: function (e) { return setValue(e.target.value); },
113
+ max: 7,
114
+ sx: {
115
+ height: '48px',
116
+ width: '320px',
117
+ marginTop: '16px',
118
+ },
119
+ });
120
+ var handleStep = (0, react_1.useCallback)(function () { return __awaiter(void 0, void 0, void 0, function () {
121
+ var error;
122
+ return __generator(this, function (_a) {
123
+ switch (_a.label) {
124
+ case 0: return [4 /*yield*/, nameTextField.handleValidate()];
125
+ case 1:
126
+ error = _a.sent();
127
+ if (!error) {
128
+ setStepLoading(true);
129
+ setTimeout(function () {
130
+ setStep(2);
131
+ setStepLoading(false);
132
+ }, 300);
133
+ }
134
+ return [2 /*return*/];
135
+ }
136
+ });
137
+ }); }, [nameTextField]);
138
+ var handleValue = (0, react_1.useCallback)(function (v) {
139
+ var index = workPlaceItems.findIndex(function (ele) { return ele.type === v.type; });
140
+ workPlaceItems.splice(index, 1, v);
141
+ var list = workPlaceItems;
142
+ console.log(v, list);
143
+ setWorkPlaceItems(list);
144
+ }, [workPlaceItems]);
145
+ var handleOk = (0, react_1.useCallback)(function () { return __awaiter(void 0, void 0, void 0, function () {
146
+ var error, avocadoConfig;
147
+ return __generator(this, function (_a) {
148
+ console.log(workPlaceItems);
149
+ error = workPlaceItems.some(function (v) { return v.items.length === 0; });
150
+ if (!error) {
151
+ avocadoConfig = window['AvocadoVideoInterviewConfig'];
152
+ run({
153
+ name: value,
154
+ tag: value,
155
+ token: token,
156
+ type: type,
157
+ workPlaceItems: workPlaceItems,
158
+ mateData: {
159
+ account: avocadoConfig === null || avocadoConfig === void 0 ? void 0 : avocadoConfig.account,
160
+ enterpriseId: avocadoConfig === null || avocadoConfig === void 0 ? void 0 : avocadoConfig.enterpriseId,
161
+ },
162
+ });
163
+ }
164
+ return [2 /*return*/];
165
+ });
166
+ }); }, [run, type, token, value, workPlaceItems]);
167
+ var footer = (0, react_1.useCallback)(function () {
168
+ return step === 1 ? ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", justifyContent: "flex-end", padding: "12px 16px" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ sx: { mr: 1, fontWeight: 400 }, variant: "text", color: "inherit", onClick: onClose }, { children: "\u53D6\u6D88" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ loading: stepLoading, onClick: handleStep }, { children: "\u4E0B\u4E00\u6B65" }))] }))) : ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", justifyContent: "space-between", padding: "12px 16px" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "outlined", color: "inherit", onClick: function () { return setStep(1); } }, { children: "\u4E0A\u4E00\u6B65" })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ sx: { mr: 1, fontWeight: 400 }, variant: "text", color: "inherit", onClick: onClose }, { children: "\u53D6\u6D88" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ loading: loading, onClick: handleOk }, { children: "\u65B0\u589E" }))] }))] })));
169
+ }, [step, loading, stepLoading, handleStep, setStep, handleOk, onClose]);
170
+ (0, react_1.useEffect)(function () {
171
+ setValue(name);
172
+ }, [name]);
173
+ (0, react_1.useEffect)(function () {
174
+ if (!open) {
175
+ setValue('');
176
+ setStep(1);
177
+ nameTextField.setError();
178
+ }
179
+ // eslint-disable-next-line react-hooks/exhaustive-deps
180
+ }, [open]);
181
+ return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Drawer, __assign({ className: "abilityDrawer", title: '新增能力', open: open, footer: footer, onClose: onClose }, { children: step === 1 ? ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ style: { width: '556px' } }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "secondary" }, { children: "\u4F7F\u7528\u901A\u7528\u7684\u80FD\u529B\u540D\u79F0\uFF08\u4F8B\u5982\uFF1A\u9886\u5BFC\u529B\u3001\u5E94\u53D8\u80FD\u529B\u7B49\u5E38\u89C1\u8003\u6838\u9879\uFF09\u547D\u540D\u6709\u52A9\u4E8E\u63D0\u9AD8 AI \u8BC4\u4EF7\u53CA\u8BC4\u5206\u51C6\u786E\u6027\u3002" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.TextField, __assign({}, nameTextField))] }))) : ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ style: { width: '556px' } }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body1", fontWeight: "medium", mb: 2 }, { children: "\u80FD\u529B\u6807\u51C6" })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "secondary", mb: 2 }, { children: ["\u6839\u636E\u60A8\u8F93\u5165\u7684\u80FD\u529B\u540D\u79F0\u300C", (0, jsx_runtime_1.jsx)("span", __assign({ style: { color: '#4CAF50', fontWeight: '500' } }, { children: value })), "\u300D\uFF0C\u5E2E\u60A8\u81EA\u52A8\u751F\u6210\u5173\u4E8E\u8BE5\u80FD\u529B\u7684\u5B9A\u4E49\u5185\u5BB9\u3001\u4F18\u6B21\u8868\u73B0\u4EE5\u53CA\u8003\u5BDF\u5EFA\u8BAE\u5185\u5BB9\uFF0C\u786E\u5B9A\u540E\u5C06\u4F1A\u6309\u7167\u8BE5\u6807\u51C6\u751F\u6210AI\u62A5\u544A\u3002"] })), initialValues.workPlaceItems.map(function (v) { return ((0, jsx_runtime_1.jsx)(AbilityFormItem_1.default, { name: value, title: v.name, type: v.type, answer: v.answer, mode: "edit", canReplace: true, onChange: handleValue }, v.type)); })] }))) })));
182
+ };
183
+ exports.default = AddAbility;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { UpdateAbilityProps } from './interface';
3
- declare const UpdateAbility: React.FC<UpdateAbilityProps>;
2
+ import { AbilityProps } from '../../interface';
3
+ declare const UpdateAbility: React.FC<AbilityProps>;
4
4
  export default UpdateAbility;
@@ -46,23 +46,84 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
46
46
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
47
  }
48
48
  };
49
+ var __importDefault = (this && this.__importDefault) || function (mod) {
50
+ return (mod && mod.__esModule) ? mod : { "default": mod };
51
+ };
49
52
  Object.defineProperty(exports, "__esModule", { value: true });
50
53
  var jsx_runtime_1 = require("react/jsx-runtime");
51
- var react_1 = require("react");
52
- var fbm_ui_1 = require("fbm-ui");
53
- var ahooks_1 = require("ahooks");
54
+ var AbilityFormItem_1 = __importDefault(require("../AbilityFormItem"));
54
55
  var ai_ability_1 = require("../../../../services/ai-ability");
56
+ var ahooks_1 = require("ahooks");
57
+ var fbm_ui_1 = require("fbm-ui");
58
+ var react_1 = require("react");
59
+ var initialValues = {
60
+ workPlaceItems: [
61
+ {
62
+ name: '能力定义',
63
+ type: 1,
64
+ answer: '',
65
+ items: [],
66
+ },
67
+ {
68
+ name: '次表现-优秀表现',
69
+ type: 2,
70
+ answer: '',
71
+ items: [],
72
+ },
73
+ {
74
+ name: '优次表现-较差表现',
75
+ type: 3,
76
+ answer: '',
77
+ items: [],
78
+ },
79
+ {
80
+ name: '考察建议-面试题目',
81
+ type: 4,
82
+ answer: '',
83
+ items: [],
84
+ },
85
+ {
86
+ name: '考察建议-评分关键点',
87
+ type: 5,
88
+ answer: '',
89
+ items: [],
90
+ },
91
+ ],
92
+ };
55
93
  var UpdateAbility = function (props) {
56
- var open = props.open, _a = props.name, name = _a === void 0 ? '' : _a, token = props.token, onClose = props.onClose, onSuccess = props.onSuccess;
57
- var _b = (0, react_1.useState)(''), value = _b[0], setValue = _b[1];
58
- var _c = (0, ahooks_1.useRequest)(ai_ability_1.PostQuestionCollectionUpsert, {
94
+ var open = props.open, _a = props.type, type = _a === void 0 ? 1 : _a, isWorkplace = props.isWorkplace, _b = props.name, name = _b === void 0 ? '' : _b, token = props.token, onClose = props.onClose, onSuccess = props.onSuccess;
95
+ var _c = (0, react_1.useState)(''), value = _c[0], setValue = _c[1];
96
+ var _d = (0, react_1.useState)(1), step = _d[0], setStep = _d[1];
97
+ var _e = (0, react_1.useState)('show'), mode = _e[0], setMode = _e[1];
98
+ var firstLoad = (0, react_1.useRef)(true);
99
+ var _f = (0, react_1.useState)(false), showAiDefineDetail = _f[0], setShowAiDefineDetail = _f[1];
100
+ // const [submitDisabled, setSubmitDisabled] = useState<boolean>(true);
101
+ var _g = (0, react_1.useState)(initialValues.workPlaceItems), workPlaceItems = _g[0], setWorkPlaceItems = _g[1];
102
+ var _h = (0, ahooks_1.useRequest)(ai_ability_1.PostQuestionCollectionUpsert, {
59
103
  manual: true,
60
104
  onSuccess: function () {
61
- fbm_ui_1.Message.success("".concat(token ? '编辑' : '新增', "\u80FD\u529B\u6210\u529F"));
105
+ fbm_ui_1.Message.success("\u7F16\u8F91\u80FD\u529B\u6210\u529F");
62
106
  onClose();
63
107
  onSuccess();
64
108
  },
65
- }), run = _c.run, loading = _c.loading;
109
+ }), run = _h.run, loading = _h.loading;
110
+ var getAbilityDetail = (0, ahooks_1.useRequest)(ai_ability_1.GetAbilityDetail, {
111
+ manual: true,
112
+ onSuccess: function (_a) {
113
+ var _b, _c;
114
+ var list = _a.data.list;
115
+ if (list.length) {
116
+ var res = (_c = (_b = list[0]) === null || _b === void 0 ? void 0 : _b.workPlaceItems) === null || _c === void 0 ? void 0 : _c.map(function (element) {
117
+ return __assign(__assign({}, element), { answer: element.items[0] || '' });
118
+ });
119
+ firstLoad.current = false;
120
+ if (res === null || res === void 0 ? void 0 : res.length) {
121
+ setWorkPlaceItems(res);
122
+ }
123
+ setShowAiDefineDetail(true);
124
+ }
125
+ },
126
+ }).run;
66
127
  var nameTextField = (0, fbm_ui_1.useTextField)({
67
128
  value: value,
68
129
  label: '能力名称',
@@ -77,41 +138,87 @@ var UpdateAbility = function (props) {
77
138
  max: 7,
78
139
  sx: {
79
140
  height: '48px',
141
+ width: '320px',
142
+ marginTop: '16px',
80
143
  },
81
144
  });
145
+ var handleValue = (0, react_1.useCallback)(function (v) {
146
+ var index = workPlaceItems.findIndex(function (ele) { return ele.type === v.type; });
147
+ workPlaceItems.splice(index, 1, v);
148
+ var list = workPlaceItems;
149
+ setWorkPlaceItems(list);
150
+ }, [workPlaceItems]);
82
151
  var handleOk = (0, react_1.useCallback)(function () { return __awaiter(void 0, void 0, void 0, function () {
83
- var error, avocadoConfig;
152
+ var error, workPlaceItemsError, avocadoConfig;
84
153
  return __generator(this, function (_a) {
85
154
  switch (_a.label) {
86
155
  case 0: return [4 /*yield*/, nameTextField.handleValidate()];
87
156
  case 1:
88
157
  error = _a.sent();
158
+ workPlaceItemsError = workPlaceItems.some(function (v) { return v.items.length === 0; });
89
159
  if (!error) {
90
160
  avocadoConfig = window['AvocadoVideoInterviewConfig'];
91
- run({
92
- name: value,
93
- tag: value,
94
- token: token,
95
- mateData: {
96
- account: avocadoConfig === null || avocadoConfig === void 0 ? void 0 : avocadoConfig.account,
97
- enterpriseId: avocadoConfig === null || avocadoConfig === void 0 ? void 0 : avocadoConfig.enterpriseId,
98
- },
99
- });
161
+ // 旧自定义能力
162
+ if (type === 3 && !isWorkplace) {
163
+ run({
164
+ name: value,
165
+ tag: value,
166
+ token: token,
167
+ mateData: {
168
+ account: avocadoConfig === null || avocadoConfig === void 0 ? void 0 : avocadoConfig.account,
169
+ enterpriseId: avocadoConfig === null || avocadoConfig === void 0 ? void 0 : avocadoConfig.enterpriseId,
170
+ },
171
+ });
172
+ }
173
+ else if (!workPlaceItemsError) {
174
+ // 职场能力
175
+ run({
176
+ name: value,
177
+ tag: value,
178
+ token: token,
179
+ workPlaceItems: workPlaceItems,
180
+ mateData: {
181
+ account: avocadoConfig === null || avocadoConfig === void 0 ? void 0 : avocadoConfig.account,
182
+ enterpriseId: avocadoConfig === null || avocadoConfig === void 0 ? void 0 : avocadoConfig.enterpriseId,
183
+ },
184
+ });
185
+ }
100
186
  }
101
187
  return [2 /*return*/];
102
188
  }
103
189
  });
104
- }); }, [nameTextField, run, token, value]);
190
+ }); }, [nameTextField, run, token, value, isWorkplace, type, workPlaceItems]);
191
+ var footer = (0, react_1.useCallback)(function () {
192
+ return step === 1 ? ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ display: "flex", padding: "12px 16px" }, { children: type === 1 ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {})) : ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "outlined", color: "inherit", onClick: function () { return setStep(2); } }, { children: "\u7F16\u8F91" }))) }))) : ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ display: "flex", justifyContent: "flex-end", padding: "12px 16px" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ sx: { mr: 1, fontWeight: 400 }, variant: "text", color: "inherit", onClick: onClose }, { children: "\u53D6\u6D88" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ loading: loading, onClick: handleOk }, { children: "\u4FDD\u5B58" }))] })));
193
+ }, [type, step, loading, setStep, handleOk, onClose]);
105
194
  (0, react_1.useEffect)(function () {
106
195
  setValue(name);
107
196
  }, [name]);
108
197
  (0, react_1.useEffect)(function () {
109
198
  if (!open) {
110
199
  setValue('');
200
+ setWorkPlaceItems([]);
201
+ setStep(1);
111
202
  nameTextField.setError();
112
203
  }
113
204
  // eslint-disable-next-line react-hooks/exhaustive-deps
114
205
  }, [open]);
115
- return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Dialog, __assign({ title: token ? '编辑能力' : '新增能力', open: open, okText: token ? '保存' : '新建', okProps: { loading: loading }, onClose: onClose, onOk: handleOk }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.TextField, __assign({}, nameTextField)) })));
206
+ (0, react_1.useEffect)(function () {
207
+ setMode(step === 1 ? 'show' : 'edit');
208
+ }, [step]);
209
+ (0, react_1.useEffect)(function () {
210
+ if (type === 3 && !isWorkplace)
211
+ return;
212
+ if (token) {
213
+ setShowAiDefineDetail(false);
214
+ getAbilityDetail({ tokens: [token] });
215
+ }
216
+ // eslint-disable-next-line react-hooks/exhaustive-deps
217
+ }, [token, name]);
218
+ (0, react_1.useEffect)(function () {
219
+ setWorkPlaceItems(workPlaceItems);
220
+ }, [workPlaceItems, setWorkPlaceItems]);
221
+ return ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Drawer, __assign({ className: "abilityDrawer", title: '能力详情', open: open, footer: footer, onClose: onClose }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ style: { width: '556px' } }, { children: step === 1 ? ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body1", fontWeight: "medium" }, { children: ["\u80FD\u529B\u540D\u79F0\uFF1A", value] }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "secondary" }, { children: "\u4F7F\u7528\u901A\u7528\u7684\u80FD\u529B\u540D\u79F0\uFF08\u4F8B\u5982\uFF1A\u9886\u5BFC\u529B\u3001\u5E94\u53D8\u80FD\u529B\u7B49\u5E38\u89C1\u8003\u6838\u9879\uFF09\u547D\u540D\u6709\u52A9\u4E8E\u63D0\u9AD8 AI \u8BC4\u4EF7\u53CA\u8BC4\u5206\u51C6\u786E\u6027\u3002" })), (0, jsx_runtime_1.jsx)(fbm_ui_1.TextField, __assign({}, nameTextField))] })) })), !(type === 3 && !isWorkplace) && ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ style: { width: '556px' } }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Divider, { style: { margin: '24px 0' } }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body1", fontWeight: "medium", mb: 2 }, { children: "\u80FD\u529B\u6807\u51C6" })), showAiDefineDetail &&
222
+ workPlaceItems.map(function (v) { return ((0, jsx_runtime_1.jsx)(AbilityFormItem_1.default, { token: token, name: value, title: v.name, type: v.type, answer: v.answer, mode: mode, canReplace: mode === 'edit' ? true : false, onChange: handleValue }, v.type)); })] })))] })));
116
223
  };
117
224
  exports.default = UpdateAbility;
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  var jsx_runtime_1 = require("react/jsx-runtime");
7
- var RootProvider_1 = __importDefault(require("../../components/RootProvider"));
8
7
  var Root_1 = __importDefault(require("./Root"));
8
+ var RootProvider_1 = __importDefault(require("../../components/RootProvider"));
9
9
  var AiAbility = function () {
10
10
  return ((0, jsx_runtime_1.jsx)(RootProvider_1.default, { children: (0, jsx_runtime_1.jsx)(Root_1.default, {}) }));
11
11
  };
@@ -5,7 +5,9 @@ export interface QuestionCollectionList {
5
5
  type: 1 | 3;
6
6
  sort: number;
7
7
  updatedAt: number;
8
+ used: boolean;
8
9
  isWorkplace: boolean;
10
+ workPlaceItems?: AiDefineItem[];
9
11
  }
10
12
  export interface QuestionCollectionListData {
11
13
  list: QuestionCollectionList[];
@@ -14,3 +16,28 @@ export interface QuestionCollectionListData {
14
16
  export interface QuestionCollectionListRes {
15
17
  data: QuestionCollectionListData;
16
18
  }
19
+ export interface AbilityProps {
20
+ open: boolean;
21
+ type: number;
22
+ isWorkplace?: boolean;
23
+ name?: string;
24
+ token?: string;
25
+ onClose: () => void;
26
+ onSuccess: () => void;
27
+ }
28
+ export interface AiDefineItem {
29
+ name: string;
30
+ type: number;
31
+ answer?: string;
32
+ items: string[];
33
+ }
34
+ export interface AiDefineData {
35
+ total: number;
36
+ list: AiDefineItem[];
37
+ }
38
+ export interface AiDefineRes {
39
+ data: AiDefineData;
40
+ }
41
+ export interface AbilityDetailRes {
42
+ data: AiDefineData;
43
+ }
@@ -1,4 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  export declare const AbilityRoot: import("@emotion/styled").StyledComponent<import("fbm-ui/lib/components/Box").BoxProps & {
3
3
  children?: import("react").ReactNode;
4
- } & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
4
+ } & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
5
+ export declare const AbilityDrawer: import("@emotion/styled").StyledComponent<import("fbm-ui").DrawerProps & {
6
+ children?: import("react").ReactNode;
7
+ } & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -1,9 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AbilityRoot = void 0;
3
+ exports.AbilityDrawer = exports.AbilityRoot = void 0;
4
4
  var fbm_ui_1 = require("fbm-ui");
5
5
  exports.AbilityRoot = (0, fbm_ui_1.styled)(fbm_ui_1.Box)({
6
6
  width: '100%',
7
7
  height: '100%',
8
8
  overflow: 'auto',
9
9
  });
10
+ exports.AbilityDrawer = (0, fbm_ui_1.styled)(fbm_ui_1.Drawer)({
11
+ boxSizing: 'border-box',
12
+ width: '588px',
13
+ });
@@ -44,6 +44,6 @@ var AnalysisItem = function (props) {
44
44
  var value = _a.target.value;
45
45
  updateAiAbilitiesWeight(value, index);
46
46
  }, [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({ 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 })] }));
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.jsxs)(jsx_runtime_1.Fragment, { children: [abilityType === 2 && isWorkplace && (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) }, { 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 })] }));
48
48
  };
49
49
  exports.default = AnalysisItem;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  export declare const ListItem: import("@emotion/styled").StyledComponent<import("fbm-ui/lib/components/Box").BoxProps & {
3
3
  children?: import("react").ReactNode;
4
- } & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
4
+ } & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -1,10 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  export declare const AccordionRoot: import("@emotion/styled").StyledComponent<import("fbm-ui/lib/components/Box").BoxProps & {
3
3
  children?: import("react").ReactNode;
4
- } & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
4
+ } & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
5
5
  export declare const AccordionTitle: import("@emotion/styled").StyledComponent<import("fbm-ui/lib/components/Typography").TypographyProps & {
6
6
  children?: import("react").ReactNode;
7
- } & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
7
+ } & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
8
8
  export declare const AccordionSubTitle: import("@emotion/styled").StyledComponent<import("fbm-ui/lib/components/Typography").TypographyProps & {
9
9
  children?: import("react").ReactNode;
10
- } & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
10
+ } & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -1,13 +1,13 @@
1
1
  /// <reference types="react" />
2
2
  export declare const CustomUploadCardRoot: import("@emotion/styled").StyledComponent<import("fbm-ui/lib/components/Box").BoxProps & {
3
3
  children?: import("react").ReactNode;
4
- } & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
4
+ } & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
5
5
  export declare const CustomUploadCardTitle: import("@emotion/styled").StyledComponent<import("fbm-ui/lib/components/Box").BoxProps & {
6
6
  children?: import("react").ReactNode;
7
- } & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
7
+ } & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
8
8
  export declare const CustomUploadButtonRoot: import("@emotion/styled").StyledComponent<import("fbm-ui/lib/components/Box").BoxProps & {
9
9
  children?: import("react").ReactNode;
10
- } & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
10
+ } & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
11
11
  export declare const CustomUploadedImgRoot: import("@emotion/styled").StyledComponent<import("fbm-ui/lib/components/Box").BoxProps & {
12
12
  children?: import("react").ReactNode;
13
- } & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
13
+ } & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  export declare const QuestionModelRoot: import("@emotion/styled").StyledComponent<import("fbm-ui/lib/components/Box").BoxProps & {
3
3
  children?: import("react").ReactNode;
4
- } & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
4
+ } & import("@mui/system/createStyled").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -4,8 +4,8 @@ export declare const PreviewRoot: import("@emotion/styled").StyledComponent<{
4
4
  classes?: Partial<import("fbm-ui/lib/mui").PaperClasses> | undefined;
5
5
  elevation?: number | undefined;
6
6
  square?: boolean | undefined;
7
- sx?: import("@mui/system").SxProps<import("fbm-ui/lib/mui").Theme> | undefined;
7
+ sx?: import("@mui/system/styleFunctionSx").SxProps<import("fbm-ui/lib/mui").Theme> | undefined;
8
8
  variant?: "elevation" | "outlined" | undefined;
9
9
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
10
10
  ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
11
- }, "children" | keyof import("@mui/material/OverridableComponent").CommonProps | "sx" | "elevation" | "variant" | "square"> & import("@mui/system").MUIStyledCommonProps<import("fbm-ui/lib/mui").Theme>, {}, {}>;
11
+ }, "children" | keyof import("@mui/material/OverridableComponent").CommonProps | "sx" | "elevation" | "variant" | "square"> & import("@mui/system/createStyled").MUIStyledCommonProps<import("fbm-ui/lib/mui").Theme>, {}, {}>;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
2
- import { MenuAnchorProps } from './interface';
3
- declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<MenuAnchorProps & import("react").RefAttributes<any>>>;
1
+ import { MenuAnchorProps } from '../../interface';
2
+ import React from 'react';
3
+ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<MenuAnchorProps & React.RefAttributes<any>>>;
4
4
  export default _default;