Files
qhmes/deploy-qhmes/frontend/js/AiAppSendModal-B83b_UCH.js
2026-05-15 11:34:12 +08:00

13 lines
6.2 KiB
Java

var I=(h,t,l)=>new Promise((e,v)=>{var n=a=>{try{s(l.next(a))}catch(y){v(y)}},p=a=>{try{s(l.throw(a))}catch(y){v(y)}},s=a=>a.done?e(a.value):Promise.resolve(a.value).then(n,p);s((l=l.apply(h,t)).next())});import{f as b,ah as g,ar as u,as as f,k as r,aF as _,ag as C,A as B,G as N,au as i,at as U,av as S}from"./vue-vendor-C7Zq48Yl.js";import{M as A}from"./BasicModal-0sAdFEk_.js";import"./index-Du0A3ksf.js";import{B as K}from"./BasicForm-BJnSRkIE.js";import{u as V,ak as E,a8 as j,bO as q,bP as F,d as O}from"./index-BI6CMai0.js";import"./ModalHeader-keHdAHWH.js";import"./antd-vue-vendor-BPnV8VqP.js";import"./useTimeout-DDl4l82I.js";import"./vxe-table-vendor-B88kchpX.js";import"./index-DeEq83Ov.js";import"./useWindowSizeFn-PRZSD86C.js";import"./index-pxs5MULf.js";import"./index-BgYCgfME.js";import"./index-f8O7TghW.js";import"./useIntersectionObserver-BMxdTqP3.js";import"./componentMap-BBZeqR-K.js";import"./useFormItem-BdW6EoZe.js";import"./download-UE0L9Rfp.js";import"./base64Conver-24EVOS6V.js";import"./index-CIBZG4nR.js";import"./index-BhQEwnQQ.js";import"./useCountdown-DqnNWBp6.js";import"./useFormItemSingle-BbRhswfn.js";import"./JSelectUser-B71zikzw.js";import"./props-DAezUTeZ.js";import"./JSelectBiz-CnEaVMUF.js";import"./JAddInput-D6qcyZjQ.js";import"./areaDataUtil-CbYCy3Ig.js";import"./index-CNkz_PUv.js";import"./index-CUdllngZ.js";import"./bem-EhXRi4nW.js";import"./props-D4vdsy3J.js";import"./useContextMenu-Cwx1lIOK.js";import"./depart.api-DeMNV8zW.js";import"./TreeIcon-DE4jdeZV.js";import"./JSelectDept-DRDVeruW.js";import"./JPopup-Bva6u6tk.js";import"./usePopBiz-CG0vVpgI.js";import"./useMethods-DVip17X8.js";import"./index-Dg4HCEvo.js";import"./JEllipsis-DqRFTSm0.js";import"./JUpload-Cz9HN61B.js";import"./index-MGIrEF-A.js";import"./index-MREkPhsT.js";const P={name:"AiAppSendModal",components:{BasicForm:K,BasicModal:A},emits:["success","register"],setup(h,{emit:t}){const l=b("嵌入网站"),e=V(),v=b("web"),n=b({}),p=b("800px"),s=b(1),[a,{closeModal:y,setModalProps:w}]=E(o=>I(null,null,function*(){v.value=o.type,n.value=o.data,n.value.menu="/ai/chat/"+o.data.id,s.value=1;let d=220;o.type==="web"?(l.value="嵌入网站",p.value="640px",d=500):(l.value="配置菜单",p.value="500px"),w({height:d,bodyStyle:{padding:"10px"}})}));function k(){x(n.value.menu)}function m(){const o=`INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('${j()}', NULL, '${n.value.name}', '${n.value.menu}', '1', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 0, 1, 0, 0, 0, NULL, '1', 0, 0, 'admin', null, NULL, NULL, 0)`;x(o)}function L(o){let d=document.location.protocol+"//"+window.location.host;if(o===1)return`<iframe
src="`+d+"/ai/app/chat/"+n.value.id+`"
style="width: 100%; height: 100%;">
</iframe>`;{let M="/src/views/super/airag/aiapp/chat/js/chat.js";q()||(M="/chat/chat.js");let c="<script src="+d+M+' id="e7e007dd52f67fe36365eff636bbffbd"><\/script>';return c+=`
<script>
`,c+=` createAiChat({
appId:"`+n.value.id+`",
`,c+=` // 支持top-left左上, top-right右上, bottom-left左下, bottom-right右下
`,c+=` iconPosition:"bottom-right"
`,c+=` })
`,c+=" <\/script>",c}}function T(o){x(L(o))}function x(o){const d=F(o);return d?e.createMessage.success("复制成功!"):e.createMessage.error("复制失败!"),d}function D(o){s.value=o}return{registerModal:a,title:l,type:v,appData:n,copySql:m,copyMenu:k,width:p,copyIframe:T,getIframeText:L,activeKey:s,handleImageClick:D}}},R="/assets/webEmbedded-CZQ1vnZk.png",z="/assets/iconWebEmbedded-Lzlg_TVw.png",Q={class:"p-2"},Z={key:0},G={key:1,class:"web"},H={style:{display:"flex",margin:"0 auto"}},W={key:0,class:"web-title"},J={key:1,class:"web-title"},X={key:2,class:"web-code"},Y={class:"web-code-title"},$={class:"web-code-iframe"},ee={key:3,class:"web-code"},te={class:"web-code-title"},oe={class:"web-code-iframe"};function ie(h,t,l,e,v,n){const p=g("a-input"),s=g("a-form-item"),a=g("a-button"),y=g("a-form"),w=g("Icon"),k=g("BasicModal");return f(),u("div",Q,[r(k,{destroyOnClose:"",onRegister:e.registerModal,canFullscreen:!1,width:e.width,title:e.title,footer:null},{default:_(()=>[e.type==="menu"?(f(),u("div",Z,[r(y,{layout:"vertical",model:e.appData},{default:_(()=>[r(s,{label:"菜单名称"},{default:_(()=>[r(p,{value:e.appData.name,"onUpdate:value":t[0]||(t[0]=m=>e.appData.name=m),readonly:""},null,8,["value"])]),_:1}),r(s,{label:"菜单地址"},{default:_(()=>[r(p,{value:e.appData.menu,"onUpdate:value":t[1]||(t[1]=m=>e.appData.menu=m),readonly:""},null,8,["value"])]),_:1}),r(s,{style:{"text-align":"right"}},{default:_(()=>[r(a,{onClick:B(e.copyMenu,["prevent"])},{default:_(()=>[...t[6]||(t[6]=[N("复制菜单",-1)])]),_:1},8,["onClick"]),r(a,{type:"primary",style:{"margin-left":"10px"},onClick:e.copySql},{default:_(()=>[...t[7]||(t[7]=[N("复制SQL",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])])):e.type==="web"?(f(),u("div",G,[i("div",H,[i("div",{class:U([e.activeKey===1?"active":"","web-img"]),onClick:t[2]||(t[2]=m=>e.handleImageClick(1))},[...t[8]||(t[8]=[i("img",{src:R},null,-1)])],2),i("div",{style:{"margin-left":"10px"},class:U([e.activeKey===2?"active":"","web-img"]),onClick:t[3]||(t[3]=m=>e.handleImageClick(2))},[...t[9]||(t[9]=[i("img",{src:z},null,-1)])],2)]),e.activeKey===1?(f(),u("div",W," 将以下 iframe 嵌入到你的网站中的目标位置 ")):(f(),u("div",J," 将以下 script 添加到网页的body区域中 ")),e.activeKey===1?(f(),u("div",X,[i("div",Y,[t[10]||(t[10]=i("div",{class:"web-code-desc"}," html ",-1)),r(w,{class:"pointer",icon:"ant-design:copy-outlined",onClick:t[4]||(t[4]=m=>e.copyIframe(1))})]),i("div",$,[i("pre",null," "+S(e.getIframeText(1))+" ",1)])])):C("",!0),e.activeKey===2?(f(),u("div",ee,[i("div",te,[t[11]||(t[11]=i("div",{class:"web-code-desc"}," html ",-1)),r(w,{class:"pointer",icon:"ant-design:copy-outlined",onClick:t[5]||(t[5]=m=>e.copyIframe(2))})]),i("div",oe,[i("pre",null," "+S(e.getIframeText(2))+" ",1)])])):C("",!0)])):C("",!0)]),_:1},8,["onRegister","width","title"])])}const We=O(P,[["render",ie],["__scopeId","data-v-80f032b3"]]);export{We as default};