import{c as a,f as e,h as t,_ as l,u as i}from"./public.js?v=1763625242172";import{c as n}from"./page_layout.js?v=1763625242172";import{o as s,p as r,g as o}from"./setting.js?v=1763625242172";import{_ as p}from"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import{_ as u}from"./index99.js?v=1763625242172";import{k as f,P as c,r as g,e as d,R as m,S as _,X as v,a3 as y,U as S,V as b,j as W,a4 as h}from"./vue.js?v=1763625242172";import{dV as w,au as x,dP as j,aC as k}from"./naive.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";const $={class:"p-20px"},U={class:"w-100px mr-8px"},T={class:"w-220px"},R={class:"w-328px"},C={class:"w-100px"},L=f({__name:"form",props:{isEdit:{type:Boolean,default:!1}},emits:["refresh"],setup(a,{expose:e,emit:t}){const l=t,{t:i}=c(),n=g(null),r=d({sType:"url",uri:"",param:"",type:1}),o=[{label:i("Waf.Setting.config_75"),value:"url"},{label:i("Waf.Setting.config_76"),value:"regular"}],f=[{label:i("Waf.Setting.config_68"),value:1},{label:i("Waf.Setting.config_69"),value:2},{label:i("Waf.Setting.config_70"),value:3},{label:i("Waf.Setting.config_71"),value:4}],W={uri:{trigger:["blur","input"],validator:()=>""!==r.uri.trim()||new Error(i("Waf.Setting.config_55"))}};return e({onConfirm:async()=>{var a;await(null==(a=n.value)?void 0:a.validate()),await s({stype:r.sType,uri:r.uri,param:r.param.replace(/\n/g,",").split(","),type:r.type}),l("refresh")}}),(a,e)=>{const t=w,l=x,i=j,s=u,c=p;return m(),_("div",$,[v(c,{ref_key:"formRef",ref:n,model:b(r),rules:W},{default:y((()=>[v(i,{label:a.$t("Waf.Setting.config_73"),path:"uri"},{default:y((()=>[S("div",U,[v(t,{value:b(r).sType,"onUpdate:value":e[0]||(e[0]=a=>b(r).sType=a),options:o},null,8,["value"])]),S("div",T,[v(l,{value:b(r).uri,"onUpdate:value":e[1]||(e[1]=a=>b(r).uri=a),placeholder:"URL"},null,8,["value"])])])),_:1},8,["label"]),v(i,{label:a.$t("Waf.Setting.config_65"),path:"param"},{default:y((()=>[S("div",R,[v(s,{value:b(r).param,"onUpdate:value":e[2]||(e[2]=a=>b(r).param=a),rows:4,placeholder:a.$t("Waf.Setting.config_74")},null,8,["value","placeholder"])])])),_:1},8,["label"]),v(i,{label:a.$t("Waf.Setting.config_67"),path:"type","show-feedback":!1},{default:y((()=>[S("div",C,[v(t,{value:b(r).type,"onUpdate:value":e[3]||(e[3]=a=>b(r).type=a),"consistent-menu-width":!1,options:f},null,8,["value"])])])),_:1},8,["label"])])),_:1},8,["model"])])}}}),P={class:"p-20px"},B={class:"flex mb-16px"},E=f({__name:"config",setup(s){const{t:p}=c(),u=async()=>{var a;a={title:p("Waf.Setting.config_64"),data:{isEdit:!1}},i({title:a.title,width:550,footer:!0,data:{...a.data,onRefresh:()=>{w()}},component:L})},{table:f,columns:g,setLoading:d}=a([{key:"url",title:"URL",ellipsis:{tooltip:!0}},{key:"param",title:p("Waf.Setting.config_65"),width:120,ellipsis:{tooltip:!0},render:a=>a.param?a.param.join(", "):"--"},{key:"sType",title:p("Waf.Setting.config_66"),width:80,render:a=>"regular"==a.sType?p("Waf.Setting.config_72"):"URL"},{key:"type",title:p("Waf.Setting.config_67"),width:90,render:a=>{var e="";switch(a.type){case 1:e=p("Waf.Setting.config_68");break;case 2:e=p("Waf.Setting.config_69");break;case 3:e=p("Waf.Setting.config_70");break;case 4:e=p("Waf.Setting.config_71")}return e}},e({width:60,options:a=>[{label:p("Public.Btn.Del"),onClick:async()=>{await r({uri:a.url}),w()}}]})]),w=async()=>{try{d(!0);const{message:a}=await o();n(a)&&(f.data=Object.entries(a.url_cc_param).map((([a,e])=>({url:a,type:e.type,param:e.param,sType:e.stype}))))}finally{d(!1)}};return w(),(a,e)=>{const i=k,n=t,s=l;return m(),_("div",P,[S("div",B,[v(i,{type:"primary",onClick:u},{default:y((()=>[W(h(a.$t("Public.Btn.Add")),1)])),_:1})]),v(n,{"max-height":368,loading:b(f).loading,data:b(f).data,columns:b(g)},null,8,["loading","data","columns"]),v(s,{class:"mt-12px"},{default:y((()=>[S("li",null,h(a.$t("Waf.Setting.config_60")),1),S("li",null,h(a.$t("Waf.Setting.config_61")),1),S("li",null,h(a.$t("Waf.Setting.config_62")),1),S("li",null,h(a.$t("Waf.Setting.config_63")),1)])),_:1})])}}});export{E as default};
