index.8ac55413.js 3.4 KB

1
  1. import{a3 as m,aE as g,Z as R,_ as S,d as M,w as F,aF as P,r as n,o as D,G as _,C as d,l as f,u as h,J as N,a as W,au as Y,aJ as H}from"./index.1d5f2f42.js";import{u as I}from"./use-page-search.5b2e253c.js";import{h as J,a as L,b as T,c as V,R as j,M as o,d as z}from"./role-modal.bb463879.js";import{h as G}from"./index.00fd5a1f.js";const v=[{value:"1",label:"\u8FD0\u8425\u8D26\u53F7"},{value:"2",label:"\u4E1A\u52A1\u516C\u53F8\u8D26\u53F7"},{value:"3",label:"\u4F9B\u5E94\u5546\u8D26\u53F7"}],U=[{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})=>m(g,null,{default:()=>{var a;return((a=v.find(({value:u})=>String(e.level)===u))==null?void 0:a.label)||"--"}})},{label:"\u72B6\u6001",prop:"status",width:100,cellRenderer:({row:e})=>m(g,{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})=>R(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:U,deleteProp:"payNo",statusRowProp:({companyCode:e})=>({companyNo:e}),apis:{httpList:J,httpDelete:L,httpAdd:!0,httpStatus:T,httpUpdate:V}},E={formItems:[{field:"nickname",type:"input",placeholder:"\u771F\u5B9E\u59D3\u540D",trigger:"change"},{field:"level",type:"select",placeholder:"\u8D26\u53F7\u7B49\u7EA7",options:v,trigger:"change"},{field:"username",type:"input",placeholder:"\u624B\u673A\u53F7",trigger:"change"}]},$=M({__name:"index",setup(e){const a="accountRole",u=F(null),l=F(null),b=t=>({result:{...t||{}},deleteProp:[]}),y={pageSearchHook:()=>I(b,void 0,E)},{run:B}=P({success:()=>l.value.onSearch()}),C={content:{create:()=>u.value.onDisplay(void 0,o.create),preview:t=>u.value.onDisplay(t,o.preview),update:t=>{if(Number(t.level)===3){Y.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 A(t){H.confirm("\u662F\u5426\u786E\u8BA4\u89E3\u9664\u7ED1\u5B9A?").then(async()=>{(await z({id:t})).code===1&&l.value.onSearch()})}function w(t,s){const{roleid:r,id:c}=t,i={status:"1",user_id:c,role_id:r};switch(s){case o.update:B(G(i));break}}return(t,s)=>{const r=n("el-button"),c=n("el-tooltip"),i=n("PageContainer"),k=n("PageAuth");return D(),_(k,{pageName:a},{default:d(()=>[f(i,{hooks:y,events:C,contentConfig:h(Z),"search-config":h(E),"get-content-ref":p=>l.value=p},{content_action:d(({is_wx:p,id:x})=>[f(c,{content:"\u89E3\u9664\u5FAE\u4FE1\u7ED1\u5B9A"},{default:d(()=>[Number(p)===1?(D(),_(r,{key:0,type:"text",size:"mini",icon:h(N)("close"),onClick:q=>A(x)},null,8,["icon","onClick"])):W("v-if",!0)]),_:2},1024)]),_:1},8,["contentConfig","search-config","get-content-ref"]),f(j,{ref_key:"roleModalRef",ref:u,onFinanceSave:w},null,512)]),_:1})}}});var ee=S($,[["__file","D:/work/rep-v3/report-v3/src/views/system/accountRole/index.vue"]]);export{ee as default};