import{_ as e}from"./public.js?v=1763625242172";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import{bn as l,fU as s,m as d}from"./page_layout.js?v=1763625242172";import{k as t,P as i,r,e as u,R as n,S as o,X as b,a3 as v,U as _,V as m,j as p,a4 as x,N as D}from"./vue.js?v=1763625242172";import{dV as c,dP as f,au as B,df as h,dY as w,az as j}from"./naive.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";const g={class:"py-20px"},$={class:"w-260px"},y={class:"w-260px"},R={class:"w-260px"},U={class:"w-260px"},P=t({__name:"index",props:{data:{}},setup(t,{expose:P}){const{t:k}=i(),q=t,{row:z,sid:E,dbIdx:H,isEdit:I}=q.data,S=l(),V=r(null),A=u({db_idx:0,name:"",val:"",endtime:void 0}),C=r([{label:"DB0",value:0},{label:"DB1",value:1},{label:"DB2",value:2},{label:"DB3",value:3},{label:"DB4",value:4},{label:"DB5",value:5},{label:"DB6",value:6},{label:"DB7",value:7},{label:"DB8",value:8},{label:"DB9",value:9},{label:"DB10",value:10},{label:"DB11",value:11},{label:"DB12",value:12},{label:"DB13",value:13},{label:"DB14",value:14},{label:"DB15",value:15}]),N={name:{required:!0,message:k("Database.redis.index_1"),trigger:"blur"},val:{required:!0,message:k("Database.redis.index_4"),trigger:"blur"}};return-1!==H&&(A.db_idx=H),I&&z&&(A.name=z.name,A.val=z.val,A.endtime=z.endtime?z.endtime:void 0),P({onConfirm:async()=>{var e;await(null==(e=V.value)?void 0:e.validate());const a=(()=>{if(null===E)throw d.error(k("Database.redis.index_8")),new Error(k("Database.redis.index_9"));const e={...D(A),sid:E};return void 0===e.endtime&&delete e.endtime,e})();await s(a),S.setRefresh(!0),S.setAddRedisId(a.db_idx)}}),(l,s)=>{const d=c,t=f,i=B,r=h,u=w,D=j,P=a,k=e;return n(),o("div",g,[b(P,{ref_key:"formRef",ref:V,model:m(A),rules:N},{default:v((()=>[b(t,{label:l.$t("Site.PHP.add_site_16"),path:"db_idx"},{default:v((()=>[_("div",$,[b(d,{value:m(A).db_idx,"onUpdate:value":s[0]||(s[0]=e=>m(A).db_idx=e),options:m(C),disabled:m(I)},null,8,["value","options","disabled"])])])),_:1},8,["label"]),b(t,{label:l.$t("Database.redis.index_2"),path:"name"},{default:v((()=>[_("div",y,[b(i,{value:m(A).name,"onUpdate:value":s[1]||(s[1]=e=>m(A).name=e),disabled:m(I),placeholder:l.$t("Database.redis.index_1")},null,8,["value","disabled","placeholder"])])])),_:1},8,["label"]),b(t,{label:l.$t("Database.redis.index_3"),path:"val"},{default:v((()=>[_("div",R,[b(i,{value:m(A).val,"onUpdate:value":s[2]||(s[2]=e=>m(A).val=e),type:"textarea",autosize:{minRows:4,maxRows:4},placeholder:l.$t("Database.redis.index_4")},null,8,["value","placeholder"])])])),_:1},8,["label"]),b(t,{label:l.$t("Database.redis.index_5"),"show-feedback":!1},{default:v((()=>[_("div",U,[b(D,null,{default:v((()=>[b(r,{value:m(A).endtime,"onUpdate:value":s[3]||(s[3]=e=>m(A).endtime=e),class:"flex-1",min:0,"show-button":!1,placeholder:l.$t("Database.redis.index_6")},null,8,["value","placeholder"]),b(u,null,{default:v((()=>s[4]||(s[4]=[p("sec")]))),_:1,__:[4]})])),_:1})])])),_:1},8,["label"])])),_:1},8,["model"]),b(k,{class:"mt-24px px-20px"},{default:v((()=>[_("li",null,x(l.$t("Database.redis.index_7")),1)])),_:1})])}}});export{P as default};
