fix(fleet): guard workspace navigation with unsaved pool drafts

This commit is contained in:
2026-10-07 18:53:06 +08:00
parent 2bc095ecac
commit ba6d0ff13f
4 changed files with 74 additions and 9 deletions
@@ -50,7 +50,10 @@ function accept(value: InquiryResult) {
const commands = useCapacityInquiryCommands('capacity-offer-command', accept)
async function action(key: string, row: CapacityInquiry) { if (key === 'confirm' || key === 'cancel') await commands.run(row, key); else { editing.value = row; readonly.value = key !== 'edit'; editorOpen.value = true } }
function create() { if (!canCreate.value) return; editing.value = null; readonly.value = false; editorOpen.value = true }
watch(() => route.params.offerNo, () => { detail.value = null; editorOpen.value = false; void load() }, { immediate: true })
watch(() => [route.name, route.params.offerNo], ([name, offerNo]) => {
if (name !== 'overseas-master-data-capacity-offer-detail' || typeof offerNo !== 'string' || !offerNo) return
detail.value = null; editorOpen.value = false; void load()
}, { immediate: true })
watch([page, size], loadInquiries)
onBeforeUnmount(() => { sequence++; inquirySequence++ })
</script>