File: /www/server/panel/BTPanel/static/js/index561.js
import{O as i,f as m}from"./utils-lib.js?v=1777008528";import{c as l,x as u,y as f,e as _,z as d,bm as E}from"./base-lib.js?v=1777008528";import{d as x,j as p,b as y,c as F,f as N}from"./form-item.js?v=1777008528";import{U as v,d as g,g as h,ab as C}from"./page12.js?v=1777008528";import"./__commonjsHelpers__.js?v=1777008528";import"./index110.js?v=1777008528";import"./use-file-editor.js?v=1777008528";import"./index432.js?v=1777008528";function w(){const n={type:1,uri:"",param:"",stype:"url"},{BtForm:r,param:e,validate:a}=i({data:()=>n,options:[x([p("类型","stype",v,{attrs:{class:"!w-[100px] mr-4"}}),y("","uri",{rules:[{required:!0,message:"请输入URL"}],attrs:{placeholder:"/path",class:"flex-1"}})]),F("参数值","param",{attrs:{placeholder:"默认为空参数,如需要填写多个参数一行一个",rows:3,class:"!w-[270px]"}}),p("验证方式","type",g,{attrs:{class:"!w-[160px] mr-4"}}),N("",h.map(s=>({content:s})))]});async function o(){return await a()&&await C(e.value.uri,JSON.stringify(e.value.param.replace(/\n/g,",").split(",").map(t=>t.trim()).filter(t=>t)),e.value.type,e.value.stype)?(m().success("添加成功"),!0):!1}return{BtForm:r,param:e,handleSubmit:o}}const O={class:"p-[20px]"},T=l({__name:"index",setup(n,{expose:r}){const e=E(),a=e==null?void 0:e.appContext.config.globalProperties.close,{BtForm:o,handleSubmit:s}=w();return r({onConfirm:async()=>await s()?(a==null||a(),!0):!1}),(c,t)=>(u(),f("div",O,[_(d(o))]))}});export{T as default};