refactor: Optimization of Q&A page

--story=1018176 --user=王孝刚 【问答页面】优化对话页面显示 https://www.tapd.cn/57709429/s/1674146
This commit is contained in:
wxg0103 2025-03-21 09:35:42 +08:00 committed by wxg
parent 72398408c5
commit e22fc95ee9
7 changed files with 28 additions and 8 deletions

View File

@ -984,6 +984,7 @@ class ApplicationSerializer(serializers.Serializer):
'draggable': application_setting.draggable, 'draggable': application_setting.draggable,
'show_guide': application_setting.show_guide, 'show_guide': application_setting.show_guide,
'avatar': application_setting.avatar, 'avatar': application_setting.avatar,
'show_avatar': application_setting.show_avatar,
'float_icon': application_setting.float_icon, 'float_icon': application_setting.float_icon,
'authentication': application_setting.authentication, 'authentication': application_setting.authentication,
'authentication_type': application_setting.authentication_value.get( 'authentication_type': application_setting.authentication_value.get(
@ -992,6 +993,7 @@ class ApplicationSerializer(serializers.Serializer):
'disclaimer_value': application_setting.disclaimer_value, 'disclaimer_value': application_setting.disclaimer_value,
'custom_theme': application_setting.custom_theme, 'custom_theme': application_setting.custom_theme,
'user_avatar': application_setting.user_avatar, 'user_avatar': application_setting.user_avatar,
'show_user_avatar': application_setting.show_user_avatar,
'float_location': application_setting.float_location} 'float_location': application_setting.float_location}
return ApplicationSerializer.Query.reset_application( return ApplicationSerializer.Query.reset_application(
{**ApplicationSerializer.ApplicationModel(application).data, {**ApplicationSerializer.ApplicationModel(application).data,

View File

@ -71,6 +71,7 @@ export default {
default: 'Default', default: 'Default',
askUserAvatar: 'User Avatar (Asking)', askUserAvatar: 'User Avatar (Asking)',
replace: 'Replace', replace: 'Replace',
display: 'Display',
imageMessage: imageMessage:
'Recommended size: 32×32 pixels. Supports JPG, PNG, and GIF formats. Max size: 10 MB', 'Recommended size: 32×32 pixels. Supports JPG, PNG, and GIF formats. Max size: 10 MB',
AIAvatar: 'AI Avatar', AIAvatar: 'AI Avatar',

View File

@ -72,6 +72,7 @@ export default {
replace: '替换', replace: '替换',
imageMessage: '建议尺寸 32*32支持 JPG、PNG、GIF大小不超过 10 MB', imageMessage: '建议尺寸 32*32支持 JPG、PNG、GIF大小不超过 10 MB',
AIAvatar: 'AI 回复头像', AIAvatar: 'AI 回复头像',
display: '显示',
floatIcon: '浮窗入口图标', floatIcon: '浮窗入口图标',
iconDefaultPosition: '图标默认位置', iconDefaultPosition: '图标默认位置',
iconPosition: { iconPosition: {

View File

@ -70,6 +70,7 @@ export default {
default: '預設', default: '預設',
askUserAvatar: '提問用戶頭像', askUserAvatar: '提問用戶頭像',
replace: '取代', replace: '取代',
display: '顯示',
imageMessage: '建議尺寸 32*32支援 JPG、PNG、GIF大小不超過 10 MB', imageMessage: '建議尺寸 32*32支援 JPG、PNG、GIF大小不超過 10 MB',
AIAvatar: 'AI 回覆頭像', AIAvatar: 'AI 回覆頭像',
floatIcon: '浮窗入口圖示', floatIcon: '浮窗入口圖示',

View File

@ -81,7 +81,7 @@
<div> <div>
<div class="p-16" style="position: relative"> <div class="p-16" style="position: relative">
<div class="flex"> <div class="flex">
<div class="avatar"> <div class="avatar" v-if="xpackForm.show_avatar">
<el-image <el-image
v-if="imgUrl.avatar" v-if="imgUrl.avatar"
:src="imgUrl.avatar" :src="imgUrl.avatar"
@ -99,7 +99,8 @@
<img src="@/assets/display-bg2.png" alt="" width="270" /> <img src="@/assets/display-bg2.png" alt="" width="270" />
</div> </div>
<div class="flex-between"> <div class="flex-between">
<div class="avatar"> <img src="@/assets/display-bg3.png" alt="" width="270" class="ml-8" />
<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"
@ -111,8 +112,6 @@
<img src="@/assets/user-icon.svg" style="width: 54%" alt="" /> <img src="@/assets/user-icon.svg" style="width: 54%" alt="" />
</AppAvatar> </AppAvatar>
</div> </div>
<img src="@/assets/display-bg3.png" alt="" width="270" class="ml-8" />
</div> </div>
</div> </div>
<div <div
@ -188,7 +187,11 @@
<span class="lighter">{{ <span class="lighter">{{
$t('views.applicationOverview.appInfo.SettingDisplayDialog.askUserAvatar') $t('views.applicationOverview.appInfo.SettingDisplayDialog.askUserAvatar')
}}</span> }}</span>
<el-checkbox v-model="xpackForm.show_user_avatar" style="margin-left: 200px">
{{
$t('views.applicationOverview.appInfo.SettingDisplayDialog.display')
}}</el-checkbox
>
<el-upload <el-upload
ref="uploadRef" ref="uploadRef"
action="#" action="#"
@ -211,7 +214,9 @@
<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">{{
$t('views.applicationOverview.appInfo.SettingDisplayDialog.display')
}}</el-checkbox>
<el-upload <el-upload
ref="uploadRef" ref="uploadRef"
action="#" action="#"
@ -417,7 +422,9 @@ const defaultSetting = {
float_location: { float_location: {
y: { type: 'bottom', value: 30 }, y: { type: 'bottom', value: 30 },
x: { type: 'right', value: 0 } x: { type: 'right', value: 0 }
} },
show_avatar: true,
show_user_avatar: false
} }
const displayFormRef = ref() const displayFormRef = ref()
@ -443,7 +450,9 @@ const xpackForm = ref<any>({
float_location: { float_location: {
y: { type: 'bottom', value: 30 }, y: { type: 'bottom', value: 30 },
x: { type: 'right', value: 0 } x: { type: 'right', value: 0 }
} },
show_avatar: true,
show_user_avatar: false
}) })
const imgUrl = ref<any>({ const imgUrl = ref<any>({
@ -510,6 +519,8 @@ const open = (data: any, content: any) => {
xpackForm.value.avatar_url = data.avatar xpackForm.value.avatar_url = data.avatar
xpackForm.value.user_avatar_url = data.user_avatar xpackForm.value.user_avatar_url = data.user_avatar
xpackForm.value.float_icon_url = data.float_icon xpackForm.value.float_icon_url = data.float_icon
xpackForm.value.show_avatar = data.show_avatar
xpackForm.value.show_user_avatar = data.show_user_avatar
xpackForm.value.custom_theme = { xpackForm.value.custom_theme = {
theme_color: data.custom_theme?.theme_color || '', theme_color: data.custom_theme?.theme_color || '',
header_font_color: data.custom_theme?.header_font_color || '#1f2329' header_font_color: data.custom_theme?.header_font_color || '#1f2329'

View File

@ -90,6 +90,8 @@
<el-form-item label="App Secret" prop="app_id" v-if="detail.type === '2'"> <el-form-item label="App Secret" prop="app_id" v-if="detail.type === '2'">
<el-input <el-input
v-model="form.app_secret" v-model="form.app_secret"
type="password"
show-password
:placeholder=" :placeholder="
$t('views.application.applicationAccess.larkSetting.appSecretPlaceholder') $t('views.application.applicationAccess.larkSetting.appSecretPlaceholder')
" "

View File

@ -154,6 +154,8 @@
<el-form-item label="App Secret" prop="app_id" v-if="datasetForm.type === '2'"> <el-form-item label="App Secret" prop="app_id" v-if="datasetForm.type === '2'">
<el-input <el-input
v-model="datasetForm.app_secret" v-model="datasetForm.app_secret"
type="password"
show-password
:placeholder="$t('views.application.applicationAccess.larkSetting.appSecretPlaceholder')" :placeholder="$t('views.application.applicationAccess.larkSetting.appSecretPlaceholder')"
/> />
</el-form-item> </el-form-item>