refactor: migrate key forms to shadcn field

This commit is contained in:
hailin
2026-07-02 15:30:01 +08:00
parent 2de36c3da6
commit 09df56c21b
6 changed files with 66 additions and 35 deletions

View File

@@ -100,15 +100,16 @@ export function SolutionCreatePage() {
<div className="grid gap-4">
<AppSection title="基础信息">
<div className="grid gap-4 md:grid-cols-2">
<AppField label="方案标题">
<AppField label="方案标题" htmlFor="solution-title" required>
<Input
id="solution-title"
required
placeholder="例如:认证回调阻塞处理方案"
value={form.title}
onChange={(event) => updateField('title', event.target.value)}
/>
</AppField>
<AppField label="状态">
<AppField label="状态" required>
<Select value={form.status} onValueChange={(value) => updateField('status', value)}>
<SelectTrigger className="w-full">
<SelectValue placeholder="选择状态" />
@@ -121,15 +122,17 @@ export function SolutionCreatePage() {
</SelectContent>
</Select>
</AppField>
<AppField label="关联系统">
<AppField label="关联系统" htmlFor="solution-related-system">
<Input
id="solution-related-system"
placeholder="例如:CRM、认证中心、支付系统"
value={form.related_system}
onChange={(event) => updateField('related_system', event.target.value)}
/>
</AppField>
<AppField label="环境范围">
<AppField label="环境范围" htmlFor="solution-environment-scope">
<Input
id="solution-environment-scope"
placeholder="例如:生产环境 / Chrome"
value={form.environment_scope}
onChange={(event) => updateField('environment_scope', event.target.value)}
@@ -139,8 +142,9 @@ export function SolutionCreatePage() {
</AppSection>
<AppSection title="问题特征">
<AppField label="问题特征">
<AppField label="问题特征" htmlFor="solution-problem-signature" required>
<Textarea
id="solution-problem-signature"
required
placeholder="描述可复用的问题表现、报错特征、触发条件。"
value={form.problem_signature}
@@ -151,16 +155,18 @@ export function SolutionCreatePage() {
<AppSection title="根因与方案">
<div className="grid gap-4">
<AppField label="根因分析">
<AppField label="根因分析" htmlFor="solution-root-cause" required>
<Textarea
id="solution-root-cause"
required
placeholder="说明问题的根因或判断依据。"
value={form.root_cause}
onChange={(event) => updateField('root_cause', event.target.value)}
/>
</AppField>
<AppField label="处理方案">
<AppField label="处理方案" htmlFor="solution-content" required>
<Textarea
id="solution-content"
required
placeholder="写清楚处理步骤、验证方式和回滚注意事项。"
value={form.solution}
@@ -171,8 +177,9 @@ export function SolutionCreatePage() {
</AppSection>
<AppSection title="风险提示">
<AppField label="风险提示">
<AppField label="风险提示" htmlFor="solution-risk-note">
<Textarea
id="solution-risk-note"
placeholder="可选:说明操作风险、影响范围或上线前确认事项。"
value={form.risk_note}
onChange={(event) => updateField('risk_note', event.target.value)}