1 |
- import{d as J,H as L,r as o,x as X,o as b,A as C,B as l,f as t,a as u,G as m,k as q,D as I,a2 as h,av as z,S as O,J as P,M as Q,cH as T,e3 as W,U as Y,L as Z,X as $,__tla as ee}from"./index-645bc0b6.js";import{_ as ae,__tla as le}from"./Dialog-48d90cfe.js";import{E as te,__tla as se}from"./el-card-dd17acb4.js";import{d as ue,h as de}from"./tree-0af4953a.js";import{g as oe,__tla as re}from"./index-5580c17a.js";import{b as ne,c as ce,__tla as _e}from"./index-51538183.js";import{u as me,__tla as ie}from"./useMessage-4e07eecf.js";import{_ as fe}from"./_plugin-vue_export-helper-1b428a4d.js";let V,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()=>{V=fe(J({name:"SystemRoleAssignMenuForm",__name:"RoleAssignMenuForm",emits:["success"],setup(pe,{expose:w,emit:H}){const{t:M}=L(),R=me(),r=o(!1),n=o(!1),s=X({id:0,name:"",code:"",menuIds:[]}),v=o(),p=o([]),c=o(!1),d=o(),i=o(!1);w({open:async a=>{r.value=!0,F(),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 U=H,A=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),R.success(M("common.updateSuccess")),r.value=!1,U("success")}finally{n.value=!1}}},F=()=>{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()},S=()=>{d.value.setCheckedNodes(i.value?p.value:[])},D=()=>{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=z,y=O,k=P,E=Q,x=T,K=W,N=te,j=Y,g=Z,B=ae,G=$;return b(),C(B,{modelValue:u(r),"onUpdate:modelValue":e[3]||(e[3]=_=>h(r)?r.value=_:null),title:"\u83DC\u5355\u6743\u9650"},{footer:l(()=>[t(g,{disabled:u(n),type:"primary",onClick:A},{default:l(()=>[m("\u786E \u5B9A")]),_:1},8,["disabled"]),t(g,{onClick:e[2]||(e[2]=_=>r.value=!1)},{default:l(()=>[m("\u53D6 \u6D88")]),_:1})]),default:l(()=>[q((b(),C(j,{ref_key:"formRef",ref:v,model:u(s),"label-width":"80px"},{default:l(()=>[t(E,{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(N,{class:"cardHeight"},{header:l(()=>[m(" \u5168\u9009/\u5168\u4E0D\u9009: "),t(x,{modelValue:u(i),"onUpdate:modelValue":e[0]||(e[0]=_=>h(i)?i.value=_:null),"active-text":"\u662F","inactive-text":"\u5426","inline-prompt":"",onChange:S},null,8,["modelValue"]),m(" \u5168\u90E8\u5C55\u5F00/\u6298\u53E0: "),t(x,{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:D},null,8,["modelValue"])]),default:l(()=>[t(K,{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"])),[[G,u(n)]])]),_:1},8,["modelValue"])}}}),[["__scopeId","data-v-3000774a"]])});export{ve as __tla,V as default};
|