index.5e8cd34c.js 3.2 KB

1
  1. import{Z as f,cp as h,S,_ as w,d as R,m as g,cq as P,r as o,o as _,A as F,x as p,h as d,u as m,D as M,a as N,cs as W}from"./index.62ae038d.js";import{u as Y}from"./use-page-search.490f9727.js";import{R as H,M as a}from"./role-modal.8be316b7.js";import{h as j,a as I,b as L,c as T,d as U}from"./index.313017bf.js";import{h as V}from"./index.45a9be0e.js";const D=[{value:"1",label:"\u8FD0\u8425\u8D26\u53F7"},{value:"2",label:"\u4E1A\u52A1\u516C\u53F8\u8D26\u53F7"},{value:"3",label:"\u4F9B\u5E94\u5546\u8D26\u53F7"}],q=[{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=D.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})=>S(e).format("YYYY-MM-DD HH:mm:ss")},{label:"\u64CD\u4F5C",fixed:"right",width:120,slot:"operation"}],z={title:"\u516C\u53F8\u8D26\u53F7\u89D2\u8272\u67E5\u8BE2",columns:q,deleteProp:"payNo",statusRowProp:({companyCode:e})=>({companyNo:e}),apis:{httpList:j,httpDelete:I,httpAdd:!0,httpStatus:L,httpUpdate:T}},v={formItems:[{field:"nickname",type:"input",placeholder:"\u771F\u5B9E\u59D3\u540D",trigger:"change"},{field:"level",type:"select",placeholder:"\u8D26\u53F7\u7B49\u7EA7",options:D,trigger:"change"},{field:"username",type:"input",placeholder:"\u624B\u673A\u53F7",trigger:"change"}]},Z="accountRole",$=R({__name:"index",setup(e){const u=g(null),n=g(null),E=t=>({result:{...t||{}},deleteProp:[]}),y={pageSearchHook:()=>Y(E,void 0,v)},{run:b}=P({success:()=>n.value.onSearch()}),C={content:{create:()=>u.value.onDisplay(void 0,a.create),preview:t=>u.value.onDisplay(t,a.preview),update:t=>{u.value.onDisplay(t,a.update)}}};async function A(t){W.confirm("\u662F\u5426\u786E\u8BA4\u89E3\u9664\u7ED1\u5B9A?").then(async()=>{(await U({id:t})).code===1&&n.value.onSearch()})}function B(t,l){const{roleid:s,id:c}=t,r={status:"1",user_id:c,role_id:s};switch(l){case a.update:b(V(r));break}}return(t,l)=>{const s=o("el-button"),c=o("el-tooltip"),r=o("PageContainer"),x=o("PageAuth");return _(),F(x,{pageName:Z},{default:p(()=>[d(r,{hooks:y,events:C,contentConfig:m(z),"search-config":m(v),"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(s,{key:0,type:"text",size:"mini",icon:m(M)("close"),onClick:G=>A(k)},null,8,["icon","onClick"])):N("v-if",!0)]),_:2},1024)]),_:1},8,["contentConfig","search-config","get-content-ref"]),d(H,{ref_key:"roleModalRef",ref:u,onFinanceSave:B},null,512)]),_:1})}}});var ee=w($,[["__file","C:/Users/63107/Desktop/projects/report-v3/src/views/system/accountRole/index.vue"]]);export{ee as default};