2 lines
3.8 KiB
JavaScript
2 lines
3.8 KiB
JavaScript
var y=Object.defineProperty,x=Object.defineProperties;var D=Object.getOwnPropertyDescriptors;var C=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var F=(o,t,e)=>t in o?y(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,p=(o,t)=>{for(var e in t||(t={}))v.call(t,e)&&F(o,e,t[e]);if(C)for(var e of C(t))B.call(t,e)&&F(o,e,t[e]);return o},_=(o,t)=>x(o,D(t));var h=(o,t,e)=>new Promise((r,s)=>{var l=n=>{try{a(e.next(n))}catch(i){s(i)}},c=n=>{try{a(e.throw(n))}catch(i){s(i)}},a=n=>n.done?r(n.value):Promise.resolve(n.value).then(l,c);a((e=e.apply(o,t)).next())});import{B as E,u as S}from"./useTable.2352d2fe.js";import{T as A}from"./useForm.d587933e.js";import{J as R,s as M,bc as N,aA as u,bN as L,o as b,h as T,p as f,x as k,w as V,j,y as I,l as J,cs as w,g0 as K,g1 as U}from"./index.e18f5da0.js";import{_ as W,c as q,s as z}from"./LinksDrawer.47d41ffa.js";import{b as G}from"./index.ce5a67b4.js";import"./index.f5b0517b.js";import"./Checkbox.1d7aef92.js";import"./index.18e37fde.js";import"./index.4165228b.js";import"./index.6ea806b4.js";import"./index.8f113586.js";import"./useSize.a4a6a0b5.js";import"./eagerComputed.5abdc236.js";import"./onMountedOrActivated.8b2c64d9.js";import"./useWindowSizeFn.331375f7.js";import"./useContentViewHeight.4fada4e8.js";import"./ArrowLeftOutlined.56d81052.js";import"./transButton.3a5125c5.js";import"./index.dd76fe0d.js";import"./index.3e27cd1f.js";import"./index.9f2dbe7f.js";import"./index.797edf9b.js";import"./dateUtil.2bca8543.js";import"./_baseMerge.da11952f.js";import"./_isIterateeCall.eb40dff9.js";import"./_baseEach.f4d1b1b6.js";import"./get.ff147aa8.js";import"./index.c55285f3.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.9f532528.js";import"./FullscreenOutlined.2ab00df5.js";import"./index.d2bd0776.js";import"./fromPairs.84aabb58.js";import"./CaretUpOutlined.c2b99130.js";import"./scrollTo.6402e612.js";import"./index.e84cb7e7.js";import"./index.314c10b5.js";import"./index.5324b222.js";import"./_baseIteratee.ca0c9f41.js";import"./index.99414f09.js";import"./useRefs.6d294be4.js";import"./download.af54b394.js";import"./index.931312bb.js";import"./uniqBy.721e8166.js";import"./defaultsDeep.ad394461.js";const H={components:{BasicTable:E,LinksDrawer:W,TableAction:A},setup(){const o=M({}),[t,{openModal:e}]=G(),[r,{reload:s}]=S({title:"\u8D26\u53F7\u5217\u8868",api:i=>h(this,null,function*(){const{data:d,meta:m}=yield U(p({},i));return{items:d,total:m==null?void 0:m.total}}),rowKey:"id",columns:q,formConfig:{labelWidth:80,schemas:z},useSearchForm:!0,showTableSetting:!0,bordered:!0,showIndexColumn:!0}),l=()=>{w.success("\u64CD\u4F5C\u6210\u529F"),s()},c=()=>{e(!0,{id:!1})};return _(p({handleEdit:i=>{e(!0,_(p({},i),{isUpdate:!0}))},handleDelete:i=>h(this,null,function*(){yield K(i.id),w.success("\u5220\u9664\u6210\u529F"),s()}),registerTable:r,registerModal:t,handleSuccess:l},N(o)),{handleCreate:c})}},O={key:0,class:"flex items-center justify-center"};function P(o,t,e,r,s,l){const c=u("a-button"),a=u("TableAction"),n=u("BasicTable"),i=u("LinksDrawer"),d=L("auth");return b(),T("div",null,[f(n,{onRegister:r.registerTable},{toolbar:k(()=>[V((b(),j(c,{type:"primary",onClick:r.handleCreate},{default:k(()=>[I(" \u65B0\u589E\u94FE\u63A5 ")]),_:1},8,["onClick"])),[[d,"endpoint.friend_links.index"]])]),bodyCell:k(({column:m,record:g})=>[m.key==="action"?(b(),T("div",O,[f(a,{actions:[{label:"\u7F16\u8F91",onClick:r.handleEdit.bind(null,g),auth:"endpoint.friend_links.edit"},{label:"\u5220\u9664",auth:"endpoint.friend_links.destroy",popConfirm:{title:"\u662F\u5426\u786E\u8BA4\u5220\u9664",placement:"topRight",confirm:r.handleDelete.bind(null,g)}}]},null,8,["actions"])])):J("",!0)]),_:1},8,["onRegister"]),f(i,{onRegister:r.registerModal,onSuccess:r.handleSuccess},null,8,["onRegister","onSuccess"])])}var Ue=R(H,[["render",P]]);export{Ue as default};
|