perf(format): code format

This commit is contained in:
zhangheng
2026-02-27 10:21:43 +08:00
parent 6cb8f98004
commit e3ca3e9c31
15 changed files with 257 additions and 142 deletions

View File

@@ -1,14 +1,7 @@
"use client"
import { getUserGroupAll, userAdd } from "@/components/label/api/user"
import {
Button,
Group,
Modal,
Select,
Stack,
TextInput,
} from "@mantine/core"
import { Button, Group, Modal, Select, Stack, TextInput } from "@mantine/core"
import { useForm } from "@mantine/form"
import { notifications } from "@mantine/notifications"
import { useEffect, useState } from "react"
@@ -22,9 +15,9 @@ export default function CreateUserModal({
opened,
onCloseAction,
}: ComponentProps) {
const [groupOpts, setGroupOpts] = useState<Array<{ label: string; value: string }>>(
[]
)
const [groupOpts, setGroupOpts] = useState<
Array<{ label: string; value: string }>
>([])
const [submitting, setSubmitting] = useState(false)
const form = useForm({
@@ -116,11 +109,7 @@ export default function CreateUserModal({
onClick={() => onCloseAction()}>
</Button>
<Button
type="submit"
size="xs"
radius="xs"
loading={submitting}>
<Button type="submit" size="xs" radius="xs" loading={submitting}>
</Button>
</Group>

View File

@@ -2,14 +2,7 @@
import { getUserGroupAll, userEditById } from "@/components/label/api/user"
import { User } from "@/components/label/api/user/typing"
import {
Button,
Group,
Modal,
Select,
Stack,
TextInput,
} from "@mantine/core"
import { Button, Group, Modal, Select, Stack, TextInput } from "@mantine/core"
import { useForm } from "@mantine/form"
import { notifications } from "@mantine/notifications"
import { useEffect, useMemo, useState } from "react"
@@ -25,9 +18,9 @@ export default function EditUserModal({
data,
onCloseAction,
}: ComponentProps) {
const [groupOpts, setGroupOpts] = useState<Array<{ label: string; value: string }>>(
[]
)
const [groupOpts, setGroupOpts] = useState<
Array<{ label: string; value: string }>
>([])
const [submitting, setSubmitting] = useState(false)
const groupValueByName = useMemo(() => {
@@ -153,11 +146,7 @@ export default function EditUserModal({
onClick={() => onCloseAction()}>
</Button>
<Button
type="submit"
size="xs"
radius="xs"
loading={submitting}>
<Button type="submit" size="xs" radius="xs" loading={submitting}>
</Button>
</Group>

View File

@@ -121,7 +121,9 @@ export default function ImportModal({ opened, onCloseAction }: ComponentProps) {
XLSX.utils.book_append_sheet(wb, ws, "用户信息")
wb.Sheets["用户信息"]["!rows"] = [{ hpx: 20 }, { hpx: 20 }, { hpx: 20 }]
wb.Sheets["用户信息"]["!cols"] = [{ wch: 20 }, { wch: 20 }, { wch: 20 }]
wb.Sheets["用户信息"]["!merges"] = [{ s: { c: 0, r: 0 }, e: { c: 2, r: 2 } }]
wb.Sheets["用户信息"]["!merges"] = [
{ s: { c: 0, r: 0 }, e: { c: 2, r: 2 } },
]
if (wb.Sheets["用户信息"]["A1"]) {
wb.Sheets["用户信息"]["A1"].s = { alignment: { wrapText: true } }
}
@@ -251,11 +253,7 @@ export default function ImportModal({ opened, onCloseAction }: ComponentProps) {
}}>
</Button>
<Button
size="xs"
radius="xs"
onClick={submit}
loading={submitting}>
<Button size="xs" radius="xs" onClick={submit} loading={submitting}>
</Button>
</Group>