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-KOQNKxnC.js";import{i as j,c as q,h as z}from"./auth.api-d3a6c4b3-Db8RVbP1.js";import{u as L,i as O}from"./auth.data-22948e87-bICx_6US.js";import{c9 as _}from"./index-CLZzJyTP.js";import A from"./BasicTable-DUJWN3yz.js";import"./componentMap-DpsJvoqz.js";import"./useFormItem-IOFWTdED.js";import"./index-XZKTTfG1.js";import"./BasicModal-B8XmAOm7.js";import"./ModalHeader-DIFQSP_0.js";import"./useTimeout-KpZCXEcl.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./index-DvqyyN77.js";import"./useWindowSizeFn-D9PllI8g.js";import"./index-DS3utcig.js";import"./index-BZbg0EjM.js";import"./index-CrdW4fN1.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./download-DopMSmFN.js";import"./base64Conver-24EVOS6V.js";import"./index-CDa2_aYE.js";import"./index-D0jTtUNS.js";import"./useCountdown-BpP55PQ2.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JSelectUser-CfAGgHjD.js";import"./props-BtZrRNiI.js";import"./JSelectBiz-CLnJTMe2.js";import"./JAddInput-B36c3B5x.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./index-C7yPiS0L.js";import"./index-44tRnyoF.js";import"./bem-DT3DdmOs.js";import"./props-CG-jAkbI.js";import"./useContextMenu-BGU2vdqV.js";import"./depart.api-DHG2p2Yd.js";import"./JImageUpload-BFwNYdm5.js";import"./JDictSelectTag-CfF54ALX.js";import"./JSelectDept-CaEHrQp6.js";import"./JPopup-BvqhHpPl.js";import"./JEllipsis-C_gT_vEQ.js";import"./JUpload-DgDEmizw.js";import"./index-Bn2zmO2L.js";import"./index-CEznvAVZ.js";import"./index-CfAukas3.js";import"./index-ByX9XNkE.js";import"./useForm-Dx3lJ3DG.js";import"./JAreaLinkage-M9TGy8nY.js";import"./JCodeEditor-CR57XeIe.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */import"./EasyCronInput-CWOTSpxK.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};
