diff --git a/components/label/LabelNossr.tsx b/components/label/LabelNossr.tsx index 356e14a..e1375f3 100644 --- a/components/label/LabelNossr.tsx +++ b/components/label/LabelNossr.tsx @@ -2186,7 +2186,13 @@ const LabelPage = ({ if (e.altKey && e.key.toLowerCase() === "x") { e.preventDefault() - if (!isView) topRef.current?.commitTaskByActionKey?.() + if (!isView) { + if (topRef.current?.requestSubmitTaskConfirm) { + topRef.current.requestSubmitTaskConfirm() + } else { + topRef.current?.commitTaskByActionKey?.() + } + } return } diff --git a/components/label/components/TopTools.tsx b/components/label/components/TopTools.tsx index 81dd0bf..8ea0c30 100644 --- a/components/label/components/TopTools.tsx +++ b/components/label/components/TopTools.tsx @@ -169,6 +169,7 @@ const TopTools = ( const [duplicateName, setDuplicateName] = useState("") const [recoverOpen, setRecoverOpen] = useState(false) const [taskOpen, setTaskOpen] = useState(false) + const [submitConfirmOpen, setSubmitConfirmOpen] = useState(false) const [operationPickerOpened, setOperationPickerOpened] = useState(false) const [operationKeyword, setOperationKeyword] = useState("") const labelData = useLabelStore((state) => state.label) @@ -1415,6 +1416,10 @@ const TopTools = ( getNextTaskData() } + const requestSubmitTaskConfirm = useCallback(() => { + setSubmitConfirmOpen(true) + }, []) + useEffect(() => { if (objectOperations.length) { setActiveOperation(objectOperations[0].category_id.toString()) @@ -1671,6 +1676,7 @@ const TopTools = ( handleSave, handleBackup, commitTaskByActionKey, + requestSubmitTaskConfirm, })) const renderEditIcon = useMemo(() => { @@ -1926,7 +1932,7 @@ const TopTools = ( disabled={isView} style={{ cursor: isView ? "default" : "pointer" }} onClick={() => { - if (!isView) commitTaskByActionKey() + if (!isView) requestSubmitTaskConfirm() }}> 提交 @@ -2554,6 +2560,20 @@ const TopTools = ( handleOk={handleBackup} /> )} + {submitConfirmOpen && ( + { + setSubmitConfirmOpen(false) + await commitTaskByActionKey() + }} + onCancel={() => { + setSubmitConfirmOpen(false) + }} + /> + )} {duplicateConfirmOpen && (