mirror of
https://github.com/dataease/dataease.git
synced 2026-05-15 05:22:13 +08:00
refactor(仪表板、数据大屏): 国际化适配 (#14496)
This commit is contained in:
@@ -3,6 +3,7 @@ package io.dataease.visualization.server;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.dataease.api.visualization.VisualizationBackgroundApi;
|
||||
import io.dataease.api.visualization.vo.VisualizationBackgroundVO;
|
||||
import io.dataease.i18n.Translator;
|
||||
import io.dataease.utils.BeanUtils;
|
||||
import io.dataease.visualization.dao.auto.entity.VisualizationBackground;
|
||||
import io.dataease.visualization.dao.auto.mapper.VisualizationBackgroundMapper;
|
||||
@@ -30,6 +31,7 @@ public class VisualizationBackgroundService implements VisualizationBackgroundAp
|
||||
return result.stream().map(vb ->{
|
||||
VisualizationBackgroundVO vbVO = new VisualizationBackgroundVO();
|
||||
BeanUtils.copyBean(vbVO,vb);
|
||||
vbVO.setName(Translator.get("i18n_board")+vbVO.getName());
|
||||
return vbVO;
|
||||
}).collect(Collectors.groupingBy(VisualizationBackgroundVO::getClassification));
|
||||
}
|
||||
|
||||
@@ -190,5 +190,6 @@ i18n_dataset_create_error=Create error,please try again
|
||||
i18n_dataset_ds_delete=Datasource deleted,this dataset can not be show
|
||||
i18n_dataset_plugin_error=Datasource plugin is not exist
|
||||
i18n_dataset_cross_error=Dataset with more than two data sources is not supported
|
||||
i18n_board=Board
|
||||
|
||||
|
||||
|
||||
@@ -189,3 +189,4 @@ i18n_dataset_create_error=\u6570\u636e\u96c6\u56e0\u5f02\u5e38\u5bfc\u81f4\u65e0
|
||||
i18n_dataset_ds_delete=\u7531\u4e8e\u6570\u636e\u96c6\u6240\u7528\u7684\u6570\u636e\u6e90\u5df2\u88ab\u5220\u9664\2c\u65e0\u6cd5\u663e\u793a\u6570\u636e\u96c6
|
||||
i18n_dataset_plugin_error=\u5f53\u524d\u6570\u636e\u6e90\u63d2\u4ef6\u4e0d\u5b58\u5728
|
||||
i18n_dataset_cross_error=\u8de8\u6e90\u6570\u636e\u96c6\u4e0d\u652f\u6301\u8be5\u529f\u80fd
|
||||
i18n_board=\u8fb9\u6846
|
||||
|
||||
@@ -189,4 +189,5 @@ i18n_dataset_create_error=\u6578\u64da\u96c6\u56e0\u7570\u5e38\u5c0e\u81f4\u7121
|
||||
i18n_dataset_ds_delete=\u7531\u4e8e\u6578\u64da\u96c6\u6240\u7528\u7684\u6578\u64da\u6e90\u5df2\u88ab\u522a\u9664\2c\u7121\u6cd5\u986f\u793a\u6578\u64da\u96c6
|
||||
i18n_dataset_plugin_error=\u7576\u524d\u6578\u64da\u6e90\u63d2\u4ef6\u4e0d\u5b58\u5728
|
||||
i18n_dataset_cross_error=\u8de8\u6e90\u6578\u64da\u96c6\u4e0d\u652f\u6301\u8a72\u529f\u80fd
|
||||
i18n_board=\u908a\u6846
|
||||
|
||||
|
||||
@@ -37,6 +37,18 @@ const onEventChange = () => {
|
||||
const onJumpValueChange = () => {
|
||||
snapshotStore.recordSnapshotCacheToMobile('events')
|
||||
}
|
||||
const getTypeLabel = type => {
|
||||
return typeMap[type] || type
|
||||
}
|
||||
const typeMap = {
|
||||
jump: t('visualization.jump'),
|
||||
download: t('visualization.download'),
|
||||
share: t('visualization.share'),
|
||||
fullScreen: t('visualization.fullscreen'),
|
||||
showHidden: t('visualization.pop_area'),
|
||||
refreshDataV: t('visualization.refresh'),
|
||||
refreshView: t('visualization.refresh_view')
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -74,7 +86,7 @@ const onJumpValueChange = () => {
|
||||
size="small"
|
||||
:effect="themes"
|
||||
:key="typeInfo.key"
|
||||
:label="typeInfo.label"
|
||||
:label="getTypeLabel(typeInfo.label)"
|
||||
:value="typeInfo.key"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
@@ -26,13 +26,13 @@ export const BASE_EVENTS = {
|
||||
showTips: false,
|
||||
type: 'jump', // openHidden jump
|
||||
typeList: [
|
||||
{ key: 'jump', label: t('visualization.jump') },
|
||||
{ key: 'download', label: t('visualization.download') },
|
||||
{ key: 'share', label: t('visualization.share') },
|
||||
{ key: 'fullScreen', label: t('visualization.fullscreen') },
|
||||
{ key: 'showHidden', label: t('visualization.pop_area') },
|
||||
{ key: 'refreshDataV', label: t('visualization.refresh') },
|
||||
{ key: 'refreshView', label: t('visualization.refresh_view') }
|
||||
{ key: 'jump', label: 'jump' },
|
||||
{ key: 'download', label: 'download' },
|
||||
{ key: 'share', label: 'share' },
|
||||
{ key: 'fullScreen', label: 'fullScreen' },
|
||||
{ key: 'showHidden', label: 'showHidden' },
|
||||
{ key: 'refreshDataV', label: 'refreshDataV' },
|
||||
{ key: 'refreshView', label: 'refreshView' }
|
||||
],
|
||||
jump: {
|
||||
value: 'https://',
|
||||
|
||||
@@ -2796,6 +2796,7 @@ Scatter chart (bubble) chart: {a} (series name), {b} (data name), {c} (value arr
|
||||
column_name: 'Field name'
|
||||
},
|
||||
visualization: {
|
||||
multi_selected: '{0} components selected',
|
||||
number1: '1',
|
||||
number2: '2',
|
||||
number3: '3',
|
||||
|
||||
@@ -2726,6 +2726,7 @@ export default {
|
||||
column_name: '欄位名稱'
|
||||
},
|
||||
visualization: {
|
||||
multi_selected: '已選{0}項',
|
||||
number1: '一',
|
||||
number2: '二',
|
||||
number3: '三',
|
||||
|
||||
@@ -2728,6 +2728,7 @@ export default {
|
||||
column_name: '字段名称'
|
||||
},
|
||||
visualization: {
|
||||
multi_selected: '已选{0}项',
|
||||
number1: '一',
|
||||
number2: '二',
|
||||
number3: '三',
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<template #footer>
|
||||
<el-row class="multiplexing-footer">
|
||||
<el-col class="adapt-count">
|
||||
<span>{{ (t('visualization.component_style'), [selectComponentCount]) }}</span>
|
||||
<span>{{ t('visualization.multi_selected', [selectComponentCount]) }} </span>
|
||||
</el-col>
|
||||
<el-col class="adapt-select">
|
||||
<span class="adapt-text">{{ t('visualization.component_style') }} : </span>
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.dataease.api.visualization;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
import io.dataease.api.visualization.request.VisualizationBackgroundRequest;
|
||||
import io.dataease.api.visualization.vo.VisualizationBackgroundVO;
|
||||
import io.dataease.i18n.I18n;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -20,5 +21,6 @@ import java.util.Map;
|
||||
public interface VisualizationBackgroundApi {
|
||||
@GetMapping("/findAll")
|
||||
@Operation(summary = "背景信息查询")
|
||||
@I18n
|
||||
Map<String, List<VisualizationBackgroundVO>> findAll();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user