forked from github/dataease
Merge branch 'dev' into pr@dev_eslint_auto_fix
This commit is contained in:
commit
e98ac7a638
@ -37,13 +37,13 @@ public class DeLogAnnotationHandler {
|
||||
@Resource
|
||||
private LogService logService;
|
||||
|
||||
private static List<Integer> befores = new ArrayList<>();
|
||||
private static List<Integer> before = new ArrayList<>();
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
befores.add(SysLogConstants.OPERATE_TYPE.DELETE.getValue());
|
||||
befores.add(SysLogConstants.OPERATE_TYPE.UNSHARE.getValue());
|
||||
befores.add(SysLogConstants.OPERATE_TYPE.UNAUTHORIZE.getValue());
|
||||
before.add(SysLogConstants.OPERATE_TYPE.DELETE.getValue());
|
||||
before.add(SysLogConstants.OPERATE_TYPE.UNSHARE.getValue());
|
||||
before.add(SysLogConstants.OPERATE_TYPE.UNAUTHORIZE.getValue());
|
||||
}
|
||||
|
||||
private SysLogDTO exec(JoinPoint point, DeLog deLog) throws Exception{
|
||||
@ -110,7 +110,7 @@ public class DeLogAnnotationHandler {
|
||||
SysLogDTO logDTO = null;
|
||||
Object result = null;
|
||||
DeLog log = getLog(point);
|
||||
if(befores.contains(log.operatetype().getValue())) {
|
||||
if(before.contains(log.operatetype().getValue())) {
|
||||
// 前置处理 比如删除操作 需要在数据删除之前查询
|
||||
logDTO = exec(point, log);
|
||||
result = point.proceed(point.getArgs());
|
||||
|
@ -182,7 +182,7 @@ public class AuthUserServiceImpl implements AuthUserService {
|
||||
if (beansOfType.keySet().size() == 0) return false;
|
||||
OidcXpackService oidcXpackService = SpringContextUtil.getBean(OidcXpackService.class);
|
||||
if (ObjectUtils.isEmpty(oidcXpackService)) return false;
|
||||
return oidcXpackService.isSuuportOIDC();
|
||||
return oidcXpackService.isSupportOIDC();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -191,7 +191,7 @@ public class AuthUserServiceImpl implements AuthUserService {
|
||||
if (beansOfType.keySet().size() == 0) return false;
|
||||
CasXpackService casXpackService = SpringContextUtil.getBean(CasXpackService.class);
|
||||
if (ObjectUtils.isEmpty(casXpackService)) return false;
|
||||
return casXpackService.suuportCas();
|
||||
return casXpackService.supportCas();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -127,7 +127,7 @@ public class ExtAuthServiceImpl implements ExtAuthService {
|
||||
@CacheEvict(value = AuthConstants.USER_PANEL_NAME, key = "'user' + #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 = {
|
||||
@ -136,7 +136,7 @@ public class ExtAuthServiceImpl implements ExtAuthService {
|
||||
@CacheEvict(value = AuthConstants.DEPT_PANEL_NAME, key = "'dept' + #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 = {
|
||||
@ -145,7 +145,7 @@ public class ExtAuthServiceImpl implements ExtAuthService {
|
||||
@CacheEvict(value = AuthConstants.ROLE_PANEL_NAME, key = "'role' + #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
|
||||
|
@ -4,10 +4,10 @@ public enum ResourceAuthLevel {
|
||||
|
||||
COMMON_LEVEL_USE(1),
|
||||
|
||||
PANNEL_LEVEL_VIEW(1),
|
||||
PANNEL_LEVEL_EXPORT(3),
|
||||
PANNEL_LEVEL_MANAGE(5),
|
||||
PANNEL_LEVEL_GRANT(15),
|
||||
PANEL_LEVEL_VIEW(1),
|
||||
PANEL_LEVEL_EXPORT(3),
|
||||
PANEL_LEVEL_MANAGE(5),
|
||||
PANEL_LEVEL_GRANT(15),
|
||||
|
||||
DATASET_LEVEL_USE(1),
|
||||
DATASET_LEVEL_MANAGE(3),
|
||||
|
@ -11,6 +11,6 @@ public class ExcelSheetModel {
|
||||
|
||||
private List<String> heads;
|
||||
|
||||
private List<List<String>> datas;
|
||||
private List<List<String>> data;
|
||||
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ public class AuthUtils {
|
||||
result.addAll(roleSet);
|
||||
result.addAll(deptSet);
|
||||
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;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class CronUtils {
|
||||
if (!CronExpression.isValidExpression(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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -28,7 +28,7 @@ public class ExcelUtils {
|
||||
|
||||
sheets.forEach(sheet -> {
|
||||
|
||||
List<List<String>> details = sheet.getDatas();
|
||||
List<List<String>> details = sheet.getData();
|
||||
details.add(0, sheet.getHeads());
|
||||
String sheetName = sheet.getSheetName();
|
||||
HSSFSheet curSheet = wb.createSheet(sheetName);
|
||||
|
@ -23,7 +23,7 @@ import java.util.stream.Collectors;
|
||||
**/
|
||||
public class ExcelXlsReader implements HSSFListener {
|
||||
|
||||
private int minColums = -1;
|
||||
private int minColumns = -1;
|
||||
|
||||
public Integer getObtainedNum() {
|
||||
return obtainedNum;
|
||||
@ -211,8 +211,8 @@ public class ExcelXlsReader implements HSSFListener {
|
||||
thisRow = frec.getRow();
|
||||
thisColumn = frec.getColumn();
|
||||
thisStr = String.valueOf(frec.getValue());
|
||||
String feildType = checkType(thisStr, thisColumn);
|
||||
if(feildType.equalsIgnoreCase("LONG") && thisStr.endsWith(".0")){
|
||||
String fieldType = checkType(thisStr, thisColumn);
|
||||
if(fieldType.equalsIgnoreCase("LONG") && thisStr.endsWith(".0")){
|
||||
thisStr = thisStr.substring(0, thisStr.length() -2);
|
||||
}
|
||||
cellList.add(thisColumn, thisStr);
|
||||
@ -300,7 +300,7 @@ public class ExcelXlsReader implements HSSFListener {
|
||||
|
||||
//行结束时的操作
|
||||
if (record instanceof LastCellOfRowDummyRecord) {
|
||||
if (minColums > 0) {
|
||||
if (minColumns > 0) {
|
||||
//列值重新置空
|
||||
if (lastColumnNumber == -1) {
|
||||
lastColumnNumber = 0;
|
||||
@ -308,9 +308,9 @@ public class ExcelXlsReader implements HSSFListener {
|
||||
}
|
||||
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.setExcelLable(sheetName);
|
||||
excelSheetData.setExcelLabel(sheetName);
|
||||
excelSheetData.setData(new ArrayList<>());
|
||||
excelSheetData.setFields(new ArrayList<>());
|
||||
totalSheets.add(excelSheetData);
|
||||
@ -330,10 +330,10 @@ public class ExcelXlsReader implements HSSFListener {
|
||||
|
||||
|
||||
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.setData(new ArrayList<>(data));
|
||||
excelSheetData.setExcelLable(sheetName);
|
||||
excelSheetData.setExcelLabel(sheetName);
|
||||
excelSheetData.setFields(new ArrayList<>(fields));
|
||||
List<String> tmp = new ArrayList<>(cellList);
|
||||
excelSheetData.getData().add(tmp);
|
||||
@ -341,11 +341,11 @@ public class ExcelXlsReader implements HSSFListener {
|
||||
totalSheets.add(excelSheetData);
|
||||
}else {
|
||||
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){
|
||||
totalSheets.stream().filter(s->s.getExcelLable().equalsIgnoreCase(sheetName)).collect(Collectors.toList()).get(0).getData().add(tmp);
|
||||
if(obtainedNum != null && totalSheets.stream().filter(s->s.getExcelLabel().equalsIgnoreCase(sheetName)).collect(Collectors.toList()).get(0).getData().size() < obtainedNum){
|
||||
totalSheets.stream().filter(s->s.getExcelLabel().equalsIgnoreCase(sheetName)).collect(Collectors.toList()).get(0).getData().add(tmp);
|
||||
}
|
||||
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++;
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ public class ExcelXlsxReader extends DefaultHandler {
|
||||
|
||||
ExcelSheetData excelSheetData = new ExcelSheetData();
|
||||
excelSheetData.setData(new ArrayList<>(data));
|
||||
excelSheetData.setExcelLable(sheets.getSheetName());
|
||||
excelSheetData.setExcelLabel(sheets.getSheetName());
|
||||
excelSheetData.setFields(new ArrayList<>(fields));
|
||||
totalSheets.add(excelSheetData);
|
||||
|
||||
|
@ -36,21 +36,21 @@ public class ChartViewController {
|
||||
@Resource
|
||||
private ChartViewCacheService chartViewCacheService;
|
||||
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
|
||||
@ApiOperation("保存")
|
||||
@PostMapping("/save/{panelId}")
|
||||
public ChartViewDTO save(@PathVariable String panelId, @RequestBody ChartViewRequest request) {
|
||||
return chartViewService.save(request);
|
||||
}
|
||||
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
|
||||
@ApiOperation("新建视图")
|
||||
@PostMapping("/newOne/{panelId}")
|
||||
public ChartViewWithBLOBs save(@PathVariable String panelId, @RequestBody ChartViewWithBLOBs chartViewWithBLOBs) {
|
||||
return chartViewService.newOne(chartViewWithBLOBs);
|
||||
}
|
||||
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
|
||||
@ApiOperation("保存编辑的视图信息")
|
||||
@PostMapping("/viewEditSave/{panelId}")
|
||||
public void viewEditSave(@PathVariable String panelId, @RequestBody ChartViewWithBLOBs chartViewWithBLOBs) {
|
||||
@ -71,7 +71,7 @@ public class ChartViewController {
|
||||
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("详细信息")
|
||||
@PostMapping("/get/{id}/{panelId}")
|
||||
public ChartViewDTO get(@PathVariable String id, @PathVariable String panelId, @RequestBody ChartViewRequest viewRequest) {
|
||||
@ -87,7 +87,7 @@ public class ChartViewController {
|
||||
}
|
||||
|
||||
@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("数据")
|
||||
@PostMapping("/getData/{id}/{panelId}")
|
||||
public ChartViewDTO getData(@PathVariable String id, @PathVariable String panelId,
|
||||
@ -95,21 +95,21 @@ public class ChartViewController {
|
||||
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("视图详情")
|
||||
@PostMapping("chartDetail/{id}/{panelId}")
|
||||
public ChartDetail chartDetail(@PathVariable String id, @PathVariable String panelId) {
|
||||
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("复制")
|
||||
@PostMapping("chartCopy/{id}/{panelId}")
|
||||
public String chartCopy(@PathVariable String id, @PathVariable String 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("批量复制")
|
||||
@PostMapping("chartBatchCopy/{panelId}")
|
||||
public Map<String, String> chartBatchCopy(@RequestBody ChartCopyBatchRequest request, @PathVariable String panelId) {
|
||||
@ -129,7 +129,7 @@ public class ChartViewController {
|
||||
return chartViewService.search(chartViewRequest);
|
||||
}
|
||||
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_VIEW)
|
||||
@ApiOperation("计算结果")
|
||||
@PostMapping("/calcData/{panelId}")
|
||||
public ChartViewDTO calcData(@PathVariable String panelId, @RequestBody ChartCalRequest request) throws Exception {
|
||||
@ -144,14 +144,14 @@ public class ChartViewController {
|
||||
return chartViewService.checkSameDataSet(viewIdSource, viewIdTarget);
|
||||
}
|
||||
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_VIEW)
|
||||
@ApiOperation("初始化仪表板视图缓存")
|
||||
@PostMapping("/initViewCache/{panelId}")
|
||||
public void initViewCache(@PathVariable String 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("重置视图")
|
||||
@PostMapping("/resetViewCache/{id}/{panelId}")
|
||||
public void resetViewCache(@PathVariable String id, @PathVariable String panelId) {
|
||||
|
@ -35,7 +35,7 @@ public class ChartViewFieldController {
|
||||
@Resource
|
||||
private DataSetTableService dataSetTableService;
|
||||
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
|
||||
@ApiOperation("保存")
|
||||
@PostMapping("/save/{panelId}")
|
||||
public ChartViewField save(@PathVariable String panelId, @RequestBody ChartViewField chartViewField) {
|
||||
@ -53,21 +53,21 @@ public class ChartViewFieldController {
|
||||
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("删除")
|
||||
@PostMapping("/delete/{id}/{panelId}")
|
||||
public void delete(@PathVariable String id, @PathVariable String panelId) {
|
||||
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("删除视图的字段")
|
||||
@PostMapping("/deleteByChartId/{chartId}/{panelId}")
|
||||
public void deleteByChartId(@PathVariable String chartId, @PathVariable String panelId) {
|
||||
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("分组查询表下属字段")
|
||||
@PostMapping("listByDQ/{chartId}/{panelId}")
|
||||
public ChartViewField4Type listByDQ(@PathVariable String chartId, @PathVariable String panelId) {
|
||||
|
@ -62,7 +62,7 @@ public class DataSetTableFieldController {
|
||||
DatasetTableField datasetTableField = DatasetTableField.builder().build();
|
||||
datasetTableField.setTableId(tableId);
|
||||
List<DatasetTableField> fields = dataSetTableFieldsService.list(datasetTableField);
|
||||
fields = permissionService.filterColumnPermissons(fields, new ArrayList<>(), tableId, null);
|
||||
fields = permissionService.filterColumnPermissions(fields, new ArrayList<>(), tableId, null);
|
||||
return fields;
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ public class DataSetTableFieldController {
|
||||
datasetTableField.setTableId(tableId);
|
||||
List<DatasetTableField> fields = dataSetTableFieldsService.list(datasetTableField);
|
||||
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());
|
||||
return fields;
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ public class PanelGroupController {
|
||||
@PostMapping("/save")
|
||||
@DePermissions(value = {
|
||||
@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)
|
||||
@I18n
|
||||
public PanelGroupDTO save(@RequestBody PanelGroupRequest request) throws Exception{
|
||||
@ -77,7 +77,7 @@ public class PanelGroupController {
|
||||
@PostMapping("/update")
|
||||
@DePermissions(value = {
|
||||
@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)
|
||||
@I18n
|
||||
public String update(@RequestBody PanelGroupRequest request) {
|
||||
@ -85,14 +85,14 @@ public class PanelGroupController {
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_MANAGE)
|
||||
@PostMapping("/deleteCircle/{id}")
|
||||
public void deleteCircle(@PathVariable String id) {
|
||||
panelGroupService.deleteCircle(id);
|
||||
}
|
||||
|
||||
@ApiOperation("详细信息")
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW)
|
||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_VIEW)
|
||||
@GetMapping("/findOne/{id}")
|
||||
public PanelGroupDTO findOne(@PathVariable String id) throws Exception {
|
||||
return panelGroupService.findOne(id);
|
||||
@ -101,7 +101,7 @@ public class PanelGroupController {
|
||||
@ApiIgnore
|
||||
@ApiOperation("详细信息(分享人代理)")
|
||||
@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}")
|
||||
public PanelGroupDTO proxyFindOne(@PathVariable String id, @RequestBody PermissionProxy proxy)
|
||||
throws Exception {
|
||||
@ -146,7 +146,7 @@ public class PanelGroupController {
|
||||
@ApiOperation("更新仪表板状态")
|
||||
@PostMapping("/updatePanelStatus/{panelId}")
|
||||
@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) {
|
||||
panelGroupService.updatePanelStatus(panelId, request);
|
||||
}
|
||||
@ -154,7 +154,7 @@ public class PanelGroupController {
|
||||
@PostMapping("/autoCache")
|
||||
@DePermissions(value = {
|
||||
@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)
|
||||
public void autoCache(@RequestBody PanelGroupRequest request){
|
||||
panelGroupService.autoCache(request);
|
||||
|
@ -18,7 +18,7 @@ public class ApiDefinition {
|
||||
private ApiDefinitionRequest request;
|
||||
private String dataPath;
|
||||
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 int previewNum = 10;
|
||||
private int maxPreviewNum = 10;
|
||||
|
@ -6,7 +6,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class EsReponse {
|
||||
public class EsResponse {
|
||||
private List<Column> columns = new ArrayList<>();
|
||||
private List<String[]> rows = new ArrayList<>();
|
||||
private String cursor;
|
@ -75,7 +75,7 @@ public class MsgController {
|
||||
@PostMapping("/setReaded/{msgId}")
|
||||
@ApiImplicitParam(paramType = "path", name = "msgId", value = "消息ID", required = true, dataType = "Long")
|
||||
public void setReaded(@PathVariable Long msgId) {
|
||||
sysMsgService.setReaded(msgId);
|
||||
sysMsgService.setRead(msgId);
|
||||
}
|
||||
|
||||
|
||||
@ -83,7 +83,7 @@ public class MsgController {
|
||||
@PostMapping("/batchRead")
|
||||
@ApiImplicitParam(name = "msgIds", value = "消息ID集合", required = true, dataType = "List")
|
||||
public void batchRead(@RequestBody List<Long> msgIds) {
|
||||
sysMsgService.setBatchReaded(msgIds);
|
||||
sysMsgService.setBatchRead(msgIds);
|
||||
}
|
||||
|
||||
@ApiOperation("全部设置已读")
|
||||
|
@ -78,8 +78,8 @@ public class SysMenuController {
|
||||
|
||||
@PostMapping("/childMenus/{pid}")
|
||||
public Set<Long> childMenus(@PathVariable Long pid){
|
||||
List<MenuNodeResponse> childs = menuService.childs(pid);
|
||||
Set<Long> sets = childs.stream().map(MenuNodeResponse::getMenuId).collect(Collectors.toSet());
|
||||
List<MenuNodeResponse> children = menuService.children(pid);
|
||||
Set<Long> sets = children.stream().map(MenuNodeResponse::getMenuId).collect(Collectors.toSet());
|
||||
sets.add(pid);
|
||||
return sets;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ public class BaseGridRequest implements Serializable {
|
||||
GridExample gridExample = new GridExample();
|
||||
if (CollectionUtils.isNotEmpty(conditions)) {
|
||||
GridExample.Criteria criteria = gridExample.createCriteria();
|
||||
conditions.forEach(criteria::addCondtion);
|
||||
conditions.forEach(criteria::addCondition);
|
||||
}
|
||||
|
||||
if (CollectionUtils.isNotEmpty(orders)){
|
||||
|
@ -10,7 +10,7 @@ public class ExcelFileData {
|
||||
@ApiModelProperty("excelID")
|
||||
private String id;
|
||||
@ApiModelProperty("excel标签")
|
||||
private String excelLable;
|
||||
private String excelLabel;
|
||||
@ApiModelProperty("sheets")
|
||||
private List<ExcelSheetData> sheets;
|
||||
@ApiModelProperty("路径")
|
||||
|
@ -9,7 +9,7 @@ import java.util.Map;
|
||||
@Data
|
||||
public class ExcelSheetData {
|
||||
@ApiModelProperty("标签")
|
||||
private String excelLable;
|
||||
private String excelLabel;
|
||||
@ApiModelProperty("数据集合")
|
||||
private List<List<String>> data;
|
||||
@ApiModelProperty("字段集合")
|
||||
|
@ -6,7 +6,7 @@ import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class RedshiftConfigration extends JdbcConfiguration {
|
||||
public class RedshiftConfiguration extends JdbcConfiguration {
|
||||
|
||||
private String driver = "com.amazon.redshift.jdbc42.Driver";
|
||||
|
@ -132,7 +132,7 @@ public class GridExample {
|
||||
|
||||
|
||||
|
||||
public Criteria addCondtion(ConditionEntity conditionEntity){
|
||||
public Criteria addCondition(ConditionEntity conditionEntity){
|
||||
String field = conditionEntity.getField();
|
||||
Object value = conditionEntity.getValue();
|
||||
String operator = conditionEntity.getOperator();
|
||||
|
@ -48,7 +48,7 @@ import java.util.stream.Collectors;
|
||||
@Service("emailTaskHandler")
|
||||
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 ERROR = -1;
|
||||
|
||||
@ -124,7 +124,7 @@ public class EmailTaskHandler extends TaskHandler implements Job {
|
||||
private GlobalTaskInstance buildInstance(GlobalTaskEntity taskEntity) {
|
||||
GlobalTaskInstance taskInstance = new GlobalTaskInstance();
|
||||
taskInstance.setTaskId(taskEntity.getTaskId());
|
||||
taskInstance.setStatus(RUNING);
|
||||
taskInstance.setStatus(RUNNING);
|
||||
taskInstance.setExecuteTime(System.currentTimeMillis());
|
||||
return taskInstance;
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ public interface MapApi {
|
||||
|
||||
|
||||
@GetMapping("/globalEntitys/{pcode}")
|
||||
List<AreaEntity> globalEntitys(@PathVariable String pcode);
|
||||
List<AreaEntity> globalEntities(@PathVariable String pcode);
|
||||
|
||||
@PostMapping(value = "/saveMapNode", consumes = {"multipart/form-data"})
|
||||
void saveMapNode(MapNodeRequest request, MultipartFile file) throws Exception;
|
||||
|
@ -6,7 +6,7 @@ import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class MapNodeReadReponse implements Serializable {
|
||||
public class MapNodeReadResponse implements Serializable {
|
||||
|
||||
@ApiModelProperty("区域代码")
|
||||
private String code;
|
||||
@ -15,7 +15,7 @@ public class MapNodeReadReponse implements Serializable {
|
||||
@ApiModelProperty("区域级别")
|
||||
private Integer level;
|
||||
@ApiModelProperty("上级区域")
|
||||
private MapNodeReadReponse parent;
|
||||
private MapNodeReadResponse parent;
|
||||
@ApiModelProperty("geoGson")
|
||||
private String json;
|
||||
}
|
@ -26,16 +26,16 @@ public class MapServer implements MapApi {
|
||||
if (StringUtils.equals(pcode, "0")) {
|
||||
return areaEntities;
|
||||
}
|
||||
return mapService.entitysByPid(areaEntities, pcode);
|
||||
return mapService.entitiesByPid(areaEntities, pcode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AreaEntity> globalEntitys(String pcode) {
|
||||
public List<AreaEntity> globalEntities(String pcode) {
|
||||
List<AreaEntity> areaEntities = mapService.globalEntities();
|
||||
if (StringUtils.equals(pcode, "0")) {
|
||||
return areaEntities;
|
||||
}
|
||||
return mapService.entitysByPid(areaEntities, pcode);
|
||||
return mapService.entitiesByPid(areaEntities, pcode);
|
||||
}
|
||||
|
||||
|
||||
|
@ -43,7 +43,7 @@ public class MapService {
|
||||
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++) {
|
||||
AreaEntity areaEntity = entities.get(i);
|
||||
if (StringUtils.equals(pid, areaEntity.getCode())) {
|
||||
@ -51,7 +51,7 @@ public class MapService {
|
||||
}
|
||||
|
||||
if (CollectionUtil.isNotEmpty(areaEntity.getChildren())) {
|
||||
List<AreaEntity> areaEntities = entitysByPid(areaEntity.getChildren(), pid);
|
||||
List<AreaEntity> areaEntities = entitiesByPid(areaEntity.getChildren(), pid);
|
||||
if (null != areaEntities) {
|
||||
return areaEntities;
|
||||
}
|
||||
@ -65,7 +65,7 @@ public class MapService {
|
||||
Long pValue = Long.parseLong(pCode);
|
||||
MapService mapService = CommonBeanFactory.getBean(MapService.class);
|
||||
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())));
|
||||
AreaEntity lastBrother = brothers.get(brothers.size() - 1);
|
||||
|
@ -57,8 +57,8 @@ public class SSOServer {
|
||||
DEException.throwException("缺少oidc插件");
|
||||
}
|
||||
oidcXpackService = SpringContextUtil.getBean(OidcXpackService.class);
|
||||
Boolean suuportOIDC = oidcXpackService.isSuuportOIDC();
|
||||
if (!suuportOIDC) {
|
||||
Boolean supportOIDC = oidcXpackService.isSupportOIDC();
|
||||
if (!supportOIDC) {
|
||||
DEException.throwException("未开启oidc");
|
||||
}
|
||||
Map<String, String> config = config(oidcXpackService);
|
||||
|
@ -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")};
|
||||
List<String> head = Arrays.asList(headArr);
|
||||
excelSheetModel.setHeads(head);
|
||||
List<List<String>> datas = instanceDTOS.stream().map(this::formatExcelData).collect(Collectors.toList());
|
||||
excelSheetModel.setDatas(datas);
|
||||
List<List<String>> data = instanceDTOS.stream().map(this::formatExcelData).collect(Collectors.toList());
|
||||
excelSheetModel.setData(data);
|
||||
return excelSheetModel;
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ public class ApiProvider extends Provider {
|
||||
ApiDefinition apiDefinition = checkApiDefinition(datasourceRequest);
|
||||
String response = execHttpRequest(apiDefinition, StringUtils.isNotBlank(basicInfo.getFrontTimeOut()) ? Integer.parseInt(basicInfo.getFrontTimeOut()) : 10);
|
||||
|
||||
fieldList = getTableFileds(apiDefinition);
|
||||
fieldList = getTableFields(apiDefinition);
|
||||
result.put("fieldList", fieldList);
|
||||
dataList = fetchResult(response, apiDefinition);
|
||||
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<>();
|
||||
for (DatasetTableFieldDTO field : apiDefinition.getFields()) {
|
||||
TableField tableField = new TableField();
|
||||
@ -93,13 +93,13 @@ public class ApiProvider extends Provider {
|
||||
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>>() {
|
||||
}.getType());
|
||||
List<TableField> tableFields = new ArrayList<>();
|
||||
for (ApiDefinition apiDefinition : lists) {
|
||||
if (datasourceRequest.getTable().equalsIgnoreCase(apiDefinition.getName())) {
|
||||
tableFields = getTableFileds(apiDefinition);
|
||||
tableFields = getTableFields(apiDefinition);
|
||||
}
|
||||
}
|
||||
return tableFields;
|
||||
@ -361,14 +361,14 @@ public class ApiProvider extends Provider {
|
||||
private List<String[]> fetchResult(String result, ApiDefinition apiDefinition) {
|
||||
List<String[]> dataList = new LinkedList<>();
|
||||
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());
|
||||
if (object instanceof List) {
|
||||
datas = (List<LinkedHashMap>) object;
|
||||
currentData = (List<LinkedHashMap>) object;
|
||||
} else {
|
||||
datas.add((LinkedHashMap) object);
|
||||
currentData.add((LinkedHashMap) object);
|
||||
}
|
||||
for (LinkedHashMap data : datas) {
|
||||
for (LinkedHashMap data : currentData) {
|
||||
String[] row = new String[apiDefinition.getFields().size()];
|
||||
int i = 0;
|
||||
for (DatasetTableFieldDTO field : apiDefinition.getFields()) {
|
||||
@ -379,22 +379,22 @@ public class ApiProvider extends Provider {
|
||||
}
|
||||
} else {
|
||||
List<String> jsonPaths = apiDefinition.getFields().stream().map(DatasetTableFieldDTO::getJsonPath).collect(Collectors.toList());
|
||||
Long maxLenth = 0l;
|
||||
Long maxLength = 0l;
|
||||
List<List<String>> columnDataList = new ArrayList<>();
|
||||
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));
|
||||
if (object instanceof List && jsonPaths.get(i).contains("[*]")) {
|
||||
datas = (List<String>) object;
|
||||
data = (List<String>) object;
|
||||
} else {
|
||||
if (object != null) {
|
||||
datas.add(object.toString());
|
||||
data.add(object.toString());
|
||||
}
|
||||
}
|
||||
maxLenth = maxLenth > datas.size() ? maxLenth : datas.size();
|
||||
columnDataList.add(datas);
|
||||
maxLength = maxLength > data.size() ? maxLength : data.size();
|
||||
columnDataList.add(data);
|
||||
}
|
||||
for (int i = 0; i < maxLenth; i++) {
|
||||
for (int i = 0; i < maxLength; i++) {
|
||||
String[] row = new String[apiDefinition.getFields().size()];
|
||||
dataList.add(row);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import com.google.gson.Gson;
|
||||
import com.google.gson.JsonParser;
|
||||
import io.dataease.commons.utils.HttpClientConfig;
|
||||
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.RequestWithCursor;
|
||||
import io.dataease.dto.datasource.EsConfiguration;
|
||||
@ -60,22 +60,22 @@ public class EsProvider extends Provider {
|
||||
request.setFetch_size(dsr.getFetchSize());
|
||||
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);
|
||||
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()) {
|
||||
Integer realSize = dsr.getPage() * dsr.getPageSize() < list.size() ? dsr.getPage() * dsr.getPageSize() : list.size();
|
||||
list = list.subList((dsr.getPage() - 1) * dsr.getPageSize(), realSize);
|
||||
}
|
||||
if (!dsr.isPreviewData()) {
|
||||
while (StringUtils.isNotEmpty(esReponse.getCursor())) {
|
||||
RequestWithCursor requstWithCursor = new RequestWithCursor();
|
||||
requstWithCursor.setQuery(dsr.getQuery());
|
||||
requstWithCursor.setFetch_size(dsr.getFetchSize());
|
||||
requstWithCursor.setCursor(esReponse.getCursor());
|
||||
response = HttpClientUtil.post(url, new Gson().toJson(requstWithCursor), httpClientConfig);
|
||||
esReponse = new Gson().fromJson(response, EsReponse.class);
|
||||
list.addAll(fetchResult(esReponse));
|
||||
while (StringUtils.isNotEmpty(esResponse.getCursor())) {
|
||||
RequestWithCursor requestWithCursor = new RequestWithCursor();
|
||||
requestWithCursor.setQuery(dsr.getQuery());
|
||||
requestWithCursor.setFetch_size(dsr.getFetchSize());
|
||||
requestWithCursor.setCursor(esResponse.getCursor());
|
||||
response = HttpClientUtil.post(url, new Gson().toJson(requestWithCursor), httpClientConfig);
|
||||
esResponse = new Gson().fromJson(response, EsResponse.class);
|
||||
list.addAll(fetchResult(esResponse));
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@ -98,7 +98,7 @@ public class EsProvider extends Provider {
|
||||
}
|
||||
|
||||
@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()));
|
||||
List<TableField> tableFields = new ArrayList<>();
|
||||
try {
|
||||
@ -112,16 +112,16 @@ public class EsProvider extends Provider {
|
||||
|
||||
|
||||
private List<String[]> fetchResult(String response) throws Exception {
|
||||
EsReponse esReponse = new Gson().fromJson(response, EsReponse.class);
|
||||
return fetchResult(esReponse);
|
||||
EsResponse esResponse = new Gson().fromJson(response, EsResponse.class);
|
||||
return fetchResult(esResponse);
|
||||
}
|
||||
|
||||
private List<String[]> fetchResult(EsReponse esReponse) throws Exception {
|
||||
private List<String[]> fetchResult(EsResponse esResponse) throws Exception {
|
||||
List<String[]> list = new LinkedList<>();
|
||||
if (esReponse.getError() != null) {
|
||||
throw new Exception(esReponse.getError().getReason());
|
||||
if (esResponse.getError() != null) {
|
||||
throw new Exception(esResponse.getError().getReason());
|
||||
}
|
||||
list.addAll(esReponse.getRows());
|
||||
list.addAll(esResponse.getRows());
|
||||
return list;
|
||||
}
|
||||
|
||||
@ -139,12 +139,12 @@ public class EsProvider extends Provider {
|
||||
|
||||
private List<TableField> fetchResultField(String response) throws Exception {
|
||||
List<TableField> fieldList = new ArrayList<>();
|
||||
EsReponse esReponse = new Gson().fromJson(response, EsReponse.class);
|
||||
if (esReponse.getError() != null) {
|
||||
throw new Exception(esReponse.getError().getReason());
|
||||
EsResponse esResponse = new Gson().fromJson(response, EsResponse.class);
|
||||
if (esResponse.getError() != null) {
|
||||
throw new Exception(esResponse.getError().getReason());
|
||||
}
|
||||
|
||||
for (String[] row : esReponse.getRows()) {
|
||||
for (String[] row : esResponse.getRows()) {
|
||||
TableField field = new TableField();
|
||||
field.setFieldName(row[0]);
|
||||
field.setRemarks(row[0]);
|
||||
@ -157,12 +157,12 @@ public class EsProvider extends Provider {
|
||||
|
||||
private List<TableField> fetchResultField4Sql(String response) throws Exception {
|
||||
List<TableField> fieldList = new ArrayList<>();
|
||||
EsReponse esReponse = new Gson().fromJson(response, EsReponse.class);
|
||||
if (esReponse.getError() != null) {
|
||||
throw new Exception(esReponse.getError().getReason());
|
||||
EsResponse esResponse = new Gson().fromJson(response, EsResponse.class);
|
||||
if (esResponse.getError() != null) {
|
||||
throw new Exception(esResponse.getError().getReason());
|
||||
}
|
||||
|
||||
for (EsReponse.Column column : esReponse.getColumns()) {
|
||||
for (EsResponse.Column column : esResponse.getColumns()) {
|
||||
TableField field = new TableField();
|
||||
field.setFieldName(column.getName());
|
||||
field.setRemarks(column.getName());
|
||||
@ -175,12 +175,12 @@ public class EsProvider extends Provider {
|
||||
|
||||
private List<TableField> fetchResultField4Table(String response) throws Exception {
|
||||
List<TableField> fieldList = new ArrayList<>();
|
||||
EsReponse esReponse = new Gson().fromJson(response, EsReponse.class);
|
||||
if (esReponse.getError() != null) {
|
||||
throw new Exception(esReponse.getError().getReason());
|
||||
EsResponse esResponse = new Gson().fromJson(response, EsResponse.class);
|
||||
if (esResponse.getError() != null) {
|
||||
throw new Exception(esResponse.getError().getReason());
|
||||
}
|
||||
|
||||
for (String[] row : esReponse.getRows()) {
|
||||
for (String[] row : esResponse.getRows()) {
|
||||
if(!row[1].equalsIgnoreCase("STRUCT")){
|
||||
TableField field = new TableField();
|
||||
field.setFieldName(row[0]);
|
||||
@ -221,12 +221,12 @@ public class EsProvider extends Provider {
|
||||
|
||||
private List<TableDesc> fetchTables(String response) throws Exception {
|
||||
List<TableDesc> tables = new ArrayList<>();
|
||||
EsReponse esReponse = new Gson().fromJson(response, EsReponse.class);
|
||||
if (esReponse.getError() != null) {
|
||||
throw new Exception(esReponse.getError().getReason());
|
||||
EsResponse esResponse = new Gson().fromJson(response, EsResponse.class);
|
||||
if (esResponse.getError() != null) {
|
||||
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")) {
|
||||
TableDesc tableDesc = new TableDesc();
|
||||
tableDesc.setName(row[0]);
|
||||
|
@ -73,7 +73,7 @@ public class JdbcProvider extends DefaultJdbcProvider {
|
||||
|
||||
|
||||
@Override
|
||||
public List<TableField> getTableFileds(DatasourceRequest datasourceRequest) throws Exception {
|
||||
public List<TableField> getTableFields(DatasourceRequest datasourceRequest) throws Exception {
|
||||
if (datasourceRequest.getDatasource().getType().equalsIgnoreCase("mongo")) {
|
||||
datasourceRequest.setQuery("select * from " + datasourceRequest.getTable());
|
||||
return fetchResultField(datasourceRequest);
|
||||
@ -263,8 +263,8 @@ public class JdbcProvider extends DefaultJdbcProvider {
|
||||
while (rs.next()) {
|
||||
String[] row = new String[columnCount];
|
||||
for (int j = 0; j < columnCount; j++) {
|
||||
int columType = metaData.getColumnType(j + 1);
|
||||
switch (columType) {
|
||||
int columnType = metaData.getColumnType(j + 1);
|
||||
switch (columnType) {
|
||||
case Types.DATE:
|
||||
if (rs.getDate(j + 1) != null) {
|
||||
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();
|
||||
} else {
|
||||
if (charset != null && StringUtils.isNotEmpty(rs.getString(j + 1))) {
|
||||
String orginStr = new String(rs.getString(j + 1).getBytes(charset), targetCharset);
|
||||
row[j] = new String(orginStr.getBytes("UTF-8"), "UTF-8");
|
||||
String originStr = new String(rs.getString(j + 1).getBytes(charset), targetCharset);
|
||||
row[j] = new String(originStr.getBytes("UTF-8"), "UTF-8");
|
||||
} else {
|
||||
row[j] = rs.getString(j + 1);
|
||||
}
|
||||
@ -426,12 +426,12 @@ public class JdbcProvider extends DefaultJdbcProvider {
|
||||
jdbcurl = mongodbConfiguration.getJdbc(datasourceRequest.getDatasource().getId());
|
||||
break;
|
||||
case redshift:
|
||||
RedshiftConfigration redshiftConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfigration.class);
|
||||
username = redshiftConfigration.getUsername();
|
||||
password = redshiftConfigration.getPassword();
|
||||
defaultDriver = redshiftConfigration.getDriver();
|
||||
customDriver = redshiftConfigration.getCustomDriver();
|
||||
jdbcurl = redshiftConfigration.getJdbc();
|
||||
RedshiftConfiguration redshiftConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfiguration.class);
|
||||
username = redshiftConfiguration.getUsername();
|
||||
password = redshiftConfiguration.getPassword();
|
||||
defaultDriver = redshiftConfiguration.getDriver();
|
||||
customDriver = redshiftConfiguration.getCustomDriver();
|
||||
jdbcurl = redshiftConfiguration.getJdbc();
|
||||
break;
|
||||
case hive:
|
||||
HiveConfiguration hiveConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), HiveConfiguration.class);
|
||||
@ -570,11 +570,11 @@ public class JdbcProvider extends DefaultJdbcProvider {
|
||||
jdbcConfiguration = mongodbConfiguration;
|
||||
break;
|
||||
case redshift:
|
||||
RedshiftConfigration redshiftConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfigration.class);
|
||||
dataSource.setPassword(redshiftConfigration.getPassword());
|
||||
dataSource.setDriverClassName(redshiftConfigration.getDriver());
|
||||
dataSource.setUrl(redshiftConfigration.getJdbc());
|
||||
jdbcConfiguration = redshiftConfigration;
|
||||
RedshiftConfiguration redshiftConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfiguration.class);
|
||||
dataSource.setPassword(redshiftConfiguration.getPassword());
|
||||
dataSource.setDriverClassName(redshiftConfiguration.getDriver());
|
||||
dataSource.setUrl(redshiftConfiguration.getJdbc());
|
||||
jdbcConfiguration = redshiftConfiguration;
|
||||
break;
|
||||
case hive:
|
||||
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);
|
||||
return "SELECT name FROM system.tables where database='DATABASE';".replace("DATABASE", chConfiguration.getDataBase());
|
||||
case redshift:
|
||||
RedshiftConfigration redshiftConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfigration.class);
|
||||
if (StringUtils.isEmpty(redshiftConfigration.getSchema())) {
|
||||
RedshiftConfiguration redshiftConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfiguration.class);
|
||||
if (StringUtils.isEmpty(redshiftConfiguration.getSchema())) {
|
||||
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:
|
||||
Db2Configuration db2Configuration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), Db2Configuration.class);
|
||||
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());
|
||||
case redshift:
|
||||
RedshiftConfigration redshiftConfigration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfigration.class);
|
||||
if (StringUtils.isEmpty(redshiftConfigration.getSchema())) {
|
||||
RedshiftConfiguration redshiftConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), RedshiftConfiguration.class);
|
||||
if (StringUtils.isEmpty(redshiftConfiguration.getSchema())) {
|
||||
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:
|
||||
Db2Configuration db2Configuration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), Db2Configuration.class);
|
||||
|
@ -10,4 +10,5 @@ public class ChartConstants {
|
||||
public static final String YEAR_YOY = "year_yoy";
|
||||
public static final String DAY_MOM = "day_mom";
|
||||
public static final String MONTH_YOY = "month_yoy";
|
||||
public static final String[] M_Y = {YEAR_MOM, MONTH_MOM, YEAR_YOY, DAY_MOM, MONTH_YOY};
|
||||
}
|
||||
|
@ -351,7 +351,7 @@ public class ChartViewService {
|
||||
|
||||
//列权限
|
||||
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());
|
||||
dataeaseNames.add("*");
|
||||
@ -580,7 +580,7 @@ public class ChartViewService {
|
||||
List<ChartViewFieldDTO> yAxisExt = gson.fromJson(view.getYAxisExt(), tokenType);
|
||||
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);
|
||||
yAxis.addAll(sizeField);
|
||||
}
|
||||
@ -598,7 +598,7 @@ public class ChartViewService {
|
||||
|
||||
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());
|
||||
dataeaseNames.add("*");
|
||||
@ -670,7 +670,8 @@ public class ChartViewService {
|
||||
}
|
||||
boolean hasParameters = false;
|
||||
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<>())) {
|
||||
if (sqlVariables.stream().map(SqlVariableDetails::getVariableName).collect(Collectors.toList()).contains(parameter)) {
|
||||
hasParameters = true;
|
||||
@ -994,20 +995,6 @@ public class ChartViewService {
|
||||
if (StringUtils.isNotEmpty(compareCalc.getType())
|
||||
&& !StringUtils.equalsIgnoreCase(compareCalc.getType(), "none")) {
|
||||
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;// 数据字段下标
|
||||
if (StringUtils.containsIgnoreCase(view.getType(), "stack")) {
|
||||
@ -1015,50 +1002,88 @@ public class ChartViewService {
|
||||
} else {
|
||||
dataIndex = xAxis.size() + i;
|
||||
}
|
||||
// 无选中字段,或者选中字段已经不在维度list中,或者选中字段日期格式不符合对比类型的,直接将对应数据置为null
|
||||
if (ObjectUtils.isEmpty(timeField) || !checkCalcType(timeField.getDateStyle(), compareCalc.getType())) {
|
||||
// set null
|
||||
for (String[] item : data) {
|
||||
item[dataIndex] = null;
|
||||
if (Arrays.asList(ChartConstants.M_Y).contains(compareCalc.getType())) {
|
||||
String resultData = compareCalc.getResultData();// 数据设置
|
||||
// 获取选中字段以及下标
|
||||
List<ChartViewFieldDTO> checkedField = new ArrayList<>(xAxis);
|
||||
if (StringUtils.containsIgnoreCase(view.getType(), "stack")) {
|
||||
checkedField.addAll(extStack);
|
||||
}
|
||||
} else {
|
||||
// 计算 同比/环比
|
||||
// 1,处理当期数据;2,根据type计算上一期数据;3,根据resultData计算结果
|
||||
Map<String, String> currentMap = new LinkedHashMap<>();
|
||||
for (String[] item : data) {
|
||||
String[] dimension = Arrays.copyOfRange(item, 0, checkedField.size());
|
||||
currentMap.put(StringUtils.join(dimension, "-"), item[dataIndex]);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
for (int index = 0; index < data.size(); index++) {
|
||||
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)) {
|
||||
// 无选中字段,或者选中字段已经不在维度list中,或者选中字段日期格式不符合对比类型的,直接将对应数据置为null
|
||||
if (ObjectUtils.isEmpty(timeField) || !checkCalcType(timeField.getDateStyle(), compareCalc.getType())) {
|
||||
// set null
|
||||
for (String[] item : data) {
|
||||
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 {
|
||||
// 计算 同比/环比
|
||||
// 1,处理当期数据;2,根据type计算上一期数据;3,根据resultData计算结果
|
||||
Map<String, String> currentMap = new LinkedHashMap<>();
|
||||
for (String[] item : data) {
|
||||
String[] dimension = Arrays.copyOfRange(item, 0, checkedField.size());
|
||||
currentMap.put(StringUtils.join(dimension, "-"), item[dataIndex]);
|
||||
}
|
||||
|
||||
for (int index = 0; index < data.size(); index++) {
|
||||
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";
|
||||
}
|
||||
|
||||
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.putAll(chartData);
|
||||
map.putAll(tabelData);
|
||||
map.putAll(tableData);
|
||||
|
||||
List<DatasetTableField> sourceFields = dataSetTableFieldsService.getFieldsByTableId(view.getTableId());
|
||||
map.put("sourceFields", sourceFields);
|
||||
@ -1193,7 +1218,7 @@ public class ChartViewService {
|
||||
PluginViewParam pluginViewParam = new PluginViewParam();
|
||||
PluginViewSetImpl pluginViewSet = BeanUtils.copyBean(new PluginViewSetImpl(), table);
|
||||
pluginViewSet.setDsType(ds.getType());
|
||||
pluginViewSet.setTabelId(table.getId());
|
||||
pluginViewSet.setTableId(table.getId());
|
||||
pluginViewSet.setDs(ds);
|
||||
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 {
|
||||
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())) {
|
||||
for (ChartExtFilterRequest chartExtFilterRequest : requestList.getFilter()) {
|
||||
if (CollectionUtils.isEmpty(chartExtFilterRequest.getValue())) {
|
||||
@ -1610,8 +1636,8 @@ public class ChartViewService {
|
||||
}
|
||||
|
||||
for (String parameter : chartExtFilterRequest.getParameters()) {
|
||||
if(parameter.contains("|DE|")){
|
||||
if(!parameter.split("\\|DE\\|")[0].equals(table.getId())){
|
||||
if (parameter.contains("|DE|")) {
|
||||
if (!parameter.split("\\|DE\\|")[0].equals(table.getId())) {
|
||||
continue;
|
||||
}
|
||||
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));
|
||||
sql = sql.replace("${" + parameter.split("\\|DE\\|")[1] + "}", filter);
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
List<SqlVariableDetails> parameters = sqlVariables.stream().filter(item -> item.getVariableName().equalsIgnoreCase(parameter)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(parameters)) {
|
||||
String filter = qp.transFilter(chartExtFilterRequest, parameters.get(0));
|
||||
@ -1656,49 +1682,46 @@ public class ChartViewService {
|
||||
JSONObject jsonObject = JSONObject.parseObject(customAttr);
|
||||
JSONObject size = jsonObject.getJSONObject("size");
|
||||
|
||||
String gaugeMinType = size.getString("gaugeMinType");
|
||||
if (StringUtils.equalsIgnoreCase("dynamic", gaugeMinType)) {
|
||||
JSONObject gaugeMinField = size.getJSONObject("gaugeMinField");
|
||||
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"));
|
||||
}
|
||||
ChartViewFieldDTO gaugeMinViewField = getDynamicField(size, "gaugeMinType", "gaugeMinField");
|
||||
if (gaugeMinViewField != null) {
|
||||
list.add(gaugeMinViewField);
|
||||
}
|
||||
String gaugeMaxType = size.getString("gaugeMaxType");
|
||||
if (StringUtils.equalsIgnoreCase("dynamic", gaugeMaxType)) {
|
||||
JSONObject gaugeMaxField = size.getJSONObject("gaugeMaxField");
|
||||
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 gaugeMaxViewField = getDynamicField(size, "gaugeMaxType", "gaugeMaxField");
|
||||
if (gaugeMaxViewField != null) {
|
||||
list.add(gaugeMaxViewField);
|
||||
}
|
||||
ChartViewFieldDTO liquidMaxViewField = getDynamicField(size, "liquidMaxType", "liquidMaxField");
|
||||
if (liquidMaxViewField != null) {
|
||||
list.add(liquidMaxViewField);
|
||||
}
|
||||
|
||||
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) {
|
||||
String senior = view.getSenior();
|
||||
JSONObject jsonObject = JSONObject.parseObject(senior);
|
||||
|
@ -23,10 +23,10 @@ public abstract class FilterBuildTemplate {
|
||||
|
||||
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> 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");
|
||||
List<String> filterIds = (List<String>) attrs.get("filterIds");
|
||||
if (!autoTrigger) { // 不是自动触发 // 需要过滤掉按钮关联的条件组件
|
||||
@ -77,7 +77,7 @@ public abstract class FilterBuildTemplate {
|
||||
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);
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ public abstract class FilterBuildTemplate {
|
||||
Map<String, Object> component = filterParamTO.getComponent();
|
||||
Map<String, Object> attrs = (Map<String, Object>) ((Map<String, Object>) component.get("options")).get("attrs");
|
||||
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");
|
||||
Boolean multiple = ObjectUtils.isNotEmpty(attrs.get("multiple")) && (Boolean) attrs.get("multiple");
|
||||
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,
|
||||
String componentType, String serviceName) {
|
||||
String componentType, String serviceName) {
|
||||
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 cServiceName = Optional.ofNullable(component.get("serviceName")).orElse("").toString();
|
||||
|
||||
@ -180,10 +180,20 @@ public abstract class FilterBuildTemplate {
|
||||
beanMapping.put("numberRangeWidget", "numberRangeWidget");
|
||||
beanMapping.put("textSelectTreeWidget", "textSelectTreeWidget");
|
||||
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);
|
||||
if (StringUtils.isBlank(beanName) && StringUtils.containsIgnoreCase(serviceName, "select")) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ public class ViewExportExcel {
|
||||
return filterInvalidDecimal(val.toString());
|
||||
}).collect(Collectors.toList())).collect(Collectors.toList());
|
||||
result.setHeads(heads);
|
||||
result.setDatas(details);
|
||||
result.setData(details);
|
||||
|
||||
result.setSheetName(title);
|
||||
return result;
|
||||
|
@ -105,7 +105,7 @@ public class ViewPluginBaseServiceImpl implements ViewPluginBaseService {
|
||||
String tableName = null;
|
||||
DataTableInfoDTO dataTableInfoDTO = new Gson().fromJson(pluginViewSet.getInfo(), DataTableInfoDTO.class);
|
||||
if (ObjectUtils.isNotEmpty(pluginViewSet.getMode()) && 1 == pluginViewSet.getMode()) {
|
||||
tableName = TableUtils.tableName(pluginViewSet.getTabelId());
|
||||
tableName = TableUtils.tableName(pluginViewSet.getTableId());
|
||||
}else {
|
||||
switch (DatasetType.getEnumObjByKey(pluginViewSet.getType())) {
|
||||
case DB:
|
||||
@ -134,11 +134,11 @@ public class ViewPluginBaseServiceImpl implements ViewPluginBaseService {
|
||||
}
|
||||
}
|
||||
String keyword = ConstantsUtil.constantsValue(pluginViewSet.getDsType(), "KEYWORD_TABLE");
|
||||
String tabelName = (tableName.startsWith("(") && tableName.endsWith(")")) ? tableName : String.format(keyword, tableName);
|
||||
String tabelAlias = String.format(TABLE_ALIAS_PREFIX, 0);
|
||||
PluginViewSQL tableObj = PluginViewSQL.builder().tableName(tabelName).tableAlias(tabelAlias).build();
|
||||
String realTableName = (tableName.startsWith("(") && tableName.endsWith(")")) ? tableName : String.format(keyword, tableName);
|
||||
String tableAlias = String.format(TABLE_ALIAS_PREFIX, 0);
|
||||
PluginViewSQL tableObj = PluginViewSQL.builder().tableName(realTableName).tableAlias(tableAlias).build();
|
||||
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;
|
||||
queryProvider.setSchema(sqlObj, child.getDs());
|
||||
tableObj.setTableName(sqlObj.getTableName());
|
||||
|
@ -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);
|
||||
|
||||
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -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();
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
@ -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) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
List<AxisChartDataAntVDTO> datas = new ArrayList<>();
|
||||
List<AxisChartDataAntVDTO> dataList = new ArrayList<>();
|
||||
for (int i1 = 0; i1 < data.size(); i1++) {
|
||||
String[] row = data.get(i1);
|
||||
|
||||
@ -65,7 +65,7 @@ public class ChartDataBuild {
|
||||
}
|
||||
axisChartDataDTO.setCategory(yAxis.get(j).getName());
|
||||
}
|
||||
datas.add(axisChartDataDTO);
|
||||
dataList.add(axisChartDataDTO);
|
||||
}
|
||||
} else {
|
||||
for (int i = xAxis.size(); i < xAxis.size() + yAxis.size(); i++) {
|
||||
@ -95,18 +95,18 @@ public class ChartDataBuild {
|
||||
axisChartDataDTO.setValue(new BigDecimal(0));
|
||||
}
|
||||
axisChartDataDTO.setCategory(yAxis.get(j).getName());
|
||||
datas.add(axisChartDataDTO);
|
||||
dataList.add(axisChartDataDTO);
|
||||
}
|
||||
}
|
||||
}
|
||||
map.put("datas", datas);
|
||||
map.put("data", dataList);
|
||||
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) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
List<AxisChartDataAntVDTO> datas = new ArrayList<>();
|
||||
List<AxisChartDataAntVDTO> dataList = new ArrayList<>();
|
||||
for (int i1 = 0; i1 < data.size(); i1++) {
|
||||
String[] row = data.get(i1);
|
||||
|
||||
@ -159,10 +159,10 @@ public class ChartDataBuild {
|
||||
axisChartDataDTO.setValue(new BigDecimal(0));
|
||||
}
|
||||
axisChartDataDTO.setCategory(b.toString());
|
||||
datas.add(axisChartDataDTO);
|
||||
dataList.add(axisChartDataDTO);
|
||||
}
|
||||
}
|
||||
map.put("datas", datas);
|
||||
map.put("data", dataList);
|
||||
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) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
List<AxisChartDataAntVDTO> datas = new ArrayList<>();
|
||||
List<AxisChartDataAntVDTO> dataList = new ArrayList<>();
|
||||
|
||||
if (CollectionUtils.isNotEmpty(extStack)) {
|
||||
for (int i1 = 0; i1 < data.size(); i1++) {
|
||||
@ -219,7 +219,7 @@ public class ChartDataBuild {
|
||||
axisChartDataDTO.setQuotaList(quotaList);
|
||||
axisChartDataDTO.setValue(new BigDecimal(0));
|
||||
}
|
||||
datas.add(axisChartDataDTO);
|
||||
dataList.add(axisChartDataDTO);
|
||||
}
|
||||
} else {
|
||||
for (int i1 = 0; i1 < data.size(); i1++) {
|
||||
@ -265,11 +265,11 @@ public class ChartDataBuild {
|
||||
axisChartDataDTO.setValue(new BigDecimal(0));
|
||||
}
|
||||
axisChartDataDTO.setCategory(yAxis.get(j).getName());
|
||||
datas.add(axisChartDataDTO);
|
||||
dataList.add(axisChartDataDTO);
|
||||
}
|
||||
}
|
||||
}
|
||||
map.put("datas", datas);
|
||||
map.put("data", dataList);
|
||||
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) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
List<AxisChartDataAntVDTO> datas = new ArrayList<>();
|
||||
List<AxisChartDataAntVDTO> dataList = new ArrayList<>();
|
||||
for (int i1 = 0; i1 < data.size(); i1++) {
|
||||
String[] row = data.get(i1);
|
||||
|
||||
@ -329,10 +329,10 @@ public class ChartDataBuild {
|
||||
axisChartDataDTO.setPopSize(new BigDecimal(0));
|
||||
}
|
||||
}
|
||||
datas.add(axisChartDataDTO);
|
||||
dataList.add(axisChartDataDTO);
|
||||
}
|
||||
}
|
||||
map.put("datas", datas);
|
||||
map.put("data", dataList);
|
||||
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) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
|
||||
List<AxisChartDataAntVDTO> datas = new ArrayList<>();
|
||||
List<AxisChartDataAntVDTO> dataList = new ArrayList<>();
|
||||
for (int i1 = 0; i1 < data.size(); i1++) {
|
||||
String[] row = data.get(i1);
|
||||
|
||||
@ -384,10 +384,10 @@ public class ChartDataBuild {
|
||||
axisChartDataDTO.setValue(new BigDecimal(0));
|
||||
}
|
||||
axisChartDataDTO.setCategory(yAxis.get(j).getName());
|
||||
datas.add(axisChartDataDTO);
|
||||
dataList.add(axisChartDataDTO);
|
||||
}
|
||||
}
|
||||
map.put("datas", datas);
|
||||
map.put("data", dataList);
|
||||
return map;
|
||||
}
|
||||
|
||||
@ -450,7 +450,7 @@ public class ChartDataBuild {
|
||||
}
|
||||
}
|
||||
|
||||
map.put("datas", series);
|
||||
map.put("data", series);
|
||||
return map;
|
||||
}
|
||||
|
||||
|
@ -510,7 +510,7 @@ public class DataSetTableService {
|
||||
DatasourceRequest datasourceRequest = new DatasourceRequest();
|
||||
datasourceRequest.setDatasource(ds);
|
||||
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)
|
||||
@ -519,7 +519,7 @@ public class DataSetTableService {
|
||||
datasetTableField.setTableId(dataSetTableRequest.getId());
|
||||
datasetTableField.setChecked(Boolean.TRUE);
|
||||
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> quota = new ArrayList<>();
|
||||
|
||||
@ -556,7 +556,7 @@ public class DataSetTableService {
|
||||
public Map<String, Object> getPreviewData(DataSetTableRequest dataSetTableRequest, Integer page, Integer pageSize,
|
||||
List<DatasetTableField> extFields) throws Exception {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
String sycnStatus = "";
|
||||
String syncStatus = "";
|
||||
DatasetTableField datasetTableField = DatasetTableField.builder().tableId(dataSetTableRequest.getId())
|
||||
.checked(Boolean.TRUE).build();
|
||||
List<DatasetTableField> fields = dataSetTableFieldsService.list(datasetTableField);
|
||||
@ -574,7 +574,7 @@ public class DataSetTableService {
|
||||
List<DataSetRowPermissionsTreeDTO> rowPermissionsTree = permissionsTreeService.getRowPermissionsTree(fields, datasetTable, null);
|
||||
// 列权限
|
||||
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)) {
|
||||
map.put("fields", fields);
|
||||
map.put("data", new ArrayList<>());
|
||||
@ -783,7 +783,7 @@ public class DataSetTableService {
|
||||
List<DataSetTaskLogDTO> dataSetTaskLogDTOS = dataSetTableTaskLogService.listTaskLog(request, "excel");
|
||||
if (CollectionUtils.isNotEmpty(dataSetTaskLogDTOS)) {
|
||||
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")) {
|
||||
@ -951,7 +951,7 @@ public class DataSetTableService {
|
||||
map.put("fields", fields);
|
||||
map.put("data", jsonArray);
|
||||
map.put("page", dataSetPreviewPage);
|
||||
map.put("sycnStatus", sycnStatus);
|
||||
map.put("syncStatus", syncStatus);
|
||||
|
||||
return map;
|
||||
}
|
||||
@ -1109,7 +1109,7 @@ public class DataSetTableService {
|
||||
binaryExpression = (BinaryExpression) expr;
|
||||
} 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);
|
||||
} else {
|
||||
expr.accept(getExpressionDeParser(stringBuilder));
|
||||
@ -2112,7 +2112,7 @@ public class DataSetTableService {
|
||||
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());
|
||||
Datasource ds = datasourceMapper.selectByPrimaryKey(datasetTable.getDataSourceId());
|
||||
QueryProvider qp = ProviderFactory.getQueryProvider(ds.getType());
|
||||
@ -2125,18 +2125,18 @@ public class DataSetTableService {
|
||||
.replace(lastUpdateTime, Long.valueOf(System.currentTimeMillis()).toString())
|
||||
.replace(currentUpdateTime, Long.valueOf(System.currentTimeMillis()).toString());
|
||||
datasourceRequest.setQuery(qp.wrapSql(sql));
|
||||
List<String> sqlFileds = new ArrayList<>();
|
||||
List<String> sqlFields = new ArrayList<>();
|
||||
try {
|
||||
datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableField::getFieldName)
|
||||
.forEach(field -> {
|
||||
sqlFileds.add(field);
|
||||
sqlFields.add(field);
|
||||
});
|
||||
} catch (Exception e) {
|
||||
DataEaseException.throwException(Translator.get("i18n_check_sql_error") + e.getMessage());
|
||||
}
|
||||
|
||||
if (!originNameFileds.equals(sqlFileds)) {
|
||||
DataEaseException.throwException(Translator.get("i18n_sql_add_not_matching") + sqlFileds.toString());
|
||||
if (!originNameFields.equals(sqlFields)) {
|
||||
DataEaseException.throwException(Translator.get("i18n_sql_add_not_matching") + sqlFields.toString());
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(datasetTableIncrementalConfig.getIncrementalDelete())
|
||||
@ -2145,16 +2145,16 @@ public class DataSetTableService {
|
||||
.replace(lastUpdateTime, Long.valueOf(System.currentTimeMillis()).toString())
|
||||
.replace(currentUpdateTime, Long.valueOf(System.currentTimeMillis()).toString());
|
||||
datasourceRequest.setQuery(qp.wrapSql(sql));
|
||||
List<String> sqlFileds = new ArrayList<>();
|
||||
List<String> sqlFields = new ArrayList<>();
|
||||
try {
|
||||
datasourceProvider.fetchResultField(datasourceRequest).stream().map(TableField::getFieldName)
|
||||
.forEach(field -> sqlFileds.add(field));
|
||||
.forEach(field -> sqlFields.add(field));
|
||||
} catch (Exception e) {
|
||||
DataEaseException.throwException(Translator.get("i18n_check_sql_error") + e.getMessage());
|
||||
}
|
||||
|
||||
if (!originNameFileds.equals(sqlFileds)) {
|
||||
DataEaseException.throwException(Translator.get("i18n_sql_delete_not_matching") + sqlFileds.toString());
|
||||
if (!originNameFields.equals(sqlFields)) {
|
||||
DataEaseException.throwException(Translator.get("i18n_sql_delete_not_matching") + sqlFields.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2218,7 +2218,7 @@ public class DataSetTableService {
|
||||
String filename = file.getOriginalFilename();
|
||||
// parse file
|
||||
List<ExcelSheetData> excelSheetDataList = parseExcel(filename, file.getInputStream(), true);
|
||||
List<ExcelSheetData> retrunSheetDataList = new ArrayList<>();
|
||||
List<ExcelSheetData> returnSheetDataList = new ArrayList<>();
|
||||
|
||||
if (StringUtils.isNotEmpty(tableId)) {
|
||||
List<DatasetTableField> fields = dataSetTableFieldsService.getFieldsByTableId(tableId);
|
||||
@ -2240,10 +2240,10 @@ public class DataSetTableService {
|
||||
List<TableField> tableFields = excelSheetData.getFields();
|
||||
List<String> newFields = tableFields.stream().map(TableField::getRemarks).collect(Collectors.toList());
|
||||
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"));
|
||||
}
|
||||
} else {
|
||||
@ -2278,41 +2278,41 @@ public class DataSetTableService {
|
||||
}
|
||||
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"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
retrunSheetDataList = excelSheetDataList;
|
||||
returnSheetDataList = excelSheetDataList;
|
||||
}
|
||||
retrunSheetDataList = retrunSheetDataList.stream()
|
||||
returnSheetDataList = returnSheetDataList.stream()
|
||||
.filter(excelSheetData -> CollectionUtils.isNotEmpty(excelSheetData.getFields()))
|
||||
.collect(Collectors.toList());
|
||||
// save file
|
||||
String excelId = UUID.randomUUID().toString();
|
||||
String filePath = saveFile(file, excelId);
|
||||
ExcelFileData excelFileData = new ExcelFileData();
|
||||
excelFileData.setExcelLable(filename);
|
||||
excelFileData.setExcelLabel(filename);
|
||||
excelFileData.setId(excelId);
|
||||
excelFileData.setPath(filePath);
|
||||
|
||||
filename = filename.substring(0, filename.lastIndexOf('.'));
|
||||
if (retrunSheetDataList.size() == 1) {
|
||||
retrunSheetDataList.get(0).setDatasetName(filename);
|
||||
retrunSheetDataList.get(0).setSheetExcelId(excelId);
|
||||
retrunSheetDataList.get(0).setId(UUID.randomUUID().toString());
|
||||
retrunSheetDataList.get(0).setPath(filePath);
|
||||
if (returnSheetDataList.size() == 1) {
|
||||
returnSheetDataList.get(0).setDatasetName(filename);
|
||||
returnSheetDataList.get(0).setSheetExcelId(excelId);
|
||||
returnSheetDataList.get(0).setId(UUID.randomUUID().toString());
|
||||
returnSheetDataList.get(0).setPath(filePath);
|
||||
} else {
|
||||
for (ExcelSheetData excelSheetData : retrunSheetDataList) {
|
||||
excelSheetData.setDatasetName(filename + "-" + excelSheetData.getExcelLable());
|
||||
for (ExcelSheetData excelSheetData : returnSheetDataList) {
|
||||
excelSheetData.setDatasetName(filename + "-" + excelSheetData.getExcelLabel());
|
||||
excelSheetData.setSheetExcelId(excelId);
|
||||
excelSheetData.setId(UUID.randomUUID().toString());
|
||||
excelSheetData.setPath(filePath);
|
||||
}
|
||||
}
|
||||
excelFileData.setSheets(retrunSheetDataList);
|
||||
excelFileData.setSheets(returnSheetDataList);
|
||||
return excelFileData;
|
||||
}
|
||||
|
||||
@ -2359,7 +2359,7 @@ public class DataSetTableService {
|
||||
String[] fieldArray = fields.stream().map(TableField::getFieldName).toArray(String[]::new);
|
||||
excelSheetData.setFields(fields);
|
||||
excelSheetData.setData(data);
|
||||
excelSheetData.setExcelLable(filename);
|
||||
excelSheetData.setExcelLabel(filename);
|
||||
excelSheetData.setFieldsMd5(Md5Utils.md5(StringUtils.join(fieldArray, ",")));
|
||||
excelSheetDataList.add(excelSheetData);
|
||||
}
|
||||
@ -2644,7 +2644,7 @@ public class DataSetTableService {
|
||||
|
||||
@Override
|
||||
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);
|
||||
} else {
|
||||
getBuffer().append(between.getLeftExpression()).append(" BETWEEN ").append(between.getBetweenExpressionStart()).append(" AND ").append(between.getBetweenExpressionEnd());
|
||||
@ -2653,7 +2653,7 @@ public class DataSetTableService {
|
||||
|
||||
@Override
|
||||
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);
|
||||
return;
|
||||
}
|
||||
@ -2664,7 +2664,7 @@ public class DataSetTableService {
|
||||
|
||||
@Override
|
||||
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);
|
||||
return;
|
||||
}
|
||||
@ -2675,7 +2675,7 @@ public class DataSetTableService {
|
||||
|
||||
@Override
|
||||
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);
|
||||
return;
|
||||
}
|
||||
@ -2686,7 +2686,7 @@ public class DataSetTableService {
|
||||
|
||||
@Override
|
||||
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);
|
||||
return;
|
||||
}
|
||||
@ -2708,7 +2708,7 @@ public class DataSetTableService {
|
||||
|
||||
@Override
|
||||
public void visit(LikeExpression likeExpression) {
|
||||
if (hasVarible(likeExpression.toString())) {
|
||||
if (hasVariable(likeExpression.toString())) {
|
||||
getBuffer().append(SubstitutedSql);
|
||||
return;
|
||||
}
|
||||
@ -2723,7 +2723,7 @@ public class DataSetTableService {
|
||||
|
||||
@Override
|
||||
public void visit(InExpression inExpression) {
|
||||
if (inExpression.getRightItemsList() != null && hasVarible(inExpression.getRightItemsList().toString())) {
|
||||
if (inExpression.getRightItemsList() != null && hasVariable(inExpression.getRightItemsList().toString())) {
|
||||
stringBuilder.append(SubstitutedSql);
|
||||
return;
|
||||
}
|
||||
@ -2752,7 +2752,7 @@ public class DataSetTableService {
|
||||
public void visit(SubSelect subSelect) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
Expression in = ((PlainSelect) subSelect.getSelectBody()).getWhere();
|
||||
if (in instanceof BinaryExpression && hasVarible(in.toString())) {
|
||||
if (in instanceof BinaryExpression && hasVariable(in.toString())) {
|
||||
stringBuilder.append(SubstitutedParams);
|
||||
} else {
|
||||
in.accept(getExpressionDeParser(stringBuilder));
|
||||
@ -2777,7 +2777,7 @@ public class DataSetTableService {
|
||||
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);
|
||||
} else {
|
||||
expr.getLeftExpression().accept(this);
|
||||
@ -2791,7 +2791,7 @@ public class DataSetTableService {
|
||||
|
||||
} 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);
|
||||
} else {
|
||||
expr.getRightExpression().accept(this);
|
||||
@ -2801,7 +2801,7 @@ public class DataSetTableService {
|
||||
return expressionDeParser;
|
||||
}
|
||||
|
||||
static private boolean hasVarible(String sql) {
|
||||
static private boolean hasVariable(String sql) {
|
||||
return sql.contains(SubstitutedParams);
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,7 @@ public class ExtractDataService {
|
||||
private static final String lastUpdateTime = "${__last_update_time__}";
|
||||
private static final String currentUpdateTime = "${__current_update_time__}";
|
||||
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/";
|
||||
|
||||
@Value("${kettle.files.keep:false}")
|
||||
@ -471,11 +471,11 @@ public class ExtractDataService {
|
||||
}
|
||||
switch (extractType) {
|
||||
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);
|
||||
break;
|
||||
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);
|
||||
break;
|
||||
}
|
||||
@ -722,7 +722,7 @@ public class ExtractDataService {
|
||||
}
|
||||
|
||||
for (ExcelSheetData sheet : totalSheets) {
|
||||
if (sheet.getExcelLable().equalsIgnoreCase(excelSheetData.getExcelLable())) {
|
||||
if (sheet.getExcelLabel().equalsIgnoreCase(excelSheetData.getExcelLabel())) {
|
||||
for (List<String> dataItem : sheet.getData()) {
|
||||
if (dataItem.size() > 0) {
|
||||
data.add(dataItem.toArray(new String[dataItem.size()]));
|
||||
@ -820,16 +820,16 @@ public class ExtractDataService {
|
||||
case "all_scope":
|
||||
outFile = TableUtils.tmpName(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;
|
||||
case "incremental_add":
|
||||
outFile = TableUtils.addName(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;
|
||||
case "incremental_delete":
|
||||
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());
|
||||
break;
|
||||
default:
|
||||
@ -1098,7 +1098,7 @@ public class ExtractDataService {
|
||||
filesRequired.add("Y");
|
||||
|
||||
ExcelInputMeta excelInputMeta = new ExcelInputMeta();
|
||||
sheetNames.add(excelSheetData.getExcelLable());
|
||||
sheetNames.add(excelSheetData.getExcelLabel());
|
||||
if (StringUtils.equalsIgnoreCase(suffix, "xlsx")) {
|
||||
excelInputMeta.setSpreadSheetType(SpreadSheetType.SAX_POI);
|
||||
excelInputMeta.setSheetName(sheetNames.toArray(new String[sheetNames.size()]));
|
||||
@ -1141,7 +1141,7 @@ public class ExtractDataService {
|
||||
textFileOutputMeta.setHeaderEnabled(false);
|
||||
textFileOutputMeta.setFilename(root_path + dorisOutputTable);
|
||||
textFileOutputMeta.setSeparator(separator);
|
||||
textFileOutputMeta.setExtension(extention);
|
||||
textFileOutputMeta.setExtension(extension);
|
||||
|
||||
if (datasource.getType().equalsIgnoreCase(DatasourceTypes.oracle.name())) {
|
||||
TextFileField[] outputFields = new TextFileField[datasetTableFields.size() + 1];
|
||||
@ -1295,7 +1295,7 @@ public class ExtractDataService {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
deleteFile(root_path + fileName + "." + extention);
|
||||
deleteFile(root_path + fileName + "." + extension);
|
||||
deleteFile(root_path + jobName + ".kjb");
|
||||
deleteFile(root_path + transName + ".ktr");
|
||||
}
|
||||
@ -1388,8 +1388,8 @@ public class ExtractDataService {
|
||||
" r = createOutputRow(r, data.outputRowMeta.size());\n" +
|
||||
" String str = \"\";\n" +
|
||||
"\n" +
|
||||
" List<String> fileds = Arrays.asList(\"Column_Fields\".split(\",\"));\n" +
|
||||
" for (String filed : fileds) {\n" +
|
||||
" List<String> fields = Arrays.asList(\"Column_Fields\".split(\",\"));\n" +
|
||||
" for (String filed : fields) {\n" +
|
||||
" String tmp = get(Fields.In, filed).getString(r);\n" +
|
||||
"handleCharset \n" +
|
||||
"handleWraps \n" +
|
||||
|
@ -73,7 +73,7 @@ public class PermissionService {
|
||||
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<ColumnPermissionItem> allColumnPermissionItems = new ArrayList<>();
|
||||
for (DataSetColumnPermissionsDTO dataSetColumnPermissionsDTO : columnPermissions(datasetTableId, user)) {
|
||||
|
@ -104,7 +104,7 @@ public class DirectFieldService implements DataSetFieldService {
|
||||
if (userPermissions) {
|
||||
//列权限
|
||||
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));
|
||||
permissionFields = fieldIds.stream().map(fieldMap::get).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(permissionFields) || permissionFields.get(0) == null) {
|
||||
|
@ -87,7 +87,7 @@ public class SysMsgService {
|
||||
return sysMsgMapper.countByExample(example);
|
||||
}
|
||||
|
||||
public void setReaded(Long msgId) {
|
||||
public void setRead(Long msgId) {
|
||||
SysMsg sysMsg = new SysMsg();
|
||||
sysMsg.setMsgId(msgId);
|
||||
sysMsg.setStatus(true);
|
||||
@ -95,7 +95,7 @@ public class SysMsgService {
|
||||
sysMsgMapper.updateByPrimaryKeySelective(sysMsg);
|
||||
}
|
||||
|
||||
public void setBatchReaded(List<Long> msgIds) {
|
||||
public void setBatchRead(List<Long> msgIds) {
|
||||
extSysMsgMapper.batchStatus(msgIds, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
|
@ -120,18 +120,18 @@ public class PanelAppTemplateService {
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
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++) {
|
||||
Datasource datasource = newDatasourceList.get(0);
|
||||
datasource.setId(null);
|
||||
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)
|
||||
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();
|
||||
String userName = AuthUtils.getUser().getUsername();
|
||||
panelViewsInfo.forEach(panelView -> {
|
||||
@ -139,13 +139,13 @@ public class PanelAppTemplateService {
|
||||
panelView.setPanelId(panelId);
|
||||
panelView.setCreateTime(time);
|
||||
panelView.setCreateBy(userName);
|
||||
panelView.setChartViewId(chartViewsRelaMap.get(panelView.getChartViewId()));
|
||||
panelView.setChartViewId(chartViewsRealMap.get(panelView.getChartViewId()));
|
||||
panelViewService.save(panelView);
|
||||
});
|
||||
}
|
||||
|
||||
@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.setPid(pid);
|
||||
panelInfo.setName(panelName);
|
||||
@ -153,48 +153,48 @@ public class PanelAppTemplateService {
|
||||
panelInfo.setPanelType("self");
|
||||
panelInfo.setCreateBy(AuthUtils.getUser().getUsername());
|
||||
panelInfo.setCreateTime(System.currentTimeMillis());
|
||||
panelGroupService.newPanelFromApp(panelInfo, chartViewsRelaMap);
|
||||
panelGroupService.newPanelFromApp(panelInfo, chartViewsRealMap);
|
||||
return newPanelId;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, String> applyDataset(List<DatasetTable> datasetTablesInfo, Map<String, String> datasourceRelaMap, String sceneId) throws Exception {
|
||||
Map<String, String> datasetsRelaMap = new HashMap<>();
|
||||
public Map<String, String> applyDataset(List<DatasetTable> datasetTablesInfo, Map<String, String> datasourceRealMap, String sceneId) throws Exception {
|
||||
Map<String, String> datasetsRealMap = new HashMap<>();
|
||||
for (DatasetTable datasetTable : datasetTablesInfo) {
|
||||
String oldId = datasetTable.getId();
|
||||
datasetTable.setId(null);
|
||||
datasetTable.setSceneId(sceneId);
|
||||
datasetTable.setDataSourceId(datasourceRelaMap.get(datasetTable.getDataSourceId()));
|
||||
datasetTable.setDataSourceId(datasourceRealMap.get(datasetTable.getDataSourceId()));
|
||||
DataSetTableRequest datasetRequest = new DataSetTableRequest();
|
||||
BeanUtils.copyBean(datasetRequest, datasetTable);
|
||||
datasetRequest.setOptFrom("appApply");
|
||||
datasetRequest.setSyncType("sync_now");
|
||||
DatasetTable newDataset = dataSetTableService.save(datasetRequest);
|
||||
datasetsRelaMap.put(oldId, newDataset.getId());
|
||||
datasetsRealMap.put(oldId, newDataset.getId());
|
||||
}
|
||||
return datasetsRelaMap;
|
||||
return datasetsRealMap;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, String> applyDatasetField(List<DatasetTableField> datasetTableFieldsInfo, Map<String, String> datasetsRelaMap) {
|
||||
Map<String, String> datasetFieldsRelaMap = new HashMap<>();
|
||||
public Map<String, String> applyDatasetField(List<DatasetTableField> datasetTableFieldsInfo, Map<String, String> datasetsRealMap) {
|
||||
Map<String, String> datasetFieldsRealMap = new HashMap<>();
|
||||
for (DatasetTableField datasetTableField : datasetTableFieldsInfo) {
|
||||
String oldId = datasetTableField.getId();
|
||||
datasetTableField.setTableId(datasetsRelaMap.get(datasetTableField.getTableId()));
|
||||
datasetTableField.setTableId(datasetsRealMap.get(datasetTableField.getTableId()));
|
||||
DatasetTableField newTableField = dataSetTableFieldsService.save(datasetTableField);
|
||||
datasetFieldsRelaMap.put(oldId, newTableField.getId());
|
||||
datasetFieldsRealMap.put(oldId, newTableField.getId());
|
||||
}
|
||||
return datasetFieldsRelaMap;
|
||||
return datasetFieldsRealMap;
|
||||
}
|
||||
|
||||
@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) {
|
||||
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));
|
||||
});
|
||||
datasetFieldsRelaMap.forEach((k, v) -> {
|
||||
datasetFieldsRealMap.forEach((k, v) -> {
|
||||
datasetTable.setInfo(datasetTable.getInfo().replaceAll(k, v));
|
||||
});
|
||||
if (1 == datasetTable.getMode()) {
|
||||
@ -209,13 +209,13 @@ public class PanelAppTemplateService {
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, String> applyViews(List<ChartViewWithBLOBs> chartViewsInfo, Map<String, String> datasetsRelaMap, Map<String, String> datasetFieldsRelaMap, String sceneId) throws Exception {
|
||||
Map<String, String> chartViewsRelaMap = new HashMap<>();
|
||||
public Map<String, String> applyViews(List<ChartViewWithBLOBs> chartViewsInfo, Map<String, String> datasetsRealMap, Map<String, String> datasetFieldsRealMap, String sceneId) throws Exception {
|
||||
Map<String, String> chartViewsRealMap = new HashMap<>();
|
||||
for (ChartViewWithBLOBs chartView : chartViewsInfo) {
|
||||
String oldViewId = chartView.getId();
|
||||
// 替换datasetId
|
||||
chartView.setTableId(datasetsRelaMap.get(chartView.getTableId()));
|
||||
datasetsRelaMap.forEach((k, v) -> {
|
||||
chartView.setTableId(datasetsRealMap.get(chartView.getTableId()));
|
||||
datasetsRealMap.forEach((k, v) -> {
|
||||
chartView.setXAxis(chartView.getXAxis().replaceAll(k, v));
|
||||
chartView.setXAxisExt(chartView.getXAxisExt().replaceAll(k, v));
|
||||
chartView.setYAxis(chartView.getYAxis().replaceAll(k, v));
|
||||
@ -228,7 +228,7 @@ public class PanelAppTemplateService {
|
||||
chartView.setDrillFields(chartView.getDrillFields().replaceAll(k, v));
|
||||
});
|
||||
//替换datasetFieldId
|
||||
datasetFieldsRelaMap.forEach((k, v) -> {
|
||||
datasetFieldsRealMap.forEach((k, v) -> {
|
||||
chartView.setXAxis(chartView.getXAxis().replaceAll(k, v));
|
||||
chartView.setXAxisExt(chartView.getXAxisExt().replaceAll(k, v));
|
||||
chartView.setYAxis(chartView.getYAxis().replaceAll(k, v));
|
||||
@ -243,31 +243,31 @@ public class PanelAppTemplateService {
|
||||
chartView.setId(null);
|
||||
chartView.setSceneId(sceneId);
|
||||
ChartViewWithBLOBs newOne = chartViewService.newOne(chartView);
|
||||
chartViewsRelaMap.put(oldViewId, newOne.getId());
|
||||
chartViewsRealMap.put(oldViewId, newOne.getId());
|
||||
}
|
||||
return chartViewsRelaMap;
|
||||
return chartViewsRealMap;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, String> applyViewsField(List<ChartViewField> chartViewFieldsInfo, Map<String, String> chartViewsRelaMap, Map<String, String> datasetsRelaMap, Map<String, String> datasetFieldsRelaMap) {
|
||||
Map<String, String> chartViewFieldsRelaMap = new HashMap<>();
|
||||
public Map<String, String> applyViewsField(List<ChartViewField> chartViewFieldsInfo, Map<String, String> chartViewsRealMap, Map<String, String> datasetsRealMap, Map<String, String> datasetFieldsRealMap) {
|
||||
Map<String, String> chartViewFieldsRealMap = new HashMap<>();
|
||||
if (!CollectionUtils.isEmpty(chartViewFieldsInfo)) {
|
||||
for (ChartViewField chartViewField : chartViewFieldsInfo) {
|
||||
String oldChartFieldId = chartViewField.getId();
|
||||
chartViewField.setId(null);
|
||||
//替换datasetId
|
||||
chartViewField.setTableId(datasetsRelaMap.get(chartViewField.getTableId()));
|
||||
chartViewField.setTableId(datasetsRealMap.get(chartViewField.getTableId()));
|
||||
//替换chartViewId
|
||||
chartViewField.setChartId(chartViewsRelaMap.get(chartViewField.getId()));
|
||||
chartViewField.setChartId(chartViewsRealMap.get(chartViewField.getId()));
|
||||
//替换datasetFieldId
|
||||
datasetFieldsRelaMap.forEach((k, v) -> {
|
||||
datasetFieldsRealMap.forEach((k, v) -> {
|
||||
chartViewField.setOriginName(chartViewField.getOriginName().replaceAll(k, v));
|
||||
});
|
||||
ChartViewField newChartViewField = chartViewFieldService.save(chartViewField);
|
||||
chartViewFieldsRelaMap.put(oldChartFieldId, newChartViewField.getId());
|
||||
chartViewFieldsRealMap.put(oldChartFieldId, newChartViewField.getId());
|
||||
}
|
||||
}
|
||||
return chartViewFieldsRelaMap;
|
||||
return chartViewFieldsRealMap;
|
||||
}
|
||||
|
||||
public void nameCheck(PanelAppTemplateApplyRequest request) {
|
||||
|
@ -401,12 +401,12 @@ public class PanelGroupService {
|
||||
return newPanelId;
|
||||
}
|
||||
@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 templateData = request.getPanelData();
|
||||
String staticResource = request.getStaticResource();
|
||||
Boolean mobileLayout = panelViewService.havaMobileLayout(templateData);
|
||||
for(Map.Entry<String,String> entry:chartViewsRelaMap.entrySet()){
|
||||
Boolean mobileLayout = panelViewService.haveMobileLayout(templateData);
|
||||
for(Map.Entry<String,String> entry:chartViewsRealMap.entrySet()){
|
||||
templateData = templateData.replaceAll(entry.getKey(),entry.getValue());
|
||||
}
|
||||
request.setMobileLayout(mobileLayout);
|
||||
@ -439,13 +439,13 @@ public class PanelGroupService {
|
||||
templateStyle = panelTemplate.getTemplateStyle();
|
||||
templateData = panelTemplate.getTemplateData();
|
||||
dynamicData = panelTemplate.getDynamicData();
|
||||
mobileLayout = panelViewService.havaMobileLayout(templateData);
|
||||
mobileLayout = panelViewService.haveMobileLayout(templateData);
|
||||
} else if (PanelConstants.NEW_PANEL_FROM.NEW_OUTER_TEMPLATE.equals(newFrom)) {
|
||||
templateStyle = request.getPanelStyle();
|
||||
templateData = request.getPanelData();
|
||||
dynamicData = request.getDynamicData();
|
||||
staticResource = request.getStaticResource();
|
||||
mobileLayout = panelViewService.havaMobileLayout(templateData);
|
||||
mobileLayout = panelViewService.haveMobileLayout(templateData);
|
||||
} else if (PanelConstants.NEW_PANEL_FROM.NEW_MARKET_TEMPLATE.equals(newFrom)) {
|
||||
PanelTemplateFileDTO templateFileInfo = getTemplateFromMarket(request.getTemplateUrl());
|
||||
if (templateFileInfo == null) {
|
||||
@ -455,7 +455,7 @@ public class PanelGroupService {
|
||||
templateData = templateFileInfo.getPanelData();
|
||||
dynamicData = templateFileInfo.getDynamicData();
|
||||
staticResource = templateFileInfo.getStaticResource();
|
||||
mobileLayout = panelViewService.havaMobileLayout(templateData);
|
||||
mobileLayout = panelViewService.haveMobileLayout(templateData);
|
||||
}
|
||||
Map<String, String> dynamicDataMap = gson.fromJson(dynamicData, Map.class);
|
||||
if (dynamicDataMap == null) {
|
||||
@ -803,7 +803,7 @@ public class PanelGroupService {
|
||||
if (CollectionUtils.isEmpty(datasourceDTOS)) {
|
||||
return new PanelExport2App("this panel don't have datasource");
|
||||
} 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);
|
||||
}
|
||||
@ -841,23 +841,23 @@ public class PanelGroupService {
|
||||
//获取仪表板视图信息
|
||||
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();
|
||||
|
||||
|
@ -133,7 +133,7 @@ public class PanelViewService {
|
||||
return viewIds;
|
||||
}
|
||||
|
||||
public Boolean havaMobileLayout(String panelData){
|
||||
public Boolean haveMobileLayout(String panelData){
|
||||
Boolean mobileLayout = false;
|
||||
if (StringUtils.isNotEmpty(panelData)) {
|
||||
JsonArray dataArray = JsonParser.parseString(panelData).getAsJsonArray();
|
||||
|
@ -351,16 +351,16 @@ public class ShareService {
|
||||
param.put("deptId", deptId);
|
||||
param.put("roleIds", CollectionUtils.isNotEmpty(roleIds)? roleIds: null);
|
||||
|
||||
List<PanelSharePo> datas = extPanelShareMapper.query(param);
|
||||
List<PanelShareDto> dtoLists = datas.stream().map(po -> BeanUtils.copyBean(new PanelShareDto(), po))
|
||||
List<PanelSharePo> data = extPanelShareMapper.query(param);
|
||||
List<PanelShareDto> dtoLists = data.stream().map(po -> BeanUtils.copyBean(new PanelShareDto(), po))
|
||||
.collect(Collectors.toList());
|
||||
return convertTree(dtoLists);
|
||||
}
|
||||
|
||||
// List构建Tree
|
||||
private List<PanelShareDto> convertTree(List<PanelShareDto> datas) {
|
||||
private List<PanelShareDto> convertTree(List<PanelShareDto> data) {
|
||||
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())
|
||||
&& !StringUtils.equals(username, panelShareDto.getCreator()))
|
||||
.collect(Collectors.groupingBy(PanelShareDto::getCreator));
|
||||
|
@ -48,18 +48,18 @@ public class AppLogManager {
|
||||
|
||||
public String detailInfo(SysLogWithBLOBs vo) {
|
||||
String sourceName = vo.getSourceName();
|
||||
String postion = null;
|
||||
String position = null;
|
||||
String operateTypeName = SysLogConstants.operateTypeName(vo.getOperateType());
|
||||
operateTypeName = Translator.get(operateTypeName);
|
||||
String sourceTypeName = SysLogConstants.sourceTypeName(vo.getSourceType());
|
||||
sourceTypeName = Translator.get(sourceTypeName);
|
||||
String result = operateTypeName + sourceTypeName + String.format(contentFormat, sourceName) + remarkInfo(vo);
|
||||
|
||||
if ((postion = vo.getPosition()) != null) {
|
||||
List<FolderItem> folderItems = gson.fromJson(postion, type);
|
||||
if ((position = vo.getPosition()) != null) {
|
||||
List<FolderItem> folderItems = gson.fromJson(position, type);
|
||||
String template = folderItems.stream().map(folderItem -> folderItem.getName()).collect(Collectors.joining("/"));
|
||||
String postionResult = String.format(positionFormat, template);
|
||||
return postionResult + result;
|
||||
String positionResult = String.format(positionFormat, template);
|
||||
return positionResult + result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -113,9 +113,9 @@ public class MenuService {
|
||||
return sysMenuMapper.updateByPrimaryKeySelective(sysMenu);
|
||||
}
|
||||
|
||||
public List<MenuNodeResponse> childs(Long pid) {
|
||||
Set<SysMenu> childs = getChilds(nodesByPid(pid), new HashSet());
|
||||
List<SysMenu> menus = new ArrayList<>(childs);
|
||||
public List<MenuNodeResponse> children(Long pid) {
|
||||
Set<SysMenu> children = getChildren(nodesByPid(pid), new HashSet());
|
||||
List<SysMenu> menus = new ArrayList<>(children);
|
||||
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());
|
||||
}
|
||||
|
||||
private Set<SysMenu> getChilds(List<SysMenu> lists, Set<SysMenu> sets) {
|
||||
private Set<SysMenu> getChildren(List<SysMenu> lists, Set<SysMenu> sets) {
|
||||
lists.forEach(menu -> {
|
||||
sets.add(menu);
|
||||
List<SysMenu> kidMenus = nodesByPid(menu.getMenuId());
|
||||
if (CollectionUtils.isNotEmpty(kidMenus)) {
|
||||
getChilds(kidMenus, sets);
|
||||
getChildren(kidMenus, sets);
|
||||
}
|
||||
});
|
||||
return sets;
|
||||
|
@ -48,18 +48,18 @@ public class LogManager {
|
||||
|
||||
public String detailInfo(SysLogWithBLOBs vo) {
|
||||
String sourceName = vo.getSourceName();
|
||||
String postion = null;
|
||||
String position = null;
|
||||
String operateTypeName = SysLogConstants.operateTypeName(vo.getOperateType());
|
||||
operateTypeName = Translator.get(operateTypeName);
|
||||
String sourceTypeName = SysLogConstants.sourceTypeName(vo.getSourceType());
|
||||
sourceTypeName = Translator.get(sourceTypeName);
|
||||
String result = operateTypeName + sourceTypeName + String.format(contentFormat, sourceName) + remarkInfo(vo);
|
||||
|
||||
if ((postion = vo.getPosition()) != null) {
|
||||
List<FolderItem> folderItems = gson.fromJson(postion, type);
|
||||
if ((position = vo.getPosition()) != null) {
|
||||
List<FolderItem> folderItems = gson.fromJson(position, type);
|
||||
String template = folderItems.stream().map(folderItem -> folderItem.getName()).collect(Collectors.joining("/"));
|
||||
String postionResult = String.format(positionFormat, template);
|
||||
return postionResult + result;
|
||||
String positionResult = String.format(positionFormat, template);
|
||||
return positionResult + result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -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`;
|
||||
|
||||
|
||||
|
||||
UPDATE `sys_msg_type` set `type_name` = 'i18n_msg_type_dataset_sync_failed' WHERE (`msg_type_id` = 6);
|
||||
|
@ -102,7 +102,7 @@ i18n_msg_type_panel_share=Dashboard sharing
|
||||
i18n_msg_type_panel_share_cacnel=Dashboard unshared
|
||||
i18n_msg_type_dataset_sync=Data set synchronization
|
||||
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_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
|
||||
@ -178,10 +178,10 @@ i18n_not_admin_error=Not an administrator account
|
||||
i18n_user_not_exist=user does not exist
|
||||
i18n_default_login_reset=Switched back to default login mode
|
||||
I18N_COMMON_LEVEL_USE=Consult
|
||||
I18N_PANNEL_LEVEL_VIEW=Consult
|
||||
I18N_PANNEL_LEVEL_EXPORT=Export
|
||||
I18N_PANNEL_LEVEL_MANAGE=Manage
|
||||
I18N_PANNEL_LEVEL_GRANT=Grant
|
||||
I18N_PANEL_LEVEL_VIEW=Consult
|
||||
I18N_PANEL_LEVEL_EXPORT=Export
|
||||
I18N_PANEL_LEVEL_MANAGE=Manage
|
||||
I18N_PANEL_LEVEL_GRANT=Grant
|
||||
I18N_DATASET_LEVEL_USE=Consult
|
||||
I18N_DATASET_LEVEL_MANAGE=Manage
|
||||
I18N_DATASET_LEVEL_GRANT=Grant
|
||||
|
@ -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_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_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_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
|
||||
@ -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_default_login_reset=\u5DF2\u5207\u6362\u56DE\u9ED8\u8BA4\u767B\u5F55\u65B9\u5F0F
|
||||
I18N_COMMON_LEVEL_USE=\u67E5\u770B
|
||||
I18N_PANNEL_LEVEL_VIEW=\u67E5\u770B
|
||||
I18N_PANNEL_LEVEL_EXPORT=\u5BFC\u51FA
|
||||
I18N_PANNEL_LEVEL_MANAGE=\u7BA1\u7406
|
||||
I18N_PANNEL_LEVEL_GRANT=\u6388\u6743
|
||||
I18N_PANEL_LEVEL_VIEW=\u67E5\u770B
|
||||
I18N_PANEL_LEVEL_EXPORT=\u5BFC\u51FA
|
||||
I18N_PANEL_LEVEL_MANAGE=\u7BA1\u7406
|
||||
I18N_PANEL_LEVEL_GRANT=\u6388\u6743
|
||||
I18N_DATASET_LEVEL_USE=\u67E5\u770B
|
||||
I18N_DATASET_LEVEL_MANAGE=\u7BA1\u7406
|
||||
I18N_DATASET_LEVEL_GRANT=\u6388\u6743
|
||||
|
@ -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_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_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_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
|
||||
@ -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_default_login_reset=\u5DF2\u5207\u63DB\u56DE\u9ED8\u8A8D\u767B\u9304\u65B9\u5F0F
|
||||
I18N_COMMON_LEVEL_USE=\u67E5\u770B
|
||||
I18N_PANNEL_LEVEL_VIEW=\u67E5\u770B
|
||||
I18N_PANNEL_LEVEL_EXPORT=\u5C0E\u51FA
|
||||
I18N_PANNEL_LEVEL_MANAGE=\u7BA1\u7406
|
||||
I18N_PANNEL_LEVEL_GRANT=\u6388\u6B0A
|
||||
I18N_PANEL_LEVEL_VIEW=\u67E5\u770B
|
||||
I18N_PANEL_LEVEL_EXPORT=\u5C0E\u51FA
|
||||
I18N_PANEL_LEVEL_MANAGE=\u7BA1\u7406
|
||||
I18N_PANEL_LEVEL_GRANT=\u6388\u6B0A
|
||||
I18N_DATASET_LEVEL_USE=\u67E5\u770B
|
||||
I18N_DATASET_LEVEL_MANAGE=\u7BA1\u7406
|
||||
I18N_DATASET_LEVEL_GRANT=\u6388\u6B0A
|
||||
|
@ -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>
|
@ -171,7 +171,7 @@ export default {
|
||||
_popoverShowFun(val) {
|
||||
this.openDialog()
|
||||
this._updateH()
|
||||
this.$emit('onFoucs')
|
||||
this.$emit('onFocus')
|
||||
},
|
||||
|
||||
_selectRemoveTag(viewId) {
|
||||
|
@ -54,7 +54,7 @@
|
||||
v-model="selectAll"
|
||||
v-customStyle="customStyle"
|
||||
:indeterminate="isIndeterminate"
|
||||
@change="selectAllChane"
|
||||
@change="selectAllChange"
|
||||
>{{ $t('dataset.check_all') }}</el-checkbox></p>
|
||||
<el-scrollbar
|
||||
tag="div"
|
||||
@ -276,7 +276,7 @@ export default {
|
||||
resetSelectAll() {
|
||||
this.selectAll = false
|
||||
},
|
||||
selectAllChane(val) {
|
||||
selectAllChange(val) {
|
||||
if (val) {
|
||||
this.ids = this._checkSum()
|
||||
this._emitFun()
|
||||
@ -535,7 +535,7 @@ export default {
|
||||
},
|
||||
_popoverShowFun(val) {
|
||||
this._updateH()
|
||||
this.$emit('onFoucs')
|
||||
this.$emit('onFocus')
|
||||
},
|
||||
_popoverHideFun(e) {
|
||||
const path = this._getEventPath(e)
|
||||
|
@ -19,7 +19,7 @@
|
||||
v-model="selectAll"
|
||||
v-customStyle="customStyle"
|
||||
:indeterminate="isIndeterminate"
|
||||
@change="selectAllChane"
|
||||
@change="selectAllChange"
|
||||
>{{ $t('dataset.check_all') }}</el-checkbox></p>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
@ -74,7 +74,7 @@ export default {
|
||||
selectValue: this.value,
|
||||
options: [],
|
||||
domList: null,
|
||||
slectBoxDom: null,
|
||||
selectBoxDom: null,
|
||||
scrollbar: null,
|
||||
startIndex: 0,
|
||||
endIndex: 0,
|
||||
@ -139,7 +139,7 @@ export default {
|
||||
}
|
||||
return this.selectValue === id && 'selected'
|
||||
},
|
||||
selectAllChane(val) {
|
||||
selectAllChange(val) {
|
||||
const vals = val ? [...this.list.map(ele => ele.id)] : []
|
||||
this.visualChange(vals)
|
||||
this.selectValue = vals
|
||||
@ -154,9 +154,9 @@ export default {
|
||||
reCacularHeight() {
|
||||
this.maxHeightDom.style.height = this.newList.length * this.itemHeight + 'px'
|
||||
},
|
||||
resetList(arrys) {
|
||||
if (Array.isArray(arrys)) {
|
||||
this.newList = arrys.slice()
|
||||
resetList(arrays) {
|
||||
if (Array.isArray(arrays)) {
|
||||
this.newList = arrays.slice()
|
||||
this.domList.style.paddingTop = 0 + 'px'
|
||||
this.scrollbar.scrollTop = 0
|
||||
this.callback()
|
||||
@ -183,13 +183,13 @@ export default {
|
||||
`.${this.classId} .el-select-dropdown .el-select-dropdown__wrap`
|
||||
)
|
||||
this.scrollbar = document.querySelector(`.${this.classId} .el-select-dropdown .el-scrollbar`)
|
||||
this.slectBoxDom = document.querySelector(`.${this.classId} .el-select-dropdown__wrap`)
|
||||
this.slectBoxDom.style.display = 'flex'
|
||||
this.slectBoxDom.style.flexDirection = 'row'
|
||||
this.selectBoxDom = document.querySelector(`.${this.classId} .el-select-dropdown__wrap`)
|
||||
this.selectBoxDom.style.display = 'flex'
|
||||
this.selectBoxDom.style.flexDirection = 'row'
|
||||
this.domList = selectDom.querySelector(
|
||||
`.${this.classId} .el-select-dropdown__wrap .el-select-dropdown__list`
|
||||
)
|
||||
this.addScrollDiv(this.slectBoxDom)
|
||||
this.addScrollDiv(this.selectBoxDom)
|
||||
|
||||
this.scrollFn()
|
||||
this.customInputStyle()
|
||||
|
@ -58,7 +58,7 @@
|
||||
@click="handler"
|
||||
>
|
||||
<div
|
||||
v-for="option in pane.datas"
|
||||
v-for="option in pane.data"
|
||||
:key="option.value"
|
||||
class="el-select-dropdown__item color-div-base"
|
||||
:class="option.value === colorDto.value ? 'selected hover editor' : ''"
|
||||
@ -163,12 +163,12 @@ export default {
|
||||
{
|
||||
label: '纯色',
|
||||
name: 'simple',
|
||||
datas: JSON.parse(JSON.stringify(colorCases))
|
||||
data: JSON.parse(JSON.stringify(colorCases))
|
||||
},
|
||||
{
|
||||
label: '渐变',
|
||||
name: 'gradient',
|
||||
datas: JSON.parse(JSON.stringify(gradientColorCases))
|
||||
data: JSON.parse(JSON.stringify(gradientColorCases))
|
||||
}
|
||||
],
|
||||
testColor: '#5470c6'
|
||||
@ -213,7 +213,7 @@ export default {
|
||||
}
|
||||
this.activeName = this.colorCases.some(item => item.value === this.colorDto.value) ? 'simple' : 'gradient'
|
||||
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) {
|
||||
item.colors = JSON.parse(JSON.stringify(this.colorDto.colors))
|
||||
}
|
||||
@ -261,7 +261,7 @@ export default {
|
||||
},
|
||||
_popoverShowFun(val) {
|
||||
this._updateH()
|
||||
this.$emit('onFoucs')
|
||||
this.$emit('onFocus')
|
||||
},
|
||||
fillGradientColor() {
|
||||
this.gradientColorCases.forEach(item => {
|
||||
@ -270,7 +270,7 @@ export default {
|
||||
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) {
|
||||
let activeName = this.activeName
|
||||
|
@ -152,11 +152,11 @@ export default {
|
||||
if (this.$route && this.$route.name && this.$route.name === row.router) {
|
||||
// 如果当前路由就是目标路由 那么使用router.push页面不会刷新 这时候要使用事件方式
|
||||
row.callback && bus.$emit(row.callback, param)
|
||||
row.status || this.setReaded(row.msgId)
|
||||
row.status || this.setRead(row.msgId)
|
||||
} else {
|
||||
if (this.hasPermissionRoute(row.router)) {
|
||||
this.$router.push({ name: row.router, params: param })
|
||||
row.status || this.setReaded(row.msgId)
|
||||
row.status || this.setRead(row.msgId)
|
||||
return
|
||||
}
|
||||
this.$warning(this.$t('commons.no_target_permission'))
|
||||
@ -247,7 +247,7 @@ export default {
|
||||
this.visible = true
|
||||
},
|
||||
// 设置已读
|
||||
setReaded(msgId) {
|
||||
setRead(msgId) {
|
||||
updateStatus(msgId).then(res => {
|
||||
this.search()
|
||||
})
|
||||
|
@ -166,7 +166,7 @@ export default {
|
||||
// 同一方向上同时显示三条线可能不太美观,因此才有了这个解决方案
|
||||
// 同一方向上的线只显示一条,例如多条横条只显示一条横线
|
||||
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)
|
||||
},
|
||||
|
||||
chooseTheTureLine(needToShow, isDownward, isRightward) {
|
||||
chooseTheTrueLine(needToShow, isDownward, isRightward) {
|
||||
// 如果鼠标向右移动 则按从右到左的顺序显示竖线 否则按相反顺序显示
|
||||
// 如果鼠标向下移动 则按从下到上的顺序显示横线 否则按相反顺序显示
|
||||
if (isRightward) {
|
||||
|
@ -39,7 +39,7 @@
|
||||
import eventBus from '@/components/canvas/utils/eventBus'
|
||||
import runAnimation from '@/components/canvas/utils/runAnimation'
|
||||
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'
|
||||
|
||||
export default {
|
||||
@ -347,12 +347,12 @@ export default {
|
||||
}
|
||||
|
||||
needSave = true
|
||||
const curPositon = {
|
||||
const curPosition = {
|
||||
x: moveEvent.clientX - editorRectInfo.left,
|
||||
y: moveEvent.clientY - editorRectInfo.top
|
||||
}
|
||||
|
||||
calculateComponentPositonAndSize(point, style, curPositon, proportion, needLockProportion, {
|
||||
calculateComponentPositionAndSize(point, style, curPosition, proportion, needLockProportion, {
|
||||
center,
|
||||
curPoint,
|
||||
symmetricPoint
|
||||
|
@ -333,11 +333,11 @@
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="attrShow('titlePostion')"
|
||||
v-if="attrShow('titlePosition')"
|
||||
style="width: 20px;float: left;margin-top: 2px;margin-left: 10px;"
|
||||
>
|
||||
<el-tooltip :content="$t('panel.title_position')">
|
||||
<title-postion
|
||||
<title-position
|
||||
:element-type="elementType"
|
||||
:show-vertical="showVertical"
|
||||
:style-info="styleInfo"
|
||||
@ -506,7 +506,7 @@ export default {
|
||||
'fontWeight',
|
||||
'letterSpacing',
|
||||
'color',
|
||||
'titlePostion'
|
||||
'titlePosition'
|
||||
],
|
||||
// tab组件显示的属性
|
||||
'de-tabs': [
|
||||
|
@ -176,7 +176,7 @@
|
||||
<el-row style="height: 20px">
|
||||
<el-col :span="4">
|
||||
<svg-icon
|
||||
icon-class="warn-tre"
|
||||
icon-class="warn-tree"
|
||||
style="width: 20px;height: 20px;float: right"
|
||||
/>
|
||||
</el-col>
|
||||
|
@ -12,10 +12,10 @@ const funcs = {
|
||||
l: calculateLeft
|
||||
}
|
||||
|
||||
function calculateLeftTop(style, curPositon, proportion, needLockProportion, pointInfo) {
|
||||
function calculateLeftTop(style, curPosition, proportion, needLockProportion, pointInfo) {
|
||||
const { symmetricPoint } = pointInfo
|
||||
let newCenterPoint = getCenterPoint(curPositon, symmetricPoint)
|
||||
let newTopLeftPoint = calculateRotatedPointCoordinate(curPositon, newCenterPoint, -style.rotate)
|
||||
let newCenterPoint = getCenterPoint(curPosition, symmetricPoint)
|
||||
let newTopLeftPoint = calculateRotatedPointCoordinate(curPosition, newCenterPoint, -style.rotate)
|
||||
let newBottomRightPoint = calculateRotatedPointCoordinate(symmetricPoint, newCenterPoint, -style.rotate)
|
||||
|
||||
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
|
||||
let newCenterPoint = getCenterPoint(curPositon, symmetricPoint)
|
||||
let newTopRightPoint = calculateRotatedPointCoordinate(curPositon, newCenterPoint, -style.rotate)
|
||||
let newCenterPoint = getCenterPoint(curPosition, symmetricPoint)
|
||||
let newTopRightPoint = calculateRotatedPointCoordinate(curPosition, newCenterPoint, -style.rotate)
|
||||
let newBottomLeftPoint = calculateRotatedPointCoordinate(symmetricPoint, newCenterPoint, -style.rotate)
|
||||
|
||||
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
|
||||
let newCenterPoint = getCenterPoint(curPositon, symmetricPoint)
|
||||
let newCenterPoint = getCenterPoint(curPosition, symmetricPoint)
|
||||
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 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
|
||||
let newCenterPoint = getCenterPoint(curPositon, symmetricPoint)
|
||||
let newCenterPoint = getCenterPoint(curPosition, symmetricPoint)
|
||||
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 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 rotatedcurPositon = calculateRotatedPointCoordinate(curPositon, curPoint, -style.rotate)
|
||||
const rotatedcurPosition = calculateRotatedPointCoordinate(curPosition, curPoint, -style.rotate)
|
||||
const rotatedTopMiddlePoint = calculateRotatedPointCoordinate({
|
||||
x: curPoint.x,
|
||||
y: rotatedcurPositon.y
|
||||
y: rotatedcurPosition.y
|
||||
}, 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 rotatedcurPositon = calculateRotatedPointCoordinate(curPositon, curPoint, -style.rotate)
|
||||
const rotatedcurPosition = calculateRotatedPointCoordinate(curPosition, curPoint, -style.rotate)
|
||||
const rotatedRightMiddlePoint = calculateRotatedPointCoordinate({
|
||||
x: rotatedcurPositon.x,
|
||||
x: rotatedcurPosition.x,
|
||||
y: curPoint.y
|
||||
}, 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 rotatedcurPositon = calculateRotatedPointCoordinate(curPositon, curPoint, -style.rotate)
|
||||
const rotatedcurPosition = calculateRotatedPointCoordinate(curPosition, curPoint, -style.rotate)
|
||||
const rotatedBottomMiddlePoint = calculateRotatedPointCoordinate({
|
||||
x: curPoint.x,
|
||||
y: rotatedcurPositon.y
|
||||
y: rotatedcurPosition.y
|
||||
}, curPoint, style.rotate)
|
||||
|
||||
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 rotatedcurPositon = calculateRotatedPointCoordinate(curPositon, curPoint, -style.rotate)
|
||||
const rotatedcurPosition = calculateRotatedPointCoordinate(curPosition, curPoint, -style.rotate)
|
||||
const rotatedLeftMiddlePoint = calculateRotatedPointCoordinate({
|
||||
x: rotatedcurPositon.x,
|
||||
x: rotatedcurPosition.x,
|
||||
y: curPoint.y
|
||||
}, curPoint, style.rotate)
|
||||
|
||||
@ -268,6 +268,6 @@ function calculateLeft(style, curPositon, proportion, needLockProportion, pointI
|
||||
}
|
||||
}
|
||||
|
||||
export default function calculateComponentPositonAndSize(name, style, curPositon, proportion, needLockProportion, pointInfo) {
|
||||
funcs[name](style, curPositon, proportion, needLockProportion, pointInfo)
|
||||
export default function calculateComponentPositionAndSize(name, style, curPosition, proportion, needLockProportion, pointInfo) {
|
||||
funcs[name](style, curPosition, proportion, needLockProportion, pointInfo)
|
||||
}
|
@ -7,7 +7,7 @@
|
||||
label="1"
|
||||
size="mini"
|
||||
border
|
||||
>{{ $t('cron.every') }}{{ lable }}</el-radio>
|
||||
>{{ $t('cron.every') }}{{ label }}</el-radio>
|
||||
</div>
|
||||
<div>
|
||||
<el-radio
|
||||
@ -34,7 +34,7 @@
|
||||
style="width: 100px;"
|
||||
@change="type = '2'"
|
||||
/>
|
||||
{{ lable }}
|
||||
{{ label }}
|
||||
</div>
|
||||
<div>
|
||||
<el-radio
|
||||
@ -52,7 +52,7 @@
|
||||
style="width: 100px;"
|
||||
@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
|
||||
v-model="loop.end"
|
||||
:min="1"
|
||||
@ -61,7 +61,7 @@
|
||||
style="width: 100px;"
|
||||
@change="type = '3'"
|
||||
/>
|
||||
{{ lable }}{{ $t('cron.every_exec') }}
|
||||
{{ label }}{{ $t('cron.every_exec') }}
|
||||
</div>
|
||||
<div>
|
||||
<el-radio
|
||||
@ -95,7 +95,7 @@ export default {
|
||||
type: String,
|
||||
default: '*'
|
||||
},
|
||||
lable: {
|
||||
label: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
|
@ -30,9 +30,9 @@
|
||||
<div class="condition-content-container">
|
||||
<div class="first-element">
|
||||
<div
|
||||
:class="element.component === 'de-select-grid' ? 'first-element-grid-contaner': ''"
|
||||
:class="element.component === 'de-select-grid' ? 'first-element-grid-container': ''"
|
||||
:style="deSelectGridBg"
|
||||
class="first-element-contaner"
|
||||
class="first-element-container"
|
||||
>
|
||||
|
||||
<component
|
||||
@ -241,7 +241,7 @@ export default {
|
||||
padding: 0px;
|
||||
height: 100%;
|
||||
}
|
||||
.first-element-contaner {
|
||||
.first-element-container {
|
||||
width: calc(100% - 10px);
|
||||
background: initial;
|
||||
margin: 0 4px;
|
||||
@ -251,7 +251,7 @@ export default {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
}
|
||||
.first-element-grid-contaner {
|
||||
.first-element-grid-container {
|
||||
background: #fff;
|
||||
border: 1px solid #d7dae2;
|
||||
top: 5px;
|
||||
|
@ -16,7 +16,7 @@
|
||||
<div class="pagination-cont">
|
||||
<el-pagination
|
||||
background
|
||||
v-bind="paginationDefalut"
|
||||
v-bind="paginationDefault"
|
||||
v-on="paginationEvent"
|
||||
/>
|
||||
</div>
|
||||
@ -56,27 +56,27 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
paginationEvent: {},
|
||||
paginationDefalut: {
|
||||
paginationDefault: {
|
||||
currentPage: 1,
|
||||
pageSizes: [10, 20, 50, 100],
|
||||
pageSize: 10,
|
||||
layout: 'total, prev, pager, next, sizes, jumper',
|
||||
total: 0
|
||||
},
|
||||
multipleSelectionCach: [],
|
||||
multipleSelectionCache: [],
|
||||
tableEvent: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
multipleSelectionAll() {
|
||||
return [...this.multipleSelectionCach, ...this.multipleSelection]
|
||||
return [...this.multipleSelectionCache, ...this.multipleSelection]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
pagination: {
|
||||
handler() {
|
||||
this.paginationDefalut = {
|
||||
...this.paginationDefalut,
|
||||
this.paginationDefault = {
|
||||
...this.paginationDefault,
|
||||
...this.pagination
|
||||
}
|
||||
},
|
||||
@ -114,24 +114,24 @@ export default {
|
||||
this.$refs.table.toggleRowSelection(row, true)
|
||||
},
|
||||
handlerSelected(multipleSelection) {
|
||||
this.multipleSelectionCach = [
|
||||
...this.multipleSelectionCach,
|
||||
this.multipleSelectionCache = [
|
||||
...this.multipleSelectionCache,
|
||||
...multipleSelection
|
||||
]
|
||||
const flags = this.multipleSelectionCach.map(
|
||||
const flags = this.multipleSelectionCache.map(
|
||||
(ele) => ele[this.selectedFlags]
|
||||
)
|
||||
// 当前页的选中项索引
|
||||
const notCurrenArr = []
|
||||
const notCurrentArr = []
|
||||
this.tableData.forEach((ele) => {
|
||||
const resultIndex = flags.indexOf(ele[this.selectedFlags])
|
||||
if (resultIndex !== -1) {
|
||||
this.$refs.table.toggleRowSelection(ele, true)
|
||||
notCurrenArr.push(resultIndex)
|
||||
notCurrentArr.push(resultIndex)
|
||||
}
|
||||
})
|
||||
notCurrenArr.sort().reduceRight((pre, next) => {
|
||||
this.multipleSelectionCach.splice(next, 1)
|
||||
notCurrentArr.sort().reduceRight((pre, next) => {
|
||||
this.multipleSelectionCache.splice(next, 1)
|
||||
}, 0)
|
||||
},
|
||||
handleListeners() {
|
||||
|
@ -116,7 +116,7 @@ export default {
|
||||
},
|
||||
form: {
|
||||
handler(value) {
|
||||
this.destryTimeMachine()
|
||||
this.destroyTimeMachine()
|
||||
this.changeIndex++
|
||||
this.searchWithKey(this.changeIndex)
|
||||
},
|
||||
@ -161,10 +161,10 @@ export default {
|
||||
if (index === this.changeIndex) {
|
||||
this.search()
|
||||
}
|
||||
this.destryTimeMachine()
|
||||
this.destroyTimeMachine()
|
||||
}, 1000)
|
||||
},
|
||||
destryTimeMachine() {
|
||||
destroyTimeMachine() {
|
||||
this.timeMachine && clearTimeout(this.timeMachine)
|
||||
this.timeMachine = null
|
||||
},
|
||||
|
@ -15,7 +15,7 @@
|
||||
:filter-method="filterMethod"
|
||||
:key-word="keyWord"
|
||||
popper-class="coustom-de-select"
|
||||
:list="datas"
|
||||
:list="data"
|
||||
:custom-style="customStyle"
|
||||
@change="changeValue"
|
||||
@focus="setOptionWidth"
|
||||
@ -24,7 +24,7 @@
|
||||
@handleShowNumber="handleShowNumber"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in templateDatas || datas"
|
||||
v-for="item in templateData || data"
|
||||
:key="item[element.options.attrs.key]"
|
||||
:style="{width:selectOptionWidth}"
|
||||
:label="item[element.options.attrs.label]"
|
||||
@ -77,7 +77,7 @@ export default {
|
||||
selectOptionWidth: 0,
|
||||
show: true,
|
||||
value: null,
|
||||
datas: [],
|
||||
data: [],
|
||||
onFocus: false,
|
||||
keyWord: ''
|
||||
}
|
||||
@ -90,7 +90,7 @@ export default {
|
||||
}
|
||||
return result
|
||||
},
|
||||
templateDatas() {
|
||||
templateData() {
|
||||
return this.mode === 'el-visual-select' ? [] : null
|
||||
},
|
||||
operator() {
|
||||
@ -133,7 +133,7 @@ export default {
|
||||
},
|
||||
'element.options.attrs.fieldId': function(value, old) {
|
||||
if (value === null || typeof value === 'undefined' || value === old) return
|
||||
this.datas = []
|
||||
this.data = []
|
||||
|
||||
let method = multFieldValues
|
||||
const token = this.$store.getters.token || getToken()
|
||||
@ -148,7 +148,7 @@ export default {
|
||||
this.element.options.attrs.fieldId &&
|
||||
this.element.options.attrs.fieldId.length > 0 &&
|
||||
method(param).then(res => {
|
||||
this.datas = this.optionDatas(res.data)
|
||||
this.data = this.optionData(res.data)
|
||||
bus.$emit('valid-values-change', true)
|
||||
}).catch(e => {
|
||||
bus.$emit('valid-values-change', false)
|
||||
@ -171,7 +171,7 @@ export default {
|
||||
if (value === null || typeof value === 'undefined' || value === old || isSameVueObj(value, old)) return
|
||||
this.show = false
|
||||
|
||||
this.datas = []
|
||||
this.data = []
|
||||
|
||||
let method = multFieldValues
|
||||
const token = this.$store.getters.token || getToken()
|
||||
@ -186,7 +186,7 @@ export default {
|
||||
this.element.options.attrs.fieldId &&
|
||||
this.element.options.attrs.fieldId.length > 0 &&
|
||||
method(param).then(res => {
|
||||
this.datas = this.optionDatas(res.data)
|
||||
this.data = this.optionData(res.data)
|
||||
this.$nextTick(() => {
|
||||
this.show = true
|
||||
this.handleCoustomStyle()
|
||||
@ -248,7 +248,7 @@ export default {
|
||||
},
|
||||
initLoad() {
|
||||
this.value = this.fillValueDerfault()
|
||||
this.datas = []
|
||||
this.data = []
|
||||
if (this.element.options.attrs.fieldId) {
|
||||
let method = multFieldValues
|
||||
const token = this.$store.getters.token || getToken()
|
||||
@ -257,7 +257,7 @@ export default {
|
||||
method = linkMultFieldValues
|
||||
}
|
||||
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)
|
||||
}).catch(e => {
|
||||
bus.$emit('valid-values-change', false)
|
||||
@ -336,9 +336,9 @@ export default {
|
||||
return defaultV.split(',')[0]
|
||||
}
|
||||
},
|
||||
optionDatas(datas) {
|
||||
if (!datas) return null
|
||||
return datas.filter(item => !!item).map(item => {
|
||||
optionData(data) {
|
||||
if (!data) return null
|
||||
return data.filter(item => !!item).map(item => {
|
||||
return {
|
||||
id: item,
|
||||
text: item
|
||||
|
@ -32,7 +32,7 @@
|
||||
@change="handleCheckedChange"
|
||||
>
|
||||
<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"
|
||||
:label="item.id"
|
||||
>{{ item.id }}</el-checkbox>
|
||||
@ -48,7 +48,7 @@
|
||||
@change="changeRadioBox"
|
||||
>
|
||||
<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"
|
||||
:label="item.id"
|
||||
@click.native.prevent="testChange(item)"
|
||||
@ -109,7 +109,7 @@ export default {
|
||||
indeterminate: false
|
||||
},
|
||||
show: true,
|
||||
datas: [],
|
||||
data: [],
|
||||
isIndeterminate: false,
|
||||
checkAll: false
|
||||
}
|
||||
@ -148,13 +148,13 @@ export default {
|
||||
this.changeValue(value)
|
||||
|
||||
if (this.element.options.attrs.multiple) {
|
||||
this.checkAll = this.value.length === this.datas.length
|
||||
this.isIndeterminate = this.value.length > 0 && this.value.length < this.datas.length
|
||||
this.checkAll = this.value.length === this.data.length
|
||||
this.isIndeterminate = this.value.length > 0 && this.value.length < this.data.length
|
||||
}
|
||||
},
|
||||
'element.options.attrs.fieldId': function(value, old) {
|
||||
if (typeof value === 'undefined' || value === old) return
|
||||
this.datas = []
|
||||
this.data = []
|
||||
let method = multFieldValues
|
||||
const token = this.$store.getters.token || getToken()
|
||||
const linkToken = this.$store.getters.linkToken || getLinkToken()
|
||||
@ -168,11 +168,11 @@ export default {
|
||||
this.element.options.attrs.fieldId &&
|
||||
this.element.options.attrs.fieldId.length > 0 &&
|
||||
method(param).then(res => {
|
||||
this.datas = this.optionDatas(res.data)
|
||||
this.data = this.optionData(res.data)
|
||||
this.changeInputStyle()
|
||||
if (this.element.options.attrs.multiple) {
|
||||
this.checkAll = this.value.length === this.datas.length
|
||||
this.isIndeterminate = this.value.length > 0 && this.value.length < this.datas.length
|
||||
this.checkAll = this.value.length === this.data.length
|
||||
this.isIndeterminate = this.value.length > 0 && this.value.length < this.data.length
|
||||
}
|
||||
}) || (this.element.options.value = '')
|
||||
},
|
||||
@ -189,15 +189,15 @@ export default {
|
||||
this.$nextTick(() => {
|
||||
this.show = true
|
||||
if (value) {
|
||||
this.checkAll = this.value.length === this.datas.length
|
||||
this.isIndeterminate = this.value.length > 0 && this.value.length < this.datas.length
|
||||
this.checkAll = this.value.length === this.data.length
|
||||
this.isIndeterminate = this.value.length > 0 && this.value.length < this.data.length
|
||||
}
|
||||
this.changeInputStyle()
|
||||
})
|
||||
},
|
||||
'element.options.attrs.sort': function(value, old) {
|
||||
if (typeof value === 'undefined' || value === old) return
|
||||
this.datas = []
|
||||
this.data = []
|
||||
let method = multFieldValues
|
||||
const token = this.$store.getters.token || getToken()
|
||||
const linkToken = this.$store.getters.linkToken || getLinkToken()
|
||||
@ -211,11 +211,11 @@ export default {
|
||||
this.element.options.attrs.fieldId &&
|
||||
this.element.options.attrs.fieldId.length > 0 &&
|
||||
method(param).then(res => {
|
||||
this.datas = this.optionDatas(res.data)
|
||||
this.data = this.optionData(res.data)
|
||||
this.changeInputStyle()
|
||||
if (this.element.options.attrs.multiple) {
|
||||
this.checkAll = this.value.length === this.datas.length
|
||||
this.isIndeterminate = this.value.length > 0 && this.value.length < this.datas.length
|
||||
this.checkAll = this.value.length === this.data.length
|
||||
this.isIndeterminate = this.value.length > 0 && this.value.length < this.data.length
|
||||
}
|
||||
}) || (this.element.options.value = '')
|
||||
},
|
||||
@ -251,8 +251,8 @@ export default {
|
||||
this.changeValue(this.value)
|
||||
|
||||
if (this.element.options.attrs.multiple) {
|
||||
this.checkAll = this.value.length === this.datas.length
|
||||
this.isIndeterminate = this.value.length > 0 && this.value.length < this.datas.length
|
||||
this.checkAll = this.value.length === this.data.length
|
||||
this.isIndeterminate = this.value.length > 0 && this.value.length < this.data.length
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -284,11 +284,11 @@ export default {
|
||||
method = linkMultFieldValues
|
||||
}
|
||||
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()
|
||||
if (this.element.options.attrs.multiple) {
|
||||
this.checkAll = this.value.length === this.datas.length
|
||||
this.isIndeterminate = this.value.length > 0 && this.value.length < this.datas.length
|
||||
this.checkAll = this.value.length === this.data.length
|
||||
this.isIndeterminate = this.value.length > 0 && this.value.length < this.data.length
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -337,9 +337,9 @@ export default {
|
||||
return defaultV.split(',')[0]
|
||||
}
|
||||
},
|
||||
optionDatas(datas) {
|
||||
if (!datas) return null
|
||||
return datas.filter(item => !!item).map(item => {
|
||||
optionData(data) {
|
||||
if (!data) return null
|
||||
return data.filter(item => !!item).map(item => {
|
||||
return {
|
||||
id: item,
|
||||
text: item
|
||||
@ -350,14 +350,14 @@ export default {
|
||||
this.changeValue(value)
|
||||
},
|
||||
handleCheckAllChange(val) {
|
||||
this.value = val ? this.datas.map(item => item.id) : []
|
||||
this.value = val ? this.data.map(item => item.id) : []
|
||||
this.isIndeterminate = false
|
||||
this.changeValue(this.value)
|
||||
},
|
||||
handleCheckedChange(values) {
|
||||
const checkedCount = values.length
|
||||
this.checkAll = checkedCount === this.datas.length
|
||||
this.isIndeterminate = checkedCount > 0 && checkedCount < this.datas.length
|
||||
this.checkAll = checkedCount === this.data.length
|
||||
this.isIndeterminate = checkedCount > 0 && checkedCount < this.data.length
|
||||
this.changeValue(values)
|
||||
},
|
||||
testChange(item) {
|
||||
|
@ -5,7 +5,7 @@
|
||||
ref="deSelectTree"
|
||||
v-model="value"
|
||||
popover-class="test-class-wrap"
|
||||
:data="datas"
|
||||
:data="data"
|
||||
:select-params="selectParams"
|
||||
:tree-params="treeParams"
|
||||
:filter-node-method="_filterFun"
|
||||
@ -17,7 +17,7 @@
|
||||
@removeTag="changeNodeIds"
|
||||
@check="changeCheckNode"
|
||||
@select-clear="selectClear"
|
||||
@onFoucs="onFoucs"
|
||||
@onFocus="onFocus"
|
||||
@treeCheckChange="handleElTagStyle"
|
||||
/>
|
||||
|
||||
@ -59,7 +59,7 @@ export default {
|
||||
return {
|
||||
show: true,
|
||||
selectOptionWidth: 0,
|
||||
datas: [],
|
||||
data: [],
|
||||
// eslint-disable-next-line
|
||||
value: this.isSingle ? '' : [],
|
||||
selectParams: {
|
||||
@ -128,7 +128,7 @@ export default {
|
||||
},
|
||||
'element.options.attrs.fieldId': function(value, old) {
|
||||
if (value === null || typeof value === 'undefined' || value === old) return
|
||||
this.datas = []
|
||||
this.data = []
|
||||
|
||||
let method = mappingFieldValues
|
||||
const token = this.$store.getters.token || getToken()
|
||||
@ -143,9 +143,9 @@ export default {
|
||||
this.element.options.attrs.fieldId &&
|
||||
this.element.options.attrs.fieldId.length > 0 &&
|
||||
method(param).then(res => {
|
||||
this.datas = this.optionDatas(res.data)
|
||||
this.data = this.optionData(res.data)
|
||||
this.$nextTick(() => {
|
||||
this.$refs.deSelectTree && this.$refs.deSelectTree.treeDataUpdateFun(this.datas)
|
||||
this.$refs.deSelectTree && this.$refs.deSelectTree.treeDataUpdateFun(this.data)
|
||||
})
|
||||
})
|
||||
this.element.options.value = ''
|
||||
@ -177,13 +177,13 @@ export default {
|
||||
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) {
|
||||
if (value === null || typeof value === 'undefined' || value === old || isSameVueObj(value, old)) return
|
||||
this.datas = []
|
||||
this.data = []
|
||||
|
||||
let method = mappingFieldValues
|
||||
const token = this.$store.getters.token || getToken()
|
||||
@ -198,9 +198,9 @@ export default {
|
||||
this.element.options.attrs.fieldId &&
|
||||
this.element.options.attrs.fieldId.length > 0 &&
|
||||
method(param).then(res => {
|
||||
this.datas = this.optionDatas(res.data)
|
||||
this.data = this.optionData(res.data)
|
||||
this.$nextTick(() => {
|
||||
this.$refs.deSelectTree && this.$refs.deSelectTree.treeDataUpdateFun(this.datas)
|
||||
this.$refs.deSelectTree && this.$refs.deSelectTree.treeDataUpdateFun(this.data)
|
||||
})
|
||||
})
|
||||
this.element.options.value = ''
|
||||
@ -233,7 +233,7 @@ export default {
|
||||
this.changeValue(this.value)
|
||||
}
|
||||
},
|
||||
onFoucs() {
|
||||
onFocus() {
|
||||
this.$nextTick(() => {
|
||||
this.handleCoustomStyle()
|
||||
})
|
||||
@ -260,7 +260,7 @@ export default {
|
||||
},
|
||||
initLoad() {
|
||||
this.value = this.fillValueDerfault()
|
||||
this.datas = []
|
||||
this.data = []
|
||||
if (this.element.options.attrs.fieldId) {
|
||||
let method = mappingFieldValues
|
||||
const token = this.$store.getters.token || getToken()
|
||||
@ -269,9 +269,9 @@ export default {
|
||||
method = linkMappingFieldValues
|
||||
}
|
||||
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.$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]
|
||||
}
|
||||
},
|
||||
optionDatas(datas) {
|
||||
if (!datas) return null
|
||||
optionData(data) {
|
||||
if (!data) return null
|
||||
|
||||
return datas.filter(item => !!item)
|
||||
return data.filter(item => !!item)
|
||||
},
|
||||
|
||||
/* 下面是树的渲染方法 */
|
||||
|
@ -41,21 +41,21 @@
|
||||
</span>
|
||||
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="beforeHandleCommond('editTitle', item)">
|
||||
<el-dropdown-item :command="beforeHandleCommand('editTitle', item)">
|
||||
{{ $t('detabs.eidttitle') }}
|
||||
</el-dropdown-item>
|
||||
|
||||
<el-dropdown-item :command="beforeHandleCommond('selectView', item)">
|
||||
<el-dropdown-item :command="beforeHandleCommand('selectView', item)">
|
||||
{{ $t('detabs.selectview') }}
|
||||
</el-dropdown-item>
|
||||
|
||||
<el-dropdown-item :command="beforeHandleCommond('selectOthers', item)">
|
||||
<el-dropdown-item :command="beforeHandleCommand('selectOthers', item)">
|
||||
{{ $t('detabs.selectOthers') }}
|
||||
</el-dropdown-item>
|
||||
|
||||
<el-dropdown-item
|
||||
v-if=" element.options.tabList.length > 1"
|
||||
:command="beforeHandleCommond('deleteCur', item)"
|
||||
:command="beforeHandleCommand('deleteCur', item)"
|
||||
>
|
||||
{{ $t('table.delete') }}
|
||||
</el-dropdown-item>
|
||||
@ -348,7 +348,7 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
beforeHandleCommond(item, param) {
|
||||
beforeHandleCommand(item, param) {
|
||||
return {
|
||||
'command': item,
|
||||
'param': param
|
||||
@ -477,8 +477,8 @@ export default {
|
||||
if (this.element.options.tabList[len].name === param.name) {
|
||||
this.element.options.tabList.splice(len, 1)
|
||||
|
||||
const activIndex = (len - 1 + this.element.options.tabList.length) % this.element.options.tabList.length
|
||||
this.activeTabName = this.element.options.tabList[activIndex].name
|
||||
const activeIndex = (len - 1 + this.element.options.tabList.length) % this.element.options.tabList.length
|
||||
this.activeTabName = this.element.options.tabList[activeIndex].name
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('chart/setViewId', null)
|
||||
|
@ -10,7 +10,7 @@
|
||||
@change="changeValue"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options.attrs.datas"
|
||||
v-for="item in options.attrs.data"
|
||||
:key="item[options.attrs.key]"
|
||||
:label="item[options.attrs.label]"
|
||||
:value="item[options.attrs.value]"
|
||||
|
@ -86,7 +86,7 @@
|
||||
* @author: v_zhuchun
|
||||
* @date: 2019-05-23
|
||||
* @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 {
|
||||
props: {
|
||||
|
@ -13,7 +13,7 @@ const dialogPanel = {
|
||||
multiple: false,
|
||||
placeholder: 'denumbergridselect.placeholder',
|
||||
viewIds: [],
|
||||
datas: [],
|
||||
data: [],
|
||||
key: 'id',
|
||||
label: 'text',
|
||||
value: 'id',
|
||||
@ -73,9 +73,9 @@ class NumberSelectGridServiceImpl extends WidgetService {
|
||||
})
|
||||
}
|
||||
|
||||
optionDatas(datas) {
|
||||
if (!datas) return null
|
||||
return datas.filter(item => !!item).map(item => {
|
||||
optionData(data) {
|
||||
if (!data) return null
|
||||
return data.filter(item => !!item).map(item => {
|
||||
return {
|
||||
id: item,
|
||||
text: item
|
||||
|
@ -12,7 +12,7 @@ const dialogPanel = {
|
||||
attrs: {
|
||||
multiple: false,
|
||||
placeholder: 'denumberselect.placeholder',
|
||||
datas: [],
|
||||
data: [],
|
||||
viewIds: [],
|
||||
parameters: [],
|
||||
key: 'id',
|
||||
@ -75,9 +75,9 @@ class NumberSelectServiceImpl extends WidgetService {
|
||||
})
|
||||
}
|
||||
|
||||
optionDatas(datas) {
|
||||
if (!datas) return null
|
||||
return datas.filter(item => !!item).map(item => {
|
||||
optionData(data) {
|
||||
if (!data) return null
|
||||
return data.filter(item => !!item).map(item => {
|
||||
return {
|
||||
id: item,
|
||||
text: item
|
||||
|
@ -14,7 +14,7 @@ const dialogPanel = {
|
||||
placeholder: 'detextgridselect.placeholder',
|
||||
viewIds: [],
|
||||
parameters: [],
|
||||
datas: [],
|
||||
data: [],
|
||||
key: 'id',
|
||||
label: 'text',
|
||||
value: 'id',
|
||||
@ -74,9 +74,9 @@ class TextSelectGridServiceImpl extends WidgetService {
|
||||
})
|
||||
}
|
||||
|
||||
optionDatas(datas) {
|
||||
if (!datas) return null
|
||||
return datas.filter(item => !!item).map(item => {
|
||||
optionData(data) {
|
||||
if (!data) return null
|
||||
return data.filter(item => !!item).map(item => {
|
||||
return {
|
||||
id: item,
|
||||
text: item
|
||||
|
@ -13,7 +13,7 @@ const dialogPanel = {
|
||||
placeholder: 'detextselect.placeholder',
|
||||
viewIds: [],
|
||||
parameters: [],
|
||||
datas: [],
|
||||
data: [],
|
||||
key: 'id',
|
||||
label: 'text',
|
||||
value: 'id',
|
||||
@ -77,9 +77,9 @@ class TextSelectServiceImpl extends WidgetService {
|
||||
})
|
||||
}
|
||||
|
||||
optionDatas(datas) {
|
||||
if (!datas) return null
|
||||
return datas.filter(item => !!item).map(item => {
|
||||
optionData(data) {
|
||||
if (!data) return null
|
||||
return data.filter(item => !!item).map(item => {
|
||||
return {
|
||||
id: item,
|
||||
text: item
|
||||
|
@ -13,7 +13,7 @@ const dialogPanel = {
|
||||
placeholder: 'detextselectTree.placeholder',
|
||||
viewIds: [],
|
||||
parameters: [],
|
||||
datas: [],
|
||||
data: [],
|
||||
key: 'id',
|
||||
label: 'text',
|
||||
value: 'id',
|
||||
@ -76,9 +76,9 @@ class TextSelectTreeServiceImpl extends WidgetService {
|
||||
})
|
||||
}
|
||||
|
||||
optionDatas(datas) {
|
||||
if (!datas) return null
|
||||
return datas.filter(item => !!item).map(item => {
|
||||
optionData(data) {
|
||||
if (!data) return null
|
||||
return data.filter(item => !!item).map(item => {
|
||||
return {
|
||||
id: item,
|
||||
text: item
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
@ -35,7 +35,7 @@ export default {
|
||||
custom_table_fields_desc: 'Fixed field is not in the selection range'
|
||||
},
|
||||
steps: {
|
||||
cancel: 'Cancle',
|
||||
cancel: 'Cancel',
|
||||
next: 'next',
|
||||
prev: 'Last step',
|
||||
finish: 'Finish'
|
||||
@ -613,7 +613,7 @@ export default {
|
||||
member: {
|
||||
create: 'Add members',
|
||||
modify: 'Modify members',
|
||||
delete_confirm: 'Comfirm to delete this user?',
|
||||
delete_confirm: 'Confirm to delete this user?',
|
||||
please_choose_member: 'Please choose member',
|
||||
search_by_name: 'Search by name',
|
||||
modify_personal_info: 'Modify personal info',
|
||||
@ -792,12 +792,12 @@ export default {
|
||||
move_success: 'Removed successfully',
|
||||
user: 'user',
|
||||
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',
|
||||
input_organization_name: 'Please enter the organization name',
|
||||
relate_top_organization: 'Associated parent organization',
|
||||
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',
|
||||
sure_delete_organization: 'Are you sure to delete this organization?',
|
||||
add_child_org: 'Add sub organization',
|
||||
@ -1429,7 +1429,8 @@ export default {
|
||||
reserve_one: '1',
|
||||
reserve_two: '2',
|
||||
proportion: 'Proportion',
|
||||
label_content: 'Label Content'
|
||||
label_content: 'Label Content',
|
||||
percent: 'Percent'
|
||||
},
|
||||
dataset: {
|
||||
parse_filed: 'Parse Field',
|
||||
@ -1721,7 +1722,7 @@ export default {
|
||||
please_input_user_name: 'Please enter user name',
|
||||
please_input_password: 'Please enter Password',
|
||||
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',
|
||||
modify: 'Edit data Source',
|
||||
validate_success: 'Verification successful',
|
||||
@ -1960,7 +1961,7 @@ export default {
|
||||
confirm_delete: 'Confirm Delete',
|
||||
delete_success: 'Delete Success',
|
||||
confirm: 'Confirm',
|
||||
cancel: 'Cancle',
|
||||
cancel: 'Cancel',
|
||||
search: 'Search',
|
||||
back: 'Back',
|
||||
view: 'Chart',
|
||||
@ -2165,7 +2166,7 @@ export default {
|
||||
install_time: 'Install Time',
|
||||
release_time: 'Time',
|
||||
un_install: 'Uninstall',
|
||||
uninstall_confirm: 'Comfirm to uninstall the plugin?',
|
||||
uninstall_confirm: 'Confirm to uninstall the plugin?',
|
||||
uninstall_cancel: 'Cancel uninstall plugin',
|
||||
un_install_success: 'Uninstall is successful and restart takes effect',
|
||||
un_install_error: 'Uninstall failed, please contact the administrator'
|
||||
@ -2253,7 +2254,7 @@ export default {
|
||||
screen_method: 'Screening method',
|
||||
select: 'Please select',
|
||||
fixed_value: 'Fixed value',
|
||||
defalut_method: 'Default condition',
|
||||
default_method: 'Default condition',
|
||||
select_all: 'Select all',
|
||||
added: 'Added',
|
||||
manual_input: 'Manual input',
|
||||
@ -2273,7 +2274,7 @@ export default {
|
||||
version_num: 'Version number',
|
||||
standard: 'Standard',
|
||||
enterprise: 'Enterprise',
|
||||
suport: 'Get technical support',
|
||||
support: 'Get technical support',
|
||||
update_success: 'Update Success'
|
||||
},
|
||||
template: {
|
||||
@ -2344,8 +2345,8 @@ export default {
|
||||
sned_time: 'Send Time',
|
||||
read_time: 'Read Time',
|
||||
type: 'Message Type',
|
||||
mark_readed: 'Mark As Read',
|
||||
all_mark_readed: 'Mark All As Read',
|
||||
mark_read: 'Mark As Read',
|
||||
all_mark_read: 'Mark All As Read',
|
||||
please_select: 'Please select at least one message',
|
||||
mark_success: 'Mark read successfully',
|
||||
receive_manage: 'Receive Manage',
|
||||
@ -2353,7 +2354,7 @@ export default {
|
||||
i18n_msg_type_panel_share_cacnel: 'Dashboard unshared',
|
||||
i18n_msg_type_dataset_sync: 'Data set synchronization',
|
||||
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_ds_invalid: 'Datasource invalid',
|
||||
channel_inner_msg: 'On site',
|
||||
@ -2369,7 +2370,7 @@ export default {
|
||||
please_key_max: 'Please key max value',
|
||||
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',
|
||||
must_int: 'Please key interger',
|
||||
must_int: 'Please key integer',
|
||||
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'
|
||||
},
|
||||
|
@ -8,7 +8,7 @@ export default {
|
||||
pagePermission: 'Permisos de la página',
|
||||
directivePermission: 'Permisos de la directiva',
|
||||
icons: 'Iconos',
|
||||
components: 'Componentes',
|
||||
components: 'Components',
|
||||
tinymce: 'Tinymce',
|
||||
markdown: 'Markdown',
|
||||
jsonEditor: 'Editor JSON',
|
||||
@ -123,7 +123,7 @@ export default {
|
||||
reviewer: 'reviewer',
|
||||
id: 'ID',
|
||||
date: 'Fecha',
|
||||
author: 'Autor',
|
||||
author: 'Author',
|
||||
readings: 'Lector',
|
||||
status: 'Estado',
|
||||
actions: 'Acciones',
|
||||
|
@ -791,12 +791,12 @@ export default {
|
||||
move_success: '移除成功',
|
||||
user: '用戶',
|
||||
add_organization: '添加組織',
|
||||
defalut_organization_canot_move: '默認組織無法刪除',
|
||||
default_organization_cannot_move: '默認組織無法刪除',
|
||||
organization_name: '組織名稱',
|
||||
input_organization_name: '請輸入組織名稱',
|
||||
relate_top_organization: '關聯上級組織',
|
||||
organization_name_exist: '組織名稱已存在',
|
||||
canot_delete: '無法刪除',
|
||||
cannot_delete: '無法刪除',
|
||||
remove_user_first: '請先移除組織中所有用戶,再進行刪除組織操作。',
|
||||
sure_delete_organization: '確定刪除該組織嗎?',
|
||||
delete: '刪除',
|
||||
@ -1429,7 +1429,8 @@ export default {
|
||||
reserve_one: '一位',
|
||||
reserve_two: '两位',
|
||||
proportion: '佔比',
|
||||
label_content: '標籤展示'
|
||||
label_content: '標籤展示',
|
||||
percent: '占比'
|
||||
},
|
||||
dataset: {
|
||||
parse_filed: '解析字段',
|
||||
@ -2254,7 +2255,7 @@ export default {
|
||||
screen_method: '篩選方式',
|
||||
select: '請選擇',
|
||||
fixed_value: '固定值',
|
||||
defalut_method: '默認條件',
|
||||
default_method: '默認條件',
|
||||
select_all: '全 選',
|
||||
added: '已添加',
|
||||
manual_input: '手工輸入',
|
||||
@ -2274,7 +2275,7 @@ export default {
|
||||
version_num: '版本號',
|
||||
standard: '標準版',
|
||||
enterprise: '企業版',
|
||||
suport: '獲取技術支持',
|
||||
support: '獲取技術支持',
|
||||
update_success: '更新成功'
|
||||
},
|
||||
template: {
|
||||
@ -2345,8 +2346,8 @@ export default {
|
||||
sned_time: '提交時間',
|
||||
read_time: '查看時間',
|
||||
type: '消息類型',
|
||||
mark_readed: '標記已讀',
|
||||
all_mark_readed: '全部已讀',
|
||||
mark_read: '標記已讀',
|
||||
all_mark_read: '全部已讀',
|
||||
please_select: '請至少選擇一條消息',
|
||||
mark_success: '標記已讀成功',
|
||||
receive_manage: '接收管理',
|
||||
@ -2354,7 +2355,7 @@ export default {
|
||||
i18n_msg_type_panel_share_cacnel: '儀表闆取消分享',
|
||||
i18n_msg_type_dataset_sync: '數據集同步',
|
||||
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_all: '全部類型',
|
||||
channel_inner_msg: '站內消息',
|
||||
|
@ -790,12 +790,12 @@ export default {
|
||||
move_success: '移除成功',
|
||||
user: '用户',
|
||||
add_organization: '添加组织',
|
||||
defalut_organization_canot_move: '默认组织无法删除',
|
||||
default_organization_cannot_move: '默认组织无法删除',
|
||||
organization_name: '组织名称',
|
||||
input_organization_name: '请输入组织名称',
|
||||
relate_top_organization: '关联上级组织',
|
||||
organization_name_exist: '组织名称已存在',
|
||||
canot_delete: '无法删除',
|
||||
cannot_delete: '无法删除',
|
||||
remove_user_first: '请先移除组织中所有用户,再进行删除组织操作。',
|
||||
sure_delete_organization: '确定删除该组织吗?',
|
||||
delete: '删除',
|
||||
@ -1428,7 +1428,8 @@ export default {
|
||||
reserve_one: '一位',
|
||||
reserve_two: '两位',
|
||||
proportion: '占比',
|
||||
label_content: '标签展示'
|
||||
label_content: '标签展示',
|
||||
percent: '占比'
|
||||
},
|
||||
dataset: {
|
||||
parse_filed: '解析字段',
|
||||
@ -2254,7 +2255,7 @@ export default {
|
||||
screen_method: '筛选方式',
|
||||
select: '请选择',
|
||||
fixed_value: '固定值',
|
||||
defalut_method: '默认条件',
|
||||
default_method: '默认条件',
|
||||
select_all: '全 选',
|
||||
added: '已添加',
|
||||
manual_input: '手工输入',
|
||||
@ -2274,7 +2275,7 @@ export default {
|
||||
version_num: '版本号',
|
||||
standard: '标准版',
|
||||
enterprise: '企业版',
|
||||
suport: '获取技术支持',
|
||||
support: '获取技术支持',
|
||||
update_success: '更新成功'
|
||||
},
|
||||
template: {
|
||||
@ -2345,8 +2346,8 @@ export default {
|
||||
sned_time: '提交时间',
|
||||
read_time: '查看时间',
|
||||
type: '消息类型',
|
||||
mark_readed: '标记已读',
|
||||
all_mark_readed: '全部已读',
|
||||
mark_read: '标记已读',
|
||||
all_mark_read: '全部已读',
|
||||
please_select: '请至少选择一条消息',
|
||||
mark_success: '标记已读成功',
|
||||
receive_manage: '接收管理',
|
||||
@ -2354,7 +2355,7 @@ export default {
|
||||
i18n_msg_type_panel_share_cacnel: '仪表板取消分享',
|
||||
i18n_msg_type_dataset_sync: '数据集同步',
|
||||
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_all: '全部类型',
|
||||
channel_inner_msg: '站内消息',
|
||||
|
@ -126,11 +126,11 @@ router.beforeEach(async(to, from, next) => routeBefore(() => {
|
||||
}))
|
||||
export const loadMenus = (next, to) => {
|
||||
buildMenus().then(res => {
|
||||
const datas = res.data
|
||||
const filterDatas = filterRouter(datas)
|
||||
const asyncRouter = filterAsyncRouter(filterDatas)
|
||||
const data = res.data
|
||||
const filterData = filterRouter(data)
|
||||
const asyncRouter = filterAsyncRouter(filterData)
|
||||
// 如果包含首页 则默认页面是 首页 否则默认页面是仪表板页面
|
||||
if (JSON.stringify(datas).indexOf('wizard') > -1) {
|
||||
if (JSON.stringify(data).indexOf('wizard') > -1) {
|
||||
asyncRouter.push({
|
||||
path: '/',
|
||||
component: Layout,
|
||||
@ -234,8 +234,8 @@ const hasPermission = (router, user_permissions) => {
|
||||
}
|
||||
// 如果有字菜单 则 判断是否满足 ‘任意一个子菜单有权限’
|
||||
if (router.children && router.children.length) {
|
||||
const permissionChilds = router.children.filter(item => hasPermission(item, user_permissions))
|
||||
router.children = permissionChilds
|
||||
const permissionChildren = router.children.filter(item => hasPermission(item, user_permissions))
|
||||
router.children = permissionChildren
|
||||
return router.children.length > 0
|
||||
}
|
||||
return true
|
||||
|
@ -21,7 +21,7 @@ module.exports = {
|
||||
*/
|
||||
sidebarLogo: false,
|
||||
showSettings: true,
|
||||
interruptTokenContineUrls: [
|
||||
interruptTokenContinueUrls: [
|
||||
'/api/sys_msg/list/',
|
||||
'/dataset/taskLog/list/'
|
||||
]
|
||||
|
@ -1400,7 +1400,7 @@ div:focus {
|
||||
}
|
||||
}
|
||||
|
||||
.de-serach-table {
|
||||
.de-search-table {
|
||||
.top-operate {
|
||||
margin-bottom: 16px;
|
||||
|
||||
@ -1545,7 +1545,7 @@ div:focus {
|
||||
}
|
||||
}
|
||||
|
||||
.de-icon-sence {
|
||||
.de-icon-sense {
|
||||
margin-right: 9px;
|
||||
width: 16px !important;
|
||||
height: 12px !important;
|
||||
|
@ -23,7 +23,7 @@ export function baseBarOptionAntV(plot, container, chart, action, isGroup, isSta
|
||||
const xAxis = getXAxis(chart)
|
||||
const yAxis = getYAxis(chart)
|
||||
// data
|
||||
const data = chart.data.datas
|
||||
const data = chart.data.data
|
||||
// config
|
||||
const slider = getSlider(chart)
|
||||
const analyse = getAnalyse(chart)
|
||||
@ -121,7 +121,7 @@ export function hBaseBarOptionAntV(plot, container, chart, action, isGroup, isSt
|
||||
const xAxis = getXAxis(chart)
|
||||
const yAxis = getYAxis(chart)
|
||||
// data
|
||||
const data = chart.data.datas
|
||||
const data = chart.data.data
|
||||
// config
|
||||
const slider = getSlider(chart)
|
||||
const analyse = getAnalyse(chart)
|
||||
|
@ -103,6 +103,11 @@ export const DEFAULT_SIZE = {
|
||||
treemapWidth: 80,
|
||||
treemapHeight: 80,
|
||||
liquidMax: 100,
|
||||
liquidMaxType: 'fix', // fix or dynamic
|
||||
liquidMaxField: {
|
||||
id: '',
|
||||
summary: ''
|
||||
},
|
||||
liquidSize: 80,
|
||||
liquidOutlineBorder: 4,
|
||||
liquidOutlineDistance: 8,
|
||||
@ -132,8 +137,8 @@ export const DEFAULT_LABEL = {
|
||||
decimalCount: 2, // 小数位数
|
||||
thousandSeparator: true// 千分符
|
||||
},
|
||||
reserveDecimalCount: 2, // 百分比堆叠柱状图,饼图,环形图保留小数位数
|
||||
labelContent: ['dimension', 'proportion'] // 饼图,环形图指标展示项
|
||||
reserveDecimalCount: 2,
|
||||
labelContent: ['dimension', 'proportion']
|
||||
}
|
||||
export const DEFAULT_TOOLTIP = {
|
||||
show: true,
|
||||
|
@ -126,6 +126,9 @@ export function getLabel(chart) {
|
||||
type: l.position,
|
||||
autoRotate: false
|
||||
}
|
||||
if (l.position === 'outer') {
|
||||
label.type = 'spider'
|
||||
}
|
||||
} else if (chart.type.includes('line') || chart.type.includes('area')) {
|
||||
label = {
|
||||
position: l.position,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user