UserTab-3eb5bd77.js 5.7 KB

1
  1. import{d as J,h as K,r as o,Q as M,o as _,v as i,aR as Y,a,w as c,g as w,m as b,P as n,t as Z,x as N,f as V,O as x,W as $,X as aa,C as ta,I as ea,_ as sa,__tla as ra}from"./index-430b3151.js";import{_ as la,__tla as oa}from"./ContentWrap-60842994.js";import{_ as _a,__tla as ia}from"./SPuUploadImg-e216b873.js";import{_ as ua,__tla as ca}from"./Dialog-cd42c639.js";import na,{__tla as ma}from"./UserForm-31187d79.js";import da,{__tla as fa}from"./UserAssignRoleForm-c64bd6f7.js";import{C as p}from"./constants-637baed6.js";import{d as ya,e as pa,r as va,__tla as ha}from"./index-43de0303.js";import{c as C,__tla as ga}from"./permission-c1d04079.js";import{u as ba,__tla as ka}from"./useMessage-d226ba89.js";import{__tla as wa}from"./el-card-dee5b36b.js";import{__tla as Ea}from"./SPuUploadImg.vue_vue_type_style_index_0_scoped_ba706063_lang-f5de6f1b.js";import{__tla as Aa}from"./index-255e3b1c.js";import{__tla as Va}from"./el-image-viewer-467ebe35.js";import{__tla as xa}from"./el-tree-select-eb1ce80a.js";import{__tla as Ca}from"./dict-603b6a58.js";import"./tree-0af4953a.js";import{__tla as Ra}from"./index-2bbd02f5.js";import{__tla as Da}from"./index-0e1a661d.js";import{__tla as Ba}from"./index-760b82ee.js";import{__tla as La}from"./index-5a4b7424.js";let T,Ua=Promise.all([(()=>{try{return ra}catch{}})(),(()=>{try{return oa}catch{}})(),(()=>{try{return ia}catch{}})(),(()=>{try{return ca}catch{}})(),(()=>{try{return ma}catch{}})(),(()=>{try{return fa}catch{}})(),(()=>{try{return ha}catch{}})(),(()=>{try{return ga}catch{}})(),(()=>{try{return ka}catch{}})(),(()=>{try{return wa}catch{}})(),(()=>{try{return Ea}catch{}})(),(()=>{try{return Aa}catch{}})(),(()=>{try{return Va}catch{}})(),(()=>{try{return xa}catch{}})(),(()=>{try{return Ca}catch{}})(),(()=>{try{return Ra}catch{}})(),(()=>{try{return Da}catch{}})(),(()=>{try{return Ba}catch{}})(),(()=>{try{return La}catch{}})()]).then(async()=>{let R,D,B,L;R={class:"left"},D={class:"right"},B=w("div",{style:{clear:"both"}},null,-1),L={class:"dialog-footer"},T=sa(J({__name:"UserTab",emits:["success"],setup(ja,{expose:z,emit:I}){const{t:E}=K(),m=ba(),d=o(!1),s=o("info"),u=o(!1),A=o(""),r=o(!1),f=o("create"),l=o({}),y=o("avatar");z({open:async(t,e)=>{t=="create"||e.avatar==""?y.value="https://mall-ffkj.oss-cn-guangzhou.aliyuncs.com/2e05b76706334aef023b85ec6aef6ffd4615aae3d06f302aa7d273e97f263025.png":y.value=e.avatar,l.value=e,f.value=t,A.value=E("action."+t),t=="view"&&(A.value="\u67E5\u770B"),r.value=t=="view",u.value=!0}});const v=I,U=o(),P=async()=>{var t;await((t=U.value)==null?void 0:t.submitForm())&&(v("success"),u.value=!1)},j=o(),S=async()=>{var t;await((t=j.value)==null?void 0:t.submitForm())&&(v("success"),u.value=!1)},O=async()=>{const t=l.value;try{const e=t.status===p.ENABLE?"\u505C\u7528":"\u542F\u7528";await m.confirm('\u786E\u8BA4\u8981"'+e+'""'+t.username+'"\u7528\u6237\u5417?'),await ya(t.id,t.status?p.ENABLE:p.DISABLE),m.success(t.username+"\u5DF2"+e),u.value=!1,v("success")}catch{t.status=t.status===p.ENABLE?p.DISABLE:p.ENABLE}},Q=async()=>{try{const t=l.value.id;await m.delConfirm("\u786E\u8BA4\u8981\u5220\u9664"+l.value.username+"\u5417?"),await pa(t),m.success(E("common.delSuccess")),u.value=!1,v("success")}catch{}},W=async t=>{try{const e=l.value.id,k=(await m.prompt('\u8BF7\u8F93\u5165"'+l.value.username+'"\u7684\u65B0\u5BC6\u7801',E("common.reminder"))).value;await va(e,k),m.success("\u4FEE\u6539\u6210\u529F\uFF0C\u65B0\u5BC6\u7801\u662F\uFF1A"+k),u.value=!1,v("success")}catch{}};return(t,e)=>{const k=_a,F=$,X=aa,q=la,h=ta,G=ea,H=M("hasPermi");return _(),i(ua,{title:a(A),modelValue:a(u),"onUpdate:modelValue":e[2]||(e[2]=g=>x(u)?u.value=g:null),width:"70%"},Y({default:c(()=>[N((_(),i(q,{style:{"max-height":"360px","min-height":"360px","overflow-y":"auto",border:"none"}},{default:c(()=>[w("div",R,[V(k,{modelValue:a(y),"onUpdate:modelValue":e[0]||(e[0]=g=>x(y)?y.value=g:null),disabled:a(r),height:"143px"},null,8,["modelValue","disabled"]),V(X,{modelValue:a(s),"onUpdate:modelValue":e[1]||(e[1]=g=>x(s)?s.value=g:null),"tab-position":"left",class:"child-tabs"},{default:c(()=>[V(F,{label:"\u57FA\u672C\u4FE1\u606F",name:"info"}),a(f)!="create"?(_(),i(F,{key:0,label:"\u5206\u914D\u89D2\u8272",name:"AssignRoles"})):n("",!0)]),_:1},8,["modelValue"])]),w("div",D,[a(s)=="info"?(_(),i(na,{key:0,obj:a(l),ref_key:"userFormRef",ref:U,avatar:a(y),isDetail:a(r),openType:a(f)},null,8,["obj","avatar","isDetail","openType"])):n("",!0),a(s)=="AssignRoles"?(_(),i(da,{key:1,obj:a(l),ref_key:"userAssignRoleFormRef",ref:j,isDetail:a(r)},null,8,["obj","isDetail"])):n("",!0)]),B]),_:1})),[[G,a(d)]])]),_:2},[a(r)?void 0:{name:"footer",fn:c(()=>[w("div",L,[!a(r)&&a(s)=="info"&&a(C)(["system:user:delete"])&&a(f)!="create"?(_(),i(h,{key:0,loading:a(d),type:"danger",onClick:Q},{default:c(()=>[b("\u5220\u9664")]),_:1},8,["loading"])):n("",!0),a(r)||a(s)!="info"||a(f)=="create"?n("",!0):(_(),i(h,{key:1,type:a(l).status==1?"primary":"danger",loading:a(d),onClick:O},{default:c(()=>[b(Z(a(l).status==1?"\u542F\u7528":"\u505C\u7528"),1)]),_:1},8,["type","loading"])),!a(r)&&a(s)=="info"&&a(C)(["system:user:update-password"])&&a(f)!="create"?(_(),i(h,{key:2,loading:a(d),type:"primary",onClick:W},{default:c(()=>[b("\u91CD\u7F6E\u5BC6\u7801")]),_:1},8,["loading"])):n("",!0),a(r)||a(s)!="info"?n("",!0):N((_(),i(h,{key:3,loading:a(d),type:"primary",onClick:P},{default:c(()=>[b("\u4FDD\u5B58")]),_:1},8,["loading"])),[[H,["system:user:update"]]]),!a(r)&&a(s)=="AssignRoles"&&a(C)(["system:permission:assign-user-role"])?(_(),i(h,{key:4,loading:a(d),type:"primary",onClick:S},{default:c(()=>[b("\u4FDD\u5B58")]),_:1},8,["loading"])):n("",!0)])]),key:"0"}]),1032,["title","modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/user/UserTab.vue"]])});export{Ua as __tla,T as default};