1 |
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1931],{87149:function(e,t,r){Promise.resolve().then(r.bind(r,68926))},2478:function(e,t,r){"use strict";r.d(t,{q5:function(){return y},AT:function(){return c},hu:function(){return b},m$:function(){return x},gu:function(){return d},z9:function(){return u},n3:function(){return m},bG:function(){return h},AA:function(){return v},gS:function(){return g},n$:function(){return f},ek:function(){return p}});var n=r(28535),a=r(41085),o=r(18963);let i=async e=>{if(!e.headers)return e;let t=e.headers.get("content-type"),r=e.headers.get("content-disposition");return null===t?null:-1!==t.indexOf("application/json")?await e.json():-1!==t.indexOf("text/plain")?await e.text():null!=r&&-1!==r.indexOf("attachment")?await e.blob():e},s=async e=>{let t=await i(e),r=(null==t?void 0:t.message)||(null==t?void 0:t.errMessage)||t;switch(e.status){case 500:r="内部服务器错误,请稍后再试";break;case 401:(0,o.rf)();return;case 403:r="资源拒绝授权访问",(0,o.d6)(1e3);break;case 404:return;default:r="string"==typeof r&&""!==r?r:"操作失败,请稍后再试,或联系技术人员"}throw n.ZP.error(r),t},l=()=>{let e=async(e,t,r)=>{let n=(0,a.kG)(),l="".concat(n).concat(e).concat((null==t?void 0:t.params)?t.params:""),c=(null==t?void 0:t.body)?t.body instanceof FormData?{...t,body:t.body}:{...t,body:JSON.stringify(t.body)}:t,u={...null==t?void 0:t.headers,...(null==t?void 0:t.body)&&t.body instanceof FormData?{}:{"Content-type":"application/json"},Authorization:"Bearer ".concat((0,o.cw)())};return fetch(l,{...c,headers:u,signal:r}).then(async e=>{if(!e.ok)throw e;return i(e)}).catch(async e=>{await s(e)})};return{get:async(t,r)=>e(t,{...r,method:"get"}),post:async(t,r)=>e(t,{...r,method:"post"}),put:async(t,r)=>e(t,{...r,method:"put"}),patch:async(t,r)=>e(t,{...r,method:"patch"}),delete:async(t,r)=>e(t,{...r,method:"delete"})}},c=e=>l().post("/category/list",{body:e}),u=e=>l().post("/employee/search",{body:e}),d=e=>l().post("/employee/detail",{body:e}),f=e=>l().post("/gpts/user/login",{body:e}),p=e=>l().post("/gpts/user/password",{body:e}),g=e=>l().post("/gpts/user/update",{body:e}),h=()=>l().post("/gpts/user/info"),m=()=>l().post("/gpts/user/balance"),b=e=>l().post("/gpts/chat/message",{body:e}),x=e=>l().post("/gpts/chat/session",{body:e}),y=e=>l().post("/gpts/chat/session/delete",{body:e}),v=e=>l().post("/gpts/chat/session/rename",{body:e})},68926:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return u}});var n=r(82267),a=r(38786),o=r(5292),i=r(88904),s=r(63501),l=r(2478),c=r(87299);function u(){let e=(0,o.useRouter)(),t=(0,a.useRef)(null),{changeMenuIndex:r}=(0,s.useGlobalContext)(),[u,d]=(0,a.useState)([]),[f,p]=(0,a.useState)([]),[g,h]=(0,a.useState)(0),[m,b]=(0,a.useState)(""),[x,y]=(0,a.useState)(1),[v,w]=(0,a.useState)(!1),j=()=>{(0,l.z9)({page:x,pageSize:20,categoryId:g,title:m}).then(e=>{0===e.code&&null!==e.data.data?(p(t=>{let r=new Set(t.map(e=>e.id));return[...t,...e.data.data.filter(e=>!r.has(e.id))]}),e.data.total<=20&&w(!0)):w(!0)})},k=e=>{g!=e&&(w(!1),h(e),y(1),p([]))},N=()=>{w(!1),y(1),p([]),j()},S=t=>{(0,c.wj)(1),(0,c.M)(t),(0,c.$U)(""),e.push("/dialogue.html")},[O,I]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{r(2),(0,l.AT)({page:1,pageSize:20}).then(e=>{0===e.code&&d(e.data.data)}),j(),y(x+1)},[v,g]),(0,n.jsxs)("div",{className:"absolute top-0 w-full overflow-auto scroll-smooth h-calc-8 md:h-calc-5",onScroll:()=>{t.current&&t.current.scrollHeight-t.current.clientHeight===t.current.scrollTop&&y(e=>(j(),e+1))},ref:t,children:[(0,n.jsxs)("div",{className:"sticky top-0 z-50 dark:shadow-[rgba(255,255,255,.15)] backdrop-blur dark:bg-transparent transition-all",children:[(0,n.jsx)("div",{className:"flex flex-row justify-center pt-9",children:(0,n.jsxs)("div",{className:"w-11/12 md:basis-1/2 2xl:basis-1/3 relative",children:[(0,n.jsx)("input",{className:"w-full border rounded-full pl-4 pr-12 py-2 focus:border-[#0061ff] dark:focus:border-slate-700 focus:outline-none",type:"text",placeholder:"输入关键词查询智能体...",value:m,onChange:e=>{b(e.target.value)},onFocus:()=>I(!0),onBlur:()=>I(!1),onKeyDown:e=>{"Enter"===e.key&&N()}}),(0,n.jsx)("div",{className:"absolute right-0 top-0 py-2 mr-4 cursor-pointer ".concat(O?"text-[#0061ff]":"text-gray-400"),children:(0,n.jsx)(i.t2h,{size:24,onClick:N})})]})}),null!==u&&u.length>0&&(0,n.jsx)("div",{className:"flex flex-row justify-center py-4",children:(0,n.jsxs)("div",{className:"w-full md:container mx-auto flex flex-wrap justify-center gap-2 text-sm",children:[(0,n.jsx)("div",{className:"w-full md:hidden overflow-x-auto scroll-smooth focus:scroll-auto",children:(0,n.jsxs)("div",{className:"flex space-x-2 p-3",children:[(0,n.jsx)("button",{type:"button",className:"px-4 py-1 border rounded-full whitespace-nowrap ".concat(0==g?"bg-blue-50 dark:bg-blue-950 text-[#0061ff]":"text-gray-500 dark:text-gray-500 bg-white dark:bg-gray-800 hover:text-gray-900 dark:hover:text-white hover:bg-blue-50 dark:hover:bg-gray-800"),onClick:()=>k(0),children:"全部分类"}),u.map(e=>(0,n.jsx)("button",{type:"button",className:"px-4 py-1 border rounded-full whitespace-nowrap ".concat(g==e.id?"bg-blue-50 dark:bg-blue-950 text-[#0061ff]":"text-gray-500 dark:text-gray-500 bg-white dark:bg-gray-800 hover:text-gray-900 dark:hover:text-white hover:bg-blue-50 dark:hover:bg-gray-800"),onClick:()=>k(e.id),children:e.name},e.id))]})}),(0,n.jsxs)("div",{className:"hidden md:flex flex-wrap justify-center gap-2",children:[(0,n.jsx)("button",{type:"button",className:"px-4 py-1 border rounded-full ".concat(0==g?"bg-blue-50 dark:bg-blue-950 text-[#0061ff]":"text-gray-500 dark:text-gray-500 bg-white dark:bg-gray-800 hover:text-gray-900 dark:hover:text-white hover:bg-blue-50 dark:hover:bg-gray-800"),onClick:()=>k(0),children:"全部分类"}),u.map(e=>(0,n.jsx)("button",{type:"button",className:"px-4 py-1 border rounded-full ".concat(g==e.id?"bg-blue-50 dark:bg-blue-950 text-[#0061ff]":"text-gray-500 dark:text-gray-500 bg-white dark:bg-gray-800 hover:text-gray-900 dark:hover:text-white hover:bg-blue-50 dark:hover:bg-gray-800"),onClick:()=>k(e.id),children:e.name},e.id))]})]})})]}),null!==f&&f.length>0&&(0,n.jsxs)("section",{className:"text-gray-600 body-font",children:[(0,n.jsx)("div",{className:"container px-5 py-5 md:py-20 mx-auto",children:(0,n.jsx)("div",{className:"flex flex-wrap -m-4 text-sm",children:f.map(e=>(0,n.jsx)("div",{className:"p-4 w-full lg:w-1/2 xl:w-1/3 transition transform hover:-translate-y-1 motion-reduce:transition-none motion-reduce:hover:transform-none grow-0 ",children:(0,n.jsxs)("a",{onClick:()=>S(e.id),className:"relative block overflow-hidden rounded-lg border border-gray-100 dark:border-slate-700 p-4 sm:p-6 lg:p-8 shadow-md cursor-pointer hover:bg-blue-50 dark:hover:bg-blue-950",children:[(0,n.jsx)("span",{className:"absolute inset-x-0 bottom-0 h-2 bg-gradient-to-r from-[#0061ff] via-[#347bec] to-[#6c62fd]"}),(0,n.jsxs)("div",{className:"flex justify-between gap-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-lg font-bold text-gray-900 dark:text-white sm:text-xl text-ellipsis line-clamp-1 h-8",children:e.title}),(0,n.jsx)("p",{className:"mt-1 text-xs font-medium text-gray-600 text-ellipsis line-clamp-2 h-8",children:e.skill})]}),(0,n.jsx)("div",{className:"shrink-0",children:(0,n.jsx)("img",{alt:e.title,src:e.avatar,className:"size-16 object-contain"})})]}),(0,n.jsx)("div",{className:"mt-4",children:(0,n.jsx)("p",{className:"text-pretty text-sm text-gray-500 text-ellipsis line-clamp-4 h-20",children:e.estimate})})]})},e.id))})}),v&&(0,n.jsx)("div",{className:"w-full mx-auto text-center text-sm text-gray-400 dark:text-gray-600 pb-20 md:pb-6",children:"已显示全部智能体"})]}),null===f||0===f.length&&(0,n.jsxs)("div",{className:"w-full px-5 text-gray-200 flex flex-col mt-20",children:[(0,n.jsx)("div",{className:"flex justify-center",children:(0,n.jsx)(i.SFW,{className:"w-16 h-16 text-center"})}),(0,n.jsx)("div",{className:"text-center mt-4",children:"查询结果为空"})]})]})}},63501:function(e,t,r){"use strict";r.r(t),r.d(t,{GlobalProvider:function(){return i},useGlobalContext:function(){return s}});var n=r(82267),a=r(38786);let o=(0,a.createContext)(null),i=e=>{let{children:t}=e,[r,i]=(0,a.useState)(0),[s,l]=(0,a.useState)(!1),[c,u]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{},[]),(0,n.jsx)(o.Provider,{value:{menuIndex:r,changeMenuIndex:e=>{i(e)},loginShow:s,changeLoginShow:e=>{l(e)},uploadUserInfoState:c,changeUploadUserInfoState:e=>{u(e)}},children:t})},s=()=>(0,a.useContext)(o)},87299:function(e,t,r){"use strict";function n(e){let t=[];return e.forEach(e=>{e.query&&t.push({id:e.id,role:"user",parentId:"",model:"",content:e.query,createAt:e.createdAt,updateAt:e.createdAt}),e.answer&&t.push({id:e.id+"_assistant",role:"assistant",parentId:e.id,model:"",content:e.answer,createAt:e.createdAt,updateAt:e.createdAt})}),t}r.d(t,{$U:function(){return x},IF:function(){return h},L0:function(){return u},M:function(){return m},Pl:function(){return s},Rd:function(){return b},S3:function(){return y},ih:function(){return n},mp:function(){return c},nN:function(){return l},oK:function(){return i},wj:function(){return g}});let a="chat-model-list";function o(e){localStorage.setItem(a,JSON.stringify(e))}let i=()=>JSON.parse(localStorage.getItem(a)||"[]"),s=e=>{var t=i();return null===t?t=[{id:e.id,name:e.title,avatar:e.avatar,estimate:e.estimate,createdAt:e.createdAt,ConversationId:""}]:0>t.findIndex(t=>t.id==e.id)&&(t=[{id:e.id,name:e.title,avatar:e.avatar,estimate:e.estimate,createdAt:e.createdAt,ConversationId:""},...t]),o(t),t},l=(e,t)=>{var r=i();if(null!==r){var n=r.findIndex(t=>t.id==e);n>=0&&(""==r[n].ConversationId||r[n].ConversationId.includes("guid_0000_"))&&(r[n].ConversationId=t)}return o(r),r},c=e=>{var t=i();if(null!==t){var r=t.findIndex(t=>t.id==e);if(r>=0)return t[r]}return{id:0,name:"",avatar:"",estimate:"",createdAt:0,ConversationId:""}},u=e=>{var t=i();if(null!==t){var r=t.findIndex(t=>t.id==e);r>=0&&t.splice(r,1)}return o(t),e==b()&&(null!=t&&t.length>0?(g(1),m(t[0].id),x(t[0].ConversationId)):(g(1),m(0),x(""))),t},d="chat-used-list-type",f="chat-used-agent-id",p="chat-used-conversation-id",g=e=>{localStorage.setItem(d,JSON.stringify(e))},h=()=>{let e=0;if("undefined"==typeof localStorage)return e;let t=localStorage.getItem(d);return t&&(e=parseInt(null!=t?t:0)),e},m=e=>{localStorage.setItem(f,e.toString())},b=()=>{let e=0;if("undefined"==typeof localStorage)return e;let t=localStorage.getItem(f);return t&&(e=parseInt(null!=t?t:0)),e},x=e=>{localStorage.setItem(p,e)},y=()=>{let e="";if("undefined"==typeof localStorage)return e;let t=localStorage.getItem(p);return t&&(e=t),e}},41085:function(e,t,r){"use strict";r.d(t,{kG:function(){return a},tq:function(){return n}});let n=()=>{let e=void 0===window.navigator?"":navigator.userAgent;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|mobile|CriOS/i.test(e)},a=()=>"https://wxadminapi.gkscrm.com/wechat-api"},18963:function(e,t,r){"use strict";r.d(t,{Sm:function(){return i},cw:function(){return s},d6:function(){return o},rf:function(){return a}});let n=()=>"/login",a=()=>{location.href=n()},o=e=>{let t=()=>{location.href="/"};e?setTimeout(t,e):t()},i=(e,t)=>{localStorage.setItem("session",JSON.stringify({sessionId:e,expires:t}))},s=()=>{if("undefined"==typeof localStorage)return"";let e=JSON.parse(localStorage.getItem("session")||"{}");return(null==e?void 0:e.expires)&&(null==e?void 0:e.expires)>new Date().getTime()?e.sessionId:""}},5292:function(e,t,r){e.exports=r(31791)},66672:function(e,t,r){"use strict";r.d(t,{w_:function(){return u}});var n=r(38786),a={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},o=n.createContext&&n.createContext(a),i=["attr","size","title"];function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach(function(t){var n,a;n=t,a=r[t],(n=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(n))in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function u(e){return t=>n.createElement(d,s({attr:c({},e.attr)},t),function e(t){return t&&t.map((t,r)=>n.createElement(t.tag,c({key:r},t.attr),e(t.child)))}(e.child))}function d(e){var t=t=>{var r,{attr:a,size:o,title:l}=e,u=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,i),d=o||t.size||"1em";return t.className&&(r=t.className),e.className&&(r=(r?r+" ":"")+e.className),n.createElement("svg",s({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,a,u,{className:r,style:c(c({color:e.color||t.color},t.style),e.style),height:d,width:d,xmlns:"http://www.w3.org/2000/svg"}),l&&n.createElement("title",null,l),e.children)};return void 0!==o?n.createElement(o.Consumer,null,e=>t(e)):t(a)}}},function(e){e.O(0,[6407,9791,3463,7717,1744],function(){return e(e.s=87149)}),_N_E=e.O()}]);
|