yangyin
2024-11-05 94ef796940807e666b0d82f0ef57b42a3e3b83a9
src/components/chat/components/playBar/phrase/CommonPhrases.vue
@@ -140,17 +140,21 @@
         handleClose();
      }
   } else {
      const res = await addUserSample({
      addCommonPhrasesData();
   }
};
//添加一条数据源
const addCommonPhrasesData = async () => {
   const res = await addUserSample({
      question: state.inputCommonPhrases,
      group_type: activeGroupType.value,
   });
   if (res.json_ok) {
      commonPhrases.value.push({
         id: res.sample_id,
         question: state.inputCommonPhrases,
         group_type: activeGroupType.value,
      });
      if (res.json_ok) {
         commonPhrases.value.push({
            id: res.sample_id,
            question: state.inputCommonPhrases,
         });
         handleClose();
      }
      handleClose();
   }
};
//#endregion
@@ -164,13 +168,14 @@
   activeSampleId.value = item.id;
};
const commonChatByUser = (data) => {
   commonPhrases.value.push(data);
   state.inputCommonPhrases = data.question;
   addCommonPhrasesData();
};
//#endregion
onMounted(() => {
   getCommonPhrases();
});
defineExpose({ commonChatByUser });
defineExpose({ commonChatByUser,getCommonPhrases });
</script>
<style scoped lang="scss">
.container {