2 lines
3.8 KiB
JavaScript
2 lines
3.8 KiB
JavaScript
var E=Object.defineProperty,A=Object.defineProperties;var N=Object.getOwnPropertyDescriptors;var k=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var w=(o,e,t)=>e in o?E(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)&&w(o,t,e[t]);if(k)for(var t of k(e))j.call(e,t)&&w(o,t,e[t]);return o},C=(o,e)=>A(o,N(e));var f=(o,e,t)=>new Promise((c,s)=>{var l=i=>{try{a(t.next(i))}catch(r){s(r)}},d=i=>{try{a(t.throw(i))}catch(r){s(r)}},a=i=>i.done?c(i.value):Promise.resolve(i.value).then(l,d);a((t=t.apply(o,e)).next())});import{u as U,B as z}from"./useTable.87323ef6.js";import{T as G}from"./useForm.07a5f44b.js";import{a as I,aC as K,bP as L,o as n,h as y,p as b,y as u,w as P,j as x,z as B,k as m,l as D,F as W,aF as $,B as q,t as H,cu as v,eG as J,eC as M}from"./index.5df1475c.js";import{u as O}from"./index.5ec8a1d4.js";import{_ as Q,c as X,s as Y}from"./BaseDrawer.ea96098d.js";import"./index.38acb0a5.js";import"./Checkbox.7f8592c5.js";import"./index.c89237ad.js";import"./index.88b332c0.js";import"./index.820e4675.js";import"./index.2207fa77.js";import"./useSize.56df91ad.js";import"./eagerComputed.ddd1509e.js";import"./onMountedOrActivated.4fbea925.js";import"./useWindowSizeFn.9540523e.js";import"./useContentViewHeight.727a582b.js";import"./ArrowLeftOutlined.1202abc6.js";import"./transButton.81d43cf8.js";import"./index.3aa4349d.js";import"./index.a4e6c070.js";import"./index.1c5b3a93.js";import"./index.b9d1be92.js";import"./dateUtil.9c6d1317.js";import"./_baseMerge.45875f5b.js";import"./_isIterateeCall.ac5b4137.js";import"./_baseEach.1a76287d.js";import"./get.585393a0.js";import"./index.4cb04beb.js";import"./FullscreenOutlined.a7be7f3a.js";import"./index.3a7d8d6f.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.d365026f.js";import"./index.0a86bb99.js";import"./fromPairs.84aabb58.js";import"./CaretUpOutlined.99a0c46c.js";import"./scrollTo.3cce7631.js";import"./index.6752e660.js";import"./index.716a4c34.js";import"./index.637ac1af.js";import"./_baseIteratee.ac78aa1a.js";import"./index.92618ffc.js";import"./useRefs.4ffe1d8c.js";import"./download.ce51a9ac.js";import"./index.d6f0940d.js";import"./uniqBy.33c2b764.js";import"./index.6cf3cc38.js";import"./MinusCircleOutlined.d8f6a9f4.js";import"./PlusOutlined.56e06f0d.js";const Z={key:0,class:"flex items-center justify-center"},Ot=I({__name:"index",setup(o){const[e,{openDrawer:t}]=O(),[c,{reload:s}]=U({title:"\u57FA\u5730\u519C\u4F5C\u7269\u5217\u8868",api:r=>f(this,null,function*(){const{data:F,meta:p}=yield M(C(h({type:"all"},r),{crop_type:1}));return{items:F,total:p==null?void 0:p.total}}),rowKey:"id",columns:X,formConfig:{labelWidth:120,schemas:Y},useSearchForm:!0,showTableSetting:!0,bordered:!0,showIndexColumn:!0}),l=()=>{v.success("\u64CD\u4F5C\u6210\u529F"),s()},d=()=>{t(!0,{isUpdate:!1})},a=r=>{t(!0,C(h({},r),{isUpdate:!0}))},i=r=>f(this,null,function*(){yield J(r.id),v.success("\u5220\u9664\u6210\u529F"),s()});return(r,F)=>{const p=K("a-button"),T=L("auth");return n(),y("div",null,[b(m(z),{onRegister:m(c)},{toolbar:u(()=>[P((n(),x(p,{type:"primary",onClick:d},{default:u(()=>[B(" \u65B0\u589E\u519C\u4F5C\u7269 ")]),_:1})),[[T,"endpoint.crops.create"]])]),bodyCell:u(({column:g,record:_})=>[g.key==="action"?(n(),y("div",Z,[b(m(G),{actions:[{label:"\u7F16\u8F91",onClick:a.bind(null,_),auth:"endpoint.crops.edit"},{label:"\u5220\u9664",auth:"endpoint.crops.destroy",popConfirm:{title:"\u662F\u5426\u786E\u8BA4\u5220\u9664",placement:"topRight",confirm:i.bind(null,_)}}]},null,8,["actions"])])):D("",!0),g.key==="crops"?(n(!0),y(W,{key:1},$(_.crops,(S,R)=>(n(),x(m(q),{class:"mx-2px",key:R,type:"link"},{default:u(()=>[B(H(S.name),1)]),_:2},1024))),128)):D("",!0)]),_:1},8,["onRegister"]),b(Q,{onRegister:m(e),onSuccess:l},null,8,["onRegister"])])}}});export{Ot as default};
|