From 79d9f233264c50b63c22cfc73173b8641b752423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E6=B0=91=E5=BA=B7?= Date: Mon, 9 Jun 2025 16:42:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AF=E4=BF=A1=E4=BB=A3=E7=A0=81=E5=BA=93-A?= =?UTF-8?q?I=E5=A4=A7=E6=A8=A1=E5=9E=8B=E9=A6=96=E9=A1=B5=E6=8E=A8?= =?UTF-8?q?=E8=8D=90=E9=97=AE=E9=A2=98=E6=8E=A5=E5=8F=A3=E5=8F=8A=E5=AF=B9?= =?UTF-8?q?=E8=AF=9D=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Jyh/AI/Home/GuessYouWantToAsk.vue | 56 ++++++++++++++----- .../ViewHistoryAside/BatchManageModal.vue | 45 ++++++++++----- .../ViewHistoryAside/ViewHistoryAside.vue | 8 +-- 3 files changed, 75 insertions(+), 34 deletions(-) diff --git a/src/views/Jyh/AI/Home/GuessYouWantToAsk.vue b/src/views/Jyh/AI/Home/GuessYouWantToAsk.vue index 748ee09..5137b63 100644 --- a/src/views/Jyh/AI/Home/GuessYouWantToAsk.vue +++ b/src/views/Jyh/AI/Home/GuessYouWantToAsk.vue @@ -19,7 +19,8 @@ diff --git a/src/views/Jyh/AI/Home/components/ViewHistoryAside/BatchManageModal.vue b/src/views/Jyh/AI/Home/components/ViewHistoryAside/BatchManageModal.vue index f110e3d..88c3181 100644 --- a/src/views/Jyh/AI/Home/components/ViewHistoryAside/BatchManageModal.vue +++ b/src/views/Jyh/AI/Home/components/ViewHistoryAside/BatchManageModal.vue @@ -14,8 +14,8 @@ v-if="dhlsList.length>0" class="jyh-table" :data="dhlsList" - row-key="id" - @check-change="handleCheckChange('dhls')" + row-key="conversationId" + @check-change="handleCheckChange" :pagination="false" :indent="32" > @@ -60,8 +60,8 @@ v-if="collectionList.length>0" class="jyh-table" :data="collectionList" - row-key="id" - @check-change="handleCheckChange('scdh')" + row-key="conversationId" + @check-change="handleCheckChange" :pagination="false" :indent="32" > @@ -107,6 +107,20 @@ 取消 + + + + 你确认批量删除对话 ? + @@ -115,9 +129,11 @@ import { ref, computed, watch } from 'vue'; import axios from 'axios'; import { Message } from 'vue-devui/message'; import NoData from '@/components/NoData/NoData.vue'; +import { GModal } from '@/components/Setting/index'; // 接收父组件传递的用户名 const props = defineProps(['username']); +const emits = defineEmits(['loadData']); // 模态框状态 const visible = ref(false); @@ -250,8 +266,9 @@ const handlePageChange = async (page) => { // 选中的行ID const selectedRowKeys = ref([]); // 复选框选中状态变化 -const handleCheckChange = (tabType, checkedKeys) => { - selectedRowKeys.value = checkedKeys; +const handleCheckChange = (checked, row, selection) => { + debugger + selectedRowKeys.value = selection.map(i=> i.conversationId); }; const initData = async () => { @@ -279,6 +296,7 @@ const handleDelete = async (conversationIds, tabType) => { // 刷新当前标签页的数据 initData() selectedRowKeys.value = []; // 清空选中项 + emits('loadData') } else { Message.error(res.data.message || '删除失败'); } @@ -288,22 +306,19 @@ const handleDelete = async (conversationIds, tabType) => { } }; +const deletevModels = ref(false); // 批量删除 const handleBatchDelete = () => { if (!selectedRowKeys.value.length) { Message.warning('请先选择要删除的对话'); return; } - - // 确认删除提示 - Message.confirm({ - title: '确认删除', - content: `确定要删除选中的 ${selectedRowKeys.value.length} 条对话吗?`, - onConfirm: async () => { - await handleDelete(selectedRowKeys.value, selectTab.value === 'dhls' ? 'history' : 'collection'); - } - }); + deletevModels.value = true }; +const confirmDelete = async () => { + await handleDelete(selectedRowKeys.value, selectTab.value === 'dhls' ? 'history' : 'collection'); +}; + // 关闭模态框 const handleCancel = () => { diff --git a/src/views/Jyh/AI/Home/components/ViewHistoryAside/ViewHistoryAside.vue b/src/views/Jyh/AI/Home/components/ViewHistoryAside/ViewHistoryAside.vue index 9dc64b6..3a38684 100644 --- a/src/views/Jyh/AI/Home/components/ViewHistoryAside/ViewHistoryAside.vue +++ b/src/views/Jyh/AI/Home/components/ViewHistoryAside/ViewHistoryAside.vue @@ -2,7 +2,7 @@ - +
@@ -116,12 +116,12 @@ 批量管理 - +
- +
@@ -230,7 +230,7 @@ 批量管理 - +