沙钢智慧能源系统前端代码
houzhongjian
2024-10-09 314507f8ddadd9c66e98d260c3b2a5dad1a04015
提交 | 用户 | 时间
314507 1 import{d as ne,Q as ie,J as me,r as f,A as ue,b as de,a1 as pe,o as n,c as M,k as e,B as a,a as t,a2 as H,F as I,i as ce,a3 as fe,N as ye,g as m,O as u,P as w,C as _e,h as U,am as we,a7 as he,S as be,$ as ge,R as ve,T as ke,U as Ce,V as Ve,W as xe,X as Ne,cF as Se,Y as Ue,ap as Re,Z as Te}from"./index-BP6bNRoi.js";import{_ as Ee}from"./index.vue_vue_type_script_setup_true_lang-sJUY8qtC.js";import{E as Ae,a as Fe,b as Be}from"./el-dropdown-item-BW-wC9MJ.js";import{_ as De}from"./ContentWrap.vue_vue_type_script_setup_true_lang-CR_2gECF.js";import{c as R}from"./permission-BEe7BIhI.js";import{d as Pe}from"./formatTime-DwR9f7DP.js";import{d as Ye}from"./download-e0EdwhTv.js";import{C}from"./constants-CuOBQ73z.js";import{b as ze,d as Le,e as Me,f as He,r as Ie}from"./index-vFgEqmZu.js";import{_ as Ke}from"./UserForm.vue_vue_type_script_setup_true_lang-Boekhu2q.js";import{_ as Oe}from"./UserImportForm.vue_vue_type_script_setup_true_lang-B9eU9TVY.js";import{_ as je}from"./UserAssignRoleForm.vue_vue_type_script_setup_true_lang-BIyYYdPa.js";import{_ as Xe}from"./DeptTree.vue_vue_type_script_setup_true_lang-SrBMShWN.js";import"./index-BZESAUPP.js";import"./el-card-bU92WWV4.js";import"./Dialog.vue_vue_type_style_index_0_lang-DFckl8Er.js";import"./el-tree-select-pYALMRc9.js";import"./tree-BBZY150N.js";import"./index-DkNlrmPs.js";import"./index-BdNokKwC.js";import"./index-B9sptnFO.js";import"./index-NsInNyZ_.js";const $e={class:"flex items-center justify-center"},qe=ne({name:"SystemUser",__name:"index",setup(Je){const _=ie(),{t:T}=me(),V=f(!0),E=f(0),A=f([]),r=ue({pageNo:1,pageSize:10,username:void 0,mobile:void 0,status:void 0,deptId:void 0,createTime:[]}),F=f(),d=async()=>{V.value=!0;try{const s=await ze(r);A.value=s.list,E.value=s.total}finally{V.value=!1}},k=()=>{r.pageNo=1,d()},K=()=>{var s;(s=F.value)==null||s.resetFields(),k()},O=async s=>{r.deptId=s.id,await d()},B=f(),D=(s,o)=>{B.value.open(s,o)},P=f(),j=()=>{P.value.open()},x=f(!1),X=async()=>{try{await _.exportConfirm(),x.value=!0;const s=await Me(r);Ye.excel(s,"\u7528\u6237\u6570\u636E.xls")}catch{}finally{x.value=!1}},$=async s=>{try{await _.delConfirm(),await He(s),_.success(T("common.delSuccess")),await d()}catch{}},q=async s=>{try{const o=(await _.prompt('\u8BF7\u8F93\u5165"'+s.username+'"\u7684\u65B0\u5BC6\u7801',T("common.reminder"))).value;await Ie(s.id,o),_.success("\u4FEE\u6539\u6210\u529F\uFF0C\u65B0\u5BC6\u7801\u662F\uFF1A"+o)}catch{}},Y=f(),J=s=>{Y.value.open(s)};return de(()=>{d()}),(s,o)=>{const N=De,z=we,L=he,h=be,Q=ge,W=ve,Z=ke,i=Ce,y=Ve,G=xe,p=Ne,ee=Se,S=Ae,ae=Fe,le=Be,te=Ue,se=Ee,oe=Re,b=pe("hasPermi"),re=Te;return n(),M(I,null,[e(oe,{gutter:20},{default:a(()=>[e(z,{span:4,xs:24},{default:a(()=>[e(N,{class:"h-1/1"},{default:a(()=>[e(Xe,{onNodeClick:O})]),_:1})]),_:1}),e(z,{span:20,xs:24},{default:a(()=>[e(N,null,{default:a(()=>[e(G,{class:"-mb-15px",model:t(r),ref_key:"queryFormRef",ref:F,inline:!0,"label-width":"68px"},{default:a(()=>[e(h,{label:"\u7528\u6237\u540D\u79F0",prop:"username"},{default:a(()=>[e(L,{modelValue:t(r).username,"onUpdate:modelValue":o[0]||(o[0]=l=>t(r).username=l),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D\u79F0",clearable:"",onKeyup:H(k,["enter"]),class:"!w-240px"},null,8,["modelValue"])]),_:1}),e(h,{label:"\u624B\u673A\u53F7\u7801",prop:"mobile"},{default:a(()=>[e(L,{modelValue:t(r).mobile,"onUpdate:modelValue":o[1]||(o[1]=l=>t(r).mobile=l),placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7\u7801",clearable:"",onKeyup:H(k,["enter"]),class:"!w-240px"},null,8,["modelValue"])]),_:1}),e(h,{label:"\u72B6\u6001",prop:"status"},{default:a(()=>[e(W,{modelValue:t(r).status,"onUpdate:modelValue":o[2]||(o[2]=l=>t(r).status=l),placeholder:"\u7528\u6237\u72B6\u6001",clearable:"",class:"!w-240px"},{default:a(()=>[(n(!0),M(I,null,ce(t(fe)(t(ye).COMMON_STATUS),l=>(n(),m(Q,{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(h,{label:"\u521B\u5EFA\u65F6\u95F4",prop:"createTime"},{default:a(()=>[e(Z,{modelValue:t(r).createTime,"onUpdate:modelValue":o[3]||(o[3]=l=>t(r).createTime=l),"value-format":"YYYY-MM-DD HH:mm:ss",type:"datetimerange","start-placeholder":"\u5F00\u59CB\u65E5\u671F","end-placeholder":"\u7ED3\u675F\u65E5\u671F",class:"!w-240px"},null,8,["modelValue"])]),_:1}),e(h,null,{default:a(()=>[e(y,{onClick:k},{default:a(()=>[e(i,{icon:"ep:search"}),u("\u641C\u7D22")]),_:1}),e(y,{onClick:K},{default:a(()=>[e(i,{icon:"ep:refresh"}),u("\u91CD\u7F6E")]),_:1}),w((n(),m(y,{type:"primary",plain:"",onClick:o[4]||(o[4]=l=>D("create"))},{default:a(()=>[e(i,{icon:"ep:plus"}),u(" \u65B0\u589E ")]),_:1})),[[b,["system:user:create"]]]),w((n(),m(y,{type:"warning",plain:"",onClick:j},{default:a(()=>[e(i,{icon:"ep:upload"}),u(" \u5BFC\u5165 ")]),_:1})),[[b,["system:user:import"]]]),w((n(),m(y,{type:"success",plain:"",onClick:X,loading:t(x)},{default:a(()=>[e(i,{icon:"ep:download"}),u("\u5BFC\u51FA ")]),_:1},8,["loading"])),[[b,["system:user:export"]]])]),_:1})]),_:1},8,["model"])]),_:1}),e(N,null,{default:a(()=>[w((n(),m(te,{data:t(A)},{default:a(()=>[e(p,{label:"\u7528\u6237\u7F16\u53F7",align:"center",key:"id",prop:"id"}),e(p,{label:"\u7528\u6237\u540D\u79F0",align:"center",prop:"username","show-overflow-tooltip":!0}),e(p,{label:"\u7528\u6237\u6635\u79F0",align:"center",prop:"nickname","show-overflow-tooltip":!0}),e(p,{label:"\u90E8\u95E8",align:"center",key:"deptName",prop:"deptName","show-overflow-tooltip":!0}),e(p,{label:"\u624B\u673A\u53F7\u7801",align:"center",prop:"mobile",width:"120"}),e(p,{label:"\u72B6\u6001",key:"status"},{default:a(l=>[e(ee,{modelValue:l.row.status,"onUpdate:modelValue":g=>l.row.status=g,"active-value":0,"inactive-value":1,onChange:g=>(async c=>{try{const v=c.status===C.ENABLE?"\u542F\u7528":"\u505C\u7528";await _.confirm('\u786E\u8BA4\u8981"'+v+'""'+c.username+'"\u7528\u6237\u5417?'),await Le(c.id,c.status),await d()}catch{c.status=c.status===C.ENABLE?C.DISABLE:C.ENABLE}})(l.row)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),e(p,{label:"\u521B\u5EFA\u65F6\u95F4",align:"center",prop:"createTime",formatter:t(Pe),width:"180"},null,8,["formatter"]),e(p,{label:"\u64CD\u4F5C",align:"center",width:"160"},{default:a(l=>[_e("div",$e,[w((n(),m(y,{type:"primary",link:"",onClick:g=>D("update",l.row.id)},{default:a(()=>[e(i,{icon:"ep:edit"}),u("\u4FEE\u6539 ")]),_:2},1032,["onClick"])),[[b,["system:user:update"]]]),w((n(),m(le,{onCommand:g=>((c,v)=>{switch(c){case"handleDelete":$(v.id);break;case"handleResetPwd":q(v);break;case"handleRole":J(v)}})(g,l.row)},{dropdown:a(()=>[e(ae,null,{default:a(()=>[t(R)(["system:user:delete"])?(n(),m(S,{key:0,command:"handleDelete"},{default:a(()=>[e(i,{icon:"ep:delete"}),u("\u5220\u9664 ")]),_:1})):U("",!0),t(R)(["system:user:update-password"])?(n(),m(S,{key:1,command:"handleResetPwd"},{default:a(()=>[e(i,{icon:"ep:key"}),u("\u91CD\u7F6E\u5BC6\u7801 ")]),_:1})):U("",!0),t(R)(["system:permission:assign-user-role"])?(n(),m(S,{key:2,command:"handleRole"},{default:a(()=>[e(i,{icon:"ep:circle-check"}),u("\u5206\u914D\u89D2\u8272 ")]),_:1})):U("",!0)]),_:1})]),default:a(()=>[e(y,{type:"primary",link:""},{default:a(()=>[e(i,{icon:"ep:d-arrow-right"}),u(" \u66F4\u591A")]),_:1})]),_:2},1032,["onCommand"])),[[b,["system:user:delete","system:user:update-password","system:permission:assign-user-role"]]])])]),_:1})]),_:1},8,["data"])),[[re,t(V)]]),e(se,{total:t(E),page:t(r).pageNo,"onUpdate:page":o[5]||(o[5]=l=>t(r).pageNo=l),limit:t(r).pageSize,"onUpdate:limit":o[6]||(o[6]=l=>t(r).pageSize=l),onPagination:d},null,8,["total","page","limit"])]),_:1})]),_:1})]),_:1}),e(Ke,{ref_key:"formRef",ref:B,onSuccess:d},null,512),e(Oe,{ref_key:"importFormRef",ref:P,onSuccess:d},null,512),e(je,{ref_key:"assignRoleFormRef",ref:Y,onSuccess:d},null,512)],64)}}});export{qe as default};