Ver código fonte

feat: 智慧办公添加字段tools -

sunxiao 8 meses atrás
pai
commit
b825da2aca
1 arquivos alterados com 10 adições e 3 exclusões
  1. 10 3
      src/views/work/WorkView.vue

+ 10 - 3
src/views/work/WorkView.vue

@@ -25,6 +25,8 @@ const isLoading = ref(false);
 const inputRef = ref(null);
 const recordActive = ref(null);
 
+const activeItem = ref({});
+
 const currenSessionId = ref(null);
 
 const isExistInHistory = computed(() => (recordList.value.findIndex(({ sessionId: sId }) => sId === unref(currenSessionId)) === -1));
@@ -78,6 +80,7 @@ const onRegenerate = async ({ question, realQuestion }) => {
       showVal: question,
       question: realQuestion || question,
       module: 2,
+      tools: activeItem.value.tools,
       isStrong: Number(unref(switchActive))
     },
     signal: controller.signal,
@@ -148,8 +151,9 @@ const handleSubmit = async (question, realQuestion = '') => {
 }
 
 // 处理推荐问题
-const handleWelcomeRecommend = ({ content }) => {
-  inputRef.value.inpVal = content;
+const handleWelcomeRecommend = (item) => {
+  activeItem.value = item;
+  inputRef.value.inpVal = item.content;
   inputRef.value.handleInpFocus();
 }
 
@@ -178,7 +182,10 @@ const handleback = async () => {
 
 onMounted(async () => {
   const { data } = await helperApi.getHelperList();
-  helperList.value = data;
+  helperList.value = data.map(item => {
+    item.tools = item.title === '公文往来' ? "official_writer" : ''
+    return item;
+  });
 })
 
 onUnmounted(() => {