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-CDWW6V_M.js";import{u as V}from"./index-BN5Ac_IG.js";import{i as j,c as q,h as z}from"./auth.api-d3a6c4b3-D2WKBhPA.js";import{u as L,i as O}from"./auth.data-22948e87-bICx_6US.js";import{c9 as _}from"./index-CYriLmQo.js";import A from"./BasicTable-DAfCfXmD.js";import"./componentMap-7D1QIeNI.js";import"./useFormItem-CWa0w7fA.js";import"./index-CF_FJn6P.js";import"./BasicModal-BBgVjypv.js";import"./ModalHeader-jGKMr-DQ.js";import"./useTimeout-DC8132dd.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./index-CxQILSKV.js";import"./useWindowSizeFn-BxrEMPtP.js";import"./index-BRTtls-l.js";import"./index-DOuVMe-q.js";import"./index-ByLO0zSl.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./download-CkbK5et1.js";import"./base64Conver-24EVOS6V.js";import"./index-QMJkXEyl.js";import"./index-Bb_NRLur.js";import"./useCountdown-C3-PRPLY.js";import"./useFormItemSingle-DM34aWgK.js";import"./JSelectUser-nVFm3ao2.js";import"./props-DoGpHXAD.js";import"./JSelectBiz-BW6f3e--.js";import"./JAddInput-CXT54-j9.js";import"./areaDataUtil-DFHnz1wu.js";import"./china-area-data-vendor-D0sJ9kfX.js";import"./index-BTSd5ebC.js";import"./index-BTAl55Kt.js";import"./bem-2ra1afoV.js";import"./props-BLY2qIO5.js";import"./useContextMenu-DYyhcDf7.js";import"./depart.api-C9T5xfw6.js";import"./JDictSelectTag-Jqy9TBcS.js";import"./JSelectDept-DorRVguN.js";import"./JPopup-KP1kIsae.js";import"./JEllipsis-287cEHxd.js";import"./JUpload-pyrTRFCz.js";import"./index-Bx9Mnn3N.js";import"./index-B1-pj6uh.js";import"./index-isxCPgHp.js";import"./index-BkgeZpOO.js";import"./useForm-8o5KRzWo.js";import"./JAreaLinkage-DFTeDmm8.js";import"./JCodeEditor-_KZ8XnNK.js";import"./htmlmixed-DRe7JlAp.js";import"./vue-B0b3nX1K.js";/* empty css             */import"./EasyCronInput-XK54XB3r.js";import"./injectionKey-DPVn4AgL.js";var v=(n,m,p)=>new Promise((l,c)=>{var g=e=>{try{a(p.next(e))}catch(o){c(o)}},d=e=>{try{a(p.throw(e))}catch(o){c(o)}},a=e=>e.done?l(e.value):Promise.resolve(e.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:e}]=V({api:o,rowKey:"code",bordered:!0,columns:L,showIndexColumn:!1});R(()=>n.headId,t=>{m.value=t.split("?")[0],a().value&&e({current:1,pageSize:10}),d().catch(()=>null)},{immediate:!0});function o(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:e,record:o})=>[x(d,{size:"small",checked:o.status===1,onChange:y=>n.onUpdateStatus(y,o)},null,8,["checked","onChange"])]),control:C(()=>[P(" 可见 ")]),_:1},8,["onRegister"])])}const Ht=_(D,[["render",G]]);export{Ht as default};
