eli-video-interview 1.2.32 → 1.2.33

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.
@@ -142,6 +142,6 @@ var AiAbilityRoot = function () {
142
142
  },
143
143
  },
144
144
  ];
145
- return (_jsxs(AbilityRoot, { children: [AddAbilityOpen && _jsx(AddAbility, __assign({}, state, { open: AddAbilityOpen, onClose: handleClose, onSuccess: getList })), UpdateAbilityOpen && _jsx(UpdateAbility, __assign({}, state, { open: UpdateAbilityOpen, onClose: handleClose, onSuccess: getList })), _jsx(Header, { title: "\u8003\u5BDF\u80FD\u529B\u7BA1\u7406", renderAction: function () { return (_jsx(Button, __assign({ icon: _jsx(AddIcon, {}), onClick: handleAdd }, { children: "\u65B0\u589E\u80FD\u529B" }))); } }), _jsx(Box, __assign({ mt: 2, border: "1px solid rgba(0, 0, 0, 0.08)", borderRadius: 0.5, overflow: "hidden" }, { children: _jsx(Table, { emptyText: "\u6682\u65E0\u6570\u636E", loading: listLoading, data: data === null || data === void 0 ? void 0 : data.data.list, columns: columns }) }))] }));
145
+ return (_jsxs(AbilityRoot, { children: [AddAbilityOpen && _jsx(AddAbility, __assign({}, state, { open: AddAbilityOpen, onClose: handleClose, onSuccess: getList })), UpdateAbilityOpen && _jsx(UpdateAbility, __assign({}, state, { open: UpdateAbilityOpen, onClose: handleClose, onSuccess: getList })), _jsx(Header, { title: "\u8003\u5BDF\u80FD\u529B\u7BA1\u7406", renderAction: function () { return (_jsx(Button, __assign({ icon: _jsx(AddIcon, {}), onClick: handleAdd }, { children: "\u65B0\u589E\u80FD\u529B" }))); } }), _jsx(Box, __assign({ mt: 2, border: "1px solid rgba(0, 0, 0, 0.08)", borderRadius: 0.5, overflow: "hidden" }, { children: _jsx(Table, { emptyText: "\u6682\u65E0\u6570\u636E", nameText: "\u8003\u5BDF\u80FD\u529B", loading: listLoading, data: data === null || data === void 0 ? void 0 : data.data.list, columns: columns }) }))] }));
146
146
  };
147
147
  export default AiAbilityRoot;
@@ -98,7 +98,7 @@ var AbilityFormItem = function (_a) {
98
98
  rows: 3,
99
99
  multiline: true,
100
100
  sx: {
101
- marginBottom: '32px',
101
+ marginBottom: '43px',
102
102
  },
103
103
  });
104
104
  useEffect(function () {
@@ -124,6 +124,6 @@ var AbilityFormItem = function (_a) {
124
124
  });
125
125
  // eslint-disable-next-line react-hooks/exhaustive-deps
126
126
  }, [type, name, token]);
127
- return (_jsxs(Stack, { children: [_jsxs(Stack, __assign({ style: { marginBottom: '18px' }, direction: "row", alignItems: "center", justifyContent: "space-between" }, { children: [_jsx(Typography, __assign({ variant: "body2", fontWeight: "medium" }, { children: title })), canReplace && (_jsx(Button, __assign({ loading: loading, onClick: handleReplace, variant: "outlined", color: "inherit", size: "small", icon: _jsx(RefreshIcon, {}) }, { children: loading ? '生成中' : '换一换' })))] })), internalMode === 'edit' && (_jsx(Box, __assign({ width: 1, pr: 2 }, { children: _jsx(TextField, __assign({}, nameTextField)) }))), internalMode === 'show' && (_jsx(Box, __assign({ style: { marginTop: '-8px', marginBottom: '24px' } }, { children: _jsx(Typography, __assign({ variant: "body2", sx: { whiteSpace: 'pre-wrap', color: 'RGBA(0, 0, 0, 0.56)' } }, { children: content })) })))] }));
127
+ return (_jsxs(Stack, { children: [_jsxs(Stack, __assign({ style: { marginBottom: '18px' }, direction: "row", alignItems: "center", justifyContent: "space-between" }, { children: [_jsx(Typography, __assign({ variant: "body2", fontWeight: "medium" }, { children: title })), canReplace && (_jsx(Button, __assign({ loading: loading, onClick: handleReplace, variant: "outlined", color: "inherit", size: "small", icon: _jsx(RefreshIcon, {}) }, { children: loading ? '生成中' : '换一换' })))] })), internalMode === 'edit' && (_jsx(Box, __assign({ width: 1 }, { children: _jsx(TextField, __assign({}, nameTextField)) }))), internalMode === 'show' && (_jsx(Box, __assign({ style: { marginTop: '-8px', marginBottom: '32px' } }, { children: _jsx(Typography, __assign({ variant: "body2", sx: { whiteSpace: 'pre-wrap', color: 'RGBA(0, 0, 0, 0.56)' } }, { children: content })) })))] }));
128
128
  };
129
129
  export default AbilityFormItem;
@@ -47,7 +47,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
47
47
  };
48
48
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
49
49
  import AbilityFormItem from '../AbilityFormItem';
50
- import { PostQuestionCollectionUpsert } from "../../../../services/ai-ability";
50
+ import { CheckDuplicateCollection, PostQuestionCollectionUpsert } from "../../../../services/ai-ability";
51
51
  import { useRequest } from 'ahooks';
52
52
  import { Box, Button, Drawer, Message, TextField, Typography, useTextField } from 'fbm-ui';
53
53
  import { useCallback, useEffect, useState } from 'react';
@@ -55,7 +55,7 @@ var AddAbility = function (props) {
55
55
  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;
56
56
  var _c = useState(''), value = _c[0], setValue = _c[1];
57
57
  var _d = useState(1), step = _d[0], setStep = _d[1];
58
- var _e = useState(false), stepLoading = _e[0], setStepLoading = _e[1];
58
+ // const [stepLoading, setStepLoading] = useState<boolean>(false);
59
59
  var InitialValues = {
60
60
  workPlaceItems: [
61
61
  {
@@ -90,15 +90,27 @@ var AddAbility = function (props) {
90
90
  },
91
91
  ],
92
92
  };
93
- var _f = useState(InitialValues.workPlaceItems), workPlaceItems = _f[0], setWorkPlaceItems = _f[1];
94
- var _g = useRequest(PostQuestionCollectionUpsert, {
93
+ var _e = useState(InitialValues.workPlaceItems), workPlaceItems = _e[0], setWorkPlaceItems = _e[1];
94
+ var _f = useRequest(PostQuestionCollectionUpsert, {
95
95
  manual: true,
96
96
  onSuccess: function () {
97
97
  Message.success('新增能力成功');
98
98
  onClose();
99
99
  onSuccess();
100
100
  },
101
- }), run = _g.run, loading = _g.loading;
101
+ }), run = _f.run, loading = _f.loading;
102
+ var _g = useRequest(CheckDuplicateCollection, {
103
+ manual: true,
104
+ onSuccess: function (_a) {
105
+ var data = _a.data;
106
+ if (data.isDuplicate) {
107
+ nameTextField.setError('能力名称不能重复');
108
+ }
109
+ else {
110
+ setStep(2);
111
+ }
112
+ },
113
+ }), checkDuplicateCollection = _g.run, stepLoading = _g.loading;
102
114
  var nameTextField = useTextField({
103
115
  value: value,
104
116
  label: '能力名称',
@@ -125,16 +137,12 @@ var AddAbility = function (props) {
125
137
  case 1:
126
138
  error = _a.sent();
127
139
  if (!error) {
128
- setStepLoading(true);
129
- setTimeout(function () {
130
- setStep(2);
131
- setStepLoading(false);
132
- }, 300);
140
+ checkDuplicateCollection({ collectionName: value });
133
141
  }
134
142
  return [2 /*return*/];
135
143
  }
136
144
  });
137
- }); }, [nameTextField]);
145
+ }); }, [nameTextField, value, checkDuplicateCollection]);
138
146
  var handleValue = useCallback(function (v) {
139
147
  var index = workPlaceItems.findIndex(function (ele) { return ele.type === v.type; });
140
148
  workPlaceItems.splice(index, 1, v);
@@ -68,6 +68,12 @@ var UpdateAbility = function (props) {
68
68
  onClose();
69
69
  onSuccess();
70
70
  },
71
+ onError: function (err) {
72
+ console.log(err);
73
+ if ((err === null || err === void 0 ? void 0 : err.code) === -1211) {
74
+ nameTextField.setError('能力名称不能重复');
75
+ }
76
+ },
71
77
  }), run = _h.run, loading = _h.loading;
72
78
  var getAbilityDetail = useRequest(GetAbilityDetail, {
73
79
  manual: true,
@@ -41,3 +41,9 @@ export interface AiDefineRes {
41
41
  export interface AbilityDetailRes {
42
42
  data: AiDefineData;
43
43
  }
44
+ export interface CheckDuplicateCollectionData {
45
+ isDuplicate: boolean;
46
+ }
47
+ export interface CheckDuplicateCollectionRes {
48
+ data: CheckDuplicateCollectionData;
49
+ }
@@ -20,4 +20,5 @@ interface DiyUpsertData {
20
20
  export declare const PostQuestionCollectionUpsert: <R>(data: DiyUpsertData) => import("axios").AxiosPromise<R>;
21
21
  export declare const GetAiDefine: <R>(data: any) => import("axios").AxiosPromise<R>;
22
22
  export declare const GetAbilityDetail: <R>(data: any) => import("axios").AxiosPromise<R>;
23
+ export declare const CheckDuplicateCollection: <R>(data: any) => import("axios").AxiosPromise<R>;
23
24
  export {};
@@ -21,3 +21,5 @@ export var PostQuestionCollectionUpsert = function (data) {
21
21
  export var GetAiDefine = function (data) { return POST({ url: '/standard/b/questionCollection/intelligenceQuery', data: data }); };
22
22
  // 获取考察能力详情
23
23
  export var GetAbilityDetail = function (data) { return POST({ url: '/standard/b/questionCollection', data: data }); };
24
+ // 能力名称查重
25
+ export var CheckDuplicateCollection = function (data) { return POST({ url: '/standard/b/questionCollection/checkDuplicateCollection', data: data }); };
@@ -147,6 +147,6 @@ var AiAbilityRoot = function () {
147
147
  },
148
148
  },
149
149
  ];
150
- return ((0, jsx_runtime_1.jsxs)(styled_1.AbilityRoot, { children: [AddAbilityOpen && (0, jsx_runtime_1.jsx)(AddAbility_1.default, __assign({}, state, { open: AddAbilityOpen, onClose: handleClose, onSuccess: getList })), UpdateAbilityOpen && (0, jsx_runtime_1.jsx)(UpdateAbility_1.default, __assign({}, state, { open: UpdateAbilityOpen, onClose: handleClose, onSuccess: getList })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Header, { title: "\u8003\u5BDF\u80FD\u529B\u7BA1\u7406", renderAction: function () { return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ icon: (0, jsx_runtime_1.jsx)(fbm_ui_1.AddIcon, {}), onClick: handleAdd }, { children: "\u65B0\u589E\u80FD\u529B" }))); } }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ mt: 2, border: "1px solid rgba(0, 0, 0, 0.08)", borderRadius: 0.5, overflow: "hidden" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Table, { emptyText: "\u6682\u65E0\u6570\u636E", loading: listLoading, data: data === null || data === void 0 ? void 0 : data.data.list, columns: columns }) }))] }));
150
+ return ((0, jsx_runtime_1.jsxs)(styled_1.AbilityRoot, { children: [AddAbilityOpen && (0, jsx_runtime_1.jsx)(AddAbility_1.default, __assign({}, state, { open: AddAbilityOpen, onClose: handleClose, onSuccess: getList })), UpdateAbilityOpen && (0, jsx_runtime_1.jsx)(UpdateAbility_1.default, __assign({}, state, { open: UpdateAbilityOpen, onClose: handleClose, onSuccess: getList })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Header, { title: "\u8003\u5BDF\u80FD\u529B\u7BA1\u7406", renderAction: function () { return ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ icon: (0, jsx_runtime_1.jsx)(fbm_ui_1.AddIcon, {}), onClick: handleAdd }, { children: "\u65B0\u589E\u80FD\u529B" }))); } }), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ mt: 2, border: "1px solid rgba(0, 0, 0, 0.08)", borderRadius: 0.5, overflow: "hidden" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Table, { emptyText: "\u6682\u65E0\u6570\u636E", nameText: "\u8003\u5BDF\u80FD\u529B", loading: listLoading, data: data === null || data === void 0 ? void 0 : data.data.list, columns: columns }) }))] }));
151
151
  };
152
152
  exports.default = AiAbilityRoot;
@@ -100,7 +100,7 @@ var AbilityFormItem = function (_a) {
100
100
  rows: 3,
101
101
  multiline: true,
102
102
  sx: {
103
- marginBottom: '32px',
103
+ marginBottom: '43px',
104
104
  },
105
105
  });
106
106
  (0, react_1.useEffect)(function () {
@@ -126,6 +126,6 @@ var AbilityFormItem = function (_a) {
126
126
  });
127
127
  // eslint-disable-next-line react-hooks/exhaustive-deps
128
128
  }, [type, name, token]);
129
- return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ style: { marginBottom: '18px' }, direction: "row", alignItems: "center", justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", fontWeight: "medium" }, { children: title })), canReplace && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ loading: loading, onClick: handleReplace, variant: "outlined", color: "inherit", size: "small", icon: (0, jsx_runtime_1.jsx)(fbm_ui_1.RefreshIcon, {}) }, { children: loading ? '生成中' : '换一换' })))] })), internalMode === 'edit' && ((0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ width: 1, pr: 2 }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.TextField, __assign({}, nameTextField)) }))), internalMode === 'show' && ((0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ style: { marginTop: '-8px', marginBottom: '24px' } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", sx: { whiteSpace: 'pre-wrap', color: 'RGBA(0, 0, 0, 0.56)' } }, { children: content })) })))] }));
129
+ return ((0, jsx_runtime_1.jsxs)(mui_1.Stack, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ style: { marginBottom: '18px' }, direction: "row", alignItems: "center", justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", fontWeight: "medium" }, { children: title })), canReplace && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ loading: loading, onClick: handleReplace, variant: "outlined", color: "inherit", size: "small", icon: (0, jsx_runtime_1.jsx)(fbm_ui_1.RefreshIcon, {}) }, { children: loading ? '生成中' : '换一换' })))] })), internalMode === 'edit' && ((0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ width: 1 }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.TextField, __assign({}, nameTextField)) }))), internalMode === 'show' && ((0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ style: { marginTop: '-8px', marginBottom: '32px' } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body2", sx: { whiteSpace: 'pre-wrap', color: 'RGBA(0, 0, 0, 0.56)' } }, { children: content })) })))] }));
130
130
  };
131
131
  exports.default = AbilityFormItem;
@@ -60,7 +60,7 @@ var AddAbility = function (props) {
60
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
61
  var _c = (0, react_1.useState)(''), value = _c[0], setValue = _c[1];
62
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];
63
+ // const [stepLoading, setStepLoading] = useState<boolean>(false);
64
64
  var InitialValues = {
65
65
  workPlaceItems: [
66
66
  {
@@ -95,15 +95,27 @@ var AddAbility = function (props) {
95
95
  },
96
96
  ],
97
97
  };
98
- var _f = (0, react_1.useState)(InitialValues.workPlaceItems), workPlaceItems = _f[0], setWorkPlaceItems = _f[1];
99
- var _g = (0, ahooks_1.useRequest)(ai_ability_1.PostQuestionCollectionUpsert, {
98
+ var _e = (0, react_1.useState)(InitialValues.workPlaceItems), workPlaceItems = _e[0], setWorkPlaceItems = _e[1];
99
+ var _f = (0, ahooks_1.useRequest)(ai_ability_1.PostQuestionCollectionUpsert, {
100
100
  manual: true,
101
101
  onSuccess: function () {
102
102
  fbm_ui_1.Message.success('新增能力成功');
103
103
  onClose();
104
104
  onSuccess();
105
105
  },
106
- }), run = _g.run, loading = _g.loading;
106
+ }), run = _f.run, loading = _f.loading;
107
+ var _g = (0, ahooks_1.useRequest)(ai_ability_1.CheckDuplicateCollection, {
108
+ manual: true,
109
+ onSuccess: function (_a) {
110
+ var data = _a.data;
111
+ if (data.isDuplicate) {
112
+ nameTextField.setError('能力名称不能重复');
113
+ }
114
+ else {
115
+ setStep(2);
116
+ }
117
+ },
118
+ }), checkDuplicateCollection = _g.run, stepLoading = _g.loading;
107
119
  var nameTextField = (0, fbm_ui_1.useTextField)({
108
120
  value: value,
109
121
  label: '能力名称',
@@ -130,16 +142,12 @@ var AddAbility = function (props) {
130
142
  case 1:
131
143
  error = _a.sent();
132
144
  if (!error) {
133
- setStepLoading(true);
134
- setTimeout(function () {
135
- setStep(2);
136
- setStepLoading(false);
137
- }, 300);
145
+ checkDuplicateCollection({ collectionName: value });
138
146
  }
139
147
  return [2 /*return*/];
140
148
  }
141
149
  });
142
- }); }, [nameTextField]);
150
+ }); }, [nameTextField, value, checkDuplicateCollection]);
143
151
  var handleValue = (0, react_1.useCallback)(function (v) {
144
152
  var index = workPlaceItems.findIndex(function (ele) { return ele.type === v.type; });
145
153
  workPlaceItems.splice(index, 1, v);
@@ -73,6 +73,12 @@ var UpdateAbility = function (props) {
73
73
  onClose();
74
74
  onSuccess();
75
75
  },
76
+ onError: function (err) {
77
+ console.log(err);
78
+ if ((err === null || err === void 0 ? void 0 : err.code) === -1211) {
79
+ nameTextField.setError('能力名称不能重复');
80
+ }
81
+ },
76
82
  }), run = _h.run, loading = _h.loading;
77
83
  var getAbilityDetail = (0, ahooks_1.useRequest)(ai_ability_1.GetAbilityDetail, {
78
84
  manual: true,
@@ -41,3 +41,9 @@ export interface AiDefineRes {
41
41
  export interface AbilityDetailRes {
42
42
  data: AiDefineData;
43
43
  }
44
+ export interface CheckDuplicateCollectionData {
45
+ isDuplicate: boolean;
46
+ }
47
+ export interface CheckDuplicateCollectionRes {
48
+ data: CheckDuplicateCollectionData;
49
+ }
@@ -20,4 +20,5 @@ interface DiyUpsertData {
20
20
  export declare const PostQuestionCollectionUpsert: <R>(data: DiyUpsertData) => import("axios").AxiosPromise<R>;
21
21
  export declare const GetAiDefine: <R>(data: any) => import("axios").AxiosPromise<R>;
22
22
  export declare const GetAbilityDetail: <R>(data: any) => import("axios").AxiosPromise<R>;
23
+ export declare const CheckDuplicateCollection: <R>(data: any) => import("axios").AxiosPromise<R>;
23
24
  export {};
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.GetAbilityDetail = exports.GetAiDefine = exports.PostQuestionCollectionUpsert = exports.PostQuestionCollectionDelete = exports.PostQuestionCollectionList = void 0;
14
+ exports.CheckDuplicateCollection = exports.GetAbilityDetail = exports.GetAiDefine = exports.PostQuestionCollectionUpsert = exports.PostQuestionCollectionDelete = exports.PostQuestionCollectionList = void 0;
15
15
  var request_1 = require("../utils/request");
16
16
  // 考察能力列表
17
17
  var PostQuestionCollectionList = function () { return (0, request_1.POST)({ url: '/standard/b/questionCollection/list' }); };
@@ -29,3 +29,6 @@ exports.GetAiDefine = GetAiDefine;
29
29
  // 获取考察能力详情
30
30
  var GetAbilityDetail = function (data) { return (0, request_1.POST)({ url: '/standard/b/questionCollection', data: data }); };
31
31
  exports.GetAbilityDetail = GetAbilityDetail;
32
+ // 能力名称查重
33
+ var CheckDuplicateCollection = function (data) { return (0, request_1.POST)({ url: '/standard/b/questionCollection/checkDuplicateCollection', data: data }); };
34
+ exports.CheckDuplicateCollection = CheckDuplicateCollection;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eli-video-interview",
3
- "version": "1.2.32",
3
+ "version": "1.2.33",
4
4
  "description": "鳄梨科技 AI视频面试 React SDK",
5
5
  "author": "鳄梨科技",
6
6
  "license": "MIT",