Skip to content

Commit 3361acf

Browse files
feat: History record supports modifying chat abstract
1 parent 3e347d2 commit 3361acf

File tree

5 files changed

+52
-17
lines changed

5 files changed

+52
-17
lines changed

ui/src/components/ai-chat/ExecutionDetailDialog.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<el-dialog
3-
class="execution-details-dialog"
3+
class="execution-details-dialog responsive-dialog"
44
:title="$t('chat.executionDetails.title')"
55
v-model="dialogVisible"
66
destroy-on-close
@@ -697,9 +697,5 @@ defineExpose({ open })
697697
}
698698
}
699699
700-
@media only screen and (max-width: 768px) {
701-
.execution-details-dialog {
702-
width: 90% !important;
703-
}
704-
}
700+
705701
</style>

ui/src/components/ai-chat/ParagraphSourceDialog.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<el-dialog
3-
class="paragraph-source"
3+
class="paragraph-source responsive-dialog"
44
:title="$t('chat.paragraphSource.title')"
55
v-model="dialogVisible"
66
destroy-on-close
@@ -76,9 +76,4 @@ defineExpose({ open })
7676
max-height: calc(100vh - 260px);
7777
}
7878
}
79-
@media only screen and (max-width: 768px) {
80-
.paragraph-source {
81-
width: 90% !important;
82-
}
83-
}
8479
</style>

ui/src/styles/app.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,3 +756,9 @@ h5 {
756756
border-right: 1px solid var(--el-border-color);
757757
}
758758
}
759+
760+
@media only screen and (max-width: 768px) {
761+
.responsive-dialog {
762+
width: 90% !important;
763+
}
764+
}

ui/src/views/chat/embed/index.vue

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,22 @@
8888
>
8989
<template #default="{ row }">
9090
<div class="flex-between">
91-
<auto-tooltip :content="row.abstract">
92-
{{ row.abstract }}
93-
</auto-tooltip>
94-
<div @click.stop v-if="mouseId === row.id && row.id !== 'new'">
91+
<ReadWrite
92+
@change="editName($event, row)"
93+
:data="row.abstract"
94+
trigger="manual"
95+
:write="row.writeStatus"
96+
@close="closeWrite(row)"
97+
:maxlength="1024"
98+
/>
99+
<div
100+
@click.stop
101+
v-if="mouseId === row.id && row.id !== 'new' && !row.writeStatus"
102+
class="flex"
103+
>
104+
<el-button style="padding: 0" link @click.stop="openWrite(row)">
105+
<el-icon><EditPen /></el-icon>
106+
</el-button>
95107
<el-button style="padding: 0" link @click.stop="deleteLog(row)">
96108
<el-icon><Delete /></el-icon>
97109
</el-button>
@@ -120,6 +132,7 @@ import { ref, onMounted, reactive, nextTick, computed } from 'vue'
120132
import { useRoute } from 'vue-router'
121133
import { isAppIcon } from '@/utils/application'
122134
import { hexToRgba } from '@/utils/theme'
135+
import { MsgError } from '@/utils/message'
123136
import useStore from '@/stores'
124137
const { user, log } = useStore()
125138
const route = useRoute()
@@ -160,6 +173,29 @@ const customStyle = computed(() => {
160173
}
161174
})
162175
176+
function editName(val: string, item: any) {
177+
if (val) {
178+
const obj = {
179+
abstract: val
180+
}
181+
182+
log.asyncPutChatClientLog(applicationDetail.value.id, item.id, obj, loading).then(() => {
183+
getChatLog(applicationDetail.value.id)
184+
item['writeStatus'] = false
185+
})
186+
} else {
187+
MsgError(t('views.applicationWorkflow.tip.nameMessage'))
188+
}
189+
}
190+
191+
function openWrite(item: any) {
192+
item['writeStatus'] = true
193+
}
194+
195+
function closeWrite(item: any) {
196+
item['writeStatus'] = false
197+
}
198+
163199
function mouseenter(row: any) {
164200
mouseId.value = row.id
165201
}
@@ -312,7 +348,7 @@ onMounted(() => {
312348
right: 16px;
313349
font-size: 22px;
314350
}
315-
&.chat-embed--popup{
351+
&.chat-embed--popup {
316352
.chat-popover-button {
317353
right: 85px;
318354
}

ui/src/views/chat/pc/EditTitleDialog.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<template>
22
<el-dialog
3+
class="responsive-dialog"
34
:title="$t('chat.editTitle')"
45
v-model="dialogVisible"
56
:close-on-click-modal="false"
@@ -27,6 +28,7 @@
2728
v-model="form.abstract"
2829
maxlength="1024"
2930
show-word-limit
31+
type="textarea"
3032
@blur="form.abstract = form.abstract.trim()"
3133
/>
3234
</el-form-item>

0 commit comments

Comments
 (0)