2 lines
3.8 KiB
JavaScript
2 lines
3.8 KiB
JavaScript
var R=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?R(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},f=(o,e)=>A(o,N(e));var y=(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 I}from"./useTable.0c2c6d52.js";import{T as K}from"./useForm.7f0ae6dc.js";import{a as L,aA as W,bN as $,o as n,h as C,p as b,x as u,w as q,j as x,y as B,k as m,l as D,F as z,aD as G,B as H,t as J,cs as v,eE as M,eB as O}from"./index.edc0759d.js";import{u as P}from"./index.a0f5fb0c.js";import{_ as Q,c as X,s as Y}from"./BaseDrawer.d8e8927f.js";import"./index.259be51b.js";import"./Checkbox.21426845.js";import"./index.d81cdb5e.js";import"./index.14c1dc69.js";import"./index.18485147.js";import"./index.06eb6349.js";import"./useSize.1a6ae380.js";import"./eagerComputed.5106fd59.js";import"./onMountedOrActivated.45dfe467.js";import"./useWindowSizeFn.8be10011.js";import"./useContentViewHeight.0b992366.js";import"./ArrowLeftOutlined.727536a9.js";import"./transButton.0f38a3d6.js";import"./index.adbf4a0d.js";import"./index.debcb6b3.js";import"./index.111c4059.js";import"./index.ad97f9f1.js";import"./dateUtil.9d098b41.js";import"./_baseMerge.1131d091.js";import"./_isIterateeCall.31ed91a4.js";import"./_baseEach.8bca3c51.js";import"./get.9ede912b.js";import"./index.2b67a644.js";import"./FullscreenOutlined.219f2fe1.js";import"./index.abbd0c37.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.8d3634d3.js";import"./index.18f69ddd.js";import"./fromPairs.84aabb58.js";import"./CaretUpOutlined.9c736fd9.js";import"./scrollTo.477b98df.js";import"./index.ac2947d4.js";import"./index.231a60da.js";import"./index.a048a7b7.js";import"./_baseIteratee.4b889e9a.js";import"./index.d03a2449.js";import"./useRefs.9a2b8e46.js";import"./download.8be5a7d1.js";import"./index.935fa161.js";import"./uniqBy.004e8f3d.js";import"./index.0b95b2ab.js";import"./MinusCircleOutlined.f806d072.js";import"./PlusOutlined.a62f0771.js";const Z={key:0,class:"flex items-center justify-center"},Pt=L({__name:"index",setup(o){const[e,{openDrawer:t}]=P(),[c,{reload:s}]=U({title:"\u57FA\u5730\u519C\u4F5C\u7269\u5217\u8868",api:r=>y(this,null,function*(){const{data:g,meta:p}=yield O(f(h({type:"all"},r),{crop_type:1}));return{items:g,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,f(h({},r),{isUpdate:!0}))},i=r=>y(this,null,function*(){yield M(r.id),v.success("\u5220\u9664\u6210\u529F"),s()});return(r,g)=>{const p=W("a-button"),T=$("auth");return n(),C("div",null,[b(m(I),{onRegister:m(c)},{toolbar:u(()=>[q((n(),x(p,{type:"primary",onClick:d},{default:u(()=>[B(" \u65B0\u589E\u519C\u4F5C\u7269 ")]),_:1})),[[T,"endpoint.crops.create"]])]),bodyCell:u(({column:F,record:_})=>[F.key==="action"?(n(),C("div",Z,[b(m(K),{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),F.key==="crops"?(n(!0),C(z,{key:1},G(_.crops,(S,E)=>(n(),x(m(H),{class:"mx-2px",key:E,type:"link"},{default:u(()=>[B(J(S.name),1)]),_:2},1024))),128)):D("",!0)]),_:1},8,["onRegister"]),b(Q,{onRegister:m(e),onSuccess:l},null,8,["onRegister"])])}}});export{Pt as default};
|