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