diff --git a/apps/fronted/src/components/editor/EditPanel.tsx b/apps/fronted/src/components/editor/EditPanel.tsx
index 9a760d1..db49ac0 100644
--- a/apps/fronted/src/components/editor/EditPanel.tsx
+++ b/apps/fronted/src/components/editor/EditPanel.tsx
@@ -20,6 +20,7 @@ import { cn } from "@/lib/utils";
import { Button } from "@/components/ui/button";
import Field from "./Field";
import ProjectItem from "./project/ProjectItem";
+import BasicPanel from "./basic/BasicPanel";
interface Project {
id: string;
@@ -66,60 +67,7 @@ export function EditPanel() {
const renderFields = () => {
switch (activeSection) {
case "basic":
- return (
-
diff --git a/apps/fronted/src/components/editor/basic/BasicPanel.tsx b/apps/fronted/src/components/editor/basic/BasicPanel.tsx
new file mode 100644
index 0000000..2d45e79
--- /dev/null
+++ b/apps/fronted/src/components/editor/basic/BasicPanel.tsx
@@ -0,0 +1,159 @@
+import React, { useState } from "react";
+import { PlusCircle, X } from "lucide-react";
+import { Button } from "@/components/ui/button";
+import Field from "../Field";
+import { useResumeStore } from "@/store/useResumeStore";
+import { Input } from "@/components/ui/input";
+import { platform } from "os";
+import { cn } from "@/lib/utils";
+
+const BasicPanel = () => {
+ const { basic, updateBasicInfo, theme } = useResumeStore();
+ const [fields, setFields] = useState(basic.customFields);
+ const [newLabel, setNewLabel] = useState("");
+ const [newValue, setNewValue] = useState("");
+
+ const addCustomField = () => {
+ const newField = {
+ id: crypto.randomUUID(),
+ label: newLabel,
+ value: newValue,
+ required: false,
+ placeholder: ""
+ };
+ setFields([...fields, newField]);
+ updateBasicInfo({
+ ...basic,
+ customFields: [...fields, newField]
+ });
+ };
+
+ const updateField = (id: string, updates: { value: string }) => {
+ setFields(
+ fields.map((field) =>
+ field.id === id ? { ...field, ...updates } : field
+ )
+ );
+ updateBasicInfo({ customFields: fields });
+ };
+
+ const deleteField = (id) => {
+ setFields(fields.filter((field) => field.id !== id));
+ updateBasicInfo({
+ customFields: fields.filter((field) => field.id !== id)
+ });
+ };
+
+ return (
+
+
updateBasicInfo({ name: value })}
+ placeholder="请输入你的姓名"
+ required
+ />
+ updateBasicInfo({ title: value })}
+ placeholder="期望职位"
+ required
+ />
+ updateBasicInfo({ birthDate: value })}
+ type="date"
+ />
+
+ updateBasicInfo({ email: value })}
+ placeholder="your@email.com"
+ required
+ />
+ updateBasicInfo({ phone: value })}
+ placeholder="手机号码"
+ required
+ />
+
+ updateBasicInfo({ location: value })}
+ placeholder="城市"
+ required
+ />
+ updateBasicInfo({ summary: value })}
+ type="textarea"
+ placeholder="简单介绍一下自己..."
+ />
+
+ {/* 自定义字段 */}
+ {fields.map((field) => (
+
+ updateField(field.id, { value })}
+ placeholder={field.placeholder}
+ />
+
+
+ ))}
+
+ {/* 新字段输入区 */}
+
+
+ );
+};
+
+export default BasicPanel;
diff --git a/apps/fronted/src/store/useResumeStore.ts b/apps/fronted/src/store/useResumeStore.ts
index 2623cdf..9bed541 100644
--- a/apps/fronted/src/store/useResumeStore.ts
+++ b/apps/fronted/src/store/useResumeStore.ts
@@ -65,7 +65,8 @@ const initialState = {
phone: "13800138000",
location: "北京市",
summary: "5年前端开发经验...",
- birthDate: "1995-01-01"
+ birthDate: "1995-01-01",
+ customFields: []
},
education: [
{
diff --git a/apps/fronted/src/types/resume.ts b/apps/fronted/src/types/resume.ts
index 731f1e2..3715b7c 100644
--- a/apps/fronted/src/types/resume.ts
+++ b/apps/fronted/src/types/resume.ts
@@ -6,6 +6,13 @@ export interface BasicInfo {
phone: string;
location: string;
summary: string;
+ customFields: Array<{
+ id: string;
+ label: string;
+ value: string;
+ required: boolean;
+ placeholder: string;
+ }>;
}
export interface Education {