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-gyz1IdHU.js";import{l as T,s as _,r as F}from"./auth.api-d3a6c4b3-lYYNpjOO.js";import{d as B}from"./auth.data-22948e87-bICx_6US.js";import{c9 as P}from"./index-Cy4uayzW.js";import R from"./BasicTable-CgafrQwz.js";import"./componentMap-0iK4HQBq.js";import"./antd-vue-vendor-CahNzUUa.js";import"./useFormItem-IOFWTdED.js";import"./index-zKZnG1QC.js";import"./BasicModal-sKcs_9Ir.js";import"./ModalHeader-ByCVDoqO.js";import"./useTimeout-gJpgadD6.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./index-Bdn0r8CG.js";import"./useWindowSizeFn-DDyhhqyw.js";import"./index-CYoRlduV.js";import"./index-DYB8Ashr.js";import"./index-CrdW4fN1.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./download-Bn4f3tzD.js";import"./base64Conver-24EVOS6V.js";import"./index-D6H6KsT6.js";import"./index-CLxBW_h0.js";import"./useCountdown-2P9HvnfJ.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JSelectUser-B98pRPrS.js";import"./props-CtlWAg-s.js";import"./JSelectBiz-vYDBA0SK.js";import"./JAddInput-DP4caUmw.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./index-tDBMxW9-.js";import"./index-CNQBnF3P.js";import"./bem-IZKqD41e.js";import"./props-CG-jAkbI.js";import"./useContextMenu-Q6J5bB_u.js";import"./depart.api-B8q8MC-j.js";import"./JImageUpload-C5OCTlCG.js";import"./JDictSelectTag-CalJXNVe.js";import"./JSelectDept-D-TUaHvK.js";import"./JPopup-CVHkQZFq.js";import"./JEllipsis-TuDc52fh.js";import"./JUpload-DSWoDwh2.js";import"./index-B4vNk56t.js";import"./index-Dc7Jr5-j.js";import"./index-Dm1rPBfc.js";import"./index-BN26Feep.js";import"./useForm-DfoT2G6J.js";import"./JAreaLinkage-CTMEfTuh.js";import"./JCodeEditor-U9QIstNN.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */import"./EasyCronInput-CZdChTcP.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};
