2 lines
3.8 KiB
JavaScript
2 lines
3.8 KiB
JavaScript
var E=Object.defineProperty,R=Object.defineProperties;var N=Object.getOwnPropertyDescriptors;var k=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var F=(r,e,t)=>e in r?E(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,h=(r,e)=>{for(var t in e||(e={}))V.call(e,t)&&F(r,t,e[t]);if(k)for(var t of k(e))j.call(e,t)&&F(r,t,e[t]);return r},w=(r,e)=>R(r,N(e));var b=(r,e,t)=>new Promise((c,a)=>{var l=i=>{try{s(t.next(i))}catch(o){a(o)}},d=i=>{try{s(t.throw(i))}catch(o){a(o)}},s=i=>i.done?c(i.value):Promise.resolve(i.value).then(l,d);s((t=t.apply(r,e)).next())});import{u as U,B as G}from"./useTable.0fe7b343.js";import{T as H}from"./useForm.501f3f59.js";import{a as I,aE as K,bP as L,o as n,h as f,p as g,B as p,y as P,j as B,D as x,k as u,l as D,F as W,aH as $,C as q,t as z,cu as v,ct as J,cv as M}from"./index.ed5deffd.js";import{u as O}from"./index.a73969f1.js";import{_ as Q,c as X,s as Y}from"./BaseDrawer.c24f5d87.js";import"./index.57e79dcc.js";import"./Checkbox.0ade27c0.js";import"./index.dfe580e1.js";import"./index.271eb465.js";import"./index.0292c9d3.js";import"./index.78c12dec.js";import"./useSize.f4cf68f5.js";import"./eagerComputed.890ab31a.js";import"./onMountedOrActivated.9d9d02f7.js";import"./useWindowSizeFn.a262cec0.js";import"./useContentViewHeight.b8e37cbd.js";import"./ArrowLeftOutlined.9abfd432.js";import"./transButton.f4575a26.js";import"./index.d726974a.js";import"./index.8d83801a.js";import"./index.cf1b1f15.js";import"./index.afc21ce4.js";import"./dateUtil.91a9b59f.js";import"./_baseMerge.9fac86cf.js";import"./_isIterateeCall.779fe698.js";import"./_baseEach.aed94d5c.js";import"./get.b38b45ae.js";import"./index.5b432cd4.js";import"./FullscreenOutlined.a18420c1.js";import"./index.cca952d1.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.a1f78ebd.js";import"./index.af1b13fa.js";import"./fromPairs.84aabb58.js";import"./CaretUpOutlined.51b9ef19.js";import"./scrollTo.707f46cf.js";import"./index.3b4e2932.js";import"./index.09a74575.js";import"./index.f6ae7164.js";import"./_baseIteratee.7c3a5712.js";import"./index.272fae53.js";import"./useRefs.045d664d.js";import"./download.b80ee91a.js";import"./index.c3b59272.js";import"./uniqBy.6fa12436.js";import"./index.141e5e7b.js";import"./other.1b193edd.js";import"./map.1d856fed.js";import"./lodash.28850c41.js";import"./defaultsDeep.74e32aaf.js";const Z={key:0,class:"flex items-center justify-center"},Xt=I({__name:"index",setup(r){const[e,{openDrawer:t}]=O(),[c,{reload:a}]=U({title:"\u57FA\u5730\u5217\u8868",api:o=>b(this,null,function*(){const{data:y,meta:m}=yield M(h({type:1},o));return{items:y,total:m==null?void 0:m.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"),a()},d=()=>{t(!0,{isUpdate:!1})},s=o=>{t(!0,w(h({},o),{isUpdate:!0}))},i=o=>b(this,null,function*(){yield J(o.id),v.success("\u5220\u9664\u6210\u529F"),a()});return(o,y)=>{const m=K("a-button"),T=L("auth");return n(),f("div",null,[g(u(G),{onRegister:u(c)},{toolbar:p(()=>[P((n(),B(m,{type:"primary",onClick:d},{default:p(()=>[x(" \u65B0\u589E\u57FA\u5730 ")]),_:1})),[[T,"endpoint.agricultural_basic.create"]])]),bodyCell:p(({column:C,record:_})=>[C.key==="action"?(n(),f("div",Z,[g(u(H),{actions:[{label:"\u7F16\u8F91",onClick:s.bind(null,_),auth:"endpoint.agricultural_basic.edit"},{label:"\u5220\u9664",auth:"endpoint.agricultural_basic.destroy",popConfirm:{title:"\u662F\u5426\u786E\u8BA4\u5220\u9664",placement:"topRight",confirm:i.bind(null,_)}}]},null,8,["actions"])])):D("",!0),C.key==="crops"?(n(!0),f(W,{key:1},$(_.crops,(S,A)=>(n(),B(u(q),{class:"mx-2px",key:A,type:"link"},{default:p(()=>[x(z(S.name),1)]),_:2},1024))),128)):D("",!0)]),_:1},8,["onRegister"]),g(Q,{onRegister:u(e),onSuccess:l},null,8,["onRegister"])])}}});export{Xt as default};
|