import{useColumns as Y}from"./columns.1c44b435.js";import{aG as L,aH as G,_ as J,q as K,A as j,a4 as V,B as p,C as Q,r,o as b,n as x,t as a,H as l,I as W,J as Z,v as i,S,aM as D,K as ee}from"./index.d8ce26ef.js";import{T as te}from"./index.4ed99b91.js";import{u as m}from"./hooks.3def80f5.js";import{s as ae}from"./status.fad06285.js";const{VITE_PROXY_DOMAIN_REAL:ve,VITE_PROXY_USER_REAL:ne}=G(),R=ne+"/admin/",oe=g=>L.request("post",`${R}supplierlist`,{data:g}),le=g=>L.request("post",`${R}menustatus`,{data:g});const se={class:"main role"},ue=S(" \u641C\u7D22 "),ie=S(" \u91CD\u7F6E "),re=S(" \u65B0\u589E\u89D2\u8272 "),ce={name:"role"},de=K({...ce,setup(g){const{logout:w}=j(),o=V({name:"",page:1,size:15}),y=p([]),v=p(!0),{columns:A}=Y(),B=p(!1),I=p(""),T=p("add"),F=p(),h=V({total:0,pageSize:15,currentPage:1,background:!0}),z=async e=>{const{id:n,status:_}=e,{code:s,message:u}=await le({id:n,status:_+""=="1"?"0":"1"});s===0?c():s>100&&s<140?w():D.error(u)};async function P(e){o.page=e,await c()}async function $(e){o.size=e,o.page=1,await c()}function M(e){}async function c(){v.value=!0;const{code:e,data:n,message:_}=await oe(o);if(e===0){const{list:s,count:u}=n;y.value=s!=null?s:[],h.total=u!=null?u:0,h.pageSize=o.size,h.currentPage=o.page}else e>100&&e<140?w():D.error(_);v.value=!1}async function N(){o.page=1,await c()}function C(e,n){I.value=e,T.value=n,B.value=!0}const O=e=>{!e||(e.resetFields(),o.page=1,c())};return Q(()=>{c()}),(e,n)=>{const _=r("el-option"),s=r("el-select"),u=r("el-form-item"),q=r("el-input"),d=r("el-button"),U=r("el-form"),H=r("el-popconfirm"),X=r("PureTable");return b(),x("div",se,[a(U,{ref_key:"formRef",ref:F,inline:!0,model:o,"label-width":0,class:"bg-white w-99/100 pl-8 pt-4"},{default:l(()=>[a(u,{prop:"status"},{default:l(()=>[a(s,{modelValue:o.status,"onUpdate:modelValue":n[0]||(n[0]=t=>o.status=t),style:{width:"100%"},placeholder:"\u89D2\u8272\u72B6\u6001",clearable:""},{default:l(()=>[(b(!0),x(W,null,Z(i(ae),(t,k)=>(b(),ee(_,{key:"status"+t.value+k,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(u,{prop:"role_name"},{default:l(()=>[a(q,{modelValue:o.role_name,"onUpdate:modelValue":n[1]||(n[1]=t=>o.role_name=t),placeholder:"\u89D2\u8272\u540D\u79F0",clearable:""},null,8,["modelValue"])]),_:1}),a(u,null,{default:l(()=>[a(d,{type:"primary",icon:i(m)("search"),loading:v.value,onClick:N},{default:l(()=>[ue]),_:1},8,["icon","loading"]),a(d,{icon:i(m)("refresh"),onClick:n[2]||(n[2]=t=>O(F.value))},{default:l(()=>[ie]),_:1},8,["icon"])]),_:1})]),_:1},8,["model"]),a(i(te),{title:"\u89D2\u8272\u7BA1\u7406",loading:v.value,dataList:y.value,onRefresh:c},{buttons:l(()=>[a(d,{type:"primary",icon:i(m)("add"),onClick:n[3]||(n[3]=t=>C("","add"))},{default:l(()=>[re]),_:1},8,["icon"])]),default:l(({size:t,checkList:k})=>[a(X,{border:"",align:"left",showOverflowTooltip:"","table-layout":"auto",size:t,data:y.value,columns:i(A),checkList:k,pagination:h,paginationSmall:t==="small","header-cell-style":{background:"#fafafa",color:"#606266"},onSelectionChange:M,onSizeChange:$,onCurrentChange:P},{operation:l(({row:f})=>[a(d,{class:"reset-margin",link:"",type:"primary",size:t,onClick:E=>C(f.id,"view"),icon:i(m)("eye-view")},null,8,["size","onClick","icon"]),a(d,{class:"reset-margin",link:"",type:"primary",size:t,onClick:E=>C(f.id,"edit"),icon:i(m)("edits")},null,8,["size","onClick","icon"]),a(H,{title:f.status==="1"?"\u6539\u4E3A\u7981\u7528\uFF1F":"\u6539\u4E3A\u542F\u7528\uFF1F",onConfirm:E=>z(f)},{reference:l(()=>[a(d,{class:"reset-margin",link:"",type:"primary",size:t,icon:i(m)(f.status==="1"?"close-circle-line":"checkbox-circle-line")},null,8,["size","icon"])]),_:2},1032,["title","onConfirm"])]),_:2},1032,["size","data","columns","checkList","pagination","paginationSmall"])]),_:1},8,["loading","dataList"])])}}});var he=J(de,[["__scopeId","data-v-cee12270"]]);export{he as default};
