diff --git a/ruoyi-ui/src/views/ccdiProject/index.vue b/ruoyi-ui/src/views/ccdiProject/index.vue index 996b6d5..7b546d7 100644 --- a/ruoyi-ui/src/views/ccdiProject/index.vue +++ b/ruoyi-ui/src/views/ccdiProject/index.vue @@ -9,9 +9,8 @@ @@ -97,6 +96,13 @@ export default { projectName: null, status: null }, + // 标签页数量统计 + tabCounts: { + all: 0, + '0': 0, + '1': 0, + '2': 0 + }, // 新增/编辑弹窗 addDialogVisible: false, addDialogTitle: '新建项目', @@ -120,10 +126,23 @@ export default { this.projectList = response.rows this.total = response.total this.loading = false + // 计算标签页数量 + this.calculateTabCounts() }).catch(() => { this.loading = false }) }, + /** 计算标签页数量 */ + calculateTabCounts() { + // 注意:这里需要后端API返回所有状态的数量统计 + // 目前暂时使用当前页的数据进行计算 + this.tabCounts = { + all: this.total, + '0': this.projectList.filter(p => p.status === '0').length, + '1': this.projectList.filter(p => p.status === '1').length, + '2': this.projectList.filter(p => p.status === '2').length + } + }, /** 搜索按钮操作 */ handleQuery(queryParams) { if (queryParams) {