Files
qhmes/web-dist/js/GraphreportAigcModal-BOcMV8Th.js
2026-06-16 18:19:57 +08:00

2 lines
4.9 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var F=Object.defineProperty,R=Object.defineProperties;var V=Object.getOwnPropertyDescriptors;var k=Object.getOwnPropertySymbols;var W=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable;var P=(a,o,t)=>o in a?F(a,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[o]=t,h=(a,o)=>{for(var t in o||(o={}))W.call(o,t)&&P(a,t,o[t]);if(k)for(var t of k(o))H.call(o,t)&&P(a,t,o[t]);return a},I=(a,o)=>R(a,V(o));var N=(a,o,t)=>new Promise((y,v)=>{var m=s=>{try{i(t.next(s))}catch(u){v(u)}},r=s=>{try{i(t.throw(s))}catch(u){v(u)}},i=s=>s.done?y(s.value):Promise.resolve(s.value).then(m,r);i((t=t.apply(a,o)).next())});import{B as U}from"./index-BDvqZ5j4.js";import{a4 as K,aO as Q,s as Y,dT as j,aH as J,aE as X,av as Z,aw as ee,bR as te,d as oe,au as ae}from"./index-X7Y8jykP.js";import{a as ne}from"./useModal-DaJ3Bflg.js";import{e as re,y as L,z as T,A as l,B as se,c as le,u as w,r as A,K as ie,f as c,Q as g,C as pe,F as ce,D as me,E as C,G as ue}from"./vue-vendor-DNhG1Cve.js";import"./BasicModal-xH56XuRZ.js";import"./ModalHeader-Sr8KwhJJ.js";import"./useTimeout-D5AmIBZw.js";import"./emoji-mart-vue-fast-R0uJEDq-.js";import"./index-BzChaRPg.js";import"./useWindowSizeFn-C-0M9_Ul.js";import"./index-ByCwbQDV.js";import"./index-Upeu4GGa.js";import"./index-C4wWpZeQ.js";import"./index-M9QP6cvf.js";import"./Skeleton-CimgOdM7.js";import"./useScrollTo-0FPEw5-K.js";import"./useIntersectionObserver-BGOgyKyu.js";import"./useAppInject-DPZGPcR3.js";import"./index-CuWaQdlK.js";import"./index-DO7ZhK45.js";const de={class:"aiWrap"},fe=re({__name:"GraphreportAigcModal",emits:["register","generate"],setup(a,{emit:o}){const t=a,y=o,v=Q(),{createMessage:m}=Y(),r=A({prompt:"",cgformTableName:void 0}),i=A(!0),[s,{closeModal:u,setModalProps:$}]=ne(()=>{O(),S(!1),r.value.prompt="",r.value.cgformTableName=void 0}),q=le(()=>{let n={width:600,height:240,title:"通过Ai生成图表",maskClosable:!1,canFullscreen:!1,confirmLoading:w(i)};return I(h(h(h({},n),w(v)),t),{onCancel:close,onRegister:s})});function S(n){i.value=n,$({confirmLoading:n})}const z=K(function(n){O(n)},500),B=A([]);function O(n=""){const d=`${n?`table_txt like '%25${n}%25' and `:""}is_db_synch='Y' and (table_type = 1 or table_type = 2)`;j(`onl_cgform_head,table_txt,table_name,${d} order by create_time desc`).then(f=>{B.value=f})}function E(){return N(this,null,function*(){yield G()})}function G(){return N(this,null,function*(){const{cgformTableName:n,prompt:e}=r.value;if(!n){m.warning("请选择Online表单");return}if(!e){m.warning("请输入图表需求");return}S(!0);try{const d="/online/graphreport/head/api/aigc?cgformTableName="+n+"&prompt="+e,{success:_,result:f,message:x}=yield oe.post({url:d,timeout:6e4},{isTransformResponse:!1});if(_){const{code:M,name:b,cgrSql:p}=f;M&&b&&p?(y("generate",f),u()):m.warn("生成失败Ai开小差了请稍后重试")}else m.error(x)}finally{S(!1)}})}function D(){u()}return(n,e)=>{const d=ee,_=Z,f=te,x=X,M=J,b=ie("a-button");return T(),L(w(U),se(q.value,{destroyOnClose:""}),{footer:l(()=>[c(b,{onClick:D},{default:l(()=>[...e[5]||(e[5]=[C("关闭",-1)])]),_:1}),c(b,{type:"primary",loading:i.value,preIcon:"carbon:ai-generate",onClick:E},{default:l(()=>[...e[6]||(e[6]=[C(" 立即生成 ",-1)])]),_:1},8,["loading"])]),default:l(()=>[c(M,{wrapperClassName:"p-2",spinning:i.value},{default:l(()=>[g("div",de,[e[3]||(e[3]=g("div",{class:"titleArea"},[g("svg",{t:"1707100353985",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4235",width:"26",height:"26"},[g("path",{d:"M512 64C264.8 64 64 264.8 64 512s200.8 448 448 448 448-200.8 448-448S759.2 64 512 64z m32 704h-64v-64h64v64z m11.2-203.2l-5.6 4.8c-3.2 2.4-5.6 8-5.6 12.8v58.4h-64v-58.4c0-24.8 11.2-48 29.6-63.2l5.6-4.8c56-44.8 83.2-68 83.2-108C598.4 358.4 560 320 512 320c-49.6 0-86.4 36.8-86.4 86.4h-64C361.6 322.4 428 256 512 256c83.2 0 150.4 67.2 150.4 150.4 0 72.8-49.6 112.8-107.2 158.4z","p-id":"4236",fill:"currentColor"})]),g("h3",null,"创建图表需要专业建议试试AI智能建表吧")],-1)),e[4]||(e[4]=g("p",{class:"tip"},"请选择Online表单并输入图表需求例如统计男生女生各自的数量",-1)),c(x,{class:"content",direction:"vertical"},{default:l(()=>[c(_,{value:r.value.cgformTableName,"onUpdate:value":e[0]||(e[0]=p=>r.value.cgformTableName=p),placeholder:"请选择Online表单","show-search":"","filter-option":!1,"not-found-content":"没有符合的表单",style:{width:"100%"},onSearch:w(z)},{default:l(()=>[(T(!0),pe(ce,null,me(B.value,p=>(T(),L(d,{value:p.value},{default:l(()=>[C(ue(p.text),1)]),_:2},1032,["value"]))),256)),c(d,{value:"2"},{default:l(()=>[...e[2]||(e[2]=[C("女",-1)])]),_:1})]),_:1},8,["value","onSearch"]),c(f,{value:r.value.prompt,"onUpdate:value":e[1]||(e[1]=p=>r.value.prompt=p),valueModifiers:{trim:!0},placeholder:"请输入图表需求",rows:3},null,8,["value"])]),_:1})])]),_:1},8,["spinning"])]),_:1},16)}}}),qe=ae(fe,[["__scopeId","data-v-cbfbeab1"]]);export{qe as default};