import{d as W,Q as X,J as Z,r as i,A as $,b as j,a1 as G,o as s,c as F,k as e,B as t,a as l,a2 as P,F as A,i as ee,a3 as ae,N as S,g as m,O as u,P as f,a7 as le,S as te,$ as oe,R as re,T as se,U as ne,V as pe,W as ie,X as me,Y as ue,Z as ce}from"./index-CHTXMeh8.js";import{_ as de}from"./index.vue_vue_type_script_setup_true_lang-Cenk7Bi3.js";import{_ as fe}from"./DictTag.vue_vue_type_script_lang-DPOZRs0A.js";import{_ as ye}from"./ContentWrap.vue_vue_type_script_setup_true_lang-BjvrLlUT.js";import{d as _e}from"./formatTime-DG99nHw2.js";import{d as ge}from"./download-e0EdwhTv.js";import{b as be,d as ke,e as we}from"./index-VglbY8ty.js";import{_ as ve}from"./RoleForm.vue_vue_type_script_setup_true_lang-D1AZNa7c.js";import xe from"./RoleAssignMenuForm-PpPyQf_t.js";import{_ as Ce}from"./RoleDataPermissionForm.vue_vue_type_script_setup_true_lang-Cr1_6CjE.js";import"./index-DVe591HI.js";import"./color-DXkOL5Tu.js";import"./el-card-Bdk9qx7q.js";import"./Dialog.vue_vue_type_style_index_0_lang-DH0TiLYN.js";import"./constants-CuOBQ73z.js";import"./tree-BBZY150N.js";import"./index-DTm78JRf.js";import"./index-C8JQPUwX.js";import"./index-BFn6KXm4.js";const Se=W({name:"SystemRole",__name:"index",setup(he){const w=X(),{t:z}=Z(),v=i(!0),h=i(0),V=i([]),o=$({pageNo:1,pageSize:10,code:"",name:"",status:void 0,createTime:[]}),T=i(),x=i(!1),c=async()=>{v.value=!0;try{const d=await be(o);V.value=d.list,h.value=d.total}finally{v.value=!1}},b=()=>{o.pageNo=1,c()},E=()=>{T.value.resetFields(),b()},U=i(),M=(d,r)=>{U.value.open(d,r)},N=i(),O=i(),I=async()=>{try{await w.exportConfirm(),x.value=!0;const d=await we(o);ge.excel(d,"\u89D2\u8272\u5217\u8868.xls")}catch{}finally{x.value=!1}};return j(()=>{c()}),(d,r)=>{const R=le,_=te,H=oe,K=re,q=se,k=ne,p=pe,B=ie,Y=ye,n=me,D=fe,J=ue,L=de,y=G("hasPermi"),Q=ce;return s(),F(A,null,[e(Y,null,{default:t(()=>[e(B,{ref_key:"queryFormRef",ref:T,inline:!0,model:l(o),class:"-mb-15px","label-width":"68px"},{default:t(()=>[e(_,{label:"\u89D2\u8272\u540D\u79F0",prop:"name"},{default:t(()=>[e(R,{modelValue:l(o).name,"onUpdate:modelValue":r[0]||(r[0]=a=>l(o).name=a),class:"!w-240px",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u89D2\u8272\u540D\u79F0",onKeyup:P(b,["enter"])},null,8,["modelValue"])]),_:1}),e(_,{label:"\u89D2\u8272\u6807\u8BC6",prop:"code"},{default:t(()=>[e(R,{modelValue:l(o).code,"onUpdate:modelValue":r[1]||(r[1]=a=>l(o).code=a),class:"!w-240px",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u89D2\u8272\u6807\u8BC6",onKeyup:P(b,["enter"])},null,8,["modelValue"])]),_:1}),e(_,{label:"\u72B6\u6001",prop:"status"},{default:t(()=>[e(K,{modelValue:l(o).status,"onUpdate:modelValue":r[2]||(r[2]=a=>l(o).status=a),class:"!w-240px",clearable:"",placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001"},{default:t(()=>[(s(!0),F(A,null,ee(l(ae)(l(S).COMMON_STATUS),a=>(s(),m(H,{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(_,{label:"\u521B\u5EFA\u65F6\u95F4",prop:"createTime"},{default:t(()=>[e(q,{modelValue:l(o).createTime,"onUpdate:modelValue":r[3]||(r[3]=a=>l(o).createTime=a),"default-time":[new Date("1 00:00:00"),new Date("1 23:59:59")],class:"!w-240px","end-placeholder":"\u7ED3\u675F\u65E5\u671F","start-placeholder":"\u5F00\u59CB\u65E5\u671F",type:"daterange","value-format":"YYYY-MM-DD HH:mm:ss"},null,8,["modelValue","default-time"])]),_:1}),e(_,null,{default:t(()=>[e(p,{onClick:b},{default:t(()=>[e(k,{class:"mr-5px",icon:"ep:search"}),u(" \u641C\u7D22 ")]),_:1}),e(p,{onClick:E},{default:t(()=>[e(k,{class:"mr-5px",icon:"ep:refresh"}),u(" \u91CD\u7F6E ")]),_:1}),f((s(),m(p,{plain:"",type:"primary",onClick:r[4]||(r[4]=a=>M("create"))},{default:t(()=>[e(k,{class:"mr-5px",icon:"ep:plus"}),u(" \u65B0\u589E ")]),_:1})),[[y,["system:role:create"]]]),f((s(),m(p,{loading:l(x),plain:"",type:"success",onClick:I},{default:t(()=>[e(k,{class:"mr-5px",icon:"ep:download"}),u(" \u5BFC\u51FA ")]),_:1},8,["loading"])),[[y,["system:role:export"]]])]),_:1})]),_:1},8,["model"])]),_:1}),e(Y,null,{default:t(()=>[f((s(),m(J,{data:l(V)},{default:t(()=>[e(n,{align:"center",label:"\u89D2\u8272\u7F16\u53F7",prop:"id"}),e(n,{align:"center",label:"\u89D2\u8272\u540D\u79F0",prop:"name"}),e(n,{label:"\u89D2\u8272\u7C7B\u578B",align:"center",prop:"type"},{default:t(a=>[e(D,{type:l(S).SYSTEM_ROLE_TYPE,value:a.row.type},null,8,["type","value"])]),_:1}),e(n,{align:"center",label:"\u89D2\u8272\u6807\u8BC6",prop:"code"}),e(n,{align:"center",label:"\u663E\u793A\u987A\u5E8F",prop:"sort"}),e(n,{align:"center",label:"\u5907\u6CE8",prop:"remark"}),e(n,{align:"center",label:"\u72B6\u6001",prop:"status"},{default:t(a=>[e(D,{type:l(S).COMMON_STATUS,value:a.row.status},null,8,["type","value"])]),_:1}),e(n,{formatter:l(_e),align:"center",label:"\u521B\u5EFA\u65F6\u95F4",prop:"createTime",width:"180"},null,8,["formatter"]),e(n,{width:300,align:"center",label:"\u64CD\u4F5C"},{default:t(a=>[f((s(),m(p,{link:"",type:"primary",onClick:C=>M("update",a.row.id)},{default:t(()=>[u(" \u7F16\u8F91 ")]),_:2},1032,["onClick"])),[[y,["system:role:update"]]]),f((s(),m(p,{link:"",preIcon:"ep:basketball",title:"\u83DC\u5355\u6743\u9650",type:"primary",onClick:C=>(async g=>{O.value.open(g)})(a.row)},{default:t(()=>[u(" \u83DC\u5355\u6743\u9650 ")]),_:2},1032,["onClick"])),[[y,["system:permission:assign-role-menu"]]]),f((s(),m(p,{link:"",preIcon:"ep:coin",title:"\u6570\u636E\u6743\u9650",type:"primary",onClick:C=>(async g=>{N.value.open(g)})(a.row)},{default:t(()=>[u(" \u6570\u636E\u6743\u9650 ")]),_:2},1032,["onClick"])),[[y,["system:permission:assign-role-data-scope"]]]),f((s(),m(p,{link:"",type:"danger",onClick:C=>(async g=>{try{await w.delConfirm(),await ke(g),w.success(z("common.delSuccess")),await c()}catch{}})(a.row.id)},{default:t(()=>[u(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[y,["system:role:delete"]]])]),_:1})]),_:1},8,["data"])),[[Q,l(v)]]),e(L,{limit:l(o).pageSize,"onUpdate:limit":r[5]||(r[5]=a=>l(o).pageSize=a),page:l(o).pageNo,"onUpdate:page":r[6]||(r[6]=a=>l(o).pageNo=a),total:l(h),onPagination:c},null,8,["limit","page","total"])]),_:1}),e(ve,{ref_key:"formRef",ref:U,onSuccess:c},null,512),e(xe,{ref_key:"assignMenuFormRef",ref:O,onSuccess:c},null,512),e(Ce,{ref_key:"dataPermissionFormRef",ref:N,onSuccess:c},null,512)],64)}}});export{Se as default};