var k=Object.defineProperty,D=Object.defineProperties;var T=Object.getOwnPropertyDescriptors;var C=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var g=(o,t,e)=>t in o?k(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,d=(o,t)=>{for(var e in t||(t={}))E.call(t,e)&&g(o,e,t[e]);if(C)for(var e of C(t))v.call(t,e)&&g(o,e,t[e]);return o},B=(o,t)=>D(o,T(t));var f=(o,t,e)=>new Promise((c,a)=>{var l=s=>{try{i(e.next(s))}catch(r){a(r)}},p=s=>{try{i(e.throw(s))}catch(r){a(r)}},i=s=>s.done?c(s.value):Promise.resolve(s.value).then(l,p);i((e=e.apply(o,t)).next())});import{u as R,B as S}from"./useTable.878d00ad.js";import{T as N}from"./BasicForm.6fc27d7c.js";import{d as V}from"./other.a0e0a1bb.js";import{d as j,P as A,o as w,f as y,m as u,s as _,x as P,j as m,k as I,cP as K}from"./index.600742c0.js";import{message as x}from"ant-design-vue";import{u as U}from"./index.d39e7f57.js";import{_ as W,c as $,s as q}from"./DeviceDrawer.98d89571.js";import"./useForm.2bc9cac7.js";import"./index.f0d83218.js";import"./useWindowSizeFn.e4cb8bac.js";import"./useContentViewHeight.9a5e8928.js";import"./CheckOutlined.bb129b54.js";import"./index.fd8050d2.js";import"./FullscreenOutlined.0627cb06.js";import"./isEqual.8095f8fc.js";import"./_baseIsEqual.68b80f32.js";import"./dateUtil.dcd6267e.js";import"./_baseMerge.c9f65aec.js";import"./_baseFor.fb668a36.js";import"./get.10d89888.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.7b913ccb.js";import"./index.f3a03a89.js";import"./download.51f45248.js";import"./index.8ec96e3a.js";import"./uniqBy.77d944c4.js";import"./_baseIteratee.c5e7a887.js";import"./defaultsDeep.5de9486a.js";const z={key:0,class:"flex items-center justify-center"},ge=j({__name:"index",setup(o){const[t,{openDrawer:e}]=U(),[c,{reload:a}]=R({title:"\u8BBE\u5907\u5217\u8868",api:r=>f(this,null,function*(){const{data:b,meta:n}=yield K(d({},r));return{items:b,total:n==null?void 0:n.total}}),rowKey:"id",columns:$,formConfig:{labelWidth:120,schemas:q},useSearchForm:!0,showTableSetting:!0,bordered:!0,showIndexColumn:!0}),l=()=>{x.success("\u64CD\u4F5C\u6210\u529F"),a()},p=()=>{e(!0,{id:!1})},i=r=>{e(!0,B(d({},r),{isUpdate:!0}))},s=r=>f(this,null,function*(){yield V(r.id),x.success("\u5220\u9664\u6210\u529F"),a()});return(r,b)=>{const n=A("a-button");return w(),y("div",null,[u(m(S),{onRegister:m(c)},{toolbar:_(()=>[u(n,{type:"primary",onClick:p},{default:_(()=>[P(" \u65B0\u589E\u8BBE\u5907 ")]),_:1})]),bodyCell:_(({column:F,record:h})=>[F.key==="action"?(w(),y("div",z,[u(m(N),{actions:[{label:"\u7F16\u8F91",onClick:i.bind(null,h)},{label:"\u5220\u9664",popConfirm:{title:"\u662F\u5426\u786E\u8BA4\u5220\u9664",placement:"topRight",confirm:s.bind(null,h)}}]},null,8,["actions"])])):I("",!0)]),_:1},8,["onRegister"]),u(W,{onRegister:m(t),onSuccess:l},null,8,["onRegister"])])}}});export{ge as default};