chore: rename web client to web_v1

This commit is contained in:
2026-07-21 11:24:27 +08:00
parent 465e7bea9b
commit ad6dcd6de4
101 changed files with 24 additions and 5537 deletions

View File

@@ -0,0 +1,93 @@
import { Input, Modal, Select, Space, Switch, Typography } from '@arco-design/web-react'
import { useEffect, useMemo, useState } from 'react'
import type { ProjectWorkspace, TaskItem } from './project-types'
const { Text } = Typography
const { TextArea } = Input
export type ProjectTaskUpdate = {
taskId: string
title: string
summary: string
tag: string
completed: boolean
}
type TaskDraft = {
title: string
summary: string
tag: string
completed: boolean
}
export function ProjectTaskEditModal({
task,
workspace,
onClose,
onSubmit,
}: {
task: TaskItem | null
workspace: ProjectWorkspace
onClose: () => void
onSubmit: (update: ProjectTaskUpdate) => void
}) {
const tagOptions = useMemo(() => workspace.tags.filter((tag) => tag !== 'all' && tag !== '全部'), [workspace.tags])
const [draft, setDraft] = useState<TaskDraft>({ title: '', summary: '', tag: '', completed: false })
useEffect(() => {
if (!task) return
setDraft({
title: task.title,
summary: task.summary,
tag: task.tag,
completed: task.completed,
})
}, [task])
return (
<Modal
className="action-modal"
title="编辑计划"
visible={Boolean(task)}
onCancel={onClose}
onOk={() => {
if (!task) return
onSubmit({
taskId: task.id,
title: draft.title.trim() || task.title,
summary: draft.summary.trim(),
tag: draft.tag.trim(),
completed: draft.completed,
})
}}
>
<Space direction="vertical" size={12} className="action-form">
<label>
<Text></Text>
<Input value={draft.title} onChange={(title) => setDraft((value) => ({ ...value, title }))} />
</label>
<label>
<Text></Text>
<TextArea rows={4} value={draft.summary} onChange={(summary) => setDraft((value) => ({ ...value, summary }))} />
</label>
<label>
<Text></Text>
<Select
allowClear
value={draft.tag || undefined}
placeholder="不设置标签"
onChange={(tag) => setDraft((value) => ({ ...value, tag: tag ?? '' }))}
>
{tagOptions.map((tag) => (
<Select.Option key={tag} value={tag}>{tag}</Select.Option>
))}
</Select>
</label>
<label className="action-switch">
<Text></Text>
<Switch checked={draft.completed} checkedText="完成" uncheckedText="未完成" onChange={(completed) => setDraft((value) => ({ ...value, completed }))} />
</label>
</Space>
</Modal>
)
}