This commit is contained in:
2026-08-07 20:07:37 +08:00
parent 28d0b81c5a
commit 99413ee155
27 changed files with 1065 additions and 595 deletions
@@ -56,6 +56,7 @@ const queryFields = computed<QueryField[]>(() => [
},
])
let loadSequence = 0
let editorLoadSequence = 0
const emptyForm = (): SavePlatformExpressCompanyRequest & { id: string } => ({
id: '',
@@ -161,6 +162,7 @@ function applyFilters(model: QueryModel) {
}
function openCreate() {
editorLoadSequence += 1
Object.assign(form, emptyForm())
captureBaseline()
editorOpen.value = true
@@ -184,13 +186,17 @@ function assignEditor(row: PlatformExpressCompanyResource) {
}
async function openEdit(row: PlatformExpressCompanyResource) {
const sequence = ++editorLoadSequence
const id = String(row.id)
const pending = new Set(editLoadingIds.value)
pending.add(id)
editLoadingIds.value = pending
try {
assignEditor(await getPlatformExpressCompany(row.id))
const result = await getPlatformExpressCompany(row.id)
if (sequence !== editorLoadSequence) return
assignEditor(result)
} catch (error) {
if (sequence !== editorLoadSequence) return
const details = getApiErrorDetails(error, '快递公司详情加载失败,请稍后重试')
ElMessage.error(details.requestId ? `${details.message}(requestId: ${details.requestId})` : details.message)
} finally {