mirror of
https://github.com/dataease/dataease.git
synced 2025-02-25 12:03:05 +08:00
Merge remote-tracking branch 'origin/main' into main
# Conflicts: # backend/src/main/resources/i18n/messages_en_US.properties # backend/src/main/resources/i18n/messages_zh_CN.properties # backend/src/main/resources/i18n/messages_zh_TW.properties # frontend/src/components/canvas/components/Toolbar.vue
This commit is contained in:
commit
746e6c49c3
@ -7,6 +7,8 @@ import io.dataease.base.mapper.ext.ExtDataSourceMapper;
|
||||
import io.dataease.base.mapper.ext.query.GridExample;
|
||||
import io.dataease.commons.exception.DEException;
|
||||
import io.dataease.commons.utils.AuthUtils;
|
||||
import io.dataease.commons.utils.CommonThreadPool;
|
||||
import io.dataease.commons.utils.LogUtil;
|
||||
import io.dataease.controller.request.DatasourceUnionRequest;
|
||||
import io.dataease.controller.sys.base.BaseGridRequest;
|
||||
import io.dataease.controller.sys.base.ConditionEntity;
|
||||
@ -40,6 +42,8 @@ public class DatasourceService {
|
||||
private DatasetTableMapper datasetTableMapper;
|
||||
@Resource
|
||||
private DataSetGroupService dataSetGroupService;
|
||||
@Resource
|
||||
private CommonThreadPool commonThreadPool;
|
||||
|
||||
public Datasource addDatasource(Datasource datasource) {
|
||||
DatasourceExample example = new DatasourceExample();
|
||||
@ -114,7 +118,6 @@ public class DatasourceService {
|
||||
DataTableInfoDTO dataTableInfoDTO = new Gson().fromJson(datasetTable.getInfo(), DataTableInfoDTO.class);
|
||||
if (StringUtils.equals(name, dataTableInfoDTO.getTable())) {
|
||||
dbTableDTO.setEnableCheck(false);
|
||||
|
||||
List<DatasetGroup> parents = dataSetGroupService.getParents(datasetTable.getSceneId());
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
parents.forEach(ele -> stringBuilder.append(ele.getName()).append("/"));
|
||||
@ -131,4 +134,25 @@ public class DatasourceService {
|
||||
public Datasource get(String id) {
|
||||
return datasourceMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public void initAllDataSourceConnectionPool(){
|
||||
List<Datasource> datasources = datasourceMapper.selectByExampleWithBLOBs(new DatasourceExample());
|
||||
datasources.forEach(datasource -> {
|
||||
try {
|
||||
commonThreadPool.addTask(() ->{
|
||||
try {
|
||||
DatasourceProvider datasourceProvider = ProviderFactory.getProvider(datasource.getType());
|
||||
DatasourceRequest datasourceRequest = new DatasourceRequest();
|
||||
datasourceRequest.setDatasource(datasource);
|
||||
datasourceProvider.initDataSource(datasourceRequest);
|
||||
LogUtil.error("Succsss to init datasource connection pool: " + datasource.getName());
|
||||
}catch (Exception e){
|
||||
LogUtil.error("Failed to init datasource connection pool: " + datasource.getName(), e);
|
||||
}
|
||||
});
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,47 +0,0 @@
|
||||
//package io.dataease.listener;
|
||||
//
|
||||
//import io.dataease.base.mapper.DatasetTableMapper;
|
||||
//import io.dataease.commons.utils.CommonThreadPool;
|
||||
//import io.dataease.service.dataset.DataSetTableFieldsService;
|
||||
//import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||
//import org.springframework.context.ApplicationListener;
|
||||
//import org.springframework.core.annotation.Order;
|
||||
//import org.springframework.core.env.Environment;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
//import javax.annotation.Resource;
|
||||
//
|
||||
//@Component
|
||||
//@Order(value = 2)
|
||||
//public class AppStartReadHBaseListener implements ApplicationListener<ApplicationReadyEvent> {
|
||||
// @Resource
|
||||
// private CommonThreadPool commonThreadPool;
|
||||
//// @Resource
|
||||
//// private SparkCalc sparkCalc;
|
||||
// @Resource
|
||||
// private Environment env; // 保存了配置文件的信息
|
||||
//
|
||||
// @Resource
|
||||
// private DatasetTableMapper datasetTableMapper;
|
||||
// @Resource
|
||||
// private DataSetTableFieldsService dataSetTableFieldsService;
|
||||
//
|
||||
// @Override
|
||||
// public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
|
||||
//// System.out.println("================= Read HBase start =================");
|
||||
//// // 项目启动,从数据集中找到定时抽取的表,从HBase中读取放入缓存
|
||||
//// DatasetTableExample datasetTableExample = new DatasetTableExample();
|
||||
//// datasetTableExample.createCriteria().andModeEqualTo(1);
|
||||
//// List<DatasetTable> datasetTables = datasetTableMapper.selectByExampleWithBLOBs(datasetTableExample);
|
||||
//// for (DatasetTable table : datasetTables) {
|
||||
////// commonThreadPool.addTask(() -> {
|
||||
//// try {
|
||||
//// List<DatasetTableField> fields = dataSetTableFieldsService.getFieldsByTableId(table.getId());
|
||||
//// sparkCalc.getHBaseDataAndCache(table.getId(), fields);
|
||||
//// } catch (Exception e) {
|
||||
//// e.printStackTrace();
|
||||
//// }
|
||||
////// });
|
||||
//// }
|
||||
// }
|
||||
//}
|
@ -0,0 +1,25 @@
|
||||
package io.dataease.listener;
|
||||
|
||||
import io.dataease.base.domain.DatasetTableTask;
|
||||
import io.dataease.datasource.service.DatasourceService;
|
||||
import io.dataease.service.ScheduleService;
|
||||
import io.dataease.service.dataset.DataSetTableTaskService;
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@Order(value = 1)
|
||||
public class DataSourceInitStartListener implements ApplicationListener<ApplicationReadyEvent> {
|
||||
@Resource
|
||||
private DatasourceService datasourceService;
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
|
||||
datasourceService.initAllDataSourceConnectionPool();
|
||||
}
|
||||
}
|
@ -9,6 +9,7 @@ import io.dataease.commons.utils.TreeUtils;
|
||||
import io.dataease.controller.request.chart.ChartGroupRequest;
|
||||
import io.dataease.controller.request.dataset.DataSetTableRequest;
|
||||
import io.dataease.dto.chart.ChartGroupDTO;
|
||||
import io.dataease.i18n.Translator;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -104,7 +105,7 @@ public class ChartGroupService {
|
||||
}
|
||||
List<ChartGroup> list = chartGroupMapper.selectByExample(chartGroupExample);
|
||||
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;
|
||||
import io.dataease.dto.chart.ChartViewFieldDTO;
|
||||
import io.dataease.dto.chart.Series;
|
||||
import io.dataease.dto.dataset.DataTableInfoDTO;
|
||||
import io.dataease.i18n.Translator;
|
||||
import io.dataease.provider.QueryProvider;
|
||||
import io.dataease.service.dataset.DataSetTableFieldsService;
|
||||
import io.dataease.service.dataset.DataSetTableService;
|
||||
@ -226,7 +227,7 @@ public class ChartViewService {
|
||||
}
|
||||
List<ChartViewWithBLOBs> list = chartViewMapper.selectByExampleWithBLOBs(chartViewExample);
|
||||
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"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,8 +12,10 @@ import io.dataease.controller.request.dataset.DataSetGroupRequest;
|
||||
import io.dataease.controller.request.dataset.DataSetTableRequest;
|
||||
import io.dataease.dto.dataset.DataSetGroupDTO;
|
||||
import io.dataease.dto.dataset.DataSetTableDTO;
|
||||
import io.dataease.i18n.Translator;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -32,6 +34,7 @@ public class DataSetGroupService {
|
||||
@Resource
|
||||
private DatasetGroupMapper datasetGroupMapper;
|
||||
@Resource
|
||||
@Lazy
|
||||
private DataSetTableService dataSetTableService;
|
||||
@Resource
|
||||
private ExtDataSetGroupMapper extDataSetGroupMapper;
|
||||
@ -115,7 +118,7 @@ public class DataSetGroupService {
|
||||
}
|
||||
List<DatasetGroup> list = datasetGroupMapper.selectByExample(datasetGroupExample);
|
||||
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;
|
||||
import io.dataease.dto.dataset.DataSetTableUnionDTO;
|
||||
import io.dataease.dto.dataset.DataTableInfoCustomUnion;
|
||||
import io.dataease.dto.dataset.DataTableInfoDTO;
|
||||
import io.dataease.i18n.Translator;
|
||||
import io.dataease.provider.DDLProvider;
|
||||
import io.dataease.provider.QueryProvider;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
@ -34,6 +35,7 @@ import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -49,6 +51,7 @@ import java.util.stream.Collectors;
|
||||
* @Date 2021/2/23 2:54 下午
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class DataSetTableService {
|
||||
@Resource
|
||||
private DatasetTableMapper datasetTableMapper;
|
||||
@ -177,7 +180,7 @@ public class DataSetTableService {
|
||||
.id("count")
|
||||
.tableId(dataSetTableRequest.getId())
|
||||
.originName("*")
|
||||
.name("记录数*")
|
||||
.name(Translator.get("i18n_chart_count"))
|
||||
.dataeaseName("*")
|
||||
.type("INT")
|
||||
.checked(true)
|
||||
@ -500,7 +503,7 @@ public class DataSetTableService {
|
||||
return;
|
||||
}
|
||||
QueryProvider qp = null;
|
||||
if(!ObjectUtils.isEmpty(ds)) {
|
||||
if (!ObjectUtils.isEmpty(ds)) {
|
||||
qp = ProviderFactory.getQueryProvider(ds.getType());
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(fields)) {
|
||||
@ -611,7 +614,7 @@ public class DataSetTableService {
|
||||
}
|
||||
List<DatasetTable> list = datasetTableMapper.selectByExample(datasetTableExample);
|
||||
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 +650,11 @@ public class DataSetTableService {
|
||||
if (StringUtils.equalsIgnoreCase(suffix, "xls")) {
|
||||
HSSFWorkbook workbook = new HSSFWorkbook(inputStream);
|
||||
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());
|
||||
}
|
||||
if (sheet0.getNumMergedRegions() > 0) {
|
||||
throw new RuntimeException("Sheet have merged regions.");
|
||||
throw new RuntimeException(Translator.get("i18n_excel_have_merge_region"));
|
||||
}
|
||||
int rows;
|
||||
if (isPreview) {
|
||||
@ -668,7 +671,7 @@ public class DataSetTableService {
|
||||
tableFiled.setFieldType("TEXT");
|
||||
tableFiled.setFieldSize(1024);
|
||||
String columnName = readCell(row.getCell(j));
|
||||
if(StringUtils.isEmpty(columnName)){
|
||||
if (StringUtils.isEmpty(columnName)) {
|
||||
columnName = "NONE_" + String.valueOf(j);
|
||||
}
|
||||
tableFiled.setFieldName(columnName);
|
||||
@ -686,11 +689,11 @@ public class DataSetTableService {
|
||||
} else if (StringUtils.equalsIgnoreCase(suffix, "xlsx")) {
|
||||
XSSFWorkbook xssfWorkbook = new XSSFWorkbook(inputStream);
|
||||
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());
|
||||
}
|
||||
if (sheet0.getNumMergedRegions() > 0) {
|
||||
throw new RuntimeException("Sheet have merged regions.");
|
||||
throw new RuntimeException(Translator.get("i18n_excel_have_merge_region"));
|
||||
}
|
||||
int rows;
|
||||
if (isPreview) {
|
||||
@ -707,7 +710,7 @@ public class DataSetTableService {
|
||||
tableFiled.setFieldType("TEXT");
|
||||
tableFiled.setFieldSize(1024);
|
||||
String columnName = readCell(row.getCell(j));
|
||||
if(StringUtils.isEmpty(columnName)){
|
||||
if (StringUtils.isEmpty(columnName)) {
|
||||
columnName = "NONE_" + String.valueOf(j);
|
||||
}
|
||||
tableFiled.setFieldName(columnName);
|
||||
|
@ -3,6 +3,7 @@ package io.dataease.service.dataset;
|
||||
import io.dataease.base.domain.DatasetTableTask;
|
||||
import io.dataease.base.domain.DatasetTableTaskExample;
|
||||
import io.dataease.base.mapper.DatasetTableTaskMapper;
|
||||
import io.dataease.i18n.Translator;
|
||||
import io.dataease.service.ScheduleService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.quartz.CronExpression;
|
||||
@ -31,7 +32,7 @@ public class DataSetTableTaskService {
|
||||
// check
|
||||
if (StringUtils.isNotEmpty(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())) {
|
||||
|
@ -63,6 +63,7 @@ import org.pentaho.di.trans.steps.userdefinedjavaclass.UserDefinedJavaClassDef;
|
||||
import org.pentaho.di.trans.steps.userdefinedjavaclass.UserDefinedJavaClassMeta;
|
||||
import org.pentaho.di.www.SlaveServerJobStatus;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -82,6 +83,7 @@ import java.util.stream.Collectors;
|
||||
public class ExtractDataService {
|
||||
|
||||
@Resource
|
||||
@Lazy
|
||||
private DataSetTableService dataSetTableService;
|
||||
@Resource
|
||||
private DataSetTableFieldsService dataSetTableFieldsService;
|
||||
@ -91,7 +93,6 @@ public class ExtractDataService {
|
||||
private DataSetTableTaskService dataSetTableTaskService;
|
||||
@Resource
|
||||
private DatasourceMapper datasourceMapper;
|
||||
private static ExecutorService pool = Executors.newScheduledThreadPool(50); //设置连接池
|
||||
|
||||
private static String lastUpdateTime = "${__last_update_time__}";
|
||||
private static String currentUpdateTime = "${__current_update_time__}";
|
||||
@ -113,7 +114,6 @@ public class ExtractDataService {
|
||||
"UNIQUE KEY(dataease_uuid)\n" +
|
||||
"DISTRIBUTED BY HASH(dataease_uuid) BUCKETS 10\n" +
|
||||
"PROPERTIES(\"replication_num\" = \"1\");";
|
||||
|
||||
private static String shellScript = "curl --location-trusted -u %s:%s -H \"label:%s\" -H \"column_separator:%s\" -H \"columns:%s\" -H \"merge_type: %s\" -T %s -XPUT http://%s:%s/api/%s/%s/_stream_load\n" +
|
||||
"rm -rf %s\n";
|
||||
|
||||
@ -448,6 +448,7 @@ public class ExtractDataService {
|
||||
selectSQL = qp.createQuerySQL(tableName, datasetTableFields);
|
||||
}
|
||||
inputStep = inputStep(transMeta, selectSQL);
|
||||
udjcStep = udjc(datasetTableFields, false);
|
||||
break;
|
||||
case sqlServer:
|
||||
SqlServerConfigration sqlServerConfigration = new Gson().fromJson(datasource.getConfiguration(), SqlServerConfigration.class);
|
||||
@ -459,10 +460,12 @@ public class ExtractDataService {
|
||||
selectSQL = qp.createQuerySQL(tableName, datasetTableFields);
|
||||
}
|
||||
inputStep = inputStep(transMeta, selectSQL);
|
||||
udjcStep = udjc(datasetTableFields, false);
|
||||
break;
|
||||
case excel:
|
||||
String filePath = new Gson().fromJson(datasetTable.getInfo(), DataTableInfoDTO.class).getData();
|
||||
inputStep = excelInputStep(filePath, datasetTableFields);
|
||||
udjcStep = udjc(datasetTableFields, true);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -487,7 +490,7 @@ public class ExtractDataService {
|
||||
break;
|
||||
}
|
||||
|
||||
udjcStep = udjc(datasetTableFields);
|
||||
|
||||
outputStep = outputStep(dorisOutputTable);
|
||||
hi1 = new TransHopMeta(inputStep, udjcStep);
|
||||
hi2 = new TransHopMeta(udjcStep, outputStep);
|
||||
@ -569,11 +572,11 @@ public class ExtractDataService {
|
||||
return outputStep;
|
||||
}
|
||||
|
||||
private StepMeta udjc(List<DatasetTableField> datasetTableFields) {
|
||||
String needToChangeolumnType = "";
|
||||
private StepMeta udjc(List<DatasetTableField> datasetTableFields, boolean isExcel) {
|
||||
String needToChangeColumnType = "";
|
||||
for (DatasetTableField datasetTableField : datasetTableFields) {
|
||||
if (datasetTableField.getDeExtractType() != null && datasetTableField.getDeExtractType() == 4) {
|
||||
needToChangeolumnType = needToChangeolumnType + alterColumnTypeCode.replace("FILED", datasetTableField.getOriginName());
|
||||
needToChangeColumnType = needToChangeColumnType + alterColumnTypeCode.replace("FILED", datasetTableField.getOriginName());
|
||||
}
|
||||
}
|
||||
|
||||
@ -583,8 +586,13 @@ public class ExtractDataService {
|
||||
fields.add(fieldInfo);
|
||||
userDefinedJavaClassMeta.setFieldInfo(fields);
|
||||
List<UserDefinedJavaClassDef> definitions = new ArrayList<UserDefinedJavaClassDef>();
|
||||
UserDefinedJavaClassDef userDefinedJavaClassDef = new UserDefinedJavaClassDef(UserDefinedJavaClassDef.ClassType.TRANSFORM_CLASS, "Processor",
|
||||
code.replace("alterColumnTypeCode", needToChangeolumnType).replace("Column_Fields", String.join(",", datasetTableFields.stream().map(DatasetTableField::getOriginName).collect(Collectors.toList()))));
|
||||
String tmp_code = code.replace("alterColumnTypeCode", needToChangeColumnType).replace("Column_Fields", String.join(",", datasetTableFields.stream().map(DatasetTableField::getOriginName).collect(Collectors.toList())));
|
||||
if(isExcel){
|
||||
tmp_code = tmp_code.replace("handleExcelIntColumn", handleExcelIntColumn);
|
||||
}else {
|
||||
tmp_code = tmp_code.replace("handleExcelIntColumn", "");
|
||||
}
|
||||
UserDefinedJavaClassDef userDefinedJavaClassDef = new UserDefinedJavaClassDef(UserDefinedJavaClassDef.ClassType.TRANSFORM_CLASS, "Processor", tmp_code);
|
||||
|
||||
userDefinedJavaClassDef.setActive(true);
|
||||
definitions.add(userDefinedJavaClassDef);
|
||||
@ -629,6 +637,14 @@ public class ExtractDataService {
|
||||
" }\n" +
|
||||
" }\n";
|
||||
|
||||
private static String handleExcelIntColumn = " \t\tif(tmp != null && tmp.endsWith(\".0\")){\n" +
|
||||
" try {\n" +
|
||||
" Integer.valueOf(tmp.substring(0, tmp.length()-2));\n" +
|
||||
" get(Fields.Out, filed).setValue(r, tmp.substring(0, tmp.length()-2));\n" +
|
||||
" get(Fields.Out, filed).getValueMeta().setType(2);\n" +
|
||||
" }catch (Exception e){}\n" +
|
||||
" }";
|
||||
|
||||
private static String code = "import org.pentaho.di.core.row.ValueMetaInterface;\n" +
|
||||
"import java.util.List;\n" +
|
||||
"import java.io.File;\n" +
|
||||
@ -659,6 +675,7 @@ public class ExtractDataService {
|
||||
" for (String filed : fileds) {\n" +
|
||||
" String tmp = get(Fields.In, filed).getString(r);\n" +
|
||||
"alterColumnTypeCode \n" +
|
||||
"handleExcelIntColumn \n" +
|
||||
" str = str + tmp;\n" +
|
||||
" }\n" +
|
||||
"\n" +
|
||||
|
@ -228,6 +228,10 @@ i18n_auth_export=Export
|
||||
i18n_auth_manage=Manage
|
||||
i18n_template_system=System 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
|
||||
i18n_same_folder_can_not_repeat=Same Folder Can Not Repeat
|
||||
i18n_default_panel=Default Panel
|
||||
i18n_panel_list=Panel List
|
||||
|
@ -229,6 +229,10 @@ i18n_auth_export=导出
|
||||
i18n_auth_manage=管理
|
||||
i18n_template_system=系统模板
|
||||
i18n_template_self=用户模板
|
||||
i18n_name_cant_repeat_same_group=同一分组下名称不能重复
|
||||
i18n_chart_count=记录数*
|
||||
i18n_excel_have_merge_region=Excel存在合并单元格
|
||||
i18n_cron_expression_error=Cron表达式校验错误
|
||||
i18n_same_folder_can_not_repeat=相同的目录下名称不能重复
|
||||
i18n_default_panel=默认仪表盘
|
||||
i18n_panel_list=仪表盘列表
|
||||
|
@ -229,6 +229,10 @@ i18n_auth_export=導出
|
||||
i18n_auth_manage=管理
|
||||
i18n_template_system=系統模板
|
||||
i18n_template_self=用戶模板
|
||||
i18n_name_cant_repeat_same_group=同一分組下名稱不能重復
|
||||
i18n_chart_count=記錄數*
|
||||
i18n_excel_have_merge_region=Excel存在合並單元格
|
||||
i18n_cron_expression_error=Cron表達式校驗錯誤
|
||||
i18n_same_folder_can_not_repeat=相同的目录下名称不能重复
|
||||
i18n_default_panel=默认仪表盘
|
||||
i18n_panel_list=仪表盘列表
|
||||
|
@ -51,7 +51,7 @@
|
||||
"@babel/register": "7.0.0",
|
||||
"@vue/cli-plugin-babel": "3.6.0",
|
||||
"@vue/cli-plugin-eslint": "^3.9.1",
|
||||
"@vue/cli-service": "3.6.0",
|
||||
"@vue/cli-service": "^3.3.1",
|
||||
"babel-eslint": "10.0.1",
|
||||
"chalk": "2.4.2",
|
||||
"connect": "3.6.6",
|
||||
@ -61,7 +61,7 @@
|
||||
"less": "^4.1.1",
|
||||
"less-loader": "^8.0.0",
|
||||
"mockjs": "1.0.1-beta3",
|
||||
"runjs": "^4.3.2",
|
||||
"runjs": "^4.1.3",
|
||||
"sass": "^1.32.5",
|
||||
"sass-loader": "^10.1.1",
|
||||
"script-ext-html-webpack-plugin": "2.1.3",
|
||||
|
@ -6,7 +6,7 @@
|
||||
{{ item.name }}<i class="el-icon-arrow-down el-icon--right" />
|
||||
</el-tag>
|
||||
<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>
|
||||
</el-dropdown-item>
|
||||
<slot />
|
||||
|
@ -79,8 +79,6 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
const _this = this
|
||||
|
||||
debugger
|
||||
// 加载数据
|
||||
_this.restore()
|
||||
const erd = elementResizeDetectorMaker()
|
||||
|
@ -29,14 +29,14 @@
|
||||
<el-button class="el-icon-document-delete" size="mini" circle @click="clearCanvas" />
|
||||
</el-tooltip>
|
||||
<input id="input" ref="files" type="file" hidden @change="handleFileChange">
|
||||
<el-tooltip :content="$t('commons.save') ">
|
||||
<el-button class="el-icon-circle-check" size="mini" circle @click="save" />
|
||||
</el-tooltip>
|
||||
<el-tooltip :content="$t('panel.preview')">
|
||||
<el-button class="el-icon-view" size="mini" circle @click="clickPreview" />
|
||||
</el-tooltip>
|
||||
|
||||
<span style="float: right;margin-left: 10px">
|
||||
<el-button size="mini" @click="save">
|
||||
{{ $t('commons.save') }}
|
||||
</el-button>
|
||||
<el-button size="mini" @click="closePanelEdit">
|
||||
{{ $t('commons.close') }}
|
||||
</el-button>
|
||||
@ -52,7 +52,7 @@ import { mapState } from 'vuex'
|
||||
import { commonStyle, commonAttr } from '@/components/canvas/custom-component/component-list'
|
||||
import eventBus from '@/components/canvas/utils/eventBus'
|
||||
import { deepCopy } from '@/components/canvas/utils/utils'
|
||||
import { panelSave } from '@/api/panel/panel'
|
||||
import { post } from '@/api/panel/panel'
|
||||
import bus from '@/utils/bus'
|
||||
|
||||
export default {
|
||||
@ -208,13 +208,8 @@ export default {
|
||||
panelStyle: JSON.stringify(this.canvasStyleData),
|
||||
panelData: JSON.stringify(this.componentData)
|
||||
}
|
||||
panelSave(requestInfo).then(response => {
|
||||
this.$message({
|
||||
message: this.$t('commons.save_success'),
|
||||
type: 'success',
|
||||
showClose: true
|
||||
})
|
||||
})
|
||||
post('panel/group/save', requestInfo, () => {})
|
||||
this.$message.success('保存成功')
|
||||
},
|
||||
clearCanvas() {
|
||||
this.$store.commit('setComponentData', [])
|
||||
|
@ -1,8 +1,6 @@
|
||||
function checkDataPermission(el, binding, vnode) {
|
||||
const dataPermission = vnode.privileges
|
||||
debugger
|
||||
const { value } = binding
|
||||
console.log('permission:' + value)
|
||||
// // 数据授权采用并集的方式 部门 角色 用户 有一个有权限即可
|
||||
// if (value && value instanceof Array) {
|
||||
// const needPermissions = value
|
||||
|
@ -815,6 +815,8 @@ export default {
|
||||
input_limit_0_50: '0-50 chars'
|
||||
},
|
||||
panel: {
|
||||
picture_limit: 'Only pictures can be inserted',
|
||||
drag_here: 'Please drag the left field here',
|
||||
copy_link_passwd: 'Copy link and password',
|
||||
copy_link: 'Copy link',
|
||||
passwd_protect: 'Password Protect',
|
||||
|
@ -814,6 +814,8 @@ export default {
|
||||
input_limit_0_50: '0-50字符'
|
||||
},
|
||||
panel: {
|
||||
picture_limit: '只能插入圖片',
|
||||
drag_here: '請將左側字段拖至此處',
|
||||
copy_link_passwd: '複製鏈接及密碼',
|
||||
copy_link: '複製鏈接',
|
||||
passwd_protect: '密碼保護',
|
||||
|
@ -816,6 +816,8 @@ export default {
|
||||
input_limit_0_50: '0-50字符'
|
||||
},
|
||||
panel: {
|
||||
picture_limit: '只能插入图片',
|
||||
drag_here: '请将左侧字段拖至此处',
|
||||
copy_link_passwd: '复制链接及密码',
|
||||
copy_link: '复制链接',
|
||||
passwd_protect: '密码保护',
|
||||
|
@ -125,20 +125,20 @@
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-row style="color: #909399;">
|
||||
<span>
|
||||
<span v-show="chart.type && (chart.type.includes('pie') || chart.type.includes('funnel'))">
|
||||
Tips: {{ $t('chart.only_one_quota') }}
|
||||
</span>
|
||||
<span v-show="chart.type && (chart.type.includes('text'))">
|
||||
Tips: {{ $t('chart.only_one_result') }}
|
||||
</span>
|
||||
<span v-show="chart.type && chart.type.includes('gauge')">
|
||||
Tips: {{ $t('chart.only_one_quota') }},{{ $t('chart.only_one_result') }}
|
||||
</span>
|
||||
</span>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-row style="padding: 4px 6px;color: #909399;">
|
||||
<span>
|
||||
<span v-show="chart.type && (chart.type.includes('pie') || chart.type.includes('funnel'))">
|
||||
Tips: {{ $t('chart.only_one_quota') }}
|
||||
</span>
|
||||
<span v-show="chart.type && (chart.type.includes('text'))">
|
||||
Tips: {{ $t('chart.only_one_result') }}
|
||||
</span>
|
||||
<span v-show="chart.type && chart.type.includes('gauge')">
|
||||
Tips: {{ $t('chart.only_one_quota') }},{{ $t('chart.only_one_result') }}
|
||||
</span>
|
||||
</span>
|
||||
</el-row>
|
||||
<div style="overflow:auto;border-top: 1px solid #e6e6e6" class="attr-style">
|
||||
<el-row class="padding-lr">
|
||||
<span>{{ $t('chart.style_priority') }}</span>
|
||||
@ -902,6 +902,8 @@ export default {
|
||||
/*background-color: rgba(35,46,64,.05);*/
|
||||
background-color: white;
|
||||
display: block;
|
||||
word-break: break-all;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.item-on-move {
|
||||
@ -977,7 +979,7 @@ export default {
|
||||
}
|
||||
|
||||
.attr-style{
|
||||
height: calc(100vh - 56px - 25vh - 40px - 62px - 10px - 60px);
|
||||
height: calc(100vh - 56px - 25vh - 40px - 62px - 60px);
|
||||
}
|
||||
|
||||
.attr-selector{
|
||||
|
@ -2,7 +2,7 @@
|
||||
<el-col>
|
||||
<el-row>
|
||||
<el-col style="width: 200px;">
|
||||
<el-form ref="form" :model="form" label-width="60px" size="mini" class="row-style">
|
||||
<el-form ref="form" :model="form" label-width="100px" size="mini" class="row-style">
|
||||
<el-form-item :label="$t('dataset.showRow')">
|
||||
<el-input v-model="form.row">
|
||||
<el-button slot="append" icon="el-icon-search" @click="reSearch" />
|
||||
|
@ -135,8 +135,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item v-if="taskForm.rate === 'CRON'" label="">
|
||||
<el-popover v-model="cronEdit">
|
||||
<cron @close="cronEdit = false" @change="cronChange" i18n="cn"/>
|
||||
<el-input v-model="taskForm.cron" size="mini" style="width: 50%" @click="cronEdit = true" slot="reference"/>
|
||||
<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-popover>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('dataset.end_time')" prop="end">
|
||||
@ -354,7 +354,8 @@ export default {
|
||||
incrementalUpdateType: 'incrementalAdd',
|
||||
sql: '',
|
||||
incrementalConfig: {},
|
||||
cronEdit: false
|
||||
cronEdit: false,
|
||||
lang: this.$store.getters.language === 'en_US' ? 'en' : 'cn'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -257,7 +257,7 @@ export default {
|
||||
this.$router.replace('/panel/index')
|
||||
},
|
||||
showPanel(type) {
|
||||
debugger
|
||||
|
||||
if (this.showIndex === -1 || this.showIndex === type) {
|
||||
this.$nextTick(() => (this.show = !this.show))
|
||||
}
|
||||
@ -272,7 +272,6 @@ export default {
|
||||
// 点击样式按钮 排除
|
||||
const stick = evt.target.closest('.el-icon-magic-stick')
|
||||
if (!parent && !self && !stick) {
|
||||
debugger
|
||||
this.show = false
|
||||
window.removeEventListener('click', this.closeSidebar)
|
||||
this.showIndex = -1
|
||||
@ -388,7 +387,6 @@ export default {
|
||||
this.openFilterDiolog()
|
||||
},
|
||||
closeLeftPanel() {
|
||||
debugger
|
||||
this.show = false
|
||||
// this.beforeDestroy()
|
||||
},
|
||||
|
@ -120,8 +120,7 @@
|
||||
<div class="filter-field">
|
||||
<div class="field-content">
|
||||
<div class="field-content-left">
|
||||
<!-- <div class="field-content-text">{{ $t('panel.field') }} </div> -->
|
||||
<div class="field-content-text">字段</div>
|
||||
<div class="field-content-text">{{ $t('panel.field') }} </div>
|
||||
</div>
|
||||
|
||||
<div class="field-content-right">
|
||||
@ -133,8 +132,8 @@
|
||||
:move="onMove"
|
||||
style="width:100%;height: 100%;margin:0 10px;border-radius: 4px;overflow-x: auto;display: flex;align-items: center;background-color: white;"
|
||||
@end="end2"
|
||||
>
|
||||
<transition-group class="draggable-group">
|
||||
>
|
||||
<transition-group class="list-group" :data-value="$t('panel.drag_here')">
|
||||
<drag-item v-for="(item,index) in selectField" :key="item.id" :item="item" :index="index" @closeItem="closeItem" />
|
||||
</transition-group>
|
||||
</draggable>
|
||||
@ -309,7 +308,9 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
attr(){
|
||||
return 'aaa'
|
||||
},
|
||||
loadViews() {
|
||||
const viewIds = this.componentData
|
||||
.filter(item => item.type === 'view' && item.propValue && item.propValue.viewId)
|
||||
@ -646,4 +647,16 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.list-group:empty,
|
||||
.list-group > div:empty {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
height: calc(100% - 13px);
|
||||
}
|
||||
|
||||
.list-group:empty:before,
|
||||
.list-group > div:empty:before {
|
||||
content: attr(data-value);
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -127,7 +127,6 @@ export default {
|
||||
// 初始化授权模板
|
||||
if (this.showExtent) {
|
||||
authDetailsModel(this.dataInfo.authType).then(res => {
|
||||
debugger
|
||||
this.defaultAuthDetails = res.data
|
||||
})
|
||||
this.loadAuth()
|
||||
|
Loading…
Reference in New Issue
Block a user