File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
frontend/src/renderer/src/views Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 138138 :volume-number =" chapterVolumeNumber"
139139 :chapter-number =" chapterChapterNumber"
140140 :participants =" chapterParticipants"
141+ @update:participants =" handleContextParticipantsUpdate"
141142 />
142143 </el-tab-pane >
143144
@@ -1117,6 +1118,24 @@ async function assembleChapterContext() {
11171118 }
11181119}
11191120
1121+ // 当右侧“参与实体”面板中手动增删参与者时,将变更写回当前章节卡片的内容
1122+ async function handleContextParticipantsUpdate(names : string []) {
1123+ try {
1124+ if (! isChapterContent .value || ! activeCard .value ) return
1125+ const card = activeCard .value as any
1126+ const content: any = { ... (card .content || {}) }
1127+ // 仅以名称列表作为实体列表的来源(对象形态后续仍可由分析流程补全)
1128+ const normalized = (names || [])
1129+ .map (n => (typeof n === ' string' ? n .trim () : String (n || ' ' )).trim ())
1130+ .filter (Boolean )
1131+ content .entity_list = normalized
1132+ await cardStore .modifyCard (card .id , { content } as any )
1133+ // modifyCard 成功后,cards watcher 会触发 assembleChapterContext 使用新的参与者
1134+ } catch (e ) {
1135+ console .error (' Failed to update participants on card:' , e )
1136+ }
1137+ }
1138+
11201139
11211140async function refreshAssistantContext() {
11221141 try {
You can’t perform that action at this time.
0 commit comments