fix(label): submit
This commit is contained in:
@@ -2186,7 +2186,13 @@ const LabelPage = ({
|
|||||||
|
|
||||||
if (e.altKey && e.key.toLowerCase() === "x") {
|
if (e.altKey && e.key.toLowerCase() === "x") {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
if (!isView) topRef.current?.commitTaskByActionKey?.()
|
if (!isView) {
|
||||||
|
if (topRef.current?.requestSubmitTaskConfirm) {
|
||||||
|
topRef.current.requestSubmitTaskConfirm()
|
||||||
|
} else {
|
||||||
|
topRef.current?.commitTaskByActionKey?.()
|
||||||
|
}
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ const TopTools = (
|
|||||||
const [duplicateName, setDuplicateName] = useState("")
|
const [duplicateName, setDuplicateName] = useState("")
|
||||||
const [recoverOpen, setRecoverOpen] = useState(false)
|
const [recoverOpen, setRecoverOpen] = useState(false)
|
||||||
const [taskOpen, setTaskOpen] = useState(false)
|
const [taskOpen, setTaskOpen] = useState(false)
|
||||||
|
const [submitConfirmOpen, setSubmitConfirmOpen] = useState(false)
|
||||||
const [operationPickerOpened, setOperationPickerOpened] = useState(false)
|
const [operationPickerOpened, setOperationPickerOpened] = useState(false)
|
||||||
const [operationKeyword, setOperationKeyword] = useState("")
|
const [operationKeyword, setOperationKeyword] = useState("")
|
||||||
const labelData = useLabelStore((state) => state.label)
|
const labelData = useLabelStore((state) => state.label)
|
||||||
@@ -1415,6 +1416,10 @@ const TopTools = (
|
|||||||
getNextTaskData()
|
getNextTaskData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const requestSubmitTaskConfirm = useCallback(() => {
|
||||||
|
setSubmitConfirmOpen(true)
|
||||||
|
}, [])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (objectOperations.length) {
|
if (objectOperations.length) {
|
||||||
setActiveOperation(objectOperations[0].category_id.toString())
|
setActiveOperation(objectOperations[0].category_id.toString())
|
||||||
@@ -1671,6 +1676,7 @@ const TopTools = (
|
|||||||
handleSave,
|
handleSave,
|
||||||
handleBackup,
|
handleBackup,
|
||||||
commitTaskByActionKey,
|
commitTaskByActionKey,
|
||||||
|
requestSubmitTaskConfirm,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const renderEditIcon = useMemo(() => {
|
const renderEditIcon = useMemo(() => {
|
||||||
@@ -1926,7 +1932,7 @@ const TopTools = (
|
|||||||
disabled={isView}
|
disabled={isView}
|
||||||
style={{ cursor: isView ? "default" : "pointer" }}
|
style={{ cursor: isView ? "default" : "pointer" }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (!isView) commitTaskByActionKey()
|
if (!isView) requestSubmitTaskConfirm()
|
||||||
}}>
|
}}>
|
||||||
提交
|
提交
|
||||||
</UnstyledButton>
|
</UnstyledButton>
|
||||||
@@ -2554,6 +2560,20 @@ const TopTools = (
|
|||||||
handleOk={handleBackup}
|
handleOk={handleBackup}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{submitConfirmOpen && (
|
||||||
|
<ConfirmModal
|
||||||
|
open={submitConfirmOpen}
|
||||||
|
title="提交任务"
|
||||||
|
content="是否确定提交当前任务?"
|
||||||
|
onOk={async () => {
|
||||||
|
setSubmitConfirmOpen(false)
|
||||||
|
await commitTaskByActionKey()
|
||||||
|
}}
|
||||||
|
onCancel={() => {
|
||||||
|
setSubmitConfirmOpen(false)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{duplicateConfirmOpen && (
|
{duplicateConfirmOpen && (
|
||||||
<ConfirmModal
|
<ConfirmModal
|
||||||
open={duplicateConfirmOpen}
|
open={duplicateConfirmOpen}
|
||||||
|
|||||||
Reference in New Issue
Block a user