Agriculture-front-end/dist/assets/authUser.48b74734.js

2 lines
4.4 KiB
JavaScript
Raw Normal View History

import{G as e,a,r as l,I as o,d as n,T as t,o as r,c as s,K as u,M as i,f as p,e as d,w as c,j as m,n as f,k as h,J as b,l as g,A as y,v as w}from"./index.e5c8b0d6.js";import v from"./selectUser.78af3543.js";import{a as _,b as I,c as C}from"./role.f62b5a30.js";const k={class:"app-container"},N=e({name:"AuthUser"}),S=Object.assign(N,{setup(e){const N=a(),{proxy:S}=w(),{sys_normal_disable:U}=S.useDict("sys_normal_disable"),j=l([]),x=l(!0),V=l(!0),$=l(!0),K=l(0),R=l([]),T=o({pageNum:1,pageSize:10,roleId:N.params.roleId,userName:void 0,phonenumber:void 0});function P(){x.value=!0,_(T).then((e=>{j.value=e.rows,K.value=e.total,x.value=!1}))}function z(){S.$tab.closeOpenPage({path:"/system/role"})}function O(){T.pageNum=1,P()}function q(){S.resetForm("queryRef"),O()}function A(e){R.value=e.map((e=>e.userId)),$.value=!e.length}function D(){S.$refs.selectRef.show()}function F(e){const a=T.roleId,l=R.value.join(",");S.$modal.confirm("是否取消选中用户授权数据项?").then((function(){return C({roleId:a,userIds:l})})).then((()=>{P(),S.$modal.msgSuccess("取消授权成功")})).catch((()=>{}))}return P(),(e,a)=>{const l=n("el-input"),o=n("el-form-item"),w=n("el-button"),_=n("el-form"),C=n("el-col"),N=n("right-toolbar"),R=n("el-row"),G=n("el-table-column"),J=n("dict-tag"),M=n("el-table"),Q=n("pagination"),B=t("hasPermi"),E=t("loading");return r(),s("div",k,[u(d(_,{model:p(T),ref:"queryRef",inline:!0},{default:c((()=>[d(o,{label:"用户名称",prop:"userName"},{default:c((()=>[d(l,{modelValue:p(T).userName,"onUpdate:modelValue":a[0]||(a[0]=e=>p(T).userName=e),placeholder:"请输入用户名称",clearable:"",style:{width:"240px"},onKeyup:m(O,["enter"])},null,8,["modelValue","onKeyup"])])),_:1}),d(o,{label:"手机号码",prop:"phonenumber"},{default:c((()=>[d(l,{modelValue:p(T).phonenumber,"onUpdate:modelValue":a[1]||(a[1]=e=>p(T).phonenumber=e),placeholder:"请输入手机号码",clearable:"",style:{width:"240px"},onKeyup:m(O,["enter"])},null,8,["modelValue","onKeyup"])])),_:1}),d(o,null,{default:c((()=>[d(w,{type:"primary",icon:"Search",onClick:O},{default:c((()=>[f("搜索")])),_:1}),d(w,{icon:"Refresh",onClick:q},{default:c((()=>[f("重置")])),_:1})])),_:1})])),_:1},8,["model"]),[[i,p(V)]]),d(R,{gutter:10,class:"mb8"},{default:c((()=>[d(C,{span:1.5},{default:c((()=>[u((r(),h(w,{type:"primary",plain:"",icon:"Plus",onClick:D},{default:c((()=>[f("添加用户")])),_:1})),[[B,["system:role:add"]]])])),_:1},8,["span"]),d(C,{span:1.5},{default:c((()=>[u((r(),h(w,{type:"danger",plain:"",icon:"CircleClose",disabled:p($),onClick:F},{default:c((()=>[f("批量取消授权")])),_:1},8,["disabled"])),[[B,["system:role:remove"]]])])),_:1},8,["span"]),d(C,{span:1.5},{default:c((()=>[d(w,{type:"warning",plain:"",icon:"Close",onClick:z},{default:c((()=>[f("关闭")])),_:1})])),_:1},8,["span"]),d(N,{showSearch:p(V),"onUpdate:showSearch":a[2]||(a[2]=e=>b(V)?V.value=e:null),onQueryTable:P},null,8,["showSearch"])])),_:1}),u((r(),h(M,{data:p(j),onSelectionChange:A},{default:c((()=>[d(G,{type:"selection",width:"55",align:"center"}),d(G,{label:"用户名称",prop:"userName","show-overflow-tooltip":!0}),d(G,{label:"用户昵称",prop:"nickName","show-overflow-tooltip":!0}),d(G,{label:"邮箱",prop:"email","show-overflow-tooltip":!0}),d(G,{label:"手机",prop:"phonenumber","show-overflow-tooltip":!0}),d(G,{label:"状态",align:"center",prop:"status"},{default:c((e=>[d(J,{options:p(U),value:e.row.status},null,8,["options","value"])])),_:1}),d(G,{label:"创建时间",align:"center",prop:"createTime",width:"180"},{default:c((a=>[g("span",null,y(e.parseTime(a.row.createTime)),1)])),_:1}),d(G,{label:"操作",align:"center","class-name":"small-padding fixed-width"},{default:c((e=>[u((r(),h(w,{link:"",type:"primary",icon:"CircleClose",onClick:a=>{return l=e.row,void S.$modal.confirm('确认要取消该用户"'+l.userName+'"角色吗?').then((function(){return I({userId:l.userId,roleId:T.roleId})})).then((()=>{P(),S.$modal.msgSuccess("取消授权成功")})).catch((()=>{}));var l}},{default:c((()=>[f("取消授权")])),_:2},1032,["onClick"])),[[B,["syst