feat: 添加分页功能至租户和租户用户表格,优化数据展示

This commit is contained in:
傅光孟 2026-03-11 14:28:02 +08:00
parent 910f8b540e
commit 863fcd2d55
3 changed files with 25 additions and 5 deletions

View File

@ -3,11 +3,11 @@ ENV = development
# 本地环境接口地址 # 本地环境接口地址
# VITE_API_URL = http://4155gf93ll13.vicp.fun/admin # VITE_API_URL = http://4155gf93ll13.vicp.fun/admin
VITE_API_URL = http://localhost:13579/admin # VITE_API_URL = http://localhost:13579/admin
# VITE_API_URL = https://cankao.cs.com.cn/admin # VITE_API_URL = https://cankao.cs.com.cn/admin
# VITE_API_URL = http://127.0.0.1:13579/admin # VITE_API_URL = http://127.0.0.1:13579/admin
# VITE_API_URL = http://123.60.153.169:8040/admin VITE_API_URL = http://123.60.153.169:8040/admin
# VITE_API_URL = /api # VITE_API_URL = /api

View File

@ -32,7 +32,7 @@
</el-form> </el-form>
</div> </div>
<tableComponents :tableData="tableData" :tableLoading="loading" :hadExpand="false"> <tableComponents :tableData="tableData" :tableLoading="loading" :hadExpand="false" @currentChange="currentChange" @sizeChange="sizeChange">
<el-table-column prop="companyType" label="企业类型" align="center"> <el-table-column prop="companyType" label="企业类型" align="center">
<template #default="scope"> <template #default="scope">
{{ COMPANYTYPE_CONST[scope.row.companyType]?.label }} {{ COMPANYTYPE_CONST[scope.row.companyType]?.label }}
@ -224,6 +224,16 @@ function exportExcel() {
}); });
} }
function currentChange(val) {
tableData.page = val;
getData();
}
function sizeChange(val) {
tableData.size = val;
getData();
}
// //
onMounted(() => { onMounted(() => {
NextLoading.done(); NextLoading.done();

View File

@ -34,7 +34,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<tableComponents :tableData="tableData" :tableLoading="loading" :hadExpand="false"> <tableComponents :tableData="tableData" :tableLoading="loading" :hadExpand="false" @currentChange="currentChange" @sizeChange="sizeChange">
<el-table-column prop="name" label="姓名" align="center" /> <el-table-column prop="name" label="姓名" align="center" />
<el-table-column prop="mobile" label="手机号" align="center" /> <el-table-column prop="mobile" label="手机号" align="center" />
<el-table-column prop="companyName" label="企业名称" align="center" /> <el-table-column prop="companyName" label="企业名称" align="center" />
@ -155,7 +155,7 @@ async function doUpdateStatus(row: IData) {
ElMessage.success('操作成功'); ElMessage.success('操作成功');
getData(); getData();
} else { } else {
if(row.status === 1) { if (row.status === 1) {
ElMessage.error('启用失败,当前可管理子账号已达上限,请先删除无用子账号再启用'); ElMessage.error('启用失败,当前可管理子账号已达上限,请先删除无用子账号再启用');
} }
} }
@ -221,6 +221,16 @@ function clearForm() {
getData(); getData();
} }
function currentChange(val) {
tableData.page = val;
getData();
}
function sizeChange(val) {
tableData.size = val;
getData();
}
// //
onMounted(() => { onMounted(() => {
NextLoading.done(); NextLoading.done();