feature:新增角色/组织状态追踪系统,章节分析自动更新角色存活状态、心理状态及组织成员变动
This commit is contained in:
@@ -32,11 +32,28 @@ export const CharacterCard: React.FC<CharacterCardProps> = ({ character, onEdit,
|
||||
};
|
||||
|
||||
const isOrganization = character.is_organization;
|
||||
const charStatus = character.status || 'active';
|
||||
const isInactive = charStatus !== 'active';
|
||||
|
||||
const getStatusTag = () => {
|
||||
const statusConfig: Record<string, { color: string; label: string }> = {
|
||||
deceased: { color: '#000000', label: '💀 已死亡' },
|
||||
missing: { color: '#faad14', label: '❓ 已失踪' },
|
||||
retired: { color: '#8c8c8c', label: '📤 已退场' },
|
||||
destroyed: { color: '#000000', label: '💀 已覆灭' },
|
||||
};
|
||||
const config = statusConfig[charStatus];
|
||||
if (!config) return null;
|
||||
return <Tag color={config.color} style={{ marginLeft: 4 }}>{config.label}</Tag>;
|
||||
};
|
||||
|
||||
return (
|
||||
<Card
|
||||
hoverable
|
||||
style={isOrganization ? cardStyles.organization : cardStyles.character}
|
||||
style={{
|
||||
...(isOrganization ? cardStyles.organization : cardStyles.character),
|
||||
...(isInactive ? { opacity: 0.6, filter: 'grayscale(40%)' } : {}),
|
||||
}}
|
||||
styles={{
|
||||
body: {
|
||||
flex: 1,
|
||||
@@ -82,6 +99,7 @@ export const CharacterCard: React.FC<CharacterCardProps> = ({ character, onEdit,
|
||||
</Tag>
|
||||
)
|
||||
)}
|
||||
{getStatusTag()}
|
||||
</Space>
|
||||
}
|
||||
description={
|
||||
@@ -112,6 +130,17 @@ export const CharacterCard: React.FC<CharacterCardProps> = ({ character, onEdit,
|
||||
</Text>
|
||||
</div>
|
||||
)}
|
||||
{character.relationships && (
|
||||
<div style={{ marginBottom: 8, display: 'flex', alignItems: 'flex-start' }}>
|
||||
<Text type="secondary" style={{ flexShrink: 0 }}>关系:</Text>
|
||||
<Text
|
||||
style={{ flex: 1, minWidth: 0 }}
|
||||
ellipsis={{ tooltip: character.relationships }}
|
||||
>
|
||||
{character.relationships}
|
||||
</Text>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -174,14 +203,7 @@ export const CharacterCard: React.FC<CharacterCardProps> = ({ character, onEdit,
|
||||
{character.organization_members && (
|
||||
<div style={{ marginBottom: 8, display: 'flex', alignItems: 'flex-start' }}>
|
||||
<Text type="secondary" style={{ flexShrink: 0 }}>成员:</Text>
|
||||
<Text
|
||||
style={{ flex: 1, minWidth: 0 }}
|
||||
ellipsis={{
|
||||
tooltip: typeof character.organization_members === 'string'
|
||||
? character.organization_members
|
||||
: JSON.stringify(character.organization_members)
|
||||
}}
|
||||
>
|
||||
<Text style={{ flex: 1, minWidth: 0, fontSize: 12, lineHeight: 1.6, wordBreak: 'break-all' }}>
|
||||
{typeof character.organization_members === 'string'
|
||||
? character.organization_members
|
||||
: JSON.stringify(character.organization_members)}
|
||||
|
||||
@@ -220,6 +220,11 @@ export interface Character {
|
||||
location?: string;
|
||||
motto?: string;
|
||||
color?: string;
|
||||
// 角色/组织状态
|
||||
status?: string;
|
||||
status_changed_chapter?: number;
|
||||
current_state?: string;
|
||||
state_updated_chapter?: number;
|
||||
// 职业相关字段
|
||||
main_career_id?: string;
|
||||
main_career_stage?: number;
|
||||
@@ -240,7 +245,6 @@ export interface CharacterUpdate {
|
||||
personality?: string;
|
||||
background?: string;
|
||||
appearance?: string;
|
||||
relationships?: string;
|
||||
organization_type?: string;
|
||||
organization_purpose?: string;
|
||||
organization_members?: string;
|
||||
|
||||
Reference in New Issue
Block a user