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-BN5Ac_IG.js";import{l as T,s as _,r as F}from"./auth.api-d3a6c4b3-D2WKBhPA.js";import{d as B}from"./auth.data-22948e87-bICx_6US.js";import{c9 as P}from"./index-CYriLmQo.js";import R from"./BasicTable-DAfCfXmD.js";import"./componentMap-7D1QIeNI.js";import"./antd-vue-vendor-CDWW6V_M.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 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 Kt=P(U,[["render",A],["__scopeId","data-v-c886a3df"]]);export{Kt as default};
