var O=Object.defineProperty;var k=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var T=(s,o,t)=>o in s?O(s,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[o]=t,B=(s,o)=>{for(var t in o||(o={}))V.call(o,t)&&T(s,t,o[t]);if(k)for(var t of k(o))$.call(o,t)&&T(s,t,o[t]);return s};var p=(s,o,t)=>new Promise((b,u)=>{var h=i=>{try{c(t.next(i))}catch(d){u(d)}},y=i=>{try{c(t.throw(i))}catch(d){u(d)}},c=i=>i.done?b(i.value):Promise.resolve(i.value).then(h,y);c((t=t.apply(s,o)).next())});import{u as M,a as F,b as G,_ as q}from"./useCrudSchemas-f5-cIgli.js";import{e as f,c as I}from"./index-D4Ne4xf-.js";import{w as Z,x as H}from"./index-CkdMtLMK.js";import{l as J,aB as K,r as g,Z as Q,U as r,F as W,u as l,m as X,M as Y,O as S,q as ee,S as D,T as C,B as z,y as te}from"./vue-chunks-DyZSmvoe.js";import{u as ae}from"./useEventBus-BjGKlZmW.js";import{n as P,f as le}from"./element-plus-DNKe9-lk.js";import"./tsxHelper-DOqx_mcA.js";import"./tree-Dgaev6Pi.js";const oe={class:"mb-10px"};function R(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Object]"&&!te(s)}const ge=J({__name:"index",setup(s){const{push:o}=K(),t=g([]),{tableRegister:b,tableState:u,tableMethods:h}=M({fetchDataApi:()=>p(this,null,function*(){const{currentPage:e,pageSize:a}=u,n=yield H(B({current:l(e),pageSize:l(a)},l(U)));return{list:n.list,total:n.count}}),fetchDelApi:()=>p(this,null,function*(){})}),{loading:y,dataList:c,total:i,currentPage:d,pageSize:_}=u,{getList:v,getElTableExpose:L,delList:se}=h,U=g({}),{t:m}=I(),j=Q([{field:"selection",search:{hidden:!0},form:{hidden:!0},detail:{hidden:!0},table:{type:"selection"}},{field:"label",label:"标签",search:{hidden:!0},formatter:e=>e.label&&r(P,{type:"primary"},{default:()=>[e.label]})},{field:"customUrl",label:"api地址",search:{hidden:!0},formatter:e=>r("div",null,[e.customUrl])},{field:"methods",label:"请求方法",search:{hidden:!0},formatter:e=>e.methods&&r(P,{type:"primary"},{default:()=>[e.methods]})},{field:"action",width:"260px",label:m("tableDemo.action"),search:{hidden:!0},form:{hidden:!0},detail:{hidden:!0},fixed:"right",table:{slots:{default:e=>{let a,n;return r(W,null,[r(f,{type:"primary",onClick:()=>N(e.row)},R(a=m("exampleDemo.edit"))?a:{default:()=>[a]}),r(f,{type:"danger",onClick:()=>w(e.row)},R(n=m("exampleDemo.del"))?n:{default:()=>[n]})])}}}}]),{allSchemas:A}=F(j);g(null);const E=()=>{o("/globalTask/add")},x=g(!1),w=e=>p(this,null,function*(){const a=yield L();t.value=e?[e.id]:(a==null?void 0:a.getSelectionRows().map(n=>n.id))||[],x.value=!0,yield le.confirm("确定删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}),yield Z(l(t).join(",")).finally(()=>{x.value=!1,v()})}),N=(e,a)=>p(this,null,function*(){o("/globalTask/edit/"+e.id)});return ae({name:"getList",callback:e=>{e==="add"&&(d.value=1),v()}}),(e,a)=>(X(),Y(l(q),{title:"回调配置",message:`全局回调配置
`},{default:S(()=>[ee("div",oe,[r(l(f),{type:"primary",onClick:E},{default:S(()=>[D(C(l(m)("exampleDemo.add")),1)]),_:1}),r(l(f),{loading:x.value,type:"danger",onClick:a[0]||(a[0]=n=>w(null))},{default:S(()=>[D(C(l(m)("exampleDemo.del")),1)]),_:1},8,["loading"])]),r(l(G),{showOverflowTooltip:!1,pageSize:l(_),"onUpdate:pageSize":a[1]||(a[1]=n=>z(_)?_.value=n:null),currentPage:l(d),"onUpdate:currentPage":a[2]||(a[2]=n=>z(d)?d.value=n:null),columns:l(A).tableColumns,data:l(c),loading:l(y),pagination:{total:l(i)},"image-preview":["url"],onRegister:l(b)},null,8,["pageSize","currentPage","columns","data","loading","pagination","onRegister"])]),_:1}))}});export{ge as default};
