fix(label): submit
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
}}>
|
||||
提交
|
||||
</UnstyledButton>
|
||||
@@ -2554,6 +2560,20 @@ const TopTools = (
|
||||
handleOk={handleBackup}
|
||||
/>
|
||||
)}
|
||||
{submitConfirmOpen && (
|
||||
<ConfirmModal
|
||||
open={submitConfirmOpen}
|
||||
title="提交任务"
|
||||
content="是否确定提交当前任务?"
|
||||
onOk={async () => {
|
||||
setSubmitConfirmOpen(false)
|
||||
await commitTaskByActionKey()
|
||||
}}
|
||||
onCancel={() => {
|
||||
setSubmitConfirmOpen(false)
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{duplicateConfirmOpen && (
|
||||
<ConfirmModal
|
||||
open={duplicateConfirmOpen}
|
||||
|
||||
Reference in New Issue
Block a user