From 152707a1b9b4b429e54fb0a8b49e74558166e7c0 Mon Sep 17 00:00:00 2001 From: zhaoshibao <501348474@qq.com> Date: Mon, 31 Mar 2025 18:05:38 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=96=B0=E5=A2=9E=E7=9F=A5=E8=AF=86?= =?UTF-8?q?=E5=BA=93=E6=96=87=E4=BB=B6=E5=88=A0=E9=99=A4=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E9=98=B2=E6=AD=A2=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=AF=AF=E5=88=A0=E9=99=A4=EF=BC=9B=E8=A7=A3=E5=86=B3=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E6=95=B0=E6=8D=AE=E5=BA=93=E5=BC=B9=E7=AA=97=E5=8F=B3?= =?UTF-8?q?=E4=B8=8A=E8=A7=92=E5=85=B3=E9=97=AD=E6=8C=89=E9=92=AE=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E4=B8=8D=E4=BA=86=E9=97=AE=E9=A2=98=E3=80=82=EF=BC=88?= =?UTF-8?q?=E5=85=B3=E8=81=94=20Issue=20#113=20#114=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/views/DataBaseInfoView.vue | 56 +++++++++++++++++++----------- web/src/views/DataBaseView.vue | 2 +- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/web/src/views/DataBaseInfoView.vue b/web/src/views/DataBaseInfoView.vue index 8f7fb059..2a4bcfd6 100644 --- a/web/src/views/DataBaseInfoView.vue +++ b/web/src/views/DataBaseInfoView.vue @@ -558,30 +558,44 @@ const getDatabaseInfo = () => { const deleteFile = (fileId) => { console.log(fileId) - state.lock = true - fetch('/api/data/document', { - method: "DELETE", - headers: { - "Content-Type": "application/json" // 添加 Content-Type 头 + //删除提示 + Modal.confirm({ + title: '删除文件', + content: '确定要删除该文件吗?', + okText: '确认', + cancelText: '取消', + onOk: () => { + state.lock = true + fetch('/api/data/document', { + method: "DELETE", + headers: { + "Content-Type": "application/json" // 添加 Content-Type 头 + }, + body: JSON.stringify({ + db_id: databaseId.value, + file_id: fileId + }), + }) + .then(response => response.json()) + .then(data => { + console.log(data) + message.success(data.message) + getDatabaseInfo() + }) + .catch(error => { + console.error(error) + message.error(error.message) + }) + .finally(() => { + state.lock = false + }) }, - body: JSON.stringify({ - db_id: databaseId.value, - file_id: fileId - }), - }) - .then(response => response.json()) - .then(data => { - console.log(data) - message.success(data.message) - getDatabaseInfo() - }) - .catch(error => { - console.error(error) - message.error(error.message) - }) + onCancel: () => { + console.log('Cancel'); + }, + }); } - const chunkParams = ref({ chunk_size: 1000, chunk_overlap: 200, diff --git a/web/src/views/DataBaseView.vue b/web/src/views/DataBaseView.vue index c8a67b32..44c9ae4c 100644 --- a/web/src/views/DataBaseView.vue +++ b/web/src/views/DataBaseView.vue @@ -9,7 +9,7 @@ - +

数据库名称*

数据库描述