import{l as a,a4 as e,$ as s,M as t,x as l,du as r,dv as n,dt as i,a2 as o}from"./utils-lib.js?v=20260328163632";import{u}from"./index115.js?v=20260328163632";import{r as m,k as d,o as c,J as p,V as v,_ as f,a3 as j,O as x,Y as _,N as h,j as g,Z as b}from"./base-lib.js?v=20260328163632";import{b as y,B as k}from"./naive-ui.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";import"./index88.js?v=20260328163632";const{favoriteList:q}=u(),w=m("");m(null);const C=m({columns:[{title:a("分类名称"),key:"name",render:e=>"默认分类"===e.name?a("默认分类"):e.name},e([{isHide:a=>"默认分类"===a.name,onClick:async e=>{await l({loading:a("正在删除收藏分类，请稍后..."),request:n({name:e.name}),success:()=>{B()}})},title:a("删除")}])],data:[]}),[H,N]=s(C),B=async()=>{l({loading:a("正在获取收藏分类列表，请稍候..."),request:i(),success:a=>{C.value.data=a.data,q.value=a.data}})},J=async()=>{if(""===w.value)return t.error(a("请输入分类名称"));await l({loading:a("正在添加收藏分类，请稍后..."),request:r({name:w.value}),message:!0,data:{status:Number},success:a=>{0===a.status&&(B(),w.value="")}})},L=()=>{M(),B()},M=()=>{w.value="",C.value.data=[]},O=d({__name:"index",setup:e=>(c(L),p(M),(e,s)=>{const t=y,l=k;return v(),f(_(o),{class:"p-20px"},{"header-left":j((()=>[x(t,{value:_(w),"onUpdate:value":s[0]||(s[0]=a=>h(w)?w.value=a:null),class:"!w-396px mr-10px",placeholder:_(a)("请添加分类名称")},null,8,["value","placeholder"]),x(l,{type:"primary",onClick:_(J)},{default:j((()=>[g(b(_(a)("添加")),1)])),_:1},8,["onClick"])])),"header-right":j((()=>s[1]||(s[1]=[]))),content:j((()=>[x(_(H),{"max-height":300})])),"footer-left":j((()=>s[2]||(s[2]=[]))),"footer-right":j((()=>s[3]||(s[3]=[]))),_:1})})});export{O as default};
