import{l as G,c as J,a as M,b as P,d as Q,e as W}from"./cache-uH-4DeCX.js";import{r,d as c,D as X,o as b,c as Y,e,f as t,p as f,h as n,l as S,F as B,m as k,I as Z,v as ee}from"./index-TnLvmlMR.js";const te={class:"app-container"},ae=k("span",{style:{"vertical-align":"middle"}},"缓存列表",-1),le=k("span",{style:{"vertical-align":"middle"}},"键名列表",-1),ne=k("span",{style:{"vertical-align":"middle"}},"缓存内容",-1),oe=Z({name:"CacheList"}),re=Object.assign(oe,{setup(ce){const{proxy:u}=ee(),N=r([]),V=r([]),s=r({}),_=r(!0),g=r(!1),h=r(""),x=r(window.innerHeight-200);function K(){_.value=!0,G().then(l=>{N.value=l.data,_.value=!1})}function F(){K(),u.$modal.msgSuccess("刷新缓存列表成功")}function O(l){J(l.cacheName).then(a=>{u.$modal.msgSuccess("清理缓存名称["+l.cacheName+"]成功"),p()})}function p(l){const a=l!==void 0?l.cacheName:h.value;a!==""&&(g.value=!0,M(a).then(y=>{V.value=y.data,g.value=!1,h.value=a}))}function U(){p(),u.$modal.msgSuccess("刷新键名列表成功")}function A(l){P(l).then(a=>{u.$modal.msgSuccess("清理缓存键名["+l+"]成功"),p()})}function H(l){return l.cacheName.replace(":","")}function I(l){return l.replace(h.value,"")}function L(l){Q(h.value,l).then(a=>{s.value=a.data})}function j(){W().then(l=>{u.$modal.msgSuccess("清理全部缓存成功")})}return K(),(l,a)=>{const y=c("Collection"),m=c("el-button"),i=c("el-table-column"),$=c("el-table"),v=c("el-card"),d=c("el-col"),E=c("Key"),T=c("Document"),C=c("el-input"),w=c("el-form-item"),D=c("el-row"),q=c("el-form"),R=X("loading");return b(),Y("div",te,[e(D,{gutter:10},{default:t(()=>[e(d,{span:8},{default:t(()=>[e(v,{style:{height:"calc(100vh - 125px)"}},{header:t(()=>[e(y,{style:{width:"1em",height:"1em","vertical-align":"middle"}}),f(),ae,e(m,{style:{float:"right",padding:"3px 0"},link:"",type:"primary",icon:"Refresh",onClick:a[0]||(a[0]=o=>F())})]),default:t(()=>[B((b(),S($,{data:n(N),height:n(x),"highlight-current-row":"",onRowClick:p,style:{width:"100%"}},{default:t(()=>[e(i,{label:"序号",width:"60",type:"index"}),e(i,{label:"缓存名称",align:"center",prop:"cacheName","show-overflow-tooltip":!0,formatter:H}),e(i,{label:"备注",align:"center",prop:"remark","show-overflow-tooltip":!0}),e(i,{label:"操作",width:"60",align:"center","class-name":"small-padding fixed-width"},{default:t(o=>[e(m,{link:"",type:"primary",icon:"Delete",onClick:z=>O(o.row)},null,8,["onClick"])]),_:1})]),_:1},8,["data","height"])),[[R,n(_)]])]),_:1})]),_:1}),e(d,{span:8},{default:t(()=>[e(v,{style:{height:"calc(100vh - 125px)"}},{header:t(()=>[e(E,{style:{width:"1em",height:"1em","vertical-align":"middle"}}),f(),le,e(m,{style:{float:"right",padding:"3px 0"},link:"",type:"primary",icon:"Refresh",onClick:a[1]||(a[1]=o=>U())})]),default:t(()=>[B((b(),S($,{data:n(V),height:n(x),"highlight-current-row":"",onRowClick:L,style:{width:"100%"}},{default:t(()=>[e(i,{label:"序号",width:"60",type:"index"}),e(i,{label:"缓存键名",align:"center","show-overflow-tooltip":!0,formatter:I}),e(i,{label:"操作",width:"60",align:"center","class-name":"small-padding fixed-width"},{default:t(o=>[e(m,{link:"",type:"primary",icon:"Delete",onClick:z=>A(o.row)},null,8,["onClick"])]),_:1})]),_:1},8,["data","height"])),[[R,n(g)]])]),_:1})]),_:1}),e(d,{span:8},{default:t(()=>[e(v,{bordered:!1,style:{height:"calc(100vh - 125px)"}},{header:t(()=>[e(T,{style:{width:"1em",height:"1em","vertical-align":"middle"}}),f(),ne,e(m,{style:{float:"right",padding:"3px 0"},link:"",type:"primary",icon:"Refresh",onClick:a[2]||(a[2]=o=>j())},{default:t(()=>[f("清理全部")]),_:1})]),default:t(()=>[e(q,{model:n(s)},{default:t(()=>[e(D,{gutter:32},{default:t(()=>[e(d,{offset:1,span:22},{default:t(()=>[e(w,{label:"缓存名称:",prop:"cacheName"},{default:t(()=>[e(C,{modelValue:n(s).cacheName,"onUpdate:modelValue":a[3]||(a[3]=o=>n(s).cacheName=o),readOnly:!0},null,8,["modelValue"])]),_:1})]),_:1}),e(d,{offset:1,span:22},{default:t(()=>[e(w,{label:"缓存键名:",prop:"cacheKey"},{default:t(()=>[e(C,{modelValue:n(s).cacheKey,"onUpdate:modelValue":a[4]||(a[4]=o=>n(s).cacheKey=o),readOnly:!0},null,8,["modelValue"])]),_:1})]),_:1}),e(d,{offset:1,span:22},{default:t(()=>[e(w,{label:"缓存内容:",prop:"cacheValue"},{default:t(()=>[e(C,{modelValue:n(s).cacheValue,"onUpdate:modelValue":a[5]||(a[5]=o=>n(s).cacheValue=o),type:"textarea",rows:8,readOnly:!0},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1})]),_:1})]),_:1})])}}});export{re as default};
