1 |
- import{d as P,h as D,r as o,e as G,o as C,q as V,w as l,f as t,a as u,m,v as J,t as I,N as h,ak as L,z as O,E as Q,i as T,d2 as W,d_ as X,C as Y,B as Z,H as $,__tla as ee}from"./index-2eab2d23.js";import{_ as ae,__tla as le}from"./Dialog-c2716df6.js";import{E as te,__tla as se}from"./el-card-c558f0ec.js";import{d as ue,h as de}from"./tree-fd3a041e.js";import{g as oe,__tla as re}from"./index-14739cb5.js";import{b as ne,c as ce,__tla as _e}from"./index-36e83085.js";import{u as me,__tla as ie}from"./useMessage-171aa63e.js";import{_ as fe}from"./_plugin-vue_export-helper-1b428a4d.js";let b,ve=Promise.all([(()=>{try{return ee}catch{}})(),(()=>{try{return le}catch{}})(),(()=>{try{return se}catch{}})(),(()=>{try{return re}catch{}})(),(()=>{try{return _e}catch{}})(),(()=>{try{return ie}catch{}})()]).then(async()=>{b=fe(P({name:"SystemRoleAssignMenuForm",__name:"RoleAssignMenuForm",emits:["success"],setup(pe,{expose:w,emit:R}){const{t:E}=D(),F=me(),r=o(!1),n=o(!1),s=G({id:0,name:"",code:"",menuIds:[]}),v=o(),p=o([]),c=o(!1),d=o(),i=o(!1);w({open:async a=>{r.value=!0,U(),p.value=de(await oe({categoryId:a.categoryId})),s.id=a.id,s.name=a.name,s.code=a.code,n.value=!0;try{s.value.menuIds=await ne(a.id),s.value.menuIds.forEach(e=>{d.value.setChecked(e,!0,!1)})}finally{n.value=!1}}});const H=R,M=async()=>{if(v&&await v.value.validate()){n.value=!0;try{const a={roleId:s.id,menuIds:[...d.value.getCheckedKeys(!1),...d.value.getHalfCheckedKeys()]};await ce(a),F.success(E("common.updateSuccess")),r.value=!1,H("success")}finally{n.value=!1}}},U=()=>{var a,e;i.value=!1,c.value=!1,s.value={id:0,name:"",code:"",menuIds:[]},(a=d.value)==null||a.setCheckedNodes([]),(e=v.value)==null||e.resetFields()},N=()=>{d.value.setCheckedNodes(i.value?p.value:[])},A=()=>{var e;const a=(e=d.value)==null?void 0:e.store.nodesMap;for(let f in a)a[f].expanded!==c.value&&(a[f].expanded=c.value)};return(a,e)=>{const f=L,y=O,k=Q,K=T,g=W,S=X,j=te,q=Y,x=Z,z=ae,B=$;return C(),V(z,{modelValue:u(r),"onUpdate:modelValue":e[3]||(e[3]=_=>h(r)?r.value=_:null),title:"\u83DC\u5355\u6743\u9650"},{footer:l(()=>[t(x,{disabled:u(n),type:"primary",onClick:M},{default:l(()=>[m("\u786E \u5B9A")]),_:1},8,["disabled"]),t(x,{onClick:e[2]||(e[2]=_=>r.value=!1)},{default:l(()=>[m("\u53D6 \u6D88")]),_:1})]),default:l(()=>[J((C(),V(q,{ref_key:"formRef",ref:v,model:u(s),"label-width":"80px"},{default:l(()=>[t(K,{gutter:30},{default:l(()=>[t(k,{span:"12"},{default:l(()=>[t(y,{label:"\u89D2\u8272\u540D\u79F0"},{default:l(()=>[t(f,null,{default:l(()=>[m(I(u(s).name),1)]),_:1})]),_:1})]),_:1}),t(k,{span:"12"},{default:l(()=>[t(y,{label:"\u89D2\u8272\u6807\u8BC6"},{default:l(()=>[t(f,null,{default:l(()=>[m(I(u(s).code),1)]),_:1})]),_:1})]),_:1})]),_:1}),t(y,{label:"\u83DC\u5355\u6743\u9650"},{default:l(()=>[t(j,{class:"cardHeight"},{header:l(()=>[m(" \u5168\u9009/\u5168\u4E0D\u9009: "),t(g,{modelValue:u(i),"onUpdate:modelValue":e[0]||(e[0]=_=>h(i)?i.value=_:null),"active-text":"\u662F","inactive-text":"\u5426","inline-prompt":"",onChange:N},null,8,["modelValue"]),m(" \u5168\u90E8\u5C55\u5F00/\u6298\u53E0: "),t(g,{modelValue:u(c),"onUpdate:modelValue":e[1]||(e[1]=_=>h(c)?c.value=_:null),"active-text":"\u5C55\u5F00","inactive-text":"\u6298\u53E0","inline-prompt":"",onChange:A},null,8,["modelValue"])]),default:l(()=>[t(S,{ref_key:"treeRef",ref:d,data:u(p),props:u(ue),"empty-text":"\u52A0\u8F7D\u4E2D\uFF0C\u8BF7\u7A0D\u5019","node-key":"id","show-checkbox":""},null,8,["data","props"])]),_:1})]),_:1})]),_:1},8,["model"])),[[B,u(n)]])]),_:1},8,["modelValue"])}}}),[["__scopeId","data-v-3000774a"]])});export{ve as __tla,b as default};
|