You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
4.0 KiB

import{g as V,_ as E,d as $,o as q,c as N}from"./editDialog-BLnDv3VC.js";import{g as O,z as j,h as M,r as s,i as f,j as g,o as i,c as R,d as n,w as t,k as d,e as p,t as U,D as _,A as y}from"./index-CsSGZIOI.js";const A={class:"app-container"},G=Object.assign({name:"tenantIndex"},{__name:"index",setup(H){const e=O({loading:!1,queryParams:{name:""},pageParams:{Page:1,PageSize:10,Total:0},tableData:[]}),P=j();M(()=>{r()});function r(){e.loading=!0,V(Object.assign({},e.queryParams,e.pageParams)).then(o=>{e.tableData=o.data.data,e.pageParams.Total=o.data.total}).finally(()=>e.loading=!1)}function v(o){_.confirm("是否删除该租户?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{e.loading=!0,$(o).then(()=>{y({message:"删除成功",type:"success"}),r()}).finally(()=>e.loading=!1)})}function C(o){_.confirm("是否启用该租户?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{e.loading=!0,q(o).then(()=>{y({message:"启用成功",type:"success"}),r()}).finally(()=>e.loading=!1)})}function T(o){_.confirm("是否禁用该租户?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{e.loading=!0,N(o).then(()=>{y({message:"禁用成功",type:"success"}),r()}).finally(()=>e.loading=!1)})}return(o,a)=>{const D=s("el-input"),b=s("el-form-item"),m=s("el-button"),z=s("el-form"),x=s("el-card"),u=s("el-table-column"),k=s("el-tag"),B=s("el-table"),I=s("el-pagination"),c=f("auth"),S=f("auth-any"),h=f("loading");return g((i(),R("div",A,[n(x,{class:"search-container"},{default:t(()=>[n(z,{inline:!0},{default:t(()=>[n(b,{label:"职位名称"},{default:t(()=>[n(D,{modelValue:e.queryParams.name,"onUpdate:modelValue":a[0]||(a[0]=l=>e.queryParams.name=l),placeholder:"职位名称",clearable:""},null,8,["modelValue"])]),_:1}),n(b,null,{default:t(()=>[g((i(),d(m,{onClick:r,icon:"Search"},{default:t(()=>a[4]||(a[4]=[p("查询")])),_:1})),[[c,"tenantIndex:page"]]),g((i(),d(m,{type:"primary",onClick:a[1]||(a[1]=()=>P.value.openDialog())},{default:t(()=>a[5]||(a[5]=[p("新增")])),_:1})),[[c,"tenantIndex:add"]])]),_:1})]),_:1})]),_:1}),n(x,{class:"paged-table-container"},{default:t(()=>[n(B,{ref:"tableRef","row-key":"id",data:e.tableData,border:""},{default:t(()=>[n(u,{type:"index",width:"50"},{default:t(l=>[p(U(l.$index+1+(e.pageParams.Page-1)*e.pageParams.PageSize),1)]),_:1}),n(u,{prop:"tenantName",label:"租户名称"}),n(u,{prop:"orgName",label:"机构"}),n(u,{prop:"sort",label:"序号"}),n(u,{prop:"status",label:"状态"},{default:t(l=>[l.row.status===1?(i(),d(k,{key:0,type:"success","disable-transitions":""},{default:t(()=>a[6]||(a[6]=[p("正常")])),_:1})):(i(),d(k,{key:1,type:"danger","disable-transitions":""},{default:t(()=>a[7]||(a[7]=[p("禁用")])),_:1}))]),_:1}),n(u,{prop:"remark",label:"备注"}),g((i(),d(u,{label:"操作",align:"left",width:"260","show-overflow-tooltip":""},{default:t(l=>[l.row.status===0?g((i(),d(m,{key:0,link:"",icon:"View",type:"success",onClick:w=>C(l.row.id)},{default:t(()=>a[8]||(a[8]=[p(" 启用 ")])),_:2},1032,["onClick"])),[[c,"tenantIndex:open_close"]]):g((i(),d(m,{key:1,link:"",icon:"Hide",type:"danger",onClick:w=>T(l.row.id)},{default:t(()=>a[9]||(a[9]=[p(" 禁用 ")])),_:2},1032,["onClick"])),[[c,"tenantIndex:open_close"]]),g((i(),d(m,{link:"",icon:"Delete",type:"danger",onClick:w=>v(l.row.id)},{default:t(()=>a[10]||(a[10]=[p(" 删除 ")])),_:2},1032,["onClick"])),[[c,"tenantIndex:delete"]])]),_:1})),[[S,["tenantIndex:edit","tenantIndex:delete","tenantIndex:open_close"]]])]),_:1},8,["data"]),n(I,{style:{"margin-top":"15px",float:"right"},currentPage:e.pageParams.Page,"onUpdate:currentPage":a[2]||(a[2]=l=>e.pageParams.Page=l),"page-size":e.pageParams.PageSize,"onUpdate:pageSize":a[3]||(a[3]=l=>e.pageParams.PageSize=l),total:e.pageParams.Total,background:"",layout:"total, sizes,prev, pager, next",onSizeChange:r,onCurrentChange:r,"page-sizes":[10,20,50,100]},null,8,["currentPage","page-size","total"])]),_:1}),n(E,{ref_key:"tenantEditDialogRef",ref:P,onOnClose:r},null,512)])),[[h,e.loading]])}}});export{G as default};