From 434db5a9007d8ab562beedf29f21a3cb377a4d58 Mon Sep 17 00:00:00 2001 From: shaohuzhang1 Date: Wed, 23 Oct 2024 19:19:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=A1=B5=E9=9D=A2,=E5=9B=9E=E6=98=BE?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/util/field_message.py | 5 +++-- .../component/XPackDisplaySettingDialog.vue | 15 +++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/common/util/field_message.py b/apps/common/util/field_message.py index 3d3945400..5dd8d981a 100644 --- a/apps/common/util/field_message.py +++ b/apps/common/util/field_message.py @@ -102,7 +102,8 @@ class ErrMessage: 'required': gettext_lazy('【%s】此字段必填。' % field), 'null': gettext_lazy('【%s】此字段不能为null。' % field), 'invalid_image': gettext_lazy('【%s】上载有效的图像。您上载的文件不是图像或图像已损坏。' % field), - 'max_length': gettext_lazy('请确保此文件名最多包含 {max_length} 个字符(长度为 {length})。') + 'max_length': gettext_lazy('【%s】请确保此文件名最多包含 {max_length} 个字符(长度为 {length})。' % field), + 'invalid': gettext_lazy('【%s】提交的数据不是文件。请检查表单上的编码类型。' % field) } @staticmethod @@ -112,5 +113,5 @@ class ErrMessage: 'empty': gettext_lazy('【%s】提交的文件为空。' % field), 'invalid': gettext_lazy('【%s】提交的数据不是文件。请检查表单上的编码类型。' % field), 'no_name': gettext_lazy('【%s】无法确定任何文件名。' % field), - 'max_length': gettext_lazy('请确保此文件名最多包含 {max_length} 个字符(长度为 {length})。') + 'max_length': gettext_lazy('【%s】请确保此文件名最多包含 {max_length} 个字符(长度为 {length})。' % field) } diff --git a/ui/src/views/application-overview/component/XPackDisplaySettingDialog.vue b/ui/src/views/application-overview/component/XPackDisplaySettingDialog.vue index 65d246679..8896596ea 100644 --- a/ui/src/views/application-overview/component/XPackDisplaySettingDialog.vue +++ b/ui/src/views/application-overview/component/XPackDisplaySettingDialog.vue @@ -326,8 +326,8 @@ const xpackForm = ref({ header_font_color: '#1f2329' }, float_location: { - x: { type: '', value: 0 }, - y: { type: '', value: 0 } + x: { type: 'bottom', value: 30 }, + y: { type: 'right', value: 0 } } }) @@ -389,12 +389,9 @@ const open = (data: any, content: any) => { xpackForm.value.show_history = data.show_history xpackForm.value.draggable = data.draggable xpackForm.value.show_guide = data.show_guide - xpackForm.value.avatar = data.avatar - xpackForm.value.float_icon = data.float_icon imgUrl.value.avatar = data.avatar imgUrl.value.float_icon = data.float_icon imgUrl.value.user_avatar = data.user_avatar - xpackForm.value.user_avatar = data.user_avatar xpackForm.value.disclaimer = data.disclaimer xpackForm.value.disclaimer_value = data.disclaimer_value xpackForm.value.custom_theme.theme_color = data.custom_theme?.theme_color @@ -411,10 +408,12 @@ const submit = async (formEl: FormInstance | undefined) => { await formEl.validate((valid, fields) => { if (valid) { let fd = new FormData() - form.value.custom_theme = JSON.stringify(form.value.custom_theme) - form.value.float_location = JSON.stringify(form.value.float_location) Object.keys(form.value).map((item) => { - fd.append(item, form.value[item]) + if (['custom_theme', 'float_location'].includes(item)) { + fd.append(item, JSON.stringify(form.value[item])) + } else { + fd.append(item, form.value[item]) + } }) applicationXpackApi.putAccessToken(id as string, fd, loading).then((res) => { emit('refresh')