diff --git a/ui/src/api/dataset.ts b/ui/src/api/dataset.ts index 91d669d1..10a19fbb 100644 --- a/ui/src/api/dataset.ts +++ b/ui/src/api/dataset.ts @@ -196,6 +196,30 @@ const delParagraph: ( return del(`${prefix}/${dataset_id}/document/${document_id}/paragraph/${paragraph_id}`) } +/** + * 创建段落 + * @param 参数 + * dataset_id, document_id + * { + "content": "string", + "title": "string", + "is_active": true, + "problem_list": [ + { + "id": "string", + "content": "string" + } + ] + } + */ +const postParagraph: ( + dataset_id: string, + document_id: string, + data: any +) => Promise> = (dataset_id, document_id, data: any) => { + return post(`${prefix}/${dataset_id}/document/${document_id}/paragraph`, data) +} + /** * 修改段落 * @param 参数 @@ -236,5 +260,6 @@ export default { getDocumentDetail, getParagraph, delParagraph, - putParagraph + putParagraph, + postParagraph } diff --git a/ui/src/components/app-table/index.vue b/ui/src/components/app-table/index.vue index 14dafc87..6a4506ce 100644 --- a/ui/src/components/app-table/index.vue +++ b/ui/src/components/app-table/index.vue @@ -8,6 +8,7 @@ v-model="inputValue" placeholder="请输入文档名称" class="w-240 mr-12" + autofocus /> 创建 diff --git a/ui/src/components/index.ts b/ui/src/components/index.ts index e3ac6770..0173c424 100644 --- a/ui/src/components/index.ts +++ b/ui/src/components/index.ts @@ -10,6 +10,7 @@ import CardAdd from './card-add/index.vue' import BackButton from './back-button/index.vue' import AppTable from './app-table/index.vue' import ReadWrite from './read-write/index.vue' +import TagEllipsis from './tag-ellipsis/index.vue' export default { install(app: App) { @@ -24,5 +25,6 @@ export default { app.component(BackButton.name, BackButton) app.component(AppTable.name, AppTable) app.component(ReadWrite.name, ReadWrite) + app.component(TagEllipsis.name, TagEllipsis) } } diff --git a/ui/src/components/read-write/index.vue b/ui/src/components/read-write/index.vue index 93719dcb..71762873 100644 --- a/ui/src/components/read-write/index.vue +++ b/ui/src/components/read-write/index.vue @@ -10,7 +10,10 @@
- +
+ +
+