import{U as g,a2 as x,a3 as S,k as h,af as p,G as w,d as v,f as y,w as E}from"./vue-vendor-CxLCUzY4.js";import{u as I}from"./index-KOQNKxnC.js";import{l as T,s as _,r as F}from"./auth.api-d3a6c4b3-Db8RVbP1.js";import{d as B}from"./auth.data-22948e87-bICx_6US.js";import{c9 as P}from"./index-CLZzJyTP.js";import R from"./BasicTable-DUJWN3yz.js";import"./componentMap-DpsJvoqz.js";import"./antd-vue-vendor-CahNzUUa.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 C=(i,u,r)=>new Promise((f,c)=>{var b=e=>{try{a(r.next(e))}catch(n){c(n)}},d=e=>{try{a(r.throw(e))}catch(n){c(n)}},a=e=>e.done?f(e.value):Promise.resolve(e.value).then(b,d);a((r=r.apply(i,u)).next())});const U=v({name:"AuthFieldConfig",components:{BasicTable:R},props:{headId:{type:String,default:"",required:!0}},emits:["update:authFields"],setup(i,{emit:u}){const r=y(""),[f,{reload:c,getTableRef:b,setPagination:d}]=I({api:a,rowKey:"code",bordered:!0,columns:B,showIndexColumn:!1});E(()=>i.headId,o=>{r.value=o.split("?")[0],b().value&&d({current:1,pageSize:10}),c().catch(()=>null)},{immediate:!0});function a(o){return C(this,null,function*(){const t=["id"];let l=yield T(r.value,o),m=[],k=[];return l.forEach(s=>{t.indexOf(s.code)<0&&((s.isShowForm==1||s.isShowList==1)&&k.push(s),s.dbIsPersist==1&&m.push({text:s.title,value:s.code}))}),u("update:authFields",m),k})}function e(o,t){return C(this,null,function*(){yield F({cgformId:r.value,code:t.code,status:o?1:0}),t.formEditable||t.formShow||t.listShow||(t.formEditable=!0,t.formShow=!0,t.listShow=!0),t.status=Math.abs(t.status-1)})}function n(o,t,l){return C(this,null,function*(){let m=o.target.checked;yield _({cgformId:r.value,code:t.code,switchFlag:l,listShow:m,formShow:m,formEditable:m}),l==1?t.listShow=m:l==2?t.formShow=m:l==3&&(t.formEditable=m)})}return{registerTable:f,onUpdateStatus:e,onCheckboxChange:n}}}),z={class:"auth-field-config"};function A(i,u,r,f,c,b){const d=g("a-switch"),a=g("a-checkbox"),e=g("BasicTable");return x(),S("div",z,[h(e,{onRegister:i.registerTable},{switch:p(({text:n,record:o})=>[h(d,{size:"small",checked:o.status===1,onChange:t=>i.onUpdateStatus(t,o)},null,8,["checked","onChange"])]),list:p(({text:n,record:o})=>[h(a,{checked:o.listShow,disabled:o.status===0,onChange:t=>i.onCheckboxChange(t,o,1)},{default:p(()=>[w(" 可见 ")]),_:2},1032,["checked","disabled","onChange"])]),form:p(({text:n,record:o})=>[h(a,{checked:o.formShow,disabled:o.status===0,onChange:t=>i.onCheckboxChange(t,o,2)},{default:p(()=>[w(" 可见 ")]),_:2},1032,["checked","disabled","onChange"]),h(a,{checked:o.formEditable,disabled:o.status===0,onChange:t=>i.onCheckboxChange(t,o,3)},{default:p(()=>[w(" 可编辑 ")]),_:2},1032,["checked","disabled","onChange"])]),_:1},8,["onRegister"])])}const Nt=P(U,[["render",A],["__scopeId","data-v-c886a3df"]]);export{Nt as default};
