RoleDataPermissionForm-dd075c0e.js 4.5 KB

1
  1. import{d as $,h as j,r as u,e as B,o as f,v as h,w as l,f as t,a,n as c,x as G,t as b,c as H,F as J,q as L,O as S,P as Q,al as W,A as Z,E as ee,i as ae,y as le,z as te,D as se,c_ as oe,e2 as de,C as ue,I as re,_ as ce,__tla as ne}from"./index-3f6d2b3a.js";import{_ as _e,__tla as me}from"./Dialog-d80e1167.js";import{E as ie,__tla as pe}from"./el-card-850c26c2.js";import{a as fe,D as ve,__tla as ye}from"./dict-9cca1721.js";import{d as he,h as Se}from"./tree-0af4953a.js";import{m as w}from"./constants-a3c69b57.js";import{g as xe,__tla as Ve}from"./index-2b1427b0.js";import{d as ke,__tla as Ce}from"./index-a386ce87.js";import{u as De,__tla as be}from"./useMessage-d75e3be7.js";let P,we=Promise.all([(()=>{try{return ne}catch{}})(),(()=>{try{return me}catch{}})(),(()=>{try{return pe}catch{}})(),(()=>{try{return ye}catch{}})(),(()=>{try{return Ve}catch{}})(),(()=>{try{return Ce}catch{}})(),(()=>{try{return be}catch{}})()]).then(async()=>{P=ce($({name:"SystemRoleDataPermissionForm",__name:"RoleDataPermissionForm",emits:["success"],setup(Pe,{expose:U,emit:E}){const{t:F}=j(),I=De(),n=u(!1),v=u(!1),d=B({id:0,name:"",code:"",dataScope:void 0,dataScopeDeptIds:[]}),k=u(),x=u([]),_=u(!1),m=u(),i=u(!1),p=u(!0);U({open:async s=>{var e;n.value=!0,g(),x.value=Se(await xe()),d.id=s.id,d.name=s.name,d.code=s.code,d.dataScope=s.dataScope,(e=s.dataScopeDeptIds)==null||e.forEach(r=>{m.value.setChecked(r,!0,!1)})}});const R=E,T=async()=>{v.value=!0;try{const s={roleId:d.id,dataScope:d.dataScope,dataScopeDeptIds:d.dataScope!==w.DEPT_CUSTOM?[]:m.value.getCheckedKeys(!1)};await ke(s),I.success(F("common.updateSuccess")),n.value=!1,R("success")}finally{v.value=!1}},g=()=>{var s,e;i.value=!1,_.value=!1,p.value=!0,d.value={id:0,name:"",code:"",dataScope:void 0,dataScopeDeptIds:[]},(s=m.value)==null||s.setCheckedNodes([]),(e=k.value)==null||e.resetFields()},O=()=>{var e;const s=(e=m.value)==null?void 0:e.store.nodesMap;for(let r in s)s[r].expanded!==_.value&&(s[r].expanded=_.value)};return(s,e)=>{const r=W,y=Z,C=ee,z=ae,A=le,M=te,N=se,V=oe,q=de,K=ie,D=ue,X=_e,Y=re;return f(),h(X,{modelValue:a(n),"onUpdate:modelValue":e[6]||(e[6]=o=>S(n)?n.value=o:null),title:"\u83DC\u5355\u6743\u9650",width:"800"},{footer:l(()=>[t(D,{disabled:a(v),type:"primary",onClick:T},{default:l(()=>[c("\u786E \u5B9A")]),_:1},8,["disabled"]),t(D,{onClick:e[5]||(e[5]=o=>n.value=!1)},{default:l(()=>[c("\u53D6 \u6D88")]),_:1})]),default:l(()=>[G((f(),h(N,{ref_key:"formRef",ref:k,model:a(d),"label-width":"80px"},{default:l(()=>[t(z,{gutter:30},{default:l(()=>[t(C,{span:"12"},{default:l(()=>[t(y,{label:"\u89D2\u8272\u540D\u79F0"},{default:l(()=>[t(r,null,{default:l(()=>[c(b(a(d).name),1)]),_:1})]),_:1})]),_:1}),t(C,{span:"12"},{default:l(()=>[t(y,{label:"\u89D2\u8272\u6807\u8BC6"},{default:l(()=>[t(r,null,{default:l(()=>[c(b(a(d).code),1)]),_:1})]),_:1})]),_:1})]),_:1}),t(y,{label:"\u6743\u9650\u8303\u56F4"},{default:l(()=>[t(M,{modelValue:a(d).dataScope,"onUpdate:modelValue":e[0]||(e[0]=o=>a(d).dataScope=o)},{default:l(()=>[(f(!0),H(J,null,L(a(fe)(a(ve).SYSTEM_DATA_SCOPE),o=>(f(),h(A,{key:o.value,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])),[[Y,a(v)]]),a(d).dataScope===a(w).DEPT_CUSTOM?(f(),h(y,{key:0,label:"\u6743\u9650\u8303\u56F4",style:{display:"flex"}},{default:l(()=>[t(K,{class:"card",shadow:"never"},{header:l(()=>[c(" \u5168\u9009/\u5168\u4E0D\u9009: "),t(V,{modelValue:a(i),"onUpdate:modelValue":e[1]||(e[1]=o=>S(i)?i.value=o:null),"active-text":"\u662F","inactive-text":"\u5426","inline-prompt":"",onChange:e[2]||(e[2]=o=>{m.value.setCheckedNodes(i.value?x.value:[])})},null,8,["modelValue"]),c(" \u5168\u90E8\u5C55\u5F00/\u6298\u53E0: "),t(V,{modelValue:a(_),"onUpdate:modelValue":e[3]||(e[3]=o=>S(_)?_.value=o:null),"active-text":"\u5C55\u5F00","inactive-text":"\u6298\u53E0","inline-prompt":"",onChange:O},null,8,["modelValue"]),c(" \u7236\u5B50\u8054\u52A8(\u9009\u4E2D\u7236\u8282\u70B9\uFF0C\u81EA\u52A8\u9009\u62E9\u5B50\u8282\u70B9): "),t(V,{modelValue:a(p),"onUpdate:modelValue":e[4]||(e[4]=o=>S(p)?p.value=o:null),"active-text":"\u662F","inactive-text":"\u5426","inline-prompt":""},null,8,["modelValue"])]),default:l(()=>[t(q,{ref_key:"treeRef",ref:m,"check-strictly":!a(p),data:a(x),props:a(he),"default-expand-all":"","empty-text":"\u52A0\u8F7D\u4E2D\uFF0C\u8BF7\u7A0D\u540E","node-key":"id","show-checkbox":""},null,8,["check-strictly","data","props"])]),_:1})]),_:1})):Q("",!0)]),_:1},8,["modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/role/RoleDataPermissionForm.vue"]])});export{we as __tla,P as default};