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