|
@@ -411,7 +411,7 @@ const filteredList = computed(() => {
|
|
|
const handleSearch = () => {
|
|
|
// console.log("filteredList");
|
|
|
// console.log(filteredList.value);
|
|
|
- emit('update:searchedConditions', queries.value)
|
|
|
+ emit('update:searchedConditions', filterQueries(queries.value))
|
|
|
emit('update:searchedData', filteredList.value);
|
|
|
};
|
|
|
|
|
@@ -576,10 +576,21 @@ const truncateText = (text: string): string => {
|
|
|
return result;
|
|
|
};
|
|
|
|
|
|
+/**
|
|
|
+ * 判断是否为当前激活的查询条件
|
|
|
+ * @param index
|
|
|
+ */
|
|
|
function isActive(index) {
|
|
|
return activeIndex.value === index;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * 过滤有空值的查询条件
|
|
|
+ * @param queries
|
|
|
+ */
|
|
|
+function filterQueries(queries) {
|
|
|
+ return queries.filter(query => query.column && query.condition && query.term && query.mode);
|
|
|
+}
|
|
|
// 在组件挂载时加载选中的查询条件
|
|
|
onMounted(() => {
|
|
|
loadQuery();
|