| | |
| | | :isHome="isHome" |
| | | ref="commonPhrasesRef" |
| | | @updateCommonChatInput="updateCommonChatInput" |
| | | |
| | | /> |
| | | </div> |
| | | </template> |
| | |
| | | onClickOutside(tipEleRef, () => { |
| | | triggerShow.value = false; |
| | | }); |
| | | |
| | | const inputText = (text) => { |
| | | nextTick(() => { |
| | | setTimeout(() => { |
| | |
| | | |
| | | //#region ====================== 当前应用场景 ====================== |
| | | const currentGroupTypeIsShow = computed(() => !!activeGroupType.value); |
| | | |
| | | const groupTypeClick = (item) => { |
| | | activeGroupType.value = item; |
| | | |
| | | inputRef.value.focus(); |
| | | commonPhrasesRef.value.getCommonPhrases(); |
| | | }; |
| | | |
| | | // 关闭当前 groupType 面板 |
| | |
| | | |
| | | //#region ====================== 常用语功能 ====================== |
| | | const commonPhrasesRef = ref(null); |
| | | const isMessageBoxVisible = ref(false); |
| | | // 常用语功能点击 |
| | | const commonPhrasesClick = () => { |
| | | isShowPhrase.value = true; |
| | | }; |
| | | // 区域关闭常用语功能面板 |
| | | onClickOutside(commonPhrasesRef, () => { |
| | | const messageBoxElement = document.querySelector('.el-message-box'); |
| | | if (messageBoxElement) { |
| | | isMessageBoxVisible.value = true; |
| | | return; |
| | | } |
| | | isShowPhrase.value = false; |
| | | }); |
| | | // 常用语功能输入框更新 |
| | | const updateCommonChatInput = (val) => { |
| | | inputValue.value = val; |
| | | isShowPhrase.value = false; |
| | | }; |
| | | |
| | | watch(setCommonQuestionInfo, (val) => { |
| | | if (!props.isHome) { |
| | | let obj = { |
| | | id: val?.historyId, |
| | | title: val?.content.values, |
| | | question: val?.content.values, |
| | | }; |
| | | commonPhrasesRef.value.commonChatByUser(obj); |
| | | isShowPhrase.value = true; |