import{_ as e}from"./public.js?v=1753954525509";import{_ as a}from"./index.vue_vue_type_script_setup_true_lang.js?v=1753954525509";import{b1 as l,eZ as s,m as d}from"./page_layout.js?v=1753954525509";import{k as t,P as i,r,e as u,U as n,V as o,Q as b,a2 as v,W as _,X as m,j as p,a3 as x,N as c}from"./vue.js?v=1753954525509";import{cG as D,cA as f,aq as B,c1 as h,cI as w,av as j}from"./naive.js?v=1753954525509";import"./common.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";const g={class:"py-20px"},$={class:"w-260px"},y={class:"w-260px"},R={class:"w-260px"},U={class:"w-260px"},k=t({__name:"index",props:{data:{}},setup(t,{expose:k}){const{t:q}=i(),I=t,{row:P,sid:A,dbIdx:E,isEdit:H}=I.data,z=l(),C=r(null),G=u({db_idx:0,name:"",val:"",endtime:void 0}),N=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}]),Q={name:{required:!0,message:q("Database.redis.index_1"),trigger:"blur"},val:{required:!0,message:q("Database.redis.index_4"),trigger:"blur"}};return-1!==E&&(G.db_idx=E),H&&P&&(G.name=P.name,G.val=P.val,G.endtime=P.endtime?P.endtime:void 0),k({onConfirm:async()=>{var e;await(null==(e=C.value)?void 0:e.validate());const a=(()=>{if(null===A)throw d.error(q("Database.redis.index_8")),new Error(q("Database.redis.index_9"));const e={...c(G),sid:A};return void 0===e.endtime&&delete e.endtime,e})();await s(a),z.setRefresh(!0),z.setAddRedisId(a.db_idx)}}),(l,s)=>{const d=D,t=f,i=B,r=h,u=w,c=j,k=a,q=e;return n(),o("div",g,[b(k,{ref_key:"formRef",ref:C,model:m(G),rules:Q},{default:v((()=>[b(t,{label:l.$t("Site.PHP.add_site_16"),path:"db_idx"},{default:v((()=>[_("div",$,[b(d,{value:m(G).db_idx,"onUpdate:value":s[0]||(s[0]=e=>m(G).db_idx=e),options:m(N),disabled:m(H)},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(G).name,"onUpdate:value":s[1]||(s[1]=e=>m(G).name=e),disabled:m(H),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(G).val,"onUpdate:value":s[2]||(s[2]=e=>m(G).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(c,null,{default:v((()=>[b(r,{value:m(G).endtime,"onUpdate:value":s[3]||(s[3]=e=>m(G).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(q,{class:"mt-24px px-20px"},{default:v((()=>[_("li",null,x(l.$t("Database.redis.index_7")),1)])),_:1})])}}});export{k as default};
