perf: Improving the conversation to a left-right layout(#2286)

* refactor: Optimize code

* feat: Improving the conversation to a left-right layout(#2286)
This commit is contained in:
wangdan-fit2cloud 2025-02-19 15:48:04 +08:00 committed by GitHub
parent 2a84c58d4b
commit cc7f49fa8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 48 additions and 32 deletions

View File

@ -33,7 +33,6 @@
"lodash": "^4.17.21", "lodash": "^4.17.21",
"marked": "^12.0.2", "marked": "^12.0.2",
"md-editor-v3": "^4.16.7", "md-editor-v3": "^4.16.7",
"medium-zoom": "^1.1.0",
"mermaid": "^10.9.0", "mermaid": "^10.9.0",
"mitt": "^3.0.0", "mitt": "^3.0.0",
"moment": "^2.30.1", "moment": "^2.30.1",

View File

@ -1,19 +1,7 @@
<template> <template>
<!-- 问题内容 --> <!-- 问题内容 -->
<div class="item-content mb-16 lighter"> <div class="qustion-content item-content mb-16 lighter">
<div class="avatar"> <div class="content mr-16">
<el-image
v-if="application.user_avatar"
:src="application.user_avatar"
alt=""
fit="cover"
style="width: 32px; height: 32px; display: block"
/>
<AppAvatar v-else>
<img src="@/assets/user-icon.svg" style="width: 50%" alt="" />
</AppAvatar>
</div>
<div class="content">
<div class="text break-all pre-wrap"> <div class="text break-all pre-wrap">
<div class="mb-8" v-if="document_list.length"> <div class="mb-8" v-if="document_list.length">
<el-row :gutter="10"> <el-row :gutter="10">
@ -90,6 +78,18 @@
{{ chatRecord.problem_text }} {{ chatRecord.problem_text }}
</div> </div>
</div> </div>
<div class="avatar">
<el-image
v-if="application.user_avatar"
:src="application.user_avatar"
alt=""
fit="cover"
style="width: 32px; height: 32px; display: block"
/>
<AppAvatar v-else>
<img src="@/assets/user-icon.svg" style="width: 50%" alt="" />
</AppAvatar>
</div>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -137,26 +137,31 @@ function downloadFile(item: any) {
onMounted(() => {}) onMounted(() => {})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.download-file { .qustion-content {
height: 43px; display: flex;
justify-content: flex-end;
&:hover { .download-file {
color: var(--el-color-primary); height: 43px;
border: 1px solid var(--el-color-primary);
.download-button { &:hover {
display: block; color: var(--el-color-primary);
text-align: center; border: 1px solid var(--el-color-primary);
line-height: 26px;
.download-button {
display: block;
text-align: center;
line-height: 26px;
}
.show {
display: none;
}
} }
.show { .download-button {
display: none; display: none;
} }
} }
.download-button {
display: none;
}
} }
</style> </style>

View File

@ -30,7 +30,6 @@
></FormRander> ></FormRander>
<MdPreview <MdPreview
v-else v-else
noIconfont
ref="editorRef" ref="editorRef"
editorId="preview-only" editorId="preview-only"
:modelValue="item.content" :modelValue="item.content"

View File

@ -7,7 +7,6 @@
<el-collapse-transition> <el-collapse-transition>
<div class="border-l mt-8" v-show="showThink"> <div class="border-l mt-8" v-show="showThink">
<MdPreview <MdPreview
noIconfont
ref="editorRef" ref="editorRef"
editorId="preview-only" editorId="preview-only"
:modelValue="content" :modelValue="content"

View File

@ -29,7 +29,16 @@
type="ai-chat" type="ai-chat"
:available="applicationAvailable" :available="applicationAvailable"
:appId="applicationDetail?.id" :appId="applicationDetail?.id"
></AiChat> :record="recordList"
>
<template #operateBefore>
<div>
<el-button type="primary" link class="new-chat-button mb-8" @click="newChat">
<el-icon><Plus /></el-icon><span class="ml-4">{{ $t('chat.createChat') }}</span>
</el-button>
</div>
</template>
</AiChat>
</div> </div>
<div class="chat__footer"></div> <div class="chat__footer"></div>
</div> </div>
@ -57,6 +66,11 @@ const applicationDetail = computed({
}, },
set: (v) => {} set: (v) => {}
}) })
const recordList = ref([])
function newChat() {
recordList.value = []
}
</script> </script>
<style lang="scss"> <style lang="scss">
.chat { .chat {