feat: 数据管理编辑行支持「清空字段=写入 NULL」

This commit is contained in:
2026-06-26 05:35:21 +08:00
parent f0bbc77763
commit ef0bfc100b
2 changed files with 6 additions and 3 deletions
+5 -2
View File
@@ -808,8 +808,11 @@ async function saveEditRow() {
if (!selectedTable.value || !editRowOriginal.value || savingRow.value) return;
savingRow.value = true;
try {
const values: Record<string, string> = {};
editRowKeys.value.forEach(key => { values[key] = editRowForm[key] ?? ''; });
const values: Record<string, string | null> = {};
editRowKeys.value.forEach(key => {
const cell = editRowForm[key] ?? '';
values[key] = cell === '' ? null : cell;
});
await apiPost('/api/database/table/row/update', {
table_name: selectedTable.value,
database_source: selectedDatabaseSource.value,