2 lines
3.8 KiB
JavaScript
2 lines
3.8 KiB
JavaScript
var y=Object.defineProperty,v=Object.defineProperties;var D=Object.getOwnPropertyDescriptors;var C=Object.getOwnPropertySymbols;var x=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={}))x.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)=>v(o,D(t));var h=(o,t,e)=>new Promise((r,a)=>{var l=n=>{try{s(e.next(n))}catch(i){a(i)}},c=n=>{try{s(e.throw(n))}catch(i){a(i)}},s=n=>n.done?r(n.value):Promise.resolve(n.value).then(l,c);s((e=e.apply(o,t)).next())});import{B as E,u as S}from"./useTable.47f1515f.js";import{T as R}from"./useForm.c0be8dd2.js";import{q as A,v as M,be as L,aC as u,bP as N,o as b,h as T,p as f,y as k,w as V,j,z as q,l as z,cu as w,g1 as I,g2 as K}from"./index.80d5b8a7.js";import{_ as P,c as U,s as W}from"./LinksDrawer.ebe4bb15.js";import{b as G}from"./index.7365439b.js";import"./index.2eef3e03.js";import"./Checkbox.ecb61dd2.js";import"./index.f86fd20a.js";import"./index.b81c4f99.js";import"./index.9ed9a1ce.js";import"./index.72a1ec09.js";import"./useSize.18c36d63.js";import"./eagerComputed.2afcc68e.js";import"./onMountedOrActivated.9a4e7728.js";import"./useWindowSizeFn.dff138d1.js";import"./useContentViewHeight.1aa83691.js";import"./ArrowLeftOutlined.244b6f1a.js";import"./transButton.dd91eda9.js";import"./index.94cdeb5c.js";import"./index.d3965a8a.js";import"./index.936bcd03.js";import"./index.a1361fe8.js";import"./dateUtil.334acb5f.js";import"./_baseMerge.d787d49c.js";import"./_isIterateeCall.e28bc4c3.js";import"./_baseEach.db363ee6.js";import"./get.9ecf4090.js";import"./index.a2f39e1a.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.d76b2479.js";import"./FullscreenOutlined.abcb6c9a.js";import"./index.d9c8bfa0.js";import"./fromPairs.84aabb58.js";import"./CaretUpOutlined.14988d42.js";import"./scrollTo.baf7def3.js";import"./index.d15bc2a6.js";import"./index.e3f23f17.js";import"./index.bfcaa235.js";import"./_baseIteratee.02af8ef8.js";import"./index.a94422d1.js";import"./useRefs.7ceb8caa.js";import"./download.2742eb39.js";import"./index.e3e998e3.js";import"./uniqBy.ea1eebc1.js";import"./defaultsDeep.c868e328.js";const H={components:{BasicTable:E,LinksDrawer:P,TableAction:R},setup(){const o=M({}),[t,{openModal:e}]=G(),[r,{reload:a}]=S({title:"\u8D26\u53F7\u5217\u8868",api:i=>h(this,null,function*(){const{data:d,meta:m}=yield K(p({},i));return{items:d,total:m==null?void 0:m.total}}),rowKey:"id",columns:U,formConfig:{labelWidth:80,schemas:W},useSearchForm:!0,showTableSetting:!0,bordered:!0,showIndexColumn:!0}),l=()=>{w.success("\u64CD\u4F5C\u6210\u529F"),a()},c=()=>{e(!0,{id:!1})};return _(p({handleEdit:i=>{e(!0,_(p({},i),{isUpdate:!0}))},handleDelete:i=>h(this,null,function*(){yield I(i.id),w.success("\u5220\u9664\u6210\u529F"),a()}),registerTable:r,registerModal:t,handleSuccess:l},L(o)),{handleCreate:c})}},J={key:0,class:"flex items-center justify-center"};function O(o,t,e,r,a,l){const c=u("a-button"),s=u("TableAction"),n=u("BasicTable"),i=u("LinksDrawer"),d=N("auth");return b(),T("div",null,[f(n,{onRegister:r.registerTable},{toolbar:k(()=>[V((b(),j(c,{type:"primary",onClick:r.handleCreate},{default:k(()=>[q(" \u65B0\u589E\u94FE\u63A5 ")]),_:1},8,["onClick"])),[[d,"endpoint.friend_links.index"]])]),bodyCell:k(({column:m,record:g})=>[m.key==="action"?(b(),T("div",J,[f(s,{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"])])):z("",!0)]),_:1},8,["onRegister"]),f(i,{onRegister:r.registerModal,onSuccess:r.handleSuccess},null,8,["onRegister","onSuccess"])])}var Ke=A(H,[["render",O]]);export{Ke as default};
|