eli-video-interview 1.2.23 → 1.2.26

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 (108) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/esm/assets/icons/AI.svg +1 -0
  3. package/esm/components/AiHeaderTitle/index.d.ts +4 -0
  4. package/esm/components/AiHeaderTitle/index.js +19 -0
  5. package/esm/components/AiHeaderTitle/interface.d.ts +4 -0
  6. package/esm/components/AiHeaderTitle/interface.js +1 -0
  7. package/esm/components/Charts/Chart.d.ts +1 -1
  8. package/esm/components/Charts/Chart.js +8 -8
  9. package/esm/components/Charts/ReportPie.js +1 -1
  10. package/esm/modules/ai-ability/interface.d.ts +1 -0
  11. package/esm/modules/ai-question/components/AiAnalysis/AnalysisItem.d.ts +1 -1
  12. package/esm/modules/ai-question/components/AiAnalysis/AnalysisItem.js +12 -7
  13. package/esm/modules/ai-question/components/AiAnalysis/index.js +9 -17
  14. package/esm/modules/ai-question/components/AiAssessmentCriteria/const.d.ts +6 -0
  15. package/esm/modules/ai-question/components/AiAssessmentCriteria/const.js +7 -0
  16. package/esm/modules/ai-question/components/AiAssessmentCriteria/index.d.ts +1 -1
  17. package/esm/modules/ai-question/components/AiAssessmentCriteria/index.js +27 -26
  18. package/esm/modules/ai-question/components/AiAssessmentCriteria/interface.d.ts +6 -0
  19. package/esm/modules/ai-question/components/QuestionModel/index.js +6 -6
  20. package/esm/modules/ai-question/components/QuestionUpdate/Form.d.ts +1 -1
  21. package/esm/modules/ai-question/components/QuestionUpdate/Form.js +19 -10
  22. package/esm/modules/ai-question/components/QuestionUpdate/index.js +60 -11
  23. package/esm/modules/ai-question/interface.d.ts +2 -0
  24. package/esm/modules/ai-report/Root.js +7 -5
  25. package/esm/modules/ai-report/components/AIEvaluate/index.js +10 -9
  26. package/esm/modules/ai-report/components/ScoreReport/Bar.js +3 -3
  27. package/esm/modules/ai-report/components/ScoreReport/Report.js +13 -5
  28. package/esm/modules/ai-report/components/Suggestion/Suggestion.d.ts +4 -0
  29. package/esm/modules/ai-report/components/Suggestion/Suggestion.js +29 -0
  30. package/esm/modules/ai-report/components/Suggestion/index.d.ts +2 -0
  31. package/esm/modules/ai-report/components/Suggestion/index.js +27 -0
  32. package/esm/modules/ai-report/components/VideoQuestion/Abilities.d.ts +1 -1
  33. package/esm/modules/ai-report/components/VideoQuestion/Abilities.js +5 -5
  34. package/esm/modules/ai-report/components/VideoQuestion/QuestionItem.d.ts +1 -1
  35. package/esm/modules/ai-report/components/VideoQuestion/QuestionItem.js +9 -9
  36. package/esm/modules/ai-report/components/VideoQuestion/index.js +4 -3
  37. package/esm/modules/ai-report/components/WorkPlaces/ScoreSlider.d.ts +4 -0
  38. package/esm/modules/ai-report/components/WorkPlaces/ScoreSlider.js +24 -0
  39. package/esm/modules/ai-report/components/WorkPlaces/WorkPlace.d.ts +11 -0
  40. package/esm/modules/ai-report/components/WorkPlaces/WorkPlace.js +55 -0
  41. package/esm/modules/ai-report/components/WorkPlaces/index.d.ts +2 -0
  42. package/esm/modules/ai-report/components/WorkPlaces/index.js +67 -0
  43. package/esm/modules/ai-report/components/WorkPlaces/interface.d.ts +7 -0
  44. package/esm/modules/ai-report/components/WorkPlaces/interface.js +1 -0
  45. package/esm/modules/ai-report/components/WorkPlaces/styled.d.ts +62 -0
  46. package/esm/modules/ai-report/components/WorkPlaces/styled.js +27 -0
  47. package/esm/modules/ai-report/interface.d.ts +38 -0
  48. package/esm/services/ai-ability.d.ts +1 -0
  49. package/esm/services/ai-report.d.ts +5 -0
  50. package/esm/services/ai-report.js +4 -0
  51. package/esm/store/ai-ability/question-ability-store.d.ts +12 -0
  52. package/esm/store/ai-ability/question-ability-store.js +10 -0
  53. package/esm/store/ai-question/ai-analysis-store.d.ts +5 -1
  54. package/esm/store/ai-question/ai-analysis-store.js +36 -11
  55. package/lib/assets/icons/AI.svg +1 -0
  56. package/lib/components/AiHeaderTitle/index.d.ts +4 -0
  57. package/lib/components/AiHeaderTitle/index.js +24 -0
  58. package/lib/components/AiHeaderTitle/interface.d.ts +4 -0
  59. package/lib/components/AiHeaderTitle/interface.js +2 -0
  60. package/lib/components/Charts/Chart.d.ts +1 -1
  61. package/lib/components/Charts/Chart.js +8 -8
  62. package/lib/components/Charts/ReportPie.js +1 -1
  63. package/lib/modules/ai-ability/interface.d.ts +1 -0
  64. package/lib/modules/ai-question/components/AiAnalysis/AnalysisItem.d.ts +1 -1
  65. package/lib/modules/ai-question/components/AiAnalysis/AnalysisItem.js +12 -7
  66. package/lib/modules/ai-question/components/AiAnalysis/index.js +8 -16
  67. package/lib/modules/ai-question/components/AiAssessmentCriteria/const.d.ts +6 -0
  68. package/lib/modules/ai-question/components/AiAssessmentCriteria/const.js +8 -1
  69. package/lib/modules/ai-question/components/AiAssessmentCriteria/index.d.ts +1 -1
  70. package/lib/modules/ai-question/components/AiAssessmentCriteria/index.js +27 -26
  71. package/lib/modules/ai-question/components/AiAssessmentCriteria/interface.d.ts +6 -0
  72. package/lib/modules/ai-question/components/QuestionModel/index.js +6 -6
  73. package/lib/modules/ai-question/components/QuestionUpdate/Form.d.ts +1 -1
  74. package/lib/modules/ai-question/components/QuestionUpdate/Form.js +19 -10
  75. package/lib/modules/ai-question/components/QuestionUpdate/index.js +60 -11
  76. package/lib/modules/ai-question/interface.d.ts +2 -0
  77. package/lib/modules/ai-report/Root.js +7 -5
  78. package/lib/modules/ai-report/components/AIEvaluate/index.js +9 -8
  79. package/lib/modules/ai-report/components/ScoreReport/Bar.js +3 -3
  80. package/lib/modules/ai-report/components/ScoreReport/Report.js +13 -5
  81. package/lib/modules/ai-report/components/Suggestion/Suggestion.d.ts +4 -0
  82. package/lib/modules/ai-report/components/Suggestion/Suggestion.js +31 -0
  83. package/lib/modules/ai-report/components/Suggestion/index.d.ts +2 -0
  84. package/lib/modules/ai-report/components/Suggestion/index.js +32 -0
  85. package/lib/modules/ai-report/components/VideoQuestion/Abilities.d.ts +1 -1
  86. package/lib/modules/ai-report/components/VideoQuestion/Abilities.js +5 -5
  87. package/lib/modules/ai-report/components/VideoQuestion/QuestionItem.d.ts +1 -1
  88. package/lib/modules/ai-report/components/VideoQuestion/QuestionItem.js +9 -9
  89. package/lib/modules/ai-report/components/VideoQuestion/index.js +4 -3
  90. package/lib/modules/ai-report/components/WorkPlaces/ScoreSlider.d.ts +4 -0
  91. package/lib/modules/ai-report/components/WorkPlaces/ScoreSlider.js +26 -0
  92. package/lib/modules/ai-report/components/WorkPlaces/WorkPlace.d.ts +11 -0
  93. package/lib/modules/ai-report/components/WorkPlaces/WorkPlace.js +57 -0
  94. package/lib/modules/ai-report/components/WorkPlaces/index.d.ts +2 -0
  95. package/lib/modules/ai-report/components/WorkPlaces/index.js +72 -0
  96. package/lib/modules/ai-report/components/WorkPlaces/interface.d.ts +7 -0
  97. package/lib/modules/ai-report/components/WorkPlaces/interface.js +2 -0
  98. package/lib/modules/ai-report/components/WorkPlaces/styled.d.ts +62 -0
  99. package/lib/modules/ai-report/components/WorkPlaces/styled.js +30 -0
  100. package/lib/modules/ai-report/interface.d.ts +38 -0
  101. package/lib/services/ai-ability.d.ts +1 -0
  102. package/lib/services/ai-report.d.ts +5 -0
  103. package/lib/services/ai-report.js +6 -1
  104. package/lib/store/ai-ability/question-ability-store.d.ts +12 -0
  105. package/lib/store/ai-ability/question-ability-store.js +13 -0
  106. package/lib/store/ai-question/ai-analysis-store.d.ts +5 -1
  107. package/lib/store/ai-question/ai-analysis-store.js +36 -11
  108. package/package.json +1 -7
package/CHANGELOG.md ADDED
@@ -0,0 +1,30 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
+
5
+ ## 1.3.0 (2022-11-09)
6
+
7
+
8
+ ### Features
9
+
10
+ * 题目允许跳过 ([a899bee](https://jihulab.com/elihr/elifront/open/lerna-avocado-sdk/commit/a899beede4d71da37bfb3a4cb34bd745c4c29cef))
11
+ * 题目允许跳过 ([67369a3](https://jihulab.com/elihr/elifront/open/lerna-avocado-sdk/commit/67369a3735096a6c0598a9878d020c4cb86994ed))
12
+ * 增加对企业 id 支持 ([1711c47](https://jihulab.com/elihr/elifront/open/lerna-avocado-sdk/commit/1711c472ace5ebafdf3bf95d9c899b3294c3bfa9))
13
+ * add package eli-video-interview ([78c1130](https://jihulab.com/elihr/elifront/open/lerna-avocado-sdk/commit/78c113068882e1192354e153b596a9efd5ebbf90))
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * 图片预览报错 ([047314d](https://jihulab.com/elihr/elifront/open/lerna-avocado-sdk/commit/047314d03eefb475ec933c86c4d8a58ad357602c))
19
+ * 图片预览报错 ([222c8a5](https://jihulab.com/elihr/elifront/open/lerna-avocado-sdk/commit/222c8a57aa86614d5a078992020b72245b413f7d))
20
+ * 图片预览报错 ([7924905](https://jihulab.com/elihr/elifront/open/lerna-avocado-sdk/commit/7924905c4e744cdb9c02356f928c64b98a9f32a3))
21
+ * 修复已知问题 ([d432e59](https://jihulab.com/elihr/elifront/open/lerna-avocado-sdk/commit/d432e59f607f6bfaa64016ad331577cf5a21783a))
22
+ * 修复已知问题 ([2057483](https://jihulab.com/elihr/elifront/open/lerna-avocado-sdk/commit/2057483b47fc4c515d9fff20a6146aed1d39976d))
23
+ * 修复已知问题 ([8f1581d](https://jihulab.com/elihr/elifront/open/lerna-avocado-sdk/commit/8f1581d96d8d35a814b6b40a87618725f0037fda))
24
+ * 修复已知问题 ([be5d222](https://jihulab.com/elihr/elifront/open/lerna-avocado-sdk/commit/be5d2221ff5dd71c14fcdf531474fdfa8d1030fd))
25
+ * 修复已知问题 ([66e8d7c](https://jihulab.com/elihr/elifront/open/lerna-avocado-sdk/commit/66e8d7cb93fe95ef41fac48548c14bd6abab15dd))
26
+ * 修复已知问题 ([59b0422](https://jihulab.com/elihr/elifront/open/lerna-avocado-sdk/commit/59b04224586850b3d3625f173f56ed3580c738de))
27
+ * 修复已知问题 ([9125ae4](https://jihulab.com/elihr/elifront/open/lerna-avocado-sdk/commit/9125ae44d45ab935b8fea3db8f301ff51707bd04))
28
+ * 修复已知问题 ([1e04309](https://jihulab.com/elihr/elifront/open/lerna-avocado-sdk/commit/1e04309e37d77d3e9e73a58da837d3575c816c62))
29
+ * 修复已知问题 ([fe35d71](https://jihulab.com/elihr/elifront/open/lerna-avocado-sdk/commit/fe35d71374c4b92bac5d09878b02ff4624c2b4ae))
30
+ * 修复已知问题 ([27c4d32](https://jihulab.com/elihr/elifront/open/lerna-avocado-sdk/commit/27c4d3205a2ea6071d54a183b64c83888b30fb0e))
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><defs><linearGradient id="a" x1="36.62%" x2="71.052%" y1="76.01%" y2="4.425%"><stop offset="0%" stop-color="#00B768"/><stop offset="39%" stop-color="#00AF62"/><stop offset="100%" stop-color="#009953"/><stop offset="100%" stop-color="#009953"/></linearGradient></defs><g fill="none" transform="translate(3 7.16)"><rect width="3.109" height="8.176" x="18.116" y="4.824" fill="#00D97C" rx="1.554"/><path fill="#00D97C" d="M21.4330891 1.95993177 21.4367129 1.93267091C21.4403366 1.90483003 21.4433564 1.87466908 21.4457722 1.84798824L21.4457722 1.82072738C21.4457722 1.78476624 21.4500001 1.74822509 21.4500001 1.71168394L21.4500001 1.71168394C21.4502442 1.01957447 21.0163106.395484118 20.3505677.130462712 19.6848249-.134558695 18.9184003.0116886167 18.4087228.50100097 17.8990452.990313327 17.7465029 1.72631363 18.0222352 2.36576189 18.2979675 3.00521015 18.947665 3.42215785 19.6683358 3.42215789L19.6683358 3.42215789 19.6683358 4.1645813C19.8960264 4.05611788 21.1945274 3.17855021 21.4167824 2.03997429 21.4236272 2.01329345 21.4290628 1.98661261 21.4330891 1.95993177ZM15.4605889 10.719948 9.60706759.98260094C9.24145617.374932483 8.56614784.000646522375 7.83536873.000646522375 7.10458966.000646522375 6.42928134.374932483 6.06366994.98260094L5.39026133 2.1037763 5.39026133 2.1037763 4.64920987 3.33515515C4.92547127 2.86174873 5.4452855 2.56740188 6.01035444 2.56440169 6.57542336 2.5614015 7.09859463 2.8502107 7.3802895 3.32065469L7.3802895 3.32065469 12.7367568 12.2303157C13.0172603 12.6974945 13.5359784 12.9854694 14.0975151 12.9857635 14.6590517 12.9860566 15.178096 12.6986244 15.4591292 12.2317392 15.7401622 11.7648541 15.7404885 11.1894469 15.4599849 10.7222681L15.4605889 10.719948Z"/><path fill="url(#a)" d="M7.37968551,3.32065469 C7.09841787,2.85095068 6.57638695,2.56226386 6.01219476,2.56439864 C5.44800258,2.56658124 4.92838341,2.85925359 4.65102173,3.33109501 L1.83840835,8.01126263 C1.83808295,8.0127936 1.83808295,8.01437187 1.83840835,8.01590276 L0.210148599,10.719948 C-0.0703549557,11.1871269 -0.0700287417,11.762534 0.21100436,12.2294192 C0.49203746,12.6963044 1.01108183,12.9837366 1.57261848,12.9834434 C2.13415513,12.9831493 2.65287327,12.6951745 2.9333768,12.2279956 L7.83506677,4.07409845 L7.38089343,3.32007467 L7.37968551,3.32065469 Z"/></g></svg>
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { AiHeaderProps } from './interface';
3
+ declare const AiHeaderTitle: React.FC<AiHeaderProps>;
4
+ export default AiHeaderTitle;
@@ -0,0 +1,19 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import SvgIcon from "../SvgIcon";
14
+ import { Box, Typography } from 'fbm-ui';
15
+ var AiHeaderTitle = function (_a) {
16
+ var name = _a.name;
17
+ return (_jsxs(Box, __assign({ display: "inline-flex" }, { children: [_jsx(SvgIcon, { name: "AI" }), _jsx(Typography, __assign({ variant: "h6", fontWeight: "medium", sx: { fontWeight: 500 }, ml: 1 }, { children: name }))] })));
18
+ };
19
+ export default AiHeaderTitle;
@@ -0,0 +1,4 @@
1
+ export interface AiHeaderProps {
2
+ name: string;
3
+ style?: any;
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { ChartProps } from './interface';
2
1
  import { FC } from 'react';
2
+ import { ChartProps } from './interface';
3
3
  declare const Chart: FC<ChartProps>;
4
4
  export default Chart;
@@ -1,18 +1,18 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import * as echarts from 'echarts';
3
2
  import { useEffect, useRef } from 'react';
3
+ import * as echarts from 'echarts';
4
4
  var charts = {};
5
5
  var Chart = function (_a) {
6
6
  var _b = _a.id, id = _b === void 0 ? '' : _b, options = _a.options;
7
7
  var currentId = useRef('');
8
8
  var target = useRef(null);
9
9
  useEffect(function () {
10
- // if (id && !charts[id] && options) {
11
- currentId.current = id;
12
- charts[id] = echarts.init(target.current);
13
- charts[id].resize();
14
- charts[id].setOption(options, true);
15
- // }
10
+ if (id && !charts[id] && options) {
11
+ currentId.current = id;
12
+ charts[id] = echarts.init(target.current);
13
+ charts[id].resize();
14
+ charts[id].setOption(options, true);
15
+ }
16
16
  // eslint-disable-next-line react-hooks/exhaustive-deps
17
17
  }, [id, options]);
18
18
  useEffect(function () {
@@ -24,7 +24,7 @@ var Chart = function (_a) {
24
24
  };
25
25
  // eslint-disable-next-line react-hooks/exhaustive-deps
26
26
  }, []);
27
- return (_jsx("div", { id: id, ref: target, style: {
27
+ return (_jsx("div", { ref: target, style: {
28
28
  width: '100%',
29
29
  height: '100%',
30
30
  } }));
@@ -21,8 +21,8 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
- import { levelMapping } from './const';
25
24
  import Chart from "./Chart";
25
+ import { levelMapping } from './const';
26
26
  var formateTitle = function (originalTitle) {
27
27
  var regex = /(\d+?)[.](.+)/;
28
28
  if (!regex.test(originalTitle))
@@ -5,6 +5,7 @@ export interface QuestionCollectionList {
5
5
  type: 1 | 3;
6
6
  sort: number;
7
7
  updatedAt: number;
8
+ isWorkplace: boolean;
8
9
  }
9
10
  export interface QuestionCollectionListData {
10
11
  list: QuestionCollectionList[];
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
2
1
  import { AnalysisItemProps } from './interface';
2
+ import { FC } from 'react';
3
3
  declare const AnalysisItem: FC<AnalysisItemProps>;
4
4
  export default AnalysisItem;
@@ -10,17 +10,22 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import { useCallback } from 'react';
13
+ import { willOrNotOptions } from './const';
14
+ import MainPoints from './MainPoints';
15
+ import { useAiAnalysisStore } from "../../../../store/ai-question/ai-analysis-store";
14
16
  import { Box, CloseIcon, IconButton, InfoIcon, Input, Select, Tooltip, Typography } from 'fbm-ui';
15
17
  import { ListItem, ListItemText } from 'fbm-ui/lib/mui';
16
18
  import update from 'immutability-helper';
17
- import { useAiAnalysisStore } from "../../../../store/ai-question/ai-analysis-store";
18
- import { willOrNotOptions } from './const';
19
- import MainPoints from './MainPoints';
19
+ import { useCallback } from 'react';
20
20
  var AnalysisItem = function (props) {
21
21
  var _a;
22
- var name = props.name, desc = props.desc, weight = props.weight, type = props.type, extra = props.extra, index = props.index;
23
- var _b = useAiAnalysisStore(function (store) { return [store.aiAbilities]; }), aiAbilities = _b.aiAbilities, updateAiAbilities = _b.updateAiAbilities, updateAiAbilitiesWeight = _b.updateAiAbilitiesWeight, removeAiAbilities = _b.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;
23
+ var _c = useAiAnalysisStore(function (store) { return [store.aiAbilities]; }), aiAbilities = _c.aiAbilities, updateAiAbilities = _c.updateAiAbilities, updateAiAbilitiesWeight = _c.updateAiAbilitiesWeight, removeAiAbilities = _c.removeAiAbilities;
24
+ var desc = props.desc || props.name;
25
+ var NotUsedAilibity = ['英文能力', '游戏测评'];
26
+ if (abilityType === 2 && !isWorkplace) {
27
+ desc = "".concat(NotUsedAilibity.includes(name) ? name : '自定义能力', "\u4E0D\u80FD\u53C2\u4E0EAI\u5206\u6790");
28
+ }
24
29
  var handleRemove = useCallback(function () {
25
30
  removeAiAbilities(index);
26
31
  }, [index, removeAiAbilities]);
@@ -34,6 +39,6 @@ var AnalysisItem = function (props) {
34
39
  var value = _a.target.value;
35
40
  updateAiAbilitiesWeight(value, index);
36
41
  }, [updateAiAbilitiesWeight, index]);
37
- return (_jsxs(Box, { children: [_jsxs(ListItem, __assign({ sx: { pl: 0, pr: 4 }, secondaryAction: _jsx(IconButton, __assign({ 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" }, { children: name })), _jsx(Tooltip, __assign({ title: "".concat(desc) }, { 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 }))] })) }), _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 })] }));
42
+ return (_jsxs(Box, { children: [_jsxs(ListItem, __assign({ sx: { pl: 0, pr: 4 }, secondaryAction: _jsx(IconButton, __assign({ 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" }, { children: name })), abilityType === 2 && !isWorkplace ? (_jsx(Typography, __assign({ variant: "body2", style: { color: 'RGBA(0, 0, 0, 0.26)', fontSize: 12 }, ml: 1 }, { children: desc }))) : (_jsx(Tooltip, __assign({ title: "".concat(desc) }, { 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 })] }));
38
43
  };
39
44
  export default AnalysisItem;
@@ -9,27 +9,19 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
- import { useCallback, useState } from 'react';
14
- import { AddIcon, Box, Button, Checkbox, Typography } from 'fbm-ui';
15
- import { Divider, List } from 'fbm-ui/lib/mui';
16
- import { useAiAnalysisStore } from "../../../../store/ai-question/ai-analysis-store";
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
13
  import AiAssessmentCriteria from '../AiAssessmentCriteria';
18
14
  import { LANGUAGE_NAMES } from '../AiAssessmentCriteria/const';
19
15
  import AnalysisItem from './AnalysisItem';
16
+ import { useAiAnalysisStore } from "../../../../store/ai-question/ai-analysis-store";
17
+ import { AddIcon, Box, Button, Typography } from 'fbm-ui';
18
+ import { Divider, List } from 'fbm-ui/lib/mui';
19
+ import { useState } from 'react';
20
20
  var AiAnalysis = function () {
21
- var _a = useAiAnalysisStore(function (store) { return [store.aiAbilities, store.analysisState]; }), aiAbilities = _a.aiAbilities, analysisState = _a.analysisState, updateState = _a.updateState;
21
+ var _a = useAiAnalysisStore(function (store) { return [store.aiAbilities, store.analysisState]; }), aiAbilities = _a.aiAbilities, analysisState = _a.analysisState;
22
22
  var _b = useState(false), aiAnalysisOpen = _b[0], setAiAnalysisOpen = _b[1];
23
- var aiSwitch = analysisState.aiSwitch, language = analysisState.language;
24
- var isOpenAiAnalysis = aiSwitch === 1;
25
- var handleAiSwitch = useCallback(function (e, checked) {
26
- if (language !== undefined) {
27
- updateState({ aiSwitch: checked ? 1 : 2 });
28
- }
29
- else {
30
- setAiAnalysisOpen(true);
31
- }
32
- }, [language, updateState]);
33
- return (_jsxs(Box, { children: [aiAnalysisOpen && _jsx(AiAssessmentCriteria, { open: aiAnalysisOpen, onClose: function () { return setAiAnalysisOpen(false); } }), _jsxs(Box, __assign({ display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: [_jsxs(Box, __assign({ display: "flex", alignItems: "center", ml: "1px" }, { children: [_jsx(Checkbox, { checked: isOpenAiAnalysis, label: _jsx(Typography, __assign({ variant: "body2" }, { children: "\u5F00\u542FAI\u5206\u6790" })), onChange: handleAiSwitch }), isOpenAiAnalysis && (_jsxs(Typography, __assign({ variant: "caption", color: "secondary" }, { children: ["\u8BED\u79CD\uFF1A", language && LANGUAGE_NAMES[language]] })))] })), isOpenAiAnalysis && aiAbilities.length > 0 && (_jsx(Typography, __assign({ variant: "caption", display: "block", width: 122 }, { children: "\u6743\u91CD\uFF1A" })))] })), isOpenAiAnalysis && (_jsxs(_Fragment, { children: [aiAbilities.length ? (_jsx(List, { children: aiAbilities.map(function (item, index) { return (_jsx(AnalysisItem, __assign({ index: index }, item), item.token)); }) })) : (_jsx(Typography, __assign({ variant: "body2", color: "secondary", sx: { mt: 1, mb: 1 } }, { children: "\u672A\u9009\u62E9 AI \u8BC4\u5206\u7EF4\u5EA6,\u6D4B\u8BD5\u62A5\u544A\u4E0D\u4F1A\u5BF9\u5019\u9009\u4EBA\u8FDB\u884C\u8BC4\u5206" }))), _jsx(Divider, { sx: { mb: 1 } }), _jsx(Button, __assign({ variant: "text", color: "inherit", icon: _jsx(AddIcon, {}), onClick: function () { return setAiAnalysisOpen(true); } }, { children: "\u6DFB\u52A0AI\u5206\u6790\u7EF4\u5EA6" }))] }))] }));
23
+ var language = analysisState.language;
24
+ var isOpenAiAnalysis = aiAbilities.length > 0;
25
+ return (_jsxs(Box, { children: [aiAnalysisOpen && _jsx(AiAssessmentCriteria, { open: aiAnalysisOpen, onClose: function () { return setAiAnalysisOpen(false); } }), isOpenAiAnalysis && (_jsx(Box, __assign({ display: "flex", alignItems: "center", justifyContent: "space-between" }, { children: _jsxs(Box, __assign({ display: "flex", alignItems: "center" }, { children: [_jsx(Typography, __assign({ variant: "subtitle1" }, { children: "\u6743\u91CD\u8BBE\u7F6E" })), language && LANGUAGE_NAMES[language] && (_jsxs(Typography, __assign({ variant: "caption", color: "secondary", ml: "8px" }, { children: ["\u8BED\u79CD\uFF1A", language && LANGUAGE_NAMES[language]] })))] })) }))), aiAbilities.length > 0 && (_jsx(List, { children: aiAbilities.map(function (item, index) { return (_jsx(AnalysisItem, __assign({ index: index }, item), item.token)); }) })), _jsx(Divider, { sx: { mb: 1 } }), _jsx(Button, __assign({ variant: "text", color: "inherit", icon: _jsx(AddIcon, {}), onClick: function () { return setAiAnalysisOpen(true); } }, { children: "\u6DFB\u52A0AI\u5206\u6790\u7EF4\u5EA6" }))] }));
34
26
  };
35
27
  export default AiAnalysis;
@@ -17,3 +17,9 @@ export declare const SERVER_LANGUAGE_TYPE: {
17
17
  11: number;
18
18
  13: number;
19
19
  };
20
+ export declare const LANGUAGE_SHOW_NAME: {
21
+ 2: string;
22
+ 13: string;
23
+ 12: string;
24
+ 11: string;
25
+ };
@@ -21,3 +21,10 @@ export var SERVER_LANGUAGE_TYPE = (_b = {},
21
21
  _b[ENGLISH] = 3,
22
22
  _b[CANTONESE] = 4,
23
23
  _b);
24
+ // 由于语种value 和 name的映射不对应,这里用于前端显示 AI基础能力 中文|英文表达
25
+ export var LANGUAGE_SHOW_NAME = {
26
+ 2: '中文',
27
+ 13: '中文',
28
+ 12: '日语',
29
+ 11: '英文',
30
+ };
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
2
1
  import { AiAssessmentCriteriaProps } from './interface';
2
+ import { FC } from 'react';
3
3
  declare const AiAssessmentCriteria: FC<AiAssessmentCriteriaProps>;
4
4
  export default AiAssessmentCriteria;
@@ -10,16 +10,16 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
- import { useCallback, useEffect, useState } from 'react';
14
- import { Checkbox, Dialog, Loading, Radio, RadioGroup, Typography } from 'fbm-ui';
15
- import { Box, FormControl, FormLabel } from 'fbm-ui/lib/mui';
16
- import { useRequest, useSetState } from 'ahooks';
13
+ import { CATEGORY_NAME, LANGUAGE_SHOW_NAME, SERVER_LANGUAGE_TYPE } from './const';
14
+ import { groupCategory } from './utils';
17
15
  import ScrollDialogContent from "../../../../components/ScrollDialogContent";
18
16
  import { CATEGORY_TYPE, LANGUAGE_TYPE } from "../../../../enum/ai-question";
19
17
  import { PostAiAbilities } from "../../../../services/ai-question";
20
18
  import { useAiAnalysisStore } from "../../../../store/ai-question/ai-analysis-store";
21
- import { CATEGORY_NAME, SERVER_LANGUAGE_TYPE } from './const';
22
- import { groupCategory } from './utils';
19
+ import { useRequest, useSetState } from 'ahooks';
20
+ import { Checkbox, Dialog, Loading, Radio, RadioGroup, Typography } from 'fbm-ui';
21
+ import { Box, Divider, FormControl, FormLabel } from 'fbm-ui/lib/mui';
22
+ import { useCallback, useEffect, useState } from 'react';
23
23
  var MANDARIN = LANGUAGE_TYPE.MANDARIN, CANTONESE = LANGUAGE_TYPE.CANTONESE;
24
24
  var AiAssessmentCriteria = function (props) {
25
25
  var open = props.open, onClose = props.onClose;
@@ -57,14 +57,15 @@ var AiAssessmentCriteria = function (props) {
57
57
  setCheckAbilities((_a = {}, _a[key] = undefined, _a));
58
58
  }
59
59
  });
60
+ console.log(language);
60
61
  setLanguage(language);
61
62
  setCheckedChinese([MANDARIN, CANTONESE].includes(language));
62
63
  setRelatedAbilities(item === null || item === void 0 ? void 0 : item.relatedAbilities);
63
64
  };
64
65
  var handleOk = useCallback(function () {
65
- updateAiAbilities(Object.values(checkAbilities)
66
- .filter(function (item) { return item; })
67
- .sort(function (a, b) { return ((a === null || a === void 0 ? void 0 : a.sort) && (b === null || b === void 0 ? void 0 : b.sort) ? (a === null || a === void 0 ? void 0 : a.sort) - (b === null || b === void 0 ? void 0 : b.sort) : 0); }));
66
+ var CurAiAbilities = Object.values(checkAbilities).filter(function (item) { return item; });
67
+ console.log(CurAiAbilities, 'CurAiAbilities');
68
+ updateAiAbilities(Object.values(checkAbilities).filter(function (item) { return item; }));
68
69
  updateState({ language: SERVER_LANGUAGE_TYPE[language], aiSwitch: 1 });
69
70
  onClose();
70
71
  }, [checkAbilities, language, onClose, updateAiAbilities, updateState]);
@@ -79,23 +80,23 @@ var AiAssessmentCriteria = function (props) {
79
80
  return (_jsxs(Box, { children: [(list.filter(function (_a) {
80
81
  var type = _a.type;
81
82
  return relatedAbilities === null || relatedAbilities === void 0 ? void 0 : relatedAbilities.includes(type);
82
- }).length > 0 || type === CATEGORY_TYPE.LANGUAGE) && (_jsx(FormControl, { children: _jsxs(FormLabel, __assign({ component: "legend", style: { fontSize: 14, color: 'rgba(0,0,0,0.86)' } }, { children: [name, type === CATEGORY_TYPE.LANGUAGE && (_jsx(Typography, __assign({ variant: "caption", color: "textSecondary", sx: { ml: 1 } }, { children: "\u4EE5\u6240\u9009\u8BED\u8A00\u8BC6\u522B\u5019\u9009\u4EBA\u56DE\u7B54\u5185\u5BB9\u5E76\u8F6C\u6362\u6587\u5B57" })))] })) })), type === CATEGORY_TYPE.LANGUAGE ? (_jsxs(RadioGroup, __assign({ sx: { mb: 1, ml: '4px' }, row: false, value: language, onChange: function (e) { return onLanguageChange(e, list); } }, { children: [_jsx(Radio, { value: "0", RadioProps: { checked: checkedChinese }, label: "\u4E2D\u6587" }), _jsx(RadioGroup, __assign({ value: language, sx: { ml: 3 }, onChange: function (e) { return onLanguageChange(e, list); } }, { children: list
83
- .filter(function (_a) {
84
- var type = _a.type;
85
- return [MANDARIN, CANTONESE].includes(type);
86
- })
87
- .map(function (_a) {
88
- var name = _a.name, type = _a.type, token = _a.token;
89
- return checkedChinese && _jsx(Radio, { value: type, label: name }, token);
90
- }) })), list
91
- .filter(function (_a) {
92
- var type = _a.type;
93
- return ![MANDARIN, CANTONESE].includes(type);
94
- })
95
- .map(function (_a) {
96
- var name = _a.name, type = _a.type, token = _a.token;
97
- return (_jsx(Radio, { value: type, label: name }, token));
98
- })] }))) : (_jsx(_Fragment, { children: list.map(function (item) {
83
+ }).length > 0 || type === CATEGORY_TYPE.LANGUAGE) && (_jsx(FormControl, { children: _jsxs(FormLabel, __assign({ component: "legend", style: { fontSize: 14, fontWeight: 400, color: 'rgba(0,0,0,0.86)' } }, { children: [type === CATEGORY_TYPE.LANGUAGE ? (_jsx(Typography, __assign({ style: { fontSize: 16, fontWeight: 500 } }, { children: name }))) : (_jsx(Typography, { children: type === CATEGORY_TYPE.EXPRESSION ? LANGUAGE_SHOW_NAME[language] + name : name })), type === CATEGORY_TYPE.LANGUAGE && (_jsx(Typography, __assign({ variant: "caption", color: "textSecondary", sx: { ml: 1 } }, { children: "\u4EE5\u6240\u9009\u8BED\u8A00\u8BC6\u522B\u5019\u9009\u4EBA\u56DE\u7B54\u5185\u5BB9\u5E76\u8F6C\u6362\u6587\u5B57" })))] })) })), type === CATEGORY_TYPE.LANGUAGE ? (_jsxs(Box, { children: [_jsxs(RadioGroup, __assign({ sx: { mb: 1, ml: '4px' }, row: false, value: language, onChange: function (e) { return onLanguageChange(e, list); } }, { children: [_jsx(Radio, { value: "0", RadioProps: { checked: checkedChinese }, label: "\u4E2D\u6587" }), _jsx(RadioGroup, __assign({ value: language, sx: { ml: 3 }, onChange: function (e) { return onLanguageChange(e, list); } }, { children: list
84
+ .filter(function (_a) {
85
+ var type = _a.type;
86
+ return [MANDARIN, CANTONESE].includes(type);
87
+ })
88
+ .map(function (_a) {
89
+ var name = _a.name, type = _a.type, token = _a.token;
90
+ return checkedChinese && _jsx(Radio, { value: type, label: name }, token);
91
+ }) })), list
92
+ .filter(function (_a) {
93
+ var type = _a.type;
94
+ return ![MANDARIN, CANTONESE].includes(type);
95
+ })
96
+ .map(function (_a) {
97
+ var name = _a.name, type = _a.type, token = _a.token;
98
+ return (_jsx(Radio, { value: type, label: name }, token));
99
+ })] })), _jsx(Divider, { sx: { mb: 1 } }), _jsx(FormControl, { children: _jsx(FormLabel, __assign({ component: "legend", style: { fontSize: 16, color: 'rgba(0,0,0,0.86)', fontWeight: 500, marginBottom: 16 } }, { children: "AI\u57FA\u7840\u80FD\u529B" })) })] })) : (_jsx(_Fragment, { children: list.map(function (item) {
99
100
  var name = item.name, desc = item.desc, type = item.type, token = item.token;
100
101
  if (relatedAbilities === null || relatedAbilities === void 0 ? void 0 : relatedAbilities.includes(type)) {
101
102
  var isLanguageAbility = [14, 15].includes(type);
@@ -9,6 +9,12 @@ export interface AiAbilityItem extends BaseAiAbilityParams {
9
9
  groupName?: string;
10
10
  isNotCompute?: boolean;
11
11
  }
12
+ export interface WorkplaceItem {
13
+ token: string;
14
+ name: string;
15
+ weight: number | string;
16
+ isWorkplace?: boolean;
17
+ }
12
18
  export declare type GroupCategoryRet = Array<{
13
19
  name: string;
14
20
  type: number;
@@ -10,17 +10,17 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
- import { useEffect, useRef } from 'react';
14
- import { useRequest } from 'ahooks';
15
- import { PostAiModelDetails } from "../../../../services/ai-question";
16
- import { useAiQuestionStore } from "../../../../store/ai-question/global-store";
17
- import { useQuestionModelStore } from "../../../../store/ai-question/question-model-store";
18
- import { useQuestionTemplateStore } from "../../../../store/ai-question/question-template-store";
19
13
  import { defaultQuestionParams } from '../QuestionUpdate/const';
20
14
  import QuestionModelHeader from './Header';
21
15
  import QuestionModelList from './List';
22
16
  import Skeleton from './Skeleton';
23
17
  import { QuestionModelRoot } from './styled';
18
+ import { PostAiModelDetails } from "../../../../services/ai-question";
19
+ import { useAiQuestionStore } from "../../../../store/ai-question/global-store";
20
+ import { useQuestionModelStore } from "../../../../store/ai-question/question-model-store";
21
+ import { useQuestionTemplateStore } from "../../../../store/ai-question/question-template-store";
22
+ import { useRequest } from 'ahooks';
23
+ import { useEffect, useRef } from 'react';
24
24
  var Question = function () {
25
25
  var isDefaultAdded = useRef(false);
26
26
  var _a = useAiQuestionStore(function (store) { return [store.token, store.name, store.templateList]; }), token = _a.token, name = _a.name, templateList = _a.templateList, onLoad = _a.onLoad;
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
1
  import { QuestionFormProps } from './interface';
2
+ import React from 'react';
3
3
  declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<QuestionFormProps & React.RefAttributes<any>>>;
4
4
  export default _default;
@@ -46,16 +46,18 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
46
46
  }
47
47
  };
48
48
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
49
- import { forwardRef, memo, useEffect, useImperativeHandle } from 'react';
50
- import { Autocomplete, Box, Form, FormItem, Select, useForm } from 'fbm-ui';
51
- import { useRequest } from 'ahooks';
52
- import { ADD_QUESTION_TYPE } from "../../../../enum/ai-question";
53
- import { PostQuestionCollectionList } from "../../../../services/ai-ability";
54
49
  import AiAnalysis from '../AiAnalysis';
55
50
  import { broadcastModeOptions, durationOptions, prepareTimeOptions } from './const';
56
51
  import VideoVoice from './VideoVoice';
52
+ import { useQuestionCollectionListStore } from "../../../../store/ai-ability/question-ability-store";
53
+ import { ADD_QUESTION_TYPE } from "../../../../enum/ai-question";
54
+ import { PostQuestionCollectionList } from "../../../../services/ai-ability";
55
+ import { useRequest } from 'ahooks';
56
+ import { Autocomplete, Box, Form, FormItem, Select, useForm } from 'fbm-ui';
57
+ import { forwardRef, memo, useEffect, useImperativeHandle } from 'react';
57
58
  var QuestionForm = forwardRef(function (props, ref) {
58
59
  var aiShowType = props.aiShowType, initialValues = props.initialValues, values = props.values, preview = props.preview, onValuesChange = props.onValuesChange, onSubmit = props.onSubmit;
60
+ var _a = useQuestionCollectionListStore(function (store) { return [store.questionCollectionList]; }), questionCollectionList = _a.questionCollectionList, updateQuestionCollectionList = _a.updateQuestionCollectionList;
59
61
  var data = useRequest(PostQuestionCollectionList, { manual: preview }).data;
60
62
  var form = useForm({
61
63
  initialValues: initialValues,
@@ -78,15 +80,22 @@ var QuestionForm = forwardRef(function (props, ref) {
78
80
  }); });
79
81
  useEffect(function () {
80
82
  values && form.setValues(values);
83
+ updateQuestionCollectionList((data === null || data === void 0 ? void 0 : data.data.list) || []);
81
84
  // eslint-disable-next-line react-hooks/exhaustive-deps
82
- }, [values]);
85
+ }, [values, data]);
83
86
  useEffect(function () {
84
- console.log(form.values);
87
+ // console.log(form.values);
85
88
  onValuesChange === null || onValuesChange === void 0 ? void 0 : onValuesChange(form.values);
86
89
  }, [form.values, onValuesChange]);
87
- 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: data === null || data === void 0 ? void 0 : data.data.list.map(function (_a) {
88
- var tag = _a.tag;
89
- return ({ label: tag, value: tag });
90
+ 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: questionCollectionList.map(function (_a) {
91
+ var tag = _a.tag, token = _a.token, isWorkplace = _a.isWorkplace;
92
+ return ({
93
+ label: tag,
94
+ value: tag,
95
+ name: tag,
96
+ token: token,
97
+ isWorkplace: isWorkplace,
98
+ });
90
99
  }) }) })))] })), form.values.broadcastType === 1 || preview ? (_jsx(FormItem, { required: true, disabled: preview, name: "desc", label: "\u9762\u8BD5\u5185\u5BB9", max: 300, placeholder: "\u9762\u8BD5\u5185\u5BB9\uFF08\u7CFB\u7EDF\u5C06\u6839\u636E\u6B64\u5185\u5BB9\u5411\u5019\u9009\u4EBA\u8FDB\u884C\u8BED\u97F3\u64AD\u62A5\uFF09" })) : (_jsx(VideoVoice, {})), aiShowType === ADD_QUESTION_TYPE.LANGUAGE && (_jsx(FormItem, { sx: { height: 'auto', mb: 2 }, required: true, name: "readText", label: "\u6717\u8BFB\u5185\u5BB9", max: 240, InputProps: {
91
100
  rows: 3,
92
101
  multiline: true,
@@ -57,26 +57,29 @@ var __rest = (this && this.__rest) || function (s, e) {
57
57
  return t;
58
58
  };
59
59
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
60
- import { useCallback, useEffect, useRef, useState } from 'react';
61
- import { Box, Button, confirm, Dialog, Message, Popover, Typography } from 'fbm-ui';
62
- import { MenuItem } from 'fbm-ui/lib/mui';
60
+ import { defaultQuestionParams } from './const';
61
+ import Form from './Form';
62
+ import { useQuestionCollectionListStore } from "../../../../store/ai-ability/question-ability-store";
63
63
  import ScrollDialogContent from "../../../../components/ScrollDialogContent";
64
64
  import { ADD_QUESTION_TYPE } from "../../../../enum/ai-question";
65
65
  import { useAiAnalysisStore } from "../../../../store/ai-question/ai-analysis-store";
66
66
  import { useQuestionModelStore } from "../../../../store/ai-question/question-model-store";
67
67
  import { useUpdateQuestionStore } from "../../../../store/ai-question/question-update-store";
68
- import { defaultQuestionParams } from './const';
69
- import Form from './Form';
68
+ import { Box, Button, confirm, Dialog, Message, Popover, Typography } from 'fbm-ui';
69
+ import { MenuItem } from 'fbm-ui/lib/mui';
70
+ import { useCallback, useEffect, useRef, useState } from 'react';
70
71
  var QuestionUpdate = function () {
71
72
  var _a;
72
73
  var formRef = useRef();
73
74
  var _b = useState(false), switchTypeOpen = _b[0], setSwitchTypeOpen = _b[1];
74
75
  var _c = useQuestionModelStore(), addModel = _c.addModel, editModel = _c.editModel;
75
76
  var _d = useUpdateQuestionStore(function (store) { return [store.questionState]; }), questionState = _d.questionState, updateQuestionState = _d.updateQuestionState;
77
+ var questionCollectionList = useQuestionCollectionListStore(function (store) { return [store.questionCollectionList]; }).questionCollectionList;
76
78
  var _e = useAiAnalysisStore(function (store) { return [
77
79
  store.aiAbilities,
78
80
  store.analysisState,
79
- ]; }), aiAbilities = _e.aiAbilities, analysisState = _e.analysisState, setKeyPointAnalysisError = _e.setKeyPointAnalysisError, updateAiAbilities = _e.updateAiAbilities, updateState = _e.updateState;
81
+ store.workplaces,
82
+ ]; }), aiAbilities = _e.aiAbilities, workplaces = _e.workplaces, analysisState = _e.analysisState, setKeyPointAnalysisError = _e.setKeyPointAnalysisError, updateAiAbilities = _e.updateAiAbilities, updateState = _e.updateState;
80
83
  var open = questionState.open, item = questionState.item, aiShowType = questionState.aiShowType, token = questionState.token, index = questionState.index;
81
84
  var initialValues = {
82
85
  name: item === null || item === void 0 ? void 0 : item.name,
@@ -85,7 +88,7 @@ var QuestionUpdate = function () {
85
88
  readText: (_a = item === null || item === void 0 ? void 0 : item.extra) === null || _a === void 0 ? void 0 : _a.readText,
86
89
  prepareTime: item === null || item === void 0 ? void 0 : item.prepareTime,
87
90
  duration: item === null || item === void 0 ? void 0 : item.duration,
88
- category: (item === null || item === void 0 ? void 0 : item.category) ? { label: item === null || item === void 0 ? void 0 : item.category[0], value: item === null || item === void 0 ? void 0 : item.category[0] } : { label: '', value: '' },
91
+ category: (item === null || item === void 0 ? void 0 : item.category) ? { label: (item === null || item === void 0 ? void 0 : item.category[0]) || '', value: (item === null || item === void 0 ? void 0 : item.category[0]) || '' } : { label: '', value: '' },
89
92
  };
90
93
  var CustomHeader = function () {
91
94
  var content = (_jsxs(_Fragment, { children: [_jsx(MenuItem, __assign({ sx: { backgroundColor: aiShowType === ADD_QUESTION_TYPE.FREE ? 'rgba(76, 175, 80, 0.08)' : 'rgba(255, 255, 255, 1)' }, onClick: function () {
@@ -105,7 +108,9 @@ var QuestionUpdate = function () {
105
108
  return new Promise(function (resolve, reject) {
106
109
  var _a;
107
110
  var errorIndexes = [];
108
- var newAiAbilities = aiAbilities.map(function (item) {
111
+ // 职场能力中不参与AI分析的提交时,过滤掉
112
+ var newAiAbilities = aiAbilities
113
+ .map(function (item) {
109
114
  item.isNotCompute = true;
110
115
  if (item.type === 6) {
111
116
  var extra_1 = {};
@@ -126,7 +131,8 @@ var QuestionUpdate = function () {
126
131
  return __assign(__assign({}, item), { extra: JSON.stringify(extra_1) });
127
132
  }
128
133
  return item;
129
- });
134
+ })
135
+ .filter(function (v) { return v.abilityType === 1 || (v.abilityType === 2 && v.isWorkplace); });
130
136
  var _b = values || { category: undefined }, _c = _b.readText, readText = _c === void 0 ? '' : _c, otherValues = __rest(_b, ["readText"]);
131
137
  resolve({
132
138
  errorIndexes: errorIndexes,
@@ -193,13 +199,56 @@ var QuestionUpdate = function () {
193
199
  }
194
200
  });
195
201
  }); }, [getModelParams, item === null || item === void 0 ? void 0 : item.videoBroadcast.videoUrl, token, editModel, index, addModel, updateQuestionState]);
202
+ var handleWorkplaceData = useCallback(function (curSelectWorkPlace) {
203
+ // console.log('curSelectWorkPlace', curSelectWorkPlace);
204
+ var curAiAbilities = item.aiAbilities;
205
+ // 是否是初始化
206
+ var inInit = true;
207
+ // 考察能力是否包含在AI能力
208
+ var workplaceTypeIndex = curAiAbilities.findIndex(function (v) { return v.abilityType === 2; });
209
+ var CurWorkplace = questionCollectionList.find(function (v) { return v.name === curSelectWorkPlace.label; }) || {};
210
+ var CurWorkPlaceAiAbility = __assign(__assign(__assign({}, curSelectWorkPlace), CurWorkplace), { abilityType: 2, weight: 0 });
211
+ inInit = workplaceTypeIndex === -1;
212
+ // 是否可修改
213
+ // CurWorkPlaceAiAbility.isNotCompute = !CurWorkPlaceAiAbility.isWorkplace;
214
+ CurWorkPlaceAiAbility.desc = CurWorkPlaceAiAbility.name;
215
+ console.log('CurWorkPlaceAiAbility', CurWorkPlaceAiAbility);
216
+ curAiAbilities.splice(0, 1, CurWorkPlaceAiAbility);
217
+ console.log('curAiAbilities', curAiAbilities);
218
+ updateAiAbilities(curAiAbilities, inInit);
219
+ }, [questionCollectionList, updateAiAbilities, item.aiAbilities]);
220
+ // const NotUsedAbility = ['英文能力', '游戏测评'];
221
+ var handleValuesChange = useCallback(function (value) {
222
+ console.log('form value category:', value.category);
223
+ // 考察能力未发生变化
224
+ var WorkplaceIndex = item.aiAbilities.findIndex(function (v) { var _a; return v.name === ((_a = value.category) === null || _a === void 0 ? void 0 : _a.label); });
225
+ if (WorkplaceIndex > -1) {
226
+ return;
227
+ }
228
+ // 考察能力更改
229
+ if (value.category && value.category.label) {
230
+ handleWorkplaceData(value.category);
231
+ }
232
+ else if (!value.category || !value.category.label) {
233
+ // 考察能力删除
234
+ console.log('考察能力删除');
235
+ }
236
+ }, [item.aiAbilities, handleWorkplaceData]);
196
237
  useEffect(function () {
197
238
  if (open) {
198
239
  updateState({ language: item.language, aiSwitch: item.aiSwitch });
199
240
  updateAiAbilities(item.aiAbilities, true);
200
241
  }
201
242
  // eslint-disable-next-line react-hooks/exhaustive-deps
202
- }, [open]);
203
- return (_jsx(Dialog, __assign({ open: open, header: CustomHeader, size: "sm", okText: "\u786E\u8BA4", onClose: handleClose, onOk: handleOk }, { children: _jsx(ScrollDialogContent, { children: _jsx(Box, __assign({ sx: { mt: 1 } }, { children: _jsx(Form, { ref: formRef, initialValues: initialValues, aiShowType: aiShowType, onSubmit: handleSubmit }) })) }) })));
243
+ }, [open, item.aiAbilities]);
244
+ useEffect(function () {
245
+ var _a;
246
+ // 删除考察能力时,考察能力选择框清空
247
+ var WorkplaceLength = workplaces.length;
248
+ if (WorkplaceLength === 0) {
249
+ (_a = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _a === void 0 ? void 0 : _a.setFormValues({ category: { label: '', value: '' } });
250
+ }
251
+ }, [workplaces]);
252
+ return (_jsx(Dialog, __assign({ open: open, header: CustomHeader, size: "sm", okText: "\u786E\u8BA4", onClose: handleClose, onOk: handleOk }, { children: _jsx(ScrollDialogContent, { children: _jsx(Box, __assign({ sx: { mt: 1 } }, { children: _jsx(Form, { ref: formRef, initialValues: initialValues, aiShowType: aiShowType, onSubmit: handleSubmit, onValuesChange: handleValuesChange }) })) }) })));
204
253
  };
205
254
  export default QuestionUpdate;
@@ -19,6 +19,8 @@ export interface BaseAiAbilityParams {
19
19
  relatedAbilities: number[];
20
20
  sort: number;
21
21
  weight: number | string;
22
+ abilityType: number;
23
+ isWorkplace?: boolean;
22
24
  }
23
25
  export interface MineExtra {
24
26
  firstFrameUrl: string;