st-comp 0.0.257 → 0.0.259

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "st-comp",
3
3
  "public": true,
4
- "version": "0.0.257",
4
+ "version": "0.0.259",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -2,7 +2,7 @@
2
2
  import dayjs from "dayjs";
3
3
  import { ElMessage } from "element-plus";
4
4
  import { getUserData } from "st-func";
5
- import { inject, ref, nextTick, watch, reactive } from "vue";
5
+ import { inject, ref, nextTick, watch, reactive, onMounted } from "vue";
6
6
  import { sendToBaiLianAppStreaming } from "../../public/aiTools";
7
7
  import { UserFilled, Service, Promotion } from "@element-plus/icons-vue";
8
8
 
@@ -17,6 +17,9 @@ const props = defineProps({
17
17
  },
18
18
  });
19
19
 
20
+ // 自定义标签数据
21
+ const tagMap = ref();
22
+
20
23
  // loading状态
21
24
  const isSending = ref(false);
22
25
  const isThinking = ref(false);
@@ -250,11 +253,23 @@ const sendMessage = async () => {
250
253
  }
251
254
 
252
255
  // 触发回调
256
+ console.log(fullResponse);
253
257
  try {
254
258
  const jsonResponse = JSON.parse(fullResponse);
255
- // 切割掉parsedConditions, 这个字段仅做AI提炼展示使用
256
- delete jsonResponse.parsedConditions;
257
- console.log(jsonResponse)
259
+ // 切割处理: parsedConditions, 这个字段仅做AI提炼展示使用
260
+ if (jsonResponse.parsedConditions) {
261
+ delete jsonResponse.parsedConditions;
262
+ }
263
+ // 切割处理: customTagNames, 这个字段需要被转换成customTag
264
+ if (jsonResponse.customTagNames?.length) {
265
+ const customTag = jsonResponse.customTagNames.reduce((result, item) => {
266
+ const id = tagMap.value[item];
267
+ if (id) result.push(id);
268
+ return result;
269
+ }, []);
270
+ delete jsonResponse.customTagNames;
271
+ jsonResponse.customTag = customTag;
272
+ }
258
273
  emit("callBack", jsonResponse);
259
274
  } catch (error) {
260
275
  emit("callBack", fullResponse);
@@ -312,7 +327,25 @@ const scrollToBottom = async () => {
312
327
  messageListRef.value.scrollTop = messageListRef.value.scrollHeight;
313
328
  }
314
329
  };
315
-
330
+ // 获取全部标签
331
+ const getTotalTagMap = async () => {
332
+ const res = await Promise.all([stConfig.request.post("/alarm/deliversign/findTagsByUserId"), stConfig.request.post("/alarm/deliversign/findSystemTagsByTagName")]);
333
+ tagMap.value = res.reduce((result, item) => {
334
+ return {
335
+ ...result,
336
+ ...item.body?.reduce((cR, cI) => {
337
+ return {
338
+ ...cR,
339
+ [cI.tagName]: cI.id,
340
+ };
341
+ }, {}),
342
+ };
343
+ }, {});
344
+ };
345
+ onMounted(() => {
346
+ getTotalTagMap();
347
+ });
348
+ // 监视消息队列 => 自动滚动
316
349
  watch(
317
350
  () => messageList.value,
318
351
  () => {
@@ -320,6 +353,13 @@ watch(
320
353
  },
321
354
  { deep: true },
322
355
  );
356
+ // 监视不满意的反馈详情窗口 => 关闭自动清空数据
357
+ watch(
358
+ () => feedbackDialogVisible.value,
359
+ (newValue) => {
360
+ if (!newValue) feedbackContent.value = "";
361
+ },
362
+ );
323
363
  defineExpose({
324
364
  open: () => {
325
365
  visible.value = true;
@@ -433,7 +473,7 @@ defineExpose({
433
473
  type="textarea"
434
474
  :rows="4"
435
475
  :autosize="{ minRows: 2, maxRows: 4 }"
436
- placeholder="输入您想查询的品种条件... (Ctrl+Enter换行,Enter发送)"
476
+ placeholder="输入您想查询的品种条件..."
437
477
  @keydown="handleKeydown"
438
478
  />
439
479
  <div class="input-actions">
@@ -632,19 +672,15 @@ defineExpose({
632
672
  .message-content {
633
673
  align-items: flex-start;
634
674
  .message-text {
635
- background: white;
636
- color: #2c3e50;
637
675
  border-radius: 18px 18px 18px 4px;
638
676
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
639
- border: 1px solid rgba(102, 126, 234, 0.1);
677
+ border: 1px solid rgba(102, 126, 234, .3);
640
678
  }
641
679
  .message-json {
642
680
  width: 100%;
643
- background: white;
644
- color: #2c3e50;
645
681
  border-radius: 18px 18px 18px 4px;
646
682
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
647
- border: 1px solid rgba(102, 126, 234, 0.1);
683
+ border: 1px solid rgba(102, 126, 234, .3);
648
684
  :deep(.parsed-conditions) {
649
685
  margin-top: 10px;
650
686
  .parsed-conditions-item {
@@ -662,60 +698,39 @@ defineExpose({
662
698
  }
663
699
  .input-area {
664
700
  padding: 16px 24px 24px;
665
- border-top: 1px solid rgba(102, 126, 234, 0.1);
666
- background: rgba(255, 255, 255, 0.9);
667
701
  backdrop-filter: blur(10px);
668
-
669
702
  .message-input {
670
703
  :deep(.el-textarea__inner) {
671
704
  border-radius: 16px;
672
705
  border: 1px solid rgba(102, 126, 234, 0.2);
673
- background: #ffffff;
674
706
  font-size: 14px;
675
707
  padding: 12px 16px;
676
708
  transition: all 0.3s ease;
677
-
678
709
  &:focus {
679
710
  border-color: #667eea;
680
711
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
681
712
  }
682
-
683
- &::placeholder {
684
- color: #cbd5e0;
685
- }
686
713
  }
687
714
  }
688
-
689
715
  .input-actions {
690
716
  display: flex;
691
717
  justify-content: space-between;
692
718
  align-items: center;
693
719
  margin-top: 12px;
694
-
695
720
  .input-hint {
696
- font-size: 12px;
697
- color: #9ca3af;
698
-
699
- span {
700
- background: rgba(102, 126, 234, 0.1);
701
- padding: 4px 8px;
702
- border-radius: 12px;
703
- font-size: 11px;
704
- }
721
+ font-size: 11px;
722
+ color: var(--el-color-info);
705
723
  }
706
-
707
724
  .send-btn {
708
725
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
709
726
  border: none;
710
727
  padding: 8px 20px;
711
728
  font-weight: 500;
712
729
  transition: all 0.3s ease;
713
-
714
730
  &:hover {
715
731
  transform: translateY(-2px);
716
732
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
717
733
  }
718
-
719
734
  &:active {
720
735
  transform: translateY(0);
721
736
  }