index-BBMFveho.js 2.2 KB

1
  1. import{d as f,u as h,r as g,W as w,G as i,e as _,j as y,o as C,w as l,i as n,q as t,g as D,y as k,l as x,t as R,A,P as I}from"./index-BrzxbNKf.js";import{u as N,N as s,C as P}from"./index-AuO9KRkp.js";import{u as V,C as v}from"./index-Pks81AU0.js";import"./index-DC8tzfmn.js";import"./index-rSiyH974.js";const F={style:{display:"flex","justify-content":"flex-end",width:"100%"}},L=f({__name:"index",setup(S){const{t:a}=h();g();const{register:d,tableActions:p}=N({title:"部门列表",api:i.departmentList,showSelection:!1,showIndex:!1,showAction:w(60,70,80),immediate:!0,columns:[{prop:"id",label:"部门ID",width:80,align:"center"},{prop:"name",label:"部门名称"},{prop:"parent_id",label:"上级部门ID",width:80,align:"center"},{prop:"weight",label:"权重",width:80,align:"center"},{prop:"status",label:"状态",tagEnums:s,align:"center",width:100},{prop:"remark",label:"备注"}],schema:[{label:"部门名称",prop:"name",type:"input"},{label:"状态",prop:"status",type:"select",options:s}],actionProps:{width:240,btnList:[{label:"新增下级",perm:60,click:e=>{o({title:a("新增下级")},()=>{r().setValues("parent_id",e.row.id)})}},{perm:70,label:"编辑",click:e=>{o({title:a("编辑")},()=>{r().setFormModel(e.row)})}},{perm:80,label:"删除",isPopConfirm:!0,type:"danger",popConfirmEmits:{confirm(e){return i.departmentDelete({id:e.row.id}).then(()=>{p.reload()}),!0}}}]}}),[u,{open:o,getFormActions:r}]=V({submit(e,m){i.departmentUpdate(e).then(()=>{r().reset(),m(),p.reload()})},formConfig:{schema:[{label:"id",prop:"id",type:"input",notShow:!0},{label:"上级部门ID",prop:"parent_id",type:"input"},{label:"部门名称",prop:"name",type:"input",required:!0},{label:"备注",prop:"remark",type:"input"},{label:"状态",prop:"status",type:"select",options:s,defaultValue:1},{label:"权重",prop:"weight",type:"input"}]}});function c(){o({title:a("新增")})}return(e,m)=>{const b=_("el-button");return C(),y(I,null,{default:l(()=>[n(t(P),{onRegister:t(d)},{titleRight:l(()=>[D("div",F,[k(n(b,{type:"primary",onClick:c},{default:l(()=>[x(R(t(a)("新增")),1)]),_:1},512),[[A,e.$perm(60)]])])]),_:1},8,["onRegister"]),n(t(v),{onRegister:t(u)},null,8,["onRegister"])]),_:1})}}});export{L as default};