2 lines
3.8 KiB
JavaScript
2 lines
3.8 KiB
JavaScript
var R=Object.defineProperty,E=Object.defineProperties;var N=Object.getOwnPropertyDescriptors;var F=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var k=(r,e,t)=>e in r?R(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)&&k(r,t,e[t]);if(F)for(var t of F(e))j.call(e,t)&&k(r,t,e[t]);return r},w=(r,e)=>E(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 z}from"./useTable.04f0cb03.js";import{T as G}from"./useForm.f303dc30.js";import{a as I,aC as K,bP as L,o as n,h as f,p as g,y as p,w as P,j as B,z as x,k as u,l as v,F as W,aF as $,B as q,t as H,cu as D,ct as J,cv as M}from"./index.b56218e3.js";import{u as O}from"./index.58543c13.js";import{_ as Q,c as X,s as Y}from"./BaseDrawer.a19d850d.js";import"./index.f7854fa1.js";import"./Checkbox.43bd7deb.js";import"./index.0fbd073a.js";import"./index.184a4e5f.js";import"./index.a16f936c.js";import"./index.66e48ba2.js";import"./useSize.28a0d6e1.js";import"./eagerComputed.635e64cb.js";import"./onMountedOrActivated.0c0da89f.js";import"./useWindowSizeFn.f9d5ec9c.js";import"./useContentViewHeight.889f30a5.js";import"./ArrowLeftOutlined.beca8456.js";import"./transButton.405e50c4.js";import"./index.99b8df6b.js";import"./index.04f94c35.js";import"./index.8de1bb37.js";import"./index.12b269e9.js";import"./dateUtil.9fb6b0e3.js";import"./_baseMerge.0bfa0606.js";import"./_isIterateeCall.1e6ed12b.js";import"./_baseEach.7dd737b2.js";import"./get.38aee530.js";import"./index.9755e7ea.js";import"./FullscreenOutlined.df04a8af.js";import"./index.1d137040.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.771d23fd.js";import"./index.ee596b95.js";import"./fromPairs.84aabb58.js";import"./CaretUpOutlined.95a93c7c.js";import"./scrollTo.94a35d9d.js";import"./index.f3cd09dd.js";import"./index.120725a3.js";import"./index.8f641cc1.js";import"./_baseIteratee.5bc6cd3b.js";import"./index.3bc5adfa.js";import"./useRefs.f74cd62f.js";import"./download.3f7475a2.js";import"./index.4d910db3.js";import"./uniqBy.27125bbb.js";import"./index.cd3cda07.js";import"./other.d795c67e.js";import"./map.43319819.js";import"./lodash.9151235c.js";import"./defaultsDeep.b75360d3.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=()=>{D.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),D.success("\u5220\u9664\u6210\u529F"),a()});return(o,y)=>{const m=K("a-button"),T=L("auth");return n(),f("div",null,[g(u(z),{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(G),{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"])])):v("",!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(H(S.name),1)]),_:2},1024))),128)):v("",!0)]),_:1},8,["onRegister"]),g(Q,{onRegister:u(e),onSuccess:l},null,8,["onRegister"])])}}});export{Xt as default};
|