1 line
16 KiB
JavaScript
1 line
16 KiB
JavaScript
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,26922,e=>{"use strict";let s=(0,e.i(27706).default)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);e.s(["Upload",()=>s],26922)},74665,8204,e=>{"use strict";var s=e.i(27706);let a=(0,s.default)("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);e.s(["CircleUser",()=>a],74665);let r=(0,s.default)("CircleUserRound",[["path",{d:"M18 20a6 6 0 0 0-12 0",key:"1qehca"}],["circle",{cx:"12",cy:"10",r:"4",key:"1h16sb"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["CircleUserRound",()=>r],8204)},35904,34420,e=>{"use strict";var s=e.i(36792),a=e.i(69744);function r({className:e,...r}){return(0,s.jsx)("textarea",{"data-slot":"textarea",className:(0,a.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...r})}e.s(["Textarea",()=>r],35904);let t=(0,e.i(27706).default)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",()=>t],34420)},78657,e=>{"use strict";let s=(0,e.i(27706).default)("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);e.s(["ZoomIn",()=>s],78657)},43359,e=>{"use strict";let s=(0,e.i(27706).default)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);e.s(["Users",()=>s],43359)},21446,e=>{"use strict";let s=(0,e.i(27706).default)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",()=>s],21446)},49326,e=>{"use strict";let s=(0,e.i(27706).default)("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);e.s(["default",()=>s])},90432,7790,e=>{"use strict";var s=e.i(36792),a=e.i(97185),r=e.i(6315),r=r,t=e.i(69744);function d({...e}){return(0,s.jsx)(a.Root,{"data-slot":"dialog",...e})}function l({...e}){return(0,s.jsx)(a.Trigger,{"data-slot":"dialog-trigger",...e})}function i({...e}){return(0,s.jsx)(a.Portal,{"data-slot":"dialog-portal",...e})}function n({className:e,...r}){return(0,s.jsx)(a.Overlay,{"data-slot":"dialog-overlay",className:(0,t.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...r})}function o({className:e,children:d,showCloseButton:l=!0,...o}){return(0,s.jsxs)(i,{"data-slot":"dialog-portal",children:[(0,s.jsx)(n,{}),(0,s.jsxs)(a.Content,{"data-slot":"dialog-content",className:(0,t.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...o,children:[d,l&&(0,s.jsxs)(a.Close,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,s.jsx)(r.default,{}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function c({className:e,...a}){return(0,s.jsx)("div",{"data-slot":"dialog-header",className:(0,t.cn)("flex flex-col gap-2 text-center sm:text-left",e),...a})}function m({className:e,...a}){return(0,s.jsx)("div",{"data-slot":"dialog-footer",className:(0,t.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...a})}function x({className:e,...r}){return(0,s.jsx)(a.Title,{"data-slot":"dialog-title",className:(0,t.cn)("text-lg leading-none font-semibold",e),...r})}function h({className:e,...r}){return(0,s.jsx)(a.Description,{"data-slot":"dialog-description",className:(0,t.cn)("text-muted-foreground text-sm",e),...r})}e.s(["Dialog",()=>d,"DialogContent",()=>o,"DialogDescription",()=>h,"DialogFooter",()=>m,"DialogHeader",()=>c,"DialogTitle",()=>x,"DialogTrigger",()=>l],90432);let u=(0,e.i(27706).default)("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);e.s(["Edit",()=>u],7790)},91258,e=>{"use strict";var s=e.i(49326);e.s(["Calendar",()=>s.default])},30869,e=>{"use strict";var s=e.i(36792),a=e.i(3965),r=e.i(69074),t=e.i(92879),d=e.i(82772),l=e.i(23951),i=e.i(9991),n=e.i(34420),o=e.i(7790),c=e.i(432),m=e.i(27706);let x=(0,m.default)("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),h=(0,m.default)("Printer",[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]);var u=e.i(74665),f=e.i(8204),g=e.i(42469),p=e.i(27458),j=e.i(34346),b=e.i(76584),y=e.i(62345),N=e.i(76637),v=e.i(75212);function k(){let{id:e}=(0,r.useParams)(),{getMember:m,updateMember:k,deleteMember:w}=(0,t.useFamily)(),{showConfirm:I}=(0,v.useDialog)(),C=(0,r.useRouter)(),[M,U]=(0,j.useState)(!1),[D,z]=(0,j.useState)(void 0),H=m(e);if((0,j.useEffect)(()=>{H?.avatarImageId?b.db.images.get(H.avatarImageId).then(e=>{if(e){let s=URL.createObjectURL(e.blob);return z(s),()=>URL.revokeObjectURL(s)}}):z(void 0)},[H?.avatarImageId]),!H)return(0,s.jsxs)("div",{className:"min-h-screen flex flex-col bg-background",children:[(0,s.jsx)(d.SiteHeader,{}),(0,s.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center gap-4",children:[(0,s.jsx)("p",{className:"text-muted-foreground",children:"Member not found"}),(0,s.jsx)(i.Button,{onClick:()=>C.push("/members"),children:"Back to List"})]})]});let R=async()=>{await I("确定要删除这位成员吗?这将同时删除其关联关系。","删除成员","destructive")&&(w(H.id),C.push("/members"))};return M?(0,s.jsxs)("div",{className:"min-h-screen flex flex-col bg-background",children:[(0,s.jsx)(d.SiteHeader,{}),(0,s.jsxs)("div",{className:"container mx-auto py-8",children:[(0,s.jsxs)("div",{className:"mb-6 flex items-center gap-2",children:[(0,s.jsxs)(i.Button,{variant:"ghost",onClick:()=>U(!1),children:[(0,s.jsx)(n.ArrowLeft,{className:"mr-2 h-4 w-4"})," 返回"]}),(0,s.jsxs)("h1",{className:"text-2xl font-bold font-serif",children:["编辑成员: ",H.fullName]})]}),(0,s.jsx)(l.MemberForm,{initialData:H,onSubmit:e=>{k(e.id,e),U(!1)},onCancel:()=>U(!1)})]})]}):(0,s.jsxs)("div",{className:"min-h-screen flex flex-col bg-background",children:[(0,s.jsx)(d.SiteHeader,{}),(0,s.jsxs)("main",{className:"container mx-auto py-8 px-4 md:px-6",children:[(0,s.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-start gap-6 mb-8 border-b border-border pb-8",children:[(0,s.jsxs)("div",{className:"flex items-start gap-6",children:[(0,s.jsx)("div",{className:"h-32 w-32 rounded-lg bg-muted flex items-center justify-center border-2 border-primary/20 overflow-hidden",children:D?(0,s.jsx)("img",{src:D,alt:H.fullName,className:"h-full w-full object-cover"}):"FEMALE"===H.gender?(0,s.jsx)(f.CircleUserRound,{className:"h-20 w-20 text-pink-400"}):(0,s.jsx)(u.CircleUser,{className:"h-20 w-20 text-blue-400"})}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,s.jsx)("h1",{className:"text-4xl font-bold font-serif text-foreground",children:H.fullName}),(0,s.jsxs)("span",{className:"px-2 py-1 bg-primary/10 text-primary text-sm font-medium rounded-full border border-primary/20",children:[H.generation,"世"]})]}),(0,s.jsxs)("div",{className:"space-y-1 text-muted-foreground",children:[H.courtesyName&&(0,s.jsxs)("p",{children:["字:",(0,s.jsx)("span",{className:"text-foreground",children:H.courtesyName})]}),H.artName&&(0,s.jsxs)("p",{children:["号:",(0,s.jsx)("span",{className:"text-foreground",children:H.artName})]}),H.ancestralHome&&(0,s.jsxs)("p",{children:["籍贯:",H.ancestralHome]})]})]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.Button,{variant:"outline",size:"icon",onClick:()=>window.print(),children:(0,s.jsx)(h,{className:"h-4 w-4"})}),(0,s.jsx)(i.Button,{variant:"outline",size:"icon",children:(0,s.jsx)(x,{className:"h-4 w-4"})}),(0,s.jsxs)(i.Button,{variant:"outline",onClick:()=>U(!0),className:"gap-2",children:[(0,s.jsx)(o.Edit,{className:"h-4 w-4"})," 编辑"]}),(0,s.jsx)(i.Button,{variant:"destructive",size:"icon",onClick:R,children:(0,s.jsx)(c.Trash,{className:"h-4 w-4"})})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[(0,s.jsxs)("div",{className:"lg:col-span-2 space-y-8",children:[(0,s.jsxs)("section",{children:[(0,s.jsxs)("h2",{className:"text-2xl font-serif font-bold mb-4 flex items-center gap-2",children:[(0,s.jsx)("span",{className:"w-1 h-6 bg-primary rounded-full"}),"生平事迹"]}),(0,s.jsx)("div",{className:"prose prose-stone dark:prose-invert max-w-none bg-card p-6 rounded-lg border border-border shadow-sm",children:H.bio?(0,s.jsx)("p",{className:"whitespace-pre-line leading-relaxed",children:H.bio}):(0,s.jsx)("p",{className:"text-muted-foreground italic",children:"暂无生平记录..."})})]}),H.photoIds&&H.photoIds.length>0&&(0,s.jsxs)("section",{children:[(0,s.jsxs)("h2",{className:"text-2xl font-serif font-bold mb-4 flex items-center gap-2",children:[(0,s.jsx)(g.Images,{className:"h-6 w-6 text-primary"}),"照片墙"]}),(0,s.jsx)("div",{className:"bg-card p-6 rounded-lg border border-border shadow-sm",children:(0,s.jsx)(y.PhotoGallery,{photoIds:H.photoIds,onChange:e=>k(H.id,{photoIds:e}),readonly:!1})})]}),H.stories&&H.stories.length>0&&(0,s.jsxs)("section",{children:[(0,s.jsxs)("h2",{className:"text-2xl font-serif font-bold mb-4 flex items-center gap-2",children:[(0,s.jsx)(p.BookOpen,{className:"h-6 w-6 text-primary"}),"家族故事"]}),(0,s.jsx)("div",{className:"bg-card p-6 rounded-lg border border-border shadow-sm",children:(0,s.jsx)(N.StoryManager,{stories:H.stories,onChange:e=>k(H.id,{stories:e}),readonly:!1})})]}),(0,s.jsxs)("section",{children:[(0,s.jsxs)("h2",{className:"text-2xl font-serif font-bold mb-4 flex items-center gap-2",children:[(0,s.jsx)("span",{className:"w-1 h-6 bg-secondary rounded-full"}),"家族关系"]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"bg-card p-4 rounded-lg border border-border",children:[(0,s.jsx)("h3",{className:"font-medium text-muted-foreground mb-2 text-sm uppercase tracking-wider",children:"父亲 (Father)"}),H.fatherId?(0,s.jsx)(a.default,{href:`/members/${H.fatherId}`,className:"text-lg font-serif font-bold hover:underline text-primary",children:m(H.fatherId)?.fullName||H.fatherId}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"-"})]}),(0,s.jsxs)("div",{className:"bg-card p-4 rounded-lg border border-border",children:[(0,s.jsx)("h3",{className:"font-medium text-muted-foreground mb-2 text-sm uppercase tracking-wider",children:"母亲 (Mother)"}),H.motherId?(0,s.jsx)(a.default,{href:`/members/${H.motherId}`,className:"text-lg font-serif font-bold hover:underline text-primary",children:m(H.motherId)?.fullName||H.motherId}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"-"})]}),(0,s.jsxs)("div",{className:"bg-card p-4 rounded-lg border border-border",children:[(0,s.jsx)("h3",{className:"font-medium text-muted-foreground mb-2 text-sm uppercase tracking-wider",children:"配偶 (Spouse)"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:H.spouseIds?.length>0?H.spouseIds.map(e=>(0,s.jsx)(a.default,{href:`/members/${e}`,className:"px-3 py-1 bg-muted rounded hover:bg-muted/80 text-sm font-medium",children:m(e)?.fullName||e},e)):(0,s.jsx)("span",{className:"text-muted-foreground",children:"无记录"})})]}),(0,s.jsxs)("div",{className:"bg-card p-4 rounded-lg border border-border",children:[(0,s.jsx)("h3",{className:"font-medium text-muted-foreground mb-2 text-sm uppercase tracking-wider",children:"子女 (Children)"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:H.childrenIds?.length>0?H.childrenIds.map(e=>(0,s.jsx)(a.default,{href:`/members/${e}`,className:"px-3 py-1 bg-muted rounded hover:bg-muted/80 text-sm font-medium",children:m(e)?.fullName||e},e)):(0,s.jsx)("span",{className:"text-muted-foreground",children:"无记录"})})]})]})]})]}),(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"bg-card rounded-lg border border-border p-6 shadow-sm",children:[(0,s.jsx)("h3",{className:"font-serif font-bold text-lg mb-4 border-b border-border pb-2",children:"详细信息"}),(0,s.jsxs)("dl",{className:"space-y-4 text-sm",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:"出生日期"}),(0,s.jsx)("dd",{className:"font-medium",children:H.birthDate||"-"})]}),H.deathDate&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:"逝世日期"}),(0,s.jsx)("dd",{className:"font-medium",children:H.deathDate})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:"谥号"}),(0,s.jsx)("dd",{className:"font-medium",children:H.posthumousName||"-"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:"墓地"}),(0,s.jsx)("dd",{className:"font-medium",children:H.burialPlace||"-"})]})]}),H.generationName&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:"字辈"}),(0,s.jsx)("dd",{className:"font-medium",children:H.generationName})]})]})]}),(H.phone||H.telephone||H.email||H.address)&&(0,s.jsxs)("div",{className:"bg-card rounded-lg border border-border p-6 shadow-sm",children:[(0,s.jsx)("h3",{className:"font-serif font-bold text-lg mb-4 border-b border-border pb-2",children:"联系方式"}),(0,s.jsxs)("dl",{className:"space-y-4 text-sm",children:[H.phone&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:"手机号"}),(0,s.jsx)("dd",{className:"font-medium",children:(0,s.jsx)("a",{href:`tel:${H.phone}`,className:"hover:text-primary",children:H.phone})})]}),H.telephone&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:"固定电话"}),(0,s.jsx)("dd",{className:"font-medium",children:(0,s.jsx)("a",{href:`tel:${H.telephone}`,className:"hover:text-primary",children:H.telephone})})]}),H.email&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:"邮箱"}),(0,s.jsx)("dd",{className:"font-medium",children:(0,s.jsx)("a",{href:`mailto:${H.email}`,className:"hover:text-primary",children:H.email})})]}),H.address&&(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-muted-foreground",children:"现居地址"}),(0,s.jsx)("dd",{className:"font-medium",children:H.address})]})]})]})]})]})]})]})}e.s(["default",()=>k],30869)}]); |