| | |
| | | export const useAssistantContentOpt = (option: AssistantContentOptOption) => { |
| | | const { forbidScroll, sendChatMessage, displayMessageList } = option; |
| | | const { toClipboard } = useClipboard(); |
| | | const isNextChat = ref(false); |
| | | const preQuestion = ref(null); |
| | | |
| | | const copyClick = (item) => { |
| | | const type = item.content.type; |
| | |
| | | }); |
| | | }; |
| | | useClickOther( |
| | | computed(() => feedbackPanelRef.value[curFeedbackIndex.value]), |
| | | computed(() => feedbackPanelRef.value?.[curFeedbackIndex.value]), |
| | | feedbackIsShow, |
| | | () => { |
| | | feedbackIsShow.value = false; |
| | |
| | | sendChatMessage({ type: AnswerType.Text, values: item.question }); |
| | | }; |
| | | |
| | | const fixQuestionClick = (item) => { |
| | | const fixQuestionClick = (item,originData) => { |
| | | if (!item.question) return; |
| | | isNextChat.value = true; |
| | | preQuestion.value = originData?.question; |
| | | try { |
| | | sendChatMessage({ |
| | | type: AnswerType.Text, |
| | | values: item.question, |
| | | }); |
| | | } finally { |
| | | isNextChat.value = false; |
| | | preQuestion.value = null; |
| | | } |
| | | }; |
| | | |
| | |
| | | feedbackClick, |
| | | askMoreClick, |
| | | fixQuestionClick, |
| | | isNextChat, |
| | | preQuestion, |
| | | showAskMore, |
| | | showFixQuestion, |
| | | }; |