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-LwlFn7Y4.js";import{l as T,s as _,r as F}from"./auth.api-d3a6c4b3-DRUeCw5j.js";import{d as B}from"./auth.data-22948e87-bICx_6US.js";import{c9 as P}from"./index-B_2CoVdl.js";import R from"./BasicTable-Clbg3fHx.js";import"./componentMap-CzCGDP7x.js";import"./antd-vue-vendor-CDWW6V_M.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 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};
