import{_ as e}from"./public.js?v=1764830988434";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang.js?v=1764830988434";import{aL as l,fN as s,m as d}from"./page_layout.js?v=1764830988434";import{k as t,P as i,r,e as u,R as n,V as o,W as v,a3 as b,S as _,U as m,j as p,a4 as x,N as D}from"./vue.js?v=1764830988434";import{dR as c,dV as f,au as B,av as h,df as w,dZ as j}from"./naive.js?v=1764830988434";import"./common.js?v=1764830988434";import"./__commonjsHelpers__.js?v=1764830988434";const g={class:"py-20px"},$={class:"w-260px"},R={class:"w-260px"},y={class:"w-260px"},U={class:"w-260px"},k=t({__name:"index",props:{data:{}},setup(t,{expose:k}){const{t:P}=i(),q=t,{row:E,sid:H,dbIdx:I,isEdit:N}=q.data,S=l(),V=r(null),z=u({db_idx:0,name:"",val:"",endtime:void 0}),A=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}]),C={name:{required:!0,message:P("Database.redis.index_1"),trigger:"blur"},val:{required:!0,message:P("Database.redis.index_4"),trigger:"blur"}};return-1!==I&&(z.db_idx=I),N&&E&&(z.name=E.name,z.val=E.val,z.endtime=E.endtime?E.endtime:void 0),k({onConfirm:async()=>{var e;await(null==(e=V.value)?void 0:e.validate());const a=(()=>{if(null===H)throw d.error(P("Database.redis.index_8")),new Error(P("Database.redis.index_9"));const e={...D(z),sid:H};return void 0===e.endtime&&delete e.endtime,e})();await s(a),S.setRefresh(!0),S.setAddRedisId(a.db_idx)}}),(l,s)=>{const d=f,t=c,i=B,r=w,u=j,D=h,k=a,P=e;return o(),n("div",g,[v(k,{ref_key:"formRef",ref:V,model:m(z),rules:C},{default:b(()=>[v(t,{label:l.$t("Site.PHP.add_site_16"),path:"db_idx"},{default:b(()=>[_("div",$,[v(d,{value:m(z).db_idx,"onUpdate:value":s[0]||(s[0]=e=>m(z).db_idx=e),options:m(A),disabled:m(N)},null,8,["value","options","disabled"])])]),_:1},8,["label"]),v(t,{label:l.$t("Database.redis.index_2"),path:"name"},{default:b(()=>[_("div",R,[v(i,{value:m(z).name,"onUpdate:value":s[1]||(s[1]=e=>m(z).name=e),disabled:m(N),placeholder:l.$t("Database.redis.index_1")},null,8,["value","disabled","placeholder"])])]),_:1},8,["label"]),v(t,{label:l.$t("Database.redis.index_3"),path:"val"},{default:b(()=>[_("div",y,[v(i,{value:m(z).val,"onUpdate:value":s[2]||(s[2]=e=>m(z).val=e),type:"textarea",autosize:{minRows:4,maxRows:4},placeholder:l.$t("Database.redis.index_4")},null,8,["value","placeholder"])])]),_:1},8,["label"]),v(t,{label:l.$t("Database.redis.index_5"),"show-feedback":!1},{default:b(()=>[_("div",U,[v(D,null,{default:b(()=>[v(r,{value:m(z).endtime,"onUpdate:value":s[3]||(s[3]=e=>m(z).endtime=e),class:"flex-1",min:0,"show-button":!1,placeholder:l.$t("Database.redis.index_6")},null,8,["value","placeholder"]),v(u,null,{default:b(()=>s[4]||(s[4]=[p("sec",-1)])),_:1,__:[4]})]),_:1})])]),_:1},8,["label"])]),_:1},8,["model"]),v(P,{class:"mt-24px px-20px"},{default:b(()=>[_("li",null,x(l.$t("Database.redis.index_7")),1)]),_:1})])}}});export{k as default};
