Merge branch 'dev' into pr@dev_eslint_auto_fix

This commit is contained in:
dataeaseShu 2022-10-24 11:48:07 +08:00
commit e98ac7a638
178 changed files with 1793 additions and 1386 deletions

View File

@ -37,13 +37,13 @@ public class DeLogAnnotationHandler {
@Resource @Resource
private LogService logService; private LogService logService;
private static List<Integer> befores = new ArrayList<>(); private static List<Integer> before = new ArrayList<>();
@PostConstruct @PostConstruct
public void init() { public void init() {
befores.add(SysLogConstants.OPERATE_TYPE.DELETE.getValue()); before.add(SysLogConstants.OPERATE_TYPE.DELETE.getValue());
befores.add(SysLogConstants.OPERATE_TYPE.UNSHARE.getValue()); before.add(SysLogConstants.OPERATE_TYPE.UNSHARE.getValue());
befores.add(SysLogConstants.OPERATE_TYPE.UNAUTHORIZE.getValue()); before.add(SysLogConstants.OPERATE_TYPE.UNAUTHORIZE.getValue());
} }
private SysLogDTO exec(JoinPoint point, DeLog deLog) throws Exception{ private SysLogDTO exec(JoinPoint point, DeLog deLog) throws Exception{
@ -110,7 +110,7 @@ public class DeLogAnnotationHandler {
SysLogDTO logDTO = null; SysLogDTO logDTO = null;
Object result = null; Object result = null;
DeLog log = getLog(point); DeLog log = getLog(point);
if(befores.contains(log.operatetype().getValue())) { if(before.contains(log.operatetype().getValue())) {
// 前置处理 比如删除操作 需要在数据删除之前查询 // 前置处理 比如删除操作 需要在数据删除之前查询
logDTO = exec(point, log); logDTO = exec(point, log);
result = point.proceed(point.getArgs()); result = point.proceed(point.getArgs());

View File

@ -182,7 +182,7 @@ public class AuthUserServiceImpl implements AuthUserService {
if (beansOfType.keySet().size() == 0) return false; if (beansOfType.keySet().size() == 0) return false;
OidcXpackService oidcXpackService = SpringContextUtil.getBean(OidcXpackService.class); OidcXpackService oidcXpackService = SpringContextUtil.getBean(OidcXpackService.class);
if (ObjectUtils.isEmpty(oidcXpackService)) return false; if (ObjectUtils.isEmpty(oidcXpackService)) return false;
return oidcXpackService.isSuuportOIDC(); return oidcXpackService.isSupportOIDC();
} }
@Override @Override
@ -191,7 +191,7 @@ public class AuthUserServiceImpl implements AuthUserService {
if (beansOfType.keySet().size() == 0) return false; if (beansOfType.keySet().size() == 0) return false;
CasXpackService casXpackService = SpringContextUtil.getBean(CasXpackService.class); CasXpackService casXpackService = SpringContextUtil.getBean(CasXpackService.class);
if (ObjectUtils.isEmpty(casXpackService)) return false; if (ObjectUtils.isEmpty(casXpackService)) return false;
return casXpackService.suuportCas(); return casXpackService.supportCas();
} }
@Override @Override

View File

@ -127,7 +127,7 @@ public class ExtAuthServiceImpl implements ExtAuthService {
@CacheEvict(value = AuthConstants.USER_PANEL_NAME, key = "'user' + #userId") @CacheEvict(value = AuthConstants.USER_PANEL_NAME, key = "'user' + #userId")
}) })
public void clearUserResource(Long userId) { public void clearUserResource(Long userId) {
LogUtil.info("all permission resource of user {} is cleanning...", userId); LogUtil.info("all permission resource of user {} is cleaning...", userId);
} }
@Caching(evict = { @Caching(evict = {
@ -136,7 +136,7 @@ public class ExtAuthServiceImpl implements ExtAuthService {
@CacheEvict(value = AuthConstants.DEPT_PANEL_NAME, key = "'dept' + #deptId") @CacheEvict(value = AuthConstants.DEPT_PANEL_NAME, key = "'dept' + #deptId")
}) })
public void clearDeptResource(Long deptId) { public void clearDeptResource(Long deptId) {
LogUtil.info("all permission resource of dept {} is cleanning...", deptId); LogUtil.info("all permission resource of dept {} is cleaning...", deptId);
} }
@Caching(evict = { @Caching(evict = {
@ -145,7 +145,7 @@ public class ExtAuthServiceImpl implements ExtAuthService {
@CacheEvict(value = AuthConstants.ROLE_PANEL_NAME, key = "'role' + #roleId") @CacheEvict(value = AuthConstants.ROLE_PANEL_NAME, key = "'role' + #roleId")
}) })
public void clearRoleResource(Long roleId) { public void clearRoleResource(Long roleId) {
LogUtil.info("all permission resource of role {} is cleanning...", roleId); LogUtil.info("all permission resource of role {} is cleaning...", roleId);
} }
@Override @Override

View File

@ -4,10 +4,10 @@ public enum ResourceAuthLevel {
COMMON_LEVEL_USE(1), COMMON_LEVEL_USE(1),
PANNEL_LEVEL_VIEW(1), PANEL_LEVEL_VIEW(1),
PANNEL_LEVEL_EXPORT(3), PANEL_LEVEL_EXPORT(3),
PANNEL_LEVEL_MANAGE(5), PANEL_LEVEL_MANAGE(5),
PANNEL_LEVEL_GRANT(15), PANEL_LEVEL_GRANT(15),
DATASET_LEVEL_USE(1), DATASET_LEVEL_USE(1),
DATASET_LEVEL_MANAGE(3), DATASET_LEVEL_MANAGE(3),

View File

@ -11,6 +11,6 @@ public class ExcelSheetModel {
private List<String> heads; private List<String> heads;
private List<List<String>> datas; private List<List<String>> data;
} }

View File

@ -131,7 +131,7 @@ public class AuthUtils {
result.addAll(roleSet); result.addAll(roleSet);
result.addAll(deptSet); result.addAll(deptSet);
Arrays.stream(defaultPanelPermissions).forEach(item -> { Arrays.stream(defaultPanelPermissions).forEach(item -> {
result.add(new AuthItem(item, ResourceAuthLevel.PANNEL_LEVEL_MANAGE.getLevel())); result.add(new AuthItem(item, ResourceAuthLevel.PANEL_LEVEL_MANAGE.getLevel()));
}); });
return result; return result;
} }

View File

@ -28,7 +28,7 @@ public class CronUtils {
if (!CronExpression.isValidExpression(cron)) { if (!CronExpression.isValidExpression(cron)) {
throw new RuntimeException("cron :" + cron + "表达式解析错误"); throw new RuntimeException("cron :" + cron + "表达式解析错误");
} }
return TriggerBuilder.newTrigger().withIdentity("Caclulate Date").withSchedule(CronScheduleBuilder.cronSchedule(cron)).build(); return TriggerBuilder.newTrigger().withIdentity("Calculate Date").withSchedule(CronScheduleBuilder.cronSchedule(cron)).build();
} }
/** /**

View File

@ -28,7 +28,7 @@ public class ExcelUtils {
sheets.forEach(sheet -> { sheets.forEach(sheet -> {
List<List<String>> details = sheet.getDatas(); List<List<String>> details = sheet.getData();
details.add(0, sheet.getHeads()); details.add(0, sheet.getHeads());
String sheetName = sheet.getSheetName(); String sheetName = sheet.getSheetName();
HSSFSheet curSheet = wb.createSheet(sheetName); HSSFSheet curSheet = wb.createSheet(sheetName);

View File

@ -23,7 +23,7 @@ import java.util.stream.Collectors;
**/ **/
public class ExcelXlsReader implements HSSFListener { public class ExcelXlsReader implements HSSFListener {
private int minColums = -1; private int minColumns = -1;
public Integer getObtainedNum() { public Integer getObtainedNum() {
return obtainedNum; return obtainedNum;
@ -211,8 +211,8 @@ public class ExcelXlsReader implements HSSFListener {
thisRow = frec.getRow(); thisRow = frec.getRow();
thisColumn = frec.getColumn(); thisColumn = frec.getColumn();
thisStr = String.valueOf(frec.getValue()); thisStr = String.valueOf(frec.getValue());
String feildType = checkType(thisStr, thisColumn); String fieldType = checkType(thisStr, thisColumn);
if(feildType.equalsIgnoreCase("LONG") && thisStr.endsWith(".0")){ if(fieldType.equalsIgnoreCase("LONG") && thisStr.endsWith(".0")){
thisStr = thisStr.substring(0, thisStr.length() -2); thisStr = thisStr.substring(0, thisStr.length() -2);
} }
cellList.add(thisColumn, thisStr); cellList.add(thisColumn, thisStr);
@ -300,7 +300,7 @@ public class ExcelXlsReader implements HSSFListener {
//行结束时的操作 //行结束时的操作
if (record instanceof LastCellOfRowDummyRecord) { if (record instanceof LastCellOfRowDummyRecord) {
if (minColums > 0) { if (minColumns > 0) {
//列值重新置空 //列值重新置空
if (lastColumnNumber == -1) { if (lastColumnNumber == -1) {
lastColumnNumber = 0; lastColumnNumber = 0;
@ -308,9 +308,9 @@ public class ExcelXlsReader implements HSSFListener {
} }
lastColumnNumber = -1; lastColumnNumber = -1;
if(!totalSheets.stream().map(ExcelSheetData::getExcelLable).collect(Collectors.toList()).contains(sheetName)){ if(!totalSheets.stream().map(ExcelSheetData::getExcelLabel).collect(Collectors.toList()).contains(sheetName)){
ExcelSheetData excelSheetData = new ExcelSheetData(); ExcelSheetData excelSheetData = new ExcelSheetData();
excelSheetData.setExcelLable(sheetName); excelSheetData.setExcelLabel(sheetName);
excelSheetData.setData(new ArrayList<>()); excelSheetData.setData(new ArrayList<>());
excelSheetData.setFields(new ArrayList<>()); excelSheetData.setFields(new ArrayList<>());
totalSheets.add(excelSheetData); totalSheets.add(excelSheetData);
@ -330,10 +330,10 @@ public class ExcelXlsReader implements HSSFListener {
if (flag && curRow != 0) { //该行不为空行且该行不是第一行发送第一行为列名不需要 if (flag && curRow != 0) { //该行不为空行且该行不是第一行发送第一行为列名不需要
if(!totalSheets.stream().map(ExcelSheetData::getExcelLable).collect(Collectors.toList()).contains(sheetName)){ if(!totalSheets.stream().map(ExcelSheetData::getExcelLabel).collect(Collectors.toList()).contains(sheetName)){
ExcelSheetData excelSheetData = new ExcelSheetData(); ExcelSheetData excelSheetData = new ExcelSheetData();
excelSheetData.setData(new ArrayList<>(data)); excelSheetData.setData(new ArrayList<>(data));
excelSheetData.setExcelLable(sheetName); excelSheetData.setExcelLabel(sheetName);
excelSheetData.setFields(new ArrayList<>(fields)); excelSheetData.setFields(new ArrayList<>(fields));
List<String> tmp = new ArrayList<>(cellList); List<String> tmp = new ArrayList<>(cellList);
excelSheetData.getData().add(tmp); excelSheetData.getData().add(tmp);
@ -341,11 +341,11 @@ public class ExcelXlsReader implements HSSFListener {
totalSheets.add(excelSheetData); totalSheets.add(excelSheetData);
}else { }else {
List<String> tmp = new ArrayList<>(cellList); List<String> tmp = new ArrayList<>(cellList);
if(obtainedNum != null && totalSheets.stream().filter(s->s.getExcelLable().equalsIgnoreCase(sheetName)).collect(Collectors.toList()).get(0).getData().size() < obtainedNum){ if(obtainedNum != null && totalSheets.stream().filter(s->s.getExcelLabel().equalsIgnoreCase(sheetName)).collect(Collectors.toList()).get(0).getData().size() < obtainedNum){
totalSheets.stream().filter(s->s.getExcelLable().equalsIgnoreCase(sheetName)).collect(Collectors.toList()).get(0).getData().add(tmp); totalSheets.stream().filter(s->s.getExcelLabel().equalsIgnoreCase(sheetName)).collect(Collectors.toList()).get(0).getData().add(tmp);
} }
if(obtainedNum == null){ if(obtainedNum == null){
totalSheets.stream().filter(s->s.getExcelLable().equalsIgnoreCase(sheetName)).collect(Collectors.toList()).get(0).getData().add(tmp); totalSheets.stream().filter(s->s.getExcelLabel().equalsIgnoreCase(sheetName)).collect(Collectors.toList()).get(0).getData().add(tmp);
} }
totalRows++; totalRows++;
} }

View File

@ -170,7 +170,7 @@ public class ExcelXlsxReader extends DefaultHandler {
ExcelSheetData excelSheetData = new ExcelSheetData(); ExcelSheetData excelSheetData = new ExcelSheetData();
excelSheetData.setData(new ArrayList<>(data)); excelSheetData.setData(new ArrayList<>(data));
excelSheetData.setExcelLable(sheets.getSheetName()); excelSheetData.setExcelLabel(sheets.getSheetName());
excelSheetData.setFields(new ArrayList<>(fields)); excelSheetData.setFields(new ArrayList<>(fields));
totalSheets.add(excelSheetData); totalSheets.add(excelSheetData);

View File

@ -36,21 +36,21 @@ public class ChartViewController {
@Resource @Resource
private ChartViewCacheService chartViewCacheService; private ChartViewCacheService chartViewCacheService;
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE) @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
@ApiOperation("保存") @ApiOperation("保存")
@PostMapping("/save/{panelId}") @PostMapping("/save/{panelId}")
public ChartViewDTO save(@PathVariable String panelId, @RequestBody ChartViewRequest request) { public ChartViewDTO save(@PathVariable String panelId, @RequestBody ChartViewRequest request) {
return chartViewService.save(request); return chartViewService.save(request);
} }
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE) @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
@ApiOperation("新建视图") @ApiOperation("新建视图")
@PostMapping("/newOne/{panelId}") @PostMapping("/newOne/{panelId}")
public ChartViewWithBLOBs save(@PathVariable String panelId, @RequestBody ChartViewWithBLOBs chartViewWithBLOBs) { public ChartViewWithBLOBs save(@PathVariable String panelId, @RequestBody ChartViewWithBLOBs chartViewWithBLOBs) {
return chartViewService.newOne(chartViewWithBLOBs); return chartViewService.newOne(chartViewWithBLOBs);
} }
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE) @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
@ApiOperation("保存编辑的视图信息") @ApiOperation("保存编辑的视图信息")
@PostMapping("/viewEditSave/{panelId}") @PostMapping("/viewEditSave/{panelId}")
public void viewEditSave(@PathVariable String panelId, @RequestBody ChartViewWithBLOBs chartViewWithBLOBs) { public void viewEditSave(@PathVariable String panelId, @RequestBody ChartViewWithBLOBs chartViewWithBLOBs) {
@ -71,7 +71,7 @@ public class ChartViewController {
return chartViewService.listAndGroup(chartViewRequest); return chartViewService.listAndGroup(chartViewRequest);
} }
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW, paramIndex = 1) @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_VIEW, paramIndex = 1)
@ApiOperation("详细信息") @ApiOperation("详细信息")
@PostMapping("/get/{id}/{panelId}") @PostMapping("/get/{id}/{panelId}")
public ChartViewDTO get(@PathVariable String id, @PathVariable String panelId, @RequestBody ChartViewRequest viewRequest) { public ChartViewDTO get(@PathVariable String id, @PathVariable String panelId, @RequestBody ChartViewRequest viewRequest) {
@ -87,7 +87,7 @@ public class ChartViewController {
} }
@DePermissionProxy(value = "proxy", paramIndex = 2) @DePermissionProxy(value = "proxy", paramIndex = 2)
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW, paramIndex = 1) @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_VIEW, paramIndex = 1)
@ApiOperation("数据") @ApiOperation("数据")
@PostMapping("/getData/{id}/{panelId}") @PostMapping("/getData/{id}/{panelId}")
public ChartViewDTO getData(@PathVariable String id, @PathVariable String panelId, public ChartViewDTO getData(@PathVariable String id, @PathVariable String panelId,
@ -95,21 +95,21 @@ public class ChartViewController {
return chartViewService.getData(id, requestList); return chartViewService.getData(id, requestList);
} }
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW, paramIndex = 1) @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_VIEW, paramIndex = 1)
@ApiOperation("视图详情") @ApiOperation("视图详情")
@PostMapping("chartDetail/{id}/{panelId}") @PostMapping("chartDetail/{id}/{panelId}")
public ChartDetail chartDetail(@PathVariable String id, @PathVariable String panelId) { public ChartDetail chartDetail(@PathVariable String id, @PathVariable String panelId) {
return chartViewService.getChartDetail(id); return chartViewService.getChartDetail(id);
} }
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE, paramIndex = 1) @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE, paramIndex = 1)
@ApiOperation("复制") @ApiOperation("复制")
@PostMapping("chartCopy/{id}/{panelId}") @PostMapping("chartCopy/{id}/{panelId}")
public String chartCopy(@PathVariable String id, @PathVariable String panelId) { public String chartCopy(@PathVariable String id, @PathVariable String panelId) {
return chartViewService.chartCopy(id, panelId); return chartViewService.chartCopy(id, panelId);
} }
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE, paramIndex = 1) @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE, paramIndex = 1)
@ApiOperation("批量复制") @ApiOperation("批量复制")
@PostMapping("chartBatchCopy/{panelId}") @PostMapping("chartBatchCopy/{panelId}")
public Map<String, String> chartBatchCopy(@RequestBody ChartCopyBatchRequest request, @PathVariable String panelId) { public Map<String, String> chartBatchCopy(@RequestBody ChartCopyBatchRequest request, @PathVariable String panelId) {
@ -129,7 +129,7 @@ public class ChartViewController {
return chartViewService.search(chartViewRequest); return chartViewService.search(chartViewRequest);
} }
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW) @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_VIEW)
@ApiOperation("计算结果") @ApiOperation("计算结果")
@PostMapping("/calcData/{panelId}") @PostMapping("/calcData/{panelId}")
public ChartViewDTO calcData(@PathVariable String panelId, @RequestBody ChartCalRequest request) throws Exception { public ChartViewDTO calcData(@PathVariable String panelId, @RequestBody ChartCalRequest request) throws Exception {
@ -144,14 +144,14 @@ public class ChartViewController {
return chartViewService.checkSameDataSet(viewIdSource, viewIdTarget); return chartViewService.checkSameDataSet(viewIdSource, viewIdTarget);
} }
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW) @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_VIEW)
@ApiOperation("初始化仪表板视图缓存") @ApiOperation("初始化仪表板视图缓存")
@PostMapping("/initViewCache/{panelId}") @PostMapping("/initViewCache/{panelId}")
public void initViewCache(@PathVariable String panelId) { public void initViewCache(@PathVariable String panelId) {
chartViewService.initViewCache(panelId); chartViewService.initViewCache(panelId);
} }
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW, paramIndex = 1) @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_VIEW, paramIndex = 1)
@ApiOperation("重置视图") @ApiOperation("重置视图")
@PostMapping("/resetViewCache/{id}/{panelId}") @PostMapping("/resetViewCache/{id}/{panelId}")
public void resetViewCache(@PathVariable String id, @PathVariable String panelId) { public void resetViewCache(@PathVariable String id, @PathVariable String panelId) {

View File

@ -35,7 +35,7 @@ public class ChartViewFieldController {
@Resource @Resource
private DataSetTableService dataSetTableService; private DataSetTableService dataSetTableService;
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE) @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
@ApiOperation("保存") @ApiOperation("保存")
@PostMapping("/save/{panelId}") @PostMapping("/save/{panelId}")
public ChartViewField save(@PathVariable String panelId, @RequestBody ChartViewField chartViewField) { public ChartViewField save(@PathVariable String panelId, @RequestBody ChartViewField chartViewField) {
@ -53,21 +53,21 @@ public class ChartViewFieldController {
return chartViewFieldService.save(chartViewField); return chartViewFieldService.save(chartViewField);
} }
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE, paramIndex = 1) @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE, paramIndex = 1)
@ApiOperation("删除") @ApiOperation("删除")
@PostMapping("/delete/{id}/{panelId}") @PostMapping("/delete/{id}/{panelId}")
public void delete(@PathVariable String id, @PathVariable String panelId) { public void delete(@PathVariable String id, @PathVariable String panelId) {
chartViewFieldService.delete(id); chartViewFieldService.delete(id);
} }
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE, paramIndex = 1) @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE, paramIndex = 1)
@ApiOperation("删除视图的字段") @ApiOperation("删除视图的字段")
@PostMapping("/deleteByChartId/{chartId}/{panelId}") @PostMapping("/deleteByChartId/{chartId}/{panelId}")
public void deleteByChartId(@PathVariable String chartId, @PathVariable String panelId) { public void deleteByChartId(@PathVariable String chartId, @PathVariable String panelId) {
chartViewFieldService.deleteByChartId(chartId); chartViewFieldService.deleteByChartId(chartId);
} }
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW, paramIndex = 1) @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_VIEW, paramIndex = 1)
@ApiOperation("分组查询表下属字段") @ApiOperation("分组查询表下属字段")
@PostMapping("listByDQ/{chartId}/{panelId}") @PostMapping("listByDQ/{chartId}/{panelId}")
public ChartViewField4Type listByDQ(@PathVariable String chartId, @PathVariable String panelId) { public ChartViewField4Type listByDQ(@PathVariable String chartId, @PathVariable String panelId) {

View File

@ -62,7 +62,7 @@ public class DataSetTableFieldController {
DatasetTableField datasetTableField = DatasetTableField.builder().build(); DatasetTableField datasetTableField = DatasetTableField.builder().build();
datasetTableField.setTableId(tableId); datasetTableField.setTableId(tableId);
List<DatasetTableField> fields = dataSetTableFieldsService.list(datasetTableField); List<DatasetTableField> fields = dataSetTableFieldsService.list(datasetTableField);
fields = permissionService.filterColumnPermissons(fields, new ArrayList<>(), tableId, null); fields = permissionService.filterColumnPermissions(fields, new ArrayList<>(), tableId, null);
return fields; return fields;
} }
@ -74,7 +74,7 @@ public class DataSetTableFieldController {
datasetTableField.setTableId(tableId); datasetTableField.setTableId(tableId);
List<DatasetTableField> fields = dataSetTableFieldsService.list(datasetTableField); List<DatasetTableField> fields = dataSetTableFieldsService.list(datasetTableField);
List<String> desensitizationList = new ArrayList<>(); List<String> desensitizationList = new ArrayList<>();
fields = permissionService.filterColumnPermissons(fields, desensitizationList, tableId, null); fields = permissionService.filterColumnPermissions(fields, desensitizationList, tableId, null);
fields = fields.stream().filter(item -> !desensitizationList.contains(item.getDataeaseName())).collect(Collectors.toList()); fields = fields.stream().filter(item -> !desensitizationList.contains(item.getDataeaseName())).collect(Collectors.toList());
return fields; return fields;
} }

View File

@ -59,7 +59,7 @@ public class PanelGroupController {
@PostMapping("/save") @PostMapping("/save")
@DePermissions(value = { @DePermissions(value = {
@DePermission(type = DePermissionType.PANEL, value = "id"), @DePermission(type = DePermissionType.PANEL, value = "id"),
@DePermission(type = DePermissionType.PANEL, value = "pid", level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE) @DePermission(type = DePermissionType.PANEL, value = "pid", level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
}, logical = Logical.AND) }, logical = Logical.AND)
@I18n @I18n
public PanelGroupDTO save(@RequestBody PanelGroupRequest request) throws Exception{ public PanelGroupDTO save(@RequestBody PanelGroupRequest request) throws Exception{
@ -77,7 +77,7 @@ public class PanelGroupController {
@PostMapping("/update") @PostMapping("/update")
@DePermissions(value = { @DePermissions(value = {
@DePermission(type = DePermissionType.PANEL, value = "id"), @DePermission(type = DePermissionType.PANEL, value = "id"),
@DePermission(type = DePermissionType.PANEL, value = "pid", level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE) @DePermission(type = DePermissionType.PANEL, value = "pid", level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
}, logical = Logical.AND) }, logical = Logical.AND)
@I18n @I18n
public String update(@RequestBody PanelGroupRequest request) { public String update(@RequestBody PanelGroupRequest request) {
@ -85,14 +85,14 @@ public class PanelGroupController {
} }
@ApiOperation("删除") @ApiOperation("删除")
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE) @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
@PostMapping("/deleteCircle/{id}") @PostMapping("/deleteCircle/{id}")
public void deleteCircle(@PathVariable String id) { public void deleteCircle(@PathVariable String id) {
panelGroupService.deleteCircle(id); panelGroupService.deleteCircle(id);
} }
@ApiOperation("详细信息") @ApiOperation("详细信息")
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW) @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_VIEW)
@GetMapping("/findOne/{id}") @GetMapping("/findOne/{id}")
public PanelGroupDTO findOne(@PathVariable String id) throws Exception { public PanelGroupDTO findOne(@PathVariable String id) throws Exception {
return panelGroupService.findOne(id); return panelGroupService.findOne(id);
@ -101,7 +101,7 @@ public class PanelGroupController {
@ApiIgnore @ApiIgnore
@ApiOperation("详细信息(分享人代理)") @ApiOperation("详细信息(分享人代理)")
@DePermissionProxy(paramIndex = 1) @DePermissionProxy(paramIndex = 1)
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW) @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_VIEW)
@PostMapping("/proxy/findOne/{id}") @PostMapping("/proxy/findOne/{id}")
public PanelGroupDTO proxyFindOne(@PathVariable String id, @RequestBody PermissionProxy proxy) public PanelGroupDTO proxyFindOne(@PathVariable String id, @RequestBody PermissionProxy proxy)
throws Exception { throws Exception {
@ -146,7 +146,7 @@ public class PanelGroupController {
@ApiOperation("更新仪表板状态") @ApiOperation("更新仪表板状态")
@PostMapping("/updatePanelStatus/{panelId}") @PostMapping("/updatePanelStatus/{panelId}")
@I18n @I18n
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE) @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
public void updatePanelStatus(@PathVariable String panelId, @RequestBody PanelGroupBaseInfoRequest request) { public void updatePanelStatus(@PathVariable String panelId, @RequestBody PanelGroupBaseInfoRequest request) {
panelGroupService.updatePanelStatus(panelId, request); panelGroupService.updatePanelStatus(panelId, request);
} }
@ -154,7 +154,7 @@ public class PanelGroupController {
@PostMapping("/autoCache") @PostMapping("/autoCache")
@DePermissions(value = { @DePermissions(value = {
@DePermission(type = DePermissionType.PANEL, value = "id"), @DePermission(type = DePermissionType.PANEL, value = "id"),
@DePermission(type = DePermissionType.PANEL, value = "pid", level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE) @DePermission(type = DePermissionType.PANEL, value = "pid", level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
}, logical = Logical.AND) }, logical = Logical.AND)
public void autoCache(@RequestBody PanelGroupRequest request){ public void autoCache(@RequestBody PanelGroupRequest request){
panelGroupService.autoCache(request); panelGroupService.autoCache(request);

View File

@ -18,7 +18,7 @@ public class ApiDefinition {
private ApiDefinitionRequest request; private ApiDefinitionRequest request;
private String dataPath; private String dataPath;
private String status; private String status;
private List<Map<String,String>> datas = new ArrayList<>(); private List<Map<String,String>> data = new ArrayList<>();
private List<JSONObject> jsonFields = new ArrayList<>(); private List<JSONObject> jsonFields = new ArrayList<>();
private int previewNum = 10; private int previewNum = 10;
private int maxPreviewNum = 10; private int maxPreviewNum = 10;

View File

@ -6,7 +6,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
@Data @Data
public class EsReponse { public class EsResponse {
private List<Column> columns = new ArrayList<>(); private List<Column> columns = new ArrayList<>();
private List<String[]> rows = new ArrayList<>(); private List<String[]> rows = new ArrayList<>();
private String cursor; private String cursor;

View File

@ -75,7 +75,7 @@ public class MsgController {
@PostMapping("/setReaded/{msgId}") @PostMapping("/setReaded/{msgId}")
@ApiImplicitParam(paramType = "path", name = "msgId", value = "消息ID", required = true, dataType = "Long") @ApiImplicitParam(paramType = "path", name = "msgId", value = "消息ID", required = true, dataType = "Long")
public void setReaded(@PathVariable Long msgId) { public void setReaded(@PathVariable Long msgId) {
sysMsgService.setReaded(msgId); sysMsgService.setRead(msgId);
} }
@ -83,7 +83,7 @@ public class MsgController {
@PostMapping("/batchRead") @PostMapping("/batchRead")
@ApiImplicitParam(name = "msgIds", value = "消息ID集合", required = true, dataType = "List") @ApiImplicitParam(name = "msgIds", value = "消息ID集合", required = true, dataType = "List")
public void batchRead(@RequestBody List<Long> msgIds) { public void batchRead(@RequestBody List<Long> msgIds) {
sysMsgService.setBatchReaded(msgIds); sysMsgService.setBatchRead(msgIds);
} }
@ApiOperation("全部设置已读") @ApiOperation("全部设置已读")

View File

@ -78,8 +78,8 @@ public class SysMenuController {
@PostMapping("/childMenus/{pid}") @PostMapping("/childMenus/{pid}")
public Set<Long> childMenus(@PathVariable Long pid){ public Set<Long> childMenus(@PathVariable Long pid){
List<MenuNodeResponse> childs = menuService.childs(pid); List<MenuNodeResponse> children = menuService.children(pid);
Set<Long> sets = childs.stream().map(MenuNodeResponse::getMenuId).collect(Collectors.toSet()); Set<Long> sets = children.stream().map(MenuNodeResponse::getMenuId).collect(Collectors.toSet());
sets.add(pid); sets.add(pid);
return sets; return sets;
} }

View File

@ -39,7 +39,7 @@ public class BaseGridRequest implements Serializable {
GridExample gridExample = new GridExample(); GridExample gridExample = new GridExample();
if (CollectionUtils.isNotEmpty(conditions)) { if (CollectionUtils.isNotEmpty(conditions)) {
GridExample.Criteria criteria = gridExample.createCriteria(); GridExample.Criteria criteria = gridExample.createCriteria();
conditions.forEach(criteria::addCondtion); conditions.forEach(criteria::addCondition);
} }
if (CollectionUtils.isNotEmpty(orders)){ if (CollectionUtils.isNotEmpty(orders)){

View File

@ -10,7 +10,7 @@ public class ExcelFileData {
@ApiModelProperty("excelID") @ApiModelProperty("excelID")
private String id; private String id;
@ApiModelProperty("excel标签") @ApiModelProperty("excel标签")
private String excelLable; private String excelLabel;
@ApiModelProperty("sheets") @ApiModelProperty("sheets")
private List<ExcelSheetData> sheets; private List<ExcelSheetData> sheets;
@ApiModelProperty("路径") @ApiModelProperty("路径")

View File

@ -9,7 +9,7 @@ import java.util.Map;
@Data @Data
public class ExcelSheetData { public class ExcelSheetData {
@ApiModelProperty("标签") @ApiModelProperty("标签")
private String excelLable; private String excelLabel;
@ApiModelProperty("数据集合") @ApiModelProperty("数据集合")
private List<List<String>> data; private List<List<String>> data;
@ApiModelProperty("字段集合") @ApiModelProperty("字段集合")

View File

@ -6,7 +6,7 @@ import lombok.Setter;
@Getter @Getter
@Setter @Setter
public class RedshiftConfigration extends JdbcConfiguration { public class RedshiftConfiguration extends JdbcConfiguration {
private String driver = "com.amazon.redshift.jdbc42.Driver"; private String driver = "com.amazon.redshift.jdbc42.Driver";

View File

@ -132,7 +132,7 @@ public class GridExample {
public Criteria addCondtion(ConditionEntity conditionEntity){ public Criteria addCondition(ConditionEntity conditionEntity){
String field = conditionEntity.getField(); String field = conditionEntity.getField();
Object value = conditionEntity.getValue(); Object value = conditionEntity.getValue();
String operator = conditionEntity.getOperator(); String operator = conditionEntity.getOperator();

View File

@ -48,7 +48,7 @@ import java.util.stream.Collectors;
@Service("emailTaskHandler") @Service("emailTaskHandler")
public class EmailTaskHandler extends TaskHandler implements Job { public class EmailTaskHandler extends TaskHandler implements Job {
private static final Integer RUNING = 0; private static final Integer RUNNING = 0;
private static final Integer SUCCESS = 1; private static final Integer SUCCESS = 1;
private static final Integer ERROR = -1; private static final Integer ERROR = -1;
@ -124,7 +124,7 @@ public class EmailTaskHandler extends TaskHandler implements Job {
private GlobalTaskInstance buildInstance(GlobalTaskEntity taskEntity) { private GlobalTaskInstance buildInstance(GlobalTaskEntity taskEntity) {
GlobalTaskInstance taskInstance = new GlobalTaskInstance(); GlobalTaskInstance taskInstance = new GlobalTaskInstance();
taskInstance.setTaskId(taskEntity.getTaskId()); taskInstance.setTaskId(taskEntity.getTaskId());
taskInstance.setStatus(RUNING); taskInstance.setStatus(RUNNING);
taskInstance.setExecuteTime(System.currentTimeMillis()); taskInstance.setExecuteTime(System.currentTimeMillis());
return taskInstance; return taskInstance;
} }

View File

@ -17,7 +17,7 @@ public interface MapApi {
@GetMapping("/globalEntitys/{pcode}") @GetMapping("/globalEntitys/{pcode}")
List<AreaEntity> globalEntitys(@PathVariable String pcode); List<AreaEntity> globalEntities(@PathVariable String pcode);
@PostMapping(value = "/saveMapNode", consumes = {"multipart/form-data"}) @PostMapping(value = "/saveMapNode", consumes = {"multipart/form-data"})
void saveMapNode(MapNodeRequest request, MultipartFile file) throws Exception; void saveMapNode(MapNodeRequest request, MultipartFile file) throws Exception;

View File

@ -6,7 +6,7 @@ import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
@Data @Data
public class MapNodeReadReponse implements Serializable { public class MapNodeReadResponse implements Serializable {
@ApiModelProperty("区域代码") @ApiModelProperty("区域代码")
private String code; private String code;
@ -15,7 +15,7 @@ public class MapNodeReadReponse implements Serializable {
@ApiModelProperty("区域级别") @ApiModelProperty("区域级别")
private Integer level; private Integer level;
@ApiModelProperty("上级区域") @ApiModelProperty("上级区域")
private MapNodeReadReponse parent; private MapNodeReadResponse parent;
@ApiModelProperty("geoGson") @ApiModelProperty("geoGson")
private String json; private String json;
} }

View File

@ -26,16 +26,16 @@ public class MapServer implements MapApi {
if (StringUtils.equals(pcode, "0")) { if (StringUtils.equals(pcode, "0")) {
return areaEntities; return areaEntities;
} }
return mapService.entitysByPid(areaEntities, pcode); return mapService.entitiesByPid(areaEntities, pcode);
} }
@Override @Override
public List<AreaEntity> globalEntitys(String pcode) { public List<AreaEntity> globalEntities(String pcode) {
List<AreaEntity> areaEntities = mapService.globalEntities(); List<AreaEntity> areaEntities = mapService.globalEntities();
if (StringUtils.equals(pcode, "0")) { if (StringUtils.equals(pcode, "0")) {
return areaEntities; return areaEntities;
} }
return mapService.entitysByPid(areaEntities, pcode); return mapService.entitiesByPid(areaEntities, pcode);
} }

View File

@ -43,7 +43,7 @@ public class MapService {
return areaEntities; return areaEntities;
} }
public List<AreaEntity> entitysByPid(List<AreaEntity> entities, String pid) { public List<AreaEntity> entitiesByPid(List<AreaEntity> entities, String pid) {
for (int i = 0; i < entities.size(); i++) { for (int i = 0; i < entities.size(); i++) {
AreaEntity areaEntity = entities.get(i); AreaEntity areaEntity = entities.get(i);
if (StringUtils.equals(pid, areaEntity.getCode())) { if (StringUtils.equals(pid, areaEntity.getCode())) {
@ -51,7 +51,7 @@ public class MapService {
} }
if (CollectionUtil.isNotEmpty(areaEntity.getChildren())) { if (CollectionUtil.isNotEmpty(areaEntity.getChildren())) {
List<AreaEntity> areaEntities = entitysByPid(areaEntity.getChildren(), pid); List<AreaEntity> areaEntities = entitiesByPid(areaEntity.getChildren(), pid);
if (null != areaEntities) { if (null != areaEntities) {
return areaEntities; return areaEntities;
} }
@ -65,7 +65,7 @@ public class MapService {
Long pValue = Long.parseLong(pCode); Long pValue = Long.parseLong(pCode);
MapService mapService = CommonBeanFactory.getBean(MapService.class); MapService mapService = CommonBeanFactory.getBean(MapService.class);
List<AreaEntity> areaEntities = mapService.globalEntities(); List<AreaEntity> areaEntities = mapService.globalEntities();
List<AreaEntity> brothers = entitysByPid(areaEntities, pCode); List<AreaEntity> brothers = entitiesByPid(areaEntities, pCode);
brothers.sort(Comparator.comparing(item -> Long.parseLong(item.getCode()))); brothers.sort(Comparator.comparing(item -> Long.parseLong(item.getCode())));
AreaEntity lastBrother = brothers.get(brothers.size() - 1); AreaEntity lastBrother = brothers.get(brothers.size() - 1);

View File

@ -57,8 +57,8 @@ public class SSOServer {
DEException.throwException("缺少oidc插件"); DEException.throwException("缺少oidc插件");
} }
oidcXpackService = SpringContextUtil.getBean(OidcXpackService.class); oidcXpackService = SpringContextUtil.getBean(OidcXpackService.class);
Boolean suuportOIDC = oidcXpackService.isSuuportOIDC(); Boolean supportOIDC = oidcXpackService.isSupportOIDC();
if (!suuportOIDC) { if (!supportOIDC) {
DEException.throwException("未开启oidc"); DEException.throwException("未开启oidc");
} }
Map<String, String> config = config(oidcXpackService); Map<String, String> config = config(oidcXpackService);

View File

@ -270,8 +270,8 @@ public class XEmailTaskServer {
String[] headArr = new String[] {Translator.get("I18N_XPACKTASK_NAME"), Translator.get("I18N_XPACKTASK_EXEC_TIME"), Translator.get("I18N_XPACKTASK_STATUS")}; String[] headArr = new String[] {Translator.get("I18N_XPACKTASK_NAME"), Translator.get("I18N_XPACKTASK_EXEC_TIME"), Translator.get("I18N_XPACKTASK_STATUS")};
List<String> head = Arrays.asList(headArr); List<String> head = Arrays.asList(headArr);
excelSheetModel.setHeads(head); excelSheetModel.setHeads(head);
List<List<String>> datas = instanceDTOS.stream().map(this::formatExcelData).collect(Collectors.toList()); List<List<String>> data = instanceDTOS.stream().map(this::formatExcelData).collect(Collectors.toList());
excelSheetModel.setDatas(datas); excelSheetModel.setData(data);
return excelSheetModel; return excelSheetModel;
} }

View File

@ -72,7 +72,7 @@ public class ApiProvider extends Provider {
ApiDefinition apiDefinition = checkApiDefinition(datasourceRequest); ApiDefinition apiDefinition = checkApiDefinition(datasourceRequest);
String response = execHttpRequest(apiDefinition, StringUtils.isNotBlank(basicInfo.getFrontTimeOut()) ? Integer.parseInt(basicInfo.getFrontTimeOut()) : 10); String response = execHttpRequest(apiDefinition, StringUtils.isNotBlank(basicInfo.getFrontTimeOut()) ? Integer.parseInt(basicInfo.getFrontTimeOut()) : 10);
fieldList = getTableFileds(apiDefinition); fieldList = getTableFields(apiDefinition);
result.put("fieldList", fieldList); result.put("fieldList", fieldList);
dataList = fetchResult(response, apiDefinition); dataList = fetchResult(response, apiDefinition);
result.put("dataList", dataList); result.put("dataList", dataList);
@ -80,7 +80,7 @@ public class ApiProvider extends Provider {
} }
private List<TableField> getTableFileds(ApiDefinition apiDefinition) throws Exception { private List<TableField> getTableFields(ApiDefinition apiDefinition) throws Exception {
List<TableField> tableFields = new ArrayList<>(); List<TableField> tableFields = new ArrayList<>();
for (DatasetTableFieldDTO field : apiDefinition.getFields()) { for (DatasetTableFieldDTO field : apiDefinition.getFields()) {
TableField tableField = new TableField(); TableField tableField = new TableField();
@ -93,13 +93,13 @@ public class ApiProvider extends Provider {
return tableFields; return tableFields;
} }
public List<TableField> getTableFileds(DatasourceRequest datasourceRequest) throws Exception { public List<TableField> getTableFields(DatasourceRequest datasourceRequest) throws Exception {
List<ApiDefinition> lists = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), new TypeToken<List<ApiDefinition>>() { List<ApiDefinition> lists = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), new TypeToken<List<ApiDefinition>>() {
}.getType()); }.getType());
List<TableField> tableFields = new ArrayList<>(); List<TableField> tableFields = new ArrayList<>();
for (ApiDefinition apiDefinition : lists) { for (ApiDefinition apiDefinition : lists) {
if (datasourceRequest.getTable().equalsIgnoreCase(apiDefinition.getName())) { if (datasourceRequest.getTable().equalsIgnoreCase(apiDefinition.getName())) {
tableFields = getTableFileds(apiDefinition); tableFields = getTableFields(apiDefinition);
} }
} }
return tableFields; return tableFields;
@ -361,14 +361,14 @@ public class ApiProvider extends Provider {
private List<String[]> fetchResult(String result, ApiDefinition apiDefinition) { private List<String[]> fetchResult(String result, ApiDefinition apiDefinition) {
List<String[]> dataList = new LinkedList<>(); List<String[]> dataList = new LinkedList<>();
if (StringUtils.isNotEmpty(apiDefinition.getDataPath()) && CollectionUtils.isEmpty(apiDefinition.getJsonFields())) { if (StringUtils.isNotEmpty(apiDefinition.getDataPath()) && CollectionUtils.isEmpty(apiDefinition.getJsonFields())) {
List<LinkedHashMap> datas = new ArrayList<>(); List<LinkedHashMap> currentData = new ArrayList<>();
Object object = JsonPath.read(result, apiDefinition.getDataPath()); Object object = JsonPath.read(result, apiDefinition.getDataPath());
if (object instanceof List) { if (object instanceof List) {
datas = (List<LinkedHashMap>) object; currentData = (List<LinkedHashMap>) object;
} else { } else {
datas.add((LinkedHashMap) object); currentData.add((LinkedHashMap) object);
} }
for (LinkedHashMap data : datas) { for (LinkedHashMap data : currentData) {
String[] row = new String[apiDefinition.getFields().size()]; String[] row = new String[apiDefinition.getFields().size()];
int i = 0; int i = 0;
for (DatasetTableFieldDTO field : apiDefinition.getFields()) { for (DatasetTableFieldDTO field : apiDefinition.getFields()) {
@ -379,22 +379,22 @@ public class ApiProvider extends Provider {
} }
} else { } else {
List<String> jsonPaths = apiDefinition.getFields().stream().map(DatasetTableFieldDTO::getJsonPath).collect(Collectors.toList()); List<String> jsonPaths = apiDefinition.getFields().stream().map(DatasetTableFieldDTO::getJsonPath).collect(Collectors.toList());
Long maxLenth = 0l; Long maxLength = 0l;
List<List<String>> columnDataList = new ArrayList<>(); List<List<String>> columnDataList = new ArrayList<>();
for (int i = 0; i < jsonPaths.size(); i++) { for (int i = 0; i < jsonPaths.size(); i++) {
List<String> datas = new ArrayList<>(); List<String> data = new ArrayList<>();
Object object = JsonPath.read(result, jsonPaths.get(i)); Object object = JsonPath.read(result, jsonPaths.get(i));
if (object instanceof List && jsonPaths.get(i).contains("[*]")) { if (object instanceof List && jsonPaths.get(i).contains("[*]")) {
datas = (List<String>) object; data = (List<String>) object;
} else { } else {
if (object != null) { if (object != null) {
datas.add(object.toString()); data.add(object.toString());
} }
} }
maxLenth = maxLenth > datas.size() ? maxLenth : datas.size(); maxLength = maxLength > data.size() ? maxLength : data.size();
columnDataList.add(datas); columnDataList.add(data);
} }
for (int i = 0; i < maxLenth; i++) { for (int i = 0; i < maxLength; i++) {
String[] row = new String[apiDefinition.getFields().size()]; String[] row = new String[apiDefinition.getFields().size()];
dataList.add(row); dataList.add(row);
} }

View File

@ -4,7 +4,7 @@ import com.google.gson.Gson;
import com.google.gson.JsonParser; import com.google.gson.JsonParser;
import io.dataease.commons.utils.HttpClientConfig; import io.dataease.commons.utils.HttpClientConfig;
import io.dataease.commons.utils.HttpClientUtil; import io.dataease.commons.utils.HttpClientUtil;
import io.dataease.controller.request.datasource.es.EsReponse; import io.dataease.controller.request.datasource.es.EsResponse;
import io.dataease.controller.request.datasource.es.Request; import io.dataease.controller.request.datasource.es.Request;
import io.dataease.controller.request.datasource.es.RequestWithCursor; import io.dataease.controller.request.datasource.es.RequestWithCursor;
import io.dataease.dto.datasource.EsConfiguration; import io.dataease.dto.datasource.EsConfiguration;
@ -60,22 +60,22 @@ public class EsProvider extends Provider {
request.setFetch_size(dsr.getFetchSize()); request.setFetch_size(dsr.getFetchSize());
String url = esConfiguration.getUrl().endsWith("/") ? esConfiguration.getUrl() + esConfiguration.getUri() + "?format=json" : esConfiguration.getUrl() + "/" + esConfiguration.getUri() + "?format=json"; String url = esConfiguration.getUrl().endsWith("/") ? esConfiguration.getUrl() + esConfiguration.getUri() + "?format=json" : esConfiguration.getUrl() + "/" + esConfiguration.getUri() + "?format=json";
String response = HttpClientUtil.post(url, new Gson().toJson(request), httpClientConfig); String response = HttpClientUtil.post(url, new Gson().toJson(request), httpClientConfig);
EsReponse esReponse = new Gson().fromJson(response, EsReponse.class); EsResponse esResponse = new Gson().fromJson(response, EsResponse.class);
list.addAll(fetchResult(esReponse)); list.addAll(fetchResult(esResponse));
if (dsr.isPageable()) { if (dsr.isPageable()) {
Integer realSize = dsr.getPage() * dsr.getPageSize() < list.size() ? dsr.getPage() * dsr.getPageSize() : list.size(); Integer realSize = dsr.getPage() * dsr.getPageSize() < list.size() ? dsr.getPage() * dsr.getPageSize() : list.size();
list = list.subList((dsr.getPage() - 1) * dsr.getPageSize(), realSize); list = list.subList((dsr.getPage() - 1) * dsr.getPageSize(), realSize);
} }
if (!dsr.isPreviewData()) { if (!dsr.isPreviewData()) {
while (StringUtils.isNotEmpty(esReponse.getCursor())) { while (StringUtils.isNotEmpty(esResponse.getCursor())) {
RequestWithCursor requstWithCursor = new RequestWithCursor(); RequestWithCursor requestWithCursor = new RequestWithCursor();
requstWithCursor.setQuery(dsr.getQuery()); requestWithCursor.setQuery(dsr.getQuery());
requstWithCursor.setFetch_size(dsr.getFetchSize()); requestWithCursor.setFetch_size(dsr.getFetchSize());
requstWithCursor.setCursor(esReponse.getCursor()); requestWithCursor.setCursor(esResponse.getCursor());
response = HttpClientUtil.post(url, new Gson().toJson(requstWithCursor), httpClientConfig); response = HttpClientUtil.post(url, new Gson().toJson(requestWithCursor), httpClientConfig);
esReponse = new Gson().fromJson(response, EsReponse.class); esResponse = new Gson().fromJson(response, EsResponse.class);
list.addAll(fetchResult(esReponse)); list.addAll(fetchResult(esResponse));
} }
} }
} catch (Exception e) { } catch (Exception e) {
@ -98,7 +98,7 @@ public class EsProvider extends Provider {
} }
@Override @Override
public List<TableField> getTableFileds(DatasourceRequest datasourceRequest) throws Exception { public List<TableField> getTableFields(DatasourceRequest datasourceRequest) throws Exception {
datasourceRequest.setQuery("desc " + String.format(EsSqlLConstants.KEYWORD_TABLE, datasourceRequest.getTable())); datasourceRequest.setQuery("desc " + String.format(EsSqlLConstants.KEYWORD_TABLE, datasourceRequest.getTable()));
List<TableField> tableFields = new ArrayList<>(); List<TableField> tableFields = new ArrayList<>();
try { try {
@ -112,16 +112,16 @@ public class EsProvider extends Provider {
private List<String[]> fetchResult(String response) throws Exception { private List<String[]> fetchResult(String response) throws Exception {
EsReponse esReponse = new Gson().fromJson(response, EsReponse.class); EsResponse esResponse = new Gson().fromJson(response, EsResponse.class);
return fetchResult(esReponse); return fetchResult(esResponse);
} }
private List<String[]> fetchResult(EsReponse esReponse) throws Exception { private List<String[]> fetchResult(EsResponse esResponse) throws Exception {
List<String[]> list = new LinkedList<>(); List<String[]> list = new LinkedList<>();
if (esReponse.getError() != null) { if (esResponse.getError() != null) {
throw new Exception(esReponse.getError().getReason()); throw new Exception(esResponse.getError().getReason());
} }
list.addAll(esReponse.getRows()); list.addAll(esResponse.getRows());
return list; return list;
} }
@ -139,12 +139,12 @@ public class EsProvider extends Provider {
private List<TableField> fetchResultField(String response) throws Exception { private List<TableField> fetchResultField(String response) throws Exception {
List<TableField> fieldList = new ArrayList<>(); List<TableField> fieldList = new ArrayList<>();
EsReponse esReponse = new Gson().fromJson(response, EsReponse.class); EsResponse esResponse = new Gson().fromJson(response, EsResponse.class);
if (esReponse.getError() != null) { if (esResponse.getError() != null) {
throw new Exception(esReponse.getError().getReason()); throw new Exception(esResponse.getError().getReason());
} }
for (String[] row : esReponse.getRows()) { for (String[] row : esResponse.getRows()) {
TableField field = new TableField(); TableField field = new TableField();
field.setFieldName(row[0]); field.setFieldName(row[0]);
field.setRemarks(row[0]); field.setRemarks(row[0]);
@ -157,12 +157,12 @@ public class EsProvider extends Provider {
private List<TableField> fetchResultField4Sql(String response) throws Exception { private List<TableField> fetchResultField4Sql(String response) throws Exception {
List<TableField> fieldList = new ArrayList<>(); List<TableField> fieldList = new ArrayList<>();
EsReponse esReponse = new Gson().fromJson(response, EsReponse.class); EsResponse esResponse = new Gson().fromJson(response, EsResponse.class);
if (esReponse.getError() != null) { if (esResponse.getError() != null) {
throw new Exception(esReponse.getError().getReason()); throw new Exception(esResponse.getError().getReason());
} }
for (EsReponse.Column column : esReponse.getColumns()) { for (EsResponse.Column column : esResponse.getColumns()) {
TableField field = new TableField(); TableField field = new TableField();
field.setFieldName(column.getName()); field.setFieldName(column.getName());
field.setRemarks(column.getName()); field.setRemarks(column.getName());
@ -175,12 +175,12 @@ public class EsProvider extends Provider {
private List<TableField> fetchResultField4Table(String response) throws Exception { private List<TableField> fetchResultField4Table(String response) throws Exception {
List<TableField> fieldList = new ArrayList<>(); List<TableField> fieldList = new ArrayList<>();
EsReponse esReponse = new Gson().fromJson(response, EsReponse.class); EsResponse esResponse = new Gson().fromJson(response, EsResponse.class);
if (esReponse.getError() != null) { if (esResponse.getError() != null) {
throw new Exception(esReponse.getError().getReason()); throw new Exception(esResponse.getError().getReason());
} }
for (String[] row : esReponse.getRows()) { for (String[] row : esResponse.getRows()) {
if(!row[1].equalsIgnoreCase("STRUCT")){ if(!row[1].equalsIgnoreCase("STRUCT")){
TableField field = new TableField(); TableField field = new TableField();
field.setFieldName(row[0]); field.setFieldName(row[0]);
@ -221,12 +221,12 @@ public class EsProvider extends Provider {
private List<TableDesc> fetchTables(String response) throws Exception { private List<TableDesc> fetchTables(String response) throws Exception {
List<TableDesc> tables = new ArrayList<>(); List<TableDesc> tables = new ArrayList<>();
EsReponse esReponse = new Gson().fromJson(response, EsReponse.class); EsResponse esResponse = new Gson().fromJson(response, EsResponse.class);
if (esReponse.getError() != null) { if (esResponse.getError() != null) {
throw new Exception(esReponse.getError().getReason()); throw new Exception(esResponse.getError().getReason());
} }
for (String[] row : esReponse.getRows()) { for (String[] row : esResponse.getRows()) {
if (row.length == 3 && row[1].contains("TABLE") && row[2].equalsIgnoreCase("INDEX")) { if (row.length == 3 && row[1].contains("TABLE") && row[2].equalsIgnoreCase("INDEX")) {
TableDesc tableDesc = new TableDesc(); TableDesc tableDesc = new TableDesc();
tableDesc.setName(row[0]); tableDesc.setName(row[0]);

View File

@ -73,7 +73,7 @@ public class JdbcProvider extends DefaultJdbcProvider {
@Override @Override
public List<TableField> getTableFileds(DatasourceRequest datasourceRequest) throws Exception { public List<TableField> getTableFields(DatasourceRequest datasourceRequest) throws Exception {
if (datasourceRequest.getDatasource().getType().equalsIgnoreCase("mongo")) { if (datasourceRequest.getDatasource().getType().equalsIgnoreCase("mongo")) {
datasourceRequest.setQuery("select * from " + datasourceRequest.getTable()); datasourceRequest.setQuery("select * from " + datasourceRequest.getTable());
return fetchResultField(datasourceRequest); return fetchResultField(datasourceRequest);
@ -263,8 +263,8 @@ public class JdbcProvider extends DefaultJdbcProvider {
while (rs.next()) { while (rs.next()) {
String[] row = new String[columnCount]; String[] row = new String[columnCount];
for (int j = 0; j < columnCount; j++) { for (int j = 0; j < columnCount; j++) {
int columType = metaData.getColumnType(j + 1); int columnType = metaData.getColumnType(j + 1);
switch (columType) { switch (columnType) {
case Types.DATE: case Types.DATE:
if (rs.getDate(j + 1) != null) { if (rs.getDate(j + 1) != null) {
row[j] = rs.getDate(j + 1).toString(); row[j] = rs.getDate(j + 1).toString();
@ -278,8 +278,8 @@ public class JdbcProvider extends DefaultJdbcProvider {
row[j] = rs.getBlob(j + 1) == null ? "" : rs.getBlob(j + 1).toString(); row[j] = rs.getBlob(j + 1) == null ? "" : rs.getBlob(j + 1).toString();
} else { } else {
if (charset != null && StringUtils.isNotEmpty(rs.getString(j + 1))) { if (charset != null && StringUtils.isNotEmpty(rs.getString(j + 1))) {
String orginStr = new String(rs.getString(j + 1).getBytes(charset), targetCharset); String originStr = new String(rs.getString(j + 1).getBytes(charset), targetCharset);
row[j] = new String(orginStr.getBytes("UTF-8"), "UTF-8"); row[j] = new String(originStr.getBytes("UTF-8"), "UTF-8");
} else { } else {
row[j] = rs.getString(j + 1); row[j] = rs.getString(j + 1);
} }
@ -426,12 +426,12 @@ public class JdbcProvider extends DefaultJdbcProvider {
jdbcurl = mongodbConfiguration.getJdbc(datasourceRequest.getDatasource().getId()); jdbcurl = mongodbConfiguration.getJdbc(datasourceRequest.getDatasource().getId());
break; break;
case redshift: case redshift:
RedshiftConfigration redshiftConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfigration.class); RedshiftConfiguration redshiftConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfiguration.class);
username = redshiftConfigration.getUsername(); username = redshiftConfiguration.getUsername();
password = redshiftConfigration.getPassword(); password = redshiftConfiguration.getPassword();
defaultDriver = redshiftConfigration.getDriver(); defaultDriver = redshiftConfiguration.getDriver();
customDriver = redshiftConfigration.getCustomDriver(); customDriver = redshiftConfiguration.getCustomDriver();
jdbcurl = redshiftConfigration.getJdbc(); jdbcurl = redshiftConfiguration.getJdbc();
break; break;
case hive: case hive:
HiveConfiguration hiveConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), HiveConfiguration.class); HiveConfiguration hiveConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), HiveConfiguration.class);
@ -570,11 +570,11 @@ public class JdbcProvider extends DefaultJdbcProvider {
jdbcConfiguration = mongodbConfiguration; jdbcConfiguration = mongodbConfiguration;
break; break;
case redshift: case redshift:
RedshiftConfigration redshiftConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfigration.class); RedshiftConfiguration redshiftConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfiguration.class);
dataSource.setPassword(redshiftConfigration.getPassword()); dataSource.setPassword(redshiftConfiguration.getPassword());
dataSource.setDriverClassName(redshiftConfigration.getDriver()); dataSource.setDriverClassName(redshiftConfiguration.getDriver());
dataSource.setUrl(redshiftConfigration.getJdbc()); dataSource.setUrl(redshiftConfiguration.getJdbc());
jdbcConfiguration = redshiftConfigration; jdbcConfiguration = redshiftConfiguration;
break; break;
case hive: case hive:
HiveConfiguration hiveConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), HiveConfiguration.class); HiveConfiguration hiveConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), HiveConfiguration.class);
@ -655,11 +655,11 @@ public class JdbcProvider extends DefaultJdbcProvider {
CHConfiguration chConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), CHConfiguration.class); CHConfiguration chConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), CHConfiguration.class);
return "SELECT name FROM system.tables where database='DATABASE';".replace("DATABASE", chConfiguration.getDataBase()); return "SELECT name FROM system.tables where database='DATABASE';".replace("DATABASE", chConfiguration.getDataBase());
case redshift: case redshift:
RedshiftConfigration redshiftConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfigration.class); RedshiftConfiguration redshiftConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfiguration.class);
if (StringUtils.isEmpty(redshiftConfigration.getSchema())) { if (StringUtils.isEmpty(redshiftConfiguration.getSchema())) {
throw new Exception(Translator.get("i18n_schema_is_empty")); throw new Exception(Translator.get("i18n_schema_is_empty"));
} }
return "SELECT tablename FROM pg_tables WHERE schemaname='SCHEMA' ;".replace("SCHEMA", redshiftConfigration.getSchema()); return "SELECT tablename FROM pg_tables WHERE schemaname='SCHEMA' ;".replace("SCHEMA", redshiftConfiguration.getSchema());
case db2: case db2:
Db2Configuration db2Configuration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), Db2Configuration.class); Db2Configuration db2Configuration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), Db2Configuration.class);
if (StringUtils.isEmpty(db2Configuration.getSchema())) { if (StringUtils.isEmpty(db2Configuration.getSchema())) {
@ -705,11 +705,11 @@ public class JdbcProvider extends DefaultJdbcProvider {
} }
return "SELECT viewname FROM pg_views WHERE schemaname='SCHEMA' ;".replace("SCHEMA", pgConfiguration.getSchema()); return "SELECT viewname FROM pg_views WHERE schemaname='SCHEMA' ;".replace("SCHEMA", pgConfiguration.getSchema());
case redshift: case redshift:
RedshiftConfigration redshiftConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfigration.class); RedshiftConfiguration redshiftConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfiguration.class);
if (StringUtils.isEmpty(redshiftConfigration.getSchema())) { if (StringUtils.isEmpty(redshiftConfiguration.getSchema())) {
throw new Exception(Translator.get("i18n_schema_is_empty")); throw new Exception(Translator.get("i18n_schema_is_empty"));
} }
return "SELECT viewname FROM pg_views WHERE schemaname='SCHEMA' ;".replace("SCHEMA", redshiftConfigration.getSchema()); return "SELECT viewname FROM pg_views WHERE schemaname='SCHEMA' ;".replace("SCHEMA", redshiftConfiguration.getSchema());
case db2: case db2:
Db2Configuration db2Configuration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), Db2Configuration.class); Db2Configuration db2Configuration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), Db2Configuration.class);

View File

@ -10,4 +10,5 @@ public class ChartConstants {
public static final String YEAR_YOY = "year_yoy"; public static final String YEAR_YOY = "year_yoy";
public static final String DAY_MOM = "day_mom"; public static final String DAY_MOM = "day_mom";
public static final String MONTH_YOY = "month_yoy"; public static final String MONTH_YOY = "month_yoy";
public static final String[] M_Y = {YEAR_MOM, MONTH_MOM, YEAR_YOY, DAY_MOM, MONTH_YOY};
} }

View File

@ -351,7 +351,7 @@ public class ChartViewService {
//列权限 //列权限
List<String> desensitizationList = new ArrayList<>(); List<String> desensitizationList = new ArrayList<>();
List<DatasetTableField> columnPermissionFields = permissionService.filterColumnPermissons(fields, desensitizationList, table.getId(), requestList.getUser()); List<DatasetTableField> columnPermissionFields = permissionService.filterColumnPermissions(fields, desensitizationList, table.getId(), requestList.getUser());
//将没有权限的列删掉 //将没有权限的列删掉
List<String> dataeaseNames = columnPermissionFields.stream().map(DatasetTableField::getDataeaseName).collect(Collectors.toList()); List<String> dataeaseNames = columnPermissionFields.stream().map(DatasetTableField::getDataeaseName).collect(Collectors.toList());
dataeaseNames.add("*"); dataeaseNames.add("*");
@ -580,7 +580,7 @@ public class ChartViewService {
List<ChartViewFieldDTO> yAxisExt = gson.fromJson(view.getYAxisExt(), tokenType); List<ChartViewFieldDTO> yAxisExt = gson.fromJson(view.getYAxisExt(), tokenType);
yAxis.addAll(yAxisExt); yAxis.addAll(yAxisExt);
} }
if (StringUtils.equalsIgnoreCase(view.getRender(), "antv") && StringUtils.equalsIgnoreCase(view.getType(), "gauge")) { if (StringUtils.equalsIgnoreCase(view.getRender(), "antv") && StringUtils.equalsAnyIgnoreCase(view.getType(), "gauge","liquid")) {
List<ChartViewFieldDTO> sizeField = getSizeField(view); List<ChartViewFieldDTO> sizeField = getSizeField(view);
yAxis.addAll(sizeField); yAxis.addAll(sizeField);
} }
@ -598,7 +598,7 @@ public class ChartViewService {
List<String> desensitizationList = new ArrayList<>(); List<String> desensitizationList = new ArrayList<>();
//列权限 //列权限
List<DatasetTableField> columnPermissionFields = permissionService.filterColumnPermissons(fields, desensitizationList, table.getId(), requestList.getUser()); List<DatasetTableField> columnPermissionFields = permissionService.filterColumnPermissions(fields, desensitizationList, table.getId(), requestList.getUser());
//将没有权限的列删掉 //将没有权限的列删掉
List<String> dataeaseNames = columnPermissionFields.stream().map(DatasetTableField::getDataeaseName).collect(Collectors.toList()); List<String> dataeaseNames = columnPermissionFields.stream().map(DatasetTableField::getDataeaseName).collect(Collectors.toList());
dataeaseNames.add("*"); dataeaseNames.add("*");
@ -670,7 +670,8 @@ public class ChartViewService {
} }
boolean hasParameters = false; boolean hasParameters = false;
if (StringUtils.isNotEmpty(table.getSqlVariableDetails())) { if (StringUtils.isNotEmpty(table.getSqlVariableDetails())) {
List<SqlVariableDetails> sqlVariables = new Gson().fromJson(table.getSqlVariableDetails(), new TypeToken<List<SqlVariableDetails>>() {}.getType()); List<SqlVariableDetails> sqlVariables = new Gson().fromJson(table.getSqlVariableDetails(), new TypeToken<List<SqlVariableDetails>>() {
}.getType());
for (String parameter : Optional.ofNullable(request.getParameters()).orElse(new ArrayList<>())) { for (String parameter : Optional.ofNullable(request.getParameters()).orElse(new ArrayList<>())) {
if (sqlVariables.stream().map(SqlVariableDetails::getVariableName).collect(Collectors.toList()).contains(parameter)) { if (sqlVariables.stream().map(SqlVariableDetails::getVariableName).collect(Collectors.toList()).contains(parameter)) {
hasParameters = true; hasParameters = true;
@ -994,20 +995,6 @@ public class ChartViewService {
if (StringUtils.isNotEmpty(compareCalc.getType()) if (StringUtils.isNotEmpty(compareCalc.getType())
&& !StringUtils.equalsIgnoreCase(compareCalc.getType(), "none")) { && !StringUtils.equalsIgnoreCase(compareCalc.getType(), "none")) {
String compareFieldId = compareCalc.getField();// 选中字段 String compareFieldId = compareCalc.getField();// 选中字段
String resultData = compareCalc.getResultData();// 数据设置
// 获取选中字段以及下标
List<ChartViewFieldDTO> checkedField = new ArrayList<>(xAxis);
if (StringUtils.containsIgnoreCase(view.getType(), "stack")) {
checkedField.addAll(extStack);
}
int timeIndex = 0;// 时间字段下标
ChartViewFieldDTO timeField = null;
for (int j = 0; j < checkedField.size(); j++) {
if (StringUtils.equalsIgnoreCase(checkedField.get(j).getId(), compareFieldId)) {
timeIndex = j;
timeField = checkedField.get(j);
}
}
// 计算指标对应的下标 // 计算指标对应的下标
int dataIndex = 0;// 数据字段下标 int dataIndex = 0;// 数据字段下标
if (StringUtils.containsIgnoreCase(view.getType(), "stack")) { if (StringUtils.containsIgnoreCase(view.getType(), "stack")) {
@ -1015,50 +1002,88 @@ public class ChartViewService {
} else { } else {
dataIndex = xAxis.size() + i; dataIndex = xAxis.size() + i;
} }
// 无选中字段或者选中字段已经不在维度list中或者选中字段日期格式不符合对比类型的直接将对应数据置为null if (Arrays.asList(ChartConstants.M_Y).contains(compareCalc.getType())) {
if (ObjectUtils.isEmpty(timeField) || !checkCalcType(timeField.getDateStyle(), compareCalc.getType())) { String resultData = compareCalc.getResultData();// 数据设置
// set null // 获取选中字段以及下标
for (String[] item : data) { List<ChartViewFieldDTO> checkedField = new ArrayList<>(xAxis);
item[dataIndex] = null; if (StringUtils.containsIgnoreCase(view.getType(), "stack")) {
checkedField.addAll(extStack);
} }
} else { int timeIndex = 0;// 时间字段下标
// 计算 同比/环比 ChartViewFieldDTO timeField = null;
// 1处理当期数据2根据type计算上一期数据3根据resultData计算结果 for (int j = 0; j < checkedField.size(); j++) {
Map<String, String> currentMap = new LinkedHashMap<>(); if (StringUtils.equalsIgnoreCase(checkedField.get(j).getId(), compareFieldId)) {
for (String[] item : data) { timeIndex = j;
String[] dimension = Arrays.copyOfRange(item, 0, checkedField.size()); timeField = checkedField.get(j);
currentMap.put(StringUtils.join(dimension, "-"), item[dataIndex]); }
} }
// 无选中字段或者选中字段已经不在维度list中或者选中字段日期格式不符合对比类型的直接将对应数据置为null
for (int index = 0; index < data.size(); index++) { if (ObjectUtils.isEmpty(timeField) || !checkCalcType(timeField.getDateStyle(), compareCalc.getType())) {
String[] item = data.get(index); // set null
String cTime = item[timeIndex]; for (String[] item : data) {
String cValue = item[dataIndex];
// 获取计算后的时间并且与所有维度拼接
String lastTime = calcLastTime(cTime, compareCalc.getType(), timeField.getDateStyle(), timeField.getDatePattern());
String[] dimension = Arrays.copyOfRange(item, 0, checkedField.size());
dimension[timeIndex] = lastTime;
String lastValue = currentMap.get(StringUtils.join(dimension, "-"));
if (StringUtils.isEmpty(cValue) || StringUtils.isEmpty(lastValue)) {
item[dataIndex] = null; item[dataIndex] = null;
} else { }
if (StringUtils.equalsIgnoreCase(resultData, "sub")) { } else {
item[dataIndex] = new BigDecimal(cValue).subtract(new BigDecimal(lastValue)).toString(); // 计算 同比/环比
} else if (StringUtils.equalsIgnoreCase(resultData, "percent")) { // 1处理当期数据2根据type计算上一期数据3根据resultData计算结果
if (new BigDecimal(lastValue).compareTo(BigDecimal.ZERO) == 0) { Map<String, String> currentMap = new LinkedHashMap<>();
item[dataIndex] = null; for (String[] item : data) {
} else { String[] dimension = Arrays.copyOfRange(item, 0, checkedField.size());
item[dataIndex] = new BigDecimal(cValue) currentMap.put(StringUtils.join(dimension, "-"), item[dataIndex]);
.divide(new BigDecimal(lastValue), 8, RoundingMode.HALF_UP) }
.subtract(new BigDecimal(1))
.setScale(8, RoundingMode.HALF_UP) for (int index = 0; index < data.size(); index++) {
.toString(); String[] item = data.get(index);
String cTime = item[timeIndex];
String cValue = item[dataIndex];
// 获取计算后的时间并且与所有维度拼接
String lastTime = calcLastTime(cTime, compareCalc.getType(), timeField.getDateStyle(), timeField.getDatePattern());
String[] dimension = Arrays.copyOfRange(item, 0, checkedField.size());
dimension[timeIndex] = lastTime;
String lastValue = currentMap.get(StringUtils.join(dimension, "-"));
if (StringUtils.isEmpty(cValue) || StringUtils.isEmpty(lastValue)) {
item[dataIndex] = null;
} else {
if (StringUtils.equalsIgnoreCase(resultData, "sub")) {
item[dataIndex] = new BigDecimal(cValue).subtract(new BigDecimal(lastValue)).toString();
} else if (StringUtils.equalsIgnoreCase(resultData, "percent")) {
if (new BigDecimal(lastValue).compareTo(BigDecimal.ZERO) == 0) {
item[dataIndex] = null;
} else {
item[dataIndex] = new BigDecimal(cValue)
.divide(new BigDecimal(lastValue), 8, RoundingMode.HALF_UP)
.subtract(new BigDecimal(1))
.setScale(8, RoundingMode.HALF_UP)
.toString();
}
} }
} }
} }
} }
} else if (StringUtils.equalsIgnoreCase(compareCalc.getType(), "percent")) {
// 求和
BigDecimal sum = new BigDecimal(0);
for (int index = 0; index < data.size(); index++) {
String[] item = data.get(index);
String cValue = item[dataIndex];
if (StringUtils.isEmpty(cValue)) {
continue;
}
sum = sum.add(new BigDecimal(cValue));
}
// 计算占比
for (int index = 0; index < data.size(); index++) {
String[] item = data.get(index);
String cValue = item[dataIndex];
if (StringUtils.isEmpty(cValue)) {
continue;
}
item[dataIndex] = new BigDecimal(cValue)
.divide(sum, 8, RoundingMode.HALF_UP)
.toString();
}
} }
} }
} }
@ -1168,11 +1193,11 @@ public class ChartViewService {
return "SELECT " + stringBuilder + " FROM (" + sql + ") tmp"; return "SELECT " + stringBuilder + " FROM (" + sql + ") tmp";
} }
public ChartViewDTO uniteViewResult(String sql, Map<String, Object> chartData, Map<String, Object> tabelData, ChartViewDTO view, Boolean isDrill, List<ChartExtFilterRequest> drillFilters, List<ChartSeniorAssistDTO> dynamicAssistFields, List<String[]> assistData) { public ChartViewDTO uniteViewResult(String sql, Map<String, Object> chartData, Map<String, Object> tableData, ChartViewDTO view, Boolean isDrill, List<ChartExtFilterRequest> drillFilters, List<ChartSeniorAssistDTO> dynamicAssistFields, List<String[]> assistData) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.putAll(chartData); map.putAll(chartData);
map.putAll(tabelData); map.putAll(tableData);
List<DatasetTableField> sourceFields = dataSetTableFieldsService.getFieldsByTableId(view.getTableId()); List<DatasetTableField> sourceFields = dataSetTableFieldsService.getFieldsByTableId(view.getTableId());
map.put("sourceFields", sourceFields); map.put("sourceFields", sourceFields);
@ -1193,7 +1218,7 @@ public class ChartViewService {
PluginViewParam pluginViewParam = new PluginViewParam(); PluginViewParam pluginViewParam = new PluginViewParam();
PluginViewSetImpl pluginViewSet = BeanUtils.copyBean(new PluginViewSetImpl(), table); PluginViewSetImpl pluginViewSet = BeanUtils.copyBean(new PluginViewSetImpl(), table);
pluginViewSet.setDsType(ds.getType()); pluginViewSet.setDsType(ds.getType());
pluginViewSet.setTabelId(table.getId()); pluginViewSet.setTableId(table.getId());
pluginViewSet.setDs(ds); pluginViewSet.setDs(ds);
PluginViewLimit pluginViewLimit = BeanUtils.copyBean(new PluginViewLimit(), view); PluginViewLimit pluginViewLimit = BeanUtils.copyBean(new PluginViewLimit(), view);
@ -1599,7 +1624,8 @@ public class ChartViewService {
} }
private String handleVariable(String sql, ChartExtRequest requestList, QueryProvider qp, DataSetTableDTO table, Datasource ds) throws Exception { private String handleVariable(String sql, ChartExtRequest requestList, QueryProvider qp, DataSetTableDTO table, Datasource ds) throws Exception {
List<SqlVariableDetails> sqlVariables = new Gson().fromJson(table.getSqlVariableDetails(), new TypeToken<List<SqlVariableDetails>>() {}.getType()); List<SqlVariableDetails> sqlVariables = new Gson().fromJson(table.getSqlVariableDetails(), new TypeToken<List<SqlVariableDetails>>() {
}.getType());
if (requestList != null && CollectionUtils.isNotEmpty(requestList.getFilter())) { if (requestList != null && CollectionUtils.isNotEmpty(requestList.getFilter())) {
for (ChartExtFilterRequest chartExtFilterRequest : requestList.getFilter()) { for (ChartExtFilterRequest chartExtFilterRequest : requestList.getFilter()) {
if (CollectionUtils.isEmpty(chartExtFilterRequest.getValue())) { if (CollectionUtils.isEmpty(chartExtFilterRequest.getValue())) {
@ -1610,8 +1636,8 @@ public class ChartViewService {
} }
for (String parameter : chartExtFilterRequest.getParameters()) { for (String parameter : chartExtFilterRequest.getParameters()) {
if(parameter.contains("|DE|")){ if (parameter.contains("|DE|")) {
if(!parameter.split("\\|DE\\|")[0].equals(table.getId())){ if (!parameter.split("\\|DE\\|")[0].equals(table.getId())) {
continue; continue;
} }
List<SqlVariableDetails> parameters = sqlVariables.stream().filter(item -> item.getVariableName().equalsIgnoreCase(parameter.split("\\|DE\\|")[1])).collect(Collectors.toList()); List<SqlVariableDetails> parameters = sqlVariables.stream().filter(item -> item.getVariableName().equalsIgnoreCase(parameter.split("\\|DE\\|")[1])).collect(Collectors.toList());
@ -1619,7 +1645,7 @@ public class ChartViewService {
String filter = qp.transFilter(chartExtFilterRequest, parameters.get(0)); String filter = qp.transFilter(chartExtFilterRequest, parameters.get(0));
sql = sql.replace("${" + parameter.split("\\|DE\\|")[1] + "}", filter); sql = sql.replace("${" + parameter.split("\\|DE\\|")[1] + "}", filter);
} }
}else { } else {
List<SqlVariableDetails> parameters = sqlVariables.stream().filter(item -> item.getVariableName().equalsIgnoreCase(parameter)).collect(Collectors.toList()); List<SqlVariableDetails> parameters = sqlVariables.stream().filter(item -> item.getVariableName().equalsIgnoreCase(parameter)).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(parameters)) { if (CollectionUtils.isNotEmpty(parameters)) {
String filter = qp.transFilter(chartExtFilterRequest, parameters.get(0)); String filter = qp.transFilter(chartExtFilterRequest, parameters.get(0));
@ -1656,49 +1682,46 @@ public class ChartViewService {
JSONObject jsonObject = JSONObject.parseObject(customAttr); JSONObject jsonObject = JSONObject.parseObject(customAttr);
JSONObject size = jsonObject.getJSONObject("size"); JSONObject size = jsonObject.getJSONObject("size");
String gaugeMinType = size.getString("gaugeMinType"); ChartViewFieldDTO gaugeMinViewField = getDynamicField(size, "gaugeMinType", "gaugeMinField");
if (StringUtils.equalsIgnoreCase("dynamic", gaugeMinType)) { if (gaugeMinViewField != null) {
JSONObject gaugeMinField = size.getJSONObject("gaugeMinField"); list.add(gaugeMinViewField);
String id = gaugeMinField.getString("id");
String summary = gaugeMinField.getString("summary");
DatasetTableField datasetTableField = dataSetTableFieldsService.get(id);
if (ObjectUtils.isNotEmpty(datasetTableField)) {
if (datasetTableField.getDeType() == 0 || datasetTableField.getDeType() == 1 || datasetTableField.getDeType() == 5) {
if (!StringUtils.containsIgnoreCase(summary, "count")) {
DEException.throwException(Translator.get("i18n_gauge_field_change"));
}
}
ChartViewFieldDTO dto = new ChartViewFieldDTO();
BeanUtils.copyBean(dto, datasetTableField);
dto.setSummary(summary);
list.add(dto);
} else {
DEException.throwException(Translator.get("i18n_gauge_field_delete"));
}
} }
String gaugeMaxType = size.getString("gaugeMaxType"); ChartViewFieldDTO gaugeMaxViewField = getDynamicField(size, "gaugeMaxType", "gaugeMaxField");
if (StringUtils.equalsIgnoreCase("dynamic", gaugeMaxType)) { if (gaugeMaxViewField != null) {
JSONObject gaugeMaxField = size.getJSONObject("gaugeMaxField"); list.add(gaugeMaxViewField);
String id = gaugeMaxField.getString("id");
String summary = gaugeMaxField.getString("summary");
DatasetTableField datasetTableField = dataSetTableFieldsService.get(id);
if (ObjectUtils.isNotEmpty(datasetTableField)) {
if (datasetTableField.getDeType() == 0 || datasetTableField.getDeType() == 1 || datasetTableField.getDeType() == 5) {
if (!StringUtils.containsIgnoreCase(summary, "count")) {
DEException.throwException(Translator.get("i18n_gauge_field_change"));
}
}
ChartViewFieldDTO dto = new ChartViewFieldDTO();
BeanUtils.copyBean(dto, datasetTableField);
dto.setSummary(summary);
list.add(dto);
} else {
DEException.throwException(Translator.get("i18n_gauge_field_delete"));
}
} }
ChartViewFieldDTO liquidMaxViewField = getDynamicField(size, "liquidMaxType", "liquidMaxField");
if (liquidMaxViewField != null) {
list.add(liquidMaxViewField);
}
return list; return list;
} }
private ChartViewFieldDTO getDynamicField(JSONObject sizeObj, String type, String field) {
String maxType = sizeObj.getString(type);
if (StringUtils.equalsIgnoreCase("dynamic", maxType)) {
JSONObject maxField = sizeObj.getJSONObject(field);
String id = maxField.getString("id");
String summary = maxField.getString("summary");
DatasetTableField datasetTableField = dataSetTableFieldsService.get(id);
if (ObjectUtils.isNotEmpty(datasetTableField)) {
if (datasetTableField.getDeType() == 0 || datasetTableField.getDeType() == 1 || datasetTableField.getDeType() == 5) {
if (!StringUtils.containsIgnoreCase(summary, "count")) {
DEException.throwException(Translator.get("i18n_gauge_field_change"));
}
}
ChartViewFieldDTO dto = new ChartViewFieldDTO();
BeanUtils.copyBean(dto, datasetTableField);
dto.setSummary(summary);
return dto;
} else {
DEException.throwException(Translator.get("i18n_gauge_field_delete"));
}
}
return null;
}
private List<ChartSeniorAssistDTO> getDynamicAssistFields(ChartViewDTO view) { private List<ChartSeniorAssistDTO> getDynamicAssistFields(ChartViewDTO view) {
String senior = view.getSenior(); String senior = view.getSenior();
JSONObject jsonObject = JSONObject.parseObject(senior); JSONObject jsonObject = JSONObject.parseObject(senior);

View File

@ -23,10 +23,10 @@ public abstract class FilterBuildTemplate {
List<Map<String, Object>> filters = componentsFilter(components, "custom", null, null); List<Map<String, Object>> filters = componentsFilter(components, "custom", null, null);
if(ObjectUtils.isNotEmpty(searchButton)) { if (ObjectUtils.isNotEmpty(searchButton)) {
Map<String, Object> options = (Map<String, Object>) searchButton.get("options"); Map<String, Object> options = (Map<String, Object>) searchButton.get("options");
Map<String, Object> attrs = (Map<String, Object>) options.get("attrs"); Map<String, Object> attrs = (Map<String, Object>) options.get("attrs");
Boolean customRange = (Boolean)attrs.get("customRange"); Boolean customRange = (Boolean) attrs.get("customRange");
Boolean autoTrigger = (Boolean) attrs.get("autoTrigger"); Boolean autoTrigger = (Boolean) attrs.get("autoTrigger");
List<String> filterIds = (List<String>) attrs.get("filterIds"); List<String> filterIds = (List<String>) attrs.get("filterIds");
if (!autoTrigger) { // 不是自动触发 // 需要过滤掉按钮关联的条件组件 if (!autoTrigger) { // 不是自动触发 // 需要过滤掉按钮关联的条件组件
@ -77,7 +77,7 @@ public abstract class FilterBuildTemplate {
return ObjectUtils.isNotEmpty(condition) && CollectionUtils.isNotEmpty(condition.getValue()) && StringUtils.isNotBlank(condition.getValue().get(0)); return ObjectUtils.isNotEmpty(condition) && CollectionUtils.isNotEmpty(condition.getValue()) && StringUtils.isNotBlank(condition.getValue().get(0));
} }
private static Boolean viewIdMatch(List<String> viewIds, String viewId) { private static Boolean viewIdMatch(List<String> viewIds, String viewId) {
return CollectionUtils.isEmpty(viewIds) || viewIds.contains(viewId); return CollectionUtils.isEmpty(viewIds) || viewIds.contains(viewId);
} }
@ -88,7 +88,7 @@ public abstract class FilterBuildTemplate {
Map<String, Object> component = filterParamTO.getComponent(); Map<String, Object> component = filterParamTO.getComponent();
Map<String, Object> attrs = (Map<String, Object>) ((Map<String, Object>) component.get("options")).get("attrs"); Map<String, Object> attrs = (Map<String, Object>) ((Map<String, Object>) component.get("options")).get("attrs");
String fieldId = attrs.get("fieldId").toString(); String fieldId = attrs.get("fieldId").toString();
List<String> viewIds = (List<String>)attrs.get("viewIds"); List<String> viewIds = (List<String>) attrs.get("viewIds");
List<String> parameters = (List<String>) attrs.get("parameters"); List<String> parameters = (List<String>) attrs.get("parameters");
Boolean multiple = ObjectUtils.isNotEmpty(attrs.get("multiple")) && (Boolean) attrs.get("multiple"); Boolean multiple = ObjectUtils.isNotEmpty(attrs.get("multiple")) && (Boolean) attrs.get("multiple");
if (isTree && !multiple && CollectionUtils.isNotEmpty(value)) { if (isTree && !multiple && CollectionUtils.isNotEmpty(value)) {
@ -147,9 +147,9 @@ public abstract class FilterBuildTemplate {
} }
public static List<Map<String, Object>> componentsFilter(List<Map<String, Object>> components, String type, public static List<Map<String, Object>> componentsFilter(List<Map<String, Object>> components, String type,
String componentType, String serviceName) { String componentType, String serviceName) {
return components.stream().filter(component -> { return components.stream().filter(component -> {
String ctype = Optional.ofNullable(component.get("type")).orElse("").toString(); String ctype = Optional.ofNullable(component.get("type")).orElse("").toString();
String cComponentType = Optional.ofNullable(component.get("component")).orElse("").toString(); String cComponentType = Optional.ofNullable(component.get("component")).orElse("").toString();
String cServiceName = Optional.ofNullable(component.get("serviceName")).orElse("").toString(); String cServiceName = Optional.ofNullable(component.get("serviceName")).orElse("").toString();
@ -180,10 +180,20 @@ public abstract class FilterBuildTemplate {
beanMapping.put("numberRangeWidget", "numberRangeWidget"); beanMapping.put("numberRangeWidget", "numberRangeWidget");
beanMapping.put("textSelectTreeWidget", "textSelectTreeWidget"); beanMapping.put("textSelectTreeWidget", "textSelectTreeWidget");
beanMapping.put("textInputWidget", "textInputWidget"); beanMapping.put("textInputWidget", "textInputWidget");
beanMapping.put("timeDateWidget", "timeDateWidget");
beanMapping.put("timeMonthWidget", "timeMonthWidget");
beanMapping.put("timeYearWidget", "timeYearWidget");
beanMapping.put("timeDateRangeWidget", "timeDateRangeWidget");
String beanName = beanMapping.get(serviceName); String beanName = beanMapping.get(serviceName);
if (StringUtils.isBlank(beanName) && StringUtils.containsIgnoreCase(serviceName, "select")) { if (StringUtils.isBlank(beanName) && StringUtils.containsIgnoreCase(serviceName, "select")) {
beanName = "selectWidget"; beanName = "selectWidget";
} }
return (FilterBuildTemplate)CommonBeanFactory.getBean(beanName);
return (FilterBuildTemplate) CommonBeanFactory.getBean(beanName);
}
protected Map<String, Object> buildAttrs(Map<String, Object> component) {
Map<String, Object> attrs = (Map<String, Object>) ((Map<String, Object>) component.get("options")).get("attrs");
return attrs;
} }
} }

View File

@ -114,7 +114,7 @@ public class ViewExportExcel {
return filterInvalidDecimal(val.toString()); return filterInvalidDecimal(val.toString());
}).collect(Collectors.toList())).collect(Collectors.toList()); }).collect(Collectors.toList())).collect(Collectors.toList());
result.setHeads(heads); result.setHeads(heads);
result.setDatas(details); result.setData(details);
result.setSheetName(title); result.setSheetName(title);
return result; return result;

View File

@ -105,7 +105,7 @@ public class ViewPluginBaseServiceImpl implements ViewPluginBaseService {
String tableName = null; String tableName = null;
DataTableInfoDTO dataTableInfoDTO = new Gson().fromJson(pluginViewSet.getInfo(), DataTableInfoDTO.class); DataTableInfoDTO dataTableInfoDTO = new Gson().fromJson(pluginViewSet.getInfo(), DataTableInfoDTO.class);
if (ObjectUtils.isNotEmpty(pluginViewSet.getMode()) && 1 == pluginViewSet.getMode()) { if (ObjectUtils.isNotEmpty(pluginViewSet.getMode()) && 1 == pluginViewSet.getMode()) {
tableName = TableUtils.tableName(pluginViewSet.getTabelId()); tableName = TableUtils.tableName(pluginViewSet.getTableId());
}else { }else {
switch (DatasetType.getEnumObjByKey(pluginViewSet.getType())) { switch (DatasetType.getEnumObjByKey(pluginViewSet.getType())) {
case DB: case DB:
@ -134,11 +134,11 @@ public class ViewPluginBaseServiceImpl implements ViewPluginBaseService {
} }
} }
String keyword = ConstantsUtil.constantsValue(pluginViewSet.getDsType(), "KEYWORD_TABLE"); String keyword = ConstantsUtil.constantsValue(pluginViewSet.getDsType(), "KEYWORD_TABLE");
String tabelName = (tableName.startsWith("(") && tableName.endsWith(")")) ? tableName : String.format(keyword, tableName); String realTableName = (tableName.startsWith("(") && tableName.endsWith(")")) ? tableName : String.format(keyword, tableName);
String tabelAlias = String.format(TABLE_ALIAS_PREFIX, 0); String tableAlias = String.format(TABLE_ALIAS_PREFIX, 0);
PluginViewSQL tableObj = PluginViewSQL.builder().tableName(tabelName).tableAlias(tabelAlias).build(); PluginViewSQL tableObj = PluginViewSQL.builder().tableName(realTableName).tableAlias(tableAlias).build();
QueryProvider queryProvider = ProviderFactory.getQueryProvider(pluginViewSet.getDsType()); QueryProvider queryProvider = ProviderFactory.getQueryProvider(pluginViewSet.getDsType());
SQLObj sqlObj = SQLObj.builder().tableName(tabelName).tableAlias(tabelAlias).build(); SQLObj sqlObj = SQLObj.builder().tableName(realTableName).tableAlias(tableAlias).build();
PluginViewSetImpl child = (PluginViewSetImpl)pluginViewSet; PluginViewSetImpl child = (PluginViewSetImpl)pluginViewSet;
queryProvider.setSchema(sqlObj, child.getDs()); queryProvider.setSchema(sqlObj, child.getDs());
tableObj.setTableName(sqlObj.getTableName()); tableObj.setTableName(sqlObj.getTableName());

View File

@ -0,0 +1,209 @@
package io.dataease.service.chart.build;
import io.dataease.commons.exception.DEException;
import io.dataease.commons.utils.LogUtil;
import io.dataease.dto.chart.FilterParamTO;
import io.dataease.service.chart.FilterBuildTemplate;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import java.lang.reflect.Method;
import java.util.*;
import java.util.stream.Collectors;
public abstract class TimeBuild extends FilterBuildTemplate {
private static final String MULTIPLETYPE = "daterange";
@Override
protected FilterParamTO buildParam(Map<String, Object> component) {
FilterParamTO result = new FilterParamTO();
result.setComponent(component);
result.setValue(null);
result.setOperator("between");
result.setIsTree(false);
Map<String, Object> options = (Map<String, Object>) component.get("options");
Map<String, Object> attrs = (Map<String, Object>) options.get("attrs");
Object valueObj = options.get("value");
String defaultValue = "";
boolean multiple = attrs.get("type").equals(MULTIPLETYPE);
Object defaultObject = attrs.get("default");
Boolean isDynamic = false;
if (ObjectUtils.isNotEmpty(defaultObject)) {
Map<String, Object> defaultMap = (Map<String, Object>) defaultObject;
isDynamic = (Boolean) defaultMap.getOrDefault("isDynamic", false);
}
List<String> realValues = null;
if (!ObjectUtils.isEmpty(valueObj)) {
if (valueObj instanceof List) {
defaultValue = "";
} else {
defaultValue = valueObj.toString();
}
}
String componentType = componentType(component);
String labelFormat = labelFormat(component);
if (isDynamic) {
List<Long> dynamicTimes = dynamicDateFromNow(component);
if (CollectionUtils.isNotEmpty(dynamicTimes)) {
int size = dynamicTimes.size();
if (size > 1) {
String start = timeSection(String.valueOf(dynamicTimes.get(0)), multiple ? "datetime" : componentType, labelFormat).get(0);
String end = timeSection(String.valueOf(dynamicTimes.get(1)), multiple ? "datetime" : componentType, labelFormat).get(1);
realValues = add2List(start, end);
} else {
realValues = timeSection(String.valueOf(dynamicTimes.get(0)), componentType, labelFormat);
}
}
} else {
if (StringUtils.isBlank(defaultValue)) {
realValues = new ArrayList<>();
} else {
if (multiple) {
List<String> realVals = Arrays.asList(defaultValue.split(","));
String start = realVals.get(0);
String end = realVals.get(1);
start = timeSection(start, "datetime", labelFormat).get(0);
end = timeSection(end, "datetime", labelFormat).get(1);
realValues = add2List(start, end);
} else {
realValues = Arrays.asList(defaultValue.split(",")).stream().limit(1).collect(Collectors.toList());
realValues = timeSection(realValues.get(0), componentType, labelFormat);
}
}
}
result.setValue(realValues);
return result;
}
public List<String> timeSection(String sourceTimeStr, String type, String labelFormat) {
if (StringUtils.isBlank(sourceTimeStr)) return null;
Long sourceTime = Long.parseLong(sourceTimeStr);
List<String> result = new ArrayList<>();
List<String> formatArr = new ArrayList<>();
if (StringUtils.isNotBlank(labelFormat)) {
formatArr = Arrays.stream(labelFormat.split(" ")).collect(Collectors.toList());
}
Integer[] fieldNames = {Calendar.HOUR_OF_DAY, Calendar.MINUTE, Calendar.SECOND, Calendar.MILLISECOND};
Calendar instance = Calendar.getInstance();
instance.setTimeInMillis(sourceTime);
int methodsLen = fieldNames.length;
int childArrLength = 0;
if (StringUtils.equals("datetime", type) && formatArr.size() > 1) {
List<String> childArr = new ArrayList<>();
if (StringUtils.isNotBlank(formatArr.get(1))) {
childArr = Arrays.stream(formatArr.get(1).split(":")).collect(Collectors.toList());
}
childArrLength = childArr.size();
while (--methodsLen >= childArrLength) {
executeSetFieldValue(instance, fieldNames[methodsLen], 0);
}
} else {
for (int i = 0; i < methodsLen; i++) {
executeSetFieldValue(instance, fieldNames[i], 0);
}
}
Calendar endInstance = Calendar.getInstance();
endInstance.setTimeInMillis(instance.getTimeInMillis());
if (StringUtils.equals("year", type)) {
instance.set(Calendar.MONTH, 0);
instance.set(Calendar.DATE, 1);
endInstance.setTimeInMillis(instance.getTimeInMillis());
endInstance.set(Calendar.YEAR, endInstance.get(Calendar.YEAR) + 1);
endInstance.add(Calendar.SECOND, -1);
endInstance.roll(Calendar.MILLISECOND, -1);
}
if (StringUtils.equals("month", type)) {
instance.set(Calendar.DATE, 1);
endInstance.setTimeInMillis(instance.getTimeInMillis());
endInstance.set(Calendar.MONTH, endInstance.get(Calendar.MONTH) + 1);
endInstance.add(Calendar.SECOND, -1);
endInstance.roll(Calendar.MILLISECOND, -1);
}
if (StringUtils.equals("date", type)) {
endInstance.set(Calendar.DATE, endInstance.get(Calendar.DATE) + 1);
endInstance.add(Calendar.SECOND, -1);
endInstance.roll(Calendar.MILLISECOND, -1);
}
if (StringUtils.equals("datetime", type)) {
if (childArrLength == 0) {
endInstance.set(Calendar.DATE, endInstance.get(Calendar.DATE) + 1);
} else {
Integer fieldNameFlag = fieldNames[childArrLength - 1];
endInstance.set(fieldNameFlag, endInstance.get(fieldNameFlag) + 1);
}
endInstance.add(Calendar.SECOND, -1);
endInstance.roll(Calendar.MILLISECOND, -1);
}
result.add(String.valueOf(instance.getTimeInMillis()));
result.add(String.valueOf(endInstance.getTimeInMillis()));
return result;
}
private void executeSetFieldValue(Calendar instance, Integer fieldFlag, Object value) {
try {
Method setMethod = instance.getClass().getMethod("set", int.class, int.class);
setMethod.invoke(instance, fieldFlag, value);
} catch (Exception e) {
DEException.throwException(e);
LogUtil.error(e.getMessage(), e);
}
}
public Boolean isTimeWidget(String serviceName) {
if (StringUtils.isBlank(serviceName)) return false;
String[] timeWidgets = {"timeDateWidget", "timeDateRangeWidget"};
return Arrays.stream(timeWidgets).anyMatch(widget -> StringUtils.equals(widget, serviceName));
}
public Boolean showTime(Map<String, Object> component) {
Map attrs = (Map) ((Map) component.get("options")).get("attrs");
if (ObjectUtils.isNotEmpty(attrs.get("showTime"))) {
return (boolean) attrs.get("showTime");
}
return false;
}
public String componentType(Map<String, Object> component) {
Map attrs = (Map) ((Map) component.get("options")).get("attrs");
String result = ObjectUtils.isEmpty(attrs.get("type")) ? "date" : attrs.get("type").toString();
String serviceName = component.get("serviceName").toString();
if (isTimeWidget(serviceName) && showTime(component)) {
result = StringUtils.equals("timeDateWidget", serviceName) ? "datetime" : "datetimerange";
}
return result;
}
public String labelFormat(Map<String, Object> component) {
String result = "yyyy-MM-dd";
Map attrs = (Map) ((Map) component.get("options")).get("attrs");
String serviceName = component.get("serviceName").toString();
if (isTimeWidget(serviceName) && showTime(component) && ObjectUtils.isNotEmpty(attrs.get("accuracy"))) {
return result + " " + attrs.get("accuracy");
}
return result;
}
public List add2List(Object... elements) {
return Arrays.stream(elements).collect(Collectors.toList());
}
public abstract List<Long> dynamicDateFromNow(Map<String, Object> component);
}

View File

@ -1,73 +0,0 @@
package io.dataease.service.chart.build;
import io.dataease.dto.chart.FilterParamTO;
import io.dataease.service.chart.FilterBuildTemplate;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
public class TimeYearBuild extends FilterBuildTemplate {
@Override
protected FilterParamTO buildParam(Map<String, Object> component) {
List<String> realVals = null;
Object valueObj = null;
String defaultValue = "";
Map<String, Object> options = (Map<String, Object>) component.get("options");
Map<String, Object> attrs = (Map<String, Object>) options.get("attrs");
Object aDefault = attrs.get("default");
Boolean isDynamic = (Boolean) attrs.getOrDefault("isDynamic", false);
if (ObjectUtils.isNotEmpty(aDefault) && isDynamic) {
Long aLong = dynamicDateFormNow(component);
realVals = new ArrayList<>();
realVals.add(aLong.toString());
}else {
if(!ObjectUtils.isEmpty(valueObj)) {
if(valueObj instanceof List) {
defaultValue = "";
}else {
defaultValue = valueObj.toString();
}
}
if (StringUtils.isBlank(defaultValue)) {
realVals = new ArrayList<>();
}else {
realVals = Arrays.asList(defaultValue.split(",")).stream().limit(1).collect(Collectors.toList());
}
}
return null;
}
private Long dynamicDateFormNow(Map<String, Object> component) {
Map<String, Object> attrs = (Map<String, Object>) ((Map<String, Object>) component.get("options")).get("attrs");
Object aDefault = attrs.get("default");
Boolean isDynamic = (Boolean) attrs.getOrDefault("isDynamic", false);
if (ObjectUtils.isEmpty(aDefault) || !isDynamic) return null;
Calendar now = Calendar.getInstance();
int nowYear = now.get(Calendar.YEAR);
Map<String, Object> aDefaultMap = (Map<String, Object>) aDefault;
if (Integer.parseInt(aDefaultMap.get("dkey").toString()) == 0){
now.set(nowYear, 0, 1, 0, 0, 0);
return now.getTimeInMillis();
}
if (Integer.parseInt(aDefaultMap.get("dkey").toString()) == 1){
now.set(nowYear - 1, 0, 1, 0, 0, 0);
return now.getTimeInMillis();
}
if (Integer.parseInt(aDefaultMap.get("dkey").toString()) == 2){
int dynamicPrefix = Integer.parseInt(aDefaultMap.get("dynamicPrefix").toString());
String dynamicSuffix = aDefaultMap.get("dynamicSuffix").toString();
now.set(StringUtils.equals("before", dynamicSuffix) ? (nowYear - dynamicPrefix) : (nowYear + dynamicPrefix), 0, 1, 0, 0, 0);
return now.getTimeInMillis();
}
return 0L;
}
}

View File

@ -0,0 +1,79 @@
package io.dataease.service.chart.build.time;
import io.dataease.service.chart.build.TimeBuild;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
@Service("timeDateWidget")
public class TimeDateBuild extends TimeBuild {
public List<Long> dynamicDateFromNow(Map<String, Object> component) {
Map<String, Object> attrs = buildAttrs(component);
Object defaultObject = attrs.get("default");
Boolean isDynamic = false;
Map<String, Object> defaultMap = null;
if (ObjectUtils.isNotEmpty(defaultObject)) {
defaultMap = (Map<String, Object>) defaultObject;
isDynamic = (Boolean) defaultMap.getOrDefault("isDynamic", false);
}
if (ObjectUtils.isEmpty(defaultObject) || !isDynamic) return null;
Calendar now = Calendar.getInstance();
int nowYear = now.get(Calendar.YEAR);
int nowMonth = now.get(Calendar.MONTH);
int nowDate = now.get(Calendar.DATE);
int dkey = (int) Double.parseDouble(defaultMap.get("dkey").toString());
if (dkey == 0) {
now.set(nowYear, nowMonth, nowDate, 0, 0, 0);
return add2List(now.getTimeInMillis());
}
if (dkey == 1) {
now.set(nowYear, nowMonth, nowDate - 1, 0, 0, 0);
return add2List(now.getTimeInMillis());
}
if (dkey == 2) {
now.set(nowYear, nowMonth, 1, 0, 0, 0);
return add2List(now.getTimeInMillis());
}
if (dkey == 4) {
now.set(nowYear, 0, 1, 0, 0, 0);
return add2List(now.getTimeInMillis());
}
if (dkey == 3) {
int dynamicPrefix = (int) Double.parseDouble(defaultMap.get("dynamicPrefix").toString());
String dynamicInfill = defaultMap.get("dynamicInfill").toString();
String dynamicSuffix = defaultMap.get("dynamicSuffix").toString();
now.set(nowYear, nowMonth, nowDate, 0, 0, 0);
if (StringUtils.equals("day", dynamicInfill)) {
int step = dynamicPrefix * (StringUtils.equals("before", dynamicSuffix) ? -1 : 1);
now.roll(Calendar.DATE, step);
return add2List(now.getTimeInMillis());
}
if (StringUtils.equals("week", dynamicInfill)) {
int step = dynamicPrefix * (StringUtils.equals("before", dynamicSuffix) ? -1 : 1) * 7;
now.roll(Calendar.DATE, step);
return add2List(now.getTimeInMillis());
}
if (StringUtils.equals("month", dynamicInfill)) {
int step = dynamicPrefix * (StringUtils.equals("before", dynamicSuffix) ? -1 : 1);
now.roll(Calendar.MONTH, step);
return add2List(now.getTimeInMillis());
}
if (StringUtils.equals("year", dynamicInfill)) {
int step = dynamicPrefix * (StringUtils.equals("before", dynamicSuffix) ? -1 : 1);
now.roll(Calendar.YEAR, step);
return add2List(now.getTimeInMillis());
}
}
return null;
}
}

View File

@ -0,0 +1,149 @@
package io.dataease.service.chart.build.time;
import io.dataease.service.chart.build.TimeBuild;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
@Service("timeDateRangeWidget")
public class TimeDateRangeBuild extends TimeBuild {
@Override
public List<Long> dynamicDateFromNow(Map<String, Object> component) {
Map<String, Object> attrs = buildAttrs(component);
Object defaultObject = null;
if ((defaultObject = attrs.get("default")) == null) return null;
Map<String, Object> defaultMap = (Map<String, Object>) defaultObject;
Boolean isDynamic = (Boolean) defaultMap.getOrDefault("isDynamic", false);
if (!isDynamic) return null;
int dkey = (int) Double.parseDouble(defaultMap.get("dkey").toString());
Calendar now = Calendar.getInstance();
now.set(Calendar.HOUR_OF_DAY, 0);
now.set(Calendar.MINUTE, 0);
now.set(Calendar.SECOND, 0);
now.set(Calendar.MILLISECOND, 0);
if (dkey % 5 == 0) {
if (dkey == 5) {
now.add(Calendar.DATE, -7);
}
now.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
long start = now.getTimeInMillis();
now.add(Calendar.DATE, 7);
now.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
long end = now.getTimeInMillis();
return add2List(start, end);
}
if (dkey == 1) {
Calendar endBase = (Calendar) now.clone();
now.set(Calendar.DAY_OF_MONTH, 1);
long start = now.getTimeInMillis();
endBase.add(Calendar.MONTH, 1);
endBase.set(Calendar.DAY_OF_MONTH, 0);
long end = endBase.getTimeInMillis();
return add2List(start, end);
}
if (dkey == 6) {
Calendar endBase = (Calendar) now.clone();
now.add(Calendar.MONTH, -1);
now.set(Calendar.DAY_OF_MONTH, 1);
long start = now.getTimeInMillis();
endBase.set(Calendar.DAY_OF_MONTH, 0);
long end = endBase.getTimeInMillis();
return add2List(start, end);
}
if (dkey % 5 == 2) {
int step = 0;
if (dkey == 7) {
step = -1;
}
Calendar endBase = (Calendar) now.clone();
Long start = quarterBegin(now, step);
Long end = quarterEnd(endBase, step);
return add2List(start, end);
}
if (dkey == 3) {
now.set(Calendar.MONTH, 0);
now.set(Calendar.DAY_OF_MONTH, 1);
long start = now.getTimeInMillis();
now.add(Calendar.YEAR, 1);
now.add(Calendar.DAY_OF_MONTH, -1);
long end = now.getTimeInMillis();
return add2List(start, end);
}
if (dkey == 8) {
now.add(Calendar.YEAR, -1);
now.set(Calendar.MONTH, 0);
now.set(Calendar.DAY_OF_MONTH, 1);
long start = now.getTimeInMillis();
now.add(Calendar.YEAR, 1);
now.add(Calendar.DAY_OF_MONTH, -1);
long end = now.getTimeInMillis();
return add2List(start, end);
}
if (dkey == 4) {
Object startDynamicObject = defaultMap.get("sDynamicPrefix");
Object endDynamicObject = defaultMap.get("eDynamicPrefix");
if (ObjectUtils.isNotEmpty(startDynamicObject) && ObjectUtils.isNotEmpty(endDynamicObject)) {
String startDynamicInfill = defaultMap.get("sDynamicInfill").toString();
String endDynamicInfill = defaultMap.get("eDynamicInfill").toString();
String startDynamicSuffix = defaultMap.get("sDynamicSuffix").toString();
String endDynamicSuffix = defaultMap.get("eDynamicSuffix").toString();
int startDynamic = (int) Double.parseDouble(startDynamicObject.toString());
int endDynamic = (int) Double.parseDouble(endDynamicObject.toString());
Calendar endBase = (Calendar) now.clone();
Long start = customTime(now, startDynamic, startDynamicInfill, startDynamicSuffix);
Long end = customTime(endBase, endDynamic, endDynamicInfill, endDynamicSuffix);
return add2List(start, end);
}
}
return null;
}
private Long customTime(Calendar now, int dynamicPrefix, String dynamicInfill, String dynamicSuffix) {
if (StringUtils.equals(dynamicInfill, "day")) {
int step = dynamicPrefix * (StringUtils.equals("before", dynamicSuffix) ? -1 : 1);
now.add(Calendar.DAY_OF_MONTH, step);
}
if (StringUtils.equals(dynamicInfill, "week")) {
int step = dynamicPrefix * (StringUtils.equals("before", dynamicSuffix) ? -1 : 1) * 7;
now.add(Calendar.DAY_OF_MONTH, step);
}
if (StringUtils.equals(dynamicInfill, "month")) {
int step = dynamicPrefix * (StringUtils.equals("before", dynamicSuffix) ? -1 : 1);
now.add(Calendar.MONTH, step);
}
if (StringUtils.equals("year", dynamicInfill)) {
int step = dynamicPrefix * (StringUtils.equals("before", dynamicSuffix) ? -1 : 1);
now.add(Calendar.YEAR, step);
}
return now.getTimeInMillis();
}
private Long quarterBegin(Calendar instance, int step) {
int month = instance.get(Calendar.MONTH);
int quarterBegin = (int) Math.floor(month / 3) * 3;
instance.set(Calendar.MONTH, quarterBegin + (3 * step));
instance.set(Calendar.DAY_OF_MONTH, 1);
return instance.getTimeInMillis();
}
private Long quarterEnd(Calendar instance, int step) {
int month = instance.get(Calendar.MONTH);
int quarterBegin = (int) Math.floor(month / 3) * 3;
instance.set(Calendar.MONTH, quarterBegin + (3 * (step + 1)));
instance.set(Calendar.DAY_OF_MONTH, 1);
instance.add(Calendar.DATE, -1);
return instance.getTimeInMillis();
}
}

View File

@ -0,0 +1,55 @@
package io.dataease.service.chart.build.time;
import io.dataease.service.chart.build.TimeBuild;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
@Service("timeMonthWidget")
public class TimeMonthBuild extends TimeBuild {
@Override
public List<Long> dynamicDateFromNow(Map<String, Object> component) {
Map<String, Object> attrs = buildAttrs(component);
Object defaultObject = attrs.get("default");
if (ObjectUtils.isEmpty(defaultObject)) return null;
Map<String, Object> defaultMap = (Map<String, Object>) defaultObject;
Boolean isDynamic = (Boolean) defaultMap.getOrDefault("isDynamic", false);
if (!isDynamic) return null;
Calendar now = Calendar.getInstance();
int nowYear = now.get(Calendar.YEAR);
int nowMonth = now.get(Calendar.MONTH);
int dkey = (int) Double.parseDouble(defaultMap.get("dkey").toString());
if (dkey == 0) {
now.set(nowYear, nowMonth, 1, 0, 0, 0);
return add2List(now.getTimeInMillis());
}
if (dkey == 1) {
now.set(nowYear, nowMonth - 1, 1, 0, 0, 0);
return add2List(now.getTimeInMillis());
}
if (dkey == 2) {
now.set(nowYear, 0, 1, 0, 0, 0);
return add2List(now.getTimeInMillis());
}
if (dkey == 4) {
now.set(nowYear - 1, nowMonth, 1, 0, 0, 0);
return add2List(now.getTimeInMillis());
}
if (dkey == 3) {
int dynamicPrefix = (int) Double.parseDouble(defaultMap.get("dynamicPrefix").toString());
String dynamicSuffix = defaultMap.get("dynamicSuffix").toString();
int targetMonth = StringUtils.equals("before", dynamicSuffix) ? (nowMonth - dynamicPrefix) : (nowMonth + dynamicPrefix);
now.set(nowYear, targetMonth, 1, 0, 0, 0);
return add2List(now.getTimeInMillis());
}
return null;
}
}

View File

@ -0,0 +1,47 @@
package io.dataease.service.chart.build.time;
import io.dataease.service.chart.build.TimeBuild;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
@Service("timeYearWidget")
public class TimeYearBuild extends TimeBuild {
@Override
public List<Long> dynamicDateFromNow(Map<String, Object> component) {
Boolean isDynamic = false;
Map<String, Object> defaultMap = null;
Map<String, Object> attrs = buildAttrs(component);
Object defaultObject = attrs.get("default");
if (ObjectUtils.isNotEmpty(defaultObject)) {
defaultMap = (Map<String, Object>) defaultObject;
isDynamic = (Boolean) defaultMap.getOrDefault("isDynamic", false);
}
if (ObjectUtils.isEmpty(defaultObject) || !isDynamic) return null;
Calendar now = Calendar.getInstance();
int nowYear = now.get(Calendar.YEAR);
int dkey = (int) Double.parseDouble(defaultMap.get("dkey").toString());
if (dkey == 0) {
now.set(nowYear, 0, 1, 0, 0, 0);
return add2List(now.getTimeInMillis());
}
if (dkey == 1) {
now.set(nowYear - 1, 0, 1, 0, 0, 0);
return add2List(now.getTimeInMillis());
}
if (dkey == 2) {
int dynamicPrefix = (int) Double.parseDouble(defaultMap.get("dynamicPrefix").toString());
String dynamicSuffix = defaultMap.get("dynamicSuffix").toString();
now.set(StringUtils.equals("before", dynamicSuffix) ? (nowYear - dynamicPrefix) : (nowYear + dynamicPrefix), 0, 1, 0, 0, 0);
return add2List(now.getTimeInMillis());
}
return null;
}
}

View File

@ -18,7 +18,7 @@ public class ChartDataBuild {
public static Map<String, Object> transChartDataAntV(List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> yAxis, ChartViewWithBLOBs view, List<String[]> data, boolean isDrill) { public static Map<String, Object> transChartDataAntV(List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> yAxis, ChartViewWithBLOBs view, List<String[]> data, boolean isDrill) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
List<AxisChartDataAntVDTO> datas = new ArrayList<>(); List<AxisChartDataAntVDTO> dataList = new ArrayList<>();
for (int i1 = 0; i1 < data.size(); i1++) { for (int i1 = 0; i1 < data.size(); i1++) {
String[] row = data.get(i1); String[] row = data.get(i1);
@ -65,7 +65,7 @@ public class ChartDataBuild {
} }
axisChartDataDTO.setCategory(yAxis.get(j).getName()); axisChartDataDTO.setCategory(yAxis.get(j).getName());
} }
datas.add(axisChartDataDTO); dataList.add(axisChartDataDTO);
} }
} else { } else {
for (int i = xAxis.size(); i < xAxis.size() + yAxis.size(); i++) { for (int i = xAxis.size(); i < xAxis.size() + yAxis.size(); i++) {
@ -95,18 +95,18 @@ public class ChartDataBuild {
axisChartDataDTO.setValue(new BigDecimal(0)); axisChartDataDTO.setValue(new BigDecimal(0));
} }
axisChartDataDTO.setCategory(yAxis.get(j).getName()); axisChartDataDTO.setCategory(yAxis.get(j).getName());
datas.add(axisChartDataDTO); dataList.add(axisChartDataDTO);
} }
} }
} }
map.put("datas", datas); map.put("data", dataList);
return map; return map;
} }
public static Map<String, Object> transBaseGroupDataAntV(List<ChartViewFieldDTO> xAxisBase, List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> xAxisExt, List<ChartViewFieldDTO> yAxis, ChartViewWithBLOBs view, List<String[]> data, boolean isDrill) { public static Map<String, Object> transBaseGroupDataAntV(List<ChartViewFieldDTO> xAxisBase, List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> xAxisExt, List<ChartViewFieldDTO> yAxis, ChartViewWithBLOBs view, List<String[]> data, boolean isDrill) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
List<AxisChartDataAntVDTO> datas = new ArrayList<>(); List<AxisChartDataAntVDTO> dataList = new ArrayList<>();
for (int i1 = 0; i1 < data.size(); i1++) { for (int i1 = 0; i1 < data.size(); i1++) {
String[] row = data.get(i1); String[] row = data.get(i1);
@ -159,10 +159,10 @@ public class ChartDataBuild {
axisChartDataDTO.setValue(new BigDecimal(0)); axisChartDataDTO.setValue(new BigDecimal(0));
} }
axisChartDataDTO.setCategory(b.toString()); axisChartDataDTO.setCategory(b.toString());
datas.add(axisChartDataDTO); dataList.add(axisChartDataDTO);
} }
} }
map.put("datas", datas); map.put("data", dataList);
return map; return map;
} }
@ -170,7 +170,7 @@ public class ChartDataBuild {
public static Map<String, Object> transStackChartDataAntV(List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> yAxis, ChartViewWithBLOBs view, List<String[]> data, List<ChartViewFieldDTO> extStack, boolean isDrill) { public static Map<String, Object> transStackChartDataAntV(List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> yAxis, ChartViewWithBLOBs view, List<String[]> data, List<ChartViewFieldDTO> extStack, boolean isDrill) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
List<AxisChartDataAntVDTO> datas = new ArrayList<>(); List<AxisChartDataAntVDTO> dataList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(extStack)) { if (CollectionUtils.isNotEmpty(extStack)) {
for (int i1 = 0; i1 < data.size(); i1++) { for (int i1 = 0; i1 < data.size(); i1++) {
@ -219,7 +219,7 @@ public class ChartDataBuild {
axisChartDataDTO.setQuotaList(quotaList); axisChartDataDTO.setQuotaList(quotaList);
axisChartDataDTO.setValue(new BigDecimal(0)); axisChartDataDTO.setValue(new BigDecimal(0));
} }
datas.add(axisChartDataDTO); dataList.add(axisChartDataDTO);
} }
} else { } else {
for (int i1 = 0; i1 < data.size(); i1++) { for (int i1 = 0; i1 < data.size(); i1++) {
@ -265,11 +265,11 @@ public class ChartDataBuild {
axisChartDataDTO.setValue(new BigDecimal(0)); axisChartDataDTO.setValue(new BigDecimal(0));
} }
axisChartDataDTO.setCategory(yAxis.get(j).getName()); axisChartDataDTO.setCategory(yAxis.get(j).getName());
datas.add(axisChartDataDTO); dataList.add(axisChartDataDTO);
} }
} }
} }
map.put("datas", datas); map.put("data", dataList);
return map; return map;
} }
@ -277,7 +277,7 @@ public class ChartDataBuild {
public static Map<String, Object> transScatterDataAntV(List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> yAxis, ChartViewWithBLOBs view, List<String[]> data, List<ChartViewFieldDTO> extBubble, boolean isDrill) { public static Map<String, Object> transScatterDataAntV(List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> yAxis, ChartViewWithBLOBs view, List<String[]> data, List<ChartViewFieldDTO> extBubble, boolean isDrill) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
List<AxisChartDataAntVDTO> datas = new ArrayList<>(); List<AxisChartDataAntVDTO> dataList = new ArrayList<>();
for (int i1 = 0; i1 < data.size(); i1++) { for (int i1 = 0; i1 < data.size(); i1++) {
String[] row = data.get(i1); String[] row = data.get(i1);
@ -329,10 +329,10 @@ public class ChartDataBuild {
axisChartDataDTO.setPopSize(new BigDecimal(0)); axisChartDataDTO.setPopSize(new BigDecimal(0));
} }
} }
datas.add(axisChartDataDTO); dataList.add(axisChartDataDTO);
} }
} }
map.put("datas", datas); map.put("data", dataList);
return map; return map;
} }
@ -340,7 +340,7 @@ public class ChartDataBuild {
public static Map<String, Object> transRadarChartDataAntV(List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> yAxis, ChartViewWithBLOBs view, List<String[]> data, boolean isDrill) { public static Map<String, Object> transRadarChartDataAntV(List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> yAxis, ChartViewWithBLOBs view, List<String[]> data, boolean isDrill) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
List<AxisChartDataAntVDTO> datas = new ArrayList<>(); List<AxisChartDataAntVDTO> dataList = new ArrayList<>();
for (int i1 = 0; i1 < data.size(); i1++) { for (int i1 = 0; i1 < data.size(); i1++) {
String[] row = data.get(i1); String[] row = data.get(i1);
@ -384,10 +384,10 @@ public class ChartDataBuild {
axisChartDataDTO.setValue(new BigDecimal(0)); axisChartDataDTO.setValue(new BigDecimal(0));
} }
axisChartDataDTO.setCategory(yAxis.get(j).getName()); axisChartDataDTO.setCategory(yAxis.get(j).getName());
datas.add(axisChartDataDTO); dataList.add(axisChartDataDTO);
} }
} }
map.put("datas", datas); map.put("data", dataList);
return map; return map;
} }
@ -450,7 +450,7 @@ public class ChartDataBuild {
} }
} }
map.put("datas", series); map.put("data", series);
return map; return map;
} }

View File

@ -510,7 +510,7 @@ public class DataSetTableService {
DatasourceRequest datasourceRequest = new DatasourceRequest(); DatasourceRequest datasourceRequest = new DatasourceRequest();
datasourceRequest.setDatasource(ds); datasourceRequest.setDatasource(ds);
datasourceRequest.setTable(new Gson().fromJson(datasetTable.getInfo(), DataTableInfoDTO.class).getTable()); datasourceRequest.setTable(new Gson().fromJson(datasetTable.getInfo(), DataTableInfoDTO.class).getTable());
return datasourceProvider.getTableFileds(datasourceRequest); return datasourceProvider.getTableFields(datasourceRequest);
} }
public Map<String, List<DatasetTableField>> getFieldsFromDE(DataSetTableRequest dataSetTableRequest) public Map<String, List<DatasetTableField>> getFieldsFromDE(DataSetTableRequest dataSetTableRequest)
@ -519,7 +519,7 @@ public class DataSetTableService {
datasetTableField.setTableId(dataSetTableRequest.getId()); datasetTableField.setTableId(dataSetTableRequest.getId());
datasetTableField.setChecked(Boolean.TRUE); datasetTableField.setChecked(Boolean.TRUE);
List<DatasetTableField> fields = dataSetTableFieldsService.list(datasetTableField); List<DatasetTableField> fields = dataSetTableFieldsService.list(datasetTableField);
fields = permissionService.filterColumnPermissons(fields, new ArrayList<>(), dataSetTableRequest.getId(), null); fields = permissionService.filterColumnPermissions(fields, new ArrayList<>(), dataSetTableRequest.getId(), null);
List<DatasetTableField> dimension = new ArrayList<>(); List<DatasetTableField> dimension = new ArrayList<>();
List<DatasetTableField> quota = new ArrayList<>(); List<DatasetTableField> quota = new ArrayList<>();
@ -556,7 +556,7 @@ public class DataSetTableService {
public Map<String, Object> getPreviewData(DataSetTableRequest dataSetTableRequest, Integer page, Integer pageSize, public Map<String, Object> getPreviewData(DataSetTableRequest dataSetTableRequest, Integer page, Integer pageSize,
List<DatasetTableField> extFields) throws Exception { List<DatasetTableField> extFields) throws Exception {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
String sycnStatus = ""; String syncStatus = "";
DatasetTableField datasetTableField = DatasetTableField.builder().tableId(dataSetTableRequest.getId()) DatasetTableField datasetTableField = DatasetTableField.builder().tableId(dataSetTableRequest.getId())
.checked(Boolean.TRUE).build(); .checked(Boolean.TRUE).build();
List<DatasetTableField> fields = dataSetTableFieldsService.list(datasetTableField); List<DatasetTableField> fields = dataSetTableFieldsService.list(datasetTableField);
@ -574,7 +574,7 @@ public class DataSetTableService {
List<DataSetRowPermissionsTreeDTO> rowPermissionsTree = permissionsTreeService.getRowPermissionsTree(fields, datasetTable, null); List<DataSetRowPermissionsTreeDTO> rowPermissionsTree = permissionsTreeService.getRowPermissionsTree(fields, datasetTable, null);
// 列权限 // 列权限
List<String> desensitizationList = new ArrayList<>(); List<String> desensitizationList = new ArrayList<>();
fields = permissionService.filterColumnPermissons(fields, desensitizationList, datasetTable.getId(), null); fields = permissionService.filterColumnPermissions(fields, desensitizationList, datasetTable.getId(), null);
if (CollectionUtils.isEmpty(fields)) { if (CollectionUtils.isEmpty(fields)) {
map.put("fields", fields); map.put("fields", fields);
map.put("data", new ArrayList<>()); map.put("data", new ArrayList<>());
@ -783,7 +783,7 @@ public class DataSetTableService {
List<DataSetTaskLogDTO> dataSetTaskLogDTOS = dataSetTableTaskLogService.listTaskLog(request, "excel"); List<DataSetTaskLogDTO> dataSetTaskLogDTOS = dataSetTableTaskLogService.listTaskLog(request, "excel");
if (CollectionUtils.isNotEmpty(dataSetTaskLogDTOS)) { if (CollectionUtils.isNotEmpty(dataSetTaskLogDTOS)) {
dataSetTaskLogDTOS.get(0).getStatus().equalsIgnoreCase(JobStatus.Underway.name()); dataSetTaskLogDTOS.get(0).getStatus().equalsIgnoreCase(JobStatus.Underway.name());
sycnStatus = dataSetTaskLogDTOS.get(0).getStatus(); syncStatus = dataSetTaskLogDTOS.get(0).getStatus();
} }
} else if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "custom")) { } else if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "custom")) {
@ -951,7 +951,7 @@ public class DataSetTableService {
map.put("fields", fields); map.put("fields", fields);
map.put("data", jsonArray); map.put("data", jsonArray);
map.put("page", dataSetPreviewPage); map.put("page", dataSetPreviewPage);
map.put("sycnStatus", sycnStatus); map.put("syncStatus", syncStatus);
return map; return map;
} }
@ -1109,7 +1109,7 @@ public class DataSetTableService {
binaryExpression = (BinaryExpression) expr; binaryExpression = (BinaryExpression) expr;
} catch (Exception e) { } catch (Exception e) {
} }
if (binaryExpression != null && !(binaryExpression.getLeftExpression() instanceof BinaryExpression) && !(binaryExpression.getRightExpression() instanceof BinaryExpression) && hasVarible(binaryExpression.toString())) { if (binaryExpression != null && !(binaryExpression.getLeftExpression() instanceof BinaryExpression) && !(binaryExpression.getRightExpression() instanceof BinaryExpression) && hasVariable(binaryExpression.toString())) {
stringBuilder.append(SubstitutedSql); stringBuilder.append(SubstitutedSql);
} else { } else {
expr.accept(getExpressionDeParser(stringBuilder)); expr.accept(getExpressionDeParser(stringBuilder));
@ -2112,7 +2112,7 @@ public class DataSetTableService {
return o1.getColumnIndex().compareTo(o2.getColumnIndex()); return o1.getColumnIndex().compareTo(o2.getColumnIndex());
}); });
List<String> originNameFileds = datasetTableFields.stream().map(DatasetTableField::getOriginName) List<String> originNameFields = datasetTableFields.stream().map(DatasetTableField::getOriginName)
.collect(Collectors.toList()); .collect(Collectors.toList());
Datasource ds = datasourceMapper.selectByPrimaryKey(datasetTable.getDataSourceId()); Datasource ds = datasourceMapper.selectByPrimaryKey(datasetTable.getDataSourceId());
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType()); QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());
@ -2125,18 +2125,18 @@ public class DataSetTableService {
.replace(lastUpdateTime, Long.valueOf(System.currentTimeMillis()).toString()) .replace(lastUpdateTime, Long.valueOf(System.currentTimeMillis()).toString())
.replace(currentUpdateTime, Long.valueOf(System.currentTimeMillis()).toString()); .replace(currentUpdateTime, Long.valueOf(System.currentTimeMillis()).toString());
datasourceRequest.setQuery(qp.wrapSql(sql)); datasourceRequest.setQuery(qp.wrapSql(sql));
List<String> sqlFileds = new ArrayList<>(); List<String> sqlFields = new ArrayList<>();
try { try {
datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableField::getFieldName) datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableField::getFieldName)
.forEach(field -> { .forEach(field -> {
sqlFileds.add(field); sqlFields.add(field);
}); });
} catch (Exception e) { } catch (Exception e) {
DataEaseException.throwException(Translator.get("i18n_check_sql_error") + e.getMessage()); DataEaseException.throwException(Translator.get("i18n_check_sql_error") + e.getMessage());
} }
if (!originNameFileds.equals(sqlFileds)) { if (!originNameFields.equals(sqlFields)) {
DataEaseException.throwException(Translator.get("i18n_sql_add_not_matching") + sqlFileds.toString()); DataEaseException.throwException(Translator.get("i18n_sql_add_not_matching") + sqlFields.toString());
} }
} }
if (StringUtils.isNotEmpty(datasetTableIncrementalConfig.getIncrementalDelete()) if (StringUtils.isNotEmpty(datasetTableIncrementalConfig.getIncrementalDelete())
@ -2145,16 +2145,16 @@ public class DataSetTableService {
.replace(lastUpdateTime, Long.valueOf(System.currentTimeMillis()).toString()) .replace(lastUpdateTime, Long.valueOf(System.currentTimeMillis()).toString())
.replace(currentUpdateTime, Long.valueOf(System.currentTimeMillis()).toString()); .replace(currentUpdateTime, Long.valueOf(System.currentTimeMillis()).toString());
datasourceRequest.setQuery(qp.wrapSql(sql)); datasourceRequest.setQuery(qp.wrapSql(sql));
List<String> sqlFileds = new ArrayList<>(); List<String> sqlFields = new ArrayList<>();
try { try {
datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableField::getFieldName) datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableField::getFieldName)
.forEach(field -> sqlFileds.add(field)); .forEach(field -> sqlFields.add(field));
} catch (Exception e) { } catch (Exception e) {
DataEaseException.throwException(Translator.get("i18n_check_sql_error") + e.getMessage()); DataEaseException.throwException(Translator.get("i18n_check_sql_error") + e.getMessage());
} }
if (!originNameFileds.equals(sqlFileds)) { if (!originNameFields.equals(sqlFields)) {
DataEaseException.throwException(Translator.get("i18n_sql_delete_not_matching") + sqlFileds.toString()); DataEaseException.throwException(Translator.get("i18n_sql_delete_not_matching") + sqlFields.toString());
} }
} }
} }
@ -2218,7 +2218,7 @@ public class DataSetTableService {
String filename = file.getOriginalFilename(); String filename = file.getOriginalFilename();
// parse file // parse file
List<ExcelSheetData> excelSheetDataList = parseExcel(filename, file.getInputStream(), true); List<ExcelSheetData> excelSheetDataList = parseExcel(filename, file.getInputStream(), true);
List<ExcelSheetData> retrunSheetDataList = new ArrayList<>(); List<ExcelSheetData> returnSheetDataList = new ArrayList<>();
if (StringUtils.isNotEmpty(tableId)) { if (StringUtils.isNotEmpty(tableId)) {
List<DatasetTableField> fields = dataSetTableFieldsService.getFieldsByTableId(tableId); List<DatasetTableField> fields = dataSetTableFieldsService.getFieldsByTableId(tableId);
@ -2240,10 +2240,10 @@ public class DataSetTableService {
List<TableField> tableFields = excelSheetData.getFields(); List<TableField> tableFields = excelSheetData.getFields();
List<String> newFields = tableFields.stream().map(TableField::getRemarks).collect(Collectors.toList()); List<String> newFields = tableFields.stream().map(TableField::getRemarks).collect(Collectors.toList());
if (oldFields.equals(newFields)) { if (oldFields.equals(newFields)) {
retrunSheetDataList.add(excelSheetData); returnSheetDataList.add(excelSheetData);
} }
} }
if (retrunSheetDataList.size() == 0) { if (returnSheetDataList.size() == 0) {
DataEaseException.throwException(Translator.get("i18n_excel_column_change")); DataEaseException.throwException(Translator.get("i18n_excel_column_change"));
} }
} else { } else {
@ -2278,41 +2278,41 @@ public class DataSetTableService {
} }
excelSheetData.setEffectExtField(effectExtField); excelSheetData.setEffectExtField(effectExtField);
retrunSheetDataList.add(excelSheetData); returnSheetDataList.add(excelSheetData);
} }
if (retrunSheetDataList.size() == 0) { if (returnSheetDataList.size() == 0) {
DataEaseException.throwException(Translator.get("i18n_excel_column_change")); DataEaseException.throwException(Translator.get("i18n_excel_column_change"));
} }
} }
} else { } else {
retrunSheetDataList = excelSheetDataList; returnSheetDataList = excelSheetDataList;
} }
retrunSheetDataList = retrunSheetDataList.stream() returnSheetDataList = returnSheetDataList.stream()
.filter(excelSheetData -> CollectionUtils.isNotEmpty(excelSheetData.getFields())) .filter(excelSheetData -> CollectionUtils.isNotEmpty(excelSheetData.getFields()))
.collect(Collectors.toList()); .collect(Collectors.toList());
// save file // save file
String excelId = UUID.randomUUID().toString(); String excelId = UUID.randomUUID().toString();
String filePath = saveFile(file, excelId); String filePath = saveFile(file, excelId);
ExcelFileData excelFileData = new ExcelFileData(); ExcelFileData excelFileData = new ExcelFileData();
excelFileData.setExcelLable(filename); excelFileData.setExcelLabel(filename);
excelFileData.setId(excelId); excelFileData.setId(excelId);
excelFileData.setPath(filePath); excelFileData.setPath(filePath);
filename = filename.substring(0, filename.lastIndexOf('.')); filename = filename.substring(0, filename.lastIndexOf('.'));
if (retrunSheetDataList.size() == 1) { if (returnSheetDataList.size() == 1) {
retrunSheetDataList.get(0).setDatasetName(filename); returnSheetDataList.get(0).setDatasetName(filename);
retrunSheetDataList.get(0).setSheetExcelId(excelId); returnSheetDataList.get(0).setSheetExcelId(excelId);
retrunSheetDataList.get(0).setId(UUID.randomUUID().toString()); returnSheetDataList.get(0).setId(UUID.randomUUID().toString());
retrunSheetDataList.get(0).setPath(filePath); returnSheetDataList.get(0).setPath(filePath);
} else { } else {
for (ExcelSheetData excelSheetData : retrunSheetDataList) { for (ExcelSheetData excelSheetData : returnSheetDataList) {
excelSheetData.setDatasetName(filename + "-" + excelSheetData.getExcelLable()); excelSheetData.setDatasetName(filename + "-" + excelSheetData.getExcelLabel());
excelSheetData.setSheetExcelId(excelId); excelSheetData.setSheetExcelId(excelId);
excelSheetData.setId(UUID.randomUUID().toString()); excelSheetData.setId(UUID.randomUUID().toString());
excelSheetData.setPath(filePath); excelSheetData.setPath(filePath);
} }
} }
excelFileData.setSheets(retrunSheetDataList); excelFileData.setSheets(returnSheetDataList);
return excelFileData; return excelFileData;
} }
@ -2359,7 +2359,7 @@ public class DataSetTableService {
String[] fieldArray = fields.stream().map(TableField::getFieldName).toArray(String[]::new); String[] fieldArray = fields.stream().map(TableField::getFieldName).toArray(String[]::new);
excelSheetData.setFields(fields); excelSheetData.setFields(fields);
excelSheetData.setData(data); excelSheetData.setData(data);
excelSheetData.setExcelLable(filename); excelSheetData.setExcelLabel(filename);
excelSheetData.setFieldsMd5(Md5Utils.md5(StringUtils.join(fieldArray, ","))); excelSheetData.setFieldsMd5(Md5Utils.md5(StringUtils.join(fieldArray, ",")));
excelSheetDataList.add(excelSheetData); excelSheetDataList.add(excelSheetData);
} }
@ -2644,7 +2644,7 @@ public class DataSetTableService {
@Override @Override
public void visit(Between between) { public void visit(Between between) {
if (hasVarible(between.getBetweenExpressionStart().toString()) || hasVarible(between.getBetweenExpressionEnd().toString())) { if (hasVariable(between.getBetweenExpressionStart().toString()) || hasVariable(between.getBetweenExpressionEnd().toString())) {
getBuffer().append(SubstitutedSql); getBuffer().append(SubstitutedSql);
} else { } else {
getBuffer().append(between.getLeftExpression()).append(" BETWEEN ").append(between.getBetweenExpressionStart()).append(" AND ").append(between.getBetweenExpressionEnd()); getBuffer().append(between.getLeftExpression()).append(" BETWEEN ").append(between.getBetweenExpressionStart()).append(" AND ").append(between.getBetweenExpressionEnd());
@ -2653,7 +2653,7 @@ public class DataSetTableService {
@Override @Override
public void visit(MinorThan minorThan) { public void visit(MinorThan minorThan) {
if (hasVarible(minorThan.getLeftExpression().toString()) || hasVarible(minorThan.getRightExpression().toString())) { if (hasVariable(minorThan.getLeftExpression().toString()) || hasVariable(minorThan.getRightExpression().toString())) {
getBuffer().append(SubstitutedSql); getBuffer().append(SubstitutedSql);
return; return;
} }
@ -2664,7 +2664,7 @@ public class DataSetTableService {
@Override @Override
public void visit(MinorThanEquals minorThan) { public void visit(MinorThanEquals minorThan) {
if (hasVarible(minorThan.getLeftExpression().toString()) || hasVarible(minorThan.getRightExpression().toString())) { if (hasVariable(minorThan.getLeftExpression().toString()) || hasVariable(minorThan.getRightExpression().toString())) {
getBuffer().append(SubstitutedSql); getBuffer().append(SubstitutedSql);
return; return;
} }
@ -2675,7 +2675,7 @@ public class DataSetTableService {
@Override @Override
public void visit(GreaterThanEquals minorThan) { public void visit(GreaterThanEquals minorThan) {
if (hasVarible(minorThan.getLeftExpression().toString()) || hasVarible(minorThan.getRightExpression().toString())) { if (hasVariable(minorThan.getLeftExpression().toString()) || hasVariable(minorThan.getRightExpression().toString())) {
getBuffer().append(SubstitutedSql); getBuffer().append(SubstitutedSql);
return; return;
} }
@ -2686,7 +2686,7 @@ public class DataSetTableService {
@Override @Override
public void visit(GreaterThan greaterThan) { public void visit(GreaterThan greaterThan) {
if (hasVarible(greaterThan.getLeftExpression().toString()) || hasVarible(greaterThan.getRightExpression().toString())) { if (hasVariable(greaterThan.getLeftExpression().toString()) || hasVariable(greaterThan.getRightExpression().toString())) {
getBuffer().append(SubstitutedSql); getBuffer().append(SubstitutedSql);
return; return;
} }
@ -2708,7 +2708,7 @@ public class DataSetTableService {
@Override @Override
public void visit(LikeExpression likeExpression) { public void visit(LikeExpression likeExpression) {
if (hasVarible(likeExpression.toString())) { if (hasVariable(likeExpression.toString())) {
getBuffer().append(SubstitutedSql); getBuffer().append(SubstitutedSql);
return; return;
} }
@ -2723,7 +2723,7 @@ public class DataSetTableService {
@Override @Override
public void visit(InExpression inExpression) { public void visit(InExpression inExpression) {
if (inExpression.getRightItemsList() != null && hasVarible(inExpression.getRightItemsList().toString())) { if (inExpression.getRightItemsList() != null && hasVariable(inExpression.getRightItemsList().toString())) {
stringBuilder.append(SubstitutedSql); stringBuilder.append(SubstitutedSql);
return; return;
} }
@ -2752,7 +2752,7 @@ public class DataSetTableService {
public void visit(SubSelect subSelect) { public void visit(SubSelect subSelect) {
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
Expression in = ((PlainSelect) subSelect.getSelectBody()).getWhere(); Expression in = ((PlainSelect) subSelect.getSelectBody()).getWhere();
if (in instanceof BinaryExpression && hasVarible(in.toString())) { if (in instanceof BinaryExpression && hasVariable(in.toString())) {
stringBuilder.append(SubstitutedParams); stringBuilder.append(SubstitutedParams);
} else { } else {
in.accept(getExpressionDeParser(stringBuilder)); in.accept(getExpressionDeParser(stringBuilder));
@ -2777,7 +2777,7 @@ public class DataSetTableService {
e.printStackTrace(); e.printStackTrace();
} }
if (expr.getLeftExpression() instanceof BinaryExpression && !hasSubBinaryExpression && hasVarible(expr.getLeftExpression().toString())) { if (expr.getLeftExpression() instanceof BinaryExpression && !hasSubBinaryExpression && hasVariable(expr.getLeftExpression().toString())) {
getBuffer().append(SubstitutedSql); getBuffer().append(SubstitutedSql);
} else { } else {
expr.getLeftExpression().accept(this); expr.getLeftExpression().accept(this);
@ -2791,7 +2791,7 @@ public class DataSetTableService {
} catch (Exception e) { } catch (Exception e) {
} }
if (expr.getRightExpression() instanceof BinaryExpression && !hasSubBinaryExpression && hasVarible(expr.getRightExpression().toString())) { if (expr.getRightExpression() instanceof BinaryExpression && !hasSubBinaryExpression && hasVariable(expr.getRightExpression().toString())) {
getBuffer().append(SubstitutedSql); getBuffer().append(SubstitutedSql);
} else { } else {
expr.getRightExpression().accept(this); expr.getRightExpression().accept(this);
@ -2801,7 +2801,7 @@ public class DataSetTableService {
return expressionDeParser; return expressionDeParser;
} }
static private boolean hasVarible(String sql) { static private boolean hasVariable(String sql) {
return sql.contains(SubstitutedParams); return sql.contains(SubstitutedParams);
} }

View File

@ -99,7 +99,7 @@ public class ExtractDataService {
private static final String lastUpdateTime = "${__last_update_time__}"; private static final String lastUpdateTime = "${__last_update_time__}";
private static final String currentUpdateTime = "${__current_update_time__}"; private static final String currentUpdateTime = "${__current_update_time__}";
private static final String separator = "|DE|"; private static final String separator = "|DE|";
private static final String extention = "txt"; private static final String extension = "txt";
private static final String root_path = "/opt/dataease/data/kettle/"; private static final String root_path = "/opt/dataease/data/kettle/";
@Value("${kettle.files.keep:false}") @Value("${kettle.files.keep:false}")
@ -471,11 +471,11 @@ public class ExtractDataService {
} }
switch (extractType) { switch (extractType) {
case "all_scope": case "all_scope":
dataFile = root_path + TableUtils.tmpName(TableUtils.tableName(datasetTable.getId())) + "." + extention; dataFile = root_path + TableUtils.tmpName(TableUtils.tableName(datasetTable.getId())) + "." + extension;
script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), System.currentTimeMillis(), separator, columns, "APPEND", dataFile, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tmpName(TableUtils.tableName(datasetTable.getId())), dataFile); script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), System.currentTimeMillis(), separator, columns, "APPEND", dataFile, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tmpName(TableUtils.tableName(datasetTable.getId())), dataFile);
break; break;
default: default:
dataFile = root_path + TableUtils.addName(TableUtils.tableName(datasetTable.getId())) + "." + extention; dataFile = root_path + TableUtils.addName(TableUtils.tableName(datasetTable.getId())) + "." + extension;
script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), System.currentTimeMillis(), separator, columns, "APPEND", dataFile, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tableName(datasetTable.getId()), dataFile); script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), System.currentTimeMillis(), separator, columns, "APPEND", dataFile, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tableName(datasetTable.getId()), dataFile);
break; break;
} }
@ -722,7 +722,7 @@ public class ExtractDataService {
} }
for (ExcelSheetData sheet : totalSheets) { for (ExcelSheetData sheet : totalSheets) {
if (sheet.getExcelLable().equalsIgnoreCase(excelSheetData.getExcelLable())) { if (sheet.getExcelLabel().equalsIgnoreCase(excelSheetData.getExcelLabel())) {
for (List<String> dataItem : sheet.getData()) { for (List<String> dataItem : sheet.getData()) {
if (dataItem.size() > 0) { if (dataItem.size() > 0) {
data.add(dataItem.toArray(new String[dataItem.size()])); data.add(dataItem.toArray(new String[dataItem.size()]));
@ -820,16 +820,16 @@ public class ExtractDataService {
case "all_scope": case "all_scope":
outFile = TableUtils.tmpName(TableUtils.tableName(datasetTable.getId())); outFile = TableUtils.tmpName(TableUtils.tableName(datasetTable.getId()));
jobName = "job_" + TableUtils.tableName(datasetTable.getId()); jobName = "job_" + TableUtils.tableName(datasetTable.getId());
script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), datasetTable.getId() + System.currentTimeMillis(), separator, columns, "APPEND", root_path + outFile + "." + extention, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tmpName(TableUtils.tableName(datasetTable.getId())), root_path + outFile + "." + extention); script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), datasetTable.getId() + System.currentTimeMillis(), separator, columns, "APPEND", root_path + outFile + "." + extension, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tmpName(TableUtils.tableName(datasetTable.getId())), root_path + outFile + "." + extension);
break; break;
case "incremental_add": case "incremental_add":
outFile = TableUtils.addName(datasetTable.getId()); outFile = TableUtils.addName(datasetTable.getId());
jobName = "job_add_" + TableUtils.tableName(datasetTable.getId()); jobName = "job_add_" + TableUtils.tableName(datasetTable.getId());
script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), datasetTable.getId() + System.currentTimeMillis(), separator, columns, "APPEND", root_path + outFile + "." + extention, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tableName(datasetTable.getId()), root_path + outFile + "." + extention); script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), datasetTable.getId() + System.currentTimeMillis(), separator, columns, "APPEND", root_path + outFile + "." + extension, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tableName(datasetTable.getId()), root_path + outFile + "." + extension);
break; break;
case "incremental_delete": case "incremental_delete":
outFile = TableUtils.deleteName(TableUtils.tableName(datasetTable.getId())); outFile = TableUtils.deleteName(TableUtils.tableName(datasetTable.getId()));
script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), datasetTable.getId() + System.currentTimeMillis(), separator, columns, "DELETE", root_path + outFile + "." + extention, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tableName(datasetTable.getId()), root_path + outFile + "." + extention); script = String.format(streamLoadScript, dorisConfiguration.getUsername(), dorisConfiguration.getPassword(), datasetTable.getId() + System.currentTimeMillis(), separator, columns, "DELETE", root_path + outFile + "." + extension, dorisConfiguration.getHost(), dorisConfiguration.getHttpPort(), dorisConfiguration.getDataBase(), TableUtils.tableName(datasetTable.getId()), root_path + outFile + "." + extension);
jobName = "job_delete_" + TableUtils.tableName(datasetTable.getId()); jobName = "job_delete_" + TableUtils.tableName(datasetTable.getId());
break; break;
default: default:
@ -1098,7 +1098,7 @@ public class ExtractDataService {
filesRequired.add("Y"); filesRequired.add("Y");
ExcelInputMeta excelInputMeta = new ExcelInputMeta(); ExcelInputMeta excelInputMeta = new ExcelInputMeta();
sheetNames.add(excelSheetData.getExcelLable()); sheetNames.add(excelSheetData.getExcelLabel());
if (StringUtils.equalsIgnoreCase(suffix, "xlsx")) { if (StringUtils.equalsIgnoreCase(suffix, "xlsx")) {
excelInputMeta.setSpreadSheetType(SpreadSheetType.SAX_POI); excelInputMeta.setSpreadSheetType(SpreadSheetType.SAX_POI);
excelInputMeta.setSheetName(sheetNames.toArray(new String[sheetNames.size()])); excelInputMeta.setSheetName(sheetNames.toArray(new String[sheetNames.size()]));
@ -1141,7 +1141,7 @@ public class ExtractDataService {
textFileOutputMeta.setHeaderEnabled(false); textFileOutputMeta.setHeaderEnabled(false);
textFileOutputMeta.setFilename(root_path + dorisOutputTable); textFileOutputMeta.setFilename(root_path + dorisOutputTable);
textFileOutputMeta.setSeparator(separator); textFileOutputMeta.setSeparator(separator);
textFileOutputMeta.setExtension(extention); textFileOutputMeta.setExtension(extension);
if (datasource.getType().equalsIgnoreCase(DatasourceTypes.oracle.name())) { if (datasource.getType().equalsIgnoreCase(DatasourceTypes.oracle.name())) {
TextFileField[] outputFields = new TextFileField[datasetTableFields.size() + 1]; TextFileField[] outputFields = new TextFileField[datasetTableFields.size() + 1];
@ -1295,7 +1295,7 @@ public class ExtractDataService {
default: default:
break; break;
} }
deleteFile(root_path + fileName + "." + extention); deleteFile(root_path + fileName + "." + extension);
deleteFile(root_path + jobName + ".kjb"); deleteFile(root_path + jobName + ".kjb");
deleteFile(root_path + transName + ".ktr"); deleteFile(root_path + transName + ".ktr");
} }
@ -1388,8 +1388,8 @@ public class ExtractDataService {
" r = createOutputRow(r, data.outputRowMeta.size());\n" + " r = createOutputRow(r, data.outputRowMeta.size());\n" +
" String str = \"\";\n" + " String str = \"\";\n" +
"\n" + "\n" +
" List<String> fileds = Arrays.asList(\"Column_Fields\".split(\",\"));\n" + " List<String> fields = Arrays.asList(\"Column_Fields\".split(\",\"));\n" +
" for (String filed : fileds) {\n" + " for (String filed : fields) {\n" +
" String tmp = get(Fields.In, filed).getString(r);\n" + " String tmp = get(Fields.In, filed).getString(r);\n" +
"handleCharset \n" + "handleCharset \n" +
"handleWraps \n" + "handleWraps \n" +

View File

@ -73,7 +73,7 @@ public class PermissionService {
return customFilter; return customFilter;
} }
public List<DatasetTableField> filterColumnPermissons(List<DatasetTableField> fields, List<String> desensitizationList, String datasetTableId, Long user){ public List<DatasetTableField> filterColumnPermissions(List<DatasetTableField> fields, List<String> desensitizationList, String datasetTableId, Long user){
List<DatasetTableField> result = new ArrayList<>(); List<DatasetTableField> result = new ArrayList<>();
List<ColumnPermissionItem> allColumnPermissionItems = new ArrayList<>(); List<ColumnPermissionItem> allColumnPermissionItems = new ArrayList<>();
for (DataSetColumnPermissionsDTO dataSetColumnPermissionsDTO : columnPermissions(datasetTableId, user)) { for (DataSetColumnPermissionsDTO dataSetColumnPermissionsDTO : columnPermissions(datasetTableId, user)) {

View File

@ -104,7 +104,7 @@ public class DirectFieldService implements DataSetFieldService {
if (userPermissions) { if (userPermissions) {
//列权限 //列权限
List<String> desensitizationList = new ArrayList<>(); List<String> desensitizationList = new ArrayList<>();
fields = permissionService.filterColumnPermissons(fields, desensitizationList, datasetTable.getId(), userId); fields = permissionService.filterColumnPermissions(fields, desensitizationList, datasetTable.getId(), userId);
Map<String, DatasetTableField> fieldMap = fields.stream().collect(Collectors.toMap(DatasetTableField::getId, node -> node)); Map<String, DatasetTableField> fieldMap = fields.stream().collect(Collectors.toMap(DatasetTableField::getId, node -> node));
permissionFields = fieldIds.stream().map(fieldMap::get).collect(Collectors.toList()); permissionFields = fieldIds.stream().map(fieldMap::get).collect(Collectors.toList());
if (CollectionUtils.isEmpty(permissionFields) || permissionFields.get(0) == null) { if (CollectionUtils.isEmpty(permissionFields) || permissionFields.get(0) == null) {

View File

@ -87,7 +87,7 @@ public class SysMsgService {
return sysMsgMapper.countByExample(example); return sysMsgMapper.countByExample(example);
} }
public void setReaded(Long msgId) { public void setRead(Long msgId) {
SysMsg sysMsg = new SysMsg(); SysMsg sysMsg = new SysMsg();
sysMsg.setMsgId(msgId); sysMsg.setMsgId(msgId);
sysMsg.setStatus(true); sysMsg.setStatus(true);
@ -95,7 +95,7 @@ public class SysMsgService {
sysMsgMapper.updateByPrimaryKeySelective(sysMsg); sysMsgMapper.updateByPrimaryKeySelective(sysMsg);
} }
public void setBatchReaded(List<Long> msgIds) { public void setBatchRead(List<Long> msgIds) {
extSysMsgMapper.batchStatus(msgIds, System.currentTimeMillis()); extSysMsgMapper.batchStatus(msgIds, System.currentTimeMillis());
} }

View File

@ -120,18 +120,18 @@ public class PanelAppTemplateService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Map<String, String> applyDatasource(List<Datasource> oldDatasourceList, List<Datasource> newDatasourceList) throws Exception { public Map<String, String> applyDatasource(List<Datasource> oldDatasourceList, List<Datasource> newDatasourceList) throws Exception {
Map<String, String> datasourceRelaMap = new HashMap<>(); Map<String, String> datasourceRealMap = new HashMap<>();
for (int i = 0; i < newDatasourceList.size(); i++) { for (int i = 0; i < newDatasourceList.size(); i++) {
Datasource datasource = newDatasourceList.get(0); Datasource datasource = newDatasourceList.get(0);
datasource.setId(null); datasource.setId(null);
Datasource newDatasource = datasourceService.addDatasource(datasource); Datasource newDatasource = datasourceService.addDatasource(datasource);
datasourceRelaMap.put(oldDatasourceList.get(i).getId(), newDatasource.getId()); datasourceRealMap.put(oldDatasourceList.get(i).getId(), newDatasource.getId());
} }
return datasourceRelaMap; return datasourceRealMap;
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void applyPanelView(List<PanelView> panelViewsInfo, Map<String, String> chartViewsRelaMap, String panelId) { public void applyPanelView(List<PanelView> panelViewsInfo, Map<String, String> chartViewsRealMap, String panelId) {
Long time = System.currentTimeMillis(); Long time = System.currentTimeMillis();
String userName = AuthUtils.getUser().getUsername(); String userName = AuthUtils.getUser().getUsername();
panelViewsInfo.forEach(panelView -> { panelViewsInfo.forEach(panelView -> {
@ -139,13 +139,13 @@ public class PanelAppTemplateService {
panelView.setPanelId(panelId); panelView.setPanelId(panelId);
panelView.setCreateTime(time); panelView.setCreateTime(time);
panelView.setCreateBy(userName); panelView.setCreateBy(userName);
panelView.setChartViewId(chartViewsRelaMap.get(panelView.getChartViewId())); panelView.setChartViewId(chartViewsRealMap.get(panelView.getChartViewId()));
panelViewService.save(panelView); panelViewService.save(panelView);
}); });
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String applyPanel(PanelGroupRequest panelInfo, Map<String, String> chartViewsRelaMap, String newPanelId, String panelName, String pid) { public String applyPanel(PanelGroupRequest panelInfo, Map<String, String> chartViewsRealMap, String newPanelId, String panelName, String pid) {
panelInfo.setId(newPanelId); panelInfo.setId(newPanelId);
panelInfo.setPid(pid); panelInfo.setPid(pid);
panelInfo.setName(panelName); panelInfo.setName(panelName);
@ -153,48 +153,48 @@ public class PanelAppTemplateService {
panelInfo.setPanelType("self"); panelInfo.setPanelType("self");
panelInfo.setCreateBy(AuthUtils.getUser().getUsername()); panelInfo.setCreateBy(AuthUtils.getUser().getUsername());
panelInfo.setCreateTime(System.currentTimeMillis()); panelInfo.setCreateTime(System.currentTimeMillis());
panelGroupService.newPanelFromApp(panelInfo, chartViewsRelaMap); panelGroupService.newPanelFromApp(panelInfo, chartViewsRealMap);
return newPanelId; return newPanelId;
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Map<String, String> applyDataset(List<DatasetTable> datasetTablesInfo, Map<String, String> datasourceRelaMap, String sceneId) throws Exception { public Map<String, String> applyDataset(List<DatasetTable> datasetTablesInfo, Map<String, String> datasourceRealMap, String sceneId) throws Exception {
Map<String, String> datasetsRelaMap = new HashMap<>(); Map<String, String> datasetsRealMap = new HashMap<>();
for (DatasetTable datasetTable : datasetTablesInfo) { for (DatasetTable datasetTable : datasetTablesInfo) {
String oldId = datasetTable.getId(); String oldId = datasetTable.getId();
datasetTable.setId(null); datasetTable.setId(null);
datasetTable.setSceneId(sceneId); datasetTable.setSceneId(sceneId);
datasetTable.setDataSourceId(datasourceRelaMap.get(datasetTable.getDataSourceId())); datasetTable.setDataSourceId(datasourceRealMap.get(datasetTable.getDataSourceId()));
DataSetTableRequest datasetRequest = new DataSetTableRequest(); DataSetTableRequest datasetRequest = new DataSetTableRequest();
BeanUtils.copyBean(datasetRequest, datasetTable); BeanUtils.copyBean(datasetRequest, datasetTable);
datasetRequest.setOptFrom("appApply"); datasetRequest.setOptFrom("appApply");
datasetRequest.setSyncType("sync_now"); datasetRequest.setSyncType("sync_now");
DatasetTable newDataset = dataSetTableService.save(datasetRequest); DatasetTable newDataset = dataSetTableService.save(datasetRequest);
datasetsRelaMap.put(oldId, newDataset.getId()); datasetsRealMap.put(oldId, newDataset.getId());
} }
return datasetsRelaMap; return datasetsRealMap;
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Map<String, String> applyDatasetField(List<DatasetTableField> datasetTableFieldsInfo, Map<String, String> datasetsRelaMap) { public Map<String, String> applyDatasetField(List<DatasetTableField> datasetTableFieldsInfo, Map<String, String> datasetsRealMap) {
Map<String, String> datasetFieldsRelaMap = new HashMap<>(); Map<String, String> datasetFieldsRealMap = new HashMap<>();
for (DatasetTableField datasetTableField : datasetTableFieldsInfo) { for (DatasetTableField datasetTableField : datasetTableFieldsInfo) {
String oldId = datasetTableField.getId(); String oldId = datasetTableField.getId();
datasetTableField.setTableId(datasetsRelaMap.get(datasetTableField.getTableId())); datasetTableField.setTableId(datasetsRealMap.get(datasetTableField.getTableId()));
DatasetTableField newTableField = dataSetTableFieldsService.save(datasetTableField); DatasetTableField newTableField = dataSetTableFieldsService.save(datasetTableField);
datasetFieldsRelaMap.put(oldId, newTableField.getId()); datasetFieldsRealMap.put(oldId, newTableField.getId());
} }
return datasetFieldsRelaMap; return datasetFieldsRealMap;
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void resetCustomAndUnionDataset(List<DatasetTable> datasetTablesInfo, Map<String, String> datasetRelaMap, Map<String, String> datasetFieldsRelaMap) 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) {
if ((DatasetType.CUSTOM.name().equalsIgnoreCase(datasetTable.getType()) || DatasetType.UNION.name().equalsIgnoreCase(datasetTable.getType()))) { if ((DatasetType.CUSTOM.name().equalsIgnoreCase(datasetTable.getType()) || DatasetType.UNION.name().equalsIgnoreCase(datasetTable.getType()))) {
datasetRelaMap.forEach((k, v) -> { datasetRealMap.forEach((k, v) -> {
datasetTable.setInfo(datasetTable.getInfo().replaceAll(k, v)); datasetTable.setInfo(datasetTable.getInfo().replaceAll(k, v));
}); });
datasetFieldsRelaMap.forEach((k, v) -> { datasetFieldsRealMap.forEach((k, v) -> {
datasetTable.setInfo(datasetTable.getInfo().replaceAll(k, v)); datasetTable.setInfo(datasetTable.getInfo().replaceAll(k, v));
}); });
if (1 == datasetTable.getMode()) { if (1 == datasetTable.getMode()) {
@ -209,13 +209,13 @@ public class PanelAppTemplateService {
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Map<String, String> applyViews(List<ChartViewWithBLOBs> chartViewsInfo, Map<String, String> datasetsRelaMap, Map<String, String> datasetFieldsRelaMap, String sceneId) throws Exception { public Map<String, String> applyViews(List<ChartViewWithBLOBs> chartViewsInfo, Map<String, String> datasetsRealMap, Map<String, String> datasetFieldsRealMap, String sceneId) throws Exception {
Map<String, String> chartViewsRelaMap = new HashMap<>(); Map<String, String> chartViewsRealMap = new HashMap<>();
for (ChartViewWithBLOBs chartView : chartViewsInfo) { for (ChartViewWithBLOBs chartView : chartViewsInfo) {
String oldViewId = chartView.getId(); String oldViewId = chartView.getId();
// 替换datasetId // 替换datasetId
chartView.setTableId(datasetsRelaMap.get(chartView.getTableId())); chartView.setTableId(datasetsRealMap.get(chartView.getTableId()));
datasetsRelaMap.forEach((k, v) -> { datasetsRealMap.forEach((k, v) -> {
chartView.setXAxis(chartView.getXAxis().replaceAll(k, v)); chartView.setXAxis(chartView.getXAxis().replaceAll(k, v));
chartView.setXAxisExt(chartView.getXAxisExt().replaceAll(k, v)); chartView.setXAxisExt(chartView.getXAxisExt().replaceAll(k, v));
chartView.setYAxis(chartView.getYAxis().replaceAll(k, v)); chartView.setYAxis(chartView.getYAxis().replaceAll(k, v));
@ -228,7 +228,7 @@ public class PanelAppTemplateService {
chartView.setDrillFields(chartView.getDrillFields().replaceAll(k, v)); chartView.setDrillFields(chartView.getDrillFields().replaceAll(k, v));
}); });
//替换datasetFieldId //替换datasetFieldId
datasetFieldsRelaMap.forEach((k, v) -> { datasetFieldsRealMap.forEach((k, v) -> {
chartView.setXAxis(chartView.getXAxis().replaceAll(k, v)); chartView.setXAxis(chartView.getXAxis().replaceAll(k, v));
chartView.setXAxisExt(chartView.getXAxisExt().replaceAll(k, v)); chartView.setXAxisExt(chartView.getXAxisExt().replaceAll(k, v));
chartView.setYAxis(chartView.getYAxis().replaceAll(k, v)); chartView.setYAxis(chartView.getYAxis().replaceAll(k, v));
@ -243,31 +243,31 @@ public class PanelAppTemplateService {
chartView.setId(null); chartView.setId(null);
chartView.setSceneId(sceneId); chartView.setSceneId(sceneId);
ChartViewWithBLOBs newOne = chartViewService.newOne(chartView); ChartViewWithBLOBs newOne = chartViewService.newOne(chartView);
chartViewsRelaMap.put(oldViewId, newOne.getId()); chartViewsRealMap.put(oldViewId, newOne.getId());
} }
return chartViewsRelaMap; return chartViewsRealMap;
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Map<String, String> applyViewsField(List<ChartViewField> chartViewFieldsInfo, Map<String, String> chartViewsRelaMap, Map<String, String> datasetsRelaMap, Map<String, String> datasetFieldsRelaMap) { public Map<String, String> applyViewsField(List<ChartViewField> chartViewFieldsInfo, Map<String, String> chartViewsRealMap, Map<String, String> datasetsRealMap, Map<String, String> datasetFieldsRealMap) {
Map<String, String> chartViewFieldsRelaMap = new HashMap<>(); Map<String, String> chartViewFieldsRealMap = new HashMap<>();
if (!CollectionUtils.isEmpty(chartViewFieldsInfo)) { if (!CollectionUtils.isEmpty(chartViewFieldsInfo)) {
for (ChartViewField chartViewField : chartViewFieldsInfo) { for (ChartViewField chartViewField : chartViewFieldsInfo) {
String oldChartFieldId = chartViewField.getId(); String oldChartFieldId = chartViewField.getId();
chartViewField.setId(null); chartViewField.setId(null);
//替换datasetId //替换datasetId
chartViewField.setTableId(datasetsRelaMap.get(chartViewField.getTableId())); chartViewField.setTableId(datasetsRealMap.get(chartViewField.getTableId()));
//替换chartViewId //替换chartViewId
chartViewField.setChartId(chartViewsRelaMap.get(chartViewField.getId())); chartViewField.setChartId(chartViewsRealMap.get(chartViewField.getId()));
//替换datasetFieldId //替换datasetFieldId
datasetFieldsRelaMap.forEach((k, v) -> { datasetFieldsRealMap.forEach((k, v) -> {
chartViewField.setOriginName(chartViewField.getOriginName().replaceAll(k, v)); chartViewField.setOriginName(chartViewField.getOriginName().replaceAll(k, v));
}); });
ChartViewField newChartViewField = chartViewFieldService.save(chartViewField); ChartViewField newChartViewField = chartViewFieldService.save(chartViewField);
chartViewFieldsRelaMap.put(oldChartFieldId, newChartViewField.getId()); chartViewFieldsRealMap.put(oldChartFieldId, newChartViewField.getId());
} }
} }
return chartViewFieldsRelaMap; return chartViewFieldsRealMap;
} }
public void nameCheck(PanelAppTemplateApplyRequest request) { public void nameCheck(PanelAppTemplateApplyRequest request) {

View File

@ -401,12 +401,12 @@ public class PanelGroupService {
return newPanelId; return newPanelId;
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String newPanelFromApp(PanelGroupRequest request,Map<String,String> chartViewsRelaMap){ public String newPanelFromApp(PanelGroupRequest request,Map<String,String> chartViewsRealMap){
String newPanelId = request.getId(); String newPanelId = request.getId();
String templateData = request.getPanelData(); String templateData = request.getPanelData();
String staticResource = request.getStaticResource(); String staticResource = request.getStaticResource();
Boolean mobileLayout = panelViewService.havaMobileLayout(templateData); Boolean mobileLayout = panelViewService.haveMobileLayout(templateData);
for(Map.Entry<String,String> entry:chartViewsRelaMap.entrySet()){ for(Map.Entry<String,String> entry:chartViewsRealMap.entrySet()){
templateData = templateData.replaceAll(entry.getKey(),entry.getValue()); templateData = templateData.replaceAll(entry.getKey(),entry.getValue());
} }
request.setMobileLayout(mobileLayout); request.setMobileLayout(mobileLayout);
@ -439,13 +439,13 @@ public class PanelGroupService {
templateStyle = panelTemplate.getTemplateStyle(); templateStyle = panelTemplate.getTemplateStyle();
templateData = panelTemplate.getTemplateData(); templateData = panelTemplate.getTemplateData();
dynamicData = panelTemplate.getDynamicData(); dynamicData = panelTemplate.getDynamicData();
mobileLayout = panelViewService.havaMobileLayout(templateData); mobileLayout = panelViewService.haveMobileLayout(templateData);
} else if (PanelConstants.NEW_PANEL_FROM.NEW_OUTER_TEMPLATE.equals(newFrom)) { } else if (PanelConstants.NEW_PANEL_FROM.NEW_OUTER_TEMPLATE.equals(newFrom)) {
templateStyle = request.getPanelStyle(); templateStyle = request.getPanelStyle();
templateData = request.getPanelData(); templateData = request.getPanelData();
dynamicData = request.getDynamicData(); dynamicData = request.getDynamicData();
staticResource = request.getStaticResource(); staticResource = request.getStaticResource();
mobileLayout = panelViewService.havaMobileLayout(templateData); mobileLayout = panelViewService.haveMobileLayout(templateData);
} else if (PanelConstants.NEW_PANEL_FROM.NEW_MARKET_TEMPLATE.equals(newFrom)) { } else if (PanelConstants.NEW_PANEL_FROM.NEW_MARKET_TEMPLATE.equals(newFrom)) {
PanelTemplateFileDTO templateFileInfo = getTemplateFromMarket(request.getTemplateUrl()); PanelTemplateFileDTO templateFileInfo = getTemplateFromMarket(request.getTemplateUrl());
if (templateFileInfo == null) { if (templateFileInfo == null) {
@ -455,7 +455,7 @@ public class PanelGroupService {
templateData = templateFileInfo.getPanelData(); templateData = templateFileInfo.getPanelData();
dynamicData = templateFileInfo.getDynamicData(); dynamicData = templateFileInfo.getDynamicData();
staticResource = templateFileInfo.getStaticResource(); staticResource = templateFileInfo.getStaticResource();
mobileLayout = panelViewService.havaMobileLayout(templateData); mobileLayout = panelViewService.haveMobileLayout(templateData);
} }
Map<String, String> dynamicDataMap = gson.fromJson(dynamicData, Map.class); Map<String, String> dynamicDataMap = gson.fromJson(dynamicData, Map.class);
if (dynamicDataMap == null) { if (dynamicDataMap == null) {
@ -803,7 +803,7 @@ public class PanelGroupService {
if (CollectionUtils.isEmpty(datasourceDTOS)) { if (CollectionUtils.isEmpty(datasourceDTOS)) {
return new PanelExport2App("this panel don't have datasource"); return new PanelExport2App("this panel don't have datasource");
} else if (datasourceDTOS.size() > 1) { } else if (datasourceDTOS.size() > 1) {
return new PanelExport2App("this panel should hava only one dataset"); return new PanelExport2App("this panel should have only one dataset");
} }
return new PanelExport2App(chartViewsInfo, chartViewFieldsInfo, datasetTablesInfo, datasetTableFieldsInfo, dataSetTasksInfo, datasourceDTOS,panelViews); return new PanelExport2App(chartViewsInfo, chartViewFieldsInfo, datasetTablesInfo, datasetTableFieldsInfo, dataSetTasksInfo, datasourceDTOS,panelViews);
} }
@ -841,23 +841,23 @@ public class PanelGroupService {
//获取仪表板视图信息 //获取仪表板视图信息
List<PanelView> panelViewsInfo = gson.fromJson(appInfo.getPanelViewsInfo(), new TypeToken<List<PanelView>>(){}.getType()); List<PanelView> panelViewsInfo = gson.fromJson(appInfo.getPanelViewsInfo(), new TypeToken<List<PanelView>>(){}.getType());
Map<String,String> datasourceRelaMap = panelAppTemplateService.applyDatasource(oldDatasourceInfo,request.getDatasourceList()); Map<String,String> datasourceRealMap = panelAppTemplateService.applyDatasource(oldDatasourceInfo,request.getDatasourceList());
Map<String,String> datasetsRelaMap = panelAppTemplateService.applyDataset(datasetTablesInfo,datasourceRelaMap,asideDatasetGroupId); Map<String,String> datasetsRealMap = panelAppTemplateService.applyDataset(datasetTablesInfo,datasourceRealMap,asideDatasetGroupId);
Map<String,String> datasetFieldsRelaMap = panelAppTemplateService.applyDatasetField(datasetTableFieldsInfo,datasetsRelaMap); Map<String,String> datasetFieldsRealMap = panelAppTemplateService.applyDatasetField(datasetTableFieldsInfo,datasetsRealMap);
panelAppTemplateService.resetCustomAndUnionDataset(datasetTablesInfo,datasetsRelaMap,datasetFieldsRelaMap); panelAppTemplateService.resetCustomAndUnionDataset(datasetTablesInfo,datasetsRealMap,datasetFieldsRealMap);
Map<String,String> chartViewsRelaMap = panelAppTemplateService.applyViews(chartViewsInfo,datasetsRelaMap,datasetFieldsRelaMap,newPanelId); Map<String,String> chartViewsRealMap = panelAppTemplateService.applyViews(chartViewsInfo,datasetsRealMap,datasetFieldsRealMap,newPanelId);
panelAppTemplateService.applyViewsField(chartViewFieldsInfo,chartViewsRelaMap,datasetsRelaMap,datasetFieldsRelaMap); panelAppTemplateService.applyViewsField(chartViewFieldsInfo,chartViewsRealMap,datasetsRealMap,datasetFieldsRealMap);
panelAppTemplateService.applyPanel(panelInfo,chartViewsRelaMap,newPanelId, request.getPanelName(), request.getPanelId()); panelAppTemplateService.applyPanel(panelInfo,chartViewsRealMap,newPanelId, request.getPanelName(), request.getPanelId());
panelAppTemplateService.applyPanelView(panelViewsInfo,chartViewsRelaMap,newPanelId); panelAppTemplateService.applyPanelView(panelViewsInfo,chartViewsRealMap,newPanelId);
String newDatasourceId =datasourceRelaMap.entrySet().stream().findFirst().get().getValue(); String newDatasourceId =datasourceRealMap.entrySet().stream().findFirst().get().getValue();
String newDatasourceName = request.getDatasourceList().get(0).getName(); String newDatasourceName = request.getDatasourceList().get(0).getName();

View File

@ -133,7 +133,7 @@ public class PanelViewService {
return viewIds; return viewIds;
} }
public Boolean havaMobileLayout(String panelData){ public Boolean haveMobileLayout(String panelData){
Boolean mobileLayout = false; Boolean mobileLayout = false;
if (StringUtils.isNotEmpty(panelData)) { if (StringUtils.isNotEmpty(panelData)) {
JsonArray dataArray = JsonParser.parseString(panelData).getAsJsonArray(); JsonArray dataArray = JsonParser.parseString(panelData).getAsJsonArray();

View File

@ -351,16 +351,16 @@ public class ShareService {
param.put("deptId", deptId); param.put("deptId", deptId);
param.put("roleIds", CollectionUtils.isNotEmpty(roleIds)? roleIds: null); param.put("roleIds", CollectionUtils.isNotEmpty(roleIds)? roleIds: null);
List<PanelSharePo> datas = extPanelShareMapper.query(param); List<PanelSharePo> data = extPanelShareMapper.query(param);
List<PanelShareDto> dtoLists = datas.stream().map(po -> BeanUtils.copyBean(new PanelShareDto(), po)) List<PanelShareDto> dtoLists = data.stream().map(po -> BeanUtils.copyBean(new PanelShareDto(), po))
.collect(Collectors.toList()); .collect(Collectors.toList());
return convertTree(dtoLists); return convertTree(dtoLists);
} }
// List构建Tree // List构建Tree
private List<PanelShareDto> convertTree(List<PanelShareDto> datas) { private List<PanelShareDto> convertTree(List<PanelShareDto> data) {
String username = AuthUtils.getUser().getUsername(); String username = AuthUtils.getUser().getUsername();
Map<String, List<PanelShareDto>> map = datas.stream() Map<String, List<PanelShareDto>> map = data.stream()
.filter(panelShareDto -> StringUtils.isNotEmpty(panelShareDto.getCreator()) .filter(panelShareDto -> StringUtils.isNotEmpty(panelShareDto.getCreator())
&& !StringUtils.equals(username, panelShareDto.getCreator())) && !StringUtils.equals(username, panelShareDto.getCreator()))
.collect(Collectors.groupingBy(PanelShareDto::getCreator)); .collect(Collectors.groupingBy(PanelShareDto::getCreator));

View File

@ -48,18 +48,18 @@ public class AppLogManager {
public String detailInfo(SysLogWithBLOBs vo) { public String detailInfo(SysLogWithBLOBs vo) {
String sourceName = vo.getSourceName(); String sourceName = vo.getSourceName();
String postion = null; String position = null;
String operateTypeName = SysLogConstants.operateTypeName(vo.getOperateType()); String operateTypeName = SysLogConstants.operateTypeName(vo.getOperateType());
operateTypeName = Translator.get(operateTypeName); operateTypeName = Translator.get(operateTypeName);
String sourceTypeName = SysLogConstants.sourceTypeName(vo.getSourceType()); String sourceTypeName = SysLogConstants.sourceTypeName(vo.getSourceType());
sourceTypeName = Translator.get(sourceTypeName); sourceTypeName = Translator.get(sourceTypeName);
String result = operateTypeName + sourceTypeName + String.format(contentFormat, sourceName) + remarkInfo(vo); String result = operateTypeName + sourceTypeName + String.format(contentFormat, sourceName) + remarkInfo(vo);
if ((postion = vo.getPosition()) != null) { if ((position = vo.getPosition()) != null) {
List<FolderItem> folderItems = gson.fromJson(postion, type); List<FolderItem> folderItems = gson.fromJson(position, type);
String template = folderItems.stream().map(folderItem -> folderItem.getName()).collect(Collectors.joining("/")); String template = folderItems.stream().map(folderItem -> folderItem.getName()).collect(Collectors.joining("/"));
String postionResult = String.format(positionFormat, template); String positionResult = String.format(positionFormat, template);
return postionResult + result; return positionResult + result;
} }
return result; return result;
} }

View File

@ -113,9 +113,9 @@ public class MenuService {
return sysMenuMapper.updateByPrimaryKeySelective(sysMenu); return sysMenuMapper.updateByPrimaryKeySelective(sysMenu);
} }
public List<MenuNodeResponse> childs(Long pid) { public List<MenuNodeResponse> children(Long pid) {
Set<SysMenu> childs = getChilds(nodesByPid(pid), new HashSet()); Set<SysMenu> children = getChildren(nodesByPid(pid), new HashSet());
List<SysMenu> menus = new ArrayList<>(childs); List<SysMenu> menus = new ArrayList<>(children);
return convert(menus); return convert(menus);
} }
@ -138,12 +138,12 @@ public class MenuService {
return roots.stream().map(node -> node.getMenuId().equals(targetRootNode.getId()) ? targetRootNode : format(node)).collect(Collectors.toList()); return roots.stream().map(node -> node.getMenuId().equals(targetRootNode.getId()) ? targetRootNode : format(node)).collect(Collectors.toList());
} }
private Set<SysMenu> getChilds(List<SysMenu> lists, Set<SysMenu> sets) { private Set<SysMenu> getChildren(List<SysMenu> lists, Set<SysMenu> sets) {
lists.forEach(menu -> { lists.forEach(menu -> {
sets.add(menu); sets.add(menu);
List<SysMenu> kidMenus = nodesByPid(menu.getMenuId()); List<SysMenu> kidMenus = nodesByPid(menu.getMenuId());
if (CollectionUtils.isNotEmpty(kidMenus)) { if (CollectionUtils.isNotEmpty(kidMenus)) {
getChilds(kidMenus, sets); getChildren(kidMenus, sets);
} }
}); });
return sets; return sets;

View File

@ -48,18 +48,18 @@ public class LogManager {
public String detailInfo(SysLogWithBLOBs vo) { public String detailInfo(SysLogWithBLOBs vo) {
String sourceName = vo.getSourceName(); String sourceName = vo.getSourceName();
String postion = null; String position = null;
String operateTypeName = SysLogConstants.operateTypeName(vo.getOperateType()); String operateTypeName = SysLogConstants.operateTypeName(vo.getOperateType());
operateTypeName = Translator.get(operateTypeName); operateTypeName = Translator.get(operateTypeName);
String sourceTypeName = SysLogConstants.sourceTypeName(vo.getSourceType()); String sourceTypeName = SysLogConstants.sourceTypeName(vo.getSourceType());
sourceTypeName = Translator.get(sourceTypeName); sourceTypeName = Translator.get(sourceTypeName);
String result = operateTypeName + sourceTypeName + String.format(contentFormat, sourceName) + remarkInfo(vo); String result = operateTypeName + sourceTypeName + String.format(contentFormat, sourceName) + remarkInfo(vo);
if ((postion = vo.getPosition()) != null) { if ((position = vo.getPosition()) != null) {
List<FolderItem> folderItems = gson.fromJson(postion, type); List<FolderItem> folderItems = gson.fromJson(position, type);
String template = folderItems.stream().map(folderItem -> folderItem.getName()).collect(Collectors.joining("/")); String template = folderItems.stream().map(folderItem -> folderItem.getName()).collect(Collectors.joining("/"));
String postionResult = String.format(positionFormat, template); String positionResult = String.format(positionFormat, template);
return postionResult + result; return positionResult + result;
} }
return result; return result;
} }

View File

@ -13,4 +13,4 @@ ALTER TABLE `dataset_table_field` ADD COLUMN `date_format` VARCHAR(255) NULL AFT
ALTER TABLE `sys_task_email` ADD COLUMN `view_data_range` VARCHAR(255) NULL DEFAULT 'view' AFTER `reci_users`; ALTER TABLE `sys_task_email` ADD COLUMN `view_data_range` VARCHAR(255) NULL DEFAULT 'view' AFTER `reci_users`;
UPDATE `sys_msg_type` set `type_name` = 'i18n_msg_type_dataset_sync_failed' WHERE (`msg_type_id` = 6);

View File

@ -102,7 +102,7 @@ i18n_msg_type_panel_share=Dashboard sharing
i18n_msg_type_panel_share_cacnel=Dashboard unshared i18n_msg_type_panel_share_cacnel=Dashboard unshared
i18n_msg_type_dataset_sync=Data set synchronization i18n_msg_type_dataset_sync=Data set synchronization
i18n_msg_type_dataset_sync_success=Dataset synchronization successful i18n_msg_type_dataset_sync_success=Dataset synchronization successful
i18n_msg_type_dataset_sync_faild=Dataset synchronization failed i18n_msg_type_dataset_sync_failed=Dataset synchronization failed
i18n_data_not_sync=Please sync data first i18n_data_not_sync=Please sync data first
i18n_excel_column_change=The column name of Excel is inconsistent with the original data set i18n_excel_column_change=The column name of Excel is inconsistent with the original data set
i18n_excel_column_inconsistent=The column names of the selected sheet pages are inconsistent i18n_excel_column_inconsistent=The column names of the selected sheet pages are inconsistent
@ -178,10 +178,10 @@ i18n_not_admin_error=Not an administrator account
i18n_user_not_exist=user does not exist i18n_user_not_exist=user does not exist
i18n_default_login_reset=Switched back to default login mode i18n_default_login_reset=Switched back to default login mode
I18N_COMMON_LEVEL_USE=Consult I18N_COMMON_LEVEL_USE=Consult
I18N_PANNEL_LEVEL_VIEW=Consult I18N_PANEL_LEVEL_VIEW=Consult
I18N_PANNEL_LEVEL_EXPORT=Export I18N_PANEL_LEVEL_EXPORT=Export
I18N_PANNEL_LEVEL_MANAGE=Manage I18N_PANEL_LEVEL_MANAGE=Manage
I18N_PANNEL_LEVEL_GRANT=Grant I18N_PANEL_LEVEL_GRANT=Grant
I18N_DATASET_LEVEL_USE=Consult I18N_DATASET_LEVEL_USE=Consult
I18N_DATASET_LEVEL_MANAGE=Manage I18N_DATASET_LEVEL_MANAGE=Manage
I18N_DATASET_LEVEL_GRANT=Grant I18N_DATASET_LEVEL_GRANT=Grant

View File

@ -102,7 +102,7 @@ i18n_msg_type_panel_share=\u4EEA\u8868\u677F\u5206\u4EAB
i18n_msg_type_panel_share_cacnel=\u4EEA\u8868\u677F\u53D6\u6D88\u5206\u4EAB i18n_msg_type_panel_share_cacnel=\u4EEA\u8868\u677F\u53D6\u6D88\u5206\u4EAB
i18n_msg_type_dataset_sync=\u6570\u636E\u96C6\u540C\u6B65 i18n_msg_type_dataset_sync=\u6570\u636E\u96C6\u540C\u6B65
i18n_msg_type_dataset_sync_success=\u6570\u636E\u96C6\u540C\u6B65\u6210\u529F i18n_msg_type_dataset_sync_success=\u6570\u636E\u96C6\u540C\u6B65\u6210\u529F
i18n_msg_type_dataset_sync_faild=\u6570\u636E\u96C6\u540C\u6B65\u5931\u8D25 i18n_msg_type_dataset_sync_failed=\u6570\u636E\u96C6\u540C\u6B65\u5931\u8D25
i18n_data_not_sync=\u8BF7\u5148\u5B8C\u6210\u6570\u636E\u540C\u6B65 i18n_data_not_sync=\u8BF7\u5148\u5B8C\u6210\u6570\u636E\u540C\u6B65
i18n_excel_column_change=Excel\u7684\u5217\u540D\u4E0E\u539F\u6570\u636E\u96C6\u4E0D\u4E00\u81F4 i18n_excel_column_change=Excel\u7684\u5217\u540D\u4E0E\u539F\u6570\u636E\u96C6\u4E0D\u4E00\u81F4
i18n_excel_column_inconsistent=\u6240\u9009sheet\u9875\u9762\u7684\u5217\u540D\u4E0D\u4E00\u81F4 i18n_excel_column_inconsistent=\u6240\u9009sheet\u9875\u9762\u7684\u5217\u540D\u4E0D\u4E00\u81F4
@ -178,10 +178,10 @@ i18n_not_admin_error=\u4E0D\u662F\u7BA1\u7406\u5458\u8D26\u53F7
i18n_user_not_exist=\u7528\u6237\u4E0D\u5B58\u5728 i18n_user_not_exist=\u7528\u6237\u4E0D\u5B58\u5728
i18n_default_login_reset=\u5DF2\u5207\u6362\u56DE\u9ED8\u8BA4\u767B\u5F55\u65B9\u5F0F i18n_default_login_reset=\u5DF2\u5207\u6362\u56DE\u9ED8\u8BA4\u767B\u5F55\u65B9\u5F0F
I18N_COMMON_LEVEL_USE=\u67E5\u770B I18N_COMMON_LEVEL_USE=\u67E5\u770B
I18N_PANNEL_LEVEL_VIEW=\u67E5\u770B I18N_PANEL_LEVEL_VIEW=\u67E5\u770B
I18N_PANNEL_LEVEL_EXPORT=\u5BFC\u51FA I18N_PANEL_LEVEL_EXPORT=\u5BFC\u51FA
I18N_PANNEL_LEVEL_MANAGE=\u7BA1\u7406 I18N_PANEL_LEVEL_MANAGE=\u7BA1\u7406
I18N_PANNEL_LEVEL_GRANT=\u6388\u6743 I18N_PANEL_LEVEL_GRANT=\u6388\u6743
I18N_DATASET_LEVEL_USE=\u67E5\u770B I18N_DATASET_LEVEL_USE=\u67E5\u770B
I18N_DATASET_LEVEL_MANAGE=\u7BA1\u7406 I18N_DATASET_LEVEL_MANAGE=\u7BA1\u7406
I18N_DATASET_LEVEL_GRANT=\u6388\u6743 I18N_DATASET_LEVEL_GRANT=\u6388\u6743

View File

@ -102,7 +102,7 @@ i18n_msg_type_panel_share=\u5100\u8868\u677F\u5206\u4EAB
i18n_msg_type_panel_share_cacnel=\u5100\u8868\u677F\u53D6\u6D88\u5206\u4EAB i18n_msg_type_panel_share_cacnel=\u5100\u8868\u677F\u53D6\u6D88\u5206\u4EAB
i18n_msg_type_dataset_sync=\u6578\u64DA\u96C6\u540C\u6B65 i18n_msg_type_dataset_sync=\u6578\u64DA\u96C6\u540C\u6B65
i18n_msg_type_dataset_sync_success=\u6578\u64DA\u96C6\u540C\u6B65\u6210\u529F i18n_msg_type_dataset_sync_success=\u6578\u64DA\u96C6\u540C\u6B65\u6210\u529F
i18n_msg_type_dataset_sync_faild=\u6578\u64DA\u96C6\u540C\u6B65\u5931\u6557 i18n_msg_type_dataset_sync_failed=\u6578\u64DA\u96C6\u540C\u6B65\u5931\u6557
i18n_data_not_sync=\u8ACB\u5148\u5B8C\u6210\u6578\u64DA\u540C\u6B65 i18n_data_not_sync=\u8ACB\u5148\u5B8C\u6210\u6578\u64DA\u540C\u6B65
i18n_excel_column_change=Excel\u7684\u5217\u540D\u8207\u539F\u6578\u64DA\u96C6\u4E0D\u4E00\u81F4 i18n_excel_column_change=Excel\u7684\u5217\u540D\u8207\u539F\u6578\u64DA\u96C6\u4E0D\u4E00\u81F4
i18n_excel_column_inconsistent=\u6240\u9078sheet\u9801\u9762\u7684\u5217\u540D\u4E0D\u4E00\u81F4 i18n_excel_column_inconsistent=\u6240\u9078sheet\u9801\u9762\u7684\u5217\u540D\u4E0D\u4E00\u81F4
@ -174,10 +174,10 @@ i18n_not_admin_error=\u4E0D\u662F\u7BA1\u7406\u54E1\u8CEC\u865F
i18n_user_not_exist=\u7528\u6236\u4E0D\u5B58\u5728 i18n_user_not_exist=\u7528\u6236\u4E0D\u5B58\u5728
i18n_default_login_reset=\u5DF2\u5207\u63DB\u56DE\u9ED8\u8A8D\u767B\u9304\u65B9\u5F0F i18n_default_login_reset=\u5DF2\u5207\u63DB\u56DE\u9ED8\u8A8D\u767B\u9304\u65B9\u5F0F
I18N_COMMON_LEVEL_USE=\u67E5\u770B I18N_COMMON_LEVEL_USE=\u67E5\u770B
I18N_PANNEL_LEVEL_VIEW=\u67E5\u770B I18N_PANEL_LEVEL_VIEW=\u67E5\u770B
I18N_PANNEL_LEVEL_EXPORT=\u5C0E\u51FA I18N_PANEL_LEVEL_EXPORT=\u5C0E\u51FA
I18N_PANNEL_LEVEL_MANAGE=\u7BA1\u7406 I18N_PANEL_LEVEL_MANAGE=\u7BA1\u7406
I18N_PANNEL_LEVEL_GRANT=\u6388\u6B0A I18N_PANEL_LEVEL_GRANT=\u6388\u6B0A
I18N_DATASET_LEVEL_USE=\u67E5\u770B I18N_DATASET_LEVEL_USE=\u67E5\u770B
I18N_DATASET_LEVEL_MANAGE=\u7BA1\u7406 I18N_DATASET_LEVEL_MANAGE=\u7BA1\u7406
I18N_DATASET_LEVEL_GRANT=\u6388\u6B0A I18N_DATASET_LEVEL_GRANT=\u6388\u6B0A

View File

@ -1,260 +0,0 @@
<template>
<div
class="el-view-select"
:class="selectClass"
>
<el-select
ref="select"
v-model="innerValues"
v-popover:popover
popper-class="view-select-option"
style="width: 100%;"
multiple
clearable
@remove-tag="_selectRemoveTag"
@clear="_selectClearFun"
@focus="_popoverShowFun"
>
<el-option
v-for="item in selectOptions"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
<el-popover
ref="popover"
v-model="visible"
:placement="placement"
:transition="transition"
:popper-class="popperClass"
:width="width"
trigger="click"
>
<el-scrollbar
v-if="viewLoaded"
tag="div"
wrap-class="el-select-dropdown__wrap"
view-class="el-select-dropdown__list"
class="is-empty"
>
<div :style="{'height': panelHeight + 'px'}">
<Preview
:component-data="componentData"
:canvas-style-data="canvasStyleData"
:panel-info="panelInfo"
:show-position="showPosition"
/>
</div>
</el-scrollbar>
<el-empty
v-else
style="height: 150px;"
:image-size="120"
description=""
/>
</el-popover>
</div>
</template>
<script>
import { on, off } from './dom'
import Preview from '@/components/canvas/components/Editor/Preview'
import { findOne } from '@/api/panel/panel'
import { viewOptions } from '@/api/chart/chart'
import { panelDataPrepare } from '@/components/canvas/utils/utils'
export default {
name: 'DeViewSelect',
components: { Preview },
props: {
value: {
type: Array,
default: () => []
},
panelId: {
type: String,
default: null
}
},
data() {
return {
visible: false,
placement: 'bottom',
transition: 'el-zoom-in-top',
width: 500,
selectClass: 'my-top-class',
innerValues: [],
panelHeight: 450,
showPosition: 'email-task',
viewLoaded: false,
selectOptions: []
}
},
computed: {
popperClass() {
const _c = 'el-view-select-popper ' + this.popoverClass
return this.disabled ? _c + ' disabled ' : _c
},
selectedViews() {
return this.$store.getters.panelViews[this.panelId]
}
},
watch: {
value(val, old) {
this.innerValues = val
},
innerValues(val, old) {
if (val !== old) {
this.$emit('input', val)
}
},
panelId(val, old) {
if (val !== old) {
this.innerValues = []
this.loadView()
}
},
selectedViews: {
handler(val) {
if (!val || !JSON.stringify(val)) {
this.innerValues = []
return
}
const viewIds = JSON.parse(JSON.stringify(val))
this.innerValues = JSON.parse(JSON.stringify(viewIds))
},
deep: true
}
},
mounted() {
this._updateH()
this.$nextTick(() => {
on(document, 'mouseup', this._popoverHideFun)
})
},
beforeDestroy() {
this._selectClearFun()
off(document, 'mouseup', this._popoverHideFun)
},
created() {
this.loadView()
},
methods: {
loadView() {
this._selectClearFun()
this.innerValues = this.value
this.viewLoaded = false
this.panelId && findOne(this.panelId).then(response => {
this.panelInfo = {
id: response.data.id,
name: response.data.name,
privileges: response.data.privileges,
sourcePanelName: response.data.sourcePanelName,
status: response.data.status
}
this.$store.dispatch('panel/setPanelInfo', this.panelInfo)
panelDataPrepare(JSON.parse(response.data.panelData), JSON.parse(response.data.panelStyle), rsp => {
this.viewLoaded = true
this.componentData = rsp.componentData
this.canvasStyleData = rsp.componentStyle
this.loadOptions()
})
})
},
loadOptions() {
this.panelId && viewOptions(this.panelId).then(res => {
this.selectOptions = res.data
this.init()
})
},
_updateH() {
this.$nextTick(() => {
this.width = this.$refs.select.$el.getBoundingClientRect().width
this.panelHeight = this.width * 9 / 16
})
},
_popoverShowFun(val) {
this._updateH()
this.$emit('onFoucs')
},
_popoverHideFun(e) {
const path = this._getEventPath(e)
const isInside = path.some(list => {
return list.className && typeof list.className === 'string' && list.className.indexOf('el-view-select') !== -1
})
if (!isInside) {
this.visible = false
}
},
_getEventPath(evt) {
const path = (evt.composedPath && evt.composedPath()) || evt.path
const target = evt.target
if (path != null) {
return path.indexOf(window) < 0 ? path.concat(window) : path
}
if (target === window) {
return [window]
}
function getParents(node, memo) {
memo = memo || []
const parentNode = node.parentNode
if (!parentNode) {
return memo
} else {
return getParents(parentNode, memo.concat(parentNode))
}
}
return [target].concat(getParents(target), window)
},
_selectRemoveTag(viewId) {
this.selectedViews.forEach(item => {
if (item.viewId === viewId) {
this.$store.dispatch('task/delView', { 'panelId': this.panelId, 'viewId': item.viewId })
}
})
},
_selectClearFun() {
this.$store.dispatch('task/delPanelViews', this.panelId)
},
init() {
if (this.value && this.value.length) {
const viewIds = JSON.parse(JSON.stringify(this.value))
this.$store.dispatch('task/initPanelView', { 'panelId': this.panelId, 'viewIds': viewIds })
}
}
}
}
</script>
<style lang="scss" scoped>
.el-view-select .view-select-option {
display: none !important;
}
.el-view-select-popper {
max-height: 800px;
overflow: auto;
}
.el-view-select-popper.disabled {
display: none !important;
}
.el-view-select-popper .el-button--small {
width: 25px !important;
min-width: 25px !important;
}
.el-view-select-popper[x-placement^='bottom'] {
margin-top: 5px;
}
.my-top-class {
width: 100%;
}
</style>

View File

@ -171,7 +171,7 @@ export default {
_popoverShowFun(val) { _popoverShowFun(val) {
this.openDialog() this.openDialog()
this._updateH() this._updateH()
this.$emit('onFoucs') this.$emit('onFocus')
}, },
_selectRemoveTag(viewId) { _selectRemoveTag(viewId) {

View File

@ -54,7 +54,7 @@
v-model="selectAll" v-model="selectAll"
v-customStyle="customStyle" v-customStyle="customStyle"
:indeterminate="isIndeterminate" :indeterminate="isIndeterminate"
@change="selectAllChane" @change="selectAllChange"
>{{ $t('dataset.check_all') }}</el-checkbox></p> >{{ $t('dataset.check_all') }}</el-checkbox></p>
<el-scrollbar <el-scrollbar
tag="div" tag="div"
@ -276,7 +276,7 @@ export default {
resetSelectAll() { resetSelectAll() {
this.selectAll = false this.selectAll = false
}, },
selectAllChane(val) { selectAllChange(val) {
if (val) { if (val) {
this.ids = this._checkSum() this.ids = this._checkSum()
this._emitFun() this._emitFun()
@ -535,7 +535,7 @@ export default {
}, },
_popoverShowFun(val) { _popoverShowFun(val) {
this._updateH() this._updateH()
this.$emit('onFoucs') this.$emit('onFocus')
}, },
_popoverHideFun(e) { _popoverHideFun(e) {
const path = this._getEventPath(e) const path = this._getEventPath(e)

View File

@ -19,7 +19,7 @@
v-model="selectAll" v-model="selectAll"
v-customStyle="customStyle" v-customStyle="customStyle"
:indeterminate="isIndeterminate" :indeterminate="isIndeterminate"
@change="selectAllChane" @change="selectAllChange"
>{{ $t('dataset.check_all') }}</el-checkbox></p> >{{ $t('dataset.check_all') }}</el-checkbox></p>
<el-option <el-option
v-for="item in options" v-for="item in options"
@ -74,7 +74,7 @@ export default {
selectValue: this.value, selectValue: this.value,
options: [], options: [],
domList: null, domList: null,
slectBoxDom: null, selectBoxDom: null,
scrollbar: null, scrollbar: null,
startIndex: 0, startIndex: 0,
endIndex: 0, endIndex: 0,
@ -139,7 +139,7 @@ export default {
} }
return this.selectValue === id && 'selected' return this.selectValue === id && 'selected'
}, },
selectAllChane(val) { selectAllChange(val) {
const vals = val ? [...this.list.map(ele => ele.id)] : [] const vals = val ? [...this.list.map(ele => ele.id)] : []
this.visualChange(vals) this.visualChange(vals)
this.selectValue = vals this.selectValue = vals
@ -154,9 +154,9 @@ export default {
reCacularHeight() { reCacularHeight() {
this.maxHeightDom.style.height = this.newList.length * this.itemHeight + 'px' this.maxHeightDom.style.height = this.newList.length * this.itemHeight + 'px'
}, },
resetList(arrys) { resetList(arrays) {
if (Array.isArray(arrys)) { if (Array.isArray(arrays)) {
this.newList = arrys.slice() this.newList = arrays.slice()
this.domList.style.paddingTop = 0 + 'px' this.domList.style.paddingTop = 0 + 'px'
this.scrollbar.scrollTop = 0 this.scrollbar.scrollTop = 0
this.callback() this.callback()
@ -183,13 +183,13 @@ export default {
`.${this.classId} .el-select-dropdown .el-select-dropdown__wrap` `.${this.classId} .el-select-dropdown .el-select-dropdown__wrap`
) )
this.scrollbar = document.querySelector(`.${this.classId} .el-select-dropdown .el-scrollbar`) this.scrollbar = document.querySelector(`.${this.classId} .el-select-dropdown .el-scrollbar`)
this.slectBoxDom = document.querySelector(`.${this.classId} .el-select-dropdown__wrap`) this.selectBoxDom = document.querySelector(`.${this.classId} .el-select-dropdown__wrap`)
this.slectBoxDom.style.display = 'flex' this.selectBoxDom.style.display = 'flex'
this.slectBoxDom.style.flexDirection = 'row' this.selectBoxDom.style.flexDirection = 'row'
this.domList = selectDom.querySelector( this.domList = selectDom.querySelector(
`.${this.classId} .el-select-dropdown__wrap .el-select-dropdown__list` `.${this.classId} .el-select-dropdown__wrap .el-select-dropdown__list`
) )
this.addScrollDiv(this.slectBoxDom) this.addScrollDiv(this.selectBoxDom)
this.scrollFn() this.scrollFn()
this.customInputStyle() this.customInputStyle()

View File

@ -58,7 +58,7 @@
@click="handler" @click="handler"
> >
<div <div
v-for="option in pane.datas" v-for="option in pane.data"
:key="option.value" :key="option.value"
class="el-select-dropdown__item color-div-base" class="el-select-dropdown__item color-div-base"
:class="option.value === colorDto.value ? 'selected hover editor' : ''" :class="option.value === colorDto.value ? 'selected hover editor' : ''"
@ -163,12 +163,12 @@ export default {
{ {
label: '纯色', label: '纯色',
name: 'simple', name: 'simple',
datas: JSON.parse(JSON.stringify(colorCases)) data: JSON.parse(JSON.stringify(colorCases))
}, },
{ {
label: '渐变', label: '渐变',
name: 'gradient', name: 'gradient',
datas: JSON.parse(JSON.stringify(gradientColorCases)) data: JSON.parse(JSON.stringify(gradientColorCases))
} }
], ],
testColor: '#5470c6' testColor: '#5470c6'
@ -213,7 +213,7 @@ export default {
} }
this.activeName = this.colorCases.some(item => item.value === this.colorDto.value) ? 'simple' : 'gradient' this.activeName = this.colorCases.some(item => item.value === this.colorDto.value) ? 'simple' : 'gradient'
if (haspPropValue) { if (haspPropValue) {
this.tabPanes[this.activeName === 'simple' ? 0 : 1].datas.forEach(item => { this.tabPanes[this.activeName === 'simple' ? 0 : 1].data.forEach(item => {
if (item.value === this.colorDto.value) { if (item.value === this.colorDto.value) {
item.colors = JSON.parse(JSON.stringify(this.colorDto.colors)) item.colors = JSON.parse(JSON.stringify(this.colorDto.colors))
} }
@ -261,7 +261,7 @@ export default {
}, },
_popoverShowFun(val) { _popoverShowFun(val) {
this._updateH() this._updateH()
this.$emit('onFoucs') this.$emit('onFocus')
}, },
fillGradientColor() { fillGradientColor() {
this.gradientColorCases.forEach(item => { this.gradientColorCases.forEach(item => {
@ -270,7 +270,7 @@ export default {
return str return str
}) })
}) })
this.tabPanes[1].datas = JSON.parse(JSON.stringify(this.gradientColorCases)) this.tabPanes[1].data = JSON.parse(JSON.stringify(this.gradientColorCases))
}, },
formatBgColor(color, useValue) { formatBgColor(color, useValue) {
let activeName = this.activeName let activeName = this.activeName

View File

@ -152,11 +152,11 @@ export default {
if (this.$route && this.$route.name && this.$route.name === row.router) { if (this.$route && this.$route.name && this.$route.name === row.router) {
// 使router.push 使 // 使router.push 使
row.callback && bus.$emit(row.callback, param) row.callback && bus.$emit(row.callback, param)
row.status || this.setReaded(row.msgId) row.status || this.setRead(row.msgId)
} else { } else {
if (this.hasPermissionRoute(row.router)) { if (this.hasPermissionRoute(row.router)) {
this.$router.push({ name: row.router, params: param }) this.$router.push({ name: row.router, params: param })
row.status || this.setReaded(row.msgId) row.status || this.setRead(row.msgId)
return return
} }
this.$warning(this.$t('commons.no_target_permission')) this.$warning(this.$t('commons.no_target_permission'))
@ -247,7 +247,7 @@ export default {
this.visible = true this.visible = true
}, },
// //
setReaded(msgId) { setRead(msgId) {
updateStatus(msgId).then(res => { updateStatus(msgId).then(res => {
this.search() this.search()
}) })

View File

@ -166,7 +166,7 @@ export default {
// 线 // 线
// 线线 // 线线
if (needToShow.length) { if (needToShow.length) {
this.chooseTheTureLine(needToShow, isDownward, isRightward) this.chooseTheTrueLine(needToShow, isDownward, isRightward)
} }
}) })
}, },
@ -180,7 +180,7 @@ export default {
return Math.round(condition.dragShift - (width - curComponentStyle.width) / 2) return Math.round(condition.dragShift - (width - curComponentStyle.width) / 2)
}, },
chooseTheTureLine(needToShow, isDownward, isRightward) { chooseTheTrueLine(needToShow, isDownward, isRightward) {
// 线 // 线
// 线 // 线
if (isRightward) { if (isRightward) {

View File

@ -39,7 +39,7 @@
import eventBus from '@/components/canvas/utils/eventBus' import eventBus from '@/components/canvas/utils/eventBus'
import runAnimation from '@/components/canvas/utils/runAnimation' import runAnimation from '@/components/canvas/utils/runAnimation'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import calculateComponentPositonAndSize from '@/components/canvas/utils/calculateComponentPositonAndSize' import calculateComponentPositionAndSize from '@/components/canvas/utils/calculateComponentPositionAndSize'
import { mod360 } from '@/components/canvas/utils/translate' import { mod360 } from '@/components/canvas/utils/translate'
export default { export default {
@ -347,12 +347,12 @@ export default {
} }
needSave = true needSave = true
const curPositon = { const curPosition = {
x: moveEvent.clientX - editorRectInfo.left, x: moveEvent.clientX - editorRectInfo.left,
y: moveEvent.clientY - editorRectInfo.top y: moveEvent.clientY - editorRectInfo.top
} }
calculateComponentPositonAndSize(point, style, curPositon, proportion, needLockProportion, { calculateComponentPositionAndSize(point, style, curPosition, proportion, needLockProportion, {
center, center,
curPoint, curPoint,
symmetricPoint symmetricPoint

View File

@ -333,11 +333,11 @@
</div> </div>
<div <div
v-if="attrShow('titlePostion')" v-if="attrShow('titlePosition')"
style="width: 20px;float: left;margin-top: 2px;margin-left: 10px;" style="width: 20px;float: left;margin-top: 2px;margin-left: 10px;"
> >
<el-tooltip :content="$t('panel.title_position')"> <el-tooltip :content="$t('panel.title_position')">
<title-postion <title-position
:element-type="elementType" :element-type="elementType"
:show-vertical="showVertical" :show-vertical="showVertical"
:style-info="styleInfo" :style-info="styleInfo"
@ -506,7 +506,7 @@ export default {
'fontWeight', 'fontWeight',
'letterSpacing', 'letterSpacing',
'color', 'color',
'titlePostion' 'titlePosition'
], ],
// tab // tab
'de-tabs': [ 'de-tabs': [

View File

@ -176,7 +176,7 @@
<el-row style="height: 20px"> <el-row style="height: 20px">
<el-col :span="4"> <el-col :span="4">
<svg-icon <svg-icon
icon-class="warn-tre" icon-class="warn-tree"
style="width: 20px;height: 20px;float: right" style="width: 20px;height: 20px;float: right"
/> />
</el-col> </el-col>

View File

@ -12,10 +12,10 @@ const funcs = {
l: calculateLeft l: calculateLeft
} }
function calculateLeftTop(style, curPositon, proportion, needLockProportion, pointInfo) { function calculateLeftTop(style, curPosition, proportion, needLockProportion, pointInfo) {
const { symmetricPoint } = pointInfo const { symmetricPoint } = pointInfo
let newCenterPoint = getCenterPoint(curPositon, symmetricPoint) let newCenterPoint = getCenterPoint(curPosition, symmetricPoint)
let newTopLeftPoint = calculateRotatedPointCoordinate(curPositon, newCenterPoint, -style.rotate) let newTopLeftPoint = calculateRotatedPointCoordinate(curPosition, newCenterPoint, -style.rotate)
let newBottomRightPoint = calculateRotatedPointCoordinate(symmetricPoint, newCenterPoint, -style.rotate) let newBottomRightPoint = calculateRotatedPointCoordinate(symmetricPoint, newCenterPoint, -style.rotate)
let newWidth = newBottomRightPoint.x - newTopLeftPoint.x let newWidth = newBottomRightPoint.x - newTopLeftPoint.x
@ -50,10 +50,10 @@ function calculateLeftTop(style, curPositon, proportion, needLockProportion, poi
} }
} }
function calculateRightTop(style, curPositon, proportion, needLockProportion, pointInfo) { function calculateRightTop(style, curPosition, proportion, needLockProportion, pointInfo) {
const { symmetricPoint } = pointInfo const { symmetricPoint } = pointInfo
let newCenterPoint = getCenterPoint(curPositon, symmetricPoint) let newCenterPoint = getCenterPoint(curPosition, symmetricPoint)
let newTopRightPoint = calculateRotatedPointCoordinate(curPositon, newCenterPoint, -style.rotate) let newTopRightPoint = calculateRotatedPointCoordinate(curPosition, newCenterPoint, -style.rotate)
let newBottomLeftPoint = calculateRotatedPointCoordinate(symmetricPoint, newCenterPoint, -style.rotate) let newBottomLeftPoint = calculateRotatedPointCoordinate(symmetricPoint, newCenterPoint, -style.rotate)
let newWidth = newTopRightPoint.x - newBottomLeftPoint.x let newWidth = newTopRightPoint.x - newBottomLeftPoint.x
@ -85,11 +85,11 @@ function calculateRightTop(style, curPositon, proportion, needLockProportion, po
} }
} }
function calculateRightBottom(style, curPositon, proportion, needLockProportion, pointInfo) { function calculateRightBottom(style, curPosition, proportion, needLockProportion, pointInfo) {
const { symmetricPoint } = pointInfo const { symmetricPoint } = pointInfo
let newCenterPoint = getCenterPoint(curPositon, symmetricPoint) let newCenterPoint = getCenterPoint(curPosition, symmetricPoint)
let newTopLeftPoint = calculateRotatedPointCoordinate(symmetricPoint, newCenterPoint, -style.rotate) let newTopLeftPoint = calculateRotatedPointCoordinate(symmetricPoint, newCenterPoint, -style.rotate)
let newBottomRightPoint = calculateRotatedPointCoordinate(curPositon, newCenterPoint, -style.rotate) let newBottomRightPoint = calculateRotatedPointCoordinate(curPosition, newCenterPoint, -style.rotate)
let newWidth = newBottomRightPoint.x - newTopLeftPoint.x let newWidth = newBottomRightPoint.x - newTopLeftPoint.x
let newHeight = newBottomRightPoint.y - newTopLeftPoint.y let newHeight = newBottomRightPoint.y - newTopLeftPoint.y
@ -120,11 +120,11 @@ function calculateRightBottom(style, curPositon, proportion, needLockProportion,
} }
} }
function calculateLeftBottom(style, curPositon, proportion, needLockProportion, pointInfo) { function calculateLeftBottom(style, curPosition, proportion, needLockProportion, pointInfo) {
const { symmetricPoint } = pointInfo const { symmetricPoint } = pointInfo
let newCenterPoint = getCenterPoint(curPositon, symmetricPoint) let newCenterPoint = getCenterPoint(curPosition, symmetricPoint)
let newTopRightPoint = calculateRotatedPointCoordinate(symmetricPoint, newCenterPoint, -style.rotate) let newTopRightPoint = calculateRotatedPointCoordinate(symmetricPoint, newCenterPoint, -style.rotate)
let newBottomLeftPoint = calculateRotatedPointCoordinate(curPositon, newCenterPoint, -style.rotate) let newBottomLeftPoint = calculateRotatedPointCoordinate(curPosition, newCenterPoint, -style.rotate)
let newWidth = newTopRightPoint.x - newBottomLeftPoint.x let newWidth = newTopRightPoint.x - newBottomLeftPoint.x
let newHeight = newBottomLeftPoint.y - newTopRightPoint.y let newHeight = newBottomLeftPoint.y - newTopRightPoint.y
@ -155,12 +155,12 @@ function calculateLeftBottom(style, curPositon, proportion, needLockProportion,
} }
} }
function calculateTop(style, curPositon, proportion, needLockProportion, pointInfo) { function calculateTop(style, curPosition, proportion, needLockProportion, pointInfo) {
const { symmetricPoint, curPoint } = pointInfo const { symmetricPoint, curPoint } = pointInfo
const rotatedcurPositon = calculateRotatedPointCoordinate(curPositon, curPoint, -style.rotate) const rotatedcurPosition = calculateRotatedPointCoordinate(curPosition, curPoint, -style.rotate)
const rotatedTopMiddlePoint = calculateRotatedPointCoordinate({ const rotatedTopMiddlePoint = calculateRotatedPointCoordinate({
x: curPoint.x, x: curPoint.x,
y: rotatedcurPositon.y y: rotatedcurPosition.y
}, curPoint, style.rotate) }, curPoint, style.rotate)
// 勾股定理 // 勾股定理
@ -185,11 +185,11 @@ function calculateTop(style, curPositon, proportion, needLockProportion, pointIn
} }
} }
function calculateRight(style, curPositon, proportion, needLockProportion, pointInfo) { function calculateRight(style, curPosition, proportion, needLockProportion, pointInfo) {
const { symmetricPoint, curPoint } = pointInfo const { symmetricPoint, curPoint } = pointInfo
const rotatedcurPositon = calculateRotatedPointCoordinate(curPositon, curPoint, -style.rotate) const rotatedcurPosition = calculateRotatedPointCoordinate(curPosition, curPoint, -style.rotate)
const rotatedRightMiddlePoint = calculateRotatedPointCoordinate({ const rotatedRightMiddlePoint = calculateRotatedPointCoordinate({
x: rotatedcurPositon.x, x: rotatedcurPosition.x,
y: curPoint.y y: curPoint.y
}, curPoint, style.rotate) }, curPoint, style.rotate)
@ -213,12 +213,12 @@ function calculateRight(style, curPositon, proportion, needLockProportion, point
} }
} }
function calculateBottom(style, curPositon, proportion, needLockProportion, pointInfo) { function calculateBottom(style, curPosition, proportion, needLockProportion, pointInfo) {
const { symmetricPoint, curPoint } = pointInfo const { symmetricPoint, curPoint } = pointInfo
const rotatedcurPositon = calculateRotatedPointCoordinate(curPositon, curPoint, -style.rotate) const rotatedcurPosition = calculateRotatedPointCoordinate(curPosition, curPoint, -style.rotate)
const rotatedBottomMiddlePoint = calculateRotatedPointCoordinate({ const rotatedBottomMiddlePoint = calculateRotatedPointCoordinate({
x: curPoint.x, x: curPoint.x,
y: rotatedcurPositon.y y: rotatedcurPosition.y
}, curPoint, style.rotate) }, curPoint, style.rotate)
const newHeight = Math.sqrt((rotatedBottomMiddlePoint.x - symmetricPoint.x) ** 2 + (rotatedBottomMiddlePoint.y - symmetricPoint.y) ** 2) const newHeight = Math.sqrt((rotatedBottomMiddlePoint.x - symmetricPoint.x) ** 2 + (rotatedBottomMiddlePoint.y - symmetricPoint.y) ** 2)
@ -241,11 +241,11 @@ function calculateBottom(style, curPositon, proportion, needLockProportion, poin
} }
} }
function calculateLeft(style, curPositon, proportion, needLockProportion, pointInfo) { function calculateLeft(style, curPosition, proportion, needLockProportion, pointInfo) {
const { symmetricPoint, curPoint } = pointInfo const { symmetricPoint, curPoint } = pointInfo
const rotatedcurPositon = calculateRotatedPointCoordinate(curPositon, curPoint, -style.rotate) const rotatedcurPosition = calculateRotatedPointCoordinate(curPosition, curPoint, -style.rotate)
const rotatedLeftMiddlePoint = calculateRotatedPointCoordinate({ const rotatedLeftMiddlePoint = calculateRotatedPointCoordinate({
x: rotatedcurPositon.x, x: rotatedcurPosition.x,
y: curPoint.y y: curPoint.y
}, curPoint, style.rotate) }, curPoint, style.rotate)
@ -268,6 +268,6 @@ function calculateLeft(style, curPositon, proportion, needLockProportion, pointI
} }
} }
export default function calculateComponentPositonAndSize(name, style, curPositon, proportion, needLockProportion, pointInfo) { export default function calculateComponentPositionAndSize(name, style, curPosition, proportion, needLockProportion, pointInfo) {
funcs[name](style, curPositon, proportion, needLockProportion, pointInfo) funcs[name](style, curPosition, proportion, needLockProportion, pointInfo)
} }

View File

@ -7,7 +7,7 @@
label="1" label="1"
size="mini" size="mini"
border border
>{{ $t('cron.every') }}{{ lable }}</el-radio> >{{ $t('cron.every') }}{{ label }}</el-radio>
</div> </div>
<div> <div>
<el-radio <el-radio
@ -34,7 +34,7 @@
style="width: 100px;" style="width: 100px;"
@change="type = '2'" @change="type = '2'"
/> />
{{ lable }} {{ label }}
</div> </div>
<div> <div>
<el-radio <el-radio
@ -52,7 +52,7 @@
style="width: 100px;" style="width: 100px;"
@change="type = '3'" @change="type = '3'"
/> />
<span style="margin-left: 5px; margin-right: 5px;">{{ lable }}{{ $t('cron.every_begin') }}</span> <span style="margin-left: 5px; margin-right: 5px;">{{ label }}{{ $t('cron.every_begin') }}</span>
<el-input-number <el-input-number
v-model="loop.end" v-model="loop.end"
:min="1" :min="1"
@ -61,7 +61,7 @@
style="width: 100px;" style="width: 100px;"
@change="type = '3'" @change="type = '3'"
/> />
{{ lable }}{{ $t('cron.every_exec') }} {{ label }}{{ $t('cron.every_exec') }}
</div> </div>
<div> <div>
<el-radio <el-radio
@ -95,7 +95,7 @@ export default {
type: String, type: String,
default: '*' default: '*'
}, },
lable: { label: {
type: String type: String
} }
}, },

View File

@ -30,9 +30,9 @@
<div class="condition-content-container"> <div class="condition-content-container">
<div class="first-element"> <div class="first-element">
<div <div
:class="element.component === 'de-select-grid' ? 'first-element-grid-contaner': ''" :class="element.component === 'de-select-grid' ? 'first-element-grid-container': ''"
:style="deSelectGridBg" :style="deSelectGridBg"
class="first-element-contaner" class="first-element-container"
> >
<component <component
@ -241,7 +241,7 @@ export default {
padding: 0px; padding: 0px;
height: 100%; height: 100%;
} }
.first-element-contaner { .first-element-container {
width: calc(100% - 10px); width: calc(100% - 10px);
background: initial; background: initial;
margin: 0 4px; margin: 0 4px;
@ -251,7 +251,7 @@ export default {
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
} }
.first-element-grid-contaner { .first-element-grid-container {
background: #fff; background: #fff;
border: 1px solid #d7dae2; border: 1px solid #d7dae2;
top: 5px; top: 5px;

View File

@ -16,7 +16,7 @@
<div class="pagination-cont"> <div class="pagination-cont">
<el-pagination <el-pagination
background background
v-bind="paginationDefalut" v-bind="paginationDefault"
v-on="paginationEvent" v-on="paginationEvent"
/> />
</div> </div>
@ -56,27 +56,27 @@ export default {
data() { data() {
return { return {
paginationEvent: {}, paginationEvent: {},
paginationDefalut: { paginationDefault: {
currentPage: 1, currentPage: 1,
pageSizes: [10, 20, 50, 100], pageSizes: [10, 20, 50, 100],
pageSize: 10, pageSize: 10,
layout: 'total, prev, pager, next, sizes, jumper', layout: 'total, prev, pager, next, sizes, jumper',
total: 0 total: 0
}, },
multipleSelectionCach: [], multipleSelectionCache: [],
tableEvent: {} tableEvent: {}
} }
}, },
computed: { computed: {
multipleSelectionAll() { multipleSelectionAll() {
return [...this.multipleSelectionCach, ...this.multipleSelection] return [...this.multipleSelectionCache, ...this.multipleSelection]
} }
}, },
watch: { watch: {
pagination: { pagination: {
handler() { handler() {
this.paginationDefalut = { this.paginationDefault = {
...this.paginationDefalut, ...this.paginationDefault,
...this.pagination ...this.pagination
} }
}, },
@ -114,24 +114,24 @@ export default {
this.$refs.table.toggleRowSelection(row, true) this.$refs.table.toggleRowSelection(row, true)
}, },
handlerSelected(multipleSelection) { handlerSelected(multipleSelection) {
this.multipleSelectionCach = [ this.multipleSelectionCache = [
...this.multipleSelectionCach, ...this.multipleSelectionCache,
...multipleSelection ...multipleSelection
] ]
const flags = this.multipleSelectionCach.map( const flags = this.multipleSelectionCache.map(
(ele) => ele[this.selectedFlags] (ele) => ele[this.selectedFlags]
) )
// //
const notCurrenArr = [] const notCurrentArr = []
this.tableData.forEach((ele) => { this.tableData.forEach((ele) => {
const resultIndex = flags.indexOf(ele[this.selectedFlags]) const resultIndex = flags.indexOf(ele[this.selectedFlags])
if (resultIndex !== -1) { if (resultIndex !== -1) {
this.$refs.table.toggleRowSelection(ele, true) this.$refs.table.toggleRowSelection(ele, true)
notCurrenArr.push(resultIndex) notCurrentArr.push(resultIndex)
} }
}) })
notCurrenArr.sort().reduceRight((pre, next) => { notCurrentArr.sort().reduceRight((pre, next) => {
this.multipleSelectionCach.splice(next, 1) this.multipleSelectionCache.splice(next, 1)
}, 0) }, 0)
}, },
handleListeners() { handleListeners() {

View File

@ -116,7 +116,7 @@ export default {
}, },
form: { form: {
handler(value) { handler(value) {
this.destryTimeMachine() this.destroyTimeMachine()
this.changeIndex++ this.changeIndex++
this.searchWithKey(this.changeIndex) this.searchWithKey(this.changeIndex)
}, },
@ -161,10 +161,10 @@ export default {
if (index === this.changeIndex) { if (index === this.changeIndex) {
this.search() this.search()
} }
this.destryTimeMachine() this.destroyTimeMachine()
}, 1000) }, 1000)
}, },
destryTimeMachine() { destroyTimeMachine() {
this.timeMachine && clearTimeout(this.timeMachine) this.timeMachine && clearTimeout(this.timeMachine)
this.timeMachine = null this.timeMachine = null
}, },

View File

@ -15,7 +15,7 @@
:filter-method="filterMethod" :filter-method="filterMethod"
:key-word="keyWord" :key-word="keyWord"
popper-class="coustom-de-select" popper-class="coustom-de-select"
:list="datas" :list="data"
:custom-style="customStyle" :custom-style="customStyle"
@change="changeValue" @change="changeValue"
@focus="setOptionWidth" @focus="setOptionWidth"
@ -24,7 +24,7 @@
@handleShowNumber="handleShowNumber" @handleShowNumber="handleShowNumber"
> >
<el-option <el-option
v-for="item in templateDatas || datas" v-for="item in templateData || data"
:key="item[element.options.attrs.key]" :key="item[element.options.attrs.key]"
:style="{width:selectOptionWidth}" :style="{width:selectOptionWidth}"
:label="item[element.options.attrs.label]" :label="item[element.options.attrs.label]"
@ -77,7 +77,7 @@ export default {
selectOptionWidth: 0, selectOptionWidth: 0,
show: true, show: true,
value: null, value: null,
datas: [], data: [],
onFocus: false, onFocus: false,
keyWord: '' keyWord: ''
} }
@ -90,7 +90,7 @@ export default {
} }
return result return result
}, },
templateDatas() { templateData() {
return this.mode === 'el-visual-select' ? [] : null return this.mode === 'el-visual-select' ? [] : null
}, },
operator() { operator() {
@ -133,7 +133,7 @@ export default {
}, },
'element.options.attrs.fieldId': function(value, old) { 'element.options.attrs.fieldId': function(value, old) {
if (value === null || typeof value === 'undefined' || value === old) return if (value === null || typeof value === 'undefined' || value === old) return
this.datas = [] this.data = []
let method = multFieldValues let method = multFieldValues
const token = this.$store.getters.token || getToken() const token = this.$store.getters.token || getToken()
@ -148,7 +148,7 @@ export default {
this.element.options.attrs.fieldId && this.element.options.attrs.fieldId &&
this.element.options.attrs.fieldId.length > 0 && this.element.options.attrs.fieldId.length > 0 &&
method(param).then(res => { method(param).then(res => {
this.datas = this.optionDatas(res.data) this.data = this.optionData(res.data)
bus.$emit('valid-values-change', true) bus.$emit('valid-values-change', true)
}).catch(e => { }).catch(e => {
bus.$emit('valid-values-change', false) bus.$emit('valid-values-change', false)
@ -171,7 +171,7 @@ export default {
if (value === null || typeof value === 'undefined' || value === old || isSameVueObj(value, old)) return if (value === null || typeof value === 'undefined' || value === old || isSameVueObj(value, old)) return
this.show = false this.show = false
this.datas = [] this.data = []
let method = multFieldValues let method = multFieldValues
const token = this.$store.getters.token || getToken() const token = this.$store.getters.token || getToken()
@ -186,7 +186,7 @@ export default {
this.element.options.attrs.fieldId && this.element.options.attrs.fieldId &&
this.element.options.attrs.fieldId.length > 0 && this.element.options.attrs.fieldId.length > 0 &&
method(param).then(res => { method(param).then(res => {
this.datas = this.optionDatas(res.data) this.data = this.optionData(res.data)
this.$nextTick(() => { this.$nextTick(() => {
this.show = true this.show = true
this.handleCoustomStyle() this.handleCoustomStyle()
@ -248,7 +248,7 @@ export default {
}, },
initLoad() { initLoad() {
this.value = this.fillValueDerfault() this.value = this.fillValueDerfault()
this.datas = [] this.data = []
if (this.element.options.attrs.fieldId) { if (this.element.options.attrs.fieldId) {
let method = multFieldValues let method = multFieldValues
const token = this.$store.getters.token || getToken() const token = this.$store.getters.token || getToken()
@ -257,7 +257,7 @@ export default {
method = linkMultFieldValues method = linkMultFieldValues
} }
method({ fieldIds: this.element.options.attrs.fieldId.split(','), sort: this.element.options.attrs.sort }).then(res => { method({ fieldIds: this.element.options.attrs.fieldId.split(','), sort: this.element.options.attrs.sort }).then(res => {
this.datas = this.optionDatas(res.data) this.data = this.optionData(res.data)
bus.$emit('valid-values-change', true) bus.$emit('valid-values-change', true)
}).catch(e => { }).catch(e => {
bus.$emit('valid-values-change', false) bus.$emit('valid-values-change', false)
@ -336,9 +336,9 @@ export default {
return defaultV.split(',')[0] return defaultV.split(',')[0]
} }
}, },
optionDatas(datas) { optionData(data) {
if (!datas) return null if (!data) return null
return datas.filter(item => !!item).map(item => { return data.filter(item => !!item).map(item => {
return { return {
id: item, id: item,
text: item text: item

View File

@ -32,7 +32,7 @@
@change="handleCheckedChange" @change="handleCheckedChange"
> >
<el-checkbox <el-checkbox
v-for="item in datas.filter(node => !keyWord || (node.id && node.id.includes(keyWord)))" v-for="item in data.filter(node => !keyWord || (node.id && node.id.includes(keyWord)))"
:key="item.id" :key="item.id"
:label="item.id" :label="item.id"
>{{ item.id }}</el-checkbox> >{{ item.id }}</el-checkbox>
@ -48,7 +48,7 @@
@change="changeRadioBox" @change="changeRadioBox"
> >
<el-radio <el-radio
v-for="(item, index) in datas.filter(node => !keyWord || (node.id && node.id.includes(keyWord)))" v-for="(item, index) in data.filter(node => !keyWord || (node.id && node.id.includes(keyWord)))"
:key="index" :key="index"
:label="item.id" :label="item.id"
@click.native.prevent="testChange(item)" @click.native.prevent="testChange(item)"
@ -109,7 +109,7 @@ export default {
indeterminate: false indeterminate: false
}, },
show: true, show: true,
datas: [], data: [],
isIndeterminate: false, isIndeterminate: false,
checkAll: false checkAll: false
} }
@ -148,13 +148,13 @@ export default {
this.changeValue(value) this.changeValue(value)
if (this.element.options.attrs.multiple) { if (this.element.options.attrs.multiple) {
this.checkAll = this.value.length === this.datas.length this.checkAll = this.value.length === this.data.length
this.isIndeterminate = this.value.length > 0 && this.value.length < this.datas.length this.isIndeterminate = this.value.length > 0 && this.value.length < this.data.length
} }
}, },
'element.options.attrs.fieldId': function(value, old) { 'element.options.attrs.fieldId': function(value, old) {
if (typeof value === 'undefined' || value === old) return if (typeof value === 'undefined' || value === old) return
this.datas = [] this.data = []
let method = multFieldValues let method = multFieldValues
const token = this.$store.getters.token || getToken() const token = this.$store.getters.token || getToken()
const linkToken = this.$store.getters.linkToken || getLinkToken() const linkToken = this.$store.getters.linkToken || getLinkToken()
@ -168,11 +168,11 @@ export default {
this.element.options.attrs.fieldId && this.element.options.attrs.fieldId &&
this.element.options.attrs.fieldId.length > 0 && this.element.options.attrs.fieldId.length > 0 &&
method(param).then(res => { method(param).then(res => {
this.datas = this.optionDatas(res.data) this.data = this.optionData(res.data)
this.changeInputStyle() this.changeInputStyle()
if (this.element.options.attrs.multiple) { if (this.element.options.attrs.multiple) {
this.checkAll = this.value.length === this.datas.length this.checkAll = this.value.length === this.data.length
this.isIndeterminate = this.value.length > 0 && this.value.length < this.datas.length this.isIndeterminate = this.value.length > 0 && this.value.length < this.data.length
} }
}) || (this.element.options.value = '') }) || (this.element.options.value = '')
}, },
@ -189,15 +189,15 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.show = true this.show = true
if (value) { if (value) {
this.checkAll = this.value.length === this.datas.length this.checkAll = this.value.length === this.data.length
this.isIndeterminate = this.value.length > 0 && this.value.length < this.datas.length this.isIndeterminate = this.value.length > 0 && this.value.length < this.data.length
} }
this.changeInputStyle() this.changeInputStyle()
}) })
}, },
'element.options.attrs.sort': function(value, old) { 'element.options.attrs.sort': function(value, old) {
if (typeof value === 'undefined' || value === old) return if (typeof value === 'undefined' || value === old) return
this.datas = [] this.data = []
let method = multFieldValues let method = multFieldValues
const token = this.$store.getters.token || getToken() const token = this.$store.getters.token || getToken()
const linkToken = this.$store.getters.linkToken || getLinkToken() const linkToken = this.$store.getters.linkToken || getLinkToken()
@ -211,11 +211,11 @@ export default {
this.element.options.attrs.fieldId && this.element.options.attrs.fieldId &&
this.element.options.attrs.fieldId.length > 0 && this.element.options.attrs.fieldId.length > 0 &&
method(param).then(res => { method(param).then(res => {
this.datas = this.optionDatas(res.data) this.data = this.optionData(res.data)
this.changeInputStyle() this.changeInputStyle()
if (this.element.options.attrs.multiple) { if (this.element.options.attrs.multiple) {
this.checkAll = this.value.length === this.datas.length this.checkAll = this.value.length === this.data.length
this.isIndeterminate = this.value.length > 0 && this.value.length < this.datas.length this.isIndeterminate = this.value.length > 0 && this.value.length < this.data.length
} }
}) || (this.element.options.value = '') }) || (this.element.options.value = '')
}, },
@ -251,8 +251,8 @@ export default {
this.changeValue(this.value) this.changeValue(this.value)
if (this.element.options.attrs.multiple) { if (this.element.options.attrs.multiple) {
this.checkAll = this.value.length === this.datas.length this.checkAll = this.value.length === this.data.length
this.isIndeterminate = this.value.length > 0 && this.value.length < this.datas.length this.isIndeterminate = this.value.length > 0 && this.value.length < this.data.length
} }
} }
}, },
@ -284,11 +284,11 @@ export default {
method = linkMultFieldValues method = linkMultFieldValues
} }
method({ fieldIds: this.element.options.attrs.fieldId.split(','), sort: this.element.options.attrs.sort }).then(res => { method({ fieldIds: this.element.options.attrs.fieldId.split(','), sort: this.element.options.attrs.sort }).then(res => {
this.datas = this.optionDatas(res.data) this.data = this.optionData(res.data)
this.changeInputStyle() this.changeInputStyle()
if (this.element.options.attrs.multiple) { if (this.element.options.attrs.multiple) {
this.checkAll = this.value.length === this.datas.length this.checkAll = this.value.length === this.data.length
this.isIndeterminate = this.value.length > 0 && this.value.length < this.datas.length this.isIndeterminate = this.value.length > 0 && this.value.length < this.data.length
} }
}) })
} }
@ -337,9 +337,9 @@ export default {
return defaultV.split(',')[0] return defaultV.split(',')[0]
} }
}, },
optionDatas(datas) { optionData(data) {
if (!datas) return null if (!data) return null
return datas.filter(item => !!item).map(item => { return data.filter(item => !!item).map(item => {
return { return {
id: item, id: item,
text: item text: item
@ -350,14 +350,14 @@ export default {
this.changeValue(value) this.changeValue(value)
}, },
handleCheckAllChange(val) { handleCheckAllChange(val) {
this.value = val ? this.datas.map(item => item.id) : [] this.value = val ? this.data.map(item => item.id) : []
this.isIndeterminate = false this.isIndeterminate = false
this.changeValue(this.value) this.changeValue(this.value)
}, },
handleCheckedChange(values) { handleCheckedChange(values) {
const checkedCount = values.length const checkedCount = values.length
this.checkAll = checkedCount === this.datas.length this.checkAll = checkedCount === this.data.length
this.isIndeterminate = checkedCount > 0 && checkedCount < this.datas.length this.isIndeterminate = checkedCount > 0 && checkedCount < this.data.length
this.changeValue(values) this.changeValue(values)
}, },
testChange(item) { testChange(item) {

View File

@ -5,7 +5,7 @@
ref="deSelectTree" ref="deSelectTree"
v-model="value" v-model="value"
popover-class="test-class-wrap" popover-class="test-class-wrap"
:data="datas" :data="data"
:select-params="selectParams" :select-params="selectParams"
:tree-params="treeParams" :tree-params="treeParams"
:filter-node-method="_filterFun" :filter-node-method="_filterFun"
@ -17,7 +17,7 @@
@removeTag="changeNodeIds" @removeTag="changeNodeIds"
@check="changeCheckNode" @check="changeCheckNode"
@select-clear="selectClear" @select-clear="selectClear"
@onFoucs="onFoucs" @onFocus="onFocus"
@treeCheckChange="handleElTagStyle" @treeCheckChange="handleElTagStyle"
/> />
@ -59,7 +59,7 @@ export default {
return { return {
show: true, show: true,
selectOptionWidth: 0, selectOptionWidth: 0,
datas: [], data: [],
// eslint-disable-next-line // eslint-disable-next-line
value: this.isSingle ? '' : [], value: this.isSingle ? '' : [],
selectParams: { selectParams: {
@ -128,7 +128,7 @@ export default {
}, },
'element.options.attrs.fieldId': function(value, old) { 'element.options.attrs.fieldId': function(value, old) {
if (value === null || typeof value === 'undefined' || value === old) return if (value === null || typeof value === 'undefined' || value === old) return
this.datas = [] this.data = []
let method = mappingFieldValues let method = mappingFieldValues
const token = this.$store.getters.token || getToken() const token = this.$store.getters.token || getToken()
@ -143,9 +143,9 @@ export default {
this.element.options.attrs.fieldId && this.element.options.attrs.fieldId &&
this.element.options.attrs.fieldId.length > 0 && this.element.options.attrs.fieldId.length > 0 &&
method(param).then(res => { method(param).then(res => {
this.datas = this.optionDatas(res.data) this.data = this.optionData(res.data)
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.deSelectTree && this.$refs.deSelectTree.treeDataUpdateFun(this.datas) this.$refs.deSelectTree && this.$refs.deSelectTree.treeDataUpdateFun(this.data)
}) })
}) })
this.element.options.value = '' this.element.options.value = ''
@ -177,13 +177,13 @@ export default {
this.value = defaultV.split(',')[0] this.value = defaultV.split(',')[0]
} }
} }
this.$refs.deSelectTree && this.$refs.deSelectTree.treeDataUpdateFun(this.datas) this.$refs.deSelectTree && this.$refs.deSelectTree.treeDataUpdateFun(this.data)
}) })
}) })
}, },
'element.options.attrs.sort': function(value, old) { 'element.options.attrs.sort': function(value, old) {
if (value === null || typeof value === 'undefined' || value === old || isSameVueObj(value, old)) return if (value === null || typeof value === 'undefined' || value === old || isSameVueObj(value, old)) return
this.datas = [] this.data = []
let method = mappingFieldValues let method = mappingFieldValues
const token = this.$store.getters.token || getToken() const token = this.$store.getters.token || getToken()
@ -198,9 +198,9 @@ export default {
this.element.options.attrs.fieldId && this.element.options.attrs.fieldId &&
this.element.options.attrs.fieldId.length > 0 && this.element.options.attrs.fieldId.length > 0 &&
method(param).then(res => { method(param).then(res => {
this.datas = this.optionDatas(res.data) this.data = this.optionData(res.data)
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.deSelectTree && this.$refs.deSelectTree.treeDataUpdateFun(this.datas) this.$refs.deSelectTree && this.$refs.deSelectTree.treeDataUpdateFun(this.data)
}) })
}) })
this.element.options.value = '' this.element.options.value = ''
@ -233,7 +233,7 @@ export default {
this.changeValue(this.value) this.changeValue(this.value)
} }
}, },
onFoucs() { onFocus() {
this.$nextTick(() => { this.$nextTick(() => {
this.handleCoustomStyle() this.handleCoustomStyle()
}) })
@ -260,7 +260,7 @@ export default {
}, },
initLoad() { initLoad() {
this.value = this.fillValueDerfault() this.value = this.fillValueDerfault()
this.datas = [] this.data = []
if (this.element.options.attrs.fieldId) { if (this.element.options.attrs.fieldId) {
let method = mappingFieldValues let method = mappingFieldValues
const token = this.$store.getters.token || getToken() const token = this.$store.getters.token || getToken()
@ -269,9 +269,9 @@ export default {
method = linkMappingFieldValues method = linkMappingFieldValues
} }
method({ fieldIds: this.element.options.attrs.fieldId.split(','), sort: this.element.options.attrs.sort }).then(res => { method({ fieldIds: this.element.options.attrs.fieldId.split(','), sort: this.element.options.attrs.sort }).then(res => {
this.datas = this.optionDatas(res.data) this.data = this.optionData(res.data)
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.deSelectTree && this.$refs.deSelectTree.treeDataUpdateFun(this.datas) this.$refs.deSelectTree && this.$refs.deSelectTree.treeDataUpdateFun(this.data)
}) })
}) })
} }
@ -355,10 +355,10 @@ export default {
return defaultV.split(',')[0] return defaultV.split(',')[0]
} }
}, },
optionDatas(datas) { optionData(data) {
if (!datas) return null if (!data) return null
return datas.filter(item => !!item) return data.filter(item => !!item)
}, },
/* 下面是树的渲染方法 */ /* 下面是树的渲染方法 */

View File

@ -41,21 +41,21 @@
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="beforeHandleCommond('editTitle', item)"> <el-dropdown-item :command="beforeHandleCommand('editTitle', item)">
{{ $t('detabs.eidttitle') }} {{ $t('detabs.eidttitle') }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item :command="beforeHandleCommond('selectView', item)"> <el-dropdown-item :command="beforeHandleCommand('selectView', item)">
{{ $t('detabs.selectview') }} {{ $t('detabs.selectview') }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item :command="beforeHandleCommond('selectOthers', item)"> <el-dropdown-item :command="beforeHandleCommand('selectOthers', item)">
{{ $t('detabs.selectOthers') }} {{ $t('detabs.selectOthers') }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item <el-dropdown-item
v-if=" element.options.tabList.length > 1" v-if=" element.options.tabList.length > 1"
:command="beforeHandleCommond('deleteCur', item)" :command="beforeHandleCommand('deleteCur', item)"
> >
{{ $t('table.delete') }} {{ $t('table.delete') }}
</el-dropdown-item> </el-dropdown-item>
@ -348,7 +348,7 @@ export default {
} }
}) })
}, },
beforeHandleCommond(item, param) { beforeHandleCommand(item, param) {
return { return {
'command': item, 'command': item,
'param': param 'param': param
@ -477,8 +477,8 @@ export default {
if (this.element.options.tabList[len].name === param.name) { if (this.element.options.tabList[len].name === param.name) {
this.element.options.tabList.splice(len, 1) this.element.options.tabList.splice(len, 1)
const activIndex = (len - 1 + this.element.options.tabList.length) % this.element.options.tabList.length const activeIndex = (len - 1 + this.element.options.tabList.length) % this.element.options.tabList.length
this.activeTabName = this.element.options.tabList[activIndex].name this.activeTabName = this.element.options.tabList[activeIndex].name
} }
} }
this.$store.dispatch('chart/setViewId', null) this.$store.dispatch('chart/setViewId', null)

View File

@ -10,7 +10,7 @@
@change="changeValue" @change="changeValue"
> >
<el-option <el-option
v-for="item in options.attrs.datas" v-for="item in options.attrs.data"
:key="item[options.attrs.key]" :key="item[options.attrs.key]"
:label="item[options.attrs.label]" :label="item[options.attrs.label]"
:value="item[options.attrs.value]" :value="item[options.attrs.value]"

View File

@ -86,7 +86,7 @@
* @author: v_zhuchun * @author: v_zhuchun
* @date: 2019-05-23 * @date: 2019-05-23
* @description: UI组件 可选择季节 * @description: UI组件 可选择季节
* @api: valueArr : 季度value defalut['01-03', '04-06', '07-09', '10-12'] 默认值待设置 * @api: valueArr : 季度value default['01-03', '04-06', '07-09', '10-12'] 默认值待设置
*/ */
export default { export default {
props: { props: {

View File

@ -13,7 +13,7 @@ const dialogPanel = {
multiple: false, multiple: false,
placeholder: 'denumbergridselect.placeholder', placeholder: 'denumbergridselect.placeholder',
viewIds: [], viewIds: [],
datas: [], data: [],
key: 'id', key: 'id',
label: 'text', label: 'text',
value: 'id', value: 'id',
@ -73,9 +73,9 @@ class NumberSelectGridServiceImpl extends WidgetService {
}) })
} }
optionDatas(datas) { optionData(data) {
if (!datas) return null if (!data) return null
return datas.filter(item => !!item).map(item => { return data.filter(item => !!item).map(item => {
return { return {
id: item, id: item,
text: item text: item

View File

@ -12,7 +12,7 @@ const dialogPanel = {
attrs: { attrs: {
multiple: false, multiple: false,
placeholder: 'denumberselect.placeholder', placeholder: 'denumberselect.placeholder',
datas: [], data: [],
viewIds: [], viewIds: [],
parameters: [], parameters: [],
key: 'id', key: 'id',
@ -75,9 +75,9 @@ class NumberSelectServiceImpl extends WidgetService {
}) })
} }
optionDatas(datas) { optionData(data) {
if (!datas) return null if (!data) return null
return datas.filter(item => !!item).map(item => { return data.filter(item => !!item).map(item => {
return { return {
id: item, id: item,
text: item text: item

View File

@ -14,7 +14,7 @@ const dialogPanel = {
placeholder: 'detextgridselect.placeholder', placeholder: 'detextgridselect.placeholder',
viewIds: [], viewIds: [],
parameters: [], parameters: [],
datas: [], data: [],
key: 'id', key: 'id',
label: 'text', label: 'text',
value: 'id', value: 'id',
@ -74,9 +74,9 @@ class TextSelectGridServiceImpl extends WidgetService {
}) })
} }
optionDatas(datas) { optionData(data) {
if (!datas) return null if (!data) return null
return datas.filter(item => !!item).map(item => { return data.filter(item => !!item).map(item => {
return { return {
id: item, id: item,
text: item text: item

View File

@ -13,7 +13,7 @@ const dialogPanel = {
placeholder: 'detextselect.placeholder', placeholder: 'detextselect.placeholder',
viewIds: [], viewIds: [],
parameters: [], parameters: [],
datas: [], data: [],
key: 'id', key: 'id',
label: 'text', label: 'text',
value: 'id', value: 'id',
@ -77,9 +77,9 @@ class TextSelectServiceImpl extends WidgetService {
}) })
} }
optionDatas(datas) { optionData(data) {
if (!datas) return null if (!data) return null
return datas.filter(item => !!item).map(item => { return data.filter(item => !!item).map(item => {
return { return {
id: item, id: item,
text: item text: item

View File

@ -13,7 +13,7 @@ const dialogPanel = {
placeholder: 'detextselectTree.placeholder', placeholder: 'detextselectTree.placeholder',
viewIds: [], viewIds: [],
parameters: [], parameters: [],
datas: [], data: [],
key: 'id', key: 'id',
label: 'text', label: 'text',
value: 'id', value: 'id',
@ -76,9 +76,9 @@ class TextSelectTreeServiceImpl extends WidgetService {
}) })
} }
optionDatas(datas) { optionData(data) {
if (!datas) return null if (!data) return null
return datas.filter(item => !!item).map(item => { return data.filter(item => !!item).map(item => {
return { return {
id: item, id: item,
text: item text: item

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -35,7 +35,7 @@ export default {
custom_table_fields_desc: 'Fixed field is not in the selection range' custom_table_fields_desc: 'Fixed field is not in the selection range'
}, },
steps: { steps: {
cancel: 'Cancle', cancel: 'Cancel',
next: 'next', next: 'next',
prev: 'Last step', prev: 'Last step',
finish: 'Finish' finish: 'Finish'
@ -613,7 +613,7 @@ export default {
member: { member: {
create: 'Add members', create: 'Add members',
modify: 'Modify members', modify: 'Modify members',
delete_confirm: 'Comfirm to delete this user?', delete_confirm: 'Confirm to delete this user?',
please_choose_member: 'Please choose member', please_choose_member: 'Please choose member',
search_by_name: 'Search by name', search_by_name: 'Search by name',
modify_personal_info: 'Modify personal info', modify_personal_info: 'Modify personal info',
@ -792,12 +792,12 @@ export default {
move_success: 'Removed successfully', move_success: 'Removed successfully',
user: 'user', user: 'user',
add_organization: 'Add organization', add_organization: 'Add organization',
defalut_organization_canot_move: 'The default organization cannot be deleted', default_organization_cannot_move: 'The default organization cannot be deleted',
organization_name: 'Organization name', organization_name: 'Organization name',
input_organization_name: 'Please enter the organization name', input_organization_name: 'Please enter the organization name',
relate_top_organization: 'Associated parent organization', relate_top_organization: 'Associated parent organization',
organization_name_exist: 'Organization name already exists', organization_name_exist: 'Organization name already exists',
canot_delete: 'Cannot delete', cannot_delete: 'Cannot delete',
remove_user_first: 'Please remove all users in the organization before deleting the organization', remove_user_first: 'Please remove all users in the organization before deleting the organization',
sure_delete_organization: 'Are you sure to delete this organization?', sure_delete_organization: 'Are you sure to delete this organization?',
add_child_org: 'Add sub organization', add_child_org: 'Add sub organization',
@ -1429,7 +1429,8 @@ export default {
reserve_one: '1', reserve_one: '1',
reserve_two: '2', reserve_two: '2',
proportion: 'Proportion', proportion: 'Proportion',
label_content: 'Label Content' label_content: 'Label Content',
percent: 'Percent'
}, },
dataset: { dataset: {
parse_filed: 'Parse Field', parse_filed: 'Parse Field',
@ -1721,7 +1722,7 @@ export default {
please_input_user_name: 'Please enter user name', please_input_user_name: 'Please enter user name',
please_input_password: 'Please enter Password', please_input_password: 'Please enter Password',
please_input_host: 'Please enter host', please_input_host: 'Please enter host',
please_input_url: 'Please enter url adress', please_input_url: 'Please enter url address',
please_input_port: 'Please enter port', please_input_port: 'Please enter port',
modify: 'Edit data Source', modify: 'Edit data Source',
validate_success: 'Verification successful', validate_success: 'Verification successful',
@ -1960,7 +1961,7 @@ export default {
confirm_delete: 'Confirm Delete', confirm_delete: 'Confirm Delete',
delete_success: 'Delete Success', delete_success: 'Delete Success',
confirm: 'Confirm', confirm: 'Confirm',
cancel: 'Cancle', cancel: 'Cancel',
search: 'Search', search: 'Search',
back: 'Back', back: 'Back',
view: 'Chart', view: 'Chart',
@ -2165,7 +2166,7 @@ export default {
install_time: 'Install Time', install_time: 'Install Time',
release_time: 'Time', release_time: 'Time',
un_install: 'Uninstall', un_install: 'Uninstall',
uninstall_confirm: 'Comfirm to uninstall the plugin?', uninstall_confirm: 'Confirm to uninstall the plugin?',
uninstall_cancel: 'Cancel uninstall plugin', uninstall_cancel: 'Cancel uninstall plugin',
un_install_success: 'Uninstall is successful and restart takes effect', un_install_success: 'Uninstall is successful and restart takes effect',
un_install_error: 'Uninstall failed, please contact the administrator' un_install_error: 'Uninstall failed, please contact the administrator'
@ -2253,7 +2254,7 @@ export default {
screen_method: 'Screening method', screen_method: 'Screening method',
select: 'Please select', select: 'Please select',
fixed_value: 'Fixed value', fixed_value: 'Fixed value',
defalut_method: 'Default condition', default_method: 'Default condition',
select_all: 'Select all', select_all: 'Select all',
added: 'Added', added: 'Added',
manual_input: 'Manual input', manual_input: 'Manual input',
@ -2273,7 +2274,7 @@ export default {
version_num: 'Version number', version_num: 'Version number',
standard: 'Standard', standard: 'Standard',
enterprise: 'Enterprise', enterprise: 'Enterprise',
suport: 'Get technical support', support: 'Get technical support',
update_success: 'Update Success' update_success: 'Update Success'
}, },
template: { template: {
@ -2344,8 +2345,8 @@ export default {
sned_time: 'Send Time', sned_time: 'Send Time',
read_time: 'Read Time', read_time: 'Read Time',
type: 'Message Type', type: 'Message Type',
mark_readed: 'Mark As Read', mark_read: 'Mark As Read',
all_mark_readed: 'Mark All As Read', all_mark_read: 'Mark All As Read',
please_select: 'Please select at least one message', please_select: 'Please select at least one message',
mark_success: 'Mark read successfully', mark_success: 'Mark read successfully',
receive_manage: 'Receive Manage', receive_manage: 'Receive Manage',
@ -2353,7 +2354,7 @@ export default {
i18n_msg_type_panel_share_cacnel: 'Dashboard unshared', i18n_msg_type_panel_share_cacnel: 'Dashboard unshared',
i18n_msg_type_dataset_sync: 'Data set synchronization', i18n_msg_type_dataset_sync: 'Data set synchronization',
i18n_msg_type_dataset_sync_success: 'Dataset synchronization successful', i18n_msg_type_dataset_sync_success: 'Dataset synchronization successful',
i18n_msg_type_dataset_sync_faild: 'Dataset synchronization failed', i18n_msg_type_dataset_sync_failed: 'Dataset synchronization failed',
i18n_msg_type_all: 'All type', i18n_msg_type_all: 'All type',
i18n_msg_type_ds_invalid: 'Datasource invalid', i18n_msg_type_ds_invalid: 'Datasource invalid',
channel_inner_msg: 'On site', channel_inner_msg: 'On site',
@ -2369,7 +2370,7 @@ export default {
please_key_max: 'Please key max value', please_key_max: 'Please key max value',
out_of_min: 'The min value cannot be less than the min integer -2³²', out_of_min: 'The min value cannot be less than the min integer -2³²',
out_of_max: 'The max value cannot be more than the max integer 2³²-1', out_of_max: 'The max value cannot be more than the max integer 2³²-1',
must_int: 'Please key interger', must_int: 'Please key integer',
min_out_max: 'The min value must be less than the max value', min_out_max: 'The min value must be less than the max value',
max_out_min: 'The max value must be more than the min value' max_out_min: 'The max value must be more than the min value'
}, },

View File

@ -8,7 +8,7 @@ export default {
pagePermission: 'Permisos de la página', pagePermission: 'Permisos de la página',
directivePermission: 'Permisos de la directiva', directivePermission: 'Permisos de la directiva',
icons: 'Iconos', icons: 'Iconos',
components: 'Componentes', components: 'Components',
tinymce: 'Tinymce', tinymce: 'Tinymce',
markdown: 'Markdown', markdown: 'Markdown',
jsonEditor: 'Editor JSON', jsonEditor: 'Editor JSON',
@ -123,7 +123,7 @@ export default {
reviewer: 'reviewer', reviewer: 'reviewer',
id: 'ID', id: 'ID',
date: 'Fecha', date: 'Fecha',
author: 'Autor', author: 'Author',
readings: 'Lector', readings: 'Lector',
status: 'Estado', status: 'Estado',
actions: 'Acciones', actions: 'Acciones',

View File

@ -791,12 +791,12 @@ export default {
move_success: '移除成功', move_success: '移除成功',
user: '用戶', user: '用戶',
add_organization: '添加組織', add_organization: '添加組織',
defalut_organization_canot_move: '默認組織無法刪除', default_organization_cannot_move: '默認組織無法刪除',
organization_name: '組織名稱', organization_name: '組織名稱',
input_organization_name: '請輸入組織名稱', input_organization_name: '請輸入組織名稱',
relate_top_organization: '關聯上級組織', relate_top_organization: '關聯上級組織',
organization_name_exist: '組織名稱已存在', organization_name_exist: '組織名稱已存在',
canot_delete: '無法刪除', cannot_delete: '無法刪除',
remove_user_first: '請先移除組織中所有用戶,再進行刪除組織操作。', remove_user_first: '請先移除組織中所有用戶,再進行刪除組織操作。',
sure_delete_organization: '確定刪除該組織嗎?', sure_delete_organization: '確定刪除該組織嗎?',
delete: '刪除', delete: '刪除',
@ -1429,7 +1429,8 @@ export default {
reserve_one: '一位', reserve_one: '一位',
reserve_two: '两位', reserve_two: '两位',
proportion: '佔比', proportion: '佔比',
label_content: '標籤展示' label_content: '標籤展示',
percent: '占比'
}, },
dataset: { dataset: {
parse_filed: '解析字段', parse_filed: '解析字段',
@ -2254,7 +2255,7 @@ export default {
screen_method: '篩選方式', screen_method: '篩選方式',
select: '請選擇', select: '請選擇',
fixed_value: '固定值', fixed_value: '固定值',
defalut_method: '默認條件', default_method: '默認條件',
select_all: '全 選', select_all: '全 選',
added: '已添加', added: '已添加',
manual_input: '手工輸入', manual_input: '手工輸入',
@ -2274,7 +2275,7 @@ export default {
version_num: '版本號', version_num: '版本號',
standard: '標準版', standard: '標準版',
enterprise: '企業版', enterprise: '企業版',
suport: '獲取技術支持', support: '獲取技術支持',
update_success: '更新成功' update_success: '更新成功'
}, },
template: { template: {
@ -2345,8 +2346,8 @@ export default {
sned_time: '提交時間', sned_time: '提交時間',
read_time: '查看時間', read_time: '查看時間',
type: '消息類型', type: '消息類型',
mark_readed: '標記已讀', mark_read: '標記已讀',
all_mark_readed: '全部已讀', all_mark_read: '全部已讀',
please_select: '請至少選擇一條消息', please_select: '請至少選擇一條消息',
mark_success: '標記已讀成功', mark_success: '標記已讀成功',
receive_manage: '接收管理', receive_manage: '接收管理',
@ -2354,7 +2355,7 @@ export default {
i18n_msg_type_panel_share_cacnel: '儀表闆取消分享', i18n_msg_type_panel_share_cacnel: '儀表闆取消分享',
i18n_msg_type_dataset_sync: '數據集同步', i18n_msg_type_dataset_sync: '數據集同步',
i18n_msg_type_dataset_sync_success: '數據集同步成功', i18n_msg_type_dataset_sync_success: '數據集同步成功',
i18n_msg_type_dataset_sync_faild: '數據集同步失敗', i18n_msg_type_dataset_sync_failed: '數據集同步失敗',
i18n_msg_type_ds_invalid: '數據源失效', i18n_msg_type_ds_invalid: '數據源失效',
i18n_msg_type_all: '全部類型', i18n_msg_type_all: '全部類型',
channel_inner_msg: '站內消息', channel_inner_msg: '站內消息',

View File

@ -790,12 +790,12 @@ export default {
move_success: '移除成功', move_success: '移除成功',
user: '用户', user: '用户',
add_organization: '添加组织', add_organization: '添加组织',
defalut_organization_canot_move: '默认组织无法删除', default_organization_cannot_move: '默认组织无法删除',
organization_name: '组织名称', organization_name: '组织名称',
input_organization_name: '请输入组织名称', input_organization_name: '请输入组织名称',
relate_top_organization: '关联上级组织', relate_top_organization: '关联上级组织',
organization_name_exist: '组织名称已存在', organization_name_exist: '组织名称已存在',
canot_delete: '无法删除', cannot_delete: '无法删除',
remove_user_first: '请先移除组织中所有用户,再进行删除组织操作。', remove_user_first: '请先移除组织中所有用户,再进行删除组织操作。',
sure_delete_organization: '确定删除该组织吗?', sure_delete_organization: '确定删除该组织吗?',
delete: '删除', delete: '删除',
@ -1428,7 +1428,8 @@ export default {
reserve_one: '一位', reserve_one: '一位',
reserve_two: '两位', reserve_two: '两位',
proportion: '占比', proportion: '占比',
label_content: '标签展示' label_content: '标签展示',
percent: '占比'
}, },
dataset: { dataset: {
parse_filed: '解析字段', parse_filed: '解析字段',
@ -2254,7 +2255,7 @@ export default {
screen_method: '筛选方式', screen_method: '筛选方式',
select: '请选择', select: '请选择',
fixed_value: '固定值', fixed_value: '固定值',
defalut_method: '默认条件', default_method: '默认条件',
select_all: '全 选', select_all: '全 选',
added: '已添加', added: '已添加',
manual_input: '手工输入', manual_input: '手工输入',
@ -2274,7 +2275,7 @@ export default {
version_num: '版本号', version_num: '版本号',
standard: '标准版', standard: '标准版',
enterprise: '企业版', enterprise: '企业版',
suport: '获取技术支持', support: '获取技术支持',
update_success: '更新成功' update_success: '更新成功'
}, },
template: { template: {
@ -2345,8 +2346,8 @@ export default {
sned_time: '提交时间', sned_time: '提交时间',
read_time: '查看时间', read_time: '查看时间',
type: '消息类型', type: '消息类型',
mark_readed: '标记已读', mark_read: '标记已读',
all_mark_readed: '全部已读', all_mark_read: '全部已读',
please_select: '请至少选择一条消息', please_select: '请至少选择一条消息',
mark_success: '标记已读成功', mark_success: '标记已读成功',
receive_manage: '接收管理', receive_manage: '接收管理',
@ -2354,7 +2355,7 @@ export default {
i18n_msg_type_panel_share_cacnel: '仪表板取消分享', i18n_msg_type_panel_share_cacnel: '仪表板取消分享',
i18n_msg_type_dataset_sync: '数据集同步', i18n_msg_type_dataset_sync: '数据集同步',
i18n_msg_type_dataset_sync_success: '数据集同步成功', i18n_msg_type_dataset_sync_success: '数据集同步成功',
i18n_msg_type_dataset_sync_faild: '数据集同步失败', i18n_msg_type_dataset_sync_failed: '数据集同步失败',
i18n_msg_type_ds_invalid: '数据源失效', i18n_msg_type_ds_invalid: '数据源失效',
i18n_msg_type_all: '全部类型', i18n_msg_type_all: '全部类型',
channel_inner_msg: '站内消息', channel_inner_msg: '站内消息',

View File

@ -126,11 +126,11 @@ router.beforeEach(async(to, from, next) => routeBefore(() => {
})) }))
export const loadMenus = (next, to) => { export const loadMenus = (next, to) => {
buildMenus().then(res => { buildMenus().then(res => {
const datas = res.data const data = res.data
const filterDatas = filterRouter(datas) const filterData = filterRouter(data)
const asyncRouter = filterAsyncRouter(filterDatas) const asyncRouter = filterAsyncRouter(filterData)
// 如果包含首页 则默认页面是 首页 否则默认页面是仪表板页面 // 如果包含首页 则默认页面是 首页 否则默认页面是仪表板页面
if (JSON.stringify(datas).indexOf('wizard') > -1) { if (JSON.stringify(data).indexOf('wizard') > -1) {
asyncRouter.push({ asyncRouter.push({
path: '/', path: '/',
component: Layout, component: Layout,
@ -234,8 +234,8 @@ const hasPermission = (router, user_permissions) => {
} }
// 如果有字菜单 则 判断是否满足 ‘任意一个子菜单有权限’ // 如果有字菜单 则 判断是否满足 ‘任意一个子菜单有权限’
if (router.children && router.children.length) { if (router.children && router.children.length) {
const permissionChilds = router.children.filter(item => hasPermission(item, user_permissions)) const permissionChildren = router.children.filter(item => hasPermission(item, user_permissions))
router.children = permissionChilds router.children = permissionChildren
return router.children.length > 0 return router.children.length > 0
} }
return true return true

View File

@ -21,7 +21,7 @@ module.exports = {
*/ */
sidebarLogo: false, sidebarLogo: false,
showSettings: true, showSettings: true,
interruptTokenContineUrls: [ interruptTokenContinueUrls: [
'/api/sys_msg/list/', '/api/sys_msg/list/',
'/dataset/taskLog/list/' '/dataset/taskLog/list/'
] ]

View File

@ -1400,7 +1400,7 @@ div:focus {
} }
} }
.de-serach-table { .de-search-table {
.top-operate { .top-operate {
margin-bottom: 16px; margin-bottom: 16px;
@ -1545,7 +1545,7 @@ div:focus {
} }
} }
.de-icon-sence { .de-icon-sense {
margin-right: 9px; margin-right: 9px;
width: 16px !important; width: 16px !important;
height: 12px !important; height: 12px !important;

View File

@ -23,7 +23,7 @@ export function baseBarOptionAntV(plot, container, chart, action, isGroup, isSta
const xAxis = getXAxis(chart) const xAxis = getXAxis(chart)
const yAxis = getYAxis(chart) const yAxis = getYAxis(chart)
// data // data
const data = chart.data.datas const data = chart.data.data
// config // config
const slider = getSlider(chart) const slider = getSlider(chart)
const analyse = getAnalyse(chart) const analyse = getAnalyse(chart)
@ -121,7 +121,7 @@ export function hBaseBarOptionAntV(plot, container, chart, action, isGroup, isSt
const xAxis = getXAxis(chart) const xAxis = getXAxis(chart)
const yAxis = getYAxis(chart) const yAxis = getYAxis(chart)
// data // data
const data = chart.data.datas const data = chart.data.data
// config // config
const slider = getSlider(chart) const slider = getSlider(chart)
const analyse = getAnalyse(chart) const analyse = getAnalyse(chart)

View File

@ -103,6 +103,11 @@ export const DEFAULT_SIZE = {
treemapWidth: 80, treemapWidth: 80,
treemapHeight: 80, treemapHeight: 80,
liquidMax: 100, liquidMax: 100,
liquidMaxType: 'fix', // fix or dynamic
liquidMaxField: {
id: '',
summary: ''
},
liquidSize: 80, liquidSize: 80,
liquidOutlineBorder: 4, liquidOutlineBorder: 4,
liquidOutlineDistance: 8, liquidOutlineDistance: 8,
@ -132,8 +137,8 @@ export const DEFAULT_LABEL = {
decimalCount: 2, // 小数位数 decimalCount: 2, // 小数位数
thousandSeparator: true// 千分符 thousandSeparator: true// 千分符
}, },
reserveDecimalCount: 2, // 百分比堆叠柱状图,饼图,环形图保留小数位数 reserveDecimalCount: 2,
labelContent: ['dimension', 'proportion'] // 饼图,环形图指标展示项 labelContent: ['dimension', 'proportion']
} }
export const DEFAULT_TOOLTIP = { export const DEFAULT_TOOLTIP = {
show: true, show: true,

View File

@ -126,6 +126,9 @@ export function getLabel(chart) {
type: l.position, type: l.position,
autoRotate: false autoRotate: false
} }
if (l.position === 'outer') {
label.type = 'spider'
}
} else if (chart.type.includes('line') || chart.type.includes('area')) { } else if (chart.type.includes('line') || chart.type.includes('area')) {
label = { label = {
position: l.position, position: l.position,

Some files were not shown because too many files have changed in this diff Show More