feat: 历史记录增加删除功能优化
feat: 历史记录增加删除功能优化
This commit is contained in:
commit
6c950e1268
@ -146,7 +146,7 @@
|
|||||||
ref="quickInputRef"
|
ref="quickInputRef"
|
||||||
v-model="inputValue"
|
v-model="inputValue"
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
:autosize="{ minRows: 1, maxRows: 4 }"
|
:autosize="{ minRows: 1, maxRows: common.isMobile() ? 4 : 10 }"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:maxlength="100000"
|
:maxlength="100000"
|
||||||
@keydown.enter="sendChatHandle($event)"
|
@keydown.enter="sendChatHandle($event)"
|
||||||
@ -173,7 +173,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, nextTick, computed, watch, reactive } from 'vue'
|
import { ref, nextTick, computed, watch, reactive, onMounted } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import LogOperationButton from './LogOperationButton.vue'
|
import LogOperationButton from './LogOperationButton.vue'
|
||||||
import OperationButton from './OperationButton.vue'
|
import OperationButton from './OperationButton.vue'
|
||||||
@ -215,7 +215,7 @@ const props = defineProps({
|
|||||||
|
|
||||||
const emit = defineEmits(['refresh', 'scroll'])
|
const emit = defineEmits(['refresh', 'scroll'])
|
||||||
|
|
||||||
const { application } = useStore()
|
const { application, common } = useStore()
|
||||||
|
|
||||||
const ParagraphSourceDialogRef = ref()
|
const ParagraphSourceDialogRef = ref()
|
||||||
const aiChatRef = ref()
|
const aiChatRef = ref()
|
||||||
@ -622,11 +622,7 @@ defineExpose({
|
|||||||
position: relative;
|
position: relative;
|
||||||
color: var(--app-text-color);
|
color: var(--app-text-color);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
&.chart-log {
|
|
||||||
.ai-chat__content {
|
|
||||||
padding-bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&__content {
|
&__content {
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|||||||
@ -6,6 +6,8 @@
|
|||||||
@click.prevent="clickHandle(item, index)"
|
@click.prevent="clickHandle(item, index)"
|
||||||
:class="current === item[props.valueKey] ? 'active' : ''"
|
:class="current === item[props.valueKey] ? 'active' : ''"
|
||||||
class="cursor"
|
class="cursor"
|
||||||
|
@mouseenter="mouseenter(item)"
|
||||||
|
@mouseleave="mouseleave()"
|
||||||
>
|
>
|
||||||
<slot :row="item" :index="index"> </slot>
|
<slot :row="item" :index="index"> </slot>
|
||||||
</li>
|
</li>
|
||||||
@ -44,7 +46,14 @@ watch(
|
|||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
)
|
)
|
||||||
|
|
||||||
const emit = defineEmits(['click'])
|
const emit = defineEmits(['click', 'mouseenter', 'mouseleave'])
|
||||||
|
|
||||||
|
function mouseenter(row: any) {
|
||||||
|
emit('mouseenter', row)
|
||||||
|
}
|
||||||
|
function mouseleave() {
|
||||||
|
emit('mouseleave')
|
||||||
|
}
|
||||||
|
|
||||||
function clickHandle(row: any, index: number) {
|
function clickHandle(row: any, index: number) {
|
||||||
current.value = row[props.valueKey]
|
current.value = row[props.valueKey]
|
||||||
|
|||||||
@ -43,14 +43,16 @@
|
|||||||
v-loading="left_loading"
|
v-loading="left_loading"
|
||||||
:defaultActive="currentChatId"
|
:defaultActive="currentChatId"
|
||||||
@click="clickListHandle"
|
@click="clickListHandle"
|
||||||
|
@mouseenter="mouseenter"
|
||||||
|
@mouseleave="mouseId = ''"
|
||||||
>
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div class="flex-between">
|
<div class="flex-between">
|
||||||
<auto-tooltip :content="row.abstract">
|
<auto-tooltip :content="row.abstract">
|
||||||
{{ row.abstract }}
|
{{ row.abstract }}
|
||||||
</auto-tooltip>
|
</auto-tooltip>
|
||||||
<div @click.stop>
|
<div @click.stop v-if="mouseId === row.id">
|
||||||
<el-button text @click.stop="deleteLog(row)">
|
<el-button style="padding: 0" link @click.stop="deleteLog(row)">
|
||||||
<el-icon><Delete /></el-icon>
|
<el-icon><Delete /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
@ -101,6 +103,11 @@ const paginationConfig = reactive({
|
|||||||
const currentRecordList = ref<any>([])
|
const currentRecordList = ref<any>([])
|
||||||
const currentChatId = ref('new') // 当前历史记录Id 默认为'new'
|
const currentChatId = ref('new') // 当前历史记录Id 默认为'new'
|
||||||
|
|
||||||
|
const mouseId = ref('')
|
||||||
|
|
||||||
|
function mouseenter(row: any) {
|
||||||
|
mouseId.value = row.id
|
||||||
|
}
|
||||||
function deleteLog(row: any) {
|
function deleteLog(row: any) {
|
||||||
log.asyncDelChatClientLog(applicationDetail.value.id, row.id, left_loading).then(() => {
|
log.asyncDelChatClientLog(applicationDetail.value.id, row.id, left_loading).then(() => {
|
||||||
if (currentChatId.value === row.id) {
|
if (currentChatId.value === row.id) {
|
||||||
@ -247,9 +254,6 @@ onMounted(() => {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.new-chat-button {
|
.new-chat-button {
|
||||||
// position: absolute;
|
|
||||||
// bottom: 80px;
|
|
||||||
// left: 18px;
|
|
||||||
z-index: 11;
|
z-index: 11;
|
||||||
}
|
}
|
||||||
// 历史对话弹出层
|
// 历史对话弹出层
|
||||||
@ -305,9 +309,6 @@ onMounted(() => {
|
|||||||
.ai-chat__operate {
|
.ai-chat__operate {
|
||||||
padding-top: 12px;
|
padding-top: 12px;
|
||||||
}
|
}
|
||||||
.ai-chat__content {
|
|
||||||
padding-bottom: 104px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -23,19 +23,22 @@
|
|||||||
v-loading="left_loading"
|
v-loading="left_loading"
|
||||||
:defaultActive="currentChatId"
|
:defaultActive="currentChatId"
|
||||||
@click="clickListHandle"
|
@click="clickListHandle"
|
||||||
|
@mouseenter="mouseenter"
|
||||||
|
@mouseleave="mouseId = ''"
|
||||||
>
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div class="flex-between">
|
<div class="flex-between">
|
||||||
<auto-tooltip :content="row.abstract">
|
<auto-tooltip :content="row.abstract">
|
||||||
{{ row.abstract }}
|
{{ row.abstract }}
|
||||||
</auto-tooltip>
|
</auto-tooltip>
|
||||||
<div @click.stop>
|
<div @click.stop v-if="mouseId === row.id">
|
||||||
<el-button text @click.stop="deleteLog(row)">
|
<el-button style="padding: 0" link @click.stop="deleteLog(row)">
|
||||||
<el-icon><Delete /></el-icon>
|
<el-icon><Delete /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #empty>
|
<template #empty>
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<el-text type="info">暂无历史记录</el-text>
|
<el-text type="info">暂无历史记录</el-text>
|
||||||
@ -150,7 +153,11 @@ const paginationConfig = ref({
|
|||||||
const currentRecordList = ref<any>([])
|
const currentRecordList = ref<any>([])
|
||||||
const currentChatId = ref('new') // 当前历史记录Id 默认为'new'
|
const currentChatId = ref('new') // 当前历史记录Id 默认为'new'
|
||||||
const currentChatName = ref('新建对话')
|
const currentChatName = ref('新建对话')
|
||||||
|
const mouseId = ref('')
|
||||||
|
|
||||||
|
function mouseenter(row: any) {
|
||||||
|
mouseId.value = row.id
|
||||||
|
}
|
||||||
function deleteLog(row: any) {
|
function deleteLog(row: any) {
|
||||||
log.asyncDelChatClientLog(applicationDetail.value.id, row.id, left_loading).then(() => {
|
log.asyncDelChatClientLog(applicationDetail.value.id, row.id, left_loading).then(() => {
|
||||||
if (currentChatId.value === row.id) {
|
if (currentChatId.value === row.id) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user