fix: add error handling to Barcodes, Tasks, Logs, Sync views

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-12 21:41:50 +08:00
parent d94e416202
commit 3f8e34c07f
4 changed files with 13 additions and 5 deletions
+4 -2
View File
@@ -183,7 +183,7 @@
<script setup lang="ts">
import { ref, reactive, computed, onMounted, onUnmounted } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { Search, Refresh, Plus, Connection, Right, Setting } from '@element-plus/icons-vue'
import { Search, Refresh, Connection, Right, Setting } from '@element-plus/icons-vue'
import api from '../api'
import { useDebounce } from '../composables/useDebounce'
@@ -337,7 +337,9 @@ async function deleteItem(row: any) {
await api.delete(`/barcodes/${row.barcode}`)
ElMessage.success('已删除')
loadData()
} catch {}
} catch (err: any) {
if (err !== 'cancel') ElMessage.error('删除失败')
}
}
onMounted(loadData)