feat(task): task detail
This commit is contained in:
@@ -5,7 +5,7 @@ import { ProjectDetail } from "@/components/label/api/project/typing"
|
||||
import { useAllUserStore } from "@/components/label/store/auth"
|
||||
import { Button, Group, Paper, Stack, Switch, Text } from "@mantine/core"
|
||||
import { notifications } from "@mantine/notifications"
|
||||
import { useMemo, useState } from "react"
|
||||
import { JSX, useMemo, useState } from "react"
|
||||
import AdminUserModal from "./components/AdminUserModal"
|
||||
import LabelSchemeContainer from "./components/LabelSchemeContainer"
|
||||
import NoteRulesTable from "./components/NoteRulesTable"
|
||||
@@ -14,15 +14,16 @@ import TaskStageTabsContainer from "./components/TaskStageTabsContainer"
|
||||
|
||||
export default function InfoSettingContainer(props: {
|
||||
info: ProjectDetail.DataProps | undefined
|
||||
menuAction?: () => JSX.Element
|
||||
userEnums: {
|
||||
allEnum: Map<any, any>
|
||||
labelEnum: Map<any, any>
|
||||
review1Enum: Map<any, any>
|
||||
review2Enum: Map<any, any>
|
||||
}
|
||||
update: () => void
|
||||
updateAction: () => void
|
||||
}) {
|
||||
const { info, userEnums, update } = props
|
||||
const { info, menuAction, userEnums, updateAction } = props
|
||||
const projectId = info?.id ?? -1
|
||||
|
||||
const { userOpts } = useAllUserStore()
|
||||
@@ -58,7 +59,7 @@ export default function InfoSettingContainer(props: {
|
||||
title: "操作成功",
|
||||
message: "已保存配置",
|
||||
})
|
||||
update()
|
||||
updateAction()
|
||||
} catch (e) {
|
||||
notifications.show({
|
||||
color: "red",
|
||||
@@ -79,9 +80,10 @@ export default function InfoSettingContainer(props: {
|
||||
radius="md"
|
||||
style={{ borderColor: "rgba(0,0,0,0.06)" }}>
|
||||
<Stack gap="sm">
|
||||
{menuAction ? <div>{menuAction()}</div> : null}
|
||||
<Group justify="space-between" wrap="wrap">
|
||||
<Text fw={700}>基础配置</Text>
|
||||
<Button size="xs" variant="default" onClick={update}>
|
||||
<Button size="xs" variant="default" onClick={updateAction}>
|
||||
刷新项目详情
|
||||
</Button>
|
||||
</Group>
|
||||
@@ -130,13 +132,13 @@ export default function InfoSettingContainer(props: {
|
||||
info={info}
|
||||
userOptions={userOptions}
|
||||
userEnums={userEnums}
|
||||
onUpdated={update}
|
||||
onUpdatedAction={updateAction}
|
||||
/>
|
||||
|
||||
<SamplingPlanContainer
|
||||
projectId={projectId}
|
||||
info={info}
|
||||
onUpdated={update}
|
||||
onUpdated={updateAction}
|
||||
/>
|
||||
|
||||
<LabelSchemeContainer info={info} />
|
||||
@@ -148,7 +150,7 @@ export default function InfoSettingContainer(props: {
|
||||
opened={adminModalOpen}
|
||||
value={info?.admin_user ?? []}
|
||||
options={userOptions}
|
||||
onClose={async (next) => {
|
||||
onCloseAction={async (next) => {
|
||||
setAdminModalOpen(false)
|
||||
if (!next || projectId === -1) return
|
||||
try {
|
||||
@@ -158,7 +160,7 @@ export default function InfoSettingContainer(props: {
|
||||
title: "操作成功",
|
||||
message: "已保存项目管理员",
|
||||
})
|
||||
update()
|
||||
updateAction()
|
||||
} catch (e) {
|
||||
notifications.show({
|
||||
color: "red",
|
||||
|
||||
@@ -14,12 +14,13 @@ import { notifications } from "@mantine/notifications"
|
||||
import { IconRefresh } from "@tabler/icons-react"
|
||||
import { DataTable, DataTableColumn } from "mantine-datatable"
|
||||
import { useRouter, useSearchParams } from "next/navigation"
|
||||
import { useCallback, useEffect, useMemo, useState } from "react"
|
||||
import { JSX, useCallback, useEffect, useMemo, useState } from "react"
|
||||
import TaskStatusTag from "./components/TaskStatusTag"
|
||||
import { runCommand } from "./util"
|
||||
|
||||
export default function OwnTaskTableContainer(props: {
|
||||
info: ProjectDetail.DataProps | undefined
|
||||
menuAction?: () => JSX.Element
|
||||
userEnums: {
|
||||
allEnum: Map<any, any>
|
||||
labelEnum: Map<any, any>
|
||||
@@ -27,7 +28,7 @@ export default function OwnTaskTableContainer(props: {
|
||||
review2Enum: Map<any, any>
|
||||
}
|
||||
}) {
|
||||
const { info, userEnums } = props
|
||||
const { info, menuAction, userEnums } = props
|
||||
const urlParams = useSearchParams()
|
||||
const id = urlParams.get("id")
|
||||
const type = urlParams.get("type")
|
||||
@@ -40,7 +41,7 @@ export default function OwnTaskTableContainer(props: {
|
||||
const user_name = usePermissionStore((s) => s.user_name)
|
||||
const user_password = usePermissionStore((s) => s.user_password)
|
||||
|
||||
const { params, total, setParams, resetParams, setPagination, setTotal } =
|
||||
const { params, total, resetParams, setPagination, setTotal } =
|
||||
useOwnTaskStore()
|
||||
|
||||
const [form, setForm] = useState<{
|
||||
@@ -89,6 +90,7 @@ export default function OwnTaskTableContainer(props: {
|
||||
}, [form.search_id, form.search_status, params, projectId, user_id])
|
||||
|
||||
const load = useCallback(async () => {
|
||||
if (!queryTrigger) return
|
||||
if (projectId === -1) return
|
||||
setLoading(true)
|
||||
try {
|
||||
@@ -235,85 +237,90 @@ export default function OwnTaskTableContainer(props: {
|
||||
p="sm"
|
||||
radius="md"
|
||||
style={{ borderColor: "rgba(0,0,0,0.06)" }}>
|
||||
<Group justify="space-between" wrap="wrap" gap="sm">
|
||||
<Group gap="sm" wrap="wrap">
|
||||
<TextInput
|
||||
size="xs"
|
||||
label="任务ID"
|
||||
value={form.search_id}
|
||||
onChange={(e) =>
|
||||
setForm((s) => ({ ...s, search_id: e.currentTarget.value }))
|
||||
}
|
||||
style={{ width: 160 }}
|
||||
/>
|
||||
<Select
|
||||
size="xs"
|
||||
label="状态"
|
||||
data={Object.entries(OwnTaskStatusOpts).map(([value, label]) => ({
|
||||
value,
|
||||
label,
|
||||
}))}
|
||||
value={form.search_status}
|
||||
onChange={(v) =>
|
||||
setForm((s) => ({ ...s, search_status: v ?? "0" }))
|
||||
}
|
||||
allowDeselect={false}
|
||||
style={{ width: 160 }}
|
||||
/>
|
||||
<Button
|
||||
size="xs"
|
||||
leftSection={<IconRefresh size={16} />}
|
||||
loading={loading}
|
||||
onClick={() => {
|
||||
setPagination(1, params.page_size ?? 20)
|
||||
setQueryTrigger((v) => v + 1)
|
||||
}}>
|
||||
刷新
|
||||
</Button>
|
||||
</Group>
|
||||
<Stack gap="sm">
|
||||
{menuAction ? <div>{menuAction()}</div> : null}
|
||||
<Group justify="space-between" wrap="wrap" gap="sm">
|
||||
<Group gap="sm" wrap="wrap">
|
||||
<TextInput
|
||||
size="xs"
|
||||
label="任务ID"
|
||||
value={form.search_id}
|
||||
onChange={(e) =>
|
||||
setForm((s) => ({ ...s, search_id: e.currentTarget.value }))
|
||||
}
|
||||
style={{ width: 160 }}
|
||||
/>
|
||||
<Select
|
||||
size="xs"
|
||||
label="状态"
|
||||
data={Object.entries(OwnTaskStatusOpts).map(
|
||||
([value, label]) => ({
|
||||
value,
|
||||
label,
|
||||
})
|
||||
)}
|
||||
value={form.search_status}
|
||||
onChange={(v) =>
|
||||
setForm((s) => ({ ...s, search_status: v ?? "0" }))
|
||||
}
|
||||
allowDeselect={false}
|
||||
style={{ width: 160 }}
|
||||
/>
|
||||
<Button
|
||||
size="xs"
|
||||
leftSection={<IconRefresh size={16} />}
|
||||
loading={loading}
|
||||
onClick={() => {
|
||||
setPagination(1, params.page_size ?? 20)
|
||||
setQueryTrigger((v) => v + 1)
|
||||
}}>
|
||||
刷新
|
||||
</Button>
|
||||
</Group>
|
||||
|
||||
<Group gap="xs" wrap="wrap">
|
||||
<Button
|
||||
size="xs"
|
||||
variant="default"
|
||||
disabled={!isLabel}
|
||||
onClick={() => handleAcquireTask(1)}>
|
||||
领取标注
|
||||
</Button>
|
||||
<Button
|
||||
size="xs"
|
||||
variant="default"
|
||||
disabled={!isReview1}
|
||||
onClick={() => handleAcquireTask(2)}>
|
||||
领取审核
|
||||
</Button>
|
||||
<Button
|
||||
size="xs"
|
||||
variant="default"
|
||||
disabled={!isReview2}
|
||||
onClick={() => handleAcquireTask(3)}>
|
||||
领取复审
|
||||
</Button>
|
||||
<Button
|
||||
size="xs"
|
||||
variant="default"
|
||||
onClick={() => {
|
||||
resetParams()
|
||||
setForm({ search_id: "", search_status: "0" })
|
||||
setQueryTrigger((v) => v + 1)
|
||||
}}>
|
||||
重置
|
||||
</Button>
|
||||
<Button
|
||||
size="xs"
|
||||
onClick={() => {
|
||||
setPagination(1, params.page_size ?? 20)
|
||||
setQueryTrigger((v) => v + 1)
|
||||
}}>
|
||||
查询
|
||||
</Button>
|
||||
<Group gap="xs" wrap="wrap">
|
||||
<Button
|
||||
size="xs"
|
||||
variant="default"
|
||||
disabled={!isLabel}
|
||||
onClick={() => handleAcquireTask(1)}>
|
||||
领取标注
|
||||
</Button>
|
||||
<Button
|
||||
size="xs"
|
||||
variant="default"
|
||||
disabled={!isReview1}
|
||||
onClick={() => handleAcquireTask(2)}>
|
||||
领取审核
|
||||
</Button>
|
||||
<Button
|
||||
size="xs"
|
||||
variant="default"
|
||||
disabled={!isReview2}
|
||||
onClick={() => handleAcquireTask(3)}>
|
||||
领取复审
|
||||
</Button>
|
||||
<Button
|
||||
size="xs"
|
||||
variant="default"
|
||||
onClick={() => {
|
||||
resetParams()
|
||||
setForm({ search_id: "", search_status: "0" })
|
||||
setQueryTrigger((v) => v + 1)
|
||||
}}>
|
||||
重置
|
||||
</Button>
|
||||
<Button
|
||||
size="xs"
|
||||
onClick={() => {
|
||||
setPagination(1, params.page_size ?? 20)
|
||||
setQueryTrigger((v) => v + 1)
|
||||
}}>
|
||||
查询
|
||||
</Button>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Paper>
|
||||
|
||||
<Group gap={0} align="stretch" style={{ flex: 1, minHeight: 0 }}>
|
||||
|
||||
@@ -26,7 +26,7 @@ import {
|
||||
} from "@tabler/icons-react"
|
||||
import { DataTable, DataTableColumn } from "mantine-datatable"
|
||||
import { useSearchParams } from "next/navigation"
|
||||
import { useCallback, useEffect, useMemo, useState } from "react"
|
||||
import { JSX, useCallback, useEffect, useMemo, useState } from "react"
|
||||
import DispatchModal from "./components/DispatchModal"
|
||||
import ReleaseModal from "./components/ReleaseModal"
|
||||
import TaskStatusTag from "./components/TaskStatusTag"
|
||||
@@ -34,6 +34,7 @@ import WorkflowModal from "./components/WorkflowModal"
|
||||
|
||||
export default function TaskTableContainer(props: {
|
||||
info: ProjectDetail.DataProps | undefined
|
||||
menuAction?: () => JSX.Element
|
||||
userEnums: {
|
||||
allEnum: Map<any, any>
|
||||
labelEnum: Map<any, any>
|
||||
@@ -41,13 +42,17 @@ export default function TaskTableContainer(props: {
|
||||
review2Enum: Map<any, any>
|
||||
}
|
||||
}) {
|
||||
const { info, userEnums } = props
|
||||
const { info, menuAction, userEnums } = props
|
||||
false && console.log(info)
|
||||
|
||||
const urlParams = useSearchParams()
|
||||
const id = urlParams.get("id")
|
||||
const projectId =
|
||||
typeof id === "string" && !isNaN(Number(id)) ? Number(id) : -1
|
||||
|
||||
const currentUid = usePermissionStore((s) => s.user_id)
|
||||
false && console.log(currentUid)
|
||||
|
||||
const { params, total, setPagination, resetParams, setTotal } =
|
||||
useAllTaskStore()
|
||||
|
||||
@@ -101,6 +106,7 @@ export default function TaskTableContainer(props: {
|
||||
}, [form.search_id, form.search_status, params, projectId])
|
||||
|
||||
const load = useCallback(async () => {
|
||||
if (!queryTrigger) return
|
||||
if (projectId === -1) return
|
||||
setLoading(true)
|
||||
try {
|
||||
@@ -211,61 +217,66 @@ export default function TaskTableContainer(props: {
|
||||
p="sm"
|
||||
radius="md"
|
||||
style={{ borderColor: "rgba(0,0,0,0.06)" }}>
|
||||
<Group justify="space-between" wrap="wrap" gap="sm">
|
||||
<Group gap="sm" wrap="wrap">
|
||||
<TextInput
|
||||
size="xs"
|
||||
label="任务ID"
|
||||
value={form.search_id}
|
||||
onChange={(e) =>
|
||||
setForm((s) => ({ ...s, search_id: e.currentTarget.value }))
|
||||
}
|
||||
style={{ width: 160 }}
|
||||
/>
|
||||
<Select
|
||||
size="xs"
|
||||
label="状态"
|
||||
data={Object.entries(TaskStatusOpts).map(([value, label]) => ({
|
||||
value,
|
||||
label,
|
||||
}))}
|
||||
value={form.search_status}
|
||||
onChange={(v) =>
|
||||
setForm((s) => ({ ...s, search_status: v ?? "0" }))
|
||||
}
|
||||
allowDeselect={false}
|
||||
style={{ width: 160 }}
|
||||
/>
|
||||
<Button
|
||||
size="xs"
|
||||
leftSection={<IconRefresh size={16} />}
|
||||
loading={loading}
|
||||
onClick={() => setQueryTrigger((v) => v + 1)}>
|
||||
刷新
|
||||
</Button>
|
||||
</Group>
|
||||
<Stack gap="sm">
|
||||
{menuAction ? <div>{menuAction()}</div> : null}
|
||||
<Group justify="space-between" wrap="wrap" gap="sm">
|
||||
<Group gap="sm" wrap="wrap">
|
||||
<TextInput
|
||||
size="xs"
|
||||
label="任务ID"
|
||||
value={form.search_id}
|
||||
onChange={(e) =>
|
||||
setForm((s) => ({ ...s, search_id: e.currentTarget.value }))
|
||||
}
|
||||
style={{ width: 160 }}
|
||||
/>
|
||||
<Select
|
||||
size="xs"
|
||||
label="状态"
|
||||
data={Object.entries(TaskStatusOpts).map(
|
||||
([value, label]) => ({
|
||||
value,
|
||||
label,
|
||||
})
|
||||
)}
|
||||
value={form.search_status}
|
||||
onChange={(v) =>
|
||||
setForm((s) => ({ ...s, search_status: v ?? "0" }))
|
||||
}
|
||||
allowDeselect={false}
|
||||
style={{ width: 160 }}
|
||||
/>
|
||||
<Button
|
||||
size="xs"
|
||||
leftSection={<IconRefresh size={16} />}
|
||||
loading={loading}
|
||||
onClick={() => setQueryTrigger((v) => v + 1)}>
|
||||
刷新
|
||||
</Button>
|
||||
</Group>
|
||||
|
||||
<Group gap="xs" wrap="wrap">
|
||||
<Button
|
||||
size="xs"
|
||||
variant="default"
|
||||
onClick={() => {
|
||||
resetParams()
|
||||
setForm({ search_id: "", search_status: "0" })
|
||||
setQueryTrigger((v) => v + 1)
|
||||
}}>
|
||||
重置
|
||||
</Button>
|
||||
<Button
|
||||
size="xs"
|
||||
onClick={() => {
|
||||
setPagination(1, params.page_size ?? 20)
|
||||
setQueryTrigger((v) => v + 1)
|
||||
}}>
|
||||
查询
|
||||
</Button>
|
||||
<Group gap="xs" wrap="wrap">
|
||||
<Button
|
||||
size="xs"
|
||||
variant="default"
|
||||
onClick={() => {
|
||||
resetParams()
|
||||
setForm({ search_id: "", search_status: "0" })
|
||||
setQueryTrigger((v) => v + 1)
|
||||
}}>
|
||||
重置
|
||||
</Button>
|
||||
<Button
|
||||
size="xs"
|
||||
onClick={() => {
|
||||
setPagination(1, params.page_size ?? 20)
|
||||
setQueryTrigger((v) => v + 1)
|
||||
}}>
|
||||
查询
|
||||
</Button>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Paper>
|
||||
|
||||
<Group gap={0} align="stretch" style={{ flex: 1, minHeight: 0 }}>
|
||||
@@ -300,13 +311,13 @@ export default function TaskTableContainer(props: {
|
||||
<WorkflowModal
|
||||
opened={workflowTaskId !== null}
|
||||
taskId={workflowTaskId}
|
||||
onClose={() => setWorkflowTaskId(null)}
|
||||
onCloseAction={() => setWorkflowTaskId(null)}
|
||||
/>
|
||||
<DispatchModal
|
||||
opened={dispatchRecord !== null}
|
||||
record={dispatchRecord}
|
||||
userOptions={userOptions}
|
||||
onClose={(refresh) => {
|
||||
onCloseAction={(refresh) => {
|
||||
setDispatchRecord(null)
|
||||
if (refresh) setQueryTrigger((v) => v + 1)
|
||||
}}
|
||||
@@ -314,7 +325,7 @@ export default function TaskTableContainer(props: {
|
||||
<ReleaseModal
|
||||
opened={releaseRecord !== null}
|
||||
record={releaseRecord}
|
||||
onClose={(refresh) => {
|
||||
onCloseAction={(refresh) => {
|
||||
setReleaseRecord(null)
|
||||
if (refresh) setQueryTrigger((v) => v + 1)
|
||||
}}
|
||||
|
||||
@@ -8,9 +8,9 @@ export default function AdminUserModal(props: {
|
||||
opened: boolean
|
||||
value: number[]
|
||||
options: Array<{ label: string; value: string }>
|
||||
onClose: (next?: number[]) => void
|
||||
onCloseAction: (next?: number[]) => void
|
||||
}) {
|
||||
const { opened, value, options, onClose } = props
|
||||
const { opened, value, options, onCloseAction } = props
|
||||
|
||||
const form = useForm({
|
||||
initialValues: { users: value.map(String) },
|
||||
@@ -25,7 +25,7 @@ export default function AdminUserModal(props: {
|
||||
return (
|
||||
<Modal
|
||||
opened={opened}
|
||||
onClose={() => onClose()}
|
||||
onClose={() => onCloseAction()}
|
||||
title="编辑项目管理员"
|
||||
centered
|
||||
size={560}>
|
||||
@@ -34,7 +34,7 @@ export default function AdminUserModal(props: {
|
||||
const next = values.users
|
||||
.map((v) => Number(v))
|
||||
.filter((v) => Number.isFinite(v))
|
||||
onClose(next)
|
||||
onCloseAction(next)
|
||||
})}>
|
||||
<Stack gap="sm">
|
||||
<MultiSelect
|
||||
@@ -46,7 +46,7 @@ export default function AdminUserModal(props: {
|
||||
onChange={(v) => form.setFieldValue("users", v)}
|
||||
/>
|
||||
<Group justify="flex-end" gap="sm">
|
||||
<Button variant="default" onClick={() => onClose()}>
|
||||
<Button variant="default" onClick={() => onCloseAction()}>
|
||||
取消
|
||||
</Button>
|
||||
<Button type="submit">保存</Button>
|
||||
|
||||
@@ -3,7 +3,15 @@
|
||||
import { taskDispatch } from "@/components/label/api/task"
|
||||
import { Task } from "@/components/label/api/task/typing"
|
||||
import { usePermissionStore } from "@/components/label/store/auth"
|
||||
import { Button, Group, Modal, Select, Stack, Switch, Text } from "@mantine/core"
|
||||
import {
|
||||
Button,
|
||||
Group,
|
||||
Modal,
|
||||
Select,
|
||||
Stack,
|
||||
Switch,
|
||||
Text,
|
||||
} from "@mantine/core"
|
||||
import { useForm } from "@mantine/form"
|
||||
import { notifications } from "@mantine/notifications"
|
||||
import { dispatchOpts } from "../../config"
|
||||
@@ -12,9 +20,9 @@ export default function DispatchModal(props: {
|
||||
opened: boolean
|
||||
record: Task.DataProps | null
|
||||
userOptions: Array<{ label: string; value: string }>
|
||||
onClose: (refresh?: boolean) => void
|
||||
onCloseAction: (refresh?: boolean) => void
|
||||
}) {
|
||||
const { opened, record, userOptions, onClose } = props
|
||||
const { opened, record, userOptions, onCloseAction } = props
|
||||
const operation_uid = usePermissionStore((s) => s.user_id)
|
||||
|
||||
const form = useForm({
|
||||
@@ -35,13 +43,16 @@ export default function DispatchModal(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) {
|
||||
notifications.show({
|
||||
color: "red",
|
||||
@@ -85,7 +96,7 @@ export default function DispatchModal(props: {
|
||||
title: "操作成功",
|
||||
message: "已调度任务",
|
||||
})
|
||||
onClose(true)
|
||||
onCloseAction(true)
|
||||
} catch (e) {
|
||||
notifications.show({
|
||||
color: "red",
|
||||
@@ -120,11 +131,13 @@ export default function DispatchModal(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">确定</Button>
|
||||
@@ -134,4 +147,3 @@ export default function DispatchModal(props: {
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,9 @@ export default function LabelSchemeContainer(props: {
|
||||
}}
|
||||
/>
|
||||
<Text size="sm">
|
||||
{color.length >= 3 ? `${color[0]},${color[1]},${color[2]}` : "-"}
|
||||
{color.length >= 3
|
||||
? `${color[0]},${color[1]},${color[2]}`
|
||||
: "-"}
|
||||
</Text>
|
||||
</Group>
|
||||
)
|
||||
@@ -70,7 +72,11 @@ export default function LabelSchemeContainer(props: {
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<Paper withBorder p="sm" radius="md" style={{ borderColor: "rgba(0,0,0,0.06)" }}>
|
||||
<Paper
|
||||
withBorder
|
||||
p="sm"
|
||||
radius="md"
|
||||
style={{ borderColor: "rgba(0,0,0,0.06)" }}>
|
||||
<Stack gap="sm">
|
||||
<Text fw={700}>标注方案</Text>
|
||||
<DataTable<ProjectDetail.LabelSchemaList>
|
||||
@@ -85,4 +91,3 @@ export default function LabelSchemeContainer(props: {
|
||||
</Paper>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,11 @@ export default function NoteRulesTable(props: {
|
||||
const checkBoxRules = rules?.check_box_rules ?? []
|
||||
|
||||
return (
|
||||
<Paper withBorder p="sm" radius="md" style={{ borderColor: "rgba(0,0,0,0.06)" }}>
|
||||
<Paper
|
||||
withBorder
|
||||
p="sm"
|
||||
radius="md"
|
||||
style={{ borderColor: "rgba(0,0,0,0.06)" }}>
|
||||
<Stack gap="xs">
|
||||
<Text fw={700}>批注规则</Text>
|
||||
|
||||
@@ -52,4 +56,3 @@ export default function NoteRulesTable(props: {
|
||||
</Paper>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,16 @@
|
||||
|
||||
import { projectConfig } from "@/components/label/api/project"
|
||||
import { ProjectDetail } from "@/components/label/api/project/typing"
|
||||
import { Button, Checkbox, Group, NumberInput, Paper, SimpleGrid, Stack, Text } from "@mantine/core"
|
||||
import {
|
||||
Button,
|
||||
Checkbox,
|
||||
Group,
|
||||
NumberInput,
|
||||
Paper,
|
||||
SimpleGrid,
|
||||
Stack,
|
||||
Text,
|
||||
} from "@mantine/core"
|
||||
import { useForm } from "@mantine/form"
|
||||
import { notifications } from "@mantine/notifications"
|
||||
import { useEffect } from "react"
|
||||
@@ -54,9 +63,18 @@ export default function SamplingPlanContainer(props: {
|
||||
check_task: form.values.check_task,
|
||||
check_frame: form.values.check_frame,
|
||||
user_grade: {
|
||||
A: { task: toRatio(form.values.A_task), frame: toRatio(form.values.A_frame) },
|
||||
B: { task: toRatio(form.values.B_task), frame: toRatio(form.values.B_frame) },
|
||||
C: { task: toRatio(form.values.C_task), frame: toRatio(form.values.C_frame) },
|
||||
A: {
|
||||
task: toRatio(form.values.A_task),
|
||||
frame: toRatio(form.values.A_frame),
|
||||
},
|
||||
B: {
|
||||
task: toRatio(form.values.B_task),
|
||||
frame: toRatio(form.values.B_frame),
|
||||
},
|
||||
C: {
|
||||
task: toRatio(form.values.C_task),
|
||||
frame: toRatio(form.values.C_frame),
|
||||
},
|
||||
},
|
||||
})
|
||||
notifications.show({
|
||||
@@ -75,7 +93,11 @@ export default function SamplingPlanContainer(props: {
|
||||
}
|
||||
|
||||
return (
|
||||
<Paper withBorder p="sm" radius="md" style={{ borderColor: "rgba(0,0,0,0.06)" }}>
|
||||
<Paper
|
||||
withBorder
|
||||
p="sm"
|
||||
radius="md"
|
||||
style={{ borderColor: "rgba(0,0,0,0.06)" }}>
|
||||
<Stack gap="sm">
|
||||
<Group justify="space-between" wrap="wrap">
|
||||
<Text fw={700}>抽检方案</Text>
|
||||
@@ -88,12 +110,16 @@ export default function SamplingPlanContainer(props: {
|
||||
<Checkbox
|
||||
label="抽检任务"
|
||||
checked={form.values.check_task}
|
||||
onChange={(e) => form.setFieldValue("check_task", e.currentTarget.checked)}
|
||||
onChange={(e) =>
|
||||
form.setFieldValue("check_task", e.currentTarget.checked)
|
||||
}
|
||||
/>
|
||||
<Checkbox
|
||||
label="抽检帧"
|
||||
checked={form.values.check_frame}
|
||||
onChange={(e) => form.setFieldValue("check_frame", e.currentTarget.checked)}
|
||||
onChange={(e) =>
|
||||
form.setFieldValue("check_frame", e.currentTarget.checked)
|
||||
}
|
||||
/>
|
||||
</Group>
|
||||
|
||||
@@ -113,7 +139,9 @@ export default function SamplingPlanContainer(props: {
|
||||
max={100}
|
||||
decimalScale={2}
|
||||
value={form.values[`${g}_task` as const]}
|
||||
onChange={(v) => form.setFieldValue(`${g}_task` as any, Number(v ?? 0))}
|
||||
onChange={(v) =>
|
||||
form.setFieldValue(`${g}_task` as any, Number(v ?? 0))
|
||||
}
|
||||
hideControls
|
||||
/>
|
||||
<NumberInput
|
||||
@@ -122,7 +150,9 @@ export default function SamplingPlanContainer(props: {
|
||||
max={100}
|
||||
decimalScale={2}
|
||||
value={form.values[`${g}_frame` as const]}
|
||||
onChange={(v) => form.setFieldValue(`${g}_frame` as any, Number(v ?? 0))}
|
||||
onChange={(v) =>
|
||||
form.setFieldValue(`${g}_frame` as any, Number(v ?? 0))
|
||||
}
|
||||
hideControls
|
||||
/>
|
||||
</Stack>
|
||||
@@ -133,4 +163,3 @@ export default function SamplingPlanContainer(props: {
|
||||
</Paper>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@ export default function StageUserModal(props: {
|
||||
title: string
|
||||
value: number[]
|
||||
options: Array<{ label: string; value: string }>
|
||||
onClose: (next?: number[]) => void
|
||||
onCloseAction: (next?: number[]) => void
|
||||
}) {
|
||||
const { opened, title, value, options, onClose } = props
|
||||
const { opened, title, value, options, onCloseAction } = props
|
||||
|
||||
const form = useForm({
|
||||
initialValues: { users: value.map(String) },
|
||||
@@ -24,13 +24,18 @@ export default function StageUserModal(props: {
|
||||
}, [opened, value, form])
|
||||
|
||||
return (
|
||||
<Modal opened={opened} onClose={() => onClose()} title={title} centered size={560}>
|
||||
<Modal
|
||||
opened={opened}
|
||||
onClose={() => onCloseAction()}
|
||||
title={title}
|
||||
centered
|
||||
size={560}>
|
||||
<form
|
||||
onSubmit={form.onSubmit((values) => {
|
||||
const next = values.users
|
||||
.map((v) => Number(v))
|
||||
.filter((v) => Number.isFinite(v))
|
||||
onClose(next)
|
||||
onCloseAction(next)
|
||||
})}>
|
||||
<Stack gap="sm">
|
||||
<MultiSelect
|
||||
@@ -42,7 +47,7 @@ export default function StageUserModal(props: {
|
||||
onChange={(v) => form.setFieldValue("users", v)}
|
||||
/>
|
||||
<Group justify="flex-end" gap="sm">
|
||||
<Button variant="default" onClick={() => onClose()}>
|
||||
<Button variant="default" onClick={() => onCloseAction()}>
|
||||
取消
|
||||
</Button>
|
||||
<Button type="submit">保存</Button>
|
||||
@@ -52,4 +57,3 @@ export default function StageUserModal(props: {
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -15,11 +15,11 @@ function stageTitle(stage: StageKey) {
|
||||
return "复审阶段"
|
||||
}
|
||||
|
||||
function stageAction(stage: StageKey) {
|
||||
if (stage === "label") return 1
|
||||
if (stage === "review1") return 2
|
||||
return 3
|
||||
}
|
||||
// function stageAction(stage: StageKey) {
|
||||
// if (stage === "label") return 1
|
||||
// if (stage === "review1") return 2
|
||||
// return 3
|
||||
// }
|
||||
|
||||
export default function TaskStageTabsContainer(props: {
|
||||
projectId: number
|
||||
@@ -31,9 +31,9 @@ export default function TaskStageTabsContainer(props: {
|
||||
review1Enum: Map<any, any>
|
||||
review2Enum: Map<any, any>
|
||||
}
|
||||
onUpdated: () => void
|
||||
onUpdatedAction: () => void
|
||||
}) {
|
||||
const { projectId, info, userOptions, userEnums, onUpdated } = props
|
||||
const { projectId, info, userOptions, userEnums, onUpdatedAction } = props
|
||||
|
||||
const stageUsers = useMemo(() => {
|
||||
const detail = info?.label_process?.step_detail ?? []
|
||||
@@ -69,7 +69,7 @@ export default function TaskStageTabsContainer(props: {
|
||||
title: "操作成功",
|
||||
message: "已保存阶段人员",
|
||||
})
|
||||
onUpdated()
|
||||
onUpdatedAction()
|
||||
} catch (e) {
|
||||
notifications.show({
|
||||
color: "red",
|
||||
@@ -89,7 +89,11 @@ export default function TaskStageTabsContainer(props: {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Paper withBorder p="sm" radius="md" style={{ borderColor: "rgba(0,0,0,0.06)" }}>
|
||||
<Paper
|
||||
withBorder
|
||||
p="sm"
|
||||
radius="md"
|
||||
style={{ borderColor: "rgba(0,0,0,0.06)" }}>
|
||||
<Stack gap="sm">
|
||||
<Text fw={700}>任务工序配置</Text>
|
||||
<Group gap="sm" align="stretch" wrap="wrap">
|
||||
@@ -107,7 +111,10 @@ export default function TaskStageTabsContainer(props: {
|
||||
<Stack gap="xs">
|
||||
<Group justify="space-between" wrap="wrap">
|
||||
<Text fw={600}>{stageTitle(stage)}</Text>
|
||||
<Button size="xs" variant="default" onClick={() => setEditingStage(stage)}>
|
||||
<Button
|
||||
size="xs"
|
||||
variant="default"
|
||||
onClick={() => setEditingStage(stage)}>
|
||||
编辑人员
|
||||
</Button>
|
||||
</Group>
|
||||
@@ -123,10 +130,12 @@ export default function TaskStageTabsContainer(props: {
|
||||
|
||||
<StageUserModal
|
||||
opened={editingStage !== null}
|
||||
title={editingStage ? `${stageTitle(editingStage)}-人员配置` : "人员配置"}
|
||||
title={
|
||||
editingStage ? `${stageTitle(editingStage)}-人员配置` : "人员配置"
|
||||
}
|
||||
value={currentStageValue}
|
||||
options={userOptions}
|
||||
onClose={async (next) => {
|
||||
onCloseAction={async (next) => {
|
||||
const stage = editingStage
|
||||
setEditingStage(null)
|
||||
if (!stage || !next) return
|
||||
@@ -136,4 +145,3 @@ export default function TaskStageTabsContainer(props: {
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -28,9 +28,15 @@ export default function TaskStatusTag(props: {
|
||||
rejected?: boolean
|
||||
center?: boolean
|
||||
}) {
|
||||
const text = useMemo(() => TaskStatusEnum.get(props.status) || "默认", [props.status])
|
||||
const text = useMemo(
|
||||
() => TaskStatusEnum.get(props.status) || "默认",
|
||||
[props.status]
|
||||
)
|
||||
return (
|
||||
<Group gap={6} justify={props.center ? "center" : "flex-start"} wrap="nowrap">
|
||||
<Group
|
||||
gap={6}
|
||||
justify={props.center ? "center" : "flex-start"}
|
||||
wrap="nowrap">
|
||||
<Badge color={statusColor(props.status)} size="sm">
|
||||
{text}
|
||||
</Badge>
|
||||
@@ -42,4 +48,3 @@ export default function TaskStatusTag(props: {
|
||||
</Group>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ import { useEffect, useState } from "react"
|
||||
export default function WorkflowModal(props: {
|
||||
opened: boolean
|
||||
taskId: number | null
|
||||
onClose: () => void
|
||||
onCloseAction: () => void
|
||||
}) {
|
||||
const { opened, taskId, onClose } = props
|
||||
const { opened, taskId, onCloseAction } = props
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [records, setRecords] = useState<any[]>([])
|
||||
|
||||
@@ -38,7 +38,7 @@ export default function WorkflowModal(props: {
|
||||
return (
|
||||
<Modal
|
||||
opened={opened}
|
||||
onClose={onClose}
|
||||
onClose={onCloseAction}
|
||||
title="工作流"
|
||||
centered
|
||||
size={720}>
|
||||
@@ -52,7 +52,7 @@ export default function WorkflowModal(props: {
|
||||
size="sm"
|
||||
style={{
|
||||
fontFamily:
|
||||
"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace",
|
||||
'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
|
||||
whiteSpace: "pre-wrap",
|
||||
wordBreak: "break-word",
|
||||
background: "rgba(0,0,0,0.03)",
|
||||
@@ -70,7 +70,7 @@ export default function WorkflowModal(props: {
|
||||
</Stack>
|
||||
</ScrollArea>
|
||||
<Group justify="flex-end">
|
||||
<Button variant="default" onClick={onClose}>
|
||||
<Button variant="default" onClick={onCloseAction}>
|
||||
关闭
|
||||
</Button>
|
||||
</Group>
|
||||
@@ -78,4 +78,3 @@ export default function WorkflowModal(props: {
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -18,12 +18,21 @@ export const confirmOpt = [
|
||||
export const labelStageConfig: FormItemProps[] = [
|
||||
{ label: "可领取最多任务条数", name: "max_size", type: "input" },
|
||||
{ label: "单次可领取任务条数", name: "acquire_size", type: "input" },
|
||||
{ label: "标注配置更新月份", name: "label_update_month", type: "select", options: monthOpt },
|
||||
{
|
||||
label: "标注配置更新月份",
|
||||
name: "label_update_month",
|
||||
type: "select",
|
||||
options: monthOpt,
|
||||
},
|
||||
{ label: "动态标注倍速", name: "dynamic_label_speed", type: "input" },
|
||||
{ label: "静态标注倍速", name: "static_label_speed", type: "input" },
|
||||
{ label: "标注准确率", name: "label_accuracy_rate", type: "input" },
|
||||
{ label: "标注结果数量倍数", name: "avg_remind_threshold", type: "input" },
|
||||
{ label: "标注结果数量告警阈值", name: "fix_remind_threshold", type: "input" },
|
||||
{
|
||||
label: "标注结果数量告警阈值",
|
||||
name: "fix_remind_threshold",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "领取顺序",
|
||||
name: "acquire_mode",
|
||||
@@ -38,7 +47,12 @@ export const labelStageConfig: FormItemProps[] = [
|
||||
export const reviewStageConfig: FormItemProps[] = [
|
||||
{ label: "可领取最多任务条数", name: "max_size", type: "input" },
|
||||
{ label: "单次可领取任务条数", name: "acquire_size", type: "input" },
|
||||
{ label: "审核配置更新月份", name: "review1_update_month", type: "select", options: monthOpt },
|
||||
{
|
||||
label: "审核配置更新月份",
|
||||
name: "review1_update_month",
|
||||
type: "select",
|
||||
options: monthOpt,
|
||||
},
|
||||
{ label: "动态审核倍速", name: "dynamic_review1_speed", type: "input" },
|
||||
{ label: "静态审核倍速", name: "static_review1_speed", type: "input" },
|
||||
{ label: "审核准确率", name: "review1_accuracy_rate", type: "input" },
|
||||
@@ -56,7 +70,12 @@ export const reviewStageConfig: FormItemProps[] = [
|
||||
export const recheckStageConfig: FormItemProps[] = [
|
||||
{ label: "可领取最多任务条数", name: "max_size", type: "input" },
|
||||
{ label: "单次可领取任务条数", name: "acquire_size", type: "input" },
|
||||
{ label: "复审配置更新月份", name: "review2_update_month", type: "select", options: monthOpt },
|
||||
{
|
||||
label: "复审配置更新月份",
|
||||
name: "review2_update_month",
|
||||
type: "select",
|
||||
options: monthOpt,
|
||||
},
|
||||
{ label: "动态复审倍速", name: "dynamic_review2_speed", type: "input" },
|
||||
{ label: "静态复审倍速", name: "static_review2_speed", type: "input" },
|
||||
{
|
||||
@@ -69,4 +88,3 @@ export const recheckStageConfig: FormItemProps[] = [
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
@@ -2,13 +2,16 @@
|
||||
|
||||
import { getProjectDetailById } from "@/components/label/api/project"
|
||||
import { ProjectDetail } from "@/components/label/api/project/typing"
|
||||
import { useAllUserStore, useBackUrlStore } from "@/components/label/store/auth"
|
||||
import {
|
||||
useAllUserStore,
|
||||
useBackUrlStore,
|
||||
usePermissionStore,
|
||||
} from "@/components/label/store/auth"
|
||||
import {
|
||||
Breadcrumbs,
|
||||
Button,
|
||||
Group,
|
||||
Paper,
|
||||
SegmentedControl,
|
||||
Stack,
|
||||
Text,
|
||||
UnstyledButton,
|
||||
@@ -33,6 +36,12 @@ export default function CollectionDetailPage() {
|
||||
|
||||
const { backTitle, setBackProps } = useBackUrlStore()
|
||||
const { userOpts } = useAllUserStore()
|
||||
const permissions = usePermissionStore((s) => s.detailInfo?.permissions)
|
||||
|
||||
const canConfig = useMemo(() => {
|
||||
const v = permissions?.project?.config?.[0]
|
||||
return typeof v === "boolean" ? v : true
|
||||
}, [permissions])
|
||||
|
||||
const [selectKey, setSelectedKey] = useState<TabKey>(
|
||||
(backTitle as TabKey) || "own"
|
||||
@@ -131,6 +140,62 @@ export default function CollectionDetailPage() {
|
||||
))
|
||||
}, [info?.name, router, type])
|
||||
|
||||
const menuItems = useMemo(() => {
|
||||
const arr: Array<{ label: string; key: TabKey }> = [
|
||||
{ label: "我的任务", key: "own" },
|
||||
{ label: "任务列表", key: "all" },
|
||||
]
|
||||
if (canConfig) arr.push({ label: "任务配置", key: "setting" })
|
||||
return arr
|
||||
}, [canConfig])
|
||||
|
||||
useEffect(() => {
|
||||
if (menuItems.some((i) => i.key === selectKey)) return
|
||||
queueMicrotask(() => {
|
||||
setSelectedKey(menuItems[0]?.key ?? "own")
|
||||
})
|
||||
}, [menuItems, selectKey])
|
||||
|
||||
const DetailMenuItems = () => {
|
||||
return (
|
||||
<Group gap={0} wrap="nowrap">
|
||||
{menuItems.map((item, index) => {
|
||||
const active = item.key === selectKey
|
||||
return (
|
||||
<UnstyledButton
|
||||
key={item.key}
|
||||
onClick={() => {
|
||||
const next = item.key
|
||||
setSelectedKey(next)
|
||||
const backUrl = type
|
||||
? `/management/person/collection/detail?id=${projectId}&type=${type}`
|
||||
: `/management/person/collection/detail?id=${projectId}`
|
||||
setBackProps(backUrl, next)
|
||||
}}
|
||||
style={{
|
||||
paddingLeft: 14,
|
||||
paddingRight: 14,
|
||||
paddingTop: 6,
|
||||
paddingBottom: 6,
|
||||
borderTopLeftRadius: index === 0 ? 10 : 0,
|
||||
borderBottomLeftRadius: index === 0 ? 10 : 0,
|
||||
borderTopRightRadius: index === menuItems.length - 1 ? 10 : 0,
|
||||
borderBottomRightRadius:
|
||||
index === menuItems.length - 1 ? 10 : 0,
|
||||
background: active
|
||||
? "var(--mantine-color-brand-filled)"
|
||||
: "rgba(0,0,0,0.04)",
|
||||
}}>
|
||||
<Text size="sm" fw={600} c={active ? "white" : "dimmed"}>
|
||||
{item.label}
|
||||
</Text>
|
||||
</UnstyledButton>
|
||||
)
|
||||
})}
|
||||
</Group>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<Stack w="100%" h="calc(100vh - 56px)" p="md" gap="md">
|
||||
<Paper
|
||||
@@ -155,52 +220,34 @@ export default function CollectionDetailPage() {
|
||||
</Button>
|
||||
<Breadcrumbs separator=">">{breadcrumbsItems}</Breadcrumbs>
|
||||
</Group>
|
||||
<SegmentedControl
|
||||
value={selectKey}
|
||||
data={[
|
||||
{ label: "我的任务", value: "own" },
|
||||
{ label: "任务列表", value: "all" },
|
||||
{ label: "任务配置", value: "setting" },
|
||||
]}
|
||||
onChange={(v) => {
|
||||
const next = v as TabKey
|
||||
setSelectedKey(next)
|
||||
const backUrl = type
|
||||
? `/management/person/collection/detail?id=${projectId}&type=${type}`
|
||||
: `/management/person/collection/detail?id=${projectId}`
|
||||
setBackProps(backUrl, next)
|
||||
}}
|
||||
/>
|
||||
</Group>
|
||||
</Paper>
|
||||
|
||||
<Paper
|
||||
withBorder
|
||||
p="md"
|
||||
radius="md"
|
||||
style={{
|
||||
borderColor: "rgba(0,0,0,0.06)",
|
||||
flex: 1,
|
||||
minHeight: 0,
|
||||
display: "flex",
|
||||
}}>
|
||||
<Stack style={{ flex: 1, minHeight: 0 }} gap="md">
|
||||
{selectKey === "own" ? (
|
||||
<OwnTaskTableContainer info={info} userEnums={userEnums} />
|
||||
) : null}
|
||||
{selectKey === "all" ? (
|
||||
<TaskTableContainer info={info} userEnums={userEnums} />
|
||||
) : null}
|
||||
{selectKey === "board" ? <TaskBoardContainer /> : null}
|
||||
{selectKey === "setting" ? (
|
||||
<InfoSettingContainer
|
||||
info={info}
|
||||
userEnums={userEnums}
|
||||
update={updateProjectInfo}
|
||||
/>
|
||||
) : null}
|
||||
</Stack>
|
||||
</Paper>
|
||||
<Stack style={{ flex: 1, minHeight: 0 }} gap="md">
|
||||
{selectKey === "own" ? (
|
||||
<OwnTaskTableContainer
|
||||
info={info}
|
||||
userEnums={userEnums}
|
||||
menuAction={DetailMenuItems}
|
||||
/>
|
||||
) : null}
|
||||
{selectKey === "all" ? (
|
||||
<TaskTableContainer
|
||||
info={info}
|
||||
userEnums={userEnums}
|
||||
menuAction={DetailMenuItems}
|
||||
/>
|
||||
) : null}
|
||||
{selectKey === "board" ? <TaskBoardContainer /> : null}
|
||||
{selectKey === "setting" ? (
|
||||
<InfoSettingContainer
|
||||
info={info}
|
||||
userEnums={userEnums}
|
||||
updateAction={updateProjectInfo}
|
||||
menuAction={DetailMenuItems}
|
||||
/>
|
||||
) : null}
|
||||
</Stack>
|
||||
</Stack>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -66,4 +66,3 @@ export const objTypeTextMap = new Map<number, string>([
|
||||
[0, "静态"],
|
||||
[1, "动态"],
|
||||
])
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ const RightDescTools = ({ taskDetail }: ComponentProps) => {
|
||||
|
||||
useEffect(() => {
|
||||
handleFormUpdate()
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [form.values])
|
||||
|
||||
useEffect(() => {
|
||||
@@ -103,6 +104,7 @@ const RightDescTools = ({ taskDetail }: ComponentProps) => {
|
||||
setTimeout(() => {
|
||||
isUpdatingFromStore.current = false
|
||||
}, 0)
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [activeImage])
|
||||
|
||||
useEffect(() => {
|
||||
@@ -128,6 +130,7 @@ const RightDescTools = ({ taskDetail }: ComponentProps) => {
|
||||
isUpdatingFromStore.current = false
|
||||
}, 0)
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [updateDescDataFlag])
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,25 +1,21 @@
|
||||
"use client"
|
||||
|
||||
import { Task } from "../api/task/typing"
|
||||
import EditorContainer, { splitWord } from "./EditorContainer"
|
||||
import { usePermissionStore } from "../store/auth"
|
||||
import CustomModal from "./CustomModal"
|
||||
import { IconEdit } from "@tabler/icons-react"
|
||||
import {
|
||||
Button,
|
||||
Accordion,
|
||||
TextInput,
|
||||
ActionIcon,
|
||||
Box,
|
||||
Button,
|
||||
Flex,
|
||||
Group,
|
||||
NumberInput,
|
||||
Radio,
|
||||
Tooltip,
|
||||
Box,
|
||||
Flex,
|
||||
Stack,
|
||||
Text,
|
||||
ActionIcon,
|
||||
Group,
|
||||
TextInput,
|
||||
Tooltip,
|
||||
} from "@mantine/core"
|
||||
import { useForm } from "@mantine/form"
|
||||
import { IconEdit } from "@tabler/icons-react"
|
||||
import dayjs from "dayjs"
|
||||
import parse from "html-react-parser"
|
||||
import { ArrowUpIcon, ArrowUpToLineIcon } from "lucide-react"
|
||||
@@ -31,11 +27,15 @@ import {
|
||||
useMemo,
|
||||
useState,
|
||||
} from "react"
|
||||
import { getWrongWordList } from "../api/scheme"
|
||||
import { Task } from "../api/task/typing"
|
||||
import { useKeyEventStore } from "../store"
|
||||
import { usePermissionStore } from "../store/auth"
|
||||
import { useBottomToolsStore } from "../useBottomToolsStore"
|
||||
import { useDescToolsStore } from "../useDescToolsStore"
|
||||
import { useTopToolsStore } from "../useTopToolsStore"
|
||||
import { getWrongWordList } from "../api/scheme"
|
||||
import CustomModal from "./CustomModal"
|
||||
import EditorContainer, { splitWord } from "./EditorContainer"
|
||||
|
||||
interface ComponentProps {
|
||||
taskDetail?: Task.DataProps
|
||||
@@ -86,6 +86,7 @@ const RightQAContent = forwardRef(
|
||||
|
||||
const counts = useMemo(() => {
|
||||
return countAllTurnsAndQaNumber(activeImage)
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [activeImage, qaData, updateDescDataFlag, countAllTurnsAndQaNumber])
|
||||
|
||||
const [open, setOpen] = useState({
|
||||
@@ -275,7 +276,8 @@ const RightQAContent = forwardRef(
|
||||
qaData.set(currentImg, newQaData)
|
||||
setQaData(new Map(qaData)) // Force update
|
||||
updateFlag(true)
|
||||
}, [selectedQuestion, form, qaData, setQaData, updateFlag])
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [selectedQuestion, qaData, setQaData, updateFlag])
|
||||
|
||||
useImperativeHandle(ref, () => ({
|
||||
checkWrongWords,
|
||||
|
||||
@@ -23,7 +23,6 @@ export async function qr_login(
|
||||
)}&response_type=code&state=${encodeURIComponent(state)}`
|
||||
const QRLogin = (<any>window).QRLogin
|
||||
const QRLoginObj = QRLogin({
|
||||
// eslint-disable-next-line prettier/prettier
|
||||
id: "login_container",
|
||||
goto: gotoUrl,
|
||||
style: `width: 270px;height: 270px;border: 0;border-radius:12px;background-color: #E4F2FF;
|
||||
@@ -44,7 +43,6 @@ export async function qr_login(
|
||||
if (typeof window.addEventListener !== "undefined") {
|
||||
window.addEventListener("message", handleMessage, false)
|
||||
} else if (typeof (<any>window).attachEvent !== "undefined") {
|
||||
// eslint-disable-next-line prettier/prettier
|
||||
;(<any>window).attachEvent("onmessage", handleMessage)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user