import{U as w,a2 as $,a3 as N,k as x,af as C,G as P,d as K,f as b,w as R}from"./vue-vendor-CxLCUzY4.js";import{h as U}from"./antd-vue-vendor-CahNzUUa.js";import{u as V}from"./index-gyz1IdHU.js";import{i as j,c as q,h as z}from"./auth.api-d3a6c4b3-lYYNpjOO.js";import{u as L,i as O}from"./auth.data-22948e87-bICx_6US.js";import{c9 as _}from"./index-Cy4uayzW.js";import A from"./BasicTable-CgafrQwz.js";import"./componentMap-0iK4HQBq.js";import"./useFormItem-IOFWTdED.js";import"./index-zKZnG1QC.js";import"./BasicModal-sKcs_9Ir.js";import"./ModalHeader-ByCVDoqO.js";import"./useTimeout-gJpgadD6.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./index-Bdn0r8CG.js";import"./useWindowSizeFn-DDyhhqyw.js";import"./index-CYoRlduV.js";import"./index-DYB8Ashr.js";import"./index-CrdW4fN1.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./download-Bn4f3tzD.js";import"./base64Conver-24EVOS6V.js";import"./index-D6H6KsT6.js";import"./index-CLxBW_h0.js";import"./useCountdown-2P9HvnfJ.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JSelectUser-B98pRPrS.js";import"./props-CtlWAg-s.js";import"./JSelectBiz-vYDBA0SK.js";import"./JAddInput-DP4caUmw.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./index-tDBMxW9-.js";import"./index-CNQBnF3P.js";import"./bem-IZKqD41e.js";import"./props-CG-jAkbI.js";import"./useContextMenu-Q6J5bB_u.js";import"./depart.api-B8q8MC-j.js";import"./JImageUpload-C5OCTlCG.js";import"./JDictSelectTag-CalJXNVe.js";import"./JSelectDept-D-TUaHvK.js";import"./JPopup-CVHkQZFq.js";import"./JEllipsis-TuDc52fh.js";import"./JUpload-DSWoDwh2.js";import"./index-B4vNk56t.js";import"./index-Dc7Jr5-j.js";import"./index-Dm1rPBfc.js";import"./index-BN26Feep.js";import"./useForm-DfoT2G6J.js";import"./JAreaLinkage-CTMEfTuh.js";import"./JCodeEditor-U9QIstNN.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */import"./EasyCronInput-CZdChTcP.js";import"./injectionKey-DPVn4AgL.js";var v=(n,m,p)=>new Promise((l,c)=>{var g=o=>{try{a(p.next(o))}catch(e){c(e)}},d=o=>{try{a(p.throw(o))}catch(e){c(e)}},a=o=>o.done?l(o.value):Promise.resolve(o.value).then(g,d);a((p=p.apply(n,m)).next())});const D=K({name:"AuthButtonConfig",components:{BasicTable:A},props:{headId:{type:String,default:"",required:!0},tableType:{type:Number,default:1}},setup(n){const m=b(""),p=b(2),l=b(3),c=b(5),[g,{reload:d,getTableRef:a,setPagination:o}]=V({api:e,rowKey:"code",bordered:!0,columns:L,showIndexColumn:!1});R(()=>n.headId,t=>{m.value=t.split("?")[0],a().value&&o({current:1,pageSize:10}),d().catch(()=>null)},{immediate:!0});function e(t){return v(this,null,function*(){let r=yield j(m.value,t),{authList:f,buttonList:s}=r,u=[];for(let i of U(O)){let h={status:0,page:l.value},k=f.find(S=>S.code==i.code);Object.assign(i,h,k),u.push(i)}if(n.tableType==3){const i=u.findIndex(h=>h.code==="super_query");i!=-1&&u.splice(i,1)}return y(f,s,u)})}function y(t,r,f){for(let s of r){let u=t.find(h=>h.code==s.buttonCode),i={code:s.buttonCode,title:s.buttonName,status:0,page:s.buttonStyle=="form"?c.value:l.value};f.push(Object.assign(i,u))}return f}function T(t,r){return v(this,null,function*(){t?B(r):I(r)})}function B(t){return v(this,null,function*(){let r=yield q({id:t.id,code:t.code,page:t.page,cgformId:m.value,type:p.value,control:5,status:1});t.id=r.id,t.status=1})}function I(t){return v(this,null,function*(){yield z(t.id),t.status=0})}return{registerTable:g,onUpdateStatus:T}}}),E={class:"auth-field-config"};function G(n,m,p,l,c,g){const d=w("a-switch"),a=w("BasicTable");return $(),N("div",E,[x(a,{onRegister:n.registerTable},{switch:C(({text:o,record:e})=>[x(d,{size:"small",checked:e.status===1,onChange:y=>n.onUpdateStatus(y,e)},null,8,["checked","onChange"])]),control:C(()=>[P(" 可见 ")]),_:1},8,["onRegister"])])}const Jt=_(D,[["render",G]]);export{Jt as default};
