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-LwlFn7Y4.js";import{i as j,c as q,h as z}from"./auth.api-d3a6c4b3-DRUeCw5j.js";import{u as L,i as O}from"./auth.data-22948e87-bICx_6US.js";import{c9 as _}from"./index-B_2CoVdl.js";import A from"./BasicTable-Clbg3fHx.js";import"./componentMap-CzCGDP7x.js";import"./useFormItem-CWa0w7fA.js";import"./index-D2AmS0aU.js";import"./BasicModal-D3g2CFhF.js";import"./ModalHeader-C-C0dUi_.js";import"./useTimeout-CB9F1PLu.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./index-DAURrYyA.js";import"./useWindowSizeFn-C3WExEpc.js";import"./index-Dz2zbQB_.js";import"./index-exs4VcBw.js";import"./index-ByLO0zSl.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./download-2tYEzlDW.js";import"./base64Conver-24EVOS6V.js";import"./index-Cgt544dC.js";import"./index-BZ9ST2iq.js";import"./useCountdown-ImUE7YaG.js";import"./useFormItemSingle-DM34aWgK.js";import"./JSelectUser-BQIJUcBR.js";import"./props-BCVPj-bG.js";import"./JSelectBiz-CJyWq5s2.js";import"./JAddInput-YFlAniYT.js";import"./areaDataUtil-DFHnz1wu.js";import"./china-area-data-vendor-D0sJ9kfX.js";import"./index-CkL00Q0a.js";import"./index-BKs2x_To.js";import"./bem-C6eT35UB.js";import"./props-BLY2qIO5.js";import"./useContextMenu-CSt5a1-F.js";import"./depart.api-0qTriT9h.js";import"./JDictSelectTag-CxpDdimB.js";import"./JSelectDept-wKz_Qtmc.js";import"./JPopup-BJBYqoWe.js";import"./JEllipsis-Cn7GCKHR.js";import"./JUpload-DzM-D4DX.js";import"./index-khU3p_On.js";import"./index-DPEnuI0R.js";import"./index-Cnb8BkwG.js";import"./index-ARbUvvsq.js";import"./useForm-CcjrODHR.js";import"./JAreaLinkage-CSgDAlrn.js";import"./JCodeEditor-esTLnfS3.js";import"./htmlmixed-DRe7JlAp.js";import"./vue-B0b3nX1K.js";/* empty css             */import"./EasyCronInput-DclSHT47.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};
