diff --git a/app/management/person/collection/detail/InfoSettingContainer.tsx b/app/management/person/collection/detail/InfoSettingContainer.tsx index 0fd9b31..bd42def 100644 --- a/app/management/person/collection/detail/InfoSettingContainer.tsx +++ b/app/management/person/collection/detail/InfoSettingContainer.tsx @@ -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 labelEnum: Map review1Enum: Map review2Enum: Map } - 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)" }}> + {menuAction ?
{menuAction()}
: null} 基础配置 - @@ -130,13 +132,13 @@ export default function InfoSettingContainer(props: { info={info} userOptions={userOptions} userEnums={userEnums} - onUpdated={update} + onUpdatedAction={updateAction} /> @@ -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", diff --git a/app/management/person/collection/detail/OwnTaskTableContainer.tsx b/app/management/person/collection/detail/OwnTaskTableContainer.tsx index 6f90a07..f0d4d6d 100644 --- a/app/management/person/collection/detail/OwnTaskTableContainer.tsx +++ b/app/management/person/collection/detail/OwnTaskTableContainer.tsx @@ -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 labelEnum: Map @@ -27,7 +28,7 @@ export default function OwnTaskTableContainer(props: { review2Enum: Map } }) { - 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)" }}> - - - - setForm((s) => ({ ...s, search_id: e.currentTarget.value })) - } - style={{ width: 160 }} - /> - ({ + value, + label, + }) + )} + value={form.search_status} + onChange={(v) => + setForm((s) => ({ ...s, search_status: v ?? "0" })) + } + allowDeselect={false} + style={{ width: 160 }} + /> + + - - - - - - + + + + + + + - +
diff --git a/app/management/person/collection/detail/TaskTableContainer.tsx b/app/management/person/collection/detail/TaskTableContainer.tsx index 4f947be..1f89716 100644 --- a/app/management/person/collection/detail/TaskTableContainer.tsx +++ b/app/management/person/collection/detail/TaskTableContainer.tsx @@ -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 labelEnum: Map @@ -41,13 +42,17 @@ export default function TaskTableContainer(props: { review2Enum: Map } }) { - 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)" }}> - - - - setForm((s) => ({ ...s, search_id: e.currentTarget.value })) - } - style={{ width: 160 }} - /> - ({ + value, + label, + }) + )} + value={form.search_status} + onChange={(v) => + setForm((s) => ({ ...s, search_status: v ?? "0" })) + } + allowDeselect={false} + style={{ width: 160 }} + /> + + - - - + + + + - + @@ -300,13 +311,13 @@ export default function TaskTableContainer(props: { setWorkflowTaskId(null)} + onCloseAction={() => setWorkflowTaskId(null)} /> { + onCloseAction={(refresh) => { setDispatchRecord(null) if (refresh) setQueryTrigger((v) => v + 1) }} @@ -314,7 +325,7 @@ export default function TaskTableContainer(props: { { + onCloseAction={(refresh) => { setReleaseRecord(null) if (refresh) setQueryTrigger((v) => v + 1) }} diff --git a/app/management/person/collection/detail/components/AdminUserModal.tsx b/app/management/person/collection/detail/components/AdminUserModal.tsx index df13c2b..f18eee0 100644 --- a/app/management/person/collection/detail/components/AdminUserModal.tsx +++ b/app/management/person/collection/detail/components/AdminUserModal.tsx @@ -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 ( 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) })}> form.setFieldValue("users", v)} /> - diff --git a/app/management/person/collection/detail/components/DispatchModal.tsx b/app/management/person/collection/detail/components/DispatchModal.tsx index 2774cf8..0e2e3f5 100644 --- a/app/management/person/collection/detail/components/DispatchModal.tsx +++ b/app/management/person/collection/detail/components/DispatchModal.tsx @@ -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 ( onClose()} + onClose={() => onCloseAction()} title="调度任务" centered size={520}>
{ - 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: { form.setFieldValue("reject", e.currentTarget.checked)} + onChange={(e) => + form.setFieldValue("reject", e.currentTarget.checked) + } /> - @@ -134,4 +147,3 @@ export default function DispatchModal(props: { ) } - diff --git a/app/management/person/collection/detail/components/LabelSchemeContainer.tsx b/app/management/person/collection/detail/components/LabelSchemeContainer.tsx index 185bcf2..702a526 100644 --- a/app/management/person/collection/detail/components/LabelSchemeContainer.tsx +++ b/app/management/person/collection/detail/components/LabelSchemeContainer.tsx @@ -36,7 +36,9 @@ export default function LabelSchemeContainer(props: { }} /> - {color.length >= 3 ? `${color[0]},${color[1]},${color[2]}` : "-"} + {color.length >= 3 + ? `${color[0]},${color[1]},${color[2]}` + : "-"} ) @@ -70,7 +72,11 @@ export default function LabelSchemeContainer(props: { }, []) return ( - + 标注方案 @@ -85,4 +91,3 @@ export default function LabelSchemeContainer(props: { ) } - diff --git a/app/management/person/collection/detail/components/NoteRulesTable.tsx b/app/management/person/collection/detail/components/NoteRulesTable.tsx index 4457b4a..b9eec14 100644 --- a/app/management/person/collection/detail/components/NoteRulesTable.tsx +++ b/app/management/person/collection/detail/components/NoteRulesTable.tsx @@ -11,7 +11,11 @@ export default function NoteRulesTable(props: { const checkBoxRules = rules?.check_box_rules ?? [] return ( - + 批注规则 @@ -52,4 +56,3 @@ export default function NoteRulesTable(props: { ) } - diff --git a/app/management/person/collection/detail/components/ReleaseModal.tsx b/app/management/person/collection/detail/components/ReleaseModal.tsx index 35d8b13..adc0106 100644 --- a/app/management/person/collection/detail/components/ReleaseModal.tsx +++ b/app/management/person/collection/detail/components/ReleaseModal.tsx @@ -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 ( onClose()} + onClose={() => onCloseAction()} title="释放任务" centered size={520}> { - 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: { form.setFieldValue("reject", e.currentTarget.checked)} + onChange={(e) => + form.setFieldValue("reject", e.currentTarget.checked) + } /> - @@ -52,4 +57,3 @@ export default function StageUserModal(props: { ) } - diff --git a/app/management/person/collection/detail/components/TaskStageTabsContainer.tsx b/app/management/person/collection/detail/components/TaskStageTabsContainer.tsx index c1bf20c..d288aaf 100644 --- a/app/management/person/collection/detail/components/TaskStageTabsContainer.tsx +++ b/app/management/person/collection/detail/components/TaskStageTabsContainer.tsx @@ -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 review2Enum: Map } - 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 ( <> - + 任务工序配置 @@ -107,7 +111,10 @@ export default function TaskStageTabsContainer(props: { {stageTitle(stage)} - @@ -123,10 +130,12 @@ export default function TaskStageTabsContainer(props: { { + onCloseAction={async (next) => { const stage = editingStage setEditingStage(null) if (!stage || !next) return @@ -136,4 +145,3 @@ export default function TaskStageTabsContainer(props: { ) } - diff --git a/app/management/person/collection/detail/components/TaskStatusTag.tsx b/app/management/person/collection/detail/components/TaskStatusTag.tsx index 92b90b6..faacbd4 100644 --- a/app/management/person/collection/detail/components/TaskStatusTag.tsx +++ b/app/management/person/collection/detail/components/TaskStatusTag.tsx @@ -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 ( - + {text} @@ -42,4 +48,3 @@ export default function TaskStatusTag(props: { ) } - diff --git a/app/management/person/collection/detail/components/WorkflowModal.tsx b/app/management/person/collection/detail/components/WorkflowModal.tsx index 5f1b8ff..1bf5df6 100644 --- a/app/management/person/collection/detail/components/WorkflowModal.tsx +++ b/app/management/person/collection/detail/components/WorkflowModal.tsx @@ -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([]) @@ -38,7 +38,7 @@ export default function WorkflowModal(props: { return ( @@ -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: { - @@ -78,4 +78,3 @@ export default function WorkflowModal(props: { ) } - diff --git a/app/management/person/collection/detail/components/config.ts b/app/management/person/collection/detail/components/config.ts index 4677bd3..b2f679d 100644 --- a/app/management/person/collection/detail/components/config.ts +++ b/app/management/person/collection/detail/components/config.ts @@ -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[] = [ ], }, ] - diff --git a/app/management/person/collection/detail/page.tsx b/app/management/person/collection/detail/page.tsx index 8af8824..2372543 100644 --- a/app/management/person/collection/detail/page.tsx +++ b/app/management/person/collection/detail/page.tsx @@ -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( (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 ( + + {menuItems.map((item, index) => { + const active = item.key === selectKey + return ( + { + 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)", + }}> + + {item.label} + + + ) + })} + + ) + } + return ( {breadcrumbsItems} - { - 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) - }} - /> - - - {selectKey === "own" ? ( - - ) : null} - {selectKey === "all" ? ( - - ) : null} - {selectKey === "board" ? : null} - {selectKey === "setting" ? ( - - ) : null} - - + + {selectKey === "own" ? ( + + ) : null} + {selectKey === "all" ? ( + + ) : null} + {selectKey === "board" ? : null} + {selectKey === "setting" ? ( + + ) : null} + ) } diff --git a/app/management/person/report/config.ts b/app/management/person/report/config.ts index 72dcbb0..8763169 100644 --- a/app/management/person/report/config.ts +++ b/app/management/person/report/config.ts @@ -66,4 +66,3 @@ export const objTypeTextMap = new Map([ [0, "静态"], [1, "动态"], ]) - diff --git a/components/label/components/RightDescTools.tsx b/components/label/components/RightDescTools.tsx index 05cc5e0..caa8de8 100644 --- a/components/label/components/RightDescTools.tsx +++ b/components/label/components/RightDescTools.tsx @@ -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 ( diff --git a/components/label/components/RightQATools.tsx b/components/label/components/RightQATools.tsx index b243649..3ccd2f0 100644 --- a/components/label/components/RightQATools.tsx +++ b/components/label/components/RightQATools.tsx @@ -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, diff --git a/components/login/feishu/util.ts b/components/login/feishu/util.ts index dc6e5d5..4fe5b94 100644 --- a/components/login/feishu/util.ts +++ b/components/login/feishu/util.ts @@ -23,7 +23,6 @@ export async function qr_login( )}&response_type=code&state=${encodeURIComponent(state)}` const QRLogin = (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 (window).attachEvent !== "undefined") { - // eslint-disable-next-line prettier/prettier ;(window).attachEvent("onmessage", handleMessage) } }