import{c as $,y as G,a as Q}from"./systemManage-d67b09c0-1779868775780v=1.0.0.js";import{E as W}from"./eleVendor-dbf96bf3-1779868775780v=1.0.0.js";import{l as X,a as i,e as k,d as Y,b as Z,ah as c,m as C,M as x,O as u,U as t,ab as f,ac as _,u as l,p as ee,F as te,a7 as ae,q as N,S as w,ay as le,az as ue}from"./vendor-98154105-1779868775780v=1.0.0.js";import{_ as oe}from"./_plugin-vue_export-helper-8c5478df-1779868775780v=1.0.0.js";import"./index-0f3e2c06-1779868775780v=1.0.0.js";const se=g=>(le("data-v-cf6f358c"),g=g(),ue(),g),ne=se(()=>N("div",{class:"divider mb30"},"\u89D2\u8272\u4FE1\u606F",-1)),re={class:"tree-container"},de=X({__name:"baseInfo",props:{value:Object,loading:{type:Boolean,default:!1}},emits:["update:value","update:loading","cancel","submit"],setup(g,{emit:S}){const I=i(),y=i(null),p=i({xs:24,sm:24,md:24,lg:18,xl:18}),L={children:"children",label:"name"},h=i([]);let D=g;const F=S,n=k({get(){return D.value},set(a){F("update:value",a)}}),K=k({get(){return D.loading},set(a){F("update:loading",a)}}),M=k(()=>!!n.value.roleId),R={status:[{required:!0,message:"\u8BF7\u9009\u62E9\u89D2\u8272\u72B6\u6001",trigger:"change"}],mpId:[{required:!0,message:"\u8BF7\u9009\u62E9\u6240\u5C5E\u5E94\u7528",trigger:"change"}],name:[{required:!0,message:"\u8BF7\u8F93\u5165\u89D2\u8272\u540D\u79F0",trigger:"change"}]},B=i([]),A=async()=>{const e=await Q({});B.value=e.data.listData},U=()=>{let a=JSON.parse(JSON.stringify(n.value));const e=y.value.getCheckedKeys(),o=y.value.getHalfCheckedKeys();return a.menuId=[...e,...o],a},q=async a=>{a.validate(async(e,o)=>{if(e){let d=U();F("submit",d)}})},O=()=>{F("cancel")};Y(()=>{A()});const E=(a,e=[])=>(a.forEach(o=>{var d;o.isSelect&&e.push(o.menuId),(d=o.children)!=null&&d.length&&E(o.children,e)}),e),P=i([]),T=(a,e)=>Array.isArray(a)?e.filter(o=>!a.includes(o)):[],z=a=>Array.isArray(a)?a.map(e=>e.menuId):[];return Z(()=>[n.value.mpId,n.value.roleId],async([a,e])=>{if(a){let o=$,d={mpId:a};e&&(o=G,d.roleId=e),h.value=[];let s=await o(d);s.code!=0&&W.warning(s.msg),h.value=s.data?s.data:[];const m=z(s.data);if(s.data){let v=E(s.data);const b=T(m,v);y.value.setCheckedKeys(b,!0)}}}),(a,e)=>{const o=c("el-option"),d=c("el-select"),s=c("el-form-item"),m=c("FormCol"),v=c("el-input"),b=c("el-tree"),V=c("el-button"),J=c("FormRow"),j=c("el-form");return C(),x(j,{model:l(n),rules:R,ref_key:"ruleFormRef",ref:I,"scroll-to-error":!0,"label-width":"120px",class:"default-form"},{default:u(()=>[ne,t(J,null,{default:u(()=>[t(m,f(_(l(p))),{default:u(()=>[t(s,{label:"\u6240\u5C5E\u5E94\u7528",prop:"mpId"},{default:u(()=>[t(d,{modelValue:l(n).mpId,"onUpdate:modelValue":e[0]||(e[0]=r=>l(n).mpId=r),placeholder:"\u8BF7\u9009\u62E9\u5E94\u7528",disabled:l(M)},{default:u(()=>[(C(!0),ee(te,null,ae(l(B),(r,H)=>(C(),x(o,{key:H,label:r.mpName,value:r.mpId},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled"])]),_:1})]),_:1},16),t(m,f(_(l(p))),{default:u(()=>[t(s,{label:"\u89D2\u8272\u72B6\u6001",prop:"status"},{default:u(()=>[t(d,{modelValue:l(n).status,"onUpdate:modelValue":e[1]||(e[1]=r=>l(n).status=r),placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001"},{default:u(()=>[t(o,{label:"\u6709\u6548",value:1}),t(o,{label:"\u65E0\u6548",value:0})]),_:1},8,["modelValue"])]),_:1})]),_:1},16),t(m,f(_(l(p))),{default:u(()=>[t(s,{label:"\u89D2\u8272\u540D\u79F0",prop:"name"},{default:u(()=>[t(v,{modelValue:l(n).name,"onUpdate:modelValue":e[2]||(e[2]=r=>l(n).name=r),placeholder:"\u8BF7\u8F93\u5165\u89D2\u8272\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1},16),t(m,f(_(l(p))),{default:u(()=>[t(s,{label:"\u89D2\u8272\u63CF\u8FF0",prop:"remark"},{default:u(()=>[t(v,{modelValue:l(n).remark,"onUpdate:modelValue":e[3]||(e[3]=r=>l(n).remark=r),placeholder:"\u8BF7\u8F93\u5165\u89D2\u8272\u63CF\u8FF0"},null,8,["modelValue"])]),_:1})]),_:1},16),t(m,f(_(l(p))),{default:u(()=>[t(s,{label:"\u83DC\u5355\u6743\u9650",prop:"desc"},{default:u(()=>[N("div",re,[t(b,{ref_key:"treeRef",ref:y,style:{width:"100%"},data:l(h),"default-checked-keys":l(P),"show-checkbox":"","node-key":"menuId",props:L},null,8,["data","default-checked-keys"])])]),_:1})]),_:1},16),t(m,f(_(l(p))),{default:u(()=>[t(s,null,{default:u(()=>[t(V,{type:"primary",loading:l(K),onClick:e[4]||(e[4]=r=>q(l(I)))},{default:u(()=>[w("\u63D0\u4EA4")]),_:1},8,["loading"]),t(V,{onClick:O},{default:u(()=>[w("\u53D6\u6D88")]),_:1})]),_:1})]),_:1},16)]),_:1})]),_:1},8,["model"])}}});const _e=oe(de,[["__scopeId","data-v-cf6f358c"]]);export{_e as default};
