Agriculture-front-end/dist/assets/authRole.88fd2c85.js
2023-04-23 09:41:12 +08:00

2 lines
3.2 KiB
JavaScript

import{_ as E,G as O,u as P,r as i,P as z,d as s,Q as F,o as N,c as G,e as t,w as a,f as o,J as y,k as J,l as m,x as C,K as Q,I as V,m as S,s as q}from"./index.b3c890dc.js";import{c as H,d as L}from"./user.41bd1d28.js";const M={class:"app-container"},W=m("h4",{class:"form-header h4"},"\u57FA\u672C\u4FE1\u606F",-1),X=m("h4",{class:"form-header h4"},"\u89D2\u8272\u4FE1\u606F",-1),Y={style:{"text-align":"center","margin-left":"-120px","margin-top":"30px"}},Z=O({name:"AuthRole"}),ee=Object.assign(Z,{setup(te){const b=P(),{proxy:f}=q(),g=i(!0),v=i(0),u=i(1),c=i(10),h=i([]),_=i([]),r=i({nickName:void 0,userName:void 0,userId:void 0});function $(l){f.$refs.roleRef.toggleRowSelection(l)}function T(l){h.value=l.map(e=>e.roleId)}function U(l){return l.roleId}function w(){const l={path:"/system/user"};f.$tab.closeOpenPage(l)}function A(){const l=r.value.userId,e=h.value.join(",");L({userId:l,roleIds:e}).then(d=>{f.$modal.msgSuccess("\u6388\u6743\u6210\u529F"),w()})}return(()=>{const l=b.params&&b.params.userId;l&&(g.value=!0,H(l).then(e=>{r.value=e.user,_.value=e.roles,v.value=_.value.length,z(()=>{_.value.forEach(d=>{d.flag&&f.$refs.roleRef.toggleRowSelection(d)})}),g.value=!1}))})(),(l,e)=>{const d=s("el-input"),k=s("el-form-item"),R=s("el-col"),B=s("el-row"),x=s("el-form"),p=s("el-table-column"),D=s("el-table"),j=s("pagination"),I=s("el-button"),K=F("loading");return N(),G("div",M,[W,t(x,{model:o(r),"label-width":"80px"},{default:a(()=>[t(B,null,{default:a(()=>[t(R,{span:8,offset:2},{default:a(()=>[t(k,{label:"\u7528\u6237\u6635\u79F0",prop:"nickName"},{default:a(()=>[t(d,{modelValue:o(r).nickName,"onUpdate:modelValue":e[0]||(e[0]=n=>o(r).nickName=n),disabled:""},null,8,["modelValue"])]),_:1})]),_:1}),t(R,{span:8,offset:2},{default:a(()=>[t(k,{label:"\u767B\u5F55\u8D26\u53F7",prop:"userName"},{default:a(()=>[t(d,{modelValue:o(r).userName,"onUpdate:modelValue":e[1]||(e[1]=n=>o(r).userName=n),disabled:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),X,y((N(),J(D,{"row-key":U,onRowClick:$,ref:"roleRef",onSelectionChange:T,data:o(_).slice((o(u)-1)*o(c),o(u)*o(c))},{default:a(()=>[t(p,{label:"\u5E8F\u53F7",width:"55",type:"index",align:"center"},{default:a(n=>[m("span",null,C((o(u)-1)*o(c)+n.$index+1),1)]),_:1}),t(p,{type:"selection","reserve-selection":!0,width:"55"}),t(p,{label:"\u89D2\u8272\u7F16\u53F7",align:"center",prop:"roleId"}),t(p,{label:"\u89D2\u8272\u540D\u79F0",align:"center",prop:"roleName"}),t(p,{label:"\u6743\u9650\u5B57\u7B26",align:"center",prop:"roleKey"}),t(p,{label:"\u521B\u5EFA\u65F6\u95F4",align:"center",prop:"createTime",width:"180"},{default:a(n=>[m("span",null,C(l.parseTime(n.row.createTime)),1)]),_:1})]),_:1},8,["data"])),[[K,o(g)]]),y(t(j,{total:o(v),page:o(u),"onUpdate:page":e[2]||(e[2]=n=>V(u)?u.value=n:null),limit:o(c),"onUpdate:limit":e[3]||(e[3]=n=>V(c)?c.value=n:null)},null,8,["total","page","limit"]),[[Q,o(v)>0]]),t(x,{"label-width":"100px"},{default:a(()=>[m("div",Y,[t(I,{type:"primary",onClick:e[4]||(e[4]=n=>A())},{default:a(()=>[S("\u63D0\u4EA4")]),_:1}),t(I,{onClick:e[5]||(e[5]=n=>w())},{default:a(()=>[S("\u8FD4\u56DE")]),_:1})])]),_:1})])}}}),ne=E(ee,[["__file","/Users/luce/Desktop/\u6570\u5B57\u4E09\u519C/Agriculture-front-end/src/views/system/user/authRole.vue"]]);export{ne as default};