diff --git a/ruoyi-ui/src/views/ccdiProject/components/SearchBar.vue b/ruoyi-ui/src/views/ccdiProject/components/SearchBar.vue index d207565..60d17ac 100644 --- a/ruoyi-ui/src/views/ccdiProject/components/SearchBar.vue +++ b/ruoyi-ui/src/views/ccdiProject/components/SearchBar.vue @@ -1,62 +1,25 @@ @@ -67,74 +30,101 @@ export default { showSearch: { type: Boolean, default: true + }, + tabCounts: { + type: Object, + default: () => ({ + all: 0, + ongoing: 0, + completed: 0, + archived: 0 + }) } }, data() { return { searchKeyword: '', - selectedStatus: '', - statusOptions: [ - { label: '进行中', value: '0' }, - { label: '已完成', value: '1' }, - { label: '已归档', value: '2' } + activeTab: 'all', + tabs: [ + { label: '全部项目', value: 'all', count: 0 }, + { label: '进行中', value: 'ongoing', count: 0 }, + { label: '已完成', value: 'completed', count: 0 }, + { label: '已归档', value: 'archived', count: 0 } ] } }, + watch: { + tabCounts: { + handler(newVal) { + this.tabs = this.tabs.map(tab => ({ + ...tab, + count: newVal[tab.value] || 0 + })) + }, + immediate: true, + deep: true + } + }, methods: { /** 搜索 */ handleSearch() { this.emitQuery() }, - /** 状态变化 */ - handleStatusChange() { - this.emitQuery() - }, - /** 重置 */ - handleReset() { - this.searchKeyword = '' - this.selectedStatus = '' + /** 标签页切换 */ + handleTabChange(tabValue) { + this.activeTab = tabValue this.emitQuery() }, /** 发送查询 */ emitQuery() { this.$emit('query', { projectName: this.searchKeyword || null, - status: this.selectedStatus || null + status: this.activeTab === 'all' ? null : this.activeTab }) - }, - /** 新增 */ - handleAdd() { - this.$emit('add') - }, - /** 导入 */ - handleImport() { - this.$emit('import') } } }