feat(notebook): pre-select notebook source when notebook_id is in URL
This commit is contained in:
1 parent
e689493723
commit
e53c1a0f7b
4 files changed
+30
-5
No files matched your search
@@ -22,6 +22,8 @@ interface AIWritingFormProps {
|
||||
disabled?: boolean;
|
||||
/** workspace 入口:隐藏严格模式、目标读者 */
|
||||
hideAdvancedFields?: boolean;
|
||||
/** 预选笔记本 ID(传入时自动切换素材来源为「我的笔记」) */
|
||||
initialNotebookId?: number;
|
||||
}
|
||||
|
||||
const INPUT_CLASS =
|
||||
@@ -50,6 +52,7 @@ export function AIWritingForm({
|
||||
onSubmit,
|
||||
disabled,
|
||||
hideAdvancedFields = false,
|
||||
initialNotebookId,
|
||||
}: AIWritingFormProps) {
|
||||
const {
|
||||
intent, setIntent,
|
||||
@@ -62,8 +65,10 @@ export function AIWritingForm({
|
||||
materialSource, setMaterialSource,
|
||||
modelName, setModelName,
|
||||
} = useWritingForm();
|
||||
// 笔记来源:选中的 search_space_id 和多个 document_id(master 引入,useWritingForm 未含)
|
||||
const [selectedNotebookId, setSelectedNotebookId] = useState<number | null>(null);
|
||||
// 笔记来源:选中的 search_space_id 和多个 document_id
|
||||
const [selectedNotebookId, setSelectedNotebookId] = useState<number | null>(
|
||||
initialNotebookId ?? null,
|
||||
);
|
||||
const [selectedDocumentIds, setSelectedDocumentIds] = useState<number[]>([]);
|
||||
|
||||
const { models, isLoading: modelsLoading } = useModels();
|
||||
|
||||
Reference in new issue
Block a user