Merge branch 'dev' into pr@dev@fix_i18n

# Conflicts:
#	frontend/src/views/chart/view/CalcChartFieldEdit.vue
#	frontend/src/views/dataset/data/CalcFieldEdit.vue
This commit is contained in:
wisonic-s 2022-11-30 19:30:18 +08:00
commit 1f827b0a07
61 changed files with 489 additions and 252 deletions

View File

@ -12,10 +12,13 @@ import javax.servlet.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.io.*;
import java.util.ArrayList;
import java.util.List;
public class SqlFilter implements Filter { public class SqlFilter implements Filter {
private List<String> excludedUris = new ArrayList<>();
@Override @Override
public void destroy() { public void destroy() {
@ -34,38 +37,43 @@ public class SqlFilter implements Filter {
return; return;
} }
String method = "GET"; if(excludedUris.contains(((HttpServletRequest) request).getRequestURI())){
String param; chain.doFilter(request, response);
XssAndSqlHttpServletRequestWrapper xssRequest = null; }else {
if (request instanceof HttpServletRequest) { String method = "GET";
method = ((HttpServletRequest) request).getMethod(); String param;
xssRequest = new XssAndSqlHttpServletRequestWrapper((HttpServletRequest) request); XssAndSqlHttpServletRequestWrapper xssRequest = null;
} if (request instanceof HttpServletRequest) {
if ("POST".equalsIgnoreCase(method)) { method = ((HttpServletRequest) request).getMethod();
param = this.getBodyString(xssRequest.getReader()); xssRequest = new XssAndSqlHttpServletRequestWrapper((HttpServletRequest) request);
if (StringUtils.isNotBlank(param)) { }
if (xssRequest.checkXSSAndSql(param)) { if ("POST".equalsIgnoreCase(method)) {
response.setCharacterEncoding("UTF-8"); param = this.getBodyString(xssRequest.getReader());
response.setContentType("application/json;charset=UTF-8"); if (StringUtils.isNotBlank(param)) {
String msg = ThreadLocalContextHolder.getData().toString(); if (xssRequest.checkXSSAndSql(param)) {
DEException.throwException(msg); response.setCharacterEncoding("UTF-8");
return; response.setContentType("application/json;charset=UTF-8");
String msg = ThreadLocalContextHolder.getData().toString();
DEException.throwException(msg);
return;
}
} }
} }
if (xssRequest.checkParameter()) {
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json;charset=UTF-8");
String msg = ThreadLocalContextHolder.getData().toString();
DEException.throwException(msg);
return;
}
chain.doFilter(xssRequest, response);
} }
if (xssRequest.checkParameter()) {
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json;charset=UTF-8");
String msg = ThreadLocalContextHolder.getData().toString();
DEException.throwException(msg);
return;
}
chain.doFilter(xssRequest, response);
} }
@Override @Override
public void init(FilterConfig filterConfig) throws ServletException { public void init(FilterConfig filterConfig) throws ServletException {
excludedUris.add("/dataset/table/excel/upload");
} }
// 获取request请求body中参数 // 获取request请求body中参数

View File

@ -149,7 +149,7 @@
</select> </select>
<select id="findByTableIds" resultMap="BaseResultMapDTO"> <select id="findByTableIds" resultMap="BaseResultMapDTO">
select dataset_table.* select distinct dataset_table.*
from dataset_table from dataset_table
where dataset_table.id in where dataset_table.id in
<foreach collection="tableIds" item="item" open="(" separator="," close=")"> <foreach collection="tableIds" item="item" open="(" separator="," close=")">

View File

@ -390,7 +390,11 @@ public class DorisQueryProvider extends QueryProvider {
originField = String.format(DorisConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName()); originField = String.format(DorisConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName());
} else { } else {
if (x.getDeType() == 2 || x.getDeType() == 3) { if (x.getDeType() == 2 || x.getDeType() == 3) {
originField = String.format(DorisConstants.CAST, String.format(DorisConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName()), DorisConstants.DEFAULT_FLOAT_FORMAT); if (x.getDeExtractType() == 1) {
originField = String.format(DorisConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName());
} else {
originField = String.format(DorisConstants.CAST, String.format(DorisConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName()), DorisConstants.DEFAULT_FLOAT_FORMAT);
}
} else { } else {
originField = String.format(DorisConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName()); originField = String.format(DorisConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName());
} }

View File

@ -1338,8 +1338,9 @@ public class SqlserverQueryProvider extends QueryProvider {
public List<Dateformat> dateformat() { public List<Dateformat> dateformat() {
return JSONArray.parseArray("[\n" + return JSONArray.parseArray("[\n" +
"{\"dateformat\": \"102\", \"desc\": \"yyyy.mm.dd\"},\n" + "{\"dateformat\": \"102\", \"desc\": \"yyyy.mm.dd\"},\n" +
"{\"dateformat\": \"23\", \"desc\": \"yyyy-mm-dd\"},\n" + "{\"dateformat\": \"120\", \"desc\": \"yyyy-mm-dd\"},\n" +
"{\"dateformat\": \"111\", \"desc\": \"yyyy/mm/dd\"},\n" + "{\"dateformat\": \"111\", \"desc\": \"yyyy/mm/dd\"},\n" +
"{\"dateformat\": \"112\", \"desc\": \"yyyymmdd\"},\n" +
"{\"dateformat\": \"120\", \"desc\": \"yyyy-mm-dd hh:mi:ss\"}\n" + "{\"dateformat\": \"120\", \"desc\": \"yyyy-mm-dd hh:mi:ss\"}\n" +
"]", Dateformat.class); "]", Dateformat.class);
} }

View File

@ -982,7 +982,8 @@ public class ChartViewService {
} }
if (StringUtils.isNotEmpty(totalPageSql) && StringUtils.equalsIgnoreCase((String) mapSize.get("tablePageMode"), "page")) { if (StringUtils.isNotEmpty(totalPageSql) && StringUtils.equalsIgnoreCase((String) mapSize.get("tablePageMode"), "page")) {
datasourceRequest.setQuery(totalPageSql); datasourceRequest.setQuery(totalPageSql);
totalItems = Long.valueOf(datasourceProvider.getData(datasourceRequest).get(0)[0]); java.util.List<java.lang.String[]> datas = datasourceProvider.getData(datasourceRequest);
totalItems = CollectionUtils.isEmpty(datas) ? 0 : Long.valueOf(datas.get(0)[0]);
totalPage = (totalItems / pageInfo.getPageSize()) + (totalItems % pageInfo.getPageSize() > 0 ? 1 : 0); totalPage = (totalItems / pageInfo.getPageSize()) + (totalItems % pageInfo.getPageSize() > 0 ? 1 : 0);
} }

View File

@ -2,11 +2,16 @@ package io.dataease.service.dataset;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
import io.dataease.ext.ExtChartViewMapper;
import io.dataease.commons.constants.*; import io.dataease.commons.constants.*;
import io.dataease.commons.model.AuthURD; import io.dataease.commons.model.AuthURD;
import io.dataease.commons.utils.*; import io.dataease.commons.utils.*;
import io.dataease.controller.request.datasource.ApiDefinition; import io.dataease.controller.request.datasource.ApiDefinition;
import io.dataease.dto.dataset.DataTableInfoDTO;
import io.dataease.dto.dataset.ExcelSheetData;
import io.dataease.dto.datasource.*;
import io.dataease.exception.DataEaseException;
import io.dataease.ext.ExtChartViewMapper;
import io.dataease.listener.util.CacheUtils;
import io.dataease.plugins.common.base.domain.*; import io.dataease.plugins.common.base.domain.*;
import io.dataease.plugins.common.constants.DatasetType; import io.dataease.plugins.common.constants.DatasetType;
import io.dataease.plugins.common.constants.DatasourceTypes; import io.dataease.plugins.common.constants.DatasourceTypes;
@ -17,14 +22,9 @@ import io.dataease.plugins.datasource.entity.JdbcConfiguration;
import io.dataease.plugins.datasource.provider.Provider; import io.dataease.plugins.datasource.provider.Provider;
import io.dataease.plugins.datasource.query.QueryProvider; import io.dataease.plugins.datasource.query.QueryProvider;
import io.dataease.provider.DDLProvider; import io.dataease.provider.DDLProvider;
import io.dataease.provider.datasource.JdbcProvider;
import io.dataease.provider.ProviderFactory; import io.dataease.provider.ProviderFactory;
import io.dataease.dto.datasource.*; import io.dataease.provider.datasource.JdbcProvider;
import io.dataease.service.datasource.DatasourceService; import io.dataease.service.datasource.DatasourceService;
import io.dataease.dto.dataset.DataTableInfoDTO;
import io.dataease.dto.dataset.ExcelSheetData;
import io.dataease.exception.DataEaseException;
import io.dataease.listener.util.CacheUtils;
import io.dataease.service.engine.EngineService; import io.dataease.service.engine.EngineService;
import io.dataease.service.kettle.KettleService; import io.dataease.service.kettle.KettleService;
import io.dataease.service.message.DeMsgutil; import io.dataease.service.message.DeMsgutil;
@ -413,7 +413,7 @@ public class ExtractDataService {
} }
private List<DatasetTableField> getDatasetTableFields(String datasetTableId) { public List<DatasetTableField> getDatasetTableFields(String datasetTableId) {
List<DatasetTableField> datasetTableFields = dataSetTableFieldsService.list(DatasetTableField.builder().tableId(datasetTableId).build()); List<DatasetTableField> datasetTableFields = dataSetTableFieldsService.list(DatasetTableField.builder().tableId(datasetTableId).build());
datasetTableFields = datasetTableFields.stream().filter(datasetTableField -> datasetTableField.getExtField() == 0).collect(Collectors.toList()); datasetTableFields = datasetTableFields.stream().filter(datasetTableField -> datasetTableField.getExtField() == 0).collect(Collectors.toList());
datasetTableFields.sort((o1, o2) -> { datasetTableFields.sort((o1, o2) -> {
@ -617,7 +617,7 @@ public class ExtractDataService {
dataSetTableTaskLogService.save(datasetTableTaskLog, hasTask); dataSetTableTaskLogService.save(datasetTableTaskLog, hasTask);
} }
private void createEngineTable(String tableName, List<DatasetTableField> datasetTableFields) throws Exception { public void createEngineTable(String tableName, List<DatasetTableField> datasetTableFields) throws Exception {
Datasource engine = engineService.getDeEngine(); Datasource engine = engineService.getDeEngine();
JdbcProvider jdbcProvider = CommonBeanFactory.getBean(JdbcProvider.class); JdbcProvider jdbcProvider = CommonBeanFactory.getBean(JdbcProvider.class);
DatasourceRequest datasourceRequest = new DatasourceRequest(); DatasourceRequest datasourceRequest = new DatasourceRequest();
@ -793,7 +793,7 @@ public class ExtractDataService {
Thread.sleep(1000); Thread.sleep(1000);
} }
if (jobStatus.getStatusDescription().equals("Finished")) { if (jobStatus.getStatusDescription().equals("Finished")) {
LogUtil.info(datasetTable.getId()+ ": " + jobStatus.getLoggingString()); LogUtil.info(datasetTable.getId() + ": " + jobStatus.getLoggingString());
return; return;
} else { } else {
DataEaseException.throwException(jobStatus.getLoggingString()); DataEaseException.throwException(jobStatus.getLoggingString());
@ -1029,7 +1029,7 @@ public class ExtractDataService {
if (extractType.equalsIgnoreCase("all_scope") && datasetTable.getType().equalsIgnoreCase(DatasetType.SQL.name())) { if (extractType.equalsIgnoreCase("all_scope") && datasetTable.getType().equalsIgnoreCase(DatasetType.SQL.name())) {
DataTableInfoDTO dataTableInfoDTO = new Gson().fromJson(datasetTable.getInfo(), DataTableInfoDTO.class); DataTableInfoDTO dataTableInfoDTO = new Gson().fromJson(datasetTable.getInfo(), DataTableInfoDTO.class);
selectSQL = dataTableInfoDTO.getSql(); selectSQL = dataTableInfoDTO.getSql();
if(dataTableInfoDTO.isBase64Encryption()){ if (dataTableInfoDTO.isBase64Encryption()) {
selectSQL = new String(java.util.Base64.getDecoder().decode(selectSQL)); selectSQL = new String(java.util.Base64.getDecoder().decode(selectSQL));
} }
QueryProvider qp = ProviderFactory.getQueryProvider(datasource.getType()); QueryProvider qp = ProviderFactory.getQueryProvider(datasource.getType());
@ -1056,13 +1056,13 @@ public class ExtractDataService {
} }
private List<StepMeta> excelInputStep(String Info, List<DatasetTableField> datasetTableFields) { private List<StepMeta> excelInputStep(String Info, List<DatasetTableField> datasetTableFields) {
List<StepMeta>inputSteps = new ArrayList<>(); List<StepMeta> inputSteps = new ArrayList<>();
DataTableInfoDTO dataTableInfoDTO = new Gson().fromJson(Info, DataTableInfoDTO.class); DataTableInfoDTO dataTableInfoDTO = new Gson().fromJson(Info, DataTableInfoDTO.class);
List<ExcelSheetData> excelSheetDataList = dataTableInfoDTO.getExcelSheetDataList(); List<ExcelSheetData> excelSheetDataList = dataTableInfoDTO.getExcelSheetDataList();
List<String> sheetNames = new ArrayList<>(); List<String> sheetNames = new ArrayList<>();
int size =1; int size = 1;
for (ExcelSheetData excelSheetData : excelSheetDataList) { for (ExcelSheetData excelSheetData : excelSheetDataList) {
StepMeta fromStep = null; StepMeta fromStep = null;
String suffix = excelSheetData.getPath().substring(excelSheetDataList.get(0).getPath().lastIndexOf(".") + 1); String suffix = excelSheetData.getPath().substring(excelSheetDataList.get(0).getPath().lastIndexOf(".") + 1);
@ -1090,7 +1090,7 @@ public class ExtractDataService {
fromStep.setDraw(true); fromStep.setDraw(true);
fromStep.setLocation(100, 100 * size); fromStep.setLocation(100, 100 * size);
inputSteps.add(fromStep); inputSteps.add(fromStep);
}else { } else {
List<String> files = new ArrayList<>(); List<String> files = new ArrayList<>();
files.add(excelSheetData.getPath()); files.add(excelSheetData.getPath());
@ -1240,7 +1240,7 @@ public class ExtractDataService {
if (StringUtils.isNotEmpty(charset)) { if (StringUtils.isNotEmpty(charset)) {
String varcharFields = datasetTableFields.stream().filter(datasetTableField -> datasetTableField.getDeExtractType() == 0).map(DatasetTableField::getOriginName).collect(Collectors.joining(",")); String varcharFields = datasetTableFields.stream().filter(datasetTableField -> datasetTableField.getDeExtractType() == 0).map(DatasetTableField::getOriginName).collect(Collectors.joining(","));
tmp_code = tmp_code.replace("handleCharset", handleCharset.replace("Datasource_Charset", charset).replace("Target_Charset", targetCharset).replace("varcharFields", varcharFields)); tmp_code = tmp_code.replace("handleCharset", handleCharset.replace("Datasource_Charset", charset).replace("Target_Charset", targetCharset).replace("varcharFields", varcharFields));
}else { } else {
tmp_code = tmp_code.replace("handleCharset", ""); tmp_code = tmp_code.replace("handleCharset", "");
} }
} else { } else {

View File

@ -20,6 +20,7 @@ import io.dataease.service.chart.ChartViewService;
import io.dataease.service.dataset.DataSetGroupService; import io.dataease.service.dataset.DataSetGroupService;
import io.dataease.service.dataset.DataSetTableFieldsService; import io.dataease.service.dataset.DataSetTableFieldsService;
import io.dataease.service.dataset.DataSetTableService; import io.dataease.service.dataset.DataSetTableService;
import io.dataease.service.dataset.ExtractDataService;
import io.dataease.service.datasource.DatasourceService; import io.dataease.service.datasource.DatasourceService;
import io.dataease.service.staticResource.StaticResourceService; import io.dataease.service.staticResource.StaticResourceService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -68,6 +69,8 @@ public class PanelAppTemplateService {
private DataSetGroupService dataSetGroupService; private DataSetGroupService dataSetGroupService;
@Resource @Resource
private StaticResourceService staticResourceService; private StaticResourceService staticResourceService;
@Resource
private ExtractDataService extractDataService;
public List<PanelAppTemplateWithBLOBs> list(PanelAppTemplateRequest request) { public List<PanelAppTemplateWithBLOBs> list(PanelAppTemplateRequest request) {
return extPanelAppTemplateMapper.queryBaseInfo(request.getNodeType(), request.getPid()); return extPanelAppTemplateMapper.queryBaseInfo(request.getNodeType(), request.getPid());
@ -209,6 +212,7 @@ public class PanelAppTemplateService {
DatasetTableField newTableField = dataSetTableFieldsService.save(datasetTableField); DatasetTableField newTableField = dataSetTableFieldsService.save(datasetTableField);
datasetFieldsRealMap.put(oldId, newTableField.getId()); datasetFieldsRealMap.put(oldId, newTableField.getId());
datasetFieldsMd5FormatRealMap.put(TableUtils.fieldNameShort(oldTableId + "_" + datasetTableField.getOriginName()), TableUtils.fieldNameShort(newTableField.getTableId() + "_" + datasetTableField.getOriginName())); datasetFieldsMd5FormatRealMap.put(TableUtils.fieldNameShort(oldTableId + "_" + datasetTableField.getOriginName()), TableUtils.fieldNameShort(newTableField.getTableId() + "_" + datasetTableField.getOriginName()));
datasetFieldsMd5FormatRealMap.put(TableUtils.fieldName(oldTableId + "_" + datasetTableField.getDataeaseName()), TableUtils.fieldName(newTableField.getTableId() + "_" + datasetTableField.getDataeaseName()));
} }
} }
//数据集计算字段替换 //数据集计算字段替换
@ -225,6 +229,8 @@ public class PanelAppTemplateService {
DatasetTableField newTableField = dataSetTableFieldsService.save(datasetTableField); DatasetTableField newTableField = dataSetTableFieldsService.save(datasetTableField);
datasetFieldsRealMap.put(oldId, newTableField.getId()); datasetFieldsRealMap.put(oldId, newTableField.getId());
datasetFieldsMd5FormatRealMap.put(TableUtils.fieldNameShort(oldTableId + "_" + oldOriginName), TableUtils.fieldNameShort(newTableField.getTableId() + "_" + datasetTableField.getOriginName())); datasetFieldsMd5FormatRealMap.put(TableUtils.fieldNameShort(oldTableId + "_" + oldOriginName), TableUtils.fieldNameShort(newTableField.getTableId() + "_" + datasetTableField.getOriginName()));
datasetFieldsMd5FormatRealMap.put(TableUtils.fieldName(oldTableId + "_" + datasetTableField.getDataeaseName()), TableUtils.fieldName(newTableField.getTableId() + "_" + datasetTableField.getDataeaseName()));
} }
} }
@ -233,13 +239,28 @@ public class PanelAppTemplateService {
if (DatasetType.UNION.name().equalsIgnoreCase(datasetTypeRealMap.get(datasetTableField.getTableId())) || DatasetType.CUSTOM.name().equalsIgnoreCase(datasetTypeRealMap.get(datasetTableField.getTableId()))) { if (DatasetType.UNION.name().equalsIgnoreCase(datasetTypeRealMap.get(datasetTableField.getTableId())) || DatasetType.CUSTOM.name().equalsIgnoreCase(datasetTypeRealMap.get(datasetTableField.getTableId()))) {
DatasetTableField updateField = new DatasetTableField(); DatasetTableField updateField = new DatasetTableField();
updateField.setId(datasetTableField.getId()); updateField.setId(datasetTableField.getId());
updateField.setOriginName(datasetFieldsMd5FormatRealMap.get(datasetTableField.getOriginName())); String newOriginName = datasetFieldsMd5FormatRealMap.get(datasetTableField.getOriginName());
dataSetTableFieldsService.updateByPrimaryKeySelective(updateField); String dataeaseName = datasetFieldsMd5FormatRealMap.get(datasetTableField.getDataeaseName());
if (StringUtils.isNotEmpty(newOriginName) || StringUtils.isNotEmpty(dataeaseName)) {
updateField.setOriginName(datasetFieldsMd5FormatRealMap.get(datasetTableField.getOriginName()));
updateField.setDataeaseName(datasetFieldsMd5FormatRealMap.get(datasetTableField.getDataeaseName()));
dataSetTableFieldsService.updateByPrimaryKeySelective(updateField);
}
} }
} }
return datasetFieldsRealMap; return datasetFieldsRealMap;
} }
@Transactional(rollbackFor = Exception.class)
public void createDorisTable(List<DatasetTable> datasetTablesInfo) throws Exception {
for (DatasetTable datasetTable : datasetTablesInfo) {
if (1 == datasetTable.getMode() && !(DatasetType.CUSTOM.name().equalsIgnoreCase(datasetTable.getType()) || DatasetType.UNION.name().equalsIgnoreCase(datasetTable.getType()))) {
List<DatasetTableField> fields = extractDataService.getDatasetTableFields(datasetTable.getId());
extractDataService.createEngineTable(TableUtils.tableName(datasetTable.getId()), fields);
}
}
}
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void resetCustomAndUnionDataset(List<DatasetTable> datasetTablesInfo, Map<String, String> datasetRealMap, Map<String, String> datasetFieldsRealMap) throws Exception { public void resetCustomAndUnionDataset(List<DatasetTable> datasetTablesInfo, Map<String, String> datasetRealMap, Map<String, String> datasetFieldsRealMap) throws Exception {
for (DatasetTable datasetTable : datasetTablesInfo) { for (DatasetTable datasetTable : datasetTablesInfo) {

View File

@ -30,7 +30,6 @@ import io.dataease.listener.util.CacheUtils;
import io.dataease.plugins.common.base.domain.*; import io.dataease.plugins.common.base.domain.*;
import io.dataease.plugins.common.base.mapper.*; import io.dataease.plugins.common.base.mapper.*;
import io.dataease.plugins.common.constants.DeTypeConstants; import io.dataease.plugins.common.constants.DeTypeConstants;
import io.dataease.service.SystemInfoService;
import io.dataease.service.chart.ChartViewService; import io.dataease.service.chart.ChartViewService;
import io.dataease.service.dataset.DataSetGroupService; import io.dataease.service.dataset.DataSetGroupService;
import io.dataease.service.dataset.DataSetTableService; import io.dataease.service.dataset.DataSetTableService;
@ -135,8 +134,6 @@ public class PanelGroupService {
private DatasetGroupMapper datasetGroupMapper; private DatasetGroupMapper datasetGroupMapper;
@Resource @Resource
private PanelWatermarkMapper panelWatermarkMapper; private PanelWatermarkMapper panelWatermarkMapper;
@Resource
private SystemInfoService systemInfoService;
public List<PanelGroupDTO> tree(PanelGroupRequest panelGroupRequest) { public List<PanelGroupDTO> tree(PanelGroupRequest panelGroupRequest) {
String userId = String.valueOf(AuthUtils.getUser().getUserId()); String userId = String.valueOf(AuthUtils.getUser().getUserId());
@ -811,29 +808,6 @@ public class PanelGroupService {
List<ChartViewField> chartViewFieldsInfo = extChartViewFieldMapper.findByPanelId(panelId); List<ChartViewField> chartViewFieldsInfo = extChartViewFieldMapper.findByPanelId(panelId);
//3.获取所有数据集信息 //3.获取所有数据集信息
List<DatasetTable> datasetTablesInfo = extDataSetTableMapper.findByPanelId(panelId); List<DatasetTable> datasetTablesInfo = extDataSetTableMapper.findByPanelId(panelId);
List<String> attachTableIds = new ArrayList<>();
if (CollectionUtils.isNotEmpty(datasetTablesInfo)) {
for (DatasetTable datasetTable : datasetTablesInfo) {
if ("union".equals(datasetTable.getType()) && StringUtils.isNotEmpty(datasetTable.getInfo())) {
DataTableInfoDTO dt = gson.fromJson(datasetTable.getInfo(), DataTableInfoDTO.class);
DatasetUtils.getUnionTable(attachTableIds, dt.getUnion());
} else if ("custom".equals(datasetTable.getType()) && StringUtils.isNotEmpty(datasetTable.getInfo())) {
Map result = gson.fromJson(datasetTable.getInfo(), Map.class);
List<Map> list = (List<Map>) result.get("list");
if (CollectionUtils.isNotEmpty(list)) {
for (Map details : list) {
attachTableIds.add(String.valueOf(details.get("tableId")));
}
}
}
}
if (CollectionUtils.isNotEmpty(attachTableIds)) {
List<DatasetTable> attachDatasetTables = extDataSetTableMapper.findByTableIds(attachTableIds);
if (CollectionUtils.isNotEmpty(attachDatasetTables)) {
datasetTablesInfo.addAll(attachDatasetTables);
}
}
}
// dataset check // dataset check
if (CollectionUtils.isEmpty(datasetTablesInfo)) { if (CollectionUtils.isEmpty(datasetTablesInfo)) {
return new PanelExport2App(Translator.get("I18N_APP_NO_DATASET_ERROR")); return new PanelExport2App(Translator.get("I18N_APP_NO_DATASET_ERROR"));
@ -841,6 +815,23 @@ public class PanelGroupService {
return new PanelExport2App(Translator.get("I18N_APP_ERROR_DATASET")); return new PanelExport2App(Translator.get("I18N_APP_ERROR_DATASET"));
} }
List<String> allTableIds = datasetTablesInfo.stream().map(DatasetTable::getId).collect(Collectors.toList()); List<String> allTableIds = datasetTablesInfo.stream().map(DatasetTable::getId).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(datasetTablesInfo)) {
for (DatasetTable datasetTable : datasetTablesInfo) {
if ("union".equals(datasetTable.getType()) && StringUtils.isNotEmpty(datasetTable.getInfo())) {
DataTableInfoDTO dt = gson.fromJson(datasetTable.getInfo(), DataTableInfoDTO.class);
DatasetUtils.getUnionTable(allTableIds, dt.getUnion());
} else if ("custom".equals(datasetTable.getType()) && StringUtils.isNotEmpty(datasetTable.getInfo())) {
Map result = gson.fromJson(datasetTable.getInfo(), Map.class);
List<Map> list = (List<Map>) result.get("list");
if (CollectionUtils.isNotEmpty(list)) {
for (Map details : list) {
allTableIds.add(String.valueOf(details.get("tableId")));
}
}
}
}
}
datasetTablesInfo = extDataSetTableMapper.findByTableIds(allTableIds);
//4.获取所有数据集字段信息 //4.获取所有数据集字段信息
List<DatasetTableField> datasetTableFieldsInfo = extDataSetTableFieldMapper.findByTableIds(allTableIds); List<DatasetTableField> datasetTableFieldsInfo = extDataSetTableFieldMapper.findByTableIds(allTableIds);
//5.获取所有任务信息 //5.获取所有任务信息
@ -917,6 +908,8 @@ public class PanelGroupService {
Map<String, String> datasetFieldsRealMap = panelAppTemplateService.applyDatasetField(datasetTableFieldsInfo, datasetsRealMap, datasetTypeRealMap, datasetFieldsMd5FormatRealMap); Map<String, String> datasetFieldsRealMap = panelAppTemplateService.applyDatasetField(datasetTableFieldsInfo, datasetsRealMap, datasetTypeRealMap, datasetFieldsMd5FormatRealMap);
panelAppTemplateService.createDorisTable(datasetTablesInfo);
panelAppTemplateService.resetCustomAndUnionDataset(datasetTablesInfo, datasetsRealMap, datasetFieldsRealMap); panelAppTemplateService.resetCustomAndUnionDataset(datasetTablesInfo, datasetsRealMap, datasetFieldsRealMap);
Map<String, String> chartViewsRealMap = panelAppTemplateService.applyViews(chartViewsInfo, datasetsRealMap, datasetFieldsRealMap, datasetFieldsMd5FormatRealMap, newPanelId); Map<String, String> chartViewsRealMap = panelAppTemplateService.applyViews(chartViewsInfo, datasetsRealMap, datasetFieldsRealMap, datasetFieldsMd5FormatRealMap, newPanelId);

View File

@ -247,3 +247,16 @@ I18N_LOG_FORMAT_POSITION=IN\u3010%s\u3011
I18N_LOG_FORMAT=TO %s\u3010%s\u3011 I18N_LOG_FORMAT=TO %s\u3010%s\u3011
I18N_LOG_FORMAT_PREFIX=With authority of %s\u3010%s\u3011 I18N_LOG_FORMAT_PREFIX=With authority of %s\u3010%s\u3011
\u4E0A\u4F20\u63D2\u4EF6=Upload
\u5378\u8F7D\u63D2\u4EF6=Uninstall
\u67E5\u770B\u7CFB\u7EDF\u6A21\u677F=System templates
\u7F16\u8F91\u62A5\u544A=Edit report
\u521B\u5EFA\u62A5\u544A=Create report
\u5220\u9664\u62A5\u544A=Delete report
\u5BFC\u51FA\u65E5\u5FD7=Export log
\u5BFC\u5165\u7528\u6237=Import user
\u6570\u636E\u96C6\u8868\u5355=Dataset form
\u7F16\u8F91\u8BB0\u5F55=Edit record
\u5220\u9664\u8BB0\u5F55=Delete record
\u6C34\u5370\u7BA1\u7406=Watermark

View File

@ -247,3 +247,17 @@ I18N_LOG_FORMAT_POSITION=\u5728\u3010%s\u3011
I18N_LOG_FORMAT=\u7ED9%s\u3010%s\u3011 I18N_LOG_FORMAT=\u7ED9%s\u3010%s\u3011
I18N_LOG_FORMAT_PREFIX=\u4EE5%s\u3010%s\u3011\u6743\u9650 I18N_LOG_FORMAT_PREFIX=\u4EE5%s\u3010%s\u3011\u6743\u9650
\u4E0A\u4F20\u63D2\u4EF6=\u4E0A\u4F20\u63D2\u4EF6
\u5378\u8F7D\u63D2\u4EF6=\u5378\u8F7D\u63D2\u4EF6
\u67E5\u770B\u7CFB\u7EDF\u6A21\u677F=\u7CFB\u7EDF\u6A21\u7248
\u7F16\u8F91\u62A5\u544A=\u7F16\u8F91\u62A5\u544A
\u521B\u5EFA\u62A5\u544A=\u521B\u5EFA\u62A5\u544A
\u5220\u9664\u62A5\u544A=\u5220\u9664\u62A5\u544A
\u5BFC\u51FA\u65E5\u5FD7=\u5BFC\u51FA\u65E5\u5FD7
\u5BFC\u5165\u7528\u6237=\u5BFC\u5165\u7528\u6237
\u6570\u636E\u96C6\u8868\u5355=\u6570\u636E\u96C6\u8868\u5355
\u7F16\u8F91\u8BB0\u5F55=\u7F16\u8F91\u8BB0\u5F55
\u5220\u9664\u8BB0\u5F55=\u5220\u9664\u8BB0\u5F55
\u6C34\u5370\u7BA1\u7406=\u6C34\u5370\u7BA1\u7406

View File

@ -242,3 +242,16 @@ I18N_PROHIBIT_SCANNING_TO_CREATE_USER=\u7981\u6B62\u6383\u78BC\u5275\u5EFA\u7528
I18N_LOG_FORMAT_POSITION=\u5728\u3010%s\u3011 I18N_LOG_FORMAT_POSITION=\u5728\u3010%s\u3011
I18N_LOG_FORMAT=\u7D66%s\u3010%s\u3011 I18N_LOG_FORMAT=\u7D66%s\u3010%s\u3011
I18N_LOG_FORMAT_PREFIX=\u4EE5%s\u3010%s\u3011\u6B0A\u9650 I18N_LOG_FORMAT_PREFIX=\u4EE5%s\u3010%s\u3011\u6B0A\u9650
\u4E0A\u4F20\u63D2\u4EF6=\u4E0A\u50B3\u63D2\u4EF6
\u5378\u8F7D\u63D2\u4EF6=\u5378\u8F09\u63D2\u4EF6
\u67E5\u770B\u7CFB\u7EDF\u6A21\u677F=\u7CFB\u7D71\u6A21\u7248
\u7F16\u8F91\u62A5\u544A=\u7DE8\u8F2F\u5831\u544A
\u521B\u5EFA\u62A5\u544A=\u5275\u5EFA\u5831\u544A
\u5220\u9664\u62A5\u544A=\u522A\u9664\u5831\u544A
\u5BFC\u51FA\u65E5\u5FD7=\u5C0E\u51FA\u65E5\u8A8C
\u5BFC\u5165\u7528\u6237=\u5C0E\u5165\u7528\u6236
\u6570\u636E\u96C6\u8868\u5355=\u6578\u64DA\u96C6\u8868\u55AE
\u7F16\u8F91\u8BB0\u5F55=\u7DE8\u8F2F\u8A18\u9304
\u5220\u9664\u8BB0\u5F55=\u522A\u9664\u8A18\u9304
\u6C34\u5370\u7BA1\u7406=\u6C34\u5370\u7BA1\u7406

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -293,14 +293,18 @@ export default {
} }
}, },
elementMouseDown(e) { elementMouseDown(e) {
// private // // private
this.$store.commit('setClickComponentStatus', true) this.$store.commit('setClickComponentStatus', true)
if (this.config.component !== 'v-text' && this.config.component !== 'rect-shape' && this.config.component !== 'de-input-search' && this.config.component !== 'de-select-grid' && this.config.component !== 'de-number-range' && this.config.component !== 'de-date') { if (this.config.component !== 'v-text' && this.config.component !== 'rect-shape' && this.config.component !== 'de-input-search' && this.config.component !== 'de-select-grid' && this.config.component !== 'de-number-range' && this.config.component !== 'de-date') {
e.preventDefault() e.preventDefault()
} }
// //
e.stopPropagation() e.stopPropagation()
this.$store.commit('setCurComponent', { component: this.config, index: this.index }) const _this = this
setTimeout(() => {
_this.$store.commit('setCurComponent', { component: _this.config, index: _this.index })
}, 200)
}, },
showViewDetails(params) { showViewDetails(params) {
this.$refs.wrapperChild.openChartDetailsDialog(params) this.$refs.wrapperChild.openChartDetailsDialog(params)

View File

@ -372,7 +372,7 @@ export default {
]) ])
}, },
mounted() { mounted() {
if (navigator.platform.indexOf('Mac') == -1) { if (navigator.platform.indexOf('Mac') === -1) {
this.systemOS = 'Other' this.systemOS = 'Other'
} }
this.initCurFields() this.initCurFields()

View File

@ -17,8 +17,7 @@
v-if="curComponent.type != 'custom-button'" v-if="curComponent.type != 'custom-button'"
icon="el-icon-document-copy" icon="el-icon-document-copy"
@click.native="copy" @click.native="copy"
><span>{{ $t('panel.copy') }}(<span v-show="systemOS==='Mac'"><i class="icon iconfont icon-command" ><span>{{ $t('panel.copy') }}(<span v-show="systemOS==='Mac'"><i class="icon iconfont icon-command" />+ D</span> <span v-show="systemOS!=='Mac'">Control + D</span>)</span>
/>+ D</span> <span v-show="systemOS!=='Mac'">Control + D</span>)</span>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item <el-dropdown-item
icon="el-icon-delete" icon="el-icon-delete"
@ -210,7 +209,7 @@ export default {
]) ])
}, },
mounted() { mounted() {
if (navigator.platform.indexOf('Mac') == -1) { if (navigator.platform.indexOf('Mac') === -1) {
this.systemOS = 'Other' this.systemOS = 'Other'
} }
}, },

View File

@ -112,9 +112,9 @@ export default {
} }
} }
//eslint-disable-next-line // eslint-disable-next-line
this.showPrevMore = showPrevMore this.showPrevMore = showPrevMore
//eslint-disable-next-line // eslint-disable-next-line
this.showNextMore = showNextMore this.showNextMore = showNextMore
return array return array

View File

@ -1,12 +1,12 @@
<template> <template>
<el-input <el-input
v-count="value" v-count="{value, maxlength}"
:placeholder="$t('fu.search_bar.please_input')" :placeholder="$t('fu.search_bar.please_input')"
show-word-limit show-word-limit
:disabled="disabled" :disabled="disabled"
:value="value" :value="value"
type="textarea" type="textarea"
maxlength="200" :maxlength="maxlength"
@input="handleChange" @input="handleChange"
/> />
</template> </template>
@ -16,14 +16,14 @@ export default {
directives: { directives: {
count: { count: {
update: function(el, binding) { update: function(el, binding) {
const lg = binding.value?.length || 0 const lg = binding.value.value?.length || 0
const count = el.querySelector('.el-input__count') const count = el.querySelector('.el-input__count')
if (!count) return if (!count) return
if (!lg) { if (!lg) {
if (count?.classList?.contains('no-zore')) { if (count?.classList?.contains('no-zore')) {
count.classList.remove('no-zore') count.classList.remove('no-zore')
} }
count.innerHTML = '0/200' count.innerHTML = `0/${binding.value.maxlength || 200}`
return return
} }
if (el.querySelector('.no-zore')) { if (el.querySelector('.no-zore')) {
@ -34,7 +34,7 @@ export default {
const num = document.createElement('span') const num = document.createElement('span')
const total = document.createElement('span') const total = document.createElement('span')
num.style.color = '#1F2329' num.style.color = '#1F2329'
total.innerHTML = '/200' total.innerHTML = `/${binding.value.maxlength || 200}`
num.innerHTML = lg num.innerHTML = lg
if (!newCount) return if (!newCount) return
newCount.classList.add('el-input__count', 'no-zore') newCount.classList.add('el-input__count', 'no-zore')
@ -46,7 +46,11 @@ export default {
}, },
props: { props: {
disabled: Boolean, disabled: Boolean,
value: String value: String,
maxlength: {
type: Number,
default: 200
}
}, },
methods: { methods: {
handleChange(val) { handleChange(val) {

View File

@ -707,23 +707,26 @@ export default {
border-color: blueviolet; border-color: blueviolet;
} }
::v-deep .el-tabs__nav { ::v-deep .el-tabs__nav-prev {
width: 100%; line-height: 25px;
}
::v-deep .el-tabs__nav-next {
line-height: 25px;
} }
.tab-head-left ::v-deep .el-tabs__nav { .tab-head-left ::v-deep .el-tabs__nav-scroll {
width: 100%; display: flex;
text-align: left; justify-content: start;
} }
.tab-head-right ::v-deep .el-tabs__nav { .tab-head-right ::v-deep .el-tabs__nav-scroll {
width: 100%; display: flex;
text-align: right; justify-content: end;
} }
.tab-head-center ::v-deep .el-tabs__nav { .tab-head-center ::v-deep .el-tabs__nav-scroll {
width: 100%; display: flex;
text-align: center; justify-content: center;
} }
.frame-mask { .frame-mask {

View File

@ -135,6 +135,7 @@ export default {
default_login: 'Normal' default_login: 'Normal'
}, },
commons: { commons: {
collapse_navigation: 'Collapse navigation',
operate_cancelled: 'Operation cancelled', operate_cancelled: 'Operation cancelled',
bind: 'Bind', bind: 'Bind',
unbind: 'Unbind', unbind: 'Unbind',
@ -535,7 +536,10 @@ export default {
set_saved_successfully: 'Data set saved successfully', set_saved_successfully: 'Data set saved successfully',
to_start_using: 'Browse the contents of your database, tables and columns. Choose a database to get started.', to_start_using: 'Browse the contents of your database, tables and columns. Choose a database to get started.',
to_run_query: 'Click to run query', to_run_query: 'Click to run query',
the_running_results: 'You can view the running results' the_running_results: 'You can view the running results',
item: 'item',
logic_filter: 'Condition Filter',
enum_filter: 'Enum Filter'
}, },
detabs: { detabs: {
custom_sort: 'Custom Sort', custom_sort: 'Custom Sort',
@ -659,6 +663,7 @@ export default {
input_password: 'Please input a password', input_password: 'Please input a password',
input_phone: 'Please enter the phone number', input_phone: 'Please enter the phone number',
input_roles: 'Please select role', input_roles: 'Please select role',
select_users: 'Please select user',
user_name_pattern_error: 'IDs can only contain alphanumeric and ._- and start with a letter!', user_name_pattern_error: 'IDs can only contain alphanumeric and ._- and start with a letter!',
special_characters_are_not_supported: 'Special characters are not supported', special_characters_are_not_supported: 'Special characters are not supported',
mobile_number_format_is_incorrect: 'Incorrect format of mobile phone number', mobile_number_format_is_incorrect: 'Incorrect format of mobile phone number',
@ -815,6 +820,7 @@ export default {
edite_organization: 'Edit organization' edite_organization: 'Edit organization'
}, },
system_parameter_setting: { system_parameter_setting: {
email_server_config: 'Mailbox server configuration',
edit_success: 'Edit success', edit_success: 'Edit success',
mailbox_service_settings: 'Mail Setting', mailbox_service_settings: 'Mail Setting',
test_connection: 'Test connection', test_connection: 'Test connection',
@ -1734,7 +1740,17 @@ export default {
export_dataset: 'Export', export_dataset: 'Export',
filename: 'Filename', filename: 'Filename',
export_filter: 'Filter', export_filter: 'Filter',
pls_input_filename: 'Please input filename' pls_input_filename: 'Please input filename',
calc_tips: {
tip1: 'The expression syntax should follow the database syntax corresponding to the data source.',
tip2: 'Aggregation operation is not supported in the dataset.',
tip3: 'The reference field starts with "[" and ends with "]"',
tip4: 'Do not modify the reference content, otherwise the reference will fail',
tip5: 'If you enter content in the same format as the reference field, it will be treated as a reference field',
tip6: 'Use the functions supported by the database type corresponding to the dataset. The syntax is the same as that of the corresponding database',
tip7: 'For example, date format: MySQL uses DATE_ FORMAT(date,format) Oracle uses TO_ DATE(X,[,fmt])',
tip8: 'Non direct connection mode data set, use Doris database functions, refer to Doris official website'
}
}, },
driver: { driver: {
driver: 'Driver', driver: 'Driver',
@ -1902,7 +1918,7 @@ export default {
}, },
panel: { panel: {
position_adjust_component: 'Position adjust', position_adjust_component: 'Position adjust',
active_font_size: 'Active font size', active_font_size: 'Selected font size',
carousel: 'Carousel', carousel: 'Carousel',
switch_time: 'Switch time', switch_time: 'Switch time',
position_adjust: 'Position', position_adjust: 'Position',
@ -2557,6 +2573,14 @@ export default {
}, },
emailtask: { emailtask: {
week_mon: 'Mon',
week_tue: 'Tue',
week_wed: 'Wed',
week_thu: 'Thu',
week_fri: 'Fri',
week_sat: 'Sat',
week_sun: 'Sun',
send_config: 'Send configuration',
title: 'Title', title: 'Title',
panel: 'Panel', panel: 'Panel',
content: 'Content', content: 'Content',

View File

@ -135,6 +135,7 @@ export default {
default_login: '普通登錄' default_login: '普通登錄'
}, },
commons: { commons: {
collapse_navigation: '收起導航',
operate_cancelled: '已取消操作', operate_cancelled: '已取消操作',
bind: '綁定', bind: '綁定',
unbind: '解綁', unbind: '解綁',
@ -535,7 +536,10 @@ export default {
set_saved_successfully: '數據集保存成功', set_saved_successfully: '數據集保存成功',
to_start_using: '瀏覽您的數據庫,表和列的內容。 選擇一個數據庫即可開始使用。', to_start_using: '瀏覽您的數據庫,表和列的內容。 選擇一個數據庫即可開始使用。',
to_run_query: '點擊運行査詢', to_run_query: '點擊運行査詢',
the_running_results: '即可查看運行結果' the_running_results: '即可查看運行結果',
item: '項',
logic_filter: '條件篩選',
enum_filter: '枚舉篩選'
}, },
detabs: { detabs: {
custom_sort: '自定義排序', custom_sort: '自定義排序',
@ -815,6 +819,7 @@ export default {
edite_organization: '編輯組織' edite_organization: '編輯組織'
}, },
system_parameter_setting: { system_parameter_setting: {
email_server_config: '郵箱服務器配置',
edit_success: '編輯成功', edit_success: '編輯成功',
mailbox_service_settings: '郵件設置', mailbox_service_settings: '郵件設置',
test_connection: '測試連接', test_connection: '測試連接',
@ -1734,7 +1739,17 @@ export default {
export_dataset: '數據集導出', export_dataset: '數據集導出',
filename: '文件名稱', filename: '文件名稱',
export_filter: '篩選條件', export_filter: '篩選條件',
pls_input_filename: '請輸入文件名稱' pls_input_filename: '請輸入文件名稱',
calc_tips: {
tip1: '表達式語法請遵循該數據源對應的數據庫語法。',
tip2: '數據集中不支持聚合運算。',
tip3: '引用字段以 "[" 開始, "]" 結束',
tip4: '請勿修改引用內容,否則將引用失敗',
tip5: '若輸入與引用字段相同格式的內容,將被當作引用字段處理',
tip6: '使用數據集對應數據庫類型所支持的函數,語法同對應數據庫',
tip7: '如日期格式化MySQL使用DATE_FORMAT(date,format)Oracle使用TO_DATE(X,[,fmt])',
tip8: '非直連模式數據集使用Doris數據庫函數可參考Doris官網'
}
}, },
driver: { driver: {
driver: '驅動', driver: '驅動',
@ -1902,7 +1917,7 @@ export default {
}, },
panel: { panel: {
position_adjust_component: '位置調整', position_adjust_component: '位置調整',
active_font_size: '激活字體大小', active_font_size: '选中字體大小',
carousel: '輪播', carousel: '輪播',
switch_time: '切換時間', switch_time: '切換時間',
position_adjust: '位置', position_adjust: '位置',
@ -2558,6 +2573,14 @@ export default {
}, },
emailtask: { emailtask: {
week_mon: '周一',
week_tue: '周二',
week_wed: '周三',
week_thu: '周四',
week_fri: '周五',
week_sat: '周六',
week_sun: '周日',
send_config: '發送設置',
title: '報告主題', title: '報告主題',
panel: '儀表闆', panel: '儀表闆',
content: '報告正文', content: '報告正文',
@ -2582,9 +2605,9 @@ export default {
emial_preview: '報告預覽', emial_preview: '報告預覽',
chart_data_range: '視圖數據範圍', chart_data_range: '視圖數據範圍',
simple_repeat: '簡單重複', simple_repeat: '簡單重複',
once_a_day: '每天一次', once_a_day: '每天',
once_a_week: '每周一次', once_a_week: '每周',
once_a_month: '每月一次', once_a_month: '每月',
complex_repeat: '複雜重複', complex_repeat: '複雜重複',
pixel_tip: '可直接輸入分辨率(例如:2560 * 1600)或者選擇', pixel_tip: '可直接輸入分辨率(例如:2560 * 1600)或者選擇',
task_type: '任務類型', task_type: '任務類型',

View File

@ -135,6 +135,7 @@ export default {
default_login: '普通登录' default_login: '普通登录'
}, },
commons: { commons: {
collapse_navigation: '收起导航',
operate_cancelled: '已取消操作', operate_cancelled: '已取消操作',
bind: '绑定', bind: '绑定',
unbind: '解绑', unbind: '解绑',
@ -534,7 +535,10 @@ export default {
set_saved_successfully: '数据集保存成功', set_saved_successfully: '数据集保存成功',
to_start_using: '浏览您的数据库,表和列的内容。 选择一个数据库即可开始使用。', to_start_using: '浏览您的数据库,表和列的内容。 选择一个数据库即可开始使用。',
to_run_query: '点击运行查询', to_run_query: '点击运行查询',
the_running_results: '即可查看运行结果' the_running_results: '即可查看运行结果',
item: '项',
logic_filter: '条件筛选',
enum_filter: '枚举筛选'
}, },
detabs: { detabs: {
custom_sort: '自定义排序', custom_sort: '自定义排序',
@ -814,6 +818,7 @@ export default {
edite_organization: '编辑组织' edite_organization: '编辑组织'
}, },
system_parameter_setting: { system_parameter_setting: {
email_server_config: '邮箱服务器配置',
edit_success: '编辑成功', edit_success: '编辑成功',
mailbox_service_settings: '邮件设置', mailbox_service_settings: '邮件设置',
test_connection: '测试连接', test_connection: '测试连接',
@ -1733,7 +1738,17 @@ export default {
export_dataset: '数据集导出', export_dataset: '数据集导出',
filename: '文件名称', filename: '文件名称',
export_filter: '筛选条件', export_filter: '筛选条件',
pls_input_filename: '请输入文件名称' pls_input_filename: '请输入文件名称',
calc_tips: {
tip1: '表达式语法请遵循该数据源对应的数据库语法。',
tip2: '数据集中不支持聚合运算。',
tip3: '引用字段以 "[" 开始, "]" 结束',
tip4: '请勿修改引用内容,否则将引用失败',
tip5: '若输入与引用字段相同格式的内容,将被当作引用字段处理',
tip6: '使用数据集对应数据库类型所支持的函数,语法同对应数据库',
tip7: '如日期格式化MySQL使用DATE_FORMAT(date,format)Oracle使用TO_DATE(X,[,fmt])',
tip8: '非直连模式数据集使用Doris数据库函数可参考Doris官网'
}
}, },
driver: { driver: {
driver: '驱动', driver: '驱动',
@ -1902,7 +1917,7 @@ export default {
}, },
panel: { panel: {
position_adjust_component: '位置调整', position_adjust_component: '位置调整',
active_font_size: '激活字体大小', active_font_size: '选中字体大小',
carousel: '轮播', carousel: '轮播',
switch_time: '切换时间', switch_time: '切换时间',
position_adjust: '位置', position_adjust: '位置',
@ -2558,6 +2573,14 @@ export default {
}, },
emailtask: { emailtask: {
week_mon: '周一',
week_tue: '周二',
week_wed: '周三',
week_thu: '周四',
week_fri: '周五',
week_sat: '周六',
week_sun: '周日',
send_config: '发送设置',
title: '报告主题', title: '报告主题',
panel: '仪表板', panel: '仪表板',
content: '报告正文', content: '报告正文',
@ -2582,9 +2605,9 @@ export default {
emial_preview: '报告预览', emial_preview: '报告预览',
chart_data_range: '视图数据范围', chart_data_range: '视图数据范围',
simple_repeat: '简单重复', simple_repeat: '简单重复',
once_a_day: '每天一次', once_a_day: '每天',
once_a_week: '每周一次', once_a_week: '每周',
once_a_month: '每月一次', once_a_month: '每月',
complex_repeat: '复杂重复', complex_repeat: '复杂重复',
pixel_tip: '可直接输入自定义分辨率(例如:2560 * 1600)或选择', pixel_tip: '可直接输入自定义分辨率(例如:2560 * 1600)或选择',
task_type: '任务类型', task_type: '任务类型',

View File

@ -33,7 +33,7 @@
:style="{ transform: isCollapse ? 'rotate(90deg)' : 'rotate(-90deg)' }" :style="{ transform: isCollapse ? 'rotate(90deg)' : 'rotate(-90deg)' }"
class="el-icon-upload2" class="el-icon-upload2"
/> />
{{ isCollapse ? "" : "收起导航" }} {{ isCollapse ? "" : $t('commons.collapse_navigation') }}
</div> </div>
</div> </div>
</template> </template>

View File

@ -108,13 +108,16 @@ service.interceptors.response.use(response => {
const headers = error.response && error.response.headers || error.response || config.headers const headers = error.response && error.response.headers || error.response || config.headers
config.loading && tryHideLoading(store.getters.currentPath) config.loading && tryHideLoading(store.getters.currentPath)
let msg let msg = ''
if (error.response) { if (error.response) {
checkAuth(error.response) checkAuth(error.response)
msg = error.response.data.message || error.response.data msg = error.response.data.message || error.response.data
} else { } else {
msg = error.message msg = error.message
} }
if (msg.length > 600) {
msg = msg.slice(0, 600)
}
!config.hideMsg && (!headers['authentication-status']) && $error(msg) !config.hideMsg && (!headers['authentication-status']) && $error(msg)
return Promise.reject(config.url === '/dataset/table/sqlPreview' ? msg : error) return Promise.reject(config.url === '/dataset/table/sqlPreview' ? msg : error)
}) })

View File

@ -18,7 +18,7 @@
:style="title_class" :style="title_class"
style="cursor: default;display: block;" style="cursor: default;display: block;"
> >
<div style="padding:6px 4px 0;margin: 0;"> <div style="padding:4px 4px 0;margin: 0;">
<chart-title-update <chart-title-update
:title-class="title_class" :title-class="title_class"
:chart-info="chartInfo" :chart-info="chartInfo"

View File

@ -18,7 +18,7 @@
:style="title_class" :style="title_class"
style="cursor: default;display: block;" style="cursor: default;display: block;"
> >
<div style="padding:6px 4px 0;margin: 0;"> <div style="padding:4px 4px 0;margin: 0;">
<chart-title-update <chart-title-update
:title-class="title_class" :title-class="title_class"
:chart-info="chartInfo" :chart-info="chartInfo"

View File

@ -380,8 +380,8 @@ export default {
if (!viewSave) return if (!viewSave) return
viewEditSave(this.panelInfo.id, viewSave).then(() => { viewEditSave(this.panelInfo.id, viewSave).then(() => {
this.chart.title = this.chartTitleUpdate this.chart.title = this.chartTitleUpdate
bus.$emit('aside-set-title', this.chart.title)
}) })
bus.$emit('title-name', this.chart.title, chartView.id)
bus.$emit('view-in-cache', { bus.$emit('view-in-cache', {
type: 'styleChange', type: 'styleChange',
viewId: chartView.id, viewId: chartView.id,

View File

@ -67,7 +67,8 @@ export default {
min_height: 200, min_height: 200,
max_height: 500, max_height: 500,
elementpath: false, elementpath: false,
statusbar: false statusbar: false,
convert_urls: false
} }
} }
}, },

View File

@ -2,7 +2,7 @@
<div <div
ref="tableContainer" ref="tableContainer"
:style="bg_class" :style="bg_class"
style="padding: 8px;width: 100%;height: 100%;overflow: hidden;" style="padding: 4px;width: 100%;height: 100%;overflow: hidden;"
> >
<span <span
v-show="title_show" v-show="title_show"

View File

@ -2,7 +2,7 @@
<div <div
ref="tableContainer" ref="tableContainer"
:style="bg_class" :style="bg_class"
style="width: 100%;height: 100%;overflow: hidden;" style="padding: 4px;width: 100%;height: 100%;overflow: hidden;"
> >
<view-track-bar <view-track-bar
ref="viewTrack" ref="viewTrack"

View File

@ -369,7 +369,7 @@ export default {
const arr = this.thresholdForm.gaugeThreshold.split(',') const arr = this.thresholdForm.gaugeThreshold.split(',')
for (let i = 0; i < arr.length; i++) { for (let i = 0; i < arr.length; i++) {
const ele = arr[i] const ele = arr[i]
if (parseFloat(ele).toString() === 'NaN' || parseFloat(ele) < 1 || parseFloat(ele) > 99) { if (parseFloat(ele).toString() === 'NaN' || parseFloat(ele) <= 0 || parseFloat(ele) >= 100) {
this.$message({ this.$message({
message: this.$t('chart.gauge_threshold_format_error'), message: this.$t('chart.gauge_threshold_format_error'),
type: 'error', type: 'error',

View File

@ -32,9 +32,9 @@
placement="bottom" placement="bottom"
> >
<div slot="content"> <div slot="content">
表达式语法请遵循该数据源对应的数据库语法 {{ $t('dataset.calc_tips.tip1') }}
<br> <br>
字段类型将使用原始类型如有需要请在表达式中自行转换 {{ $t('dataset.calc_tips.tip2') }}
</div> </div>
<i <i
class="el-icon-info" class="el-icon-info"
@ -110,10 +110,13 @@
class="item" class="item"
effect="dark" effect="dark"
placement="bottom" placement="bottom"
popper-class="popper-tip"
> >
<div slot="content"> <div slot="content">
{{ $t('chart.reference_field_tip') }} {{ $t('dataset.calc_tips.tip3') }}
<br>
{{ $t('dataset.calc_tips.tip4') }}
<br>
{{ $t('dataset.calc_tips.tip5') }}
</div> </div>
<i <i
class="el-icon-info" class="el-icon-info"
@ -236,11 +239,11 @@
placement="bottom" placement="bottom"
> >
<div slot="content"> <div slot="content">
使用数据集对应数据库类型所支持的函数语法同对应数据库 {{ $t('dataset.calc_tips.tip6') }}
<br> <br>
如日期格式化MySQL使用DATE_FORMAT(date,format)Oracle使用TO_DATE(X,[,fmt]) {{ $t('dataset.calc_tips.tip7') }}
<br> <br>
非直连模式数据集使用Doris数据库函数可参考Doris官网 https://doris.apache.org/zh-CN/ {{ $t('dataset.calc_tips.tip8') }} https://doris.apache.org/zh-CN/
</div> </div>
<i <i
class="el-icon-info" class="el-icon-info"

View File

@ -1934,7 +1934,8 @@ export default {
}, },
methods: { methods: {
setTitle(title) { setTitle(title, id) {
if (this.view.id !== id) return
this.view.customStyle.text = { ...this.view.customStyle.text, title } this.view.customStyle.text = { ...this.view.customStyle.text, title }
this.view.title = title this.view.title = title
this.view.name = title this.view.name = title

View File

@ -14,7 +14,9 @@
v-model="styleInfo.top" v-model="styleInfo.top"
type="number" type="number"
:min="0" :min="0"
:max="maxTop"
class="hide-icon-number" class="hide-icon-number"
@change="topOnChange"
> >
<template slot="append">px</template> <template slot="append">px</template>
</el-input> </el-input>
@ -44,8 +46,11 @@
> >
<el-input <el-input
v-model="styleInfo.width" v-model="styleInfo.width"
:min="0"
:max="maxWidth"
type="number" type="number"
class="hide-icon-number" class="hide-icon-number"
@change="widthOnChange"
> >
<template slot="append">px</template> <template slot="append">px</template>
</el-input> </el-input>
@ -59,7 +64,10 @@
<el-input <el-input
v-model="styleInfo.height" v-model="styleInfo.height"
type="number" type="number"
:min="0"
:max="maxHeight"
class="hide-icon-number" class="hide-icon-number"
@change="heightOnChange"
> >
<template slot="append">px</template> <template slot="append">px</template>
</el-input> </el-input>
@ -77,12 +85,18 @@ export default {
name: 'PositionAdjust', name: 'PositionAdjust',
props: {}, props: {},
data() { data() {
return {} return {
maxHeight: 2000,
maxTop: 40000
}
}, },
computed: { computed: {
maxLeft() { maxLeft() {
return 1600 - this.styleInfo.width - this.componentGap return 1600 - this.styleInfo.width - this.componentGap
}, },
maxWidth() {
return 1600 - this.styleInfo.left - this.componentGap
},
styleInfo() { styleInfo() {
return this.$store.state.curComponent.style return this.$store.state.curComponent.style
}, },
@ -97,7 +111,34 @@ export default {
leftOnChange() { leftOnChange() {
if (this.styleInfo.left > this.maxLeft) { if (this.styleInfo.left > this.maxLeft) {
this.styleInfo.left = this.maxLeft this.styleInfo.left = this.maxLeft
} else if (this.styleInfo.left < 0) {
this.styleInfo.left = 0
} }
this.$store.commit('canvasChange')
},
widthOnChange() {
if (this.styleInfo.width > this.maxWidth) {
this.styleInfo.width = this.maxWidth
} else if (this.styleInfo.width < 0) {
this.styleInfo.left = 0
}
this.$store.commit('canvasChange')
},
heightOnChange() {
if (this.styleInfo.height > this.maxHeight) {
this.styleInfo.height = this.maxHeight
} else if (this.styleInfo.height < 0) {
this.styleInfo.height = 0
}
this.$store.commit('canvasChange')
},
topOnChange() {
if (this.styleInfo.top > this.maxTop) {
this.styleInfo.top = this.maxTop
} else if (this.styleInfo.top < 0) {
this.styleInfo.top = 0
}
this.$store.commit('canvasChange')
} }
} }
} }

View File

@ -39,7 +39,7 @@
v-if="['db', 'excel', 'api'].includes(datasetType)" v-if="['db', 'excel', 'api'].includes(datasetType)"
class="table-num" class="table-num"
>{{ $t('deDataset.selected') }} {{ tableNum }} >{{ $t('deDataset.selected') }} {{ tableNum }}
{{ ['excel'].includes(datasetType) ? $t('deDataset.table') : '项' }}</span> {{ ['excel'].includes(datasetType) ? $t('deDataset.table') : $t('deDataset.item') }}</span>
<deBtn <deBtn
:disabled="['db', 'excel', 'api'].includes(datasetType) && !tableNum" :disabled="['db', 'excel', 'api'].includes(datasetType) && !tableNum"
type="primary" type="primary"

View File

@ -29,9 +29,9 @@
placement="bottom" placement="bottom"
> >
<div slot="content"> <div slot="content">
表达式语法请遵循该数据源对应的数据库语法 {{ $t('dataset.calc_tips.tip1') }}
<br> <br>
数据集中不支持聚合运算 {{ $t('dataset.calc_tips.tip2') }}
</div> </div>
<i <i
class="el-icon-info" class="el-icon-info"
@ -88,10 +88,13 @@
class="item" class="item"
effect="dark" effect="dark"
placement="bottom" placement="bottom"
popper-class="popper-tip"
> >
<div slot="content"> <div slot="content">
{{ $t('chart.reference_field_tip') }} {{ $t('dataset.calc_tips.tip3') }}
<br>
{{ $t('dataset.calc_tips.tip4') }}
<br>
{{ $t('dataset.calc_tips.tip5') }}
</div> </div>
<i <i
class="el-icon-info" class="el-icon-info"
@ -211,11 +214,11 @@
placement="bottom" placement="bottom"
> >
<div slot="content"> <div slot="content">
使用数据集对应数据库类型所支持的函数语法同对应数据库 {{ $t('dataset.calc_tips.tip6') }}
<br> <br>
如日期格式化MySQL使用DATE_FORMAT(date,format)Oracle使用TO_DATE(X,[,fmt]) {{ $t('dataset.calc_tips.tip7') }}
<br> <br>
非直连模式数据集使用Doris数据库函数可参考Doris官网 {{ $t('dataset.calc_tips.tip8') }}
https://doris.apache.org/zh-CN/ https://doris.apache.org/zh-CN/
</div> </div>
<i <i

View File

@ -859,9 +859,12 @@ export default {
if (item.dateFormatType !== 'custom') { if (item.dateFormatType !== 'custom') {
item.dateFormat = item.dateFormatType item.dateFormat = item.dateFormatType
} }
}else {
item.dateFormatType = ''
item.dateFormat = ''
} }
if(item.dateFormatType === 'custom' && !item.dateFormat){ if (item.dateFormatType === 'custom' && !item.dateFormat) {
return; return
} }
post('/dataset/field/save', item) post('/dataset/field/save', item)
.then((response) => { .then((response) => {

View File

@ -861,7 +861,7 @@ export default {
}, },
disableExec(task) { disableExec(task) {
return ( return (
(task.status === 'Stopped' && task.rate !== 'SIMPLE') || task.status === 'Pending' || task.status ==='Exec' || !hasDataPermission('manage', task.privileges) (task.status === 'Stopped' && task.rate !== 'SIMPLE') || task.status === 'Pending' || task.status === 'Exec' || !hasDataPermission('manage', task.privileges)
) )
}, },
disableDelete(task) { disableDelete(task) {

View File

@ -398,11 +398,11 @@ export default {
this.filterList = [ this.filterList = [
{ {
value: 'logic', value: 'logic',
label: '条件筛选' label: this.$t('deDataset.logic_filter')
}, },
{ {
value: 'enum', value: 'enum',
label: '枚举筛选' label: this.$t('deDataset.enum_filter')
} }
] ]
if ([1, 2, 3].includes(deType)) { if ([1, 2, 3].includes(deType)) {

View File

@ -1,8 +1,8 @@
<template> <template>
<el-row <el-row
v-loading="$store.getters.loadingMap[$store.getters.currentPath]"
style="text-align: left" style="text-align: left"
class="de-search-table" class="de-search-table"
v-loading="$store.getters.loadingMap[$store.getters.currentPath]"
> >
<el-row class="top-operate"> <el-row class="top-operate">
<el-col :span="12"> <el-col :span="12">
@ -36,8 +36,8 @@
icon="iconfont icon-icon-filter" icon="iconfont icon-icon-filter"
@click="filterShow" @click="filterShow"
>{{ >{{
$t('user.filter') $t('user.filter')
}} }}
<template v-if="filterTexts.length"> <template v-if="filterTexts.length">
({{ cacheCondition.length }}) ({{ cacheCondition.length }})
</template> </template>
@ -50,7 +50,7 @@
> >
<span class="sum">{{ paginationConfig.total }}</span> <span class="sum">{{ paginationConfig.total }}</span>
<span class="title">{{ $t('user.result_one') }}</span> <span class="title">{{ $t('user.result_one') }}</span>
<el-divider direction="vertical"/> <el-divider direction="vertical" />
<i <i
v-if="showScroll" v-if="showScroll"
class="el-icon-arrow-left arrow-filter" class="el-icon-arrow-left arrow-filter"
@ -63,9 +63,9 @@
class="text" class="text"
> >
{{ ele }} <i {{ ele }} <i
class="el-icon-close" class="el-icon-close"
@click="clearOneFilter(index)" @click="clearOneFilter(index)"
/> />
</p> </p>
</div> </div>
<i <i
@ -180,11 +180,11 @@
<!--导入templatedialog--> <!--导入templatedialog-->
<el-dialog <el-dialog
v-loading="$store.getters.loadingMap[$store.getters.currentPath]"
:title="$t('app_template.log_delete_tips')" :title="$t('app_template.log_delete_tips')"
:visible.sync="deleteConfirmDialog" :visible.sync="deleteConfirmDialog"
:show-close="true" :show-close="true"
width="420px" width="420px"
v-loading="$store.getters.loadingMap[$store.getters.currentPath]"
> >
<el-row> <el-row>
<el-checkbox <el-checkbox

View File

@ -820,7 +820,7 @@ export default {
bus.$off('change_panel_right_draw', this.changeRightDrawOpen) bus.$off('change_panel_right_draw', this.changeRightDrawOpen)
bus.$off('delete-condition', this.deleteCustomComponent) bus.$off('delete-condition', this.deleteCustomComponent)
bus.$off('current-component-change', this.asideRefresh) bus.$off('current-component-change', this.asideRefresh)
bus.$off('aside-set-title', this.asideSetTitle) bus.$off('title-name', this.asideSetTitle)
const elx = this.$refs.rightPanel const elx = this.$refs.rightPanel
elx && elx.remove() elx && elx.remove()
}, },
@ -851,16 +851,16 @@ export default {
bus.$on('change_panel_right_draw', this.changeRightDrawOpen) bus.$on('change_panel_right_draw', this.changeRightDrawOpen)
bus.$on('delete-condition', this.deleteCustomComponent) bus.$on('delete-condition', this.deleteCustomComponent)
bus.$on('current-component-change', this.asideRefresh) bus.$on('current-component-change', this.asideRefresh)
bus.$on('aside-set-title', this.asideSetTitle) bus.$on('title-name', this.asideSetTitle)
}, },
asideRefresh() { asideRefresh() {
if (this.$refs['chartEditRef']) { if (this.$refs['chartEditRef']) {
this.$refs['chartEditRef'].resetChartData() this.$refs['chartEditRef'].resetChartData()
} }
}, },
asideSetTitle(val) { asideSetTitle(val, id) {
if (this.$refs['chartEditRef']) { if (this.$refs['chartEditRef']) {
this.$refs['chartEditRef'].setTitle(val) this.$refs['chartEditRef'].setTitle(val, id)
} }
}, },
deleteCustomComponent(param) { deleteCustomComponent(param) {
@ -1376,6 +1376,7 @@ export default {
this.$store.commit('setComponentWithId', this.currentFilterCom) this.$store.commit('setComponentWithId', this.currentFilterCom)
this.$store.commit('recordSnapshot', 'sureFilter') this.$store.commit('recordSnapshot', 'sureFilter')
this.$store.commit('setCurComponent', { component: this.currentFilterCom, index: this.curComponentIndex }) this.$store.commit('setCurComponent', { component: this.currentFilterCom, index: this.curComponentIndex })
this.$store.commit('setComponentFromList', this.currentFilterCom)
bus.$emit('refresh-button-info') bus.$emit('refresh-button-info')
this.closeButton() this.closeButton()
}, },

View File

@ -23,12 +23,14 @@
<el-button <el-button
size="mini" size="mini"
@click="cancel()" @click="cancel()"
>{{ $t('commons.cancel') }}</el-button> >{{ $t('commons.cancel') }}
</el-button>
<el-button <el-button
type="primary" type="primary"
size="mini" size="mini"
@click="save()" @click="save()"
>{{ $t('panel.export_pdf') }}</el-button> >{{ $t('panel.export_pdf') }}
</el-button>
</el-row> </el-row>
</el-row> </el-row>
</template> </template>
@ -41,7 +43,7 @@ import { pdfTemplateReplaceAll } from '@/utils/StringUtils.js'
export default { export default {
name: 'PDFPreExport', name: 'PDFPreExport',
components: { }, components: {},
props: { props: {
// eslint-disable-next-line vue/require-default-prop // eslint-disable-next-line vue/require-default-prop
panelName: { panelName: {
@ -131,16 +133,16 @@ export default {
_this.toExport = true _this.toExport = true
setTimeout(() => { setTimeout(() => {
html2canvas(document.getElementById('exportPdf')).then(function(canvas) { html2canvas(document.getElementById('exportPdf')).then(function(canvas) {
_this.exportLoading = false _this.exportLoading = false
const contentWidth = canvas.width const contentWidth = canvas.width / 4
const contentHeight = canvas.height const contentHeight = canvas.height / 4
const pageData = canvas.toDataURL('image/jpeg', 1.0) const pageData = canvas.toDataURL('image/jpeg', 1.0)
const lp = contentWidth > contentHeight ? 'l' : 'p' const lp = contentWidth > contentHeight ? 'l' : 'p'
const PDF = new JsPDF(lp, 'pt', [contentWidth, contentHeight]) const PDF = new JsPDF(lp, 'pt', [contentWidth, contentHeight])
PDF.addImage(pageData, 'JPEG', 0, 0, contentWidth, contentHeight) PDF.addImage(pageData, 'JPEG', 0, 0, contentWidth, contentHeight)
PDF.save(_this.panelName + '.pdf') PDF.save(_this.panelName + '.pdf')
_this.$emit('closePreExport') _this.$emit('closePreExport')
} }
) )
}, 1500) }, 1500)
}, 500) }, 500)
@ -151,17 +153,18 @@ export default {
</script> </script>
<style scoped> <style scoped>
.root_class { .root_class {
margin: 15px 0px 5px; margin: 15px 0px 5px;
text-align: center; text-align: center;
} }
.export_body_class{
border: 1px solid #dcdfe6 ;
height: 65vh;
overflow-y: auto;
}
.export_body_inner_class{ .export_body_class {
margin: 10px; border: 1px solid #dcdfe6;
} height: 65vh;
overflow-y: auto;
}
.export_body_inner_class {
margin: 10px;
}
</style> </style>

View File

@ -728,7 +728,6 @@ export default {
optType: 'rename', optType: 'rename',
titlePre: this.$t('commons.edit'), titlePre: this.$t('commons.edit'),
panelInfo: { panelInfo: {
pid: param.data.pid,
id: param.data.id, id: param.data.id,
name: param.data.name, name: param.data.name,
nodeType: param.type nodeType: param.type

View File

@ -182,6 +182,7 @@
> >
<deTextarea <deTextarea
v-model="form.desc" v-model="form.desc"
:maxlength="50"
class="w100-textarea" class="w100-textarea"
/> />
</el-form-item> </el-form-item>

View File

@ -255,15 +255,15 @@
v-dialogDrag v-dialogDrag
:title="$t('datasource.create')" :title="$t('datasource.create')"
:visible.sync="dsTypeRelate" :visible.sync="dsTypeRelate"
width="1200px" width="1005px"
class="de-dialog-form none-scroll-bar" class="de-dialog-form none-scroll-bar"
append-to-body append-to-body
> >
<el-tabs v-model="tabActive"> <el-tabs
<el-tab-pane v-model="tabActive"
:label="$t('datasource.all')" class="de-tabs"
name="all" @tab-click="handleClick"
/> >
<el-tab-pane <el-tab-pane
:label="$t('datasource.relational_database')" :label="$t('datasource.relational_database')"
name="RDBMS" name="RDBMS"
@ -278,24 +278,36 @@
/> />
</el-tabs> </el-tabs>
<div class="db-container"> <div class="db-container">
<div <template v-for="(list, idx) in databaseList">
v-for="(db, index) in databaseList" <div
:key="db.type" :key="nameMap[idx]"
class="db-card" :class="typeList[idx]"
:class="[{ marLeft: index % 4 === 0 }]" class="name"
@click="addDb(db)" >{{ $t(`datasource.${nameMap[idx]}`) }}</div>
> <div
<img :key="nameMap[idx] + 'cont'"
v-if="!db.isPlugin" class="item-container"
:src="require('../../../assets/datasource/' + db.type + '.jpg')"
alt=""
> >
<img <div
v-if="db.isPlugin" v-for="(db, index) in list"
:src="`/api/pluginCommon/staticInfo/${db.type}/jpg`" :key="db.type"
> class="db-card"
<p class="db-name">{{ db.name }}</p> :class="[{ marLeft: index % 5 === 0 }]"
</div> @click="addDb(db)"
>
<img
v-if="!db.isPlugin"
:src="require('../../../assets/datasource/' + db.type + '.jpg')"
alt=""
>
<img
v-if="db.isPlugin"
:src="`/api/pluginCommon/staticInfo/${db.type}/jpg`"
>
<p class="db-name">{{ db.name }}</p>
</div>
</div>
</template>
</div> </div>
</el-dialog> </el-dialog>
</el-col> </el-col>
@ -329,11 +341,14 @@ export default {
}, },
data() { data() {
return { return {
tabActive: 'all', tabActive: 'RDBMS',
databaseList: [],
currentNodeId: '', currentNodeId: '',
dsTypeRelate: false, dsTypeRelate: false,
expandedArray: [], expandedArray: [],
tData: [], tData: [],
nameMap: ['relational_database', 'non_relational_database', 'other'],
typeList: ['RDBMS', 'NORDBMS', 'OTHER'],
treeLoading: false, treeLoading: false,
dsTypes: [], dsTypes: [],
dsTypesForDriver: [], dsTypesForDriver: [],
@ -386,15 +401,7 @@ export default {
} }
}, },
computed: { computed: {
...mapGetters(['user']), ...mapGetters(['user'])
databaseList() {
if (this.tabActive === 'all') {
return this.dsTypes
}
return this.dsTypes.filter(
(ele) => ele.databaseClassification === this.tabActive
)
}
}, },
watch: { watch: {
key(val) { key(val) {
@ -406,6 +413,9 @@ export default {
this.datasourceTypes() this.datasourceTypes()
}, },
methods: { methods: {
handleClick() {
document.querySelector(`.${this.tabActive}`).scrollIntoView()
},
createDriveOrDs() { createDriveOrDs() {
if (this.showView === 'Driver') { if (this.showView === 'Driver') {
this.addDriver() this.addDriver()
@ -478,11 +488,17 @@ export default {
datasourceTypes() { datasourceTypes() {
listDatasourceType().then((res) => { listDatasourceType().then((res) => {
this.dsTypes = res.data this.dsTypes = res.data
const databaseList = [[], [], []]
this.dsTypes.forEach((item) => { this.dsTypes.forEach((item) => {
const index = this.typeList.findIndex(ele => ele === item.databaseClassification)
if (index !== -1) {
databaseList[index].push(item)
}
if (item.isJdbc) { if (item.isJdbc) {
this.dsTypesForDriver.push(item) this.dsTypesForDriver.push(item)
} }
}) })
this.databaseList = databaseList
}) })
}, },
refreshType(datasource) { refreshType(datasource) {
@ -802,24 +818,38 @@ export default {
width: 100%; width: 100%;
max-height: 65vh; max-height: 65vh;
overflow-y: auto; overflow-y: auto;
display: flex; margin-top: 3px;
flex-wrap: wrap;
margin-top: -3px;
position: relative; position: relative;
z-index: 10; z-index: 10;
.name {
margin: 16px 0;
font-family: PingFang SC;
font-size: 16px;
font-weight: 500;
line-height: 24px;
color: var(--deTextPrimary, #1F2329);
}
.item-container {
display: flex;
width: 100%;
flex-wrap: wrap;
}
.db-card { .db-card {
height: 193px; height: 141px;
width: 270px; width: 177.6px;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
background: #ffffff; background: #ffffff;
border: 1px solid #dee0e3; border: 1px solid #dee0e3;
border-radius: 4px; border-radius: 4px;
margin-bottom: 24px; margin-bottom: 16px;
margin-left: 22px; margin-left: 16px;
img { img {
width: 100%; width: 100%;
height: 154.58px; height: 102px;
border-top-left-radius: 4px; border-top-left-radius: 4px;
border-top-right-radius: 4px; border-top-right-radius: 4px;
} }

View File

@ -81,7 +81,7 @@
:placeholder="$t('system_parameter_setting.SMTP_password')" :placeholder="$t('system_parameter_setting.SMTP_password')"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('system_parameter_setting.test_recipients')"> <el-form-item :label="$t('ç.test_recipients')">
<template slot="label"> <template slot="label">
{{ $t("system_parameter_setting.test_recipients") }} {{ $t("system_parameter_setting.test_recipients") }}
<el-tooltip <el-tooltip
@ -98,7 +98,7 @@
:placeholder="$t('system_parameter_setting.test_recipients')" :placeholder="$t('system_parameter_setting.test_recipients')"
/> />
</el-form-item> </el-form-item>
<el-form-item label="邮箱服务器配置"> <el-form-item :label="$t('system_parameter_setting.email_server_config')">
<el-checkbox v-model="formInline.ssl">{{ $t('chart.open') }}SSL <el-checkbox v-model="formInline.ssl">{{ $t('chart.open') }}SSL
<el-tooltip <el-tooltip
class="item" class="item"

View File

@ -36,8 +36,8 @@
icon="iconfont icon-icon-filter" icon="iconfont icon-icon-filter"
@click="filterShow" @click="filterShow"
>{{ >{{
$t("user.filter") $t("user.filter")
}} }}
<template v-if="filterTexts.length"> <template v-if="filterTexts.length">
({{ filterTexts.length }}) ({{ filterTexts.length }})
</template> </template>
@ -83,7 +83,7 @@
> >
<span class="sum">{{ paginationConfig.total }}</span> <span class="sum">{{ paginationConfig.total }}</span>
<span class="title">{{ $t("user.result_one") }}</span> <span class="title">{{ $t("user.result_one") }}</span>
<el-divider direction="vertical"/> <el-divider direction="vertical" />
<i <i
v-if="showScroll" v-if="showScroll"
class="el-icon-arrow-left arrow-filter" class="el-icon-arrow-left arrow-filter"
@ -96,9 +96,9 @@
class="text" class="text"
> >
{{ ele }} <i {{ ele }} <i
class="el-icon-close" class="el-icon-close"
@click="clearOneFilter(index)" @click="clearOneFilter(index)"
/> />
</p> </p>
</div> </div>
<i <i
@ -162,14 +162,14 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.rate === 'SIMPLE'">{{ <span v-if="scope.row.rate === 'SIMPLE'">{{
$t("dataset.execute_once") $t("dataset.execute_once")
}}</span> }}</span>
<span v-if="scope.row.rate === 'CRON'">{{ <span v-if="scope.row.rate === 'CRON'">{{
$t("dataset.cron_config") $t("dataset.cron_config")
}}</span> }}</span>
<span v-if="scope.row.rate === 'SIMPLE_CRON'">{{ <span v-if="scope.row.rate === 'SIMPLE_CRON'">{{
$t("dataset.simple_cron") $t("dataset.simple_cron")
}}</span> }}</span>
</template> </template>
</el-table-column> </el-table-column>
@ -197,8 +197,8 @@
v-if="scope.row.lastExecStatus" v-if="scope.row.lastExecStatus"
:class="[`de-${scope.row.lastExecStatus}-pre`, 'de-status']" :class="[`de-${scope.row.lastExecStatus}-pre`, 'de-status']"
>{{ >{{
$t(`dataset.${scope.row.lastExecStatus.toLocaleLowerCase()}`) $t(`dataset.${scope.row.lastExecStatus.toLocaleLowerCase()}`)
}} }}
<svg-icon <svg-icon
v-if="scope.row.lastExecStatus === 'Error'" v-if="scope.row.lastExecStatus === 'Error'"
style="cursor: pointer;" style="cursor: pointer;"
@ -333,18 +333,18 @@
secondary secondary
@click="show_error_massage = false" @click="show_error_massage = false"
>{{ >{{
$t("dataset.close") $t("dataset.close")
}}</deBtn> }}</deBtn>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import {columnOptions} from './options' import { columnOptions } from './options'
import {formatOrders} from '@/utils/index' import { formatOrders } from '@/utils/index'
import {datasetTaskList, post} from '@/api/dataset/dataset' import { datasetTaskList, post } from '@/api/dataset/dataset'
import {hasDataPermission} from '@/utils/permission' import { hasDataPermission } from '@/utils/permission'
import GridTable from '@/components/gridTable/index.vue' import GridTable from '@/components/gridTable/index.vue'
import filterUser from './FilterUser.vue' import filterUser from './FilterUser.vue'
import msgCfm from '@/components/msgCfm/index' import msgCfm from '@/components/msgCfm/index'
@ -353,7 +353,7 @@ import keyEnter from '@/components/msgCfm/keyEnter.js'
export default { export default {
name: 'DatasetTaskList', name: 'DatasetTaskList',
components: {GridTable, filterUser}, components: { GridTable, filterUser },
mixins: [msgCfm, keyEnter], mixins: [msgCfm, keyEnter],
props: { props: {
transCondition: { transCondition: {
@ -396,7 +396,7 @@ export default {
} }
}, },
created() { created() {
const {taskId, name} = this.transCondition const { taskId, name } = this.transCondition
if (taskId) { if (taskId) {
this.nickName = name this.nickName = name
} }
@ -427,7 +427,7 @@ export default {
document.querySelector('#resize-for-filter') document.querySelector('#resize-for-filter')
) )
}, },
layoutResize: _.debounce(function () { layoutResize: _.debounce(function() {
this.getScrollStatus() this.getScrollStatus()
}, 200), }, 200),
scrollPre() { scrollPre() {
@ -501,7 +501,7 @@ export default {
this.handleCurrentChange(1) this.handleCurrentChange(1)
}, },
search(showLoading = true) { search(showLoading = true) {
const {taskId, name} = this.transCondition const { taskId, name } = this.transCondition
const param = { const param = {
orders: formatOrders(this.orderConditions), orders: formatOrders(this.orderConditions),
conditions: [...this.cacheCondition] conditions: [...this.cacheCondition]
@ -520,7 +520,7 @@ export default {
field: 'dataset_table_task.id' field: 'dataset_table_task.id'
}) })
} }
const {currentPage, pageSize} = this.paginationConfig const { currentPage, pageSize } = this.paginationConfig
datasetTaskList(currentPage, pageSize, param, showLoading).then( datasetTaskList(currentPage, pageSize, param, showLoading).then(
(response) => { (response) => {
const multipleSelection = this.multipleSelection.map(ele => ele.id) const multipleSelection = this.multipleSelection.map(ele => ele.id)
@ -568,7 +568,7 @@ export default {
}) })
}, },
changeTaskStatus(task) { changeTaskStatus(task) {
const {status} = task const { status } = task
if (!['Pending', 'Underway'].includes(status)) { if (!['Pending', 'Underway'].includes(status)) {
return return
} }
@ -613,7 +613,7 @@ export default {
}, },
selectDataset(row) { selectDataset(row) {
if (row) { if (row) {
const {datasetName, id, tableId} = row const { datasetName, id, tableId } = row
this.$router.push({ this.$router.push({
path: '/task-ds-form', path: '/task-ds-form',
query: { query: {
@ -634,7 +634,7 @@ export default {
) )
}, },
disableExec(task) { disableExec(task) {
return ((task.status === 'Stopped' && task.rate !== 'SIMPLE') || task.status === 'Pending' || task.status ==='Exec' || !hasDataPermission('manage', task.privileges)) return ((task.status === 'Stopped' && task.rate !== 'SIMPLE') || task.status === 'Pending' || task.status === 'Exec' || !hasDataPermission('manage', task.privileges))
}, },
disableDelete(task) { disableDelete(task) {
return false return false