import{Z as f,cm as h,S as w,_ as S,d as R,m as g,cn as M,r as a,o as F,A as D,x as p,h as d,u as m,D as P,a as N,cc as W,cr as Y}from"./index.d0c68291.js";import{u as H}from"./use-page-search.f8fe5a6b.js";import{h as j,a as I,b as L,c as T,R as U,M as o,d as V}from"./role-modal.10c82f51.js";import{h as z}from"./index.92c55004.js";const E=[{value:"1",label:"\u8FD0\u8425\u8D26\u53F7"},{value:"2",label:"\u4E1A\u52A1\u516C\u53F8\u8D26\u53F7"},{value:"3",label:"\u4F9B\u5E94\u5546\u8D26\u53F7"}],Z=[{type:"selection",width:40,align:"center",hide:({checkList:e})=>!e.includes("\u52FE\u9009\u5217")},{label:"\u5E8F\u53F7",type:"index",minWidth:60,align:"left",hide:({checkList:e})=>!e.includes("\u5E8F\u53F7\u5217")},{label:"\u624B\u673A\u53F7",prop:"mobile",width:120,align:"left"},{label:"\u771F\u5B9E\u59D3\u540D",prop:"nickname",minWidth:150},{label:"\u8D26\u53F7\u7B49\u7EA7",cellRenderer:({row:e})=>f(h,null,{default:()=>{var u;return((u=E.find(({value:n})=>String(e.level)===n))==null?void 0:u.label)||"--"}})},{label:"\u72B6\u6001",prop:"status",width:100,cellRenderer:({row:e})=>f(h,{type:String(e.status)==="1"?"success":"danger"},{default:()=>String(e.status)==="1"?"\u542F\u7528":"\u7981\u7528"})},{label:"\u89D2\u8272",prop:"role_name",minWidth:150,align:"left"},{label:"\u521B\u5EFA\u65F6\u95F4",width:140,prop:"addtime",formatter:({addtime:e})=>w(e).format("YYYY-MM-DD HH:mm:ss")},{label:"\u64CD\u4F5C",fixed:"right",width:120,slot:"operation"}],$={title:"\u516C\u53F8\u8D26\u53F7\u89D2\u8272\u67E5\u8BE2",columns:Z,deleteProp:"payNo",statusRowProp:({companyCode:e})=>({companyNo:e}),apis:{httpList:j,httpDelete:I,httpAdd:!0,httpStatus:L,httpUpdate:T}},_={formItems:[{field:"nickname",type:"input",placeholder:"\u771F\u5B9E\u59D3\u540D",trigger:"change"},{field:"level",type:"select",placeholder:"\u8D26\u53F7\u7B49\u7EA7",options:E,trigger:"change"},{field:"username",type:"input",placeholder:"\u624B\u673A\u53F7",trigger:"change"}]},q="accountRole",G=R({__name:"index",setup(e){const u=g(null),n=g(null),v=t=>({result:{...t||{}},deleteProp:[]}),b={pageSearchHook:()=>H(v,void 0,_)},{run:y}=M({success:()=>n.value.onSearch()}),B={content:{create:()=>u.value.onDisplay(void 0,o.create),preview:t=>u.value.onDisplay(t,o.preview),update:t=>{if(Number(t.level)===3){W.warning("\u4F9B\u5E94\u5546\u7AEF\u8D26\u53F7\u4E0D\u63D0\u4F9B\u62A5\u8868\u529F\u80FD,\u4E0D\u80FD\u8BBE\u7F6E\u89D2\u8272!");return}u.value.onDisplay(t,o.update)}}};async function C(t){Y.confirm("\u662F\u5426\u786E\u8BA4\u89E3\u9664\u7ED1\u5B9A?").then(async()=>{(await V({id:t})).code===1&&n.value.onSearch()})}function A(t,l){const{roleid:s,id:c}=t,r={status:"1",user_id:c,role_id:s};switch(l){case o.update:y(z(r));break}}return(t,l)=>{const s=a("el-button"),c=a("el-tooltip"),r=a("PageContainer"),x=a("PageAuth");return F(),D(x,{pageName:q},{default:p(()=>[d(r,{hooks:b,events:B,contentConfig:m($),"search-config":m(_),"get-content-ref":i=>n.value=i},{content_action:p(({is_wx:i,id:k})=>[d(c,{content:"\u89E3\u9664\u5FAE\u4FE1\u7ED1\u5B9A"},{default:p(()=>[Number(i)===1?(F(),D(s,{key:0,type:"text",size:"mini",icon:m(P)("close"),onClick:J=>C(k)},null,8,["icon","onClick"])):N("v-if",!0)]),_:2},1024)]),_:1},8,["contentConfig","search-config","get-content-ref"]),d(U,{ref_key:"roleModalRef",ref:u,onFinanceSave:A},null,512)]),_:1})}}});var ee=S(G,[["__file","C:/Users/63107/Desktop/projects/report-v3/src/views/system/accountRole/index.vue"]]);export{ee as default};
