|
@@ -203,21 +203,9 @@ watch(showProjectPopover, (v) => {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const filteredProjects = computed(() => {
|
|
const filteredProjects = computed(() => {
|
|
|
- const searchText = projectSearch.value.toLowerCase();
|
|
|
|
|
- console.log('搜索文本:', searchText);
|
|
|
|
|
- console.log('所有项目数据:', allProjects.value);
|
|
|
|
|
- console.log('项目数量:', allProjects.value.length);
|
|
|
|
|
-
|
|
|
|
|
- if (allProjects.value.length > 0) {
|
|
|
|
|
- const filtered = allProjects.value.filter(
|
|
|
|
|
- (p) => p.name.toLowerCase().includes(searchText) || p?.conditioningProgramType?.toLowerCase().includes(searchText) || p.effect?.toLowerCase().includes(searchText)
|
|
|
|
|
- );
|
|
|
|
|
- console.log('过滤后的结果:', filtered);
|
|
|
|
|
- return filtered;
|
|
|
|
|
- } else {
|
|
|
|
|
- console.log('没有项目数据');
|
|
|
|
|
- return [];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ const searchText = projectSearch.value.trim().toLowerCase();
|
|
|
|
|
+ if (!searchText) return allProjects.value;
|
|
|
|
|
+ return allProjects.value.filter((p) => p.name?.toLowerCase().includes(searchText));
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
function onSelectProject({ row }: any) {
|
|
function onSelectProject({ row }: any) {
|