import Y from"./diagTable-53aca04b-1779868775780v=1.0.0.js";import{E as Z}from"./eleVendor-dbf96bf3-1779868775780v=1.0.0.js";import{l as ee,a as y,e as P,d as oe,ah as r,m as c,p as V,U as l,O as e,ab as b,ac as k,u as t,S as n,M as R,K as h,F as D,a7 as T,T as S,q as B,R as L,B as N,ay as le,az as ae}from"./vendor-98154105-1779868775780v=1.0.0.js";import{_ as te}from"./_plugin-vue_export-helper-8c5478df-1779868775780v=1.0.0.js";import"./useTable-7f617eef-1779868775780v=1.0.0.js";import"./index-0f3e2c06-1779868775780v=1.0.0.js";import"./useCheck-55f2b7da-1779868775780v=1.0.0.js";import"./organize-df1743e7-1779868775780v=1.0.0.js";const E=_=>(le("data-v-cde7670e"),_=_(),ae(),_),ue=E(()=>B("div",{class:"divider mb30"},"\u5BA1\u6838\u7C7B\u578B",-1)),se=E(()=>B("div",{class:"divider mb30"},"\u5BA1\u6838\u4EBA\u5458",-1)),ne=E(()=>B("div",{class:"divider mb30"},"\u8BF7\u9009\u62E9\u4EBA\u5458",-1)),de=["onClick"],re=E(()=>B("div",{class:"divider mb30"},"\u8BF7\u9009\u62E9\u89D2\u8272",-1)),ie=ee({__name:"baseform",props:{value:{default:()=>({})},roleList:{default:()=>[]},loading:{default:{type:Boolean,default:!1}}},emits:["update:value","update:loading","cancel","submit"],setup(_,{emit:w}){const x=y(),f=y({xs:24,sm:24,md:24,lg:18,xl:18});let I=_;const A=w,C=y(!1),d=y([]),p=y([]),i=P({get(){return J(I.value)},set(a){A("update:value",a)}}),O=P({get(){return I.loading},set(a){A("update:loading",a)}}),U=()=>{d.value=[],p.value=[]},M=()=>{C.value=!0},W=a=>{d.value.length&&d.value.some(s=>s.id===a.id)||d.value.push(a)},j=a=>{d.value=d.value.filter(o=>o.id!==a)},z=a=>{p.value=a},J=a=>{let o=a;return o.auditType==="personal"?d.value=o.auditRolePersIdsRespVOList:p.value=o.auditRolePersIdsRespVOList.map(s=>s.id),o},$=()=>{let a=JSON.parse(JSON.stringify(i.value));return a.auditType==="personal"?a.auditRolePersIds=d.value.map(o=>o.id).join(","):a.auditRolePersIds=p.value.join(","),a},q=async a=>{a.validate(async(o,s)=>{if(o){let m=$();if(!m.auditRolePersIds&&m.auditType!=="orgs"){Z.error("\u8BF7\u52FE\u9009\u89D2\u8272\u6216\u8005\u4EBA\u5458\uFF01");return}A("submit",m)}})},K=()=>{A("cancel")};return oe(()=>{}),(a,o)=>{const s=r("el-radio"),m=r("el-radio-group"),v=r("el-form-item"),g=r("FormCol"),F=r("el-button"),G=r("el-checkbox"),H=r("el-checkbox-group"),Q=r("FormRow"),X=r("el-form");return c(),V("div",null,[l(X,{model:t(i),ref_key:"ruleFormRef",ref:x,"scroll-to-error":!0,"label-width":"",class:"default-form"},{default:e(()=>[l(Q,null,{default:e(()=>[l(g,b(k(t(f))),{default:e(()=>[ue,l(v,{label:"",prop:"auditWay"},{default:e(()=>[l(m,{modelValue:t(i).auditWay,"onUpdate:modelValue":o[0]||(o[0]=u=>t(i).auditWay=u)},{default:e(()=>[l(s,{value:"personnel"},{default:e(()=>[n("\u4EBA\u5DE5\u5BA1\u6838")]),_:1}),l(s,{value:"auto"},{default:e(()=>[n("\u81EA\u52A8\u901A\u8FC7")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},16),l(g,b(k(t(f))),{default:e(()=>[se,l(v,{label:"",prop:"auditType"},{default:e(()=>[l(m,{modelValue:t(i).auditType,"onUpdate:modelValue":o[1]||(o[1]=u=>t(i).auditType=u),onChange:U},{default:e(()=>[l(s,{value:"personal"},{default:e(()=>[n("\u6307\u5B9A\u4EBA\u5458")]),_:1}),l(s,{value:"role"},{default:e(()=>[n("\u6307\u5B9A\u89D2\u8272")]),_:1}),l(s,{value:"orgs"},{default:e(()=>[n("\u8FDE\u7EED\u591A\u7EA7\u7BA1\u7406\u673A\u6784\u5BA1\u6838")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},16),t(i).auditType==="personal"?(c(),R(g,b(h({key:0},t(f))),{default:e(()=>[ne,l(v,{label:"",prop:"auditRolePersIds"},{default:e(()=>[l(F,{onClick:M},{default:e(()=>[n("+ \u6DFB\u52A0")]),_:1}),(c(!0),V(D,null,T(t(d),u=>(c(),V("div",{class:"name",key:u.aid},[n(S(u.name)+" ",1),B("span",{class:"close",onClick:pe=>j(u.id)},"x",8,de)]))),128))]),_:1})]),_:1},16)):L("",!0),t(i).auditType!=="personal"?(c(),R(g,b(h({key:1},t(f))),{default:e(()=>[re,l(v,{label:"",prop:"auditRolePersIds"},{default:e(()=>[l(H,{modelValue:t(p),"onUpdate:modelValue":o[2]||(o[2]=u=>N(p)?p.value=u:null),onChange:z},{default:e(()=>[(c(!0),V(D,null,T(a.roleList,u=>(c(),R(G,{key:u.roleId,value:u.roleId},{default:e(()=>[n(S(u.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},16)):L("",!0),l(g,b(k(t(f))),{default:e(()=>[l(v,null,{default:e(()=>[l(F,{onClick:K},{default:e(()=>[n("\u53D6\u6D88")]),_:1}),l(F,{type:"primary",loading:t(O),onClick:o[3]||(o[3]=u=>q(t(x)))},{default:e(()=>[n("\u63D0\u4EA4")]),_:1},8,["loading"])]),_:1})]),_:1},16)]),_:1})]),_:1},8,["model"]),l(Y,{dialogVisible:t(C),"onUpdate:dialogVisible":o[4]||(o[4]=u=>N(C)?C.value=u:null),onSelectPerson:W},null,8,["dialogVisible"])])}}});const Be=te(ie,[["__scopeId","data-v-cde7670e"]]);export{Be as default};
