index.fae2ed69.js 4.6 KB

1
  1. import{_ as X,d as ee,v as ae,Z as R,w as f,W as te,ad as E,ag as oe,x as le,r as c,o as _,c as I,H as M,K as P,b as ne,l,C as n,F as se,D as ue,u as s,G as C,J as g,M as V,a as w,bp as ie,bn as re,aY as ce}from"./index.fd765376.js";import{useColumns as de}from"./columns.fe68e6b7.js";import{a as me,h as pe,b as fe}from"./addEdit.7570897e.js";import{a as _e}from"./status.0f05917e.js";const ve={class:"main role"},ge={name:"role"},he=ee({...ge,setup(Ce){const{logout:B}=ae(),o=R({level:"2",role_name:"",status:"",page:1,size:15}),i=f([]),S=f([]),y=f(!0),{columns:T}=de(),b=f(!1),A=f(""),L=f("add"),N=f();te();const{info:D}=E(),F=oe(()=>!D||!D.id?!1:String(D.id)==="156"),k=R({total:0,pageSize:15,currentPage:1,background:!0}),$=async a=>{const{id:t,status:h}=a,{code:m,message:r}=await pe({roleid:t,status:h+""=="1"?"0":"1"});re({code:m,message:r,logout:B,handler:()=>d()})};async function U(a){o.page=a,await d()}async function H(a){o.size=a,o.page=1,await d()}function j(a){}async function d(){y.value=!0;const{code:a,data:t,message:h}=await fe({...o});if(a===0){const{list:m,count:r}=t;S.value=m!=null?m:[],k.total=r!=null?r:0,k.pageSize=o.size,k.currentPage=o.page}else a>100&&a<140?B():ce.error(h);y.value=!1}async function G(){o.page=1,await d()}function x(a,t){A.value=a,L.value=t,b.value=!0}const J=()=>{b.value=!1,d()},K=()=>{b.value=!1},O=a=>{!a||(a.resetFields(),o.page=1,d())};return le(()=>{i.value=E().getMenuActions("role"),i.value.some(a=>a=="001")&&d()}),(a,t)=>{const h=c("el-option"),m=c("el-select"),r=c("el-form-item"),W=c("el-input"),v=c("el-button"),Y=c("el-form"),Z=c("el-popconfirm"),q=c("PureTable"),Q=c("NoAuth");return _(),I("div",ve,[M(ne("div",null,[l(Y,{ref_key:"formRef",ref:N,inline:!0,model:o,size:"small","label-width":0,class:"bg-white w-99/100 pl-8 pt-4"},{default:n(()=>[l(r,{prop:"status"},{default:n(()=>[l(m,{modelValue:o.status,"onUpdate:modelValue":t[0]||(t[0]=e=>o.status=e),style:{width:"100%"},placeholder:"\u89D2\u8272\u72B6\u6001",clearable:""},{default:n(()=>[(_(!0),I(se,null,ue(s(_e),(e,z)=>(_(),C(h,{key:"status"+e.value+z,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(r,{prop:"role_name"},{default:n(()=>[l(W,{modelValue:o.role_name,"onUpdate:modelValue":t[1]||(t[1]=e=>o.role_name=e),placeholder:"\u89D2\u8272\u540D\u79F0",clearable:""},null,8,["modelValue"])]),_:1}),l(r,null,{default:n(()=>[l(v,{type:"primary",icon:s(g)("search"),loading:y.value,onClick:G},{default:n(()=>[V(" \u641C\u7D22 ")]),_:1},8,["icon","loading"]),l(v,{icon:s(g)("refresh"),onClick:t[2]||(t[2]=e=>O(N.value))},{default:n(()=>[V(" \u91CD\u7F6E ")]),_:1},8,["icon"])]),_:1})]),_:1},8,["model"]),l(s(ie),{title:"\u516C\u53F8\u89D2\u8272\u7BA1\u7406",loading:y.value,dataList:S.value,onRefresh:d},{buttons:n(()=>[i.value.some(e=>e=="002")&&!s(F)?(_(),C(v,{key:0,type:"primary",size:"small",icon:s(g)("add"),onClick:t[3]||(t[3]=e=>x("","add"))},{default:n(()=>[V(" \u65B0\u589E\u89D2\u8272 ")]),_:1},8,["icon"])):w("v-if",!0)]),default:n(({size:e,checkList:z})=>[l(q,{border:"",align:"left",showOverflowTooltip:"","table-layout":"auto",size:"small",data:S.value,columns:s(T),checkList:z,pagination:k,paginationSmall:e==="small","header-cell-style":{background:"#fafafa",color:"#606266"},onSelectionChange:j,onSizeChange:H,onCurrentChange:U},{operation:n(({row:p})=>[i.value.some(u=>u=="007")?(_(),C(v,{key:0,class:"reset-margin",link:"",type:"primary",size:e,onClick:u=>x(p.id,"view"),icon:s(g)("eye-view")},null,8,["size","onClick","icon"])):w("v-if",!0),i.value.some(u=>u=="005")&&!s(F)?(_(),C(v,{key:1,class:"reset-margin",link:"",type:"primary",size:e,onClick:u=>x(p.id,"edit"),icon:s(g)("edits")},null,8,["size","onClick","icon"])):w("v-if",!0),(i.value.some(u=>u=="004")&&p.status+""=="1"||i.value.some(u=>u=="003")&&p.status+""=="0")&&!s(F)?(_(),C(Z,{key:2,title:p.status==="1"?"\u6539\u4E3A\u7981\u7528\uFF1F":"\u6539\u4E3A\u542F\u7528\uFF1F",onConfirm:u=>$(p)},{reference:n(()=>[l(v,{class:"reset-margin",link:"",type:"primary",size:e,icon:s(g)(p.status==="1"?"close-circle-line":"checkbox-circle-line")},null,8,["size","icon"])]),_:2},1032,["title","onConfirm"])):w("v-if",!0)]),_:2},1032,["data","columns","checkList","pagination","paginationSmall"])]),_:1},8,["loading","dataList"]),l(me,{itemId:A.value,isDetails:L.value,"show-model":b.value,onRefresh:J,onCancel:K},null,8,["itemId","isDetails","show-model"])],512),[[P,i.value.some(e=>e=="001")]]),M(l(Q,null,null,512),[[P,!i.value.some(e=>e=="001")]])])}}});var Se=X(he,[["__scopeId","data-v-d902b58e"],["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/supplierManage/supplierRole/index.vue"]]);export{Se as default};