可信代码库-AI大模型首页推荐问题接口及对话搜索功能对接
This commit is contained in:
@@ -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 @@
|
||||
<d-button @click="handleCancel">取消</d-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 删除组件 -->
|
||||
<GModal
|
||||
v-model="deletevModels"
|
||||
ref="deleteModal"
|
||||
title="删除?"
|
||||
@confirm="confirmDelete"
|
||||
showWarnIcon
|
||||
confirmColor="danger"
|
||||
>
|
||||
<span class="inline-block text-G900 text-sm font-normal leading-[20px] break-all"
|
||||
>你确认批量删除对话 ?</span
|
||||
>
|
||||
</GModal>
|
||||
</d-modal>
|
||||
</template>
|
||||
|
||||
@@ -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 = () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<Card class="ViewHistoryAside">
|
||||
<d-tabs class="jyh-tabs-4" type="wrapped" v-model="selectTab">
|
||||
<d-tab id="dhls" title="对话历史">
|
||||
<d-search icon-position="left" style="width: 100%" placeholder="请输入搜索软件名称" v-model="searchText" @change="loadData"></d-search>
|
||||
<d-search icon-position="left" style="width: 100%" placeholder="请输入搜索软件名称" v-model="searchText" @change="loadData" @search="loadData"></d-search>
|
||||
<!-- 可滚动内容区域 -->
|
||||
<div class="scrollable-content">
|
||||
<d-collapse class="jyh-collapse" v-model="collapseValue">
|
||||
@@ -116,12 +116,12 @@
|
||||
</template>
|
||||
批量管理
|
||||
</d-button>
|
||||
<BatchManageModal :username="props.username" ref="BatchManageModalRef"/>
|
||||
<BatchManageModal :username="props.username" @loadData="loadData" ref="BatchManageModalRef"/>
|
||||
</div>
|
||||
</div>
|
||||
</d-tab>
|
||||
<d-tab id="scdh" title="收藏对话">
|
||||
<d-search icon-position="left" style="width: 100%" placeholder="请输入搜索软件名称" v-model="searchText" @change="loadData"></d-search>
|
||||
<d-search icon-position="left" style="width: 100%" placeholder="请输入搜索软件名称" v-model="searchText" @change="loadData" @search="loadData"></d-search>
|
||||
<!-- 可滚动内容区域 -->
|
||||
<div class="scrollable-content">
|
||||
<d-collapse class="jyh-collapse" v-model="collapseValue">
|
||||
@@ -230,7 +230,7 @@
|
||||
</template>
|
||||
批量管理
|
||||
</d-button>
|
||||
<BatchManageModal :username="props.username" ref="BatchManageModalRef"/>
|
||||
<BatchManageModal :username="props.username" @loadData="loadData" ref="BatchManageModalRef"/>
|
||||
</div>
|
||||
</div>
|
||||
</d-tab>
|
||||
|
||||
Reference in New Issue
Block a user