index.ecbde416.js 4.5 KB

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