feat: Setting avatar show or hide
This commit is contained in:
parent
b01172b242
commit
ee5c8a455d
@ -1,11 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="item-content mb-16 lighter">
|
<div class="item-content mb-16 lighter">
|
||||||
<template v-for="(answer_text, index) in answer_text_list" :key="index">
|
<template v-for="(answer_text, index) in answer_text_list" :key="index">
|
||||||
<div class="avatar">
|
<div class="avatar mr-8" v-if="application.show_avatar">
|
||||||
<img v-if="application.avatar" :src="application.avatar" height="28px" width="28px" />
|
<img v-if="application.avatar" :src="application.avatar" height="28px" width="28px" />
|
||||||
<LogoIcon v-else height="28px" width="28px" />
|
<LogoIcon v-else height="28px" width="28px" />
|
||||||
</div>
|
</div>
|
||||||
<div class="content" @mouseup="openControl">
|
<div
|
||||||
|
class="content"
|
||||||
|
@mouseup="openControl"
|
||||||
|
:style="{
|
||||||
|
'padding-right': application.show_user_avatar ? 'var(--padding-left)' : '0'
|
||||||
|
}"
|
||||||
|
>
|
||||||
<el-card shadow="always" class="mb-8 border-r-8" style="--el-card-padding: 6px 16px">
|
<el-card shadow="always" class="mb-8 border-r-8" style="--el-card-padding: 6px 16px">
|
||||||
<MdRenderer
|
<MdRenderer
|
||||||
v-if="
|
v-if="
|
||||||
@ -42,7 +48,13 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div class="content">
|
<div
|
||||||
|
class="content"
|
||||||
|
:style="{
|
||||||
|
'padding-left': application.show_avatar ? 'var(--padding-left)' : '0',
|
||||||
|
'padding-right': application.show_user_avatar ? 'var(--padding-left)' : '0'
|
||||||
|
}"
|
||||||
|
>
|
||||||
<OperationButton
|
<OperationButton
|
||||||
:type="type"
|
:type="type"
|
||||||
:application="application"
|
:application="application"
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<!-- 语音播放 -->
|
<!-- 语音播放 -->
|
||||||
<span v-if="tts">
|
<span>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
v-if="audioManage?.isPlaying()"
|
v-if="audioManage?.isPlaying()"
|
||||||
effect="dark"
|
effect="dark"
|
||||||
@ -40,18 +40,18 @@
|
|||||||
<el-divider direction="vertical" />
|
<el-divider direction="vertical" />
|
||||||
</span>
|
</span>
|
||||||
<span v-if="type == 'ai-chat' || type == 'log'">
|
<span v-if="type == 'ai-chat' || type == 'log'">
|
||||||
<el-tooltip effect="dark" :content="$t('chat.operation.regeneration')" placement="top">
|
|
||||||
<el-button :disabled="chat_loading" text @click="regeneration">
|
|
||||||
<el-icon><RefreshRight /></el-icon>
|
|
||||||
</el-button>
|
|
||||||
</el-tooltip>
|
|
||||||
<el-divider direction="vertical" />
|
|
||||||
<el-tooltip effect="dark" :content="$t('common.copy')" placement="top">
|
<el-tooltip effect="dark" :content="$t('common.copy')" placement="top">
|
||||||
<el-button text @click="copyClick(data?.answer_text.trim())">
|
<el-button text @click="copyClick(data?.answer_text.trim())">
|
||||||
<AppIcon iconName="app-copy"></AppIcon>
|
<AppIcon iconName="app-copy"></AppIcon>
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<el-divider direction="vertical" />
|
<el-divider direction="vertical" />
|
||||||
|
<el-tooltip effect="dark" :content="$t('chat.operation.regeneration')" placement="top">
|
||||||
|
<el-button :disabled="chat_loading" text @click="regeneration">
|
||||||
|
<el-icon><RefreshRight /></el-icon>
|
||||||
|
</el-button>
|
||||||
|
</el-tooltip>
|
||||||
|
<el-divider direction="vertical" />
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
effect="dark"
|
effect="dark"
|
||||||
:content="$t('chat.operation.like')"
|
:content="$t('chat.operation.like')"
|
||||||
@ -94,11 +94,18 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
|
||||||
<!-- 先渲染,不然不能播放 -->
|
<!-- 先渲染,不然不能播放 -->
|
||||||
<audio ref="audioPlayer" v-for="item in audioList" :key="item" controls hidden="hidden"></audio>
|
<audio
|
||||||
|
ref="audioPlayer"
|
||||||
|
v-for="item in audioList"
|
||||||
|
:key="item"
|
||||||
|
controls
|
||||||
|
hidden="hidden"
|
||||||
|
></audio>
|
||||||
<div ref="audioCiontainer"></div>
|
<div ref="audioCiontainer"></div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { nextTick, onMounted, ref } from 'vue'
|
import { nextTick, onMounted, ref } from 'vue'
|
||||||
@ -520,9 +527,10 @@ onMounted(() => {
|
|||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@media only screen and (max-width: 420px) {
|
@media only screen and (max-width: 430px) {
|
||||||
.chat-operation-button {
|
.chat-operation-button {
|
||||||
display: block;
|
display: block;
|
||||||
|
text-align: right;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,11 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 开场白组件 -->
|
<!-- 开场白组件 -->
|
||||||
<div class="item-content mb-16">
|
<div class="item-content mb-16">
|
||||||
<div class="avatar" v-if="prologue">
|
<div class="avatar mr-8" v-if="prologue && application.show_avatar">
|
||||||
<img v-if="application.avatar" :src="application.avatar" height="28px" width="28px" />
|
<img v-if="application.avatar" :src="application.avatar" height="28px" width="28px" />
|
||||||
<LogoIcon v-else height="28px" width="28px" />
|
<LogoIcon v-else height="28px" width="28px" />
|
||||||
</div>
|
</div>
|
||||||
<div class="content" v-if="prologue">
|
<div
|
||||||
|
class="content"
|
||||||
|
v-if="prologue"
|
||||||
|
:style="{
|
||||||
|
'padding-right': application.show_user_avatar ? 'var(--padding-left)' : '0'
|
||||||
|
}"
|
||||||
|
>
|
||||||
<el-card shadow="always" class="border-r-8" style="--el-card-padding: 10px 16px 12px">
|
<el-card shadow="always" class="border-r-8" style="--el-card-padding: 10px 16px 12px">
|
||||||
<MdRenderer
|
<MdRenderer
|
||||||
:source="prologue"
|
:source="prologue"
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<!-- 问题内容 -->
|
<!-- 问题内容 -->
|
||||||
<div class="question-content item-content mb-16 lighter">
|
<div class="question-content item-content mb-16 lighter">
|
||||||
<div
|
<div
|
||||||
class="content mr-12 p-12-16 border-r-8"
|
class="content p-12-16 border-r-8"
|
||||||
:class="document_list.length >= 2 ? 'media_2' : `media_${document_list.length}`"
|
:class="document_list.length >= 2 ? 'media_2' : `media_${document_list.length}`"
|
||||||
>
|
>
|
||||||
<div class="text break-all pre-wrap">
|
<div class="text break-all pre-wrap">
|
||||||
@ -63,7 +63,7 @@
|
|||||||
<span> {{ chatRecord.problem_text }}</span>
|
<span> {{ chatRecord.problem_text }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="avatar">
|
<div class="avatar ml-8" v-if="application.show_user_avatar">
|
||||||
<el-image
|
<el-image
|
||||||
v-if="application.user_avatar"
|
v-if="application.user_avatar"
|
||||||
:src="application.user_avatar"
|
:src="application.user_avatar"
|
||||||
@ -133,7 +133,6 @@ onMounted(() => {})
|
|||||||
background: #d6e2ff;
|
background: #d6e2ff;
|
||||||
padding-left: 16px;
|
padding-left: 16px;
|
||||||
padding-right: 16px;
|
padding-right: 16px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.download-file {
|
.download-file {
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
{{ inputFieldConfig.title }}
|
{{ inputFieldConfig.title }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<el-scrollbar max-height="160">
|
<el-scrollbar :max-height="!props.first ? 160 : 0">
|
||||||
<el-collapse-transition>
|
<el-collapse-transition>
|
||||||
<div v-show="showUserInput" class="mt-16" style="padding: 0 8px">
|
<div v-show="showUserInput" class="mt-16" style="padding: 0 8px">
|
||||||
<DynamicsForm
|
<DynamicsForm
|
||||||
|
|||||||
@ -16,8 +16,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
padding-left: var(--padding-left);
|
// padding-left: var(--padding-left);
|
||||||
padding-right: var(--padding-left);
|
// padding-right: var(--padding-left);
|
||||||
|
|
||||||
:deep(ol) {
|
:deep(ol) {
|
||||||
margin-left: 16px !important;
|
margin-left: 16px !important;
|
||||||
|
|||||||
@ -87,26 +87,44 @@
|
|||||||
:src="imgUrl.avatar"
|
:src="imgUrl.avatar"
|
||||||
alt=""
|
alt=""
|
||||||
fit="cover"
|
fit="cover"
|
||||||
style="width: 35px; height: 35px; display: block"
|
style="width: 28px; height: 28px; display: block"
|
||||||
/>
|
/>
|
||||||
<LogoIcon
|
<LogoIcon
|
||||||
v-else
|
v-else
|
||||||
height="35px"
|
height="28px"
|
||||||
style="width: 35px; height: 35px; display: block"
|
style="width: 28px; height: 28px; display: block"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<img src="@/assets/display-bg2.png" alt="" width="270" />
|
<img
|
||||||
|
src="@/assets/display-bg2.png"
|
||||||
|
alt=""
|
||||||
|
:width="
|
||||||
|
xpackForm.show_avatar
|
||||||
|
? xpackForm.show_user_avatar
|
||||||
|
? '240px'
|
||||||
|
: '270px'
|
||||||
|
: xpackForm.show_user_avatar
|
||||||
|
? '270px'
|
||||||
|
: '300px'
|
||||||
|
"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-between">
|
<div class="flex" style="justify-content: flex-end">
|
||||||
<img src="@/assets/display-bg3.png" alt="" width="270" class="ml-8" />
|
<img
|
||||||
|
src="@/assets/display-bg3.png"
|
||||||
|
alt=""
|
||||||
|
:width="xpackForm.show_user_avatar ? '240px' : '270px'"
|
||||||
|
class="mr-8"
|
||||||
|
style="object-fit: contain"
|
||||||
|
/>
|
||||||
<div class="avatar" v-if="xpackForm.show_user_avatar">
|
<div class="avatar" v-if="xpackForm.show_user_avatar">
|
||||||
<el-image
|
<el-image
|
||||||
v-if="imgUrl.user_avatar"
|
v-if="imgUrl.user_avatar"
|
||||||
:src="imgUrl.user_avatar"
|
:src="imgUrl.user_avatar"
|
||||||
alt=""
|
alt=""
|
||||||
fit="cover"
|
fit="cover"
|
||||||
style="width: 35px; height: 35px; display: block"
|
style="width: 28px; height: 28px; display: block"
|
||||||
/>
|
/>
|
||||||
<AppAvatar v-else>
|
<AppAvatar v-else>
|
||||||
<img src="@/assets/user-icon.svg" style="width: 54%" alt="" />
|
<img src="@/assets/user-icon.svg" style="width: 54%" alt="" />
|
||||||
@ -182,42 +200,17 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-card shadow="never" class="mb-8">
|
|
||||||
<div class="flex-between mb-8">
|
|
||||||
<span class="lighter">{{
|
|
||||||
$t('views.applicationOverview.appInfo.SettingDisplayDialog.askUserAvatar')
|
|
||||||
}}</span>
|
|
||||||
<el-checkbox v-model="xpackForm.show_user_avatar" style="margin-left: 200px">
|
|
||||||
{{
|
|
||||||
$t('views.applicationOverview.appInfo.SettingDisplayDialog.display')
|
|
||||||
}}</el-checkbox
|
|
||||||
>
|
|
||||||
<el-upload
|
|
||||||
ref="uploadRef"
|
|
||||||
action="#"
|
|
||||||
:auto-upload="false"
|
|
||||||
:show-file-list="false"
|
|
||||||
accept="image/jpeg, image/png, image/gif"
|
|
||||||
:on-change="(file: any, fileList: any) => onChange(file, fileList, 'user_avatar')"
|
|
||||||
>
|
|
||||||
<el-button size="small">
|
|
||||||
{{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.replace') }}
|
|
||||||
</el-button>
|
|
||||||
</el-upload>
|
|
||||||
</div>
|
|
||||||
<el-text type="info" size="small"
|
|
||||||
>{{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.imageMessage') }}
|
|
||||||
</el-text>
|
|
||||||
</el-card>
|
|
||||||
<el-card shadow="never" class="mb-8">
|
<el-card shadow="never" class="mb-8">
|
||||||
<div class="flex-between mb-8">
|
<div class="flex-between mb-8">
|
||||||
<span class="lighter">{{
|
<span class="lighter">{{
|
||||||
$t('views.applicationOverview.appInfo.SettingDisplayDialog.AIAvatar')
|
$t('views.applicationOverview.appInfo.SettingDisplayDialog.AIAvatar')
|
||||||
}}</span>
|
}}</span>
|
||||||
<el-checkbox v-model="xpackForm.show_avatar" style="margin-left: 200px">{{
|
<span class="flex align-center">
|
||||||
|
<el-checkbox v-model="xpackForm.show_avatar">{{
|
||||||
$t('views.applicationOverview.appInfo.SettingDisplayDialog.display')
|
$t('views.applicationOverview.appInfo.SettingDisplayDialog.display')
|
||||||
}}</el-checkbox>
|
}}</el-checkbox>
|
||||||
<el-upload
|
<el-upload
|
||||||
|
class="ml-8"
|
||||||
ref="uploadRef"
|
ref="uploadRef"
|
||||||
action="#"
|
action="#"
|
||||||
:auto-upload="false"
|
:auto-upload="false"
|
||||||
@ -229,11 +222,42 @@
|
|||||||
{{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.replace') }}
|
{{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.replace') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<el-text type="info" size="small">
|
<el-text type="info" size="small">
|
||||||
{{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.imageMessage') }}
|
{{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.imageMessage') }}
|
||||||
</el-text>
|
</el-text>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
<el-card shadow="never" class="mb-8">
|
||||||
|
<div class="flex-between mb-8">
|
||||||
|
<span class="lighter">{{
|
||||||
|
$t('views.applicationOverview.appInfo.SettingDisplayDialog.askUserAvatar')
|
||||||
|
}}</span>
|
||||||
|
<span class="flex align-center">
|
||||||
|
<el-checkbox v-model="xpackForm.show_user_avatar">
|
||||||
|
{{
|
||||||
|
$t('views.applicationOverview.appInfo.SettingDisplayDialog.display')
|
||||||
|
}}</el-checkbox
|
||||||
|
>
|
||||||
|
<el-upload
|
||||||
|
class="ml-8"
|
||||||
|
ref="uploadRef"
|
||||||
|
action="#"
|
||||||
|
:auto-upload="false"
|
||||||
|
:show-file-list="false"
|
||||||
|
accept="image/jpeg, image/png, image/gif"
|
||||||
|
:on-change="(file: any, fileList: any) => onChange(file, fileList, 'user_avatar')"
|
||||||
|
>
|
||||||
|
<el-button size="small">
|
||||||
|
{{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.replace') }}
|
||||||
|
</el-button>
|
||||||
|
</el-upload>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<el-text type="info" size="small"
|
||||||
|
>{{ $t('views.applicationOverview.appInfo.SettingDisplayDialog.imageMessage') }}
|
||||||
|
</el-text>
|
||||||
|
</el-card>
|
||||||
<el-card shadow="never" class="mb-8">
|
<el-card shadow="never" class="mb-8">
|
||||||
<div class="flex-between mb-8">
|
<div class="flex-between mb-8">
|
||||||
<span class="lighter">{{
|
<span class="lighter">{{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user