feat(task): task detail

This commit is contained in:
2026-02-09 18:20:33 +08:00
parent f0298b91e3
commit 3f284d057c
19 changed files with 435 additions and 279 deletions

View File

@@ -10,9 +10,9 @@ import { notifications } from "@mantine/notifications"
export default function ReleaseModal(props: {
opened: boolean
record: Task.DataProps | null
onClose: (refresh?: boolean) => void
onCloseAction: (refresh?: boolean) => void
}) {
const { opened, record, onClose } = props
const { opened, record, onCloseAction } = props
const operation_uid = usePermissionStore((s) => s.user_id)
const form = useForm({
@@ -24,13 +24,16 @@ export default function ReleaseModal(props: {
return (
<Modal
opened={opened}
onClose={() => onClose()}
onClose={() => onCloseAction()}
title="释放任务"
centered
size={520}>
<form
onSubmit={form.onSubmit(async (values) => {
const opUid = typeof operation_uid === "number" ? operation_uid : Number(operation_uid ?? 0)
const opUid =
typeof operation_uid === "number"
? operation_uid
: Number(operation_uid ?? 0)
if (!record?.id || !opUid || !record.current_uid) {
notifications.show({
color: "red",
@@ -52,7 +55,7 @@ export default function ReleaseModal(props: {
title: "操作成功",
message: "已释放任务",
})
onClose(true)
onCloseAction(true)
} catch (e) {
notifications.show({
color: "red",
@@ -68,10 +71,12 @@ export default function ReleaseModal(props: {
<Switch
label="是否返工"
checked={form.values.reject}
onChange={(e) => form.setFieldValue("reject", e.currentTarget.checked)}
onChange={(e) =>
form.setFieldValue("reject", e.currentTarget.checked)
}
/>
<Group justify="flex-end" gap="sm">
<Button variant="default" onClick={() => onClose()}>
<Button variant="default" onClick={() => onCloseAction()}>
</Button>
<Button type="submit" color="red">
@@ -83,4 +88,3 @@ export default function ReleaseModal(props: {
</Modal>
)
}