2 lines
4.1 KiB
JavaScript
Raw Normal View History

2025-06-02 21:34:56 +08:00
import{l as e,a,c as l,b as t,d as n,e as o}from"./cache-BQtvslw-.js";import{C as d,d as c,r as i,j as r,H as s,c as u,o as h,e as p,w as f,F as m,h as g,k as y,f as v,m as w}from"./index-C-c3zR6K.js";const _={class:"app-container"},b=d({name:"CacheList"}),k=Object.assign(b,{setup(d){const{proxy:b}=c(),k=i([]),x=i([]),C=i({}),V=i(!0),N=i(!1),R=i(""),S=i(window.innerHeight-200);function $(){V.value=!0,e().then((e=>{k.value=e.data,V.value=!1}))}function j(e){const l=void 0!==e?e.cacheName:R.value;""!==l&&(N.value=!0,a(l).then((e=>{x.value=e.data,N.value=!1,R.value=l})))}function O(e){return e.cacheName.replace(":","")}function K(e){return e.replace(R.value,"")}function U(e){t(R.value,e).then((e=>{C.value=e.data}))}return $(),(e,a)=>{const t=r("el-button"),d=r("el-table-column"),c=r("el-table"),i=r("el-card"),D=r("el-col"),H=r("el-input"),F=r("el-form-item"),L=r("el-row"),q=r("el-form"),z=s("loading");return h(),u("div",_,[p(L,{gutter:10},{default:f((()=>[p(D,{span:8},{default:f((()=>[p(i,{style:{height:"calc(100vh - 125px)"}},{header:f((()=>[a[6]||(a[6]=v("span",null,"缓存列表",-1)),p(t,{style:{float:"right",padding:"3px 0"},link:"",type:"primary",icon:"Refresh",onClick:a[0]||(a[0]=e=>($(),void b.$modal.msgSuccess("刷新缓存列表成功")))})])),default:f((()=>[m((h(),g(c,{data:y(k),height:y(S),"highlight-current-row":"",onRowClick:j,style:{width:"100%"}},{default:f((()=>[p(d,{label:"序号",width:"60",type:"index"}),p(d,{label:"缓存名称",align:"center",prop:"cacheName","show-overflow-tooltip":!0,formatter:O}),p(d,{label:"备注",align:"center",prop:"remark","show-overflow-tooltip":!0}),p(d,{label:"操作",width:"60",align:"center","class-name":"small-padding fixed-width"},{default:f((e=>[p(t,{link:"",type:"primary",icon:"Delete",onClick:a=>{return t=e.row,void l(t.cacheName).then((e=>{b.$modal.msgSuccess("清理缓存名称["+R.value+"]成功"),j()}));var t}},null,8,["onClick"])])),_:1})])),_:1},8,["data","height"])),[[z,y(V)]])])),_:1})])),_:1}),p(D,{span:8},{default:f((()=>[p(i,{style:{height:"calc(100vh - 125px)"}},{header:f((()=>[a[7]||(a[7]=v("span",null,"键名列表",-1)),p(t,{style:{float:"right",padding:"3px 0"},link:"",type:"primary",icon:"Refresh",onClick:a[1]||(a[1]=e=>(j(),void b.$modal.msgSuccess("刷新键名列表成功")))})])),default:f((()=>[m((h(),g(c,{data:y(x),height:y(S),"highlight-current-row":"",onRowClick:U,style:{width:"100%"}},{default:f((()=>[p(d,{label:"序号",width:"60",type:"index"}),p(d,{label:"缓存键名",align:"center","show-overflow-tooltip":!0,formatter:K}),p(d,{label:"操作",width:"60",align:"center","class-name":"small-padding fixed-width"},{default:f((e=>[p(t,{link:"",type:"primary",icon:"Delete",onClick:a=>{return l=e.row,void n(l).then((e=>{b.$modal.msgSuccess("清理缓存键名["+l+"]成功"),j()}));var l}},null,8,["onClick"])])),_:1})])),_:1},8,["data","height"])),[[z,y(N)]])])),_:1})])),_:1}),p(D,{span:8},{default:f((()=>[p(i,{bordered:!1,style:{height:"calc(100vh - 125px)"}},{header:f((()=>[a[9]||(a[9]=v("span",null,"缓存内容",-1)),p(t,{style:{float:"right",padding:"3px 0"},link:"",type:"primary",icon:"Refresh",onClick:a[2]||(a[2]=e=>{o().then((e=>{b.$modal.msgSuccess("清理全部缓存成功")}))})},{default:f((()=>a[8]||(a[8]=[w("清理全部")]))),_:1})])),default:f((()=>[p(q,{model:y(C)},{default:f((()=>[p(L,{gutter:32},{default:f((()=>[p(D,{offset:1,span:22},{default:f((()=>[p(F,{label:"缓存名称:",prop:"cacheName"},{default:f((()=>[p(H,{modelValue:y(C).cacheName,"onUpdate:modelValue":a[3]||(a[3]=e=>y(C).cacheName=e),readOnly:!0},null,8,["modelValue"])])),_:1})])),_:1}),p(D,{offset:1,span:22},{default:f((()=>[p(F,{label:"缓存键名:",prop:"cacheKey"},{default:f((()=>[p(H,{modelValue:y(C).cacheKey,"onUpdate:modelValue":a[4]||(a[4]=e=>y(C).cacheKey=e),readOnly:!0},null,8,["modelValue"])])),_:1})])),_:1}),p(D,{offset:1,span:22},{default:f((()=>[p(F,{label:"缓存内容:",prop:"cacheValue"},{default:f((()=>[p(H,{modelValue:y(C).cacheValue,"onUpdate:modelValue":a[5]||(a[5]=e=>y(C).cacheValue=e),type:"textarea",rows:8,readOnly:!0},null,8,["modelValue"