| | |
| | | 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 |
| | |
| | | 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 { |