import{_ as I}from"./EditDialog.vue_vue_type_script_setup_true_lang.318c9047.js";import{l as P,b as q}from"./classify.a92ceae9.js";import{d as L,b as B,r as c,p as M,c as u,at as $,e as b,f as j,g as a,h as t,i as s,u as e,w as O,k,q as R,A as G,F as H,m as g,y as C,N as J,E as K,_ as Q}from"./index.0308b213.js";import"./useInstance.233fbdde.js";const S={class:"filter-form"},W=g("\u67E5\u8BE2"),X={class:"data"},Y={class:"operation-container"},Z={class:"operation-btn"},ee=g("\u6DFB\u52A0"),te={class:"table"},le={class:"table-operation-btn"},oe={class:"top"},ae=g("\u7F16\u8F91"),se=g("\u5220\u9664"),ne={class:"bottom"},ie={class:"pagination"},ue=L({setup(de){const o=B({page:1,limit:10,title:""}),r=B({list:[],count:0});c([]);let v=c(!1);const _=()=>{v.value=!0,P(o).then(i=>{r.list=i.list,r.count=i.count,v.value=!1})};_(),c(!1),M(()=>[o.page,o.limit],()=>{_()});const y=()=>{_()};let d=c(!1),p=c(!1),m=c(0);const D=()=>{m.value=0,p.value=!0,C(()=>{d.value=!0})},E=i=>{m.value=i,p.value=!0,C(()=>{d.value=!0})},F=()=>{m.value=0,C(()=>{p.value=!1}),_()},V=i=>{J.alert("\u786E\u5B9A\u9700\u8981\u5220\u9664\u6570\u636E\u5417?","\u63D0\u793A",{confirmButtonText:"\u786E\u8BA4",showCancelButton:!0,cancelButtonText:"\u53D6\u6D88"}).then(()=>{q({id:i}).then(()=>{K({message:"\u5220\u9664\u6210\u529F",type:"success"}),_()})}).catch(()=>{})};return(i,n)=>{const w=u("el-input"),x=u("el-form-item"),f=u("el-button"),A=u("el-form"),h=u("el-table-column"),z=u("el-table"),N=u("el-pagination"),T=$("loading");return b(),j(H,null,[a("div",S,[t(A,{model:e(o),"label-width":"90px"},{default:s(()=>[t(x,{class:"tn-el-form-item",label:"\u5206\u7C7B\u6807\u9898"},{default:s(()=>[t(w,{modelValue:e(o).title,"onUpdate:modelValue":n[0]||(n[0]=l=>e(o).title=l),placeholder:"\u8BF7\u8F93\u5165\u5206\u7C7B\u6807\u9898"},null,8,["modelValue"])]),_:1}),t(x,null,{default:s(()=>[t(f,{class:"tn-el-form-item--item tn-button tn-button--blue",onClick:y},{default:s(()=>[W]),_:1})]),_:1})]),_:1},8,["model"])]),a("div",X,[a("div",Y,[a("div",Z,[t(f,{class:"btn",type:"primary",onClick:D},{default:s(()=>[ee]),_:1})])]),a("div",te,[O((b(),k(z,{data:e(r).list,"row-key":"id"},{default:s(()=>[t(h,{label:"ID",prop:"id"}),t(h,{label:"\u5206\u7C7B\u6807\u9898",prop:"title"}),t(h,{fixed:"right",label:"\u64CD\u4F5C",width:"290px"},{default:s(({row:l})=>[a("div",le,[a("div",oe,[t(f,{size:"small",type:"primary",onClick:U=>E(l.id)},{default:s(()=>[ae]),_:2},1032,["onClick"]),t(f,{size:"small",type:"danger",onClick:U=>V(l.id)},{default:s(()=>[se]),_:2},1032,["onClick"])])])]),_:1})]),_:1},8,["data"])),[[T,e(v)]])])]),a("div",ne,[a("div",ie,[t(N,{currentPage:e(o).page,"onUpdate:currentPage":n[1]||(n[1]=l=>e(o).page=l),"page-size":e(o).limit,"onUpdate:page-size":n[2]||(n[2]=l=>e(o).limit=l),"page-sizes":[10,20,30,40],layout:"total, sizes, prev, pager, next, jumper",total:e(r).count},null,8,["currentPage","page-size","total"])])]),e(p)?(b(),k(I,{key:0,modelValue:e(d),"onUpdate:modelValue":n[3]||(n[3]=l=>R(d)?d.value=l:d=l),id:e(m),onOnClose:F},null,8,["modelValue","id"])):G("",!0)],64)}}});const me=Q(ue,[["__scopeId","data-v-7e780d53"]]);export{me as default};
