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