1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2fc6aeae"],{"2e45":function(t,e,s){t.exports=s.p+"static/img/character1.992e7559.png"},"31e3":function(t,e,s){"use strict";s("66b3")},"3c54":function(t,e,s){"use strict";s.d(e,"c",(function(){return i})),s.d(e,"d",(function(){return n})),s.d(e,"a",(function(){return o})),s.d(e,"b",(function(){return c}));var a=s("829b");s("b775");function i(t){return Object(a["a"])({url:"https://gpt4.cocorobo.cn/get_agent_park_chat",method:"post",data:t,hideloading:!0})}function n(t){return Object(a["a"])({url:"https://gpt4.cocorobo.cn/insert_chat",method:"post",data:t,hideloading:!0})}function o(t){return Object(a["a"])({url:"https://gpt4.cocorobo.cn/ai_agent_park_chat_new",method:"post",data:t,hideloading:!0})}function c(t){return Object(a["a"])({url:"https://gpt4.cocorobo.cn/ai_agent_park_chat",method:"post",data:t,hideloading:!0})}},5013:function(t,e,s){t.exports=s.p+"static/img/bg3.aadcec19.png"},"66b3":function(t,e,s){},"682d":function(t,e,s){"use strict";s.r(e);var a=s("53ca"),i=(s("caad"),s("2532"),function(){var t=this,e=t._self._c;return e("div",{staticClass:"pocAi"},[e("bar",{attrs:{tit:"智能学伴"}}),t._m(0),5==t.chatStatusType?e("div",{staticClass:"pa_goIndex"},[e("span",{on:{click:function(e){return e.stopPropagation(),t.courseSelection()}}},[t._v(t._s(t.userInfo.userId?"開始學習":"開始選課"))])]):t._e(),t.showOpeningRemarks?t._e():e("div",{staticClass:"pa_chatArea"},[e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"pa_ca_chat"},[e("div",{ref:"chatListRef",staticClass:"pa_ca_c_list"},t._l(t.chatList,(function(a,i){return e("div",{key:i},[a.content?e("div",{staticClass:"userChat"},[e("div",{staticClass:"uc_left"},[e("div",{staticClass:"chatName"},[t._v("科科")]),e("div",{staticClass:"chatMessage"},[e("span",{domProps:{textContent:t._s(a.content)}}),e("div",{staticClass:"cm_btnArea"},[e("span",{on:{click:function(e){return e.stopPropagation(),t.copy(a.content)}}},[e("svg",{attrs:{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[e("path",{attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.76904 1.3171C2.76904 0.588877 3.35938 -0.00146484 4.08761 -0.00146484H10.6804C11.4087 -0.00146484 11.999 0.588876 11.999 1.3171V7.90992C11.999 8.63814 11.4087 9.22849 10.6804 9.22849H4.08761C3.35938 9.22849 2.76904 8.63814 2.76904 7.90992V1.3171ZM4.08761 0.987458C3.90555 0.987458 3.75797 1.13504 3.75797 1.3171V7.90992C3.75797 8.09198 3.90555 8.23956 4.08761 8.23956H10.6804C10.8625 8.23956 11.0101 8.09198 11.0101 7.90992V1.3171C11.0101 1.13504 10.8625 0.987458 10.6804 0.987458H4.08761Z",fill:"#333333"}}),e("path",{attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1.31856 3.75748C1.13651 3.75748 0.988923 3.90506 0.988923 4.08712V10.6799C0.988923 10.862 1.13651 11.0096 1.31856 11.0096H7.91139C8.09344 11.0096 8.24103 10.862 8.24103 10.6799V9.85584C8.24103 9.58275 8.46241 9.36138 8.73549 9.36138C9.00857 9.36138 9.22995 9.58275 9.22995 9.85584V10.6799C9.22995 11.4082 8.63961 11.9985 7.91139 11.9985H1.31856C0.590342 11.9985 0 11.4082 0 10.6799V4.08712C0 3.3589 0.590341 2.76855 1.31856 2.76855H2.14267C2.41575 2.76855 2.63713 2.98993 2.63713 3.26302C2.63713 3.5361 2.41575 3.75748 2.14267 3.75748H1.31856Z",fill:"#333333"}})])])])])]),e("div",{staticClass:"uc_right"},[e("el-avatar",{staticClass:"chatAvatar",attrs:{src:s("e8e8")}})],1)]):t._e(),e("div",{staticClass:"aiChat"},[e("div",{staticClass:"ac_left"},[e("el-avatar",{staticClass:"chatAvatar",attrs:{src:s("2e45")}})],1),e("div",{staticClass:"ac_right"},[t._m(1,!0),[0,2,3].includes(a.chatStatusType)?e("div",{staticClass:"chatMessage"},[0==a.chatStatusType?e("div",[e("div",{staticClass:"chatStatusMessage"},[t._v(" 為咗更了解你同提供更啱你嘅幫助,我想先問你幾個問題:你而家讀緊邊一級呀?🎓 ")]),e("div",{staticClass:"chatStatusMessageInputArea"},[e("span",[t._v("年级:")]),e("el-select",{staticClass:"chatStatusMessageInputAreaSelect",attrs:{placeholder:"快来选择你的年级",disabled:0!=t.chatStatusType},on:{change:function(e){return t.gradeChange()}},model:{value:t.choseGrade,callback:function(e){t.choseGrade=e},expression:"choseGrade"}},t._l(t.gradeList,(function(t,s){return e("el-option",{key:s,attrs:{disabled:![6].includes(s),label:t,value:t}})})),1)],1)]):t._e(),2==a.chatStatusType?e("div",[t._m(2,!0),2==t.chatStatusType?e("div",{staticClass:"chatStatusMessageInputArea"},[e("span",{staticClass:"csmia_btn",on:{click:function(e){return e.stopPropagation(),t.goChat()}}},[t._v("開始聊天")]),e("span",{staticClass:"csmia_btn",on:{click:function(e){return e.stopPropagation(),t.courseSelection()}}},[t._v(t._s(t.userInfo.userId?"開始學習":"開始選課"))])]):t._e()]):t._e(),3==a.chatStatusType?e("div",[e("div",{staticClass:"chatStatusMessage"},[t._v("好嘞,咁我哋就一齊嚟揀揀你今日想學嘅科目、教材同埋章節啦~📔")]),e("div",{staticClass:"csm_inputArea"},[e("div",{staticClass:"csm_ia_item"},[e("span",[t._v("学科")]),e("el-select",{staticClass:"chatStatusMessageInputAreaSelect",staticStyle:{width:"100%","margin-top":"5px"},attrs:{placeholder:"请选择授课科目",disabled:3!=t.chatStatusType},model:{value:t.type3Form.subject,callback:function(e){t.$set(t.type3Form,"subject",e)},expression:"type3Form.subject"}},t._l(t.subjectList,(function(t,s){return e("el-option",{key:s,attrs:{disabled:t.disabled,label:t.label,value:t.label}})})),1)],1),e("div",{staticClass:"csm_ia_item"},[e("span",[t._v("章节")]),e("el-select",{staticClass:"chatStatusMessageInputAreaSelect",staticStyle:{width:"100%","margin-top":"5px"},attrs:{placeholder:"请选择授课章节",disabled:3!=t.chatStatusType},model:{value:t.type3Form.chapter,callback:function(e){t.$set(t.type3Form,"chapter",e)},expression:"type3Form.chapter"}},t._l(t.classList,(function(t,s){return e("el-option",{key:s,attrs:{disabled:t.disabled,label:t.title,value:s}})})),1)],1),e("div",{staticClass:"csm_ia_item"},[e("span",[t._v("版本")]),e("el-select",{staticClass:"chatStatusMessageInputAreaSelect",staticStyle:{width:"100%","margin-top":"5px"},attrs:{placeholder:"请选择授课版本",disabled:3!=t.chatStatusType},model:{value:t.type3Form.edition,callback:function(e){t.$set(t.type3Form,"edition",e)},expression:"type3Form.edition"}},t._l(t.editionList,(function(t,s){return e("el-option",{key:s,attrs:{disabled:t.disabled,label:t.label,value:t.label}})})),1)],1),e("div",{staticClass:"csm_ia_btnArea"},[e("span",{on:{click:function(e){return e.stopPropagation(),t.resetType3Form()}}},[t._v("重置")]),e("span",{on:{click:function(e){return e.stopPropagation(),t.type3FormSubmit()}}},[t._v("開始學習")])])])]):t._e()]):e("div",{directives:[{name:"loading",rawName:"v-loading",value:a.loading,expression:"item.loading"}],staticClass:"chatMessage",style:a.loading?"border:none;padding:20px;border-radius:8px;overflow:hidden":""},[e("span",{domProps:{innerHTML:t._s(a.aiContent)}}),e("div",{staticClass:"cm_btnArea"},[e("span",{on:{click:function(e){return e.stopPropagation(),t.copy(a.aiContent)}}},[e("svg",{attrs:{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[e("path",{attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.76904 1.3171C2.76904 0.588877 3.35938 -0.00146484 4.08761 -0.00146484H10.6804C11.4087 -0.00146484 11.999 0.588876 11.999 1.3171V7.90992C11.999 8.63814 11.4087 9.22849 10.6804 9.22849H4.08761C3.35938 9.22849 2.76904 8.63814 2.76904 7.90992V1.3171ZM4.08761 0.987458C3.90555 0.987458 3.75797 1.13504 3.75797 1.3171V7.90992C3.75797 8.09198 3.90555 8.23956 4.08761 8.23956H10.6804C10.8625 8.23956 11.0101 8.09198 11.0101 7.90992V1.3171C11.0101 1.13504 10.8625 0.987458 10.6804 0.987458H4.08761Z",fill:"#333333"}}),e("path",{attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1.31856 3.75748C1.13651 3.75748 0.988923 3.90506 0.988923 4.08712V10.6799C0.988923 10.862 1.13651 11.0096 1.31856 11.0096H7.91139C8.09344 11.0096 8.24103 10.862 8.24103 10.6799V9.85584C8.24103 9.58275 8.46241 9.36138 8.73549 9.36138C9.00857 9.36138 9.22995 9.58275 9.22995 9.85584V10.6799C9.22995 11.4082 8.63961 11.9985 7.91139 11.9985H1.31856C0.590342 11.9985 0 11.4082 0 10.6799V4.08712C0 3.3589 0.590341 2.76855 1.31856 2.76855H2.14267C2.41575 2.76855 2.63713 2.98993 2.63713 3.26302C2.63713 3.5361 2.41575 3.75748 2.14267 3.75748H1.31856Z",fill:"#333333"}})])])])]),e("div",{staticClass:"ac_r_btnArea"},[1==a.chatStatusType?e("div",{staticClass:"ac_r_ba_box"},t._l(t.pleaseList,(function(s,a){return e("span",{key:a,class:[t.chosePleaseList.includes(s)?"ac_r_ba_boxActive":""],on:{click:function(e){return e.stopPropagation(),t.chosePlease(s)}}},[t._v(t._s(s))])})),0):t._e()])])])])})),0),e("div",{staticClass:"pa_ca_c_bottom"},[e("div",{staticClass:"pa_ca_c_b_inputArea"},[e("el-input",{ref:"textAreaRef",staticClass:"pa_ca_c_b_ia_input",attrs:{placeholder:"请在此输入您想了解的内容",disabled:null!=t.source||t.isChatStatus},model:{value:t.chatValue,callback:function(e){t.chatValue=e},expression:"chatValue"}}),e("div",{staticClass:"pa_ca_c_b_btnArea"},[e("span",{class:["pa_ca_c_b_ba_btn",t.source?"pa_ca_c_b_ba_btnDisabled":""],on:{click:t.sendChat}},[e("svg",{staticClass:"icon",attrs:{t:"1724748020468",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7309",width:"200",height:"200"}},[e("path",{attrs:{d:"M931.392 11.264L45.12 530.688c-28.736 16.896-43.52 39.424-45.12 61.248v8.128c2.048 26.112 23.04 49.984 61.632 60.416l171.968 46.592a34.304 34.304 0 0 0 41.28-25.536 35.584 35.584 0 0 0-23.808-43.136L79.68 592l873.408-511.872-95.232 703.488c-1.408 10.432-9.152 15.68-18.752 12.992l-365.632-100.288 296.32-305.856a36.416 36.416 0 0 0 0-50.24 33.728 33.728 0 0 0-48.704 0l-324.8 335.36a110.72 110.72 0 0 0-7.872 9.088 35.52 35.52 0 0 0-16.128 30.784 104 104 0 0 0-5.248 32.64v206.4c0 49.664 53.568 79.168 93.568 51.712l166.272-114.368c10.24-6.976 16-19.136 15.232-31.872a35.712 35.712 0 0 0-19.2-29.504 33.28 33.28 0 0 0-34.24 2.304L435.84 937.856v-178.432l385.472 105.6c49.6 13.632 97.472-19.072 104.576-71.808l97.152-717.568c8.448-60.48-40-94.72-91.648-64.384z","p-id":"7310"}})])])])],1)])])]),t.showOpeningRemarks?e("div",{staticClass:"pa_openingRemarks",on:{click:function(e){return e.stopPropagation(),t.openingRemarksAllFn()}}},[e("div",{staticClass:"pa_or_character"},[e("img",{attrs:{src:s("2e45")}})]),e("div",{staticClass:"pa_or_bottom"},[e("span",[t._l(t.openingRemarksMessage[0],(function(s,i){return"object"==Object(a["a"])(t.openingRemarksMessage[0])?e("span",{key:"0-"+i,domProps:{textContent:t._s(s)}}):t._e()})),"object"!=Object(a["a"])(t.openingRemarksMessage[0])?e("span",{domProps:{textContent:t._s(t.openingRemarksMessage[0])}}):t._e()],2),e("span",[t._l(t.openingRemarksMessage[1],(function(s,i){return"object"==Object(a["a"])(t.openingRemarksMessage[1])?e("span",{key:"1-"+i,domProps:{textContent:t._s(s)}}):t._e()})),"object"!=Object(a["a"])(t.openingRemarksMessage[1])?e("span",{domProps:{textContent:t._s(t.openingRemarksMessage[1])}}):t._e()],2),e("span",[t._l(t.openingRemarksMessage[2],(function(s,i){return"object"==Object(a["a"])(t.openingRemarksMessage[2])?e("span",{key:"2-"+i,domProps:{textContent:t._s(s)}}):t._e()})),"object"!=Object(a["a"])(t.openingRemarksMessage[2])?e("span",{domProps:{textContent:t._s(t.openingRemarksMessage[2])}}):t._e()],2)])]):t._e()],1)}),n=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"pa_background"},[e("img",{attrs:{src:s("5013")}})])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"chatName"},[e("span",[t._v("圆鼓鼓的大胖鱼")])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"csm_message"},[e("span",[t._v("明白晒,而家我對你熟悉多咗喇,噉我哋宜家可以開始做啲咩呢? ")]),e("span",[t._v(" 💬開始聊天:如果你想要隨意啲,我哋可以邊聊邊學,你可以問我任何學習上嘅問題,或者分享下你最近學到嘅有趣知識。")]),e("span",[t._v("📚開始選課:如果你想開始系統噉學習,我哋可以選擇一個具體嘅科目和章節,我會根據你嘅需要提供詳細嘅講解,用你最喜歡嘅講解方式嚟幫你學習,令到學習過程更加開心。")]),e("span",[t._v(" 你想要點樣開始呢?係想隨性啲聊天,定係有目標噉學習特定嘅內容?揀選你嘅方式,我哋一齊開始啦!🌟")])])}],o=(s("498a"),s("14d9"),s("ac1f"),s("5319"),s("5b81"),s("b64b"),s("7db0"),s("d3b7"),s("a630"),s("3ca3"),s("e9c4"),s("b0c0"),s("c740"),s("4de4"),s("a15b"),s("11c1")),c=s("d4cd"),r=s.n(c),l=s("3c54"),u=s("becf"),h={data:function(){return{userId:this.$store.state.user.userinfo.userid,org:this.$store.state.user.userinfo.org,oid:this.$store.state.user.userinfo.organizeid,showOpeningRemarks:!0,chatValue:"",source:null,loading:!1,chatList:[],openingRemarksMessage:[[],[],[]],isAllOpeningRemarks:!1,chatStatusType:0,isChatStatus:!0,gradeList:["小一","小二","小三","小四","小五","小六","中一","中二","中三","中四","中五","中六"],subjectList:[{value:0,label:"中國語文",disabled:!0},{value:1,label:"英國語文 ",disabled:!0},{value:2,label:"數學",disabled:!0},{value:3,label:"公民與社會發展",disabled:!0},{value:4,label:"科學",disabled:!1},{value:5,label:"物理",disabled:!0},{value:6,label:"化學",disabled:!0},{value:7,label:"生物",disabled:!0},{value:8,label:"中國歷史",disabled:!0}],editionList:[{value:0,label:"牛津大學",disabled:!1},{value:1,label:"聯合培進",disabled:!0}],classList:[{title:"第一章:科學入門",disabled:!0,allClass:[{title:"學習科學",type:0,isComplete:!0,subject:4,disabled:!0,image:"https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8741724834676182.png"},{title:"科學的實踐",type:0,subject:4,isComplete:!0,disabled:!0,image:"https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8731724834767532.png"},{title:"實驗室安全",type:0,subject:4,isComplete:!1,disabled:!0,image:"https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8721724834685472.png"},{title:"實驗室儀器及基本實驗技巧",type:0,subject:4,isComplete:!1,disabled:!0,image:"https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8751724834771676.png"},{title:"綜合練習",type:1,subject:4,isComplete:!1,disabled:!0,image:"https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8711724834666052.png"}]},{title:"第二章:水",disabled:!1,allClass:[{title:"水的物熊變化",type:0,subject:4,isComplete:!0,disabled:!1,image:"https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8761724834777931.png"},{title:"水循環",type:0,subject:4,isComplete:!0,disabled:!1,image:"https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8771724834845597.png"},{title:"溶解",type:0,subject:4,isComplete:!0,disabled:!0,image:"https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8781724834847977.png"},{title:"水的淨化",type:0,subject:4,isComplete:!0,disabled:!0,image:"https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8791724834873373.png"},{title:"食水的進一步處理",type:0,subject:4,isComplete:!1,disabled:!0,image:"https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8761724834777931.png"},{title:"節約用水和水污染",type:0,subject:4,isComplete:!1,disabled:!0,image:"https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8771724834845597.png"},{title:"綜合練習",type:1,subject:4,isComplete:!1,disabled:!0,image:"https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8721724834685472.png"}]},{title:"第三章:观察生物",disabled:!0,allClass:[{title:"生物",type:0,isComplete:!0,subject:4,disabled:!0,image:"https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8741724834676182.png"},{title:"生物的分類",type:0,subject:4,isComplete:!0,disabled:!0,image:"https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8731724834767532.png"},{title:"檢索表",type:0,subject:4,isComplete:!1,disabled:!0,image:"https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8721724834685472.png"},{title:"生物多樣性",type:0,subject:4,isComplete:!1,disabled:!0,image:"https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8751724834771676.png"},{title:"綜合練習",type:1,subject:4,isComplete:!1,disabled:!0,image:"https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/%E5%9B%BE%E7%89%8711724834666052.png"}]}],pleaseList:["講解細致","講很多不同的例子","講一些故事和笑話","提很多問题,啟發思考","提供具體的圖像和視频","提供詳細的操作示範","提供鼓勵和表揚"],chosePleaseList:[],choseGrade:"",userInfo:{grade:"",pleaseList:[],subject:"",chapter:"",edition:"",userName:"科科",choseCharacter:0,userAvatar:s("e8e8")},type3Form:{subject:"",chapter:"",edition:""}}},components:{bar:u["a"]},methods:{chatListScrollBottom:function(){var t=this;this.$nextTick((function(){t.$refs.chatListRef.scrollTop=t.$refs.chatListRef.scrollHeight}))},sendChat:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.chatValue;if([0,1].includes(this.chatStatusType))return[0].includes(this.chatStatusType)?this.chatStatusType=1:[1].includes(this.chatStatusType)&&(this.chatStatusType=2),void this.startChat();if(this.source)return this.$toast("还在对话中,请稍等");if("string"!==typeof t&&(t=this.chatValue),t.trim()){this.chatValue="";var e=s("b532"),a=e.Converter({from:"cn",to:"hk"}),i=Object(o["v4"])();this.chatList.push({role:"user",content:"".concat(t),uid:i,AI:"AI",aiContent:"",oldContent:"",isShowSynchronization:!1,filename:"",index:this.chatList.length,is_mind_map:!1,createtime:(new Date).toLocaleString().replaceAll("/","-"),loading:!0}),this.chatListScrollBottom();var n=[];n.push({role:"user",content:t});var c={assistant_id:"1601e39b-6dbf-11ef-8ce0-12e77c4cb76b",userId:this.userId,message:t,session_name:"".concat(i,"-pocAi-md"),uid:i,file_ids:[],model:"gpt-4o-2024-08-06"};Object(l["a"])(c).then((function(t){a(t.FunctionResponse.result)==a("发送成功")||console.log(t.FunctionResponse.result)})).catch((function(t){console.log(t)})),this.getAtAuContent(i)}},getAtAuContent:function(t){var e=this;this.source=new EventSource("https://gpt4.cocorobo.cn/question/".concat(t));var s="",a="",i=new r.a;this.source.onmessage=function(n){var o=JSON.parse(n.data);if("[DONE]"==o.content.replace("'","").replace("'","")){var c=[];if("result"in o){c=o.result;for(var r=0;r<c.length;r++)a=a.replace(c[r].text,c[r].fileName)}a=a.replace("_",""),e.chatList.find((function(e){return e.uid==t})).aiContent=a,e.chatList.find((function(e){return e.uid==t})).isalltext=!0,e.chatList.find((function(e){return e.uid==t})).isShowSynchronization=!0,e.chatList.find((function(e){return e.uid==t})).loading=!1,e.source.close(),e.source=null,e.chatListScrollBottom()}else{var l=o.content.replace("'","").replace("'","");""==s?s=l.replace(/^\n+/,""):s+=l,a=s+"_",a=a.replace(/\\n/g,"\n"),a=a.replace(/\\/g,""),s.split("```").length%2==0&&(a+="\n```\n"),a=i.render(a),e.chatList.find((function(e){return e.uid==t})).aiContent=a,e.chatList.find((function(e){return e.uid==t})).loading=!1,e.chatListScrollBottom()}}},insertChat:function(t){if(""!=t){var e=this.chatList.find((function(e){return e.uid==t}));if(e){var s={userId:this.userId,userName:"qgt",groupId:"qwertyuiop-poc",answer:e.aiContent,problem:e.content,file_id:e.fileid?e.fileid:"",alltext:e.aiContent,type:"chat",filename:e.filename,session_name:"pocAi-md"};Object(l["d"])(s).then((function(t){}))}}},getChatList:function(){var t=this;return new Promise((function(e,s){if(t.loading)return t.$toast("请稍等...");t.chatList=[],t.loading=!0;var a={userid:t.userId,groupid:"qwertyuiop-poc",session_name:"pocAi-md"};Object(l["c"])(a).then((function(s){var a=JSON.parse(s.FunctionResponse);if(a.length>0){for(var i=[],n=0;n<a.length;n++)i.push({loading:!1,role:"user",content:a[n].problem,uid:a[n].id,AI:"AI",aiContent:a[n].answer,oldContent:a[n].answer,isShowSynchronization:!1,filename:a[n].filename,index:n,is_mind_map:!1,fileid:a[n].fileid});t.chatList=i,t.loading=!1}else t.loading=!1;t.chatListScrollBottom(),e()})).catch((function(s){console.log(s),t.$toast.fail("获取对话记录失败"),t.loading=!1,e()}))}))},copy:function(t){var e=document.createElement("textarea");e.value=t.replace(/<[^>]+>/g,""),e.style.position="absolute",e.style.left="-9999px",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),this.$toast.success("复制成功")},setOpeningRemarksMessage:function(){var t=this;this.openingRemarksMessage=[[],[],[]];var e=null,s=null,a=null,i=["👋📚 親愛嘅同學,哈囉!👋","我係你嘅專屬學習夥伴,希望能夠陪住你喺學習旅程中一齊進步。🚀🌟","我對好多知識都有認識📚,仲有唔會厭煩嘅耐心👀,無論你係想學嘢,定係需要啲情感支持💖或者生活建議🛠,我都好樂意做你嘅聆聽者同指導者,成為你嘅最佳拍檔🧚♂️。"],n=[[],[],[]];n[0]=Array.from(i[0]),n[1]=Array.from(i[1]),n[2]=Array.from(i[2]);var o=n[0].length,c=n[1].length,r=n[2].length,l=0,u=0,h=0,p=50;e=setInterval((function(){if(t.isAllOpeningRemarks)return clearInterval(e),void(e=null);o>l?(t.openingRemarksMessage[0].push(n[0][l]),l++):(clearInterval(e),e=null,s=setInterval((function(){if(t.isAllOpeningRemarks)return clearInterval(s),void(s=null);c>u?(t.openingRemarksMessage[1].push(n[1][u]),u++):(clearInterval(s),s=null,a=setInterval((function(){if(t.isAllOpeningRemarks)return clearInterval(a),void(a=null);r>h?(t.openingRemarksMessage[2].push(n[2][h]),h++):(clearInterval(a),a=null,t.openingRemarksMessage[2]=n[2],t.isAllOpeningRemarks=!0,setTimeout((function(){t.openingRemarksAllFn()}),5e3))}),p))}),p))}),p)},openingRemarksAllFn:function(){if(this.isAllOpeningRemarks){if(this.userInfo.userId&&this.userInfo.userId==this.userId)return window.localStorage.setItem("showDialog",JSON.stringify({type:2,time:(new Date).getTime()})),void("pocStartIndex"==this.$route.name&&this.$router.push("/pocAiClassroom"));if(!this.showOpeningRemarks)return;this.showOpeningRemarks=!1,this.userInfo.userId&&(this.chatStatusType=2),this.startChat()}else this.isAllOpeningRemarks=!0,this.openingRemarksMessage=["👋📚 親愛嘅同學,哈囉!👋","我係你嘅專屬學習夥伴,希望能夠陪住你喺學習旅程中一齊進步。🚀🌟","我對好多知識都有認識📚,仲有唔會厭煩嘅耐心👀,無論你係想學嘢,定係需要啲情感支持💖或者生活建議🛠,我都好樂意做你嘅聆聽者同指導者,成為你嘅最佳拍檔🧚♂️。"]},startChat:function(){if(0==this.chatStatusType)this.chatList.push({role:"user",content:"",uid:"",AI:"AI",aiContent:"",chatStatusType:this.chatStatusType,oldContent:"",isShowSynchronization:!1,filename:"",createtime:(new Date).toLocaleString().replaceAll("/","-"),loading:!1}),this.chatListScrollBottom();else if(1==this.chatStatusType){if(!this.choseGrade)return this.chatStatusType=0,this.$toast("請選擇年級");this.chatList.push({role:"user",content:"".concat(this.choseGrade),uid:"",AI:"AI",aiContent:"你有冇鍾意嘅上堂方式,好似你鍾意邊種教學風格?係耐心細緻、例子講解更多啲,定係鍾意通過故事嚟學習?🤔可以揀多個選項㗎~ ",chatStatusType:this.chatStatusType,oldContent:"",isShowSynchronization:!1,filename:"",createtime:(new Date).toLocaleString().replaceAll("/","-"),loading:!1}),this.chatValue="",this.chatListScrollBottom()}else if(2==this.chatStatusType){if(0==this.userInfo.pleaseList.length)return this.chatStatusType=1,this.$toast("請選擇教學風格");this.chatList.push({role:"user",content:"".concat(this.chatValue),uid:"",AI:"AI",aiContent:"",chatStatusType:this.chatStatusType,oldContent:"",isShowSynchronization:!1,filename:"",createtime:(new Date).toLocaleString().replaceAll("/","-"),loading:!1}),this.chatValue="",this.chatListScrollBottom()}else 3==this.chatStatusType&&(this.chatList.push({role:"user",content:"開始選課",uid:"",AI:"AI",aiContent:"",chatStatusType:this.chatStatusType,oldContent:"",isShowSynchronization:!1,filename:"",createtime:(new Date).toLocaleString().replaceAll("/","-"),loading:!1}),this.chatValue="",this.chatListScrollBottom())},gradeChange:function(){var t=this;this.userInfo.grade=this.gradeList.findIndex((function(e){return e==t.choseGrade})),this.chatValue=this.choseGrade},chosePlease:function(t){1==this.chatStatusType&&(this.chosePleaseList.includes(t)?this.chosePleaseList=this.chosePleaseList.filter((function(e){return e!=t})):this.chosePleaseList.push(t),this.userInfo.pleaseList=this.chosePleaseList,this.chatValue=this.chosePleaseList.join("、"))},goChat:function(){var t=this;5!=this.chatStatusType&&(this.chatStatusType=5,this.isChatStatus=!1,this.$nextTick((function(){t.$refs.textAreaRef.focus()})))},courseSelection:function(){this.userInfo.userId?this.$router.push("/pocAiClassroom"):(5==this.chatStatusType||2==this.chatStatusType)&&(this.chatStatusType=3,this.startChat())},resetType3Form:function(){this.type3Form={subject:"",chapter:"",edition:""}},type3FormSubmit:function(){return""==this.type3Form.subject?this.$toast("请选择学科"):""==this.type3Form.chapter?this.$toast("请选择章节"):""==this.type3Form.edition?this.$toast("请选择版本"):(this.userInfo.subject=this.type3Form.subject,this.userInfo.chapter=this.type3Form.chapter,this.userInfo.edition=this.type3Form.edition,this.userInfo.userId=this.userId,this.userInfo.phone="",this.userInfo.birthday="",window.localStorage.setItem("userInfo",JSON.stringify(this.userInfo)),void this.$router.push("/pocAiClassroom"))},getUserInfoData:function(){var t=window.localStorage.getItem("userInfo");t&&(t=JSON.parse(t),t.userId==this.userId&&(this.userInfo=t))}},mounted:function(){this.setOpeningRemarksMessage(),this.getUserInfoData()}},p=h,d=(s("ab53"),s("2877")),g=Object(d["a"])(p,i,n,!1,null,"2c98b794",null);e["default"]=g.exports},6985:function(t,e,s){},"829b":function(t,e,s){"use strict";s("e7e5");var a=s("d399"),i=(s("d3b7"),s("bc3a")),n=s.n(i),o=s("4360"),c=s("4328"),r=s.n(c),l=n.a.create({});l.interceptors.request.use((function(t){return t.hideloading||a["a"].loading({forbidClick:!0}),"post"===t.method&&-1==t.url.indexOf("gpt4.cocorobo.cn")&&(t.data=r.a.stringify(t.data)),-1!=t.url.indexOf("gpt4.cocorobo.cn")&&(t.headers={"Content-Type":"application/json"},t.data=t.data),o["a"].getters.token&&(t.headers["X-Token"]=""),t}),(function(t){return console.log(t),Promise.reject(t)})),l.interceptors.response.use((function(t){a["a"].clear();var e=t.data;return e.status&&200!==e.status?(401===e.status&&o["a"].dispatch("FedLogOut").then((function(){location.reload()})),Promise.reject(e||"error")):Promise.resolve(e)}),(function(t){return a["a"].clear(),console.log("err"+t),Promise.reject(t)})),e["a"]=l},ab53:function(t,e,s){"use strict";s("6985")},becf:function(t,e,s){"use strict";var a=function(){var t=this,e=t._self._c;return e("div",{staticClass:"bar",style:{background:t.num?"#005CCD":"#f9f9f9",color:t.num?"#fff":"rgba(0, 0, 0, 0.90)"}},[0!==t.num||0!==t.backPage?e("div",{staticStyle:{position:"absolute",left:"10px"}},[e("van-icon",{attrs:{name:"arrow-left"},on:{click:t.back}})],1):t._e(),""!==t.tit?e("div",{staticClass:"barTitle",staticStyle:{"font-size":"20px"}},[t._v(" "+t._s(t.tit)+" ")]):e("div",[t._t("title")],2),t.setting?e("div",{staticStyle:{position:"absolute",right:"10px"}},[e("van-popover",{attrs:{placement:"bottom-end",trigger:"click"},scopedSlots:t._u([{key:"reference",fn:function(){return[t._t("settingIcon")]},proxy:!0}],null,!0),model:{value:t.showSetting,callback:function(e){t.showSetting=e},expression:"showSetting"}},[t._t("setting")],2)],1):t._e(),e("div",{staticStyle:{position:"absolute",right:"10px"}},[t._t("changeChapter")],2)])},i=[],n=(s("a9e3"),{bind:function(t,e){t.clickOutsideEvent=function(s){t===s.target||t.contains(s.target)||e.value(s)},document.addEventListener("click",t.clickOutsideEvent)},unbind:function(t){document.removeEventListener("click",t.clickOutsideEvent)}}),o={props:{tit:{type:String,default:""},num:{type:Number,default:0},backPage:{type:Number,default:0},setting:{type:Boolean,default:!1}},directives:{"click-outside":n},data:function(){return{barBackColor:"barBackColor",showSetting:!1}},methods:{back:function(){1==this.backPage?(console.log(this.backPage),this.$router.go(-1)):this.$emit("cutPage")},settingFn:function(){this.showSetting=!this.showSetting}}},c=o,r=(s("31e3"),s("2877")),l=Object(r["a"])(c,a,i,!1,null,"b6c036fa",null);e["a"]=l.exports},e8e8:function(t,e,s){t.exports=s.p+"static/img/defaultAvatar.762b260d.png"}}]);
|