import{r as e,u as a,o as t,e as l,y as s,w as r,j as i,T as o,a3 as u,f as n,g as d,ao as c,q as p,ap as g,t as y,v,x as f,aq as m,W as k,z as S,b as h,ar as _,as as x,O,A as I,aa as J}from"./vendor.08310185.js";const N={key:0},b=S("点我清除全部用例"),q=S(" 你确定要全部清理吗，我会把LocalStorage全部干掉哦。 "),z={style:{"font-size":"18px"}},C={key:1},E={setup(S){let E=e([]),j=e([{title:"名称",key:"title"},{title:"状态",key:"status"},{title:"创建时间",key:"time"},{title:"请求参数",key:"param",render:e=>(e.param.forEach((e=>{delete e.in,delete e.type,delete e.required,delete e.active})),JSON.stringify(e.param))},{title:"请求体",key:"body"},{title:"操作",key:"action",render:e=>h(y,{type:"primary",onClick:()=>W(e)},{default:()=>"删除"})}]),P=e(!0);a();let W=e=>{let a=localStorage.getItem(e.group),t=JSON.parse(a);for(var l=0;l<t.length;l++)if(t[l].title==e.title){1==t.length?localStorage.removeItem(e.group):(t.splice(l,1),localStorage.setItem(e.group,JSON.stringify(t)));break}A()},w=()=>{localStorage.clear(),A()},A=()=>{P.vlaue=!1,E.value=[];for(var e=0;e<localStorage.length;e++){var a=localStorage.key(e);if(a.startsWith("lucky")){let e={},t=JSON.parse(localStorage.getItem(a));t.forEach((e=>{e.group=a})),e.key=a.split("_")[1],e.value=t,E.value.push(e)}}P.vlaue=!0};return t((()=>{A()})),(e,a)=>(l(),s(i(o),{vertical:""},{default:r((()=>[i(P)?(l(),s(i(u),{key:0,title:"请求用例管理"},{default:r((()=>[i(E).length>0?(l(),n("div",N,[d(i(o),{vertical:"",size:15},{default:r((()=>[d(i(c),{"positive-text":"好的,没关系.","negative-text":"Emmm,算了吧.",onPositiveClick:i(w)},{icon:r((()=>[d(i(p),null,{default:r((()=>[d(i(g))])),_:1})])),trigger:r((()=>[d(i(y),{dashed:"",type:"primary"},{default:r((()=>[b])),_:1})])),default:r((()=>[q])),_:1},8,["onPositiveClick"]),(l(!0),n(v,null,f(i(E),((e,a)=>(l(),n("div",null,[d(i(_),null,{default:r((()=>[d(i(x),{name:"index"},{header:r((()=>[O("span",z,I(e.key),1)])),default:r((()=>[d(i(J),{columns:i(j),data:e.value},null,8,["columns","data"])])),_:2},1024)])),_:2},1024)])))),256))])),_:1})])):(l(),n("div",C,[d(i(m),{status:"404",title:"好像没有多余的请求用例了",description:"去创建几个试试吧"})]))])),_:1})):k("",!0)])),_:1}))}};export{E as default};
