import{a5 as A,a0 as F,n as M,D as O,a6 as V,I as q,cB as H}from"./index.17037962789732.js";import"./index.170379627897314.js";import"./index.170379627897315.js";import"./index.170379627897325.js";import"./index.170379627897322.js";import"./index.170379627897323.js";import"./index.170379627897326.js";import"./index.170379627897316.js";import"./index.170379627897317.js";import"./index.170379627897336.js";import{q as J}from"./scene.17037962789732.js";import{u as P}from"./scene.1703796278973.js";import{d as N,s as R,l as $,k as x,m as w,u as f,o as c,c as m,a as _,b as j,M as z,t as E,A as D,z as L,x as U,F as G}from"./vue.1703796278973.js";const Q={style:{color:"grey","margin-left":"5px"}},W=N({name:"NotifyBuildIn"}),pe=N({...W,props:{value:{type:Object,default:()=>({source:"fixed",value:void 0,upperKey:void 0})},item:{type:Object,default:()=>{}},name:{type:Number,default:0}},emits:["update:value","change"],setup(o,{emit:y}){var b;const u=o,B=P(),{data:I}=R(B),h=$(()=>{var t;return((t=u.value)==null?void 0:t.source)||"fixed"}),g=x([]),d=x((b=u.value)==null?void 0:b.upperKey),K=t=>{y("update:value",{...u.value,source:t,value:void 0})},v=(t,a,n,e)=>{var i;const l=(i=e==null?void 0:e.triggerNode)==null?void 0:i.props;let r="";l&&l.metadata&&(r=l.column),y("update:value",{...u.value,value:t,upperKey:a}),y("change",{sendTo:(n==null?void 0:n[0])||t},r)},C=(t,a)=>{if(Array.isArray(t)&&t.length){const n=[];return t.map(e=>{if(e.children){const l=C(e.children,a);l.length&&n.push({...e,title:e.name,value:e.id,disabled:!0,children:l})}else(e.type===a||a==="double"&&["int","float","double","long"].includes(e.type))&&n.push(e)}),n}else return[]};return w(()=>h.value,t=>{if(t==="upper"){const n=u.name-1>=0?{action:u.name-1}:void 0;J(f(I),n).then(e=>{var l,r;if(e.status===200){const i=C(e.result,((l=u.item.expands)==null?void 0:l.businessType)||((r=u.item)==null?void 0:r.type));g.value=i}})}},{deep:!0,immediate:!0}),w(()=>u.value.upperKey,t=>{d.value=t},{immediate:!0}),(t,a)=>{const n=A,e=F,l=M,r=O,i=V,S=q,T=H;return c(),m(T,{compact:""},{default:_(()=>{var k;return[j(n,{options:[{label:"手动输入",value:"fixed"},{label:"内置参数",value:"upper"}],style:{width:"120px"},value:(k=o.value)==null?void 0:k.source,onChange:K},null,8,["value"]),f(h)==="upper"?(c(),m(l,{key:0,value:f(d),"onUpdate:value":a[0]||(a[0]=s=>z(d)?d.value=s:null),treeData:f(g),placeholder:"请选择参数",style:{width:"calc(100% - 120px)"},fieldNames:{label:"name",value:"id"},onChange:a[1]||(a[1]=(s,p,Y)=>v(void 0,s,p,Y))},{title:_(({fullName:s,description:p})=>[j(e,null,{default:_(()=>[E(D(s)+" ",1),L("span",Q,D(p),1)]),_:2},1024)]),_:1},8,["value","treeData"])):(c(),U(G,{key:1},[o.item.type==="date"?(c(),m(r,{key:0,value:o.value.value,allowClear:"",format:"YYYY-MM-DD HH:mm:ss",style:{width:"calc(100% - 120px)"},onChange:a[2]||(a[2]=(s,p)=>v(p))},null,8,["value"])):o.item.type==="number"?(c(),m(i,{key:1,value:o.value.value,allowClear:"",style:{width:"calc(100% - 120px)"},placeholder:`请输入${o.item.name}`,onChange:v},null,8,["value","placeholder"])):(c(),m(S,{key:2,value:o.value.value,allowClear:"",style:{width:"calc(100% - 120px)"},placeholder:`请输入${o.item.name}`,onChange:a[3]||(a[3]=s=>v(s.target.value))},null,8,["value","placeholder"]))],64))]}),_:1})}}});export{pe as _};
