import{d as h,u as z,m as S,o as T,c as O,w as l,a as t,b as e,_ as p,e as u,f as c,g as d,t as m,h as f,n as v,j as $,i as j}from"./index-CWMhB7z4.js";import{_ as w}from"./FieldGroup.vue_vue_type_script_setup_true_lang-DZ_H-YRf.js";import{g as R,a as U}from"./schema-meta-DWUHNP8E.js";const C={class:"grid grid-cols-2 gap-4"},q=h({name:"ShwfedHttpRequestOperationConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(y){const r=z(y,"modelValue"),_=S(()=>{}),a=o=>R(_,o)??o,n=o=>U(_,o),k={json:{type:"dyn",label:"HTTP 响应"}},E={json:{type:"dyn",label:"HTTP 响应"},result:{type:"string",label:"执行结果"}};function x(o){const s={...r.value,...o};for(const[i,V]of Object.entries(o))V===void 0&&Reflect.deleteProperty(s,i);r.value=s}function g(o,s){x({[o]:s.length===0?void 0:s})}function b(o){const s=o.every(i=>i.message.trim().length===0);x({description:s?void 0:o})}return(o,s)=>(T(),O(e(w),null,{default:l(()=>[t(e(p),{orientation:"vertical"},{default:l(()=>[t(e(u),{class:"text-xs text-zinc-500"},c({default:l(()=>[d(" "+m(a("expression")),1)]),_:2},[n("expression")?{name:"tooltip",fn:l(()=>[t(e(f),{source:n("expression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),t(e(v),{"model-value":r.value.expression,multiline:"",placeholder:"例：http.post('/api/foo').body({ id: row.id })","result-type":"HttpRequest",class:"min-h-16","onUpdate:modelValue":s[0]||(s[0]=i=>x({expression:i}))},null,8,["model-value"])]),_:1}),$("div",C,[t(e(p),{orientation:"vertical"},{default:l(()=>[t(e(u),{class:"text-xs text-zinc-500"},c({default:l(()=>[d(" "+m(a("resultExpression")),1)]),_:2},[n("resultExpression")?{name:"tooltip",fn:l(()=>[t(e(f),{source:n("resultExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),t(e(v),{"model-value":r.value.resultExpression??"",placeholder:"例：json.code == 0 ? 'success' : 'error'","result-type":"string","extra-vars":k,"onUpdate:modelValue":s[1]||(s[1]=i=>g("resultExpression",i))},null,8,["model-value"])]),_:1}),t(e(p),{orientation:"vertical"},{default:l(()=>[t(e(u),{class:"text-xs text-zinc-500"},c({default:l(()=>[d(" "+m(a("titleExpression")),1)]),_:2},[n("titleExpression")?{name:"tooltip",fn:l(()=>[t(e(f),{source:n("titleExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),t(e(v),{"model-value":r.value.titleExpression??"",placeholder:"例：result == 'error' ? '保存失败' : '保存成功'","result-type":"string","extra-vars":E,"onUpdate:modelValue":s[2]||(s[2]=i=>g("titleExpression",i))},null,8,["model-value"])]),_:1})]),t(e(p),{orientation:"vertical"},{default:l(()=>[t(e(u),{class:"text-xs text-zinc-500"},c({default:l(()=>[d(" "+m(a("description")),1)]),_:2},[n("description")?{name:"tooltip",fn:l(()=>[t(e(f),{source:n("description"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),t(e(j),{markdown:"","model-value":r.value.description,"onUpdate:modelValue":s[3]||(s[3]=i=>b(i))},null,8,["model-value"])]),_:1})]),_:1}))}});export{q as default};
