var S=Object.defineProperty,R=Object.defineProperties;var E=Object.getOwnPropertyDescriptors;var k=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var F=(o,e,t)=>e in o?S(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,h=(o,e)=>{for(var t in e||(e={}))v.call(e,t)&&F(o,t,e[t]);if(k)for(var t of k(e))N.call(e,t)&&F(o,t,e[t]);return o},B=(o,e)=>R(o,E(e));var y=(o,e,t)=>new Promise((l,a)=>{var d=i=>{try{s(t.next(i))}catch(r){a(r)}},f=i=>{try{s(t.throw(i))}catch(r){a(r)}},s=i=>i.done?l(i.value):Promise.resolve(i.value).then(d,f);s((t=t.apply(o,e)).next())});import{u as V,B as j}from"./useTable.ca731c69.js";import{T as U}from"./BasicForm.8f5dae9e.js";import{a as G,aA as I,o as n,h as b,p as u,x as c,y as w,k as p,l as x,F as K,aD as L,j as W,B as $,t as q,cs as T,cr as z,ct as H}from"./index.8f9b7a71.js";import{u as J}from"./index.9a9b4669.js";import{_ as M,c as O,s as P}from"./BaseDrawer.a35e7485.js";import"./index.371aa736.js";import"./Checkbox.21f5f3b7.js";import"./index.7ddba836.js";import"./useForm.9f152460.js";import"./index.a9d41e0d.js";import"./index.726a7cc6.js";import"./index.37007eee.js";import"./useSize.09e097d2.js";import"./eagerComputed.e565f9d3.js";import"./onMountedOrActivated.30ef1095.js";import"./useWindowSizeFn.4d5463d5.js";import"./useContentViewHeight.4009f982.js";import"./ArrowLeftOutlined.9ecdf267.js";import"./transButton.5d16d6d7.js";import"./index.0a039792.js";import"./index.2da53baa.js";import"./index.bf2fdd7b.js";import"./index.b8231a8a.js";import"./dateUtil.5ee4371b.js";import"./_baseMerge.008a456a.js";import"./_isIterateeCall.174fa698.js";import"./_baseEach.5a8529ef.js";import"./get.d20ec798.js";import"./index.398e5803.js";import"./FullscreenOutlined.552f14fa.js";import"./index.cb457f6d.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.02a7db00.js";import"./fromPairs.84aabb58.js";import"./CaretUpOutlined.e5b8aa78.js";import"./scrollTo.dbb51e85.js";import"./index.7403aa18.js";import"./index.28d8cf0a.js";import"./index.0afcb63a.js";import"./_baseIteratee.8edb1dfa.js";import"./index.13069823.js";import"./useRefs.4a9dbdf0.js";import"./download.7ce18309.js";import"./index.bafb108a.js";import"./uniqBy.6623ac91.js";import"./index.6e995b33.js";import"./map.875c2d2a.js";import"./lodash.cb863bd7.js";const Q={key:0,class:"flex items-center justify-center"},Jt=G({__name:"index",setup(o){const[e,{openDrawer:t}]=J(),[l,{reload:a}]=V({title:"\u57FA\u5730\u5217\u8868",api:r=>y(this,null,function*(){const{data:g,meta:m}=yield H(h({type:1},r));return{items:g,total:m==null?void 0:m.total}}),rowKey:"id",columns:O,formConfig:{labelWidth:120,schemas:P},useSearchForm:!0,showTableSetting:!0,bordered:!0,showIndexColumn:!0}),d=()=>{T.success("\u64CD\u4F5C\u6210\u529F"),a()},f=()=>{t(!0,{isUpdate:!1})},s=r=>{t(!0,B(h({},r),{isUpdate:!0}))},i=r=>y(this,null,function*(){yield z(r.id),T.success("\u5220\u9664\u6210\u529F"),a()});return(r,g)=>{const m=I("a-button");return n(),b("div",null,[u(p(j),{onRegister:p(l)},{toolbar:c(()=>[u(m,{type:"primary",onClick:f},{default:c(()=>[w(" \u65B0\u589E\u57FA\u5730 ")]),_:1})]),bodyCell:c(({column:C,record:_})=>[C.key==="action"?(n(),b("div",Q,[u(p(U),{actions:[{label:"\u7F16\u8F91",onClick:s.bind(null,_)},{label:"\u5220\u9664",popConfirm:{title:"\u662F\u5426\u786E\u8BA4\u5220\u9664",placement:"topRight",confirm:i.bind(null,_)}}]},null,8,["actions"])])):x("",!0),C.key==="crops"?(n(!0),b(K,{key:1},L(_.crops,(D,A)=>(n(),W(p($),{class:"mx-2px",key:A,type:"link"},{default:c(()=>[w(q(D.name),1)]),_:2},1024))),128)):x("",!0)]),_:1},8,["onRegister"]),u(M,{onRegister:p(e),onSuccess:d},null,8,["onRegister"])])}}});export{Jt as default};