@myun/gimi-chat 0.9.75 → 0.9.77

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.
@@ -15,7 +15,7 @@ import FileUpload from "../../../file-upload";
15
15
  import styles from "./index.module.css";
16
16
  import classNames from "classnames";
17
17
  import { useTranslation } from "react-i18next";
18
-
18
+ import { useAppSelector } from "../../../../store/hooks";
19
19
  // 思考工具项组件
20
20
  var ThinkingToolItem = function ThinkingToolItem(_ref) {
21
21
  var item = _ref.item,
@@ -162,8 +162,15 @@ var AskToolItem = function AskToolItem(_ref4) {
162
162
  _useState8 = _slicedToArray(_useState7, 2),
163
163
  showContent = _useState8[0],
164
164
  setShowContent = _useState8[1];
165
+ var _useState9 = useState(false),
166
+ _useState10 = _slicedToArray(_useState9, 2),
167
+ uploadDisabled = _useState10[0],
168
+ setUploadDisabled = _useState10[1];
165
169
  var _useTranslation = useTranslation(),
166
170
  t = _useTranslation.t;
171
+ var fileList = useAppSelector(function (state) {
172
+ return state.gimiMenu.fileList;
173
+ });
167
174
  var askTextMap = {
168
175
  RUNNING: "等待人工确认",
169
176
  COMPLETED: "用户已确认"
@@ -190,10 +197,15 @@ var AskToolItem = function AskToolItem(_ref4) {
190
197
  detailInfo = _React$useMemo.detailInfo,
191
198
  optionsList = _React$useMemo.optionsList,
192
199
  questionContent = _React$useMemo.questionContent;
193
- React.useEffect(function () {
200
+ useEffect(function () {
194
201
  var isAnswered = item.status === 'ANSWERED' || item.confirmStatus === 'CONFIRMED';
195
202
  setDisabled(Boolean(isAnswered));
196
203
  }, [item.confirmStatus, item.status]);
204
+ useEffect(function () {
205
+ setUploadDisabled((fileList === null || fileList === void 0 ? void 0 : fileList.findIndex(function (v) {
206
+ return (v === null || v === void 0 ? void 0 : v.status) === "uploading" || (v === null || v === void 0 ? void 0 : v.status) === "padding";
207
+ })) !== -1);
208
+ }, [fileList]);
197
209
  var onAskItemClick = function onAskItemClick(key, value) {
198
210
  if (disabled) return;
199
211
  setDisabled(true);
@@ -238,13 +250,19 @@ var AskToolItem = function AskToolItem(_ref4) {
238
250
  }, optionRender(v));
239
251
  })), detailInfo.uploadFile && detailInfo.answerType === 0 && /*#__PURE__*/React.createElement("div", {
240
252
  className: classNames(styles.showUpload)
241
- }, /*#__PURE__*/React.createElement(FileUpload, null, /*#__PURE__*/React.createElement("div", {
242
- className: classNames(styles.uploadIcon)
253
+ }, /*#__PURE__*/React.createElement(FileUpload, {
254
+ disabled: uploadDisabled
255
+ }, /*#__PURE__*/React.createElement("div", {
256
+ className: classNames(styles.uploadIcon, uploadDisabled ? styles.disableFile : '')
243
257
  }, /*#__PURE__*/React.createElement(IconFont, {
244
258
  type: "icon-shurukuang-webtianjia",
245
259
  size: 26,
246
- color: 'var(--theme-deepNeutral, #2E394C)'
247
- }), /*#__PURE__*/React.createElement("span", null, t('askCard.fileUpload')))))) : item.content && showContent && /*#__PURE__*/React.createElement("div", {
260
+ color: uploadDisabled ? 'var(--theme-softNeutral, #D9DCE5)' : 'var(--theme-deepNeutral, #2E394C)'
261
+ }), /*#__PURE__*/React.createElement("span", {
262
+ style: uploadDisabled ? {
263
+ color: "var(--theme-softNeutral, #D9DCE5)"
264
+ } : {}
265
+ }, uploadDisabled ? t('askCard.uploading') : t('askCard.fileUpload')))))) : item.content && showContent && /*#__PURE__*/React.createElement("div", {
248
266
  className: styles.toolItemContent
249
267
  }, /*#__PURE__*/React.createElement(MMarkdown, {
250
268
  content: item.content
@@ -171,12 +171,9 @@
171
171
  }
172
172
  .showUpload .disableFile {
173
173
  border-radius: 22px;
174
- border: 1px solid var(--theme-softNeutral, #D9DCE5);
175
174
  background: #fff;
176
175
  color: #ced3d9;
177
- font-family: "PingFang SC";
178
176
  font-size: 14px;
179
- font-style: normal;
180
177
  font-weight: 600;
181
178
  line-height: normal;
182
179
  }
@@ -300,6 +300,9 @@ var AnswerItem = function AnswerItem(_ref) {
300
300
  var options = (_eventData2 = eventData) === null || _eventData2 === void 0 || (_eventData2 = _eventData2.data) === null || _eventData2 === void 0 || (_eventData2 = _eventData2.results) === null || _eventData2 === void 0 || (_eventData2 = _eventData2.askShowInfo) === null || _eventData2 === void 0 ? void 0 : _eventData2.options;
301
301
  if (clickedOptionId && options && options[clickedOptionId]) {
302
302
  askContent = options[clickedOptionId];
303
+ } else {
304
+ var _eventData3;
305
+ askContent = ((_eventData3 = eventData) === null || _eventData3 === void 0 || (_eventData3 = _eventData3.data) === null || _eventData3 === void 0 ? void 0 : _eventData3.results["".concat(eventData.id, ".USER_RESPONSE")]) || '';
303
306
  }
304
307
  } catch (error) {}
305
308
  newItem.content = askContent;
@@ -21,18 +21,22 @@ import DocumentList from "./documentList";
21
21
  import AiLoading from "../ai-loading";
22
22
  import TryWatch from "./tryWatch";
23
23
  import InformationList from "./information";
24
- var Empty = function Empty() {
24
+ var Empty = function Empty(_ref) {
25
+ var type = _ref.type;
26
+ var _useTranslation = useTranslation(),
27
+ t = _useTranslation.t;
25
28
  return /*#__PURE__*/React.createElement("div", {
26
29
  style: {
27
- margin: '30px auto',
30
+ margin: '20px auto',
31
+ paddingBottom: 16,
28
32
  textAlign: 'center'
29
33
  }
30
- }, "\u6682\u65E0\u6570\u636E");
34
+ }, type === 'information' ? t('trace.information.empty') : t('trace.empty.noReference'));
31
35
  };
32
- var KnowledgeIcon = function KnowledgeIcon(_ref) {
33
- var url = _ref.url;
34
- var _useTranslation = useTranslation(),
35
- t = _useTranslation.t;
36
+ var KnowledgeIcon = function KnowledgeIcon(_ref2) {
37
+ var url = _ref2.url;
38
+ var _useTranslation2 = useTranslation(),
39
+ t = _useTranslation2.t;
36
40
  return /*#__PURE__*/React.createElement("img", {
37
41
  style: {
38
42
  width: '12px',
@@ -42,12 +46,12 @@ var KnowledgeIcon = function KnowledgeIcon(_ref) {
42
46
  src: url
43
47
  });
44
48
  };
45
- export var KnowledgeIconComponent = function KnowledgeIconComponent(_ref2) {
46
- var type = _ref2.type,
47
- resources = _ref2.resources,
48
- messageId = _ref2.messageId,
49
- onCurrentTraceVideoClick = _ref2.onCurrentTraceVideoClick,
50
- curPlayer = _ref2.curPlayer;
49
+ export var KnowledgeIconComponent = function KnowledgeIconComponent(_ref3) {
50
+ var type = _ref3.type,
51
+ resources = _ref3.resources,
52
+ messageId = _ref3.messageId,
53
+ onCurrentTraceVideoClick = _ref3.onCurrentTraceVideoClick,
54
+ curPlayer = _ref3.curPlayer;
51
55
  var _useState = useState(false),
52
56
  _useState2 = _slicedToArray(_useState, 2),
53
57
  showPanel = _useState2[0],
@@ -60,8 +64,8 @@ export var KnowledgeIconComponent = function KnowledgeIconComponent(_ref2) {
60
64
  _useState6 = _slicedToArray(_useState5, 2),
61
65
  curTrace = _useState6[0],
62
66
  setCurTrace = _useState6[1];
63
- var _useTranslation2 = useTranslation(),
64
- t = _useTranslation2.t;
67
+ var _useTranslation3 = useTranslation(),
68
+ t = _useTranslation3.t;
65
69
  var dispatch = useAppDispatch();
66
70
  var lastMessageId = useAppSelector(function (state) {
67
71
  var list = state.gimiMenu.messageList;
@@ -119,23 +123,31 @@ export var KnowledgeIconComponent = function KnowledgeIconComponent(_ref2) {
119
123
  list: videoSliceList,
120
124
  hiddenTitle: true,
121
125
  handleCurrentTrace: handleCurrentTrace
122
- }) : /*#__PURE__*/React.createElement(Empty, null);
126
+ }) : /*#__PURE__*/React.createElement(Empty, {
127
+ type: type
128
+ });
123
129
  case 'product':
124
130
  return productList !== null && productList !== void 0 && productList.length ? /*#__PURE__*/React.createElement(ClassList, {
125
131
  list: productList,
126
132
  hiddenTitle: true
127
- }) : /*#__PURE__*/React.createElement(Empty, null);
133
+ }) : /*#__PURE__*/React.createElement(Empty, {
134
+ type: type
135
+ });
128
136
  case 'document':
129
137
  return documentList !== null && documentList !== void 0 && documentList.length ? /*#__PURE__*/React.createElement(DocumentList, {
130
138
  list: documentList,
131
139
  hiddenTitle: true,
132
140
  handleCurrentTrace: handleCurrentTrace
133
- }) : /*#__PURE__*/React.createElement(Empty, null);
141
+ }) : /*#__PURE__*/React.createElement(Empty, {
142
+ type: type
143
+ });
134
144
  case "information":
135
145
  return informationList !== null && informationList !== void 0 && informationList.length ? /*#__PURE__*/React.createElement(InformationList, {
136
146
  list: informationList,
137
147
  handleCurrentTrace: handleCurrentTrace
138
- }) : /*#__PURE__*/React.createElement(Empty, null);
148
+ }) : /*#__PURE__*/React.createElement(Empty, {
149
+ type: type
150
+ });
139
151
  default:
140
152
  return null;
141
153
  }
@@ -182,11 +194,11 @@ export var KnowledgeIconComponent = function KnowledgeIconComponent(_ref2) {
182
194
  onCurrentTraceVideoClick: onCurrentTraceVideoClick
183
195
  }));
184
196
  };
185
- var KnowledgeIconGroup = function KnowledgeIconGroup(_ref3) {
186
- var content = _ref3.content,
187
- messageId = _ref3.messageId,
188
- onCurrentTraceVideoClick = _ref3.onCurrentTraceVideoClick,
189
- curPlayer = _ref3.curPlayer;
197
+ var KnowledgeIconGroup = function KnowledgeIconGroup(_ref4) {
198
+ var content = _ref4.content,
199
+ messageId = _ref4.messageId,
200
+ onCurrentTraceVideoClick = _ref4.onCurrentTraceVideoClick,
201
+ curPlayer = _ref4.curPlayer;
190
202
  var parseArr = [];
191
203
  var knowledgeMap = React.useMemo(function () {
192
204
  var returnMap = new Map();
@@ -5,7 +5,7 @@ import classNames from 'classnames';
5
5
  import { documentConstants } from "../../constants";
6
6
  import { useAppSelector } from "../../store/hooks";
7
7
  var FileItem = function FileItem(_ref) {
8
- var _konwledgeTraceState$;
8
+ var _konwledgeTraceState$, _item$name;
9
9
  var item = _ref.item,
10
10
  handleCurrentTrace = _ref.handleCurrentTrace;
11
11
  var _useTranslation = useTranslation(),
@@ -16,6 +16,8 @@ var FileItem = function FileItem(_ref) {
16
16
  var isActive = (_konwledgeTraceState$ = konwledgeTraceState.resources) === null || _konwledgeTraceState$ === void 0 || (_konwledgeTraceState$ = _konwledgeTraceState$.map(function (item) {
17
17
  return item.id;
18
18
  })) === null || _konwledgeTraceState$ === void 0 ? void 0 : _konwledgeTraceState$.includes("".concat(item.hostId));
19
+ var title = (_item$name = item.name) === null || _item$name === void 0 ? void 0 : _item$name.trim();
20
+ var subInfo = [item.suffix, item.sizeUnit].filter(Boolean).join(' | ');
19
21
  return /*#__PURE__*/React.createElement("div", {
20
22
  className: classNames(styles.knowledge, item.isDelete === 1 ? styles.resource_deactive : isActive ? styles.active : ''),
21
23
  onClick: function onClick() {
@@ -29,9 +31,9 @@ var FileItem = function FileItem(_ref) {
29
31
  className: styles.description
30
32
  }, /*#__PURE__*/React.createElement("div", {
31
33
  className: styles.text
32
- }, item.name), /*#__PURE__*/React.createElement("div", {
34
+ }, title || t('trace.card.noTitle')), subInfo && /*#__PURE__*/React.createElement("div", {
33
35
  className: styles.timeTrace
34
- }, "".concat(item.suffix, " | ").concat(item.sizeUnit)), item.isDelete === 1 && /*#__PURE__*/React.createElement("div", {
36
+ }, subInfo), item.isDelete === 1 && title && /*#__PURE__*/React.createElement("div", {
35
37
  className: styles.knowledge_trace_deactive
36
38
  }, t('trace.document.invalid'))));
37
39
  };
@@ -354,6 +354,7 @@
354
354
  .knowledgeList .knowledge .description {
355
355
  display: flex;
356
356
  flex-direction: column;
357
+ justify-content: center;
357
358
  gap: 5px;
358
359
  }
359
360
  .knowledgeList .knowledge .description .text {
@@ -436,7 +437,6 @@
436
437
  -webkit-line-clamp: 2;
437
438
  -webkit-box-orient: vertical;
438
439
  overflow: hidden;
439
- width: 170px;
440
440
  max-height: 63px;
441
441
  overflow: hidden;
442
442
  font-family: "PingFang SC";
@@ -453,12 +453,12 @@
453
453
  -webkit-box-orient: vertical;
454
454
  overflow: hidden;
455
455
  color: var(--theme-dustyNeutral, #717F94);
456
- width: 150px;
457
456
  font-family: "PingFang SC";
458
457
  font-weight: 400;
459
458
  font-size: 12px;
460
459
  line-height: 150%;
461
460
  letter-spacing: 0px;
461
+ margin-top: 8px;
462
462
  }
463
463
  .knowledgeList .active {
464
464
  border: 1px solid #0073e6;
@@ -13,6 +13,8 @@ var InformationList = function InformationList(_ref) {
13
13
  return /*#__PURE__*/React.createElement("div", {
14
14
  className: styles.knowledgeList
15
15
  }, list.map(function (item) {
16
+ var _item$title;
17
+ var title = (_item$title = item.title) === null || _item$title === void 0 ? void 0 : _item$title.trim();
16
18
  return /*#__PURE__*/React.createElement("div", {
17
19
  className: classNames(styles.knowledge, item.isDelete === 1 ? styles.resource_deactive : ''),
18
20
  onClick: function onClick() {
@@ -25,7 +27,7 @@ var InformationList = function InformationList(_ref) {
25
27
  className: styles.description
26
28
  }, /*#__PURE__*/React.createElement("div", {
27
29
  className: styles.text
28
- }, item.title), item.isDelete === 1 && /*#__PURE__*/React.createElement("div", {
30
+ }, title || t('trace.card.noTitle')), item.isDelete === 1 && title && /*#__PURE__*/React.createElement("div", {
29
31
  className: styles.knowledge_trace_deactive
30
32
  }, t('trace.information.invalid'))));
31
33
  }));
@@ -5,7 +5,7 @@ import classNames from 'classnames';
5
5
  import { knowledgeConstants } from "../../constants";
6
6
  import { useAppSelector } from "../../store/hooks";
7
7
  var VideoItem = function VideoItem(_ref) {
8
- var _konwledgeTraceState$;
8
+ var _konwledgeTraceState$, _item$name;
9
9
  var item = _ref.item,
10
10
  _onClick = _ref.onClick;
11
11
  var _useTranslation = useTranslation(),
@@ -16,6 +16,8 @@ var VideoItem = function VideoItem(_ref) {
16
16
  var isActive = (_konwledgeTraceState$ = konwledgeTraceState.resources) === null || _konwledgeTraceState$ === void 0 || (_konwledgeTraceState$ = _konwledgeTraceState$.map(function (item) {
17
17
  return item.id;
18
18
  })) === null || _konwledgeTraceState$ === void 0 ? void 0 : _konwledgeTraceState$.includes("".concat(item.sliceId));
19
+ var title = (_item$name = item.name) === null || _item$name === void 0 ? void 0 : _item$name.trim();
20
+ var hasSegment = !!(item.startedAt || item.endedAt);
19
21
  return /*#__PURE__*/React.createElement("div", {
20
22
  className: classNames(styles.knowledge, item.isDelete === 1 ? styles.resource_deactive : isActive ? styles.active : ''),
21
23
  onClick: function onClick() {
@@ -37,12 +39,12 @@ var VideoItem = function VideoItem(_ref) {
37
39
  className: styles.class_description
38
40
  }, /*#__PURE__*/React.createElement("div", {
39
41
  className: styles.text
40
- }, item.name), /*#__PURE__*/React.createElement("div", {
42
+ }, title || t('trace.card.noTitle')), hasSegment && /*#__PURE__*/React.createElement("div", {
41
43
  className: styles.timeTrace
42
44
  }, t('trace.video.segment', {
43
45
  start: item.startedAt || "0'0\"",
44
46
  end: item.endedAt || "0'0\""
45
- })), item.isDelete === 1 && /*#__PURE__*/React.createElement("div", {
47
+ })), item.isDelete === 1 && title && /*#__PURE__*/React.createElement("div", {
46
48
  className: styles.knowledge_trace_deactive
47
49
  }, t('trace.video.invalid'))));
48
50
  };
@@ -21,17 +21,20 @@ import ClassList from "../knowledge-trace/classList";
21
21
  import AiLoading from "../ai-loading";
22
22
  import ShadowLoading from "../shadow-loading";
23
23
  var Empty = function Empty() {
24
+ var _useTranslation = useTranslation(),
25
+ t = _useTranslation.t;
24
26
  return /*#__PURE__*/React.createElement("div", {
25
27
  style: {
26
- margin: '30px auto',
28
+ margin: '20px auto',
29
+ paddingBottom: 16,
27
30
  textAlign: 'center'
28
31
  }
29
- }, "\u6682\u65E0\u6570\u636E");
32
+ }, t('trace.empty.noReference'));
30
33
  };
31
34
  var ProductTag = function ProductTag(_ref) {
32
35
  var value = _ref.value;
33
- var _useTranslation = useTranslation(),
34
- t = _useTranslation.t;
36
+ var _useTranslation2 = useTranslation(),
37
+ t = _useTranslation2.t;
35
38
  var _useState = useState(false),
36
39
  _useState2 = _slicedToArray(_useState, 2),
37
40
  showPanel = _useState2[0],
@@ -34,7 +34,6 @@ import useScroll from "./useScroll";
34
34
  // 获取推荐课程
35
35
  import { useChatRecommend } from "./useChatRecommend";
36
36
  import { set, cloneDeep } from 'lodash';
37
- import { FileStatus } from "../interfaces/fileInterface";
38
37
  import useChatHistory from "./useChatHistory";
39
38
  var useCommonChatAPI = function useCommonChatAPI(props) {
40
39
  var _useTranslation = useTranslation(),
@@ -1345,46 +1344,75 @@ var useCommonChatAPI = function useCommonChatAPI(props) {
1345
1344
  return;
1346
1345
  }
1347
1346
  setMsgLoading(true);
1348
- startChat(messageList, false, undefined, true);
1347
+ startChat(messageList, false, undefined, true, true);
1349
1348
  }, [startChat, status]);
1350
1349
  React.useEffect(function () {
1351
1350
  var hasValidFile = (fileList === null || fileList === void 0 ? void 0 : fileList.length) > 0;
1352
1351
  var messageList = messageListRef.current || [];
1353
1352
  var lastMessage = messageList[messageList.length - 1];
1354
- var targetMessage = messageList[messageList.length - 2];
1353
+ // const targetMessage = messageList[messageList.length - 2];
1355
1354
  if (hasValidFile && lastMessage) {
1356
- setDisableSend(true);
1355
+ setDisableSend(hasValidFile);
1357
1356
  var uploadFile = fileList[0];
1358
- var isLastMessageEmptyUserChat = (lastMessage === null || lastMessage === void 0 ? void 0 : lastMessage.moduleType) === 'ask'; // 空内容
1359
- if (!isLastMessageEmptyUserChat) {
1360
- var shouldEnableUpload = uploadFile.status === FileStatus.UPLOAD_FAILED || uploadFile.status === FileStatus.ANALYSE_FAILED;
1361
- var newMessageList = [].concat(_toConsumableArray(messageList.slice(0, -2)), [_objectSpread(_objectSpread({}, messageList[messageList.length - 2]), {}, {
1362
- disableUploadFile: !shouldEnableUpload
1363
- }), _objectSpread(_objectSpread({}, messageList[messageList.length - 1]), {}, {
1364
- messageFiles: [uploadFile]
1357
+
1358
+ // 当有文件内容时处理请求
1359
+ if (uploadFile !== null && uploadFile !== void 0 && uploadFile.content && (lastMessage === null || lastMessage === void 0 ? void 0 : lastMessage.moduleType) === 'ask') {
1360
+ var _lastMessage$toolList, _messageListRef$curre;
1361
+ var moduleInfo = lastMessage === null || lastMessage === void 0 ? void 0 : lastMessage.moduleInfo;
1362
+ var updatedToolList = (_lastMessage$toolList = lastMessage.toolList) === null || _lastMessage$toolList === void 0 ? void 0 : _lastMessage$toolList.map(function (tool) {
1363
+ return tool.status === 'RUNNING' ? _objectSpread(_objectSpread({}, tool), {}, {
1364
+ moduleType: "ask",
1365
+ status: 'COMPLETED',
1366
+ confirmStatus: "CONFIRMED",
1367
+ content: uploadFile.content
1368
+ }) : tool;
1369
+ });
1370
+ var updatedMessageList = [].concat(_toConsumableArray(messageList.slice(0, -1)), [_objectSpread(_objectSpread({}, lastMessage), {}, {
1371
+ toolList: updatedToolList
1365
1372
  })]);
1366
1373
  dispatch(setMessageList({
1367
- messageList: newMessageList
1374
+ messageList: updatedMessageList
1368
1375
  }));
1369
- // 当有文件内容时处理请求
1370
- if (uploadFile !== null && uploadFile !== void 0 && uploadFile.content && (targetMessage === null || targetMessage === void 0 ? void 0 : targetMessage.moduleType) === 'ask') {
1371
- var _messageListRef$curre;
1372
- var moduleInfo = targetMessage === null || targetMessage === void 0 ? void 0 : targetMessage.moduleInfo;
1373
- var _inputModel = _defineProperty({}, "".concat(moduleInfo === null || moduleInfo === void 0 ? void 0 : moduleInfo.id, ".input"), '');
1374
- inputModelRef.current = _inputModel;
1375
- if (((_messageListRef$curre = messageListRef.current) === null || _messageListRef$curre === void 0 ? void 0 : _messageListRef$curre.length) > 0) {
1376
- handleSendFile(newMessageList);
1377
- }
1376
+ var _inputModel = _defineProperty({}, "".concat(moduleInfo === null || moduleInfo === void 0 ? void 0 : moduleInfo.id, ".input"), '');
1377
+ inputModelRef.current = _inputModel;
1378
+ if (((_messageListRef$curre = messageListRef.current) === null || _messageListRef$curre === void 0 ? void 0 : _messageListRef$curre.length) > 0) {
1379
+ handleSendFile(updatedMessageList);
1378
1380
  }
1379
- } else {
1380
- var _newMessageList2 = [].concat(_toConsumableArray(messageList.slice(0, -1)), [_objectSpread(_objectSpread({}, messageList[messageList.length - 1]), {}, {
1381
- disableUploadFile: true
1382
- }), createUserChat('', "".concat(conversationIdRef.current))]);
1383
- dispatch(setMessageList({
1384
- messageList: _newMessageList2
1385
- }));
1386
1381
  }
1387
1382
  }
1383
+ // if (hasValidFile && lastMessage) {
1384
+ // setDisableSend(true);
1385
+ // const uploadFile = fileList[0];
1386
+ // const isLastMessageEmptyUserChat = lastMessage?.moduleType === 'ask'; // 空内容
1387
+ // if (!isLastMessageEmptyUserChat) {
1388
+ // const shouldEnableUpload = uploadFile.status === FileStatus.UPLOAD_FAILED || uploadFile.status === FileStatus.ANALYSE_FAILED;
1389
+ // const newMessageList = [...messageList.slice(0, -2),
1390
+ // { ...messageList[messageList.length - 2], disableUploadFile: !shouldEnableUpload },
1391
+ // { ...messageList[messageList.length - 1], messageFiles: [uploadFile] }];
1392
+ // dispatch(setMessageList({ messageList: newMessageList }));
1393
+ // // 当有文件内容时处理请求
1394
+ // if (uploadFile?.content && targetMessage?.moduleType === 'ask') {
1395
+ // const moduleInfo = targetMessage?.moduleInfo;
1396
+ // const _inputModel = {
1397
+ // [`${moduleInfo?.id}.input`]: '',
1398
+ // };
1399
+ // inputModelRef.current = _inputModel;
1400
+ // if (messageListRef.current?.length > 0) {
1401
+ // handleSendFile(newMessageList);
1402
+ // }
1403
+ // }
1404
+ // } else {
1405
+ // // const newMessageList = [
1406
+ // // ...messageList.slice(0, -1),
1407
+ // // {
1408
+ // // ...messageList[messageList.length - 1],
1409
+ // // disableUploadFile: true,
1410
+ // // },
1411
+ // // createUserChat('', `${conversationIdRef.current}`),
1412
+ // // ];
1413
+ // // dispatch(setMessageList({ messageList: newMessageList }));
1414
+ // }
1415
+ // }
1388
1416
  }, [fileList, dispatch, handleSendFile, createUserChat]);
1389
1417
  var onSucessExcel = React.useCallback(function (value) {
1390
1418
  // setDisableSend(true);
@@ -42,6 +42,9 @@ declare const enUS: {
42
42
  'trace.document.coverAlt': string;
43
43
  'trace.document.invalid': string;
44
44
  'trace.information.invalid': string;
45
+ 'trace.information.empty': string;
46
+ 'trace.empty.noReference': string;
47
+ 'trace.card.noTitle': string;
45
48
  'trace.document.total': string;
46
49
  'trace.document.unsupported': string;
47
50
  'trace.document.unsupportedTips': string;
@@ -108,6 +111,7 @@ declare const enUS: {
108
111
  'common.scoreUnit': string;
109
112
  'common.networkUnavailable': string;
110
113
  'askCard.fileUpload': string;
114
+ 'askCard.uploading': string;
111
115
  'upload.readFailed': string;
112
116
  'upload.networkRetry': string;
113
117
  'upload.failedMaxRetry': string;
@@ -42,6 +42,9 @@ var enUS = {
42
42
  'trace.document.coverAlt': 'Document image',
43
43
  'trace.document.invalid': 'Invalid',
44
44
  'trace.information.invalid': 'Invalid',
45
+ 'trace.information.empty': 'This article is no longer available',
46
+ 'trace.empty.noReference': 'The original reference is currently unavailable. Please search again for related content.',
47
+ 'trace.card.noTitle': 'Unable to view this reference. Please search again for related content.',
45
48
  'trace.document.total': '{{count}} documents in this conversation',
46
49
  'trace.document.unsupported': 'This file type cannot be previewed',
47
50
  'trace.document.unsupportedTips': 'This file format does not support trial preview. You can download it and view it with other software.\nTo view the full document, click the "View" button.',
@@ -108,6 +111,7 @@ var enUS = {
108
111
  'common.scoreUnit': 'Points',
109
112
  'common.networkUnavailable': 'Network connection error',
110
113
  'askCard.fileUpload': 'File Upload',
114
+ 'askCard.uploading': 'Uploading',
111
115
  'upload.readFailed': 'File read failed',
112
116
  'upload.networkRetry': 'Network error, waiting to retry',
113
117
  'upload.failedMaxRetry': 'Upload failed, max retries reached',
@@ -42,6 +42,9 @@ declare const zhCN: {
42
42
  'trace.document.coverAlt': string;
43
43
  'trace.document.invalid': string;
44
44
  'trace.information.invalid': string;
45
+ 'trace.information.empty': string;
46
+ 'trace.empty.noReference': string;
47
+ 'trace.card.noTitle': string;
45
48
  'trace.document.total': string;
46
49
  'trace.document.unsupported': string;
47
50
  'trace.document.unsupportedTips': string;
@@ -110,6 +113,7 @@ declare const zhCN: {
110
113
  'common.scoreUnit': string;
111
114
  'common.networkUnavailable': string;
112
115
  'askCard.fileUpload': string;
116
+ 'askCard.uploading': string;
113
117
  'upload.readFailed': string;
114
118
  'upload.networkRetry': string;
115
119
  'upload.failedMaxRetry': string;
@@ -42,6 +42,9 @@ var zhCN = {
42
42
  'trace.document.coverAlt': '文档图片',
43
43
  'trace.document.invalid': '已失效',
44
44
  'trace.information.invalid': '已失效',
45
+ 'trace.information.empty': '该资讯已失效',
46
+ 'trace.empty.noReference': '当前无法查看原引用片段,可重新检索相关内容。',
47
+ 'trace.card.noTitle': '无法查看该引用片段,可重新检索相关内容。',
45
48
  'trace.document.total': '本对话共{{count}}个文档',
46
49
  'trace.document.unsupported': '当前文件不支持预览',
47
50
  'trace.document.unsupportedTips': '文件格式不支持在线试看,您可以下载后用其他软件查看。\n如需查看完整文档,请点击“去查看”按钮。',
@@ -110,6 +113,7 @@ var zhCN = {
110
113
  'common.scoreUnit': '分',
111
114
  'common.networkUnavailable': '无法连接到网络',
112
115
  'askCard.fileUpload': '文件上传',
116
+ 'askCard.uploading': '上传中',
113
117
  'upload.readFailed': '文件读取失败',
114
118
  'upload.networkRetry': '网络异常,等待恢复后重试',
115
119
  'upload.failedMaxRetry': '文件上传失败,已达到最大重试次数',