2 lines
3.8 KiB
JavaScript
2 lines
3.8 KiB
JavaScript
var R=Object.defineProperty,N=Object.defineProperties;var V=Object.getOwnPropertyDescriptors;var F=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var k=(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={}))j.call(e,t)&&k(o,t,e[t]);if(F)for(var t of F(e))A.call(e,t)&&k(o,t,e[t]);return o},C=(o,e)=>N(o,V(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 G}from"./useTable.792cc9b8.js";import{T as I}from"./useForm.7bfdaab3.js";import{a as K,aC as L,bP as P,o as n,h as y,p as b,x as u,w as W,j as x,y as B,k as m,l as D,F as $,aF as q,B as z,t as H,cu as v,eG as J,eC as M}from"./index.10bef8d9.js";import{u as O}from"./index.11d0d4f7.js";import{_ as Q,c as X,s as Y}from"./TownDrawer.ab1dfee5.js";import"./index.e2b21023.js";import"./Checkbox.3916bf4f.js";import"./index.2c46e1c2.js";import"./index.e1b248c7.js";import"./index.63bd55f9.js";import"./index.7d64c1fd.js";import"./useSize.a3cc155e.js";import"./eagerComputed.6cbc98cb.js";import"./onMountedOrActivated.1a52296b.js";import"./useWindowSizeFn.828b4ed1.js";import"./useContentViewHeight.34af3465.js";import"./ArrowLeftOutlined.00865997.js";import"./transButton.fa379ab6.js";import"./index.2cfaf595.js";import"./index.d11714a0.js";import"./index.04b03248.js";import"./index.603dbfe2.js";import"./dateUtil.9f7564f2.js";import"./_baseMerge.4ec785d2.js";import"./_isIterateeCall.048b9e2b.js";import"./_baseEach.9a9c295f.js";import"./get.54ea2f74.js";import"./index.ebbd9b0a.js";import"./FullscreenOutlined.1a57dd79.js";import"./index.7c202422.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.5e7f9ab6.js";import"./index.8d3663fe.js";import"./fromPairs.84aabb58.js";import"./CaretUpOutlined.f79ea720.js";import"./scrollTo.29e5c0fe.js";import"./index.405564ab.js";import"./index.6b7c6906.js";import"./index.ac844111.js";import"./_baseIteratee.ca4916de.js";import"./index.be423f4b.js";import"./useRefs.c7d6606b.js";import"./download.8b305a5b.js";import"./index.0fbf50e1.js";import"./uniqBy.3a475547.js";import"./index.88228e57.js";import"./PlusOutlined.0369c814.js";import"./MinusCircleOutlined.b21e23f4.js";const Z={key:0,class:"flex items-center justify-center"},Ot=K({__name:"index",setup(o){const[e,{openDrawer:t}]=O(),[c,{reload:s}]=U({title:"\u57CE\u9547\u519C\u4F5C\u7269\u5217\u8868",api:r=>f(this,null,function*(){const{data:w,meta:p}=yield M(C(h({type:"all"},r),{crop_type:2}));return{items:w,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,w)=>{const p=L("a-button"),T=P("auth");return n(),y("div",null,[b(m(G),{onRegister:m(c)},{toolbar:u(()=>[W((n(),x(p,{type:"primary",onClick:d},{default:u(()=>[B(" \u65B0\u589E\u519C\u4F5C\u7269 ")]),_:1})),[[T,"endpoint.town_crops.create"]])]),bodyCell:u(({column:g,record:_})=>[g.key==="action"?(n(),y("div",Z,[b(m(I),{actions:[{label:"\u7F16\u8F91",onClick:a.bind(null,_),auth:"endpoint.town_crops.edit"},{label:"\u5220\u9664",auth:"endpoint.town_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($,{key:1},q(_.crops,(S,E)=>(n(),x(m(z),{class:"mx-2px",key:E,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};
|