提交 a17d7cc1 authored 作者: taojinlong's avatar taojinlong

Merge branch 'main' of github.com:dataease/dataease into main

...@@ -8,6 +8,7 @@ import io.dataease.commons.utils.BeanUtils; ...@@ -8,6 +8,7 @@ import io.dataease.commons.utils.BeanUtils;
import io.dataease.controller.request.chart.ChartGroupRequest; import io.dataease.controller.request.chart.ChartGroupRequest;
import io.dataease.controller.request.dataset.DataSetTableRequest; import io.dataease.controller.request.dataset.DataSetTableRequest;
import io.dataease.dto.chart.ChartGroupDTO; import io.dataease.dto.chart.ChartGroupDTO;
import io.dataease.i18n.Translator;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -122,7 +123,7 @@ public class ChartGroupService { ...@@ -122,7 +123,7 @@ public class ChartGroupService {
} }
List<ChartGroup> list = chartGroupMapper.selectByExample(chartGroupExample); List<ChartGroup> list = chartGroupMapper.selectByExample(chartGroupExample);
if (list.size() > 0) { if (list.size() > 0) {
throw new RuntimeException("Name can't repeat in same group."); throw new RuntimeException(Translator.get("i18n_name_cant_repeat_same_group"));
} }
} }
} }
...@@ -20,6 +20,7 @@ import io.dataease.dto.chart.ChartViewDTO; ...@@ -20,6 +20,7 @@ import io.dataease.dto.chart.ChartViewDTO;
import io.dataease.dto.chart.ChartViewFieldDTO; import io.dataease.dto.chart.ChartViewFieldDTO;
import io.dataease.dto.chart.Series; import io.dataease.dto.chart.Series;
import io.dataease.dto.dataset.DataTableInfoDTO; import io.dataease.dto.dataset.DataTableInfoDTO;
import io.dataease.i18n.Translator;
import io.dataease.provider.QueryProvider; import io.dataease.provider.QueryProvider;
import io.dataease.service.dataset.DataSetTableFieldsService; import io.dataease.service.dataset.DataSetTableFieldsService;
import io.dataease.service.dataset.DataSetTableService; import io.dataease.service.dataset.DataSetTableService;
...@@ -226,7 +227,7 @@ public class ChartViewService { ...@@ -226,7 +227,7 @@ public class ChartViewService {
} }
List<ChartViewWithBLOBs> list = chartViewMapper.selectByExampleWithBLOBs(chartViewExample); List<ChartViewWithBLOBs> list = chartViewMapper.selectByExampleWithBLOBs(chartViewExample);
if (list.size() > 0) { if (list.size() > 0) {
throw new RuntimeException("Name can't repeat in same group."); throw new RuntimeException(Translator.get("i18n_name_cant_repeat_same_group"));
} }
} }
......
...@@ -11,6 +11,7 @@ import io.dataease.controller.request.dataset.DataSetGroupRequest; ...@@ -11,6 +11,7 @@ import io.dataease.controller.request.dataset.DataSetGroupRequest;
import io.dataease.controller.request.dataset.DataSetTableRequest; import io.dataease.controller.request.dataset.DataSetTableRequest;
import io.dataease.dto.dataset.DataSetGroupDTO; import io.dataease.dto.dataset.DataSetGroupDTO;
import io.dataease.dto.dataset.DataSetTableDTO; import io.dataease.dto.dataset.DataSetTableDTO;
import io.dataease.i18n.Translator;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -133,7 +134,7 @@ public class DataSetGroupService { ...@@ -133,7 +134,7 @@ public class DataSetGroupService {
} }
List<DatasetGroup> list = datasetGroupMapper.selectByExample(datasetGroupExample); List<DatasetGroup> list = datasetGroupMapper.selectByExample(datasetGroupExample);
if (list.size() > 0) { if (list.size() > 0) {
throw new RuntimeException("Name can't repeat in same group."); throw new RuntimeException(Translator.get("i18n_name_cant_repeat_same_group"));
} }
} }
......
...@@ -19,6 +19,7 @@ import io.dataease.dto.dataset.DataSetTableDTO; ...@@ -19,6 +19,7 @@ import io.dataease.dto.dataset.DataSetTableDTO;
import io.dataease.dto.dataset.DataSetTableUnionDTO; import io.dataease.dto.dataset.DataSetTableUnionDTO;
import io.dataease.dto.dataset.DataTableInfoCustomUnion; import io.dataease.dto.dataset.DataTableInfoCustomUnion;
import io.dataease.dto.dataset.DataTableInfoDTO; import io.dataease.dto.dataset.DataTableInfoDTO;
import io.dataease.i18n.Translator;
import io.dataease.provider.DDLProvider; import io.dataease.provider.DDLProvider;
import io.dataease.provider.QueryProvider; import io.dataease.provider.QueryProvider;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
...@@ -177,7 +178,7 @@ public class DataSetTableService { ...@@ -177,7 +178,7 @@ public class DataSetTableService {
.id("count") .id("count")
.tableId(dataSetTableRequest.getId()) .tableId(dataSetTableRequest.getId())
.originName("*") .originName("*")
.name("记录数*") .name(Translator.get("i18n_chart_count"))
.dataeaseName("*") .dataeaseName("*")
.type("INT") .type("INT")
.checked(true) .checked(true)
...@@ -500,7 +501,7 @@ public class DataSetTableService { ...@@ -500,7 +501,7 @@ public class DataSetTableService {
return; return;
} }
QueryProvider qp = null; QueryProvider qp = null;
if(!ObjectUtils.isEmpty(ds)) { if (!ObjectUtils.isEmpty(ds)) {
qp = ProviderFactory.getQueryProvider(ds.getType()); qp = ProviderFactory.getQueryProvider(ds.getType());
} }
if (CollectionUtils.isNotEmpty(fields)) { if (CollectionUtils.isNotEmpty(fields)) {
...@@ -611,7 +612,7 @@ public class DataSetTableService { ...@@ -611,7 +612,7 @@ public class DataSetTableService {
} }
List<DatasetTable> list = datasetTableMapper.selectByExample(datasetTableExample); List<DatasetTable> list = datasetTableMapper.selectByExample(datasetTableExample);
if (list.size() > 0) { if (list.size() > 0) {
throw new RuntimeException("Name can't repeat in same group."); throw new RuntimeException(Translator.get("i18n_name_cant_repeat_same_group"));
} }
} }
...@@ -647,11 +648,11 @@ public class DataSetTableService { ...@@ -647,11 +648,11 @@ public class DataSetTableService {
if (StringUtils.equalsIgnoreCase(suffix, "xls")) { if (StringUtils.equalsIgnoreCase(suffix, "xls")) {
HSSFWorkbook workbook = new HSSFWorkbook(inputStream); HSSFWorkbook workbook = new HSSFWorkbook(inputStream);
HSSFSheet sheet0 = workbook.getSheetAt(0); HSSFSheet sheet0 = workbook.getSheetAt(0);
for (int i=0;i<workbook.getNumberOfSheets();i++){ for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
sheets.add(workbook.getSheetAt(i).getSheetName()); sheets.add(workbook.getSheetAt(i).getSheetName());
} }
if (sheet0.getNumMergedRegions() > 0) { if (sheet0.getNumMergedRegions() > 0) {
throw new RuntimeException("Sheet have merged regions."); throw new RuntimeException(Translator.get("i18n_excel_have_merge_region"));
} }
int rows; int rows;
if (isPreview) { if (isPreview) {
...@@ -668,7 +669,7 @@ public class DataSetTableService { ...@@ -668,7 +669,7 @@ public class DataSetTableService {
tableFiled.setFieldType("TEXT"); tableFiled.setFieldType("TEXT");
tableFiled.setFieldSize(1024); tableFiled.setFieldSize(1024);
String columnName = readCell(row.getCell(j)); String columnName = readCell(row.getCell(j));
if(StringUtils.isEmpty(columnName)){ if (StringUtils.isEmpty(columnName)) {
columnName = "NONE_" + String.valueOf(j); columnName = "NONE_" + String.valueOf(j);
} }
tableFiled.setFieldName(columnName); tableFiled.setFieldName(columnName);
...@@ -686,11 +687,11 @@ public class DataSetTableService { ...@@ -686,11 +687,11 @@ public class DataSetTableService {
} else if (StringUtils.equalsIgnoreCase(suffix, "xlsx")) { } else if (StringUtils.equalsIgnoreCase(suffix, "xlsx")) {
XSSFWorkbook xssfWorkbook = new XSSFWorkbook(inputStream); XSSFWorkbook xssfWorkbook = new XSSFWorkbook(inputStream);
XSSFSheet sheet0 = xssfWorkbook.getSheetAt(0); XSSFSheet sheet0 = xssfWorkbook.getSheetAt(0);
for (int i=0;i<xssfWorkbook.getNumberOfSheets();i++){ for (int i = 0; i < xssfWorkbook.getNumberOfSheets(); i++) {
sheets.add(xssfWorkbook.getSheetAt(i).getSheetName()); sheets.add(xssfWorkbook.getSheetAt(i).getSheetName());
} }
if (sheet0.getNumMergedRegions() > 0) { if (sheet0.getNumMergedRegions() > 0) {
throw new RuntimeException("Sheet have merged regions."); throw new RuntimeException(Translator.get("i18n_excel_have_merge_region"));
} }
int rows; int rows;
if (isPreview) { if (isPreview) {
...@@ -707,7 +708,7 @@ public class DataSetTableService { ...@@ -707,7 +708,7 @@ public class DataSetTableService {
tableFiled.setFieldType("TEXT"); tableFiled.setFieldType("TEXT");
tableFiled.setFieldSize(1024); tableFiled.setFieldSize(1024);
String columnName = readCell(row.getCell(j)); String columnName = readCell(row.getCell(j));
if(StringUtils.isEmpty(columnName)){ if (StringUtils.isEmpty(columnName)) {
columnName = "NONE_" + String.valueOf(j); columnName = "NONE_" + String.valueOf(j);
} }
tableFiled.setFieldName(columnName); tableFiled.setFieldName(columnName);
......
...@@ -3,6 +3,7 @@ package io.dataease.service.dataset; ...@@ -3,6 +3,7 @@ package io.dataease.service.dataset;
import io.dataease.base.domain.DatasetTableTask; import io.dataease.base.domain.DatasetTableTask;
import io.dataease.base.domain.DatasetTableTaskExample; import io.dataease.base.domain.DatasetTableTaskExample;
import io.dataease.base.mapper.DatasetTableTaskMapper; import io.dataease.base.mapper.DatasetTableTaskMapper;
import io.dataease.i18n.Translator;
import io.dataease.service.ScheduleService; import io.dataease.service.ScheduleService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.quartz.CronExpression; import org.quartz.CronExpression;
...@@ -31,7 +32,7 @@ public class DataSetTableTaskService { ...@@ -31,7 +32,7 @@ public class DataSetTableTaskService {
// check // check
if (StringUtils.isNotEmpty(datasetTableTask.getCron())) { if (StringUtils.isNotEmpty(datasetTableTask.getCron())) {
if (!CronExpression.isValidExpression(datasetTableTask.getCron())) { if (!CronExpression.isValidExpression(datasetTableTask.getCron())) {
throw new RuntimeException("cron expression error."); throw new RuntimeException(Translator.get("i18n_cron_expression_error"));
} }
} }
if (StringUtils.isEmpty(datasetTableTask.getId())) { if (StringUtils.isEmpty(datasetTableTask.getId())) {
......
...@@ -228,3 +228,7 @@ i18n_auth_export=Export ...@@ -228,3 +228,7 @@ i18n_auth_export=Export
i18n_auth_manage=Manage i18n_auth_manage=Manage
i18n_template_system=System Template i18n_template_system=System Template
i18n_template_self=Self Template i18n_template_self=Self Template
i18n_name_cant_repeat_same_group=Name is already exists in the same group
i18n_chart_count=Count*
i18n_excel_have_merge_region=Excel has merged region
i18n_cron_expression_error=Cron expression error
...@@ -229,3 +229,7 @@ i18n_auth_export=导出 ...@@ -229,3 +229,7 @@ i18n_auth_export=导出
i18n_auth_manage=管理 i18n_auth_manage=管理
i18n_template_system=系统模板 i18n_template_system=系统模板
i18n_template_self=用户模板 i18n_template_self=用户模板
i18n_name_cant_repeat_same_group=同一分组下名称不能重复
i18n_chart_count=记录数*
i18n_excel_have_merge_region=Excel存在合并单元格
i18n_cron_expression_error=Cron表达式校验错误
...@@ -229,3 +229,7 @@ i18n_auth_export=導出 ...@@ -229,3 +229,7 @@ i18n_auth_export=導出
i18n_auth_manage=管理 i18n_auth_manage=管理
i18n_template_system=系統模板 i18n_template_system=系統模板
i18n_template_self=用戶模板 i18n_template_self=用戶模板
i18n_name_cant_repeat_same_group=同一分組下名稱不能重復
i18n_chart_count=記錄數*
i18n_excel_have_merge_region=Excel存在合並單元格
i18n_cron_expression_error=Cron表達式校驗錯誤
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
{{ item.name }}<i class="el-icon-arrow-down el-icon--right" /> {{ item.name }}<i class="el-icon-arrow-down el-icon--right" />
</el-tag> </el-tag>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item icon="el-icon-delete" divided :command="beforeClickItem('remove')"> <el-dropdown-item icon="el-icon-delete" :command="beforeClickItem('remove')">
<span>{{ $t('chart.delete') }}</span> <span>{{ $t('chart.delete') }}</span>
</el-dropdown-item> </el-dropdown-item>
<slot /> <slot />
......
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
</el-form-item> </el-form-item>
<el-form-item v-if="taskForm.rate === 'CRON'" label=""> <el-form-item v-if="taskForm.rate === 'CRON'" label="">
<el-popover v-model="cronEdit"> <el-popover v-model="cronEdit">
<cron i18n="cn" @close="cronEdit = false" @change="cronChange" /> <cron :i18n="lang" @close="cronEdit = false" @change="cronChange" />
<el-input slot="reference" v-model="taskForm.cron" size="mini" style="width: 50%" @click="cronEdit = true" /> <el-input slot="reference" v-model="taskForm.cron" size="mini" style="width: 50%" @click="cronEdit = true" />
</el-popover> </el-popover>
</el-form-item> </el-form-item>
...@@ -354,7 +354,8 @@ export default { ...@@ -354,7 +354,8 @@ export default {
incrementalUpdateType: 'incrementalAdd', incrementalUpdateType: 'incrementalAdd',
sql: '', sql: '',
incrementalConfig: {}, incrementalConfig: {},
cronEdit: false cronEdit: false,
lang: this.$store.getters.language === 'en_US' ? 'en' : 'cn'
} }
}, },
computed: { computed: {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论