import{_ as C}from"./index-DIKmrNCq.js?v=1773287522785";import{_ as E}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{gz as I,m as P}from"./index-BTglIPU2.js?v=1773287522785";import{u as V}from"./index-B5d4M70B.js?v=1773287522785";import{k as q,R as z,r as f,e as F,$ as j,Z as A,a0 as t,a9 as s,_ as i,S as n,j as H,aa as K,N as O}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{a1 as T,a6 as Z,b as G,au as J,_ as L,av as M}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";const Q={class:"py-20px"},W={class:"w-260px"},X={class:"w-260px"},Y={class:"w-260px"},ee={class:"w-260px"},_e=q({__name:"index",props:{data:{}},setup(D,{expose:x}){const{t:_}=z(),g=D,{row:d,sid:p,dbIdx:m,isEdit:u}=g.data,b=V(),v=f(null),a=F({db_idx:0,name:"",val:"",endtime:void 0}),B=f([{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}]),w={name:{required:!0,message:_("Database.redis.index_1"),trigger:"blur"},val:{required:!0,message:_("Database.redis.index_4"),trigger:"blur"}},$=()=>{if(p===null)throw P.error(_("Database.redis.index_8")),new Error(_("Database.redis.index_9"));const e={...O(a),sid:p};return e.endtime===void 0&&delete e.endtime,e},h=async()=>{var l;await((l=v.value)==null?void 0:l.validate());const e=$();await I(e),b.setRefresh(!0),b.setAddRedisId(e.db_idx)};return m!==-1&&(a.db_idx=m),u&&d&&(a.name=d.name,a.val=d.val,a.endtime=d.endtime?d.endtime:void 0),x({onConfirm:h}),(e,l)=>{const R=Z,r=T,c=G,y=L,k=M,N=J,S=E,U=C;return j(),A("div",Q,[t(S,{ref_key:"formRef",ref:v,model:n(a),rules:w},{default:s(()=>[t(r,{label:e.$t("Site.PHP.add_site_16"),path:"db_idx"},{default:s(()=>[i("div",W,[t(R,{value:n(a).db_idx,"onUpdate:value":l[0]||(l[0]=o=>n(a).db_idx=o),options:n(B),disabled:n(u)},null,8,["value","options","disabled"])])]),_:1},8,["label"]),t(r,{label:e.$t("Database.redis.index_2"),path:"name"},{default:s(()=>[i("div",X,[t(c,{value:n(a).name,"onUpdate:value":l[1]||(l[1]=o=>n(a).name=o),disabled:n(u),placeholder:e.$t("Database.redis.index_1")},null,8,["value","disabled","placeholder"])])]),_:1},8,["label"]),t(r,{label:e.$t("Database.redis.index_3"),path:"val"},{default:s(()=>[i("div",Y,[t(c,{value:n(a).val,"onUpdate:value":l[2]||(l[2]=o=>n(a).val=o),type:"textarea",autosize:{minRows:4,maxRows:4},placeholder:e.$t("Database.redis.index_4")},null,8,["value","placeholder"])])]),_:1},8,["label"]),t(r,{label:e.$t("Database.redis.index_5"),"show-feedback":!1},{default:s(()=>[i("div",ee,[t(N,null,{default:s(()=>[t(y,{value:n(a).endtime,"onUpdate:value":l[3]||(l[3]=o=>n(a).endtime=o),class:"flex-1",min:0,"show-button":!1,placeholder:e.$t("Database.redis.index_6")},null,8,["value","placeholder"]),t(k,null,{default:s(()=>l[4]||(l[4]=[H("sec")])),_:1,__:[4]})]),_:1})])]),_:1},8,["label"])]),_:1},8,["model"]),t(U,{class:"mt-24px px-20px"},{default:s(()=>[i("li",null,K(e.$t("Database.redis.index_7")),1)]),_:1})])}}});export{_e as default};
