| | |
| | | import { getAuthorization } from "@/utils/auth"; |
| | | import { EventSourceParserStream } from 'eventsource-parser/stream'; |
| | | import { agentResetApi, agentSetApi, getAgentSessionDetailsApi } from "@/api/agentSession"; |
| | | import EventBus from '@/utils/EventBus'; |
| | | const props = defineProps({ |
| | | modalObj: Object, |
| | | }); |
| | |
| | | agentCompletion(); |
| | | queryAgentSessionDetail(agentObj.id); |
| | | }; |
| | | |
| | | const createNewAgent = async (session) => { |
| | | Object.assign(agentObj, session); |
| | | initPage(); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | // 调用set方法 |
| | | const agentSet = async () => { |
| | |
| | | |
| | | |
| | | onMounted(() => { |
| | | |
| | | EventBus.on('createAgent', (data) => { |
| | | createNewAgent(data); |
| | | }); |
| | | }); |
| | | |
| | | watch( |
| | | () => props.modalObj, |
| | | (newVal, oldVal) => { |
| | | Object.assign(agentObj, newVal); |
| | | // Object.assign(agentObj, newVal); |
| | | //调用agent初始化方法 |
| | | if(JSON.stringify(newVal) != '{}'){ |
| | | initPage(); |
| | | // initPage(); |
| | | } |
| | | },{ |
| | | immediate: true, |