import{d as q,O as z,k as g,l as $,r as R,o as c,x as j,z as m,b as o,a as t,F as J,h as P,u as h,c as I,t as x,A as C,B as S,M as X,G as Y,H as W,S as Z}from"./vue.1703796278973.js";import{M as ee,a0 as te,Y as oe,r as ae,aK as se,F as ne,K as le,av as pe,aw as ie,G as re,H as ue}from"./index.17037962789732.js";import"./index.170379627897334.js";import"./index.170379627897319.js";import"./index.170379627897327.js";import"./index.170379627897315.js";import"./index.170379627897318.js";import"./index.1703796278973305.js";import"./index.170379627897317.js";import"./index.1703796278973301.js";import"./index.1703796278973302.js";import"./index.170379627897332.js";import"./index.1703796278973303.js";import"./index.170379627897339.js";import"./index.170379627897316.js";import"./index.170379627897314.js";import"./index.1703796278973304.js";import{_ as me}from"./index.vue_vue_type_script_setup_true_name_ValueItem_lang.1703796278973.js";import"./index.170379627897336.js";import{u as ce}from"./instance.17037962789732.js";import{X as _e}from"./instance.1703796278973.js";import{_ as de}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"./index.170379627897337.js";import"./index.170379627897338.js";import"./index.170379627897329.js";import"./index.170379627897330.js";import"./index.170379627897325.js";import"./index.170379627897322.js";import"./index.170379627897323.js";import"./index.170379627897324.js";import"./style.1703796278973.js";import"./comm.1703796278973.js";import"./system.1703796278973.js";import"./index.170379627897333.js";import"./default.1703796278973.js";import"./permission.1703796278973.js";import"./consts.1703796278973.js";import"./404.1703796278973.js";const k=d=>(Y("data-v-26e2c13a"),d=d(),W(),d),fe={class:"simple-wrapper"},ve={class:"tips"},ye=k(()=>m("span",null,"精简模式下参数只支持输入框的方式录入",-1)),be=k(()=>m("template",{slot:"title"},[x(" 请按照json格式输入 ")],-1)),he={class:"editor-btn"},xe=k(()=>m("h6",null,"执行结果:",-1)),Te=q({__name:"Simple",setup(d){const B=ce(),E=z(),{proxy:l}=Z(),T=g(""),F=$(()=>JSON.parse(B.detail.metadata)),N=g([{title:"参数名称",dataIndex:"name",width:150,ellipsis:!0},{title:"输入类型",dataIndex:"type",width:150},{title:"值",dataIndex:"value"}]),f=g(""),O=$(()=>{var a;const s=[];return(a=F.value.functions)==null||a.forEach(u=>{var v;const p=[],i=u.inputs||u.properties;for(const e of i){const _=e.valueType?e.valueType.type:"-";_==="boolean"&&(e.valueType.elements=[{text:e.valueType.trueText,value:String(e.valueType.trueValue)},{text:e.valueType.falseText,value:String(e.valueType.falseValue)}]),p.push({id:e.id,name:e.name,type:_,format:e.valueType?e.valueType.format:void 0,options:e.valueType?e.valueType.elements:void 0,json:_==="object"?(v=e.json)==null?void 0:v.properties[0]:void 0,value:void 0})}s.push({...u,table:p,executeResult:""})}),s}),A=async s=>{l==null||l.$refs[`${s.id}Ref`][0].validate().then(async()=>{const a={};s.table.forEach(i=>{i.type==="object"?a[i.id]=JSON.parse(i.value):a[i.id]=i.value});const{success:u,result:p}=await _e(E.params.id,s.id,a);u&&(ee.success("操作成功"),f.value=p instanceof Array?p[0]:p,l==null||l.$forceUpdate())}).catch(a=>{console.log("err: ",a)})},K=s=>{f.value="",l==null||l.$refs[`${s.id}Ref`][0].resetFields()},U=s=>{f.value=""};return(s,a)=>{const u=R("AIcon"),p=te,i=R("Ellipsis"),v=oe,e=me,_=ae,L=se,M=ne,V=le,w=pe,D=ie,G=re,H=ue;return c(),j("div",fe,[m("div",ve,[o(p,null,{default:t(()=>[o(u,{type:"QuestionCircleOutlined"}),ye]),_:1})]),o(H,{modelValue:h(T),"onUpdate:modelValue":a[0]||(a[0]=n=>X(T)?T.value=n:null),"tab-position":"left",onChange:U,destroyInactiveTabPane:!0},{default:t(()=>[(c(!0),j(J,null,P(h(O),n=>(c(),I(G,{key:n.id},{tab:t(()=>[o(i,{style:{width:"100px","text-align":"left"}},{default:t(()=>[x(C(n.name),1)]),_:2},1024)]),default:t(()=>[o(D,{gutter:30},{default:t(()=>[o(w,{span:15},{default:t(()=>[o(M,{ref_for:!0,ref:`${n.id}Ref`,model:n},{default:t(()=>[o(L,{columns:h(N),"data-source":n.table,pagination:!1,rowKey:"id"},{bodyCell:t(({column:y,record:r,index:Q})=>[y.dataIndex==="type"?(c(),j(J,{key:0},[m("span",null,C(r.type),1),r.type==="object"?(c(),I(v,{key:0},{default:t(()=>[be,o(u,{type:"QuestionCircleOutlined",style:{marginLeft:"5px",cursor:"help"}})]),_:1})):S("",!0)],64)):S("",!0),y.dataIndex==="value"?(c(),I(_,{key:1,name:["table",Q,"value"],rules:{required:!0,message:"该字段为必填字段"},"has-feedback":""},{default:t(()=>[o(e,{ref_for:!0,ref:`valueItemRef${r.id}`,modelValue:r.value,"onUpdate:modelValue":b=>r.value=b,itemType:r.type,options:((r==null?void 0:r.options)||[]).map(b=>({label:b.text,value:b.value}))},null,8,["modelValue","onUpdate:modelValue","itemType","options"])]),_:2},1032,["name"])):S("",!0)]),_:2},1032,["columns","data-source"])]),_:2},1032,["model"]),m("div",he,[o(p,null,{default:t(()=>[o(V,{type:"primary",onClick:y=>A(n)},{default:t(()=>[x(" 执行 ")]),_:2},1032,["onClick"]),o(V,{type:"default",onClick:y=>K(n)},{default:t(()=>[x(" 清空 ")]),_:2},1032,["onClick"])]),_:2},1024)])]),_:2},1024),o(w,{span:9},{default:t(()=>[xe,m("span",{ref_for:!0,ref:`result${n.id}Ref`,class:"execute-result"},C(h(f)||""),513)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:1},8,["modelValue"])])}}});const ct=de(Te,[["__scopeId","data-v-26e2c13a"]]);export{ct as default};