import{_ as B}from"./index-DIKmrNCq.js?v=1773287522785";import{_ as C}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{i as R,p as L}from"./index-BTglIPU2.js?v=1773287522785";import{u as P}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import{u as j}from"./useTableData-BmkIKQ_R.js?v=1773287522785";import{o as E,p as O,g as A}from"./setting-DouXuJGW.js?v=1773287522785";import{_ as D}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{_ as N}from"./index-CZps0rIN.js?v=1773287522785";import{k as W,R as h,r as V,e as F,$ as w,Z as $,a0 as i,a9 as u,_ as r,S as n,j as G,aa as m}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{a1 as I,a6 as M,b as Z,B as q}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./data-BVsViUMm.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./copy-D-wIKr0q.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785";import"./index-Cg6fMjw6.js?v=1773287522785";const z={class:"p-20px"},H={class:"w-100px mr-8px"},J={class:"w-220px"},K={class:"w-328px"},Q={class:"w-100px"},X=W({__name:"form",props:{isEdit:{type:Boolean,default:!1}},emits:["refresh"],setup(k,{expose:a,emit:d}){const y=d,{t:o}=h(),g=V(null),e=F({sType:"url",uri:"",param:"",type:1}),c=[{label:o("Waf.Setting.config_75"),value:"url"},{label:o("Waf.Setting.config_76"),value:"regular"}],t=[{label:o("Waf.Setting.config_68"),value:1},{label:o("Waf.Setting.config_69"),value:2},{label:o("Waf.Setting.config_70"),value:3},{label:o("Waf.Setting.config_71"),value:4}],s={uri:{trigger:["blur","input"],validator:()=>e.uri.trim()===""?new Error(o("Waf.Setting.config_55")):!0}},_=()=>({stype:e.sType,uri:e.uri,param:e.param.replace(/\n/g,",").split(","),type:e.type});return a({onConfirm:async()=>{var l;await((l=g.value)==null?void 0:l.validate()),await E(_()),y("refresh")}}),(l,p)=>{const S=M,T=Z,b=I,x=N,U=D;return w(),$("div",z,[i(U,{ref_key:"formRef",ref:g,model:n(e),rules:s},{default:u(()=>[i(b,{label:l.$t("Waf.Setting.config_73"),path:"uri"},{default:u(()=>[r("div",H,[i(S,{value:n(e).sType,"onUpdate:value":p[0]||(p[0]=f=>n(e).sType=f),options:c},null,8,["value"])]),r("div",J,[i(T,{value:n(e).uri,"onUpdate:value":p[1]||(p[1]=f=>n(e).uri=f),placeholder:"URL"},null,8,["value"])])]),_:1},8,["label"]),i(b,{label:l.$t("Waf.Setting.config_65"),path:"param"},{default:u(()=>[r("div",K,[i(x,{value:n(e).param,"onUpdate:value":p[2]||(p[2]=f=>n(e).param=f),rows:4,placeholder:l.$t("Waf.Setting.config_74")},null,8,["value","placeholder"])])]),_:1},8,["label"]),i(b,{label:l.$t("Waf.Setting.config_67"),path:"type","show-feedback":!1},{default:u(()=>[r("div",Q,[i(S,{value:n(e).type,"onUpdate:value":p[3]||(p[3]=f=>n(e).type=f),"consistent-menu-width":!1,options:t},null,8,["value"])])]),_:1},8,["label"])]),_:1},8,["model"])])}}}),Y={class:"p-20px"},tt={class:"flex mb-16px"},yt=W({__name:"config",setup(k){const{t:a}=h(),d=t=>{L({title:t.title,width:550,footer:!0,data:{...t.data,onRefresh:()=>{c()}},component:X})},y=async()=>{d({title:a("Waf.Setting.config_64"),data:{isEdit:!1}})},{table:o,columns:g,setLoading:e}=j([{key:"url",title:"URL",ellipsis:{tooltip:!0}},{key:"param",title:a("Waf.Setting.config_65"),width:120,ellipsis:{tooltip:!0},render:t=>t.param?t.param.join(", "):"--"},{key:"sType",title:a("Waf.Setting.config_66"),width:80,render:t=>t.sType=="regular"?a("Waf.Setting.config_72"):"URL"},{key:"type",title:a("Waf.Setting.config_67"),width:90,render:t=>{var s="";switch(t.type){case 1:s=a("Waf.Setting.config_68");break;case 2:s=a("Waf.Setting.config_69");break;case 3:s=a("Waf.Setting.config_70");break;case 4:s=a("Waf.Setting.config_71");break}return s}},P({width:60,options:t=>[{label:a("Public.Btn.Del"),onClick:async()=>{await O({uri:t.url}),c()}}]})]),c=async()=>{try{e(!0);const{message:t}=await A();R(t)&&(o.data=Object.entries(t.url_cc_param).map(([s,_])=>({url:s,type:_.type,param:_.param,sType:_.stype})))}finally{e(!1)}};return c(),(t,s)=>{const _=q,v=C,l=B;return w(),$("div",Y,[r("div",tt,[i(_,{type:"primary",onClick:y},{default:u(()=>[G(m(t.$t("Public.Btn.Add")),1)]),_:1})]),i(v,{"max-height":368,loading:n(o).loading,data:n(o).data,columns:n(g)},null,8,["loading","data","columns"]),i(l,{class:"mt-12px"},{default:u(()=>[r("li",null,m(t.$t("Waf.Setting.config_60")),1),r("li",null,m(t.$t("Waf.Setting.config_61")),1),r("li",null,m(t.$t("Waf.Setting.config_62")),1),r("li",null,m(t.$t("Waf.Setting.config_63")),1)]),_:1})])}}});export{yt as default};
