2 lines
3.8 KiB
JavaScript
2 lines
3.8 KiB
JavaScript
var y=Object.defineProperty,D=Object.defineProperties;var B=Object.getOwnPropertyDescriptors;var C=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,x=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))x.call(t,e)&&F(o,e,t[e]);return o},_=(o,t)=>D(o,B(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.7bd3e549.js";import{T as R}from"./useForm.58d4ac30.js";import{q as A,w as M,bf as L,aE as u,bP as N,o as f,h as T,p as b,B as k,y as V,j,D as q,l as I,cu as w,g1 as K,g2 as P}from"./index.4cfab8a3.js";import{_ as U,c as W,s as z}from"./LinksDrawer.b789d12f.js";import{b as G}from"./index.99da1b3a.js";import"./index.7e6981c0.js";import"./Checkbox.1a7a2210.js";import"./index.515816b0.js";import"./index.888a9349.js";import"./index.3992b0fa.js";import"./index.05a07a2d.js";import"./useSize.83e260c9.js";import"./eagerComputed.71efe3f5.js";import"./onMountedOrActivated.6d625ecd.js";import"./useWindowSizeFn.26644a8c.js";import"./useContentViewHeight.43f717c1.js";import"./ArrowLeftOutlined.1a96c0a3.js";import"./transButton.eb9d2040.js";import"./index.7a729c0f.js";import"./index.e9092c2e.js";import"./index.5349d363.js";import"./index.1897f4c1.js";import"./dateUtil.251c5c65.js";import"./_baseMerge.103a2237.js";import"./_isIterateeCall.6985bf4f.js";import"./_baseEach.704567e6.js";import"./get.6dddc1e3.js";import"./index.8d1990c9.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.6db24b45.js";import"./FullscreenOutlined.e420ed45.js";import"./index.43d35543.js";import"./fromPairs.84aabb58.js";import"./CaretUpOutlined.dee7c343.js";import"./scrollTo.097a15b8.js";import"./index.33b8907a.js";import"./index.70669b3e.js";import"./index.570f0a95.js";import"./_baseIteratee.fc5d2f55.js";import"./index.5edfa654.js";import"./useRefs.033d12ac.js";import"./download.69999d70.js";import"./index.7478fcf0.js";import"./uniqBy.51d9a517.js";import"./defaultsDeep.aff4a7c6.js";const H={components:{BasicTable:E,LinksDrawer:U,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 P(p({},i));return{items:d,total:m==null?void 0:m.total}}),rowKey:"id",columns:W,formConfig:{labelWidth:80,schemas:z},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 K(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 f(),T("div",null,[b(n,{onRegister:r.registerTable},{toolbar:k(()=>[V((f(),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"?(f(),T("div",J,[b(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"])])):I("",!0)]),_:1},8,["onRegister"]),b(i,{onRegister:r.registerModal,onSuccess:r.handleSuccess},null,8,["onRegister","onSuccess"])])}var Pe=A(H,[["render",O]]);export{Pe as default};
|