import{d as I,O as N,k as R,l as h,o as m,x as j,b as n,a as r,F as A,h as B,u as b,c as E,z as f,t as g,A as M,M as O,G as U,H as $,S as T}from"./vue.1703796278973.js";import{M as F,a7 as L,K as D,a0 as G,av as H,aw as K,G as z,H as P}from"./index.17037962789732.js";import"./index.170379627897334.js";import"./index.170379627897319.js";import"./index.170379627897327.js";import"./index.170379627897336.js";import"./index.170379627897315.js";import"./index.170379627897338.js";import{u as X}from"./instance.17037962789732.js";import{X as q}from"./instance.1703796278973.js";import{_ as Q}from"./_plugin-vue_export-helper.1703796278973.js";import"./index.17037962789733.js";import"./dayjs.min.1703796278973.js";import"./isArray.1703796278973.js";import"./editor.api.1703796278973.js";import"./preload-helper.1703796278973.js";import"./monaco.contribution.1703796278973.js";import"./comm.1703796278973.js";import"./system.1703796278973.js";import"./index.170379627897332.js";import"./index.170379627897333.js";import"./default.1703796278973.js";import"./permission.1703796278973.js";import"./consts.1703796278973.js";import"./404.1703796278973.js";const W=l=>(U("data-v-40387aad"),l=l(),$(),l),Y={class:"advance-wrapper"},Z={class:"editor-btn"},ee=W(()=>f("h6",null,"执行结果：",-1)),te={class:"execute-result"},oe=I({__name:"Advance",setup(l){const y=X(),V=N(),{proxy:i}=T(),p=R(""),x=h(()=>JSON.parse(y.detail.metadata)),S=h(()=>{var o;const t=[];return(o=x.value.functions)==null||o.forEach(e=>{const s={},d=e.inputs||e.properties;for(const c of d){const u=c.valueType?c.valueType.type:"-";s[c.id]=v(u,c.json)}t.push({...e,json:JSON.stringify(s),executeResult:""})}),t}),v=(t,o)=>{let e="";if(["int","long","float","double"].includes(t))e=0;else if(["string","date","enum","password","geoPoint"].includes(t))e="";else if(["boolean"].includes(t))e=!1;else if(["array"].includes(t))e=[];else if(["object"].includes(t)&&(e={},o)){const s=o.properties[0];e[s.id]=v(s.valueType.type)}return e},k=async t=>{const{success:o,result:e}=await q(V.params.id,t.id,JSON.parse(t.json));o&&(F.success("操作成功"),t.executeResult=e instanceof Array?e[0]:e,i==null||i.$forceUpdate())},w=t=>{t.json="",i==null||i.$forceUpdate()};return(t,o)=>{const e=L,s=D,d=G,c=H,u=K,C=z,J=P;return m(),j("div",Y,[n(J,{modelValue:b(p),"onUpdate:modelValue":o[0]||(o[0]=a=>O(p)?p.value=a:null),"tab-position":"left"},{default:r(()=>[(m(!0),j(A,null,B(b(S),a=>(m(),E(C,{key:a.id,tab:a.name},{default:r(()=>[n(u,{gutter:30},{default:r(()=>[n(c,{span:15},{default:r(()=>[n(e,{ref_for:!0,ref:`monacoEditor${a.id}`,modelValue:a.json,"onUpdate:modelValue":_=>a.json=_,theme:"vs-dark",style:{height:"400px"}},null,8,["modelValue","onUpdate:modelValue"]),f("div",Z,[n(d,null,{default:r(()=>[n(s,{type:"primary",onClick:_=>k(a)},{default:r(()=>[g(" 执行 ")]),_:2},1032,["onClick"]),n(s,{type:"default",onClick:_=>w(a)},{default:r(()=>[g(" 清空 ")]),_:2},1032,["onClick"])]),_:2},1024)])]),_:2},1024),n(c,{span:9},{default:r(()=>[ee,f("span",te,M(a.executeResult),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["tab"]))),128))]),_:1},8,["modelValue"])])}}});const Je=Q(oe,[["__scopeId","data-v-40387aad"]]);export{Je as default};
