st-comp 0.0.256 → 0.0.258

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.256",
4
+ "version": "0.0.258",
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);
@@ -101,6 +104,9 @@ const handleFeedbackAction = async (action, messageIndex) => {
101
104
  createTime: message.createTime,
102
105
  resTime: message.resTime,
103
106
  firstPackageTime: message.firstPackageTime,
107
+
108
+ isSolved: 1, // 是否解决
109
+ logOrigin: 1, // 日志来源
104
110
  };
105
111
  await stConfig.request.post("/alarm/deliversign/addVarietyAiHelperLog", params);
106
112
  ElMessage.success("感谢您的评价!");
@@ -125,6 +131,9 @@ const handleFeedbackAction = async (action, messageIndex) => {
125
131
  resTime: message.resTime,
126
132
  createTime: message.createTime,
127
133
  firstPackageTime: message.firstPackageTime,
134
+
135
+ isSolved: 0, // 是否解决
136
+ logOrigin: 1, // 日志来源
128
137
  };
129
138
  await stConfig.request.post("/alarm/deliversign/addVarietyAiHelperLog", params);
130
139
  ElMessage.success("感谢您的反馈!我们将持续跟踪并进行优化");
@@ -144,6 +153,9 @@ const handleFeedbackAction = async (action, messageIndex) => {
144
153
  resTime: message.resTime,
145
154
  createTime: message.createTime,
146
155
  firstPackageTime: message.firstPackageTime,
156
+
157
+ isSolved: 1, // 是否解决
158
+ logOrigin: 1, // 日志来源
147
159
  };
148
160
  await stConfig.request.post("/alarm/deliversign/addVarietyAiHelperLog", params);
149
161
  }
@@ -241,10 +253,23 @@ const sendMessage = async () => {
241
253
  }
242
254
 
243
255
  // 触发回调
256
+ console.log(fullResponse);
244
257
  try {
245
258
  const jsonResponse = JSON.parse(fullResponse);
246
- // 切割掉parsedConditions, 这个字段仅做AI提炼展示使用
247
- delete jsonResponse.parsedConditions;
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
+ }
248
273
  emit("callBack", jsonResponse);
249
274
  } catch (error) {
250
275
  emit("callBack", fullResponse);
@@ -302,7 +327,25 @@ const scrollToBottom = async () => {
302
327
  messageListRef.value.scrollTop = messageListRef.value.scrollHeight;
303
328
  }
304
329
  };
305
-
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
+ // 监视消息队列 => 自动滚动
306
349
  watch(
307
350
  () => messageList.value,
308
351
  () => {
@@ -310,6 +353,13 @@ watch(
310
353
  },
311
354
  { deep: true },
312
355
  );
356
+ // 监视不满意的反馈详情窗口 => 关闭自动清空数据
357
+ watch(
358
+ () => feedbackDialogVisible.value,
359
+ (newValue) => {
360
+ if (!newValue) feedbackContent.value = "";
361
+ },
362
+ );
313
363
  defineExpose({
314
364
  open: () => {
315
365
  visible.value = true;
@@ -423,7 +473,7 @@ defineExpose({
423
473
  type="textarea"
424
474
  :rows="4"
425
475
  :autosize="{ minRows: 2, maxRows: 4 }"
426
- placeholder="输入您想查询的品种条件... (Ctrl+Enter换行,Enter发送)"
476
+ placeholder="输入您想查询的品种条件..."
427
477
  @keydown="handleKeydown"
428
478
  />
429
479
  <div class="input-actions">
@@ -652,60 +702,39 @@ defineExpose({
652
702
  }
653
703
  .input-area {
654
704
  padding: 16px 24px 24px;
655
- border-top: 1px solid rgba(102, 126, 234, 0.1);
656
- background: rgba(255, 255, 255, 0.9);
657
705
  backdrop-filter: blur(10px);
658
-
659
706
  .message-input {
660
707
  :deep(.el-textarea__inner) {
661
708
  border-radius: 16px;
662
709
  border: 1px solid rgba(102, 126, 234, 0.2);
663
- background: #ffffff;
664
710
  font-size: 14px;
665
711
  padding: 12px 16px;
666
712
  transition: all 0.3s ease;
667
-
668
713
  &:focus {
669
714
  border-color: #667eea;
670
715
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
671
716
  }
672
-
673
- &::placeholder {
674
- color: #cbd5e0;
675
- }
676
717
  }
677
718
  }
678
-
679
719
  .input-actions {
680
720
  display: flex;
681
721
  justify-content: space-between;
682
722
  align-items: center;
683
723
  margin-top: 12px;
684
-
685
724
  .input-hint {
686
- font-size: 12px;
687
- color: #9ca3af;
688
-
689
- span {
690
- background: rgba(102, 126, 234, 0.1);
691
- padding: 4px 8px;
692
- border-radius: 12px;
693
- font-size: 11px;
694
- }
725
+ font-size: 11px;
726
+ color: var(--el-color-info);
695
727
  }
696
-
697
728
  .send-btn {
698
729
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
699
730
  border: none;
700
731
  padding: 8px 20px;
701
732
  font-weight: 500;
702
733
  transition: all 0.3s ease;
703
-
704
734
  &:hover {
705
735
  transform: translateY(-2px);
706
736
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
707
737
  }
708
-
709
738
  &:active {
710
739
  transform: translateY(0);
711
740
  }
@@ -63,7 +63,7 @@ const handleAction = (action, index) => {
63
63
  const { id, name, value } = compositeOrderForm.value;
64
64
  if (!name) return ElMessage.warning("请选择需要排序的条件");
65
65
  const { label } = compositeOrderOptions.value.find((item) => item.key === name);
66
- const tagText = `${label}-${value === "asc" ? "正序↑" : "降序↓"}`;
66
+ const tagText = `${label}-${value === "asc" ? "升序↑" : "降序↓"}`;
67
67
 
68
68
  // 新增确认逻辑
69
69
  if (id === null) {
@@ -187,11 +187,11 @@ watch(
187
187
  <el-form-item label="排序方式: ">
188
188
  <el-radio-group v-model="compositeOrderForm.value">
189
189
  <el-radio
190
- label="正序"
190
+ label="升序"
191
191
  value="asc"
192
192
  />
193
193
  <el-radio
194
- label="倒序"
194
+ label="降序"
195
195
  value="desc"
196
196
  />
197
197
  </el-radio-group>