2 lines
3.7 KiB
JavaScript
2 lines
3.7 KiB
JavaScript
var y=Object.defineProperty,w=Object.defineProperties;var x=Object.getOwnPropertyDescriptors;var C=Object.getOwnPropertySymbols;var B=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var g=(o,e,t)=>e in o?y(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,p=(o,e)=>{for(var t in e||(e={}))B.call(e,t)&&g(o,t,e[t]);if(C)for(var t of C(e))D.call(e,t)&&g(o,t,e[t]);return o},b=(o,e)=>w(o,x(e));var f=(o,e,t)=>new Promise((i,s)=>{var l=a=>{try{n(t.next(a))}catch(r){s(r)}},c=a=>{try{n(t.throw(a))}catch(r){s(r)}},n=a=>a.done?i(a.value):Promise.resolve(a.value).then(l,c);n((t=t.apply(o,e)).next())});import{B as E,u as R}from"./useTable.3f58fa46.js";import{T as S}from"./BasicForm.d379c388.js";import{J as A,s as v,bc as M,aA as u,o as k,h as F,p as d,x as h,y as L,l as N,cs as T,fQ as V,fR as j}from"./index.e4176240.js";import{_ as I,c as J,s as K}from"./LinksDrawer.2c6e2fe4.js";import{b as Q}from"./index.a00c919b.js";import"./index.5305881f.js";import"./Checkbox.ffb525d7.js";import"./index.fae53a05.js";import"./useForm.86138064.js";import"./index.57f3cb24.js";import"./index.c12cac96.js";import"./index.a60c9fb0.js";import"./useSize.5f47a75b.js";import"./eagerComputed.874767be.js";import"./onMountedOrActivated.711781e7.js";import"./useWindowSizeFn.7c933d53.js";import"./useContentViewHeight.9c129ec0.js";import"./ArrowLeftOutlined.54a316a9.js";import"./transButton.a733c209.js";import"./index.4b26ce11.js";import"./index.7e68de96.js";import"./index.9ac2be09.js";import"./index.5ef9ba3e.js";import"./dateUtil.b0cecff5.js";import"./_baseMerge.4eed803f.js";import"./_isIterateeCall.a1a7b3f9.js";import"./_baseEach.45fe8ebc.js";import"./get.55077b83.js";import"./index.e77abd91.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.dcac1d59.js";import"./FullscreenOutlined.a92a15a3.js";import"./fromPairs.84aabb58.js";import"./CaretUpOutlined.2eea2641.js";import"./scrollTo.0c27e46a.js";import"./index.5d192379.js";import"./index.0930b74c.js";import"./index.6b417575.js";import"./_baseIteratee.4ef33d0f.js";import"./index.1f43d8bd.js";import"./useRefs.4a2babcc.js";import"./download.bf7e37a7.js";import"./index.d0a68da2.js";import"./uniqBy.685b5c92.js";import"./defaultsDeep.915dd4db.js";const U={components:{BasicTable:E,LinksDrawer:I,TableAction:S},setup(){const o=v({}),[e,{openModal:t}]=Q(),[i,{reload:s}]=R({title:"\u8D26\u53F7\u5217\u8868",api:r=>f(this,null,function*(){const{data:_,meta:m}=yield j(p({},r));return{items:_,total:m==null?void 0:m.total}}),rowKey:"id",columns:J,formConfig:{labelWidth:80,schemas:K},useSearchForm:!0,showTableSetting:!0,bordered:!0,showIndexColumn:!0}),l=()=>{T.success("\u64CD\u4F5C\u6210\u529F"),s()},c=()=>{t(!0,{id:!1})};return b(p({handleEdit:r=>{t(!0,b(p({},r),{isUpdate:!0}))},handleDelete:r=>f(this,null,function*(){yield V(r.id),T.success("\u5220\u9664\u6210\u529F"),s()}),registerTable:i,registerModal:e,handleSuccess:l},M(o)),{handleCreate:c})}},W={key:0,class:"flex items-center justify-center"};function q(o,e,t,i,s,l){const c=u("a-button"),n=u("TableAction"),a=u("BasicTable"),r=u("LinksDrawer");return k(),F("div",null,[d(a,{onRegister:i.registerTable},{toolbar:h(()=>[d(c,{type:"primary",onClick:i.handleCreate},{default:h(()=>[L(" \u65B0\u589E\u94FE\u63A5 ")]),_:1},8,["onClick"])]),bodyCell:h(({column:_,record:m})=>[_.key==="action"?(k(),F("div",W,[d(n,{actions:[{label:"\u7F16\u8F91",onClick:i.handleEdit.bind(null,m)},{label:"\u5220\u9664",popConfirm:{title:"\u662F\u5426\u786E\u8BA4\u5220\u9664",placement:"topRight",confirm:i.handleDelete.bind(null,m)}}]},null,8,["actions"])])):N("",!0)]),_:1},8,["onRegister"]),d(r,{onRegister:i.registerModal,onSuccess:i.handleSuccess},null,8,["onRegister","onSuccess"])])}var jt=A(U,[["render",q]]);export{jt as default};
|