diff --git a/web/src/features/admin/SourcesView.vue b/web/src/features/admin/SourcesView.vue index 46d132f..9eba2d8 100644 --- a/web/src/features/admin/SourcesView.vue +++ b/web/src/features/admin/SourcesView.vue @@ -39,6 +39,12 @@ const fieldsOpen = ref(false); const fieldsLoading = ref(false); const fieldsTitle = ref(""); const fields = ref<{ name: string; type: string }[]>([]); +const fieldKeyword = ref(""); +const visibleFields = computed(() => { + const text = fieldKeyword.value.trim().toLowerCase(); + if (!text) return fields.value; + return fields.value.filter((field) => field.name.toLowerCase().includes(text)); +}); const editing = ref(null); const name = ref(""); const enabled = ref(true); @@ -104,6 +110,7 @@ const renderTableLabel: SelectRenderLabel = (option) => { async function openFields(tablename: string, title: string) { fieldsTitle.value = title || "字段"; + fieldKeyword.value = ""; fields.value = []; fieldsOpen.value = true; fieldsLoading.value = true; @@ -346,15 +353,17 @@ onMounted(load);

正在读取字段

- +

没有匹配的字段

+

没有字段

@@ -405,10 +414,10 @@ onMounted(load); .picked-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; } .picked-row strong { display: block; } .picked-row span { color: var(--muted); font-size: 12px; } +.field-panel { display: grid; gap: 8px; } .field-list { display: grid; gap: 0; - margin-top: 8px; max-height: min(48vh, 420px); overflow: auto; border: 1px solid var(--line);