fix(daily): fix style
This commit is contained in:
81
app/person/report/components/DailyReportModal.module.css
Normal file
81
app/person/report/components/DailyReportModal.module.css
Normal file
@@ -0,0 +1,81 @@
|
||||
.modalContent {
|
||||
border-radius: 16px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
|
||||
}
|
||||
|
||||
.modalHeader {
|
||||
padding: 20px 24px 0;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.modalTitle {
|
||||
color: #1f2329;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
.modalBody {
|
||||
padding: 16px 24px 24px;
|
||||
background: #f8fafc;
|
||||
}
|
||||
|
||||
.formSurface {
|
||||
border-color: #e6ebf2;
|
||||
background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
|
||||
box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
|
||||
}
|
||||
|
||||
.formPanel :global(.mantine-InputWrapper-label) {
|
||||
color: #1f2329;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
line-height: 22px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.formPanel :global(.mantine-Input-input),
|
||||
.formPanel :global(.mantine-Select-input),
|
||||
.formPanel :global(.mantine-NumberInput-input),
|
||||
.formPanel :global(.mantine-Textarea-input) {
|
||||
min-height: 36px;
|
||||
border-color: #d0d5dd;
|
||||
background: #ffffff;
|
||||
color: #31373d;
|
||||
font-size: 14px;
|
||||
box-shadow: none;
|
||||
transition:
|
||||
border-color 0.15s ease,
|
||||
box-shadow 0.15s ease,
|
||||
background-color 0.15s ease;
|
||||
}
|
||||
|
||||
.formPanel :global(.mantine-Input-input::placeholder),
|
||||
.formPanel :global(.mantine-Select-input::placeholder),
|
||||
.formPanel :global(.mantine-NumberInput-input::placeholder),
|
||||
.formPanel :global(.mantine-Textarea-input::placeholder) {
|
||||
color: #98a2b3;
|
||||
}
|
||||
|
||||
.formPanel :global(.mantine-Input-input:focus),
|
||||
.formPanel :global(.mantine-Select-input:focus),
|
||||
.formPanel :global(.mantine-NumberInput-input:focus),
|
||||
.formPanel :global(.mantine-Textarea-input:focus) {
|
||||
border-color: #69c0ff;
|
||||
box-shadow: 0 0 0 3px rgba(105, 192, 255, 0.14);
|
||||
}
|
||||
|
||||
.formPanel :global(.mantine-Input-input[readonly]),
|
||||
.formPanel :global(.mantine-NumberInput-input[readonly]) {
|
||||
background: #f8fafc;
|
||||
color: #667085;
|
||||
}
|
||||
|
||||
.formPanel :global(.mantine-Button-root) {
|
||||
min-height: 36px;
|
||||
border-radius: 8px;
|
||||
padding-inline: 14px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
Group,
|
||||
Modal,
|
||||
NumberInput,
|
||||
Paper,
|
||||
Select,
|
||||
SimpleGrid,
|
||||
Stack,
|
||||
@@ -23,6 +24,7 @@ import {
|
||||
import { useForm } from "@mantine/form"
|
||||
import { notifications } from "@mantine/notifications"
|
||||
import { useEffect, useMemo } from "react"
|
||||
import classes from "./DailyReportModal.module.css"
|
||||
import {
|
||||
accountTypeOpts,
|
||||
actualTypeOpts,
|
||||
@@ -332,213 +334,181 @@ export default function DailyReportModal(props: {
|
||||
title={record ? "编辑日报" : "填写日报"}
|
||||
size={840}
|
||||
centered
|
||||
classNames={{
|
||||
content: classes.modalContent,
|
||||
header: classes.modalHeader,
|
||||
title: classes.modalTitle,
|
||||
body: classes.modalBody,
|
||||
}}
|
||||
overlayProps={{ backgroundOpacity: 0.22 }}
|
||||
transitionProps={{
|
||||
transition: "fade",
|
||||
duration: 100,
|
||||
timingFunction: "ease",
|
||||
}}
|
||||
closeOnClickOutside={false}>
|
||||
<form onSubmit={handleSubmit}>
|
||||
<Stack gap="sm">
|
||||
<SimpleGrid cols={{ base: 1, sm: 3 }} spacing="sm">
|
||||
<TextInput
|
||||
label="姓名"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
value={form.values.user_name}
|
||||
readOnly
|
||||
/>
|
||||
<TextInput
|
||||
label="日期"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
type="date"
|
||||
withAsterisk
|
||||
{...form.getInputProps("date")}
|
||||
/>
|
||||
<div />
|
||||
<Paper
|
||||
withBorder
|
||||
radius="lg"
|
||||
p="md"
|
||||
shadow="xs"
|
||||
className={classes.formSurface}>
|
||||
<Stack gap="md" className={classes.formPanel}>
|
||||
<SimpleGrid cols={{ base: 1, sm: 3 }} spacing="sm">
|
||||
<TextInput label="姓名" value={form.values.user_name} readOnly />
|
||||
<TextInput
|
||||
label="日期"
|
||||
type="date"
|
||||
withAsterisk
|
||||
{...form.getInputProps("date")}
|
||||
/>
|
||||
<div />
|
||||
|
||||
<TextInput
|
||||
label="开始时间"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
type="time"
|
||||
{...form.getInputProps("start_time")}
|
||||
/>
|
||||
<TextInput
|
||||
label="结束时间"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
type="time"
|
||||
{...form.getInputProps("end_time")}
|
||||
/>
|
||||
<div />
|
||||
<TextInput
|
||||
label="开始时间"
|
||||
type="time"
|
||||
{...form.getInputProps("start_time")}
|
||||
/>
|
||||
<TextInput
|
||||
label="结束时间"
|
||||
type="time"
|
||||
{...form.getInputProps("end_time")}
|
||||
/>
|
||||
<div />
|
||||
|
||||
<Select
|
||||
label="规定类型"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
withAsterisk
|
||||
data={setTypeOpts}
|
||||
searchable
|
||||
clearable
|
||||
{...form.getInputProps("set_type")}
|
||||
/>
|
||||
<Select
|
||||
label="出勤类型"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
withAsterisk
|
||||
data={actualTypeOpts}
|
||||
searchable
|
||||
clearable
|
||||
{...form.getInputProps("actual_type")}
|
||||
/>
|
||||
<div />
|
||||
<Select
|
||||
label="规定类型"
|
||||
withAsterisk
|
||||
data={setTypeOpts}
|
||||
searchable
|
||||
clearable
|
||||
{...form.getInputProps("set_type")}
|
||||
/>
|
||||
<Select
|
||||
label="出勤类型"
|
||||
withAsterisk
|
||||
data={actualTypeOpts}
|
||||
searchable
|
||||
clearable
|
||||
{...form.getInputProps("actual_type")}
|
||||
/>
|
||||
<div />
|
||||
|
||||
<Select
|
||||
label="项目名称"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
data={projectOptions}
|
||||
searchable
|
||||
clearable
|
||||
{...form.getInputProps("project_id")}
|
||||
/>
|
||||
<Select
|
||||
label="任务组长"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
data={leaderOptions}
|
||||
searchable
|
||||
clearable
|
||||
{...form.getInputProps("leader_uid")}
|
||||
/>
|
||||
<Select
|
||||
label="工作类别"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
data={workTypeOpts}
|
||||
searchable
|
||||
clearable
|
||||
{...form.getInputProps("work_type")}
|
||||
/>
|
||||
<Select
|
||||
label="项目名称"
|
||||
data={projectOptions}
|
||||
searchable
|
||||
clearable
|
||||
{...form.getInputProps("project_id")}
|
||||
/>
|
||||
<Select
|
||||
label="任务组长"
|
||||
data={leaderOptions}
|
||||
searchable
|
||||
clearable
|
||||
{...form.getInputProps("leader_uid")}
|
||||
/>
|
||||
<Select
|
||||
label="工作类别"
|
||||
data={workTypeOpts}
|
||||
searchable
|
||||
clearable
|
||||
{...form.getInputProps("work_type")}
|
||||
/>
|
||||
|
||||
<Select
|
||||
label="对象类型"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
data={objTypeOpts}
|
||||
searchable
|
||||
clearable
|
||||
{...form.getInputProps("obj_type")}
|
||||
/>
|
||||
<Select
|
||||
label="绩效核算"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
data={performanceOpts}
|
||||
searchable
|
||||
clearable
|
||||
{...form.getInputProps("performance_accounting")}
|
||||
/>
|
||||
<Select
|
||||
label="核算方式"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
data={accountTypeOpts}
|
||||
searchable
|
||||
clearable
|
||||
{...form.getInputProps("accounting_type")}
|
||||
/>
|
||||
<Select
|
||||
label="对象类型"
|
||||
data={objTypeOpts}
|
||||
searchable
|
||||
clearable
|
||||
{...form.getInputProps("obj_type")}
|
||||
/>
|
||||
<Select
|
||||
label="绩效核算"
|
||||
data={performanceOpts}
|
||||
searchable
|
||||
clearable
|
||||
{...form.getInputProps("performance_accounting")}
|
||||
/>
|
||||
<Select
|
||||
label="核算方式"
|
||||
data={accountTypeOpts}
|
||||
searchable
|
||||
clearable
|
||||
{...form.getInputProps("accounting_type")}
|
||||
/>
|
||||
|
||||
<NumberInput
|
||||
label="工时"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
min={0}
|
||||
decimalScale={1}
|
||||
allowNegative={false}
|
||||
hideControls
|
||||
rightSection={<HourRightSection />}
|
||||
rightSectionWidth={78}
|
||||
{...form.getInputProps("work_time")}
|
||||
/>
|
||||
<NumberInput
|
||||
label="额定倍速"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
min={0}
|
||||
allowNegative={false}
|
||||
hideControls
|
||||
{...form.getInputProps("rate")}
|
||||
/>
|
||||
<div />
|
||||
<NumberInput
|
||||
label="工时"
|
||||
min={0}
|
||||
decimalScale={1}
|
||||
allowNegative={false}
|
||||
hideControls
|
||||
rightSection={<HourRightSection />}
|
||||
rightSectionWidth={78}
|
||||
{...form.getInputProps("work_time")}
|
||||
/>
|
||||
<NumberInput
|
||||
label="额定倍速"
|
||||
min={0}
|
||||
allowNegative={false}
|
||||
hideControls
|
||||
{...form.getInputProps("rate")}
|
||||
/>
|
||||
<div />
|
||||
|
||||
<NumberInput
|
||||
label="标准量"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
value={form.values.standard_size}
|
||||
readOnly
|
||||
hideControls
|
||||
/>
|
||||
<NumberInput
|
||||
label="完成量"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
min={0}
|
||||
allowNegative={false}
|
||||
hideControls
|
||||
{...form.getInputProps("completed_size")}
|
||||
/>
|
||||
<div />
|
||||
<NumberInput
|
||||
label="标准量"
|
||||
value={form.values.standard_size}
|
||||
readOnly
|
||||
hideControls
|
||||
/>
|
||||
<NumberInput
|
||||
label="完成量"
|
||||
min={0}
|
||||
allowNegative={false}
|
||||
hideControls
|
||||
{...form.getInputProps("completed_size")}
|
||||
/>
|
||||
<div />
|
||||
|
||||
<NumberInput
|
||||
label="余量"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
value={form.values.residual_size}
|
||||
readOnly
|
||||
hideControls
|
||||
/>
|
||||
<NumberInput
|
||||
label="余量工时"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
value={form.values.residual_work_time}
|
||||
readOnly
|
||||
hideControls
|
||||
rightSection={<HourRightSection />}
|
||||
rightSectionWidth={78}
|
||||
/>
|
||||
<TextInput
|
||||
label="余量正负"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
value={form.values.residual_pm}
|
||||
readOnly
|
||||
/>
|
||||
</SimpleGrid>
|
||||
<NumberInput
|
||||
label="余量"
|
||||
value={form.values.residual_size}
|
||||
readOnly
|
||||
hideControls
|
||||
/>
|
||||
<NumberInput
|
||||
label="余量工时"
|
||||
value={form.values.residual_work_time}
|
||||
readOnly
|
||||
hideControls
|
||||
rightSection={<HourRightSection />}
|
||||
rightSectionWidth={78}
|
||||
/>
|
||||
<TextInput
|
||||
label="余量正负"
|
||||
value={form.values.residual_pm}
|
||||
readOnly
|
||||
/>
|
||||
</SimpleGrid>
|
||||
|
||||
<TextInput
|
||||
label="备注"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
{...form.getInputProps("remarks")}
|
||||
/>
|
||||
<TextInput label="备注" {...form.getInputProps("remarks")} />
|
||||
|
||||
<Group justify="flex-end" gap="sm">
|
||||
<Button
|
||||
variant="default"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
onClick={() => {
|
||||
form.reset()
|
||||
onCloseAction()
|
||||
}}>
|
||||
取消
|
||||
</Button>
|
||||
<Button size="xs" radius="xs" type="submit">
|
||||
提交
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
<Group justify="flex-end" gap="sm">
|
||||
<Button
|
||||
variant="default"
|
||||
onClick={() => {
|
||||
form.reset()
|
||||
onCloseAction()
|
||||
}}>
|
||||
取消
|
||||
</Button>
|
||||
<Button type="submit">提交</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Paper>
|
||||
</form>
|
||||
</Modal>
|
||||
)
|
||||
|
||||
@@ -7,15 +7,24 @@ import {
|
||||
import { Daily } from "@/components/label/api/daily/typing"
|
||||
import { getSelfProjectList } from "@/components/label/api/project"
|
||||
import { useAllUserStore } from "@/components/label/store/auth"
|
||||
import {
|
||||
SettingContentPanel,
|
||||
SettingDataTable,
|
||||
SettingFilterActions,
|
||||
SettingFilterPanel,
|
||||
SettingHeaderActions,
|
||||
SettingListHeader,
|
||||
SettingPage,
|
||||
SettingPanel,
|
||||
} from "@/components/setting/PageSurface"
|
||||
import {
|
||||
ActionIcon,
|
||||
Badge,
|
||||
Button,
|
||||
Collapse,
|
||||
Flex,
|
||||
Group,
|
||||
Modal,
|
||||
MultiSelect,
|
||||
Paper,
|
||||
SimpleGrid,
|
||||
Stack,
|
||||
Text,
|
||||
@@ -34,11 +43,7 @@ import {
|
||||
} from "@tabler/icons-react"
|
||||
|
||||
import dayjs from "dayjs"
|
||||
import {
|
||||
DataTable,
|
||||
DataTableColumn,
|
||||
DataTableSortStatus,
|
||||
} from "mantine-datatable"
|
||||
import { DataTableColumn, DataTableSortStatus } from "mantine-datatable"
|
||||
import { useCallback, useEffect, useMemo, useState } from "react"
|
||||
import DailyReportModal from "./components/DailyReportModal"
|
||||
import {
|
||||
@@ -105,6 +110,8 @@ function toNumber(value?: string) {
|
||||
return Number.isFinite(n) ? n : undefined
|
||||
}
|
||||
|
||||
const DEFAULT_RECORDS_PER_PAGE_OPTIONS = [10, 15, 20, 50]
|
||||
|
||||
export default function PersonReportPage() {
|
||||
const treeData = useAllUserStore((s) => s.treeData)
|
||||
|
||||
@@ -137,6 +144,12 @@ export default function PersonReportPage() {
|
||||
|
||||
const [page, setPage] = useState(1)
|
||||
const [pageSize, setPageSize] = useState(20)
|
||||
const [recordsPerPageOptions, setRecordsPerPageOptions] = useState<number[]>(
|
||||
() => [...DEFAULT_RECORDS_PER_PAGE_OPTIONS]
|
||||
)
|
||||
const [customPageSizeInput, setCustomPageSizeInput] = useState("")
|
||||
const [customPageSizeModalOpened, setCustomPageSizeModalOpened] =
|
||||
useState(false)
|
||||
const [totalItems, setTotalItems] = useState(0)
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [records, setRecords] = useState<Daily.DailyWorkList[]>([])
|
||||
@@ -229,6 +242,53 @@ export default function PersonReportPage() {
|
||||
})
|
||||
}, [])
|
||||
|
||||
const openCustomPageSizeModal = useCallback(() => {
|
||||
setCustomPageSizeModalOpened(true)
|
||||
}, [])
|
||||
|
||||
const closeCustomPageSizeModal = useCallback(() => {
|
||||
setCustomPageSizeModalOpened(false)
|
||||
setCustomPageSizeInput("")
|
||||
}, [])
|
||||
|
||||
const handleAddCustomPageSize = useCallback(() => {
|
||||
const rawValue = customPageSizeInput.trim()
|
||||
if (!rawValue) return
|
||||
const size = Number(rawValue)
|
||||
if (!Number.isInteger(size) || size <= 0) {
|
||||
notifications.show({
|
||||
color: "red",
|
||||
title: "输入无效",
|
||||
message: "请填写大于 0 的整数条数",
|
||||
})
|
||||
return
|
||||
}
|
||||
if (recordsPerPageOptions.includes(size)) {
|
||||
notifications.show({
|
||||
color: "blue",
|
||||
title: "已存在",
|
||||
message: `每页 ${size} 条已在可选项中`,
|
||||
})
|
||||
return
|
||||
}
|
||||
setRecordsPerPageOptions((prev) => [...prev, size].sort((a, b) => a - b))
|
||||
closeCustomPageSizeModal()
|
||||
notifications.show({
|
||||
color: "green",
|
||||
title: "添加成功",
|
||||
message: `已新增每页 ${size} 条`,
|
||||
})
|
||||
}, [closeCustomPageSizeModal, customPageSizeInput, recordsPerPageOptions])
|
||||
|
||||
const handleCustomPageSizeEnter = useCallback(
|
||||
(event: React.KeyboardEvent<HTMLInputElement>) => {
|
||||
if (event.key !== "Enter") return
|
||||
event.preventDefault()
|
||||
handleAddCustomPageSize()
|
||||
},
|
||||
[handleAddCustomPageSize]
|
||||
)
|
||||
|
||||
const columns = useMemo(() => {
|
||||
const cols: DataTableColumn<Daily.DailyWorkList>[] = [
|
||||
{ accessor: "id", title: "ID", width: 80, sortable: true },
|
||||
@@ -429,21 +489,13 @@ export default function PersonReportPage() {
|
||||
}, [asyncGetSelfProjectList])
|
||||
|
||||
return (
|
||||
<Stack w="100%" h="calc(100vh - 56px)" p="md" gap="md">
|
||||
<Paper
|
||||
withBorder
|
||||
p="md"
|
||||
radius="md"
|
||||
style={{
|
||||
borderColor:
|
||||
"light-dark(var(--mantine-color-gray-4), var(--mantine-color-dark-4))",
|
||||
}}>
|
||||
<SettingPage>
|
||||
<SettingFilterPanel>
|
||||
<Stack gap="sm">
|
||||
<Group justify="space-between" wrap="wrap" gap="sm">
|
||||
<Group gap="xs">
|
||||
<Text fw={700}>搜索条件</Text>
|
||||
<Text fw={700}>筛选条件</Text>
|
||||
<Button
|
||||
size="xs"
|
||||
variant="transparent"
|
||||
rightSection={
|
||||
searchExpanded ? (
|
||||
@@ -457,11 +509,9 @@ export default function PersonReportPage() {
|
||||
</Button>
|
||||
</Group>
|
||||
|
||||
<Group gap="sm">
|
||||
<SettingFilterActions mt={0}>
|
||||
<Button
|
||||
variant="default"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
leftSection={<IconRefresh size={16} />}
|
||||
onClick={() => {
|
||||
setFilters(defaultFilters)
|
||||
@@ -472,8 +522,6 @@ export default function PersonReportPage() {
|
||||
重置
|
||||
</Button>
|
||||
<Button
|
||||
size="xs"
|
||||
radius="xs"
|
||||
leftSection={<IconSearch size={16} />}
|
||||
onClick={() => {
|
||||
setAppliedFilters(filters)
|
||||
@@ -482,18 +530,12 @@ export default function PersonReportPage() {
|
||||
}}>
|
||||
查询
|
||||
</Button>
|
||||
</Group>
|
||||
</SettingFilterActions>
|
||||
</Group>
|
||||
<Collapse
|
||||
in={searchExpanded}
|
||||
transitionDuration={150}
|
||||
transitionTimingFunction="ease"
|
||||
animateOpacity>
|
||||
<Collapse in={searchExpanded} transitionDuration={150} animateOpacity>
|
||||
<SimpleGrid cols={{ base: 1, sm: 2, md: 3, lg: 4 }} spacing="sm">
|
||||
<TextInput
|
||||
label="开始日期"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
type="date"
|
||||
value={filters.date_start}
|
||||
onChange={(e) =>
|
||||
@@ -505,8 +547,6 @@ export default function PersonReportPage() {
|
||||
/>
|
||||
<TextInput
|
||||
label="结束日期"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
type="date"
|
||||
value={filters.date_end}
|
||||
onChange={(e) => {
|
||||
@@ -515,8 +555,6 @@ export default function PersonReportPage() {
|
||||
/>
|
||||
<MultiSelect
|
||||
label="项目名称"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
data={projectOptions}
|
||||
searchable
|
||||
clearable
|
||||
@@ -525,8 +563,6 @@ export default function PersonReportPage() {
|
||||
/>
|
||||
<MultiSelect
|
||||
label="任务组长"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
data={leaderOptions}
|
||||
searchable
|
||||
clearable
|
||||
@@ -535,8 +571,6 @@ export default function PersonReportPage() {
|
||||
/>
|
||||
<MultiSelect
|
||||
label="规定类型"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
data={setTypeOpts}
|
||||
searchable
|
||||
clearable
|
||||
@@ -547,8 +581,6 @@ export default function PersonReportPage() {
|
||||
/>
|
||||
<MultiSelect
|
||||
label="出勤类型"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
data={actualTypeOpts}
|
||||
searchable
|
||||
clearable
|
||||
@@ -559,8 +591,6 @@ export default function PersonReportPage() {
|
||||
/>
|
||||
<MultiSelect
|
||||
label="工作类别"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
data={workTypeOpts}
|
||||
searchable
|
||||
clearable
|
||||
@@ -571,8 +601,6 @@ export default function PersonReportPage() {
|
||||
/>
|
||||
<MultiSelect
|
||||
label="核算方式"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
data={accountTypeOpts}
|
||||
searchable
|
||||
clearable
|
||||
@@ -583,8 +611,6 @@ export default function PersonReportPage() {
|
||||
/>
|
||||
<MultiSelect
|
||||
label="绩效核算"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
data={performanceOpts}
|
||||
searchable
|
||||
clearable
|
||||
@@ -602,8 +628,6 @@ export default function PersonReportPage() {
|
||||
/>
|
||||
<MultiSelect
|
||||
label="对象类型"
|
||||
size="xs"
|
||||
radius="xs"
|
||||
data={objTypeOpts}
|
||||
searchable
|
||||
clearable
|
||||
@@ -615,42 +639,44 @@ export default function PersonReportPage() {
|
||||
</SimpleGrid>
|
||||
</Collapse>
|
||||
</Stack>
|
||||
</Paper>
|
||||
</SettingFilterPanel>
|
||||
|
||||
<Paper
|
||||
withBorder
|
||||
p="md"
|
||||
radius="md"
|
||||
<SettingContentPanel
|
||||
style={{
|
||||
borderColor:
|
||||
"light-dark(var(--mantine-color-gray-4), var(--mantine-color-dark-4))",
|
||||
flex: 1,
|
||||
minHeight: 0,
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
gap: 12,
|
||||
}}>
|
||||
<SettingListHeader
|
||||
title="我的日报"
|
||||
count={`${totalItems} 条`}
|
||||
actions={
|
||||
<SettingHeaderActions>
|
||||
<Button
|
||||
leftSection={<IconPlus size={16} />}
|
||||
onClick={() => {
|
||||
setEditingRecord(null)
|
||||
setModalOpened(true)
|
||||
}}>
|
||||
填写日报
|
||||
</Button>
|
||||
<Button
|
||||
variant="default"
|
||||
leftSection={<IconRefresh size={16} />}
|
||||
onClick={load}
|
||||
loading={loading}>
|
||||
刷新
|
||||
</Button>
|
||||
</SettingHeaderActions>
|
||||
}
|
||||
/>
|
||||
<Stack gap={12} align="stretch" style={{ flex: 1, minHeight: 0 }}>
|
||||
<Flex justify={"space-between"} align="center" w="100%">
|
||||
<Button
|
||||
leftSection={<IconPlus size={12} />}
|
||||
size="xs"
|
||||
radius={"xs"}
|
||||
onClick={() => {
|
||||
setEditingRecord(null)
|
||||
setModalOpened(true)
|
||||
}}>
|
||||
填写日报
|
||||
</Button>
|
||||
<ActionIcon onClick={load} variant="transparent">
|
||||
<IconRefresh size={16} />
|
||||
</ActionIcon>
|
||||
</Flex>
|
||||
<DataTable<Daily.DailyWorkList>
|
||||
<SettingDataTable<Daily.DailyWorkList>
|
||||
width="100%"
|
||||
style={{ width: "100%" }}
|
||||
withTableBorder
|
||||
withRowBorders
|
||||
minHeight={0}
|
||||
style={{ width: "100%", flex: 1 }}
|
||||
pinFirstColumn
|
||||
pinLastColumn
|
||||
scrollAreaProps={{ type: "auto" }}
|
||||
@@ -665,16 +691,35 @@ export default function PersonReportPage() {
|
||||
setPageSize(v)
|
||||
setPage(1)
|
||||
}}
|
||||
recordsPerPageOptions={[10, 15, 20, 50]}
|
||||
noRecordsText="暂无数据"
|
||||
recordsPerPageLabel="当前页数"
|
||||
recordsPerPageOptions={recordsPerPageOptions}
|
||||
sortStatus={sortStatus}
|
||||
onSortStatusChange={(s) => {
|
||||
setSortStatus(s)
|
||||
setPage(1)
|
||||
}}
|
||||
renderPagination={({ Controls }) => (
|
||||
<Group
|
||||
justify="space-between"
|
||||
align="center"
|
||||
w="100%"
|
||||
gap="sm"
|
||||
wrap="wrap">
|
||||
<Group gap="xs" align="center" wrap="wrap">
|
||||
<Controls.Text />
|
||||
<Controls.PageSizeSelector />
|
||||
<Button
|
||||
variant="light"
|
||||
color="gray"
|
||||
size="xs"
|
||||
onClick={openCustomPageSizeModal}>
|
||||
自定义每页条数
|
||||
</Button>
|
||||
</Group>
|
||||
<Controls.Pagination />
|
||||
</Group>
|
||||
)}
|
||||
/>
|
||||
<Paper withBorder radius="xs" p="sm">
|
||||
<SettingPanel radius="md" p="sm">
|
||||
<Group justify="space-between" wrap="wrap">
|
||||
<Text size="sm" fw={700}>
|
||||
当前页总计
|
||||
@@ -691,9 +736,9 @@ export default function PersonReportPage() {
|
||||
</Text>
|
||||
</Group>
|
||||
</Group>
|
||||
</Paper>
|
||||
</SettingPanel>
|
||||
</Stack>
|
||||
</Paper>
|
||||
</SettingContentPanel>
|
||||
|
||||
<DailyReportModal
|
||||
opened={modalOpened}
|
||||
@@ -705,6 +750,31 @@ export default function PersonReportPage() {
|
||||
if (refresh) load()
|
||||
}}
|
||||
/>
|
||||
</Stack>
|
||||
|
||||
<Modal
|
||||
opened={customPageSizeModalOpened}
|
||||
onClose={closeCustomPageSizeModal}
|
||||
title="添加每页条数"
|
||||
centered>
|
||||
<Stack gap="sm">
|
||||
<TextInput
|
||||
data-autofocus
|
||||
label="每页条数"
|
||||
placeholder="请输入大于 0 的整数,例如 99"
|
||||
value={customPageSizeInput}
|
||||
onChange={(event) =>
|
||||
setCustomPageSizeInput(event.currentTarget.value)
|
||||
}
|
||||
onKeyDown={handleCustomPageSizeEnter}
|
||||
/>
|
||||
<Group justify="flex-end">
|
||||
<Button variant="default" onClick={closeCustomPageSizeModal}>
|
||||
取消
|
||||
</Button>
|
||||
<Button onClick={handleAddCustomPageSize}>添加</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Modal>
|
||||
</SettingPage>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user