From bb5bf48acd36f4f5c42e96c1d340a1273a604314 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Tue, 29 Oct 2024 14:46:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9B=BD=E5=AE=B6=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/locales/en.ts | 71 +++++++++++++++++++ core/core-frontend/src/locales/zh-CN.ts | 69 +++++++++++++++++- .../src/views/system/common/InfoTemplate.vue | 14 ++-- .../src/views/system/font/UploadDetail.vue | 35 +++++---- .../src/views/system/font/index.vue | 51 +++++++------ .../src/views/system/modify-pwd/UpdatePwd.vue | 18 ++--- .../src/views/system/modify-pwd/index.vue | 2 +- .../system/parameter/basic/BasicEdit.vue | 26 +++---- .../system/parameter/basic/BasicInfo.vue | 28 ++++---- .../system/parameter/engine/EngineEdit.vue | 2 +- .../parameter/engine/EngineInfoTemplate.vue | 4 +- .../src/views/system/parameter/index.vue | 6 +- .../views/system/parameter/map/Geometry.vue | 16 +++-- .../system/parameter/map/GeometryEdit.vue | 28 ++++---- 14 files changed, 265 insertions(+), 105 deletions(-) diff --git a/core/core-frontend/src/locales/en.ts b/core/core-frontend/src/locales/en.ts index a1ce898953..1d859f4044 100644 --- a/core/core-frontend/src/locales/en.ts +++ b/core/core-frontend/src/locales/en.ts @@ -36,6 +36,77 @@ export default { delete_success: 'Delete success', no_auth_tips: 'Missing menu permissions, please contact the administrator' }, + date: { + permanent: 'Permanent', + one_year: 'One year', + six_months: 'Six months', + three_months: 'Three months', + of_range_1_59: 'Minutes out of range [1-59]', + of_range_1_23: 'Hours out of range [1-23]' + }, + system: { + click_to_show: 'Click to show', + click_to_hide: 'Click to hide', + basic_settings: 'Basic settings', + and_0_seconds: '0 minutes and 0 seconds', + time_0_seconds: 'Minutes (execution time: 0 seconds)', + and_0_seconds_de: 'Hours (execution time: 0 minutes and 0 seconds)', + fonts_before_deleting: 'Please set other fonts as default fonts before deleting.', + sure_to_delete: + 'After the current font is deleted, the components using the font will use the default font. Are you sure to delete?', + setting_successful: 'Setting successful', + font_management: 'Font management', + search_font_name: 'Search font name', + a_new_font: 'Create a new font', + add_font: 'Add font', + default_font: 'Default font', + system_built_in: 'System built-in', + update_time: 'Update time:', + font_file: 'Font file:', + upload_font_file: 'Upload font file', + replace_font_file: 'Replace font file', + as_default_font: 'Set as default font', + the_font_name: 'Please enter the font name', + in_ttf_format: 'Only supports uploading font files in ttf format!', + character_length_1_50: 'Character length 1-50', + upload_font_file_de: 'Please upload font file', + font_name: 'Font name', + font_file_de: 'Font file', + be_the_same: 'New and old passwords cannot be the same', + twice_are_inconsistent: 'The passwords entered twice are inconsistent', + log_in_again: 'Change successfully, please log in again', + original_password: 'Original password', + the_original_password: 'Please enter the original password', + new_password: 'New password', + the_new_password: 'Please enter the new password', + confirm_password: 'Confirm password', + the_confirmation_password: 'Please enter the confirmation password', + map_settings: 'Map settings', + engine_settings: 'Engine settings', + normal_login: 'Normal login', + to_take_effect: + 'Request timeout (unit: seconds, note: save and refresh the browser to take effect)', + and_platform_docking: 'Scope includes authentication settings and platform docking', + not_enabled: 'Not enabled', + default_organization: 'Default organization', + normal_role: 'Normal role', + engine_type: 'Engine type', + on_the_left: 'Please select a region on the left', + region_code: 'Region code', + superior_region: 'Superior region', + coordinate_file: 'Coordinate file', + delete_this_node: 'Are you sure you want to delete this node?', + at_the_end: + 'Country code consists of three digits, province, city, district, county, and township codes consist of two digits; non-national regions need to add 0 at the end', + non_zero_three_digit_number: 'Please enter a non-zero three-digit number', + or_11_digits: 'Please enter 9 or 11 digits', + contact_the_administrator: 'If execution fails, please contact the administrator', + upload_json_files: 'Can only upload json files', + maximum_upload_200m: 'Maximum upload 200M', + geographic_information: 'Geographic information', + superior_region_first: 'Please select the superior region first', + region_name: 'Region name' + }, components: { dashboard_style: 'Dashboard style', overall_configuration: 'Overall configuration', diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index f3791e7066..0a286a4861 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -391,7 +391,66 @@ export default { system: { user: '用户', role: '角色', - addUser: '@:common.add@:system.user' + addUser: '@:common.add@:system.user', + click_to_show: '点击显示', + click_to_hide: '点击隐藏', + basic_settings: '基础设置', + and_0_seconds: '0分0秒', + time_0_seconds: '分钟(执行时间:0秒)', + and_0_seconds_de: '小时(执行时间:0分0秒)', + fonts_before_deleting: '请先将其他字体设置为默认字体,再进行删除。', + sure_to_delete: '当前字体被删除后,使用该字体的组件将会使用默认字体,确定删除?', + setting_successful: '设置成功', + font_management: '字体管理', + search_font_name: '搜索字体名称', + a_new_font: '新建字体', + add_font: '添加字体', + default_font: '默认字体', + system_built_in: '系统内置', + update_time: '更新时间:', + font_file: '字库文件:', + upload_font_file: '上传字库文件', + replace_font_file: '替换字库文件', + as_default_font: '设为默认字体', + the_font_name: '请输入字体名称', + in_ttf_format: '只支持上传ttf格式的字体文件!', + character_length_1_50: '字符长度1-50', + upload_font_file_de: '请上传字库文件', + font_name: '字体名称', + font_file_de: '字库文件', + be_the_same: '新旧密码不能相同', + twice_are_inconsistent: '两次输入的密码不一致', + log_in_again: '修改成功,请重新登录', + original_password: '原始密码', + the_original_password: '请输入原始密码', + new_password: '新密码', + the_new_password: '请输入新密码', + confirm_password: '确认密码', + the_confirmation_password: '请输入确认密码', + map_settings: '地图设置', + engine_settings: '引擎设置', + normal_login: '普通登录', + to_take_effect: '请求超时时间(单位:秒,注意:保存后刷新浏览器生效)', + and_platform_docking: '作用域包括认证设置和平台对接', + not_enabled: '未开启', + default_organization: '默认组织', + normal_role: '普通角色', + engine_type: '引擎类型', + on_the_left: '请在左侧选择区域', + region_code: '区域代码', + superior_region: '上级区域', + coordinate_file: '坐标文件', + delete_this_node: '确定删除此节点吗', + at_the_end: + '国家代码由三位数字组成,省、市、区县、乡镇代码由两位数字组成;非国家区域需要再后面补0', + non_zero_three_digit_number: '请输入非0的三位数字', + or_11_digits: '请输入9或11位数字', + contact_the_administrator: '执行失败请联系管理员', + upload_json_files: '只能上传json文件', + maximum_upload_200m: '最大上传200M', + geographic_information: '地理信息', + superior_region_first: '请先选择上级区域', + region_name: '区域名称' }, components: { dashboard_style: '仪表板风格', @@ -2184,7 +2243,13 @@ export default { data_time_error: '开始日期不能大于结束日期', one_day: '一天', one_week: '一周', - one_month: '一个月' + one_month: '一个月', + permanent: '永久', + one_year: '一年', + six_months: '半年', + three_months: '三个月', + of_range_1_59: '分钟超出范围【1-59】', + of_range_1_23: '小时超出范围【1-23】' }, adv_search: { title: '高级搜索', diff --git a/core/core-frontend/src/views/system/common/InfoTemplate.vue b/core/core-frontend/src/views/system/common/InfoTemplate.vue index 6ce9d2fdb8..dd6752839f 100644 --- a/core/core-frontend/src/views/system/common/InfoTemplate.vue +++ b/core/core-frontend/src/views/system/common/InfoTemplate.vue @@ -48,7 +48,9 @@ @@ -64,7 +66,7 @@ - {{ item.pval + ' ' + executeTime + '执行一次' }} + {{ item.pval + ' ' + executeTime + t('common.every_exec') }} {{ item.pval }} @@ -113,7 +115,7 @@ const props = defineProps({ }, settingTitle: { type: String, - default: '基础设置' + default: t('system.basic_settings') }, hideHead: { type: Boolean, @@ -132,7 +134,7 @@ const props = defineProps({ default: () => [] } }) -const executeTime = ref('0分0秒') +const executeTime = ref(t('system.and_0_seconds')) const curTitle = computed(() => { return props.settingTitle }) @@ -159,8 +161,8 @@ const loadList = () => { const getExecuteTime = val => { const options = [ - { value: 'minute', label: '分钟(执行时间:0秒)' }, - { value: 'hour', label: '小时(执行时间:0分0秒)' } + { value: 'minute', label: t('system.time_0_seconds') }, + { value: 'hour', label: t('system.and_0_seconds_de') } ] return options.filter(item => item.value === val)[0].label } diff --git a/core/core-frontend/src/views/system/font/UploadDetail.vue b/core/core-frontend/src/views/system/font/UploadDetail.vue index bc82af6a20..e1d558b681 100644 --- a/core/core-frontend/src/views/system/font/UploadDetail.vue +++ b/core/core-frontend/src/views/system/font/UploadDetail.vue @@ -2,15 +2,18 @@ import icon_upload_outlined from '@/assets/svg/icon_upload_outlined.svg' import { ref, reactive } from 'vue' import { uploadFontFile } from '@/api/font' +import { useI18n } from '@/hooks/web/useI18n' import FontInfo from './FontInfo.vue' import { ElMessage } from 'element-plus-secondary' import { edit } from '@/api/font' import { cloneDeep } from 'lodash-es' + const state = reactive({ fileList: null }) const loading = ref(false) const upload = ref() +const { t } = useI18n() const uploadExcel = () => { const formData = new FormData() formData.append('file', state.fileList.raw) @@ -53,7 +56,7 @@ const defaultForm = { const ruleForm = reactive(cloneDeep(defaultForm)) const init = (val, type, item) => { - dialogTitle.value = val || '添加字体' + dialogTitle.value = val || t('system.add_font') action.value = type dialogVisible.value = true Object.assign(ruleForm, cloneDeep(defaultForm)) @@ -67,8 +70,8 @@ const fontDel = () => { const ruleFormRef = ref() const rules = { name: [ - { required: true, message: '请输入字体名称', trigger: 'blur' }, - { min: 1, max: 50, message: '字符长度1-50', trigger: 'blur' } + { required: true, message: t('system.the_font_name'), trigger: 'blur' }, + { min: 1, max: 50, message: t('system.character_length_1_50'), trigger: 'blur' } ] } defineExpose({ @@ -77,7 +80,7 @@ defineExpose({ const beforeAvatarUpload = rawFile => { if (!rawFile.name.endsWith('.ttf')) { - ElMessage.error('只支持上传ttf格式的字体文件!') + ElMessage.error(t('system.in_ttf_format')) return false } return true @@ -105,12 +108,12 @@ const confirm = () => { if (val) { if (action.value === 'uploadFile') { if (ruleForm.fileTransName === '') { - ElMessage.error('请上传字库文件') + ElMessage.error(t('system.upload_font_file_de')) return } } edit(ruleForm).then(() => { - ElMessage.success(dialogTitle.value + '成功') + ElMessage.success(dialogTitle.value + t('data_set.success')) cancel() emits('finish') }) @@ -136,10 +139,14 @@ const confirm = () => { label-width="auto" class="demo-ruleForm" > - - + + - + { - 上传字库文件 + {{ t('system.upload_font_file') }} @@ -182,15 +189,17 @@ const confirm = () => { v-show="state.fileList" > diff --git a/core/core-frontend/src/views/system/font/index.vue b/core/core-frontend/src/views/system/font/index.vue index a889125420..2e24c05f91 100644 --- a/core/core-frontend/src/views/system/font/index.vue +++ b/core/core-frontend/src/views/system/font/index.vue @@ -4,12 +4,13 @@ import icon_add_outlined from '@/assets/svg/icon_add_outlined.svg' import { onMounted, ref, computed } from 'vue' import UploadDetail from './UploadDetail.vue' import { useAppearanceStoreWithOut } from '@/store/modules/appearance' +import { useI18n } from '@/hooks/web/useI18n' import { deleteById, edit, defaultFont } from '@/api/font' import { ElMessage, ElMessageBox } from 'element-plus-secondary' import { cloneDeep } from 'lodash-es' const appearanceStore = useAppearanceStoreWithOut() - +const { t } = useI18n() const fontKeyword = ref('') const fontList = ref([]) const basePath = import.meta.env.VITE_API_BASEPATH @@ -35,10 +36,10 @@ const fontListComputed = computed(() => { const deleteFont = item => { if (item.isDefault) { - ElMessage.warning('请先将其他字体设置为默认字体,再进行删除。') + ElMessage.warning(t('system.fonts_before_deleting')) return } - ElMessageBox.confirm('当前字体被删除后,使用该字体的组件将会使用默认字体,确定删除?', { + ElMessageBox.confirm(t('system.sure_to_delete'), { confirmButtonType: 'danger', type: 'warning', autofocus: false, @@ -47,7 +48,7 @@ const deleteFont = item => { loading.value = true deleteById(item.id) .then(() => { - ElMessage.success('删除成功') + ElMessage.success(t('common.delete_success')) listFont() getDefaultFont() }) @@ -62,7 +63,7 @@ const setToDefault = item => { loading.value = true edit(item) .then(() => { - ElMessage.success('设置成功') + ElMessage.success(t('system.setting_successful')) getDefaultFont() listFont() }) @@ -115,9 +116,14 @@ onMounted(() => {