import{P as e,$ as a}from"./utils-lib.js?v=1761009159";import{c as s,r,o as l,v as i,x as d,e as t,B as o,z as u,y as n,T as m,ab as p,a9 as f,a7 as g}from"./base-lib.js?v=1761009159";import{setFileDeny as c}from"./site.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";const _={class:"p-20px"},b={class:"w-280px"},x={class:"w-280px"},y={class:"w-280px"},v=s({__name:"deny-form",props:{compData:{}},setup(s,{expose:v}){const w=s,{isEdit:V,siteName:q,row:j,getList:h}=w.compData,U=r(null),D=l({deny_name:"",suffix:"php|jsp",dir:""}),$={deny_name:[{required:!0,message:"请填写规则名称",trigger:"blur"},{required:!0,message:"请填写规则名称",trigger:"input"},{min:3,message:"规则名称至少需要3个字符",trigger:["blur","input"]}],suffix:[{required:!0,message:"请填写不允许的后缀",trigger:"blur"},{required:!0,message:"请填写不允许的后缀",trigger:"input"}],dir:[{required:!0,message:"请填写在此目录中引用的规则",trigger:"blur"},{required:!0,message:"请填写在此目录中引用的规则",trigger:"input"}]},k=e=>({...g(D),dir:D.dir.replace(/\/$/,"")+"/",website:q,act:e});return V&&j&&(D.deny_name=j.name,D.suffix=j.suffix,D.dir=j.dir),v({onConfirm:async a=>{var s;await(null==(s=U.value)?void 0:s.validate()),e({request:c(k(V?"edit":"add")),loading:V?"修改中...":"添加中...",message:!0,success:()=>{null==h||h(),a&&a()}})}}),(e,s)=>{const r=m,l=p,g=f,c=a;return i(),d("div",_,[t(g,{ref_key:"formRef",ref:U,model:n(D),rules:$},{default:o(()=>[t(l,{label:"名称",prop:"deny_name"},{default:o(()=>[u("div",b,[t(r,{modelValue:n(D).deny_name,"onUpdate:modelValue":s[0]||(s[0]=e=>n(D).deny_name=e),disabled:n(V),placeholder:"请填写规则名称"},null,8,["modelValue","disabled"])])]),_:1}),t(l,{label:"后缀",prop:"suffix"},{default:o(()=>[u("div",x,[t(r,{modelValue:n(D).suffix,"onUpdate:modelValue":s[1]||(s[1]=e=>n(D).suffix=e),placeholder:"不允许的后缀"},null,8,["modelValue"])])]),_:1}),t(l,{label:"路径",prop:"dir"},{default:o(()=>[u("div",y,[t(r,{modelValue:n(D).dir,"onUpdate:modelValue":s[2]||(s[2]=e=>n(D).dir=e),placeholder:"在此目录中引用的规则，例如：/a/"},null,8,["modelValue"])])]),_:1})]),_:1},8,["model"]),t(c,{options:[{content:"后缀：禁止访问的文件后缀"},{content:"访问路径：如需要禁止https://www.bt.cn/api/，则填写/api即可"}],class:"mt-4px"})])}}});export{v as default};
