Agriculture-front-end/dist/assets/authUser.80fb5aa7.js
2024-05-30 09:20:30 +08:00

2 lines
4.6 KiB
JavaScript

import{D as G,a as H,r as d,G as J,d as r,S as V,o as h,c as M,I as m,K as $,f as o,e,w as t,i as x,m as _,j as y,H as W,k as X,y as Y,s as Z}from"./index.9c864c60.js";import ee from"./selectUser.7a14f27c.js";import{a as oe,b as te,c as le}from"./role.d2df4667.js";const ne={class:"app-container"},ae=G({name:"AuthUser"}),pe=Object.assign(ae,{setup(se){const R=H(),{proxy:i}=Z(),{sys_normal_disable:K}=i.useDict("sys_normal_disable"),k=d([]),w=d(!0),g=d(!0),N=d(!0),v=d(0),U=d([]),n=J({pageNum:1,pageSize:10,roleId:R.params.roleId,userName:void 0,phonenumber:void 0});function c(){w.value=!0,oe(n).then(s=>{k.value=s.rows,v.value=s.total,w.value=!1})}function P(){const s={path:"/system/role"};i.$tab.closeOpenPage(s)}function f(){n.pageNum=1,c()}function A(){i.resetForm("queryRef"),f()}function D(s){U.value=s.map(a=>a.userId),N.value=!s.length}function T(){i.$refs.selectRef.show()}function j(s){i.$modal.confirm('\u786E\u8BA4\u8981\u53D6\u6D88\u8BE5\u7528\u6237"'+s.userName+'"\u89D2\u8272\u5417\uFF1F').then(function(){return te({userId:s.userId,roleId:n.roleId})}).then(()=>{c(),i.$modal.msgSuccess("\u53D6\u6D88\u6388\u6743\u6210\u529F")}).catch(()=>{})}function B(s){const a=n.roleId,b=U.value.join(",");i.$modal.confirm("\u662F\u5426\u53D6\u6D88\u9009\u4E2D\u7528\u6237\u6388\u6743\u6570\u636E\u9879?").then(function(){return le({roleId:a,userIds:b})}).then(()=>{c(),i.$modal.msgSuccess("\u53D6\u6D88\u6388\u6743\u6210\u529F")}).catch(()=>{})}return c(),(s,a)=>{const b=r("el-input"),C=r("el-form-item"),p=r("el-button"),q=r("el-form"),I=r("el-col"),z=r("right-toolbar"),L=r("el-row"),u=r("el-table-column"),O=r("dict-tag"),Q=r("el-table"),E=r("pagination"),S=V("hasPermi"),F=V("loading");return h(),M("div",ne,[m(e(q,{model:o(n),ref:"queryRef",inline:!0},{default:t(()=>[e(C,{label:"\u7528\u6237\u540D\u79F0",prop:"userName"},{default:t(()=>[e(b,{modelValue:o(n).userName,"onUpdate:modelValue":a[0]||(a[0]=l=>o(n).userName=l),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D\u79F0",clearable:"",style:{width:"240px"},onKeyup:x(f,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(C,{label:"\u624B\u673A\u53F7\u7801",prop:"phonenumber"},{default:t(()=>[e(b,{modelValue:o(n).phonenumber,"onUpdate:modelValue":a[1]||(a[1]=l=>o(n).phonenumber=l),placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7\u7801",clearable:"",style:{width:"240px"},onKeyup:x(f,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(C,null,{default:t(()=>[e(p,{type:"primary",icon:"Search",onClick:f},{default:t(()=>[_("\u641C\u7D22")]),_:1}),e(p,{icon:"Refresh",onClick:A},{default:t(()=>[_("\u91CD\u7F6E")]),_:1})]),_:1})]),_:1},8,["model"]),[[$,o(g)]]),e(L,{gutter:10,class:"mb8"},{default:t(()=>[e(I,{span:1.5},{default:t(()=>[m((h(),y(p,{type:"primary",plain:"",icon:"Plus",onClick:T},{default:t(()=>[_("\u6DFB\u52A0\u7528\u6237")]),_:1})),[[S,["system:role:add"]]])]),_:1},8,["span"]),e(I,{span:1.5},{default:t(()=>[m((h(),y(p,{type:"danger",plain:"",icon:"CircleClose",disabled:o(N),onClick:B},{default:t(()=>[_("\u6279\u91CF\u53D6\u6D88\u6388\u6743")]),_:1},8,["disabled"])),[[S,["system:role:remove"]]])]),_:1},8,["span"]),e(I,{span:1.5},{default:t(()=>[e(p,{type:"warning",plain:"",icon:"Close",onClick:P},{default:t(()=>[_("\u5173\u95ED")]),_:1})]),_:1},8,["span"]),e(z,{showSearch:o(g),"onUpdate:showSearch":a[2]||(a[2]=l=>W(g)?g.value=l:null),onQueryTable:c},null,8,["showSearch"])]),_:1}),m((h(),y(Q,{data:o(k),onSelectionChange:D},{default:t(()=>[e(u,{type:"selection",width:"55",align:"center"}),e(u,{label:"\u7528\u6237\u540D\u79F0",prop:"userName","show-overflow-tooltip":!0}),e(u,{label:"\u7528\u6237\u6635\u79F0",prop:"nickName","show-overflow-tooltip":!0}),e(u,{label:"\u90AE\u7BB1",prop:"email","show-overflow-tooltip":!0}),e(u,{label:"\u624B\u673A",prop:"phonenumber","show-overflow-tooltip":!0}),e(u,{label:"\u72B6\u6001",align:"center",prop:"status"},{default:t(l=>[e(O,{options:o(K),value:l.row.status},null,8,["options","value"])]),_:1}),e(u,{label:"\u521B\u5EFA\u65F6\u95F4",align:"center",prop:"createTime",width:"180"},{default:t(l=>[X("span",null,Y(s.parseTime(l.row.createTime)),1)]),_:1}),e(u,{label:"\u64CD\u4F5C",align:"center","class-name":"small-padding fixed-width"},{default:t(l=>[m((h(),y(p,{link:"",type:"primary",icon:"CircleClose",onClick:re=>j(l.row)},{default:t(()=>[_("\u53D6\u6D88\u6388\u6743")]),_:2},1032,["onClick"])),[[S,["system:role:remove"]]])]),_:1})]),_:1},8,["data"])),[[F,o(w)]]),m(e(E,{total:o(v),page:o(n).pageNum,"onUpdate:page":a[3]||(a[3]=l=>o(n).pageNum=l),limit:o(n).pageSize,"onUpdate:limit":a[4]||(a[4]=l=>o(n).pageSize=l),onPagination:c},null,8,["total","page","limit"]),[[$,o(v)>0]]),e(o(ee),{ref:"selectRef",roleId:o(n).roleId,onOk:f},null,8,["roleId"])])}}});export{pe as default};