import{K as e}from"./utils-lib.js?v=1761009159";import{c as t,g as r,v as a,N as o,y as l}from"./base-lib.js?v=1761009159";import{p as s}from"./useController18.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./site.js?v=1761009159";import"./column.js?v=1761009159";import"./index106.js?v=1761009159";import"./useStore4.js?v=1761009159";const p=t({__name:"error-redirect",props:{compData:{default:{}}},setup(t,{expose:p}){const i=t,{BtForm:m,submit:u}=e({data:()=>{if(i.compData.rowData){const{type:e,errorpage:t,redirecttype:r,topath:a,tourl:o}=i.compData.rowData;return{type:1===e,errorpage:String(t),redirecttype:r,topath:a,tourl:o}}return{type:!0,errorpage:"1",redirecttype:"301",topath:"/",tourl:""}},options:e=>r(()=>[{type:"switch",label:"开启重定向",key:"type"},{type:"select",label:"错误类型",key:"errorpage",options:[{label:"页面404",value:"1"}],attrs:{style:"width: 16rem"}},{type:"select",label:"重定向方式",key:"redirecttype",options:[{label:"301（永久重定向）",value:"301"},{label:"302（临时重定向）",value:"302"}],attrs:{style:"width: 16rem"}},{type:"select",label:"404错误重定向",key:"topath",options:[{label:"首页",value:"/"},{label:"自定义",value:""}],attrs:{style:"width: 16rem","empty-values":[null,void 0]}},...""===e.value.topath?[{type:"input",label:"重定向至",key:"tourl",attrs:{width:"24rem",placeholder:"例:http://www.bt.cn.com"},rules:[{required:!0,message:"请输入重定向地址",trigger:"blur"}]}]:[]]),submit:async(e,t)=>(await t(),await s(e.value))});return p({onConfirm:u}),(e,t)=>(a(),o(l(m),{class:"p-2rem"}))}});export{p as default};
