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.d0ac0332.js";import{T as K}from"./useForm.9a2db385.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.1c21b270.js";import{u as P}from"./index.6ea1205a.js";import{_ as Q,c as X,s as Y}from"./BaseDrawer.cec160fa.js";import"./index.f5ef0af4.js";import"./Checkbox.0afca320.js";import"./index.16addc92.js";import"./index.4735147a.js";import"./index.89bfd8ba.js";import"./index.8b6a9e70.js";import"./useSize.95cc89e0.js";import"./eagerComputed.c03251a9.js";import"./onMountedOrActivated.b0089aeb.js";import"./useWindowSizeFn.80f08068.js";import"./useContentViewHeight.3d0df870.js";import"./ArrowLeftOutlined.f21977ee.js";import"./transButton.6fc250a9.js";import"./index.268803ef.js";import"./index.e52ad4c8.js";import"./index.8d0922ec.js";import"./index.2a2b440f.js";import"./dateUtil.768de925.js";import"./_baseMerge.09dc1719.js";import"./_isIterateeCall.18176193.js";import"./_baseEach.8a908f77.js";import"./get.fa76943e.js";import"./index.3bc5264b.js";import"./FullscreenOutlined.7e34998a.js";import"./index.d594c2b7.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.fef05e74.js";import"./index.5e63b934.js";import"./fromPairs.84aabb58.js";import"./CaretUpOutlined.4691f200.js";import"./scrollTo.2c0d38e2.js";import"./index.7c1cd7ce.js";import"./index.2fe7d0b4.js";import"./index.8f5b8d5a.js";import"./_baseIteratee.a0856a2e.js";import"./index.41d92815.js";import"./useRefs.1e9f4fa6.js";import"./download.9fc2b25a.js";import"./index.e1c46204.js";import"./uniqBy.92d19b6e.js";import"./index.0f641caa.js";import"./MinusCircleOutlined.d86c2d08.js";import"./PlusOutlined.84cd3005.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};
|