Merge branch 'dev-v2' into pr@dev-v2@refactor_new-icon
This commit is contained in:
commit
075635231b
@ -41,6 +41,7 @@ public class GroupMixHandler extends MixHandler {
|
|||||||
xAxisGroup.addAll(view.getXAxisExt());
|
xAxisGroup.addAll(view.getXAxisExt());
|
||||||
axisMap.put(ChartAxis.xAxis, xAxisGroup);
|
axisMap.put(ChartAxis.xAxis, xAxisGroup);
|
||||||
context.put("xAxisBase", xAxis);
|
context.put("xAxisBase", xAxis);
|
||||||
|
axisMap.put(ChartAxis.drill, new ArrayList<>(view.getDrillFields()));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,45 +50,4 @@ public class GroupMixHandler extends MixHandler {
|
|||||||
return super.buildNormalResult(view, formatResult, filterResult, data);
|
return super.buildNormalResult(view, formatResult, filterResult, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ChartViewDTO buildChart(ChartViewDTO view, ChartCalcDataResult calcResult, AxisFormatResult formatResult, CustomFilterResult filterResult) {
|
|
||||||
var desensitizationList = (Map<String, ColumnPermissionItem>) filterResult.getContext().get("desensitizationList");
|
|
||||||
var leftCalcResult = (ChartCalcDataResult) calcResult.getData().get("left");
|
|
||||||
var leftFields = new ArrayList<ChartViewFieldDTO>();
|
|
||||||
leftFields.addAll(view.getXAxis());
|
|
||||||
leftFields.addAll(view.getXAxisExt());
|
|
||||||
leftFields.addAll(view.getYAxis());
|
|
||||||
var leftOriginData = leftCalcResult.getOriginData();
|
|
||||||
var leftTable = ChartDataBuild.transTableNormal(leftFields, view, leftOriginData, desensitizationList);
|
|
||||||
mergeAssistField(leftCalcResult.getDynamicAssistFields(), leftCalcResult.getAssistData());
|
|
||||||
var leftData = new HashMap<String, Object>(leftTable);
|
|
||||||
leftData.putAll(leftCalcResult.getData());
|
|
||||||
leftData.put("dynamicAssistLines", leftCalcResult.getDynamicAssistFields());
|
|
||||||
|
|
||||||
var rightCalcResult = (ChartCalcDataResult) calcResult.getData().get("right");
|
|
||||||
var rightFields = new ArrayList<ChartViewFieldDTO>();
|
|
||||||
rightFields.addAll(view.getXAxis());
|
|
||||||
rightFields.addAll(view.getExtBubble());
|
|
||||||
rightFields.addAll(view.getYAxisExt());
|
|
||||||
var rightOriginData = rightCalcResult.getOriginData();
|
|
||||||
var rightTable = ChartDataBuild.transTableNormal(rightFields, view, rightOriginData, desensitizationList);
|
|
||||||
mergeAssistField(rightCalcResult.getDynamicAssistFields(), rightCalcResult.getAssistData());
|
|
||||||
var rightData = new HashMap<String, Object>(rightTable);
|
|
||||||
rightData.putAll(rightCalcResult.getData());
|
|
||||||
rightData.put("dynamicAssistLines", rightCalcResult.getDynamicAssistFields());
|
|
||||||
|
|
||||||
var allFields = (List<ChartViewFieldDTO>) filterResult.getContext().get("allFields");
|
|
||||||
// 构建结果
|
|
||||||
Map<String, Object> chartData = new TreeMap<>();
|
|
||||||
chartData.put("left", leftData);
|
|
||||||
chartData.put("right", rightData);
|
|
||||||
|
|
||||||
var drillFilters = filterResult.getFilterList().stream().filter(f -> f.getFilterType() == 1).collect(Collectors.toList());
|
|
||||||
var isDrill = CollectionUtils.isNotEmpty(drillFilters);
|
|
||||||
view.setDrillFilters(drillFilters);
|
|
||||||
view.setDrill(isDrill);
|
|
||||||
view.setSql(leftCalcResult.getQuerySql());
|
|
||||||
view.setData(chartData);
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,6 +45,7 @@ public class MixHandler extends YoyChartHandler {
|
|||||||
//图表整体主维度
|
//图表整体主维度
|
||||||
axisMap.put(ChartAxis.xAxis, new ArrayList<>(view.getXAxis()));
|
axisMap.put(ChartAxis.xAxis, new ArrayList<>(view.getXAxis()));
|
||||||
context.put("xAxisBase", new ArrayList<>(view.getXAxis()));
|
context.put("xAxisBase", new ArrayList<>(view.getXAxis()));
|
||||||
|
axisMap.put(ChartAxis.drill, new ArrayList<>(view.getDrillFields()));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,26 +94,46 @@ public class MixHandler extends YoyChartHandler {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AxisFormatResult formatResult2 = new AxisFormatResult();
|
||||||
|
var axisMap = new HashMap<ChartAxis, List<ChartViewFieldDTO>>();
|
||||||
|
axisMap.put(ChartAxis.xAxis, new ArrayList<>(formatResult.getAxisMap().get(ChartAxis.xAxis)));
|
||||||
|
axisMap.put(ChartAxis.extStack, new ArrayList<>());
|
||||||
|
axisMap.put(ChartAxis.xAxisExt, new ArrayList<>());
|
||||||
|
axisMap.put(ChartAxis.extBubble, new ArrayList<>(formatResult.getAxisMap().get(ChartAxis.extBubble)));
|
||||||
|
axisMap.put(ChartAxis.yAxisExt, new ArrayList<>(formatResult.getAxisMap().get(ChartAxis.yAxisExt)));
|
||||||
|
axisMap.put(ChartAxis.extLabel, new ArrayList<>(formatResult.getAxisMap().get(ChartAxis.extLabel)));
|
||||||
|
axisMap.put(ChartAxis.extTooltip, new ArrayList<>(formatResult.getAxisMap().get(ChartAxis.extTooltip)));
|
||||||
|
axisMap.put(ChartAxis.drill, new ArrayList<>(formatResult.getAxisMap().get(ChartAxis.drill)));
|
||||||
|
formatResult2.setAxisMap(axisMap);
|
||||||
|
formatResult2.setContext(formatResult.getContext());
|
||||||
|
|
||||||
// 计算右轴,包含 xAxis,xAxisExt,yAxisExt,需要去掉 group 和 stack
|
// 计算右轴,包含 xAxis,xAxisExt,yAxisExt,需要去掉 group 和 stack
|
||||||
var xAxis = formatResult.getAxisMap().get(ChartAxis.xAxis);
|
var xAxis = new ArrayList<>(view.getXAxis());
|
||||||
var extStack = formatResult.getAxisMap().get(ChartAxis.extStack);
|
var extStack = formatResult2.getAxisMap().get(ChartAxis.extStack);
|
||||||
var xAxisExt = formatResult.getAxisMap().get(ChartAxis.xAxisExt);
|
var xAxisExt = formatResult2.getAxisMap().get(ChartAxis.xAxisExt);
|
||||||
xAxis = xAxis.subList(0, xAxis.size() - extStack.size() - xAxisExt.size());
|
//xAxis = xAxis.subList(0, xAxis.size() - extStack.size() - xAxisExt.size());
|
||||||
var extBubble = formatResult.getAxisMap().get(ChartAxis.extBubble);
|
var extBubble = formatResult2.getAxisMap().get(ChartAxis.extBubble);
|
||||||
xAxis.addAll(extBubble);
|
xAxis.addAll(extBubble);
|
||||||
formatResult.getAxisMap().put(ChartAxis.xAxis, xAxis);
|
var dillAxis = (ArrayList<ChartViewFieldDTO>) formatResult.getContext().get("dillAxis");
|
||||||
formatResult.getAxisMap().put(ChartAxis.xAxisExt, extBubble);
|
xAxis.addAll(dillAxis);
|
||||||
var yAxisExt = formatResult.getAxisMap().get(ChartAxis.yAxisExt);
|
formatResult2.getAxisMap().put(ChartAxis.xAxis, xAxis);
|
||||||
formatResult.getAxisMap().put(ChartAxis.yAxis, yAxisExt);
|
formatResult2.getAxisMap().put(ChartAxis.xAxisExt, extBubble);
|
||||||
formatResult.getContext().remove("yoyFiltered");
|
var yAxisExt = formatResult2.getAxisMap().get(ChartAxis.yAxisExt);
|
||||||
|
formatResult2.getAxisMap().put(ChartAxis.yAxis, yAxisExt);
|
||||||
|
formatResult2.getContext().remove("yoyFiltered");
|
||||||
|
|
||||||
|
|
||||||
|
formatResult.getContext().put("subAxisMap", axisMap);
|
||||||
|
|
||||||
// 右轴重新检测同环比过滤
|
// 右轴重新检测同环比过滤
|
||||||
customFilter(view, filterResult.getFilterList(), formatResult);
|
customFilter(view, filterResult.getFilterList(), formatResult2);
|
||||||
var rightResult = (T) super.calcChartResult(view, formatResult, filterResult, sqlMap, sqlMeta, provider);
|
var rightResult = (T) super.calcChartResult(view, formatResult2, filterResult, sqlMap, sqlMeta, provider);
|
||||||
try {
|
try {
|
||||||
//如果有同环比过滤,应该用原始sql
|
//如果有同环比过滤,应该用原始sql
|
||||||
var originSql = rightResult.getQuerySql();
|
var originSql = rightResult.getQuerySql();
|
||||||
var rightAssistFields = dynamicAssistFields.stream().filter(x -> StringUtils.equalsAnyIgnoreCase(x.getYAxisType(), "right")).toList();
|
var rightAssistFields = dynamicAssistFields.stream().filter(x -> StringUtils.equalsAnyIgnoreCase(x.getYAxisType(), "right")).toList();
|
||||||
var yAxis = formatResult.getAxisMap().get(ChartAxis.yAxis);
|
var yAxis = formatResult2.getAxisMap().get(ChartAxis.yAxis);
|
||||||
var assistFields = getAssistFields(rightAssistFields, yAxis);
|
var assistFields = getAssistFields(rightAssistFields, yAxis);
|
||||||
if (CollectionUtils.isNotEmpty(assistFields)) {
|
if (CollectionUtils.isNotEmpty(assistFields)) {
|
||||||
var req = new DatasourceRequest();
|
var req = new DatasourceRequest();
|
||||||
@ -140,8 +161,8 @@ public class MixHandler extends YoyChartHandler {
|
|||||||
var desensitizationList = (Map<String, ColumnPermissionItem>) filterResult.getContext().get("desensitizationList");
|
var desensitizationList = (Map<String, ColumnPermissionItem>) filterResult.getContext().get("desensitizationList");
|
||||||
var leftCalcResult = (ChartCalcDataResult) calcResult.getData().get("left");
|
var leftCalcResult = (ChartCalcDataResult) calcResult.getData().get("left");
|
||||||
var leftFields = new ArrayList<ChartViewFieldDTO>();
|
var leftFields = new ArrayList<ChartViewFieldDTO>();
|
||||||
leftFields.addAll(view.getXAxis());
|
leftFields.addAll(formatResult.getAxisMap().get(ChartAxis.xAxis));
|
||||||
leftFields.addAll(view.getYAxis());
|
leftFields.addAll(formatResult.getAxisMap().get(ChartAxis.yAxis));
|
||||||
mergeAssistField(leftCalcResult.getDynamicAssistFields(), leftCalcResult.getAssistData());
|
mergeAssistField(leftCalcResult.getDynamicAssistFields(), leftCalcResult.getAssistData());
|
||||||
var leftOriginData = leftCalcResult.getOriginData();
|
var leftOriginData = leftCalcResult.getOriginData();
|
||||||
var leftTable = ChartDataBuild.transTableNormal(leftFields, view, leftOriginData, desensitizationList);
|
var leftTable = ChartDataBuild.transTableNormal(leftFields, view, leftOriginData, desensitizationList);
|
||||||
@ -151,13 +172,14 @@ public class MixHandler extends YoyChartHandler {
|
|||||||
|
|
||||||
var rightCalcResult = (ChartCalcDataResult) calcResult.getData().get("right");
|
var rightCalcResult = (ChartCalcDataResult) calcResult.getData().get("right");
|
||||||
var rightFields = new ArrayList<ChartViewFieldDTO>();
|
var rightFields = new ArrayList<ChartViewFieldDTO>();
|
||||||
rightFields.addAll(view.getXAxis());
|
|
||||||
rightFields.addAll(view.getExtBubble());
|
var subAxisMap = (HashMap<ChartAxis, List<ChartViewFieldDTO>>) formatResult.getContext().get("subAxisMap");
|
||||||
rightFields.addAll(view.getYAxisExt());
|
rightFields.addAll(subAxisMap.get(ChartAxis.xAxis));
|
||||||
|
rightFields.addAll(subAxisMap.get(ChartAxis.yAxis));
|
||||||
|
|
||||||
mergeAssistField(rightCalcResult.getDynamicAssistFields(), rightCalcResult.getAssistData());
|
mergeAssistField(rightCalcResult.getDynamicAssistFields(), rightCalcResult.getAssistData());
|
||||||
var rightOriginData = rightCalcResult.getOriginData();
|
var rightOriginData = rightCalcResult.getOriginData();
|
||||||
var rightTable = ChartDataBuild.transTableNormal(rightFields, view, rightOriginData, desensitizationList);
|
var rightTable = ChartDataBuild.transTableNormal(rightFields, view, rightOriginData, desensitizationList);
|
||||||
mergeAssistField(rightCalcResult.getDynamicAssistFields(), rightCalcResult.getAssistData());
|
|
||||||
var rightData = new HashMap<String, Object>(rightTable);
|
var rightData = new HashMap<String, Object>(rightTable);
|
||||||
rightData.putAll(rightCalcResult.getData());
|
rightData.putAll(rightCalcResult.getData());
|
||||||
rightData.put("dynamicAssistLines", rightCalcResult.getDynamicAssistFields());
|
rightData.put("dynamicAssistLines", rightCalcResult.getDynamicAssistFields());
|
||||||
|
|||||||
@ -41,6 +41,7 @@ public class StackMixHandler extends MixHandler {
|
|||||||
xAxisStack.addAll(view.getExtStack());
|
xAxisStack.addAll(view.getExtStack());
|
||||||
axisMap.put(ChartAxis.xAxis, xAxisStack);
|
axisMap.put(ChartAxis.xAxis, xAxisStack);
|
||||||
context.put("xAxisBase", xAxis);
|
context.put("xAxisBase", xAxis);
|
||||||
|
axisMap.put(ChartAxis.drill, new ArrayList<>(view.getDrillFields()));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,49 +62,7 @@ public class StackMixHandler extends MixHandler {
|
|||||||
var xAxisBase = (List<ChartViewFieldDTO>) formatResult.getContext().get("xAxisBase");
|
var xAxisBase = (List<ChartViewFieldDTO>) formatResult.getContext().get("xAxisBase");
|
||||||
var xAxis = formatResult.getAxisMap().get(ChartAxis.xAxis);
|
var xAxis = formatResult.getAxisMap().get(ChartAxis.xAxis);
|
||||||
var xAxisExt = formatResult.getAxisMap().get(ChartAxis.xAxisExt);
|
var xAxisExt = formatResult.getAxisMap().get(ChartAxis.xAxisExt);
|
||||||
return ChartDataBuild.transMixChartDataAntV(xAxisBase, xAxis, xAxisExt, yAxis, view, data, isDrill);
|
return super.buildNormalResult(view, formatResult, filterResult, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ChartViewDTO buildChart(ChartViewDTO view, ChartCalcDataResult calcResult, AxisFormatResult formatResult, CustomFilterResult filterResult) {
|
|
||||||
var desensitizationList = (Map<String, ColumnPermissionItem>) filterResult.getContext().get("desensitizationList");
|
|
||||||
var leftCalcResult = (ChartCalcDataResult) calcResult.getData().get("left");
|
|
||||||
var leftFields = new ArrayList<ChartViewFieldDTO>();
|
|
||||||
leftFields.addAll(view.getXAxis());
|
|
||||||
leftFields.addAll(view.getExtStack());
|
|
||||||
leftFields.addAll(view.getYAxis());
|
|
||||||
var leftOriginData = leftCalcResult.getOriginData();
|
|
||||||
var leftTable = ChartDataBuild.transTableNormal(leftFields, view, leftOriginData, desensitizationList);
|
|
||||||
mergeAssistField(leftCalcResult.getDynamicAssistFields(), leftCalcResult.getAssistData());
|
|
||||||
var leftData = new HashMap<String, Object>(leftTable);
|
|
||||||
leftData.putAll(leftCalcResult.getData());
|
|
||||||
leftData.put("dynamicAssistLines", leftCalcResult.getDynamicAssistFields());
|
|
||||||
|
|
||||||
var rightCalcResult = (ChartCalcDataResult) calcResult.getData().get("right");
|
|
||||||
var rightFields = new ArrayList<ChartViewFieldDTO>();
|
|
||||||
rightFields.addAll(view.getXAxis());
|
|
||||||
rightFields.addAll(view.getExtBubble());
|
|
||||||
rightFields.addAll(view.getYAxisExt());
|
|
||||||
var rightOriginData = rightCalcResult.getOriginData();
|
|
||||||
var rightTable = ChartDataBuild.transTableNormal(rightFields, view, rightOriginData, desensitizationList);
|
|
||||||
mergeAssistField(rightCalcResult.getDynamicAssistFields(), rightCalcResult.getAssistData());
|
|
||||||
var rightData = new HashMap<String, Object>(rightTable);
|
|
||||||
rightData.putAll(rightCalcResult.getData());
|
|
||||||
rightData.put("dynamicAssistLines", rightCalcResult.getDynamicAssistFields());
|
|
||||||
|
|
||||||
var allFields = (List<ChartViewFieldDTO>) filterResult.getContext().get("allFields");
|
|
||||||
// 构建结果
|
|
||||||
Map<String, Object> chartData = new TreeMap<>();
|
|
||||||
chartData.put("left", leftData);
|
|
||||||
chartData.put("right", rightData);
|
|
||||||
|
|
||||||
var drillFilters = filterResult.getFilterList().stream().filter(f -> f.getFilterType() == 1).collect(Collectors.toList());
|
|
||||||
var isDrill = CollectionUtils.isNotEmpty(drillFilters);
|
|
||||||
view.setDrillFilters(drillFilters);
|
|
||||||
view.setDrill(isDrill);
|
|
||||||
view.setSql(leftCalcResult.getQuerySql());
|
|
||||||
view.setData(chartData);
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -104,9 +104,7 @@ public class ChartDataManage {
|
|||||||
DEException.throwException(ResultCode.DATA_IS_WRONG.code(), Translator.get("i18n_chart_not_handler") + ": " + view.getRender() + "," + view.getType());
|
DEException.throwException(ResultCode.DATA_IS_WRONG.code(), Translator.get("i18n_chart_not_handler") + ": " + view.getRender() + "," + view.getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
AxisFormatResult formatResult = chartHandler.formatAxis(view);
|
var dillAxis = new ArrayList<ChartViewFieldDTO>();
|
||||||
var xAxis = formatResult.getAxisMap().get(ChartAxis.xAxis);
|
|
||||||
var yAxis = formatResult.getAxisMap().get(ChartAxis.yAxis);
|
|
||||||
|
|
||||||
DatasetGroupInfoDTO table = datasetGroupManage.getDatasetGroupInfoDTO(view.getTableId(), null);
|
DatasetGroupInfoDTO table = datasetGroupManage.getDatasetGroupInfoDTO(view.getTableId(), null);
|
||||||
if (table == null) {
|
if (table == null) {
|
||||||
@ -122,7 +120,6 @@ public class ChartDataManage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<ChartViewFieldDTO> allFields = getAllChartFields(view);
|
List<ChartViewFieldDTO> allFields = getAllChartFields(view);
|
||||||
formatResult.getContext().put("allFields", allFields);
|
|
||||||
// column permission
|
// column permission
|
||||||
Map<String, ColumnPermissionItem> desensitizationList = new HashMap<>();
|
Map<String, ColumnPermissionItem> desensitizationList = new HashMap<>();
|
||||||
List<DatasetTableFieldDTO> columnPermissionFields = permissionManage.filterColumnPermissions(transFields(allFields), desensitizationList, table.getId(), chartExtRequest.getUser());
|
List<DatasetTableFieldDTO> columnPermissionFields = permissionManage.filterColumnPermissions(transFields(allFields), desensitizationList, table.getId(), chartExtRequest.getUser());
|
||||||
@ -130,13 +127,18 @@ public class ChartDataManage {
|
|||||||
List<DataSetRowPermissionsTreeDTO> rowPermissionsTree = permissionManage.getRowPermissionsTree(table.getId(), chartExtRequest.getUser());
|
List<DataSetRowPermissionsTreeDTO> rowPermissionsTree = permissionManage.getRowPermissionsTree(table.getId(), chartExtRequest.getUser());
|
||||||
//将没有权限的列删掉
|
//将没有权限的列删掉
|
||||||
List<String> dataeaseNames = columnPermissionFields.stream().map(DatasetTableFieldDTO::getDataeaseName).collect(Collectors.toList());
|
List<String> dataeaseNames = columnPermissionFields.stream().map(DatasetTableFieldDTO::getDataeaseName).collect(Collectors.toList());
|
||||||
dataeaseNames.add("*");
|
|
||||||
|
AxisFormatResult formatResult = chartHandler.formatAxis(view);
|
||||||
|
formatResult.getContext().put("desensitizationList", desensitizationList);
|
||||||
|
var xAxis = formatResult.getAxisMap().get(ChartAxis.xAxis);
|
||||||
|
var yAxis = formatResult.getAxisMap().get(ChartAxis.yAxis);
|
||||||
|
formatResult.getContext().put("allFields", allFields);
|
||||||
var axisMap = formatResult.getAxisMap();
|
var axisMap = formatResult.getAxisMap();
|
||||||
axisMap.forEach((axis, fields) -> {
|
axisMap.forEach((axis, fields) -> {
|
||||||
Iterator<ChartViewFieldDTO> iterator = fields.iterator();
|
Iterator<ChartViewFieldDTO> iterator = fields.iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
ChartViewFieldDTO fieldDTO = iterator.next();
|
ChartViewFieldDTO fieldDTO = iterator.next();
|
||||||
if (desensitizationList.containsKey(fieldDTO.getDataeaseName()) || !dataeaseNames.contains(fieldDTO.getDataeaseName())) {
|
if (!dataeaseNames.contains(fieldDTO.getDataeaseName())) {
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -290,6 +292,7 @@ public class ChartDataManage {
|
|||||||
if (!fields.contains(dim.getId())) {
|
if (!fields.contains(dim.getId())) {
|
||||||
viewField.setSource(FieldSource.DRILL);
|
viewField.setSource(FieldSource.DRILL);
|
||||||
xAxis.add(viewField);
|
xAxis.add(viewField);
|
||||||
|
dillAxis.add(viewField);
|
||||||
fields.add(dim.getId());
|
fields.add(dim.getId());
|
||||||
}
|
}
|
||||||
if (i == drillRequestList.size() - 1) {
|
if (i == drillRequestList.size() - 1) {
|
||||||
@ -298,13 +301,19 @@ public class ChartDataManage {
|
|||||||
viewField.setSource(FieldSource.DRILL);
|
viewField.setSource(FieldSource.DRILL);
|
||||||
nextDrillField.setSort(getDrillSort(xAxis, drill.get(0)));
|
nextDrillField.setSort(getDrillSort(xAxis, drill.get(0)));
|
||||||
xAxis.add(nextDrillField);
|
xAxis.add(nextDrillField);
|
||||||
|
dillAxis.add(nextDrillField);
|
||||||
fields.add(nextDrillField.getId());
|
fields.add(nextDrillField.getId());
|
||||||
|
} else {
|
||||||
|
dillAxis.add(nextDrillField);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
formatResult.getContext().put("dillAxis", dillAxis);
|
||||||
|
|
||||||
//转义特殊字符
|
//转义特殊字符
|
||||||
extFilterList = extFilterList.stream().peek(ele -> {
|
extFilterList = extFilterList.stream().peek(ele -> {
|
||||||
if (ObjectUtils.isNotEmpty(ele.getValue())) {
|
if (ObjectUtils.isNotEmpty(ele.getValue())) {
|
||||||
@ -352,10 +361,10 @@ public class ChartDataManage {
|
|||||||
Dimension2SQLObj.dimension2sqlObj(sqlMeta, xAxis, FieldUtil.transFields(allFields), crossDs, dsMap);
|
Dimension2SQLObj.dimension2sqlObj(sqlMeta, xAxis, FieldUtil.transFields(allFields), crossDs, dsMap);
|
||||||
Quota2SQLObj.quota2sqlObj(sqlMeta, yAxis, FieldUtil.transFields(allFields), crossDs, dsMap);
|
Quota2SQLObj.quota2sqlObj(sqlMeta, yAxis, FieldUtil.transFields(allFields), crossDs, dsMap);
|
||||||
String querySql = SQLProvider.createQuerySQL(sqlMeta, true, needOrder, view);
|
String querySql = SQLProvider.createQuerySQL(sqlMeta, true, needOrder, view);
|
||||||
|
querySql = SqlUtils.rebuildSQL(querySql, sqlMeta, crossDs, dsMap);
|
||||||
filterResult.getContext().put("querySql", querySql);
|
filterResult.getContext().put("querySql", querySql);
|
||||||
}
|
}
|
||||||
ChartCalcDataResult calcResult = chartHandler.calcChartResult(view, formatResult, filterResult, sqlMap, sqlMeta, calciteProvider);
|
ChartCalcDataResult calcResult = chartHandler.calcChartResult(view, formatResult, filterResult, sqlMap, sqlMeta, calciteProvider);
|
||||||
formatResult.getContext().put("desensitizationList", desensitizationList);
|
|
||||||
return chartHandler.buildChart(view, calcResult, formatResult, filterResult);
|
return chartHandler.buildChart(view, calcResult, formatResult, filterResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -453,13 +453,15 @@ public class CalciteProvider extends Provider {
|
|||||||
if (StringUtils.isEmpty(configuration.getSchema())) {
|
if (StringUtils.isEmpty(configuration.getSchema())) {
|
||||||
DEException.throwException(Translator.get("i18n_schema_is_empty"));
|
DEException.throwException(Translator.get("i18n_schema_is_empty"));
|
||||||
}
|
}
|
||||||
|
|
||||||
sql = String.format("SELECT \n" +
|
sql = String.format("SELECT \n" +
|
||||||
" c.name ,t.name,ep.value \n" +
|
" c.name ,t.name ,ep.value \n" +
|
||||||
"FROM \n" +
|
"FROM \n" +
|
||||||
" sys.columns AS c\n" +
|
" sys.columns AS c\n" +
|
||||||
"LEFT JOIN sys.extended_properties AS ep ON c.object_id = ep.major_id AND c.column_id = ep.minor_id\n" +
|
"LEFT JOIN sys.extended_properties AS ep ON c.object_id = ep.major_id AND c.column_id = ep.minor_id\n" +
|
||||||
"LEFT JOIN sys.types AS t ON c.user_type_id = t.user_type_id\n" +
|
"LEFT JOIN sys.types AS t ON c.user_type_id = t.user_type_id\n" +
|
||||||
"WHERE c.object_id = OBJECT_ID('%s') ", datasourceRequest.getTable());
|
"LEFT JOIN sys.objects AS o ON c.object_id = o.object_id\n" +
|
||||||
|
"WHERE o.name = '%s'", datasourceRequest.getTable());
|
||||||
break;
|
break;
|
||||||
case pg:
|
case pg:
|
||||||
configuration = JsonUtil.parseObject(datasourceRequest.getDatasource().getConfiguration(), Pg.class);
|
configuration = JsonUtil.parseObject(datasourceRequest.getDatasource().getConfiguration(), Pg.class);
|
||||||
|
|||||||
@ -81,7 +81,10 @@ const loadPluginCategory = data => {
|
|||||||
while (stack?.length) {
|
while (stack?.length) {
|
||||||
const parent = stack.pop()
|
const parent = stack.pop()
|
||||||
if (parent.category === category) {
|
if (parent.category === category) {
|
||||||
parent.details.push(node)
|
const chart = parent.details.find(chart => chart.value === node.value)
|
||||||
|
if (!chart) {
|
||||||
|
parent.details.push(node)
|
||||||
|
}
|
||||||
findParent = true
|
findParent = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,6 +57,7 @@ declare interface Chart {
|
|||||||
jumpActive: boolean
|
jumpActive: boolean
|
||||||
aggregate?: boolean
|
aggregate?: boolean
|
||||||
plugin?: CustomPlugin
|
plugin?: CustomPlugin
|
||||||
|
isPlugin: boolean
|
||||||
}
|
}
|
||||||
declare type CustomAttr = DeepPartial<ChartAttr> | JSONString<DeepPartial<ChartAttr>>
|
declare type CustomAttr = DeepPartial<ChartAttr> | JSONString<DeepPartial<ChartAttr>>
|
||||||
declare type CustomStyle = DeepPartial<ChartStyle> | JSONString<DeepPartial<ChartStyle>>
|
declare type CustomStyle = DeepPartial<ChartStyle> | JSONString<DeepPartial<ChartStyle>>
|
||||||
|
|||||||
@ -393,6 +393,7 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
id: component.id,
|
id: component.id,
|
||||||
type: component.innerType,
|
type: component.innerType,
|
||||||
render: component.render,
|
render: component.render,
|
||||||
|
isPlugin: component.isPlugin,
|
||||||
plugin: {
|
plugin: {
|
||||||
isPlugin: component.isPlugin,
|
isPlugin: component.isPlugin,
|
||||||
staticMap: component.staticMap
|
staticMap: component.staticMap
|
||||||
|
|||||||
@ -348,7 +348,7 @@ onMounted(() => {
|
|||||||
<el-select
|
<el-select
|
||||||
:effect="themes"
|
:effect="themes"
|
||||||
v-model="state.basicStyleForm.mapStyle"
|
v-model="state.basicStyleForm.mapStyle"
|
||||||
@change="changeBasicStyle('mapBaseStyle')"
|
@change="changeBasicStyle('mapStyle')"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in mapStyleOptions"
|
v-for="item in mapStyleOptions"
|
||||||
|
|||||||
@ -373,7 +373,7 @@ onMounted(() => {
|
|||||||
<el-form-item v-if="showProperty('customContent')" :class="'form-item-' + themes">
|
<el-form-item v-if="showProperty('customContent')" :class="'form-item-' + themes">
|
||||||
<template #label>
|
<template #label>
|
||||||
<span class="data-area-label">
|
<span class="data-area-label">
|
||||||
<span>
|
<span style="margin-right: 4px">
|
||||||
{{ t('chart.content_formatter') }}
|
{{ t('chart.content_formatter') }}
|
||||||
</span>
|
</span>
|
||||||
<el-tooltip class="item" :effect="toolTip" placement="bottom">
|
<el-tooltip class="item" :effect="toolTip" placement="bottom">
|
||||||
@ -996,4 +996,12 @@ onMounted(() => {
|
|||||||
border-color: rgba(255, 255, 255, 0.15);
|
border-color: rgba(255, 255, 255, 0.15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.data-area-label {
|
||||||
|
text-align: left;
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -487,7 +487,7 @@ onMounted(() => {
|
|||||||
<el-form-item v-if="showProperty('customContent')" :class="'form-item-' + themes">
|
<el-form-item v-if="showProperty('customContent')" :class="'form-item-' + themes">
|
||||||
<template #label>
|
<template #label>
|
||||||
<span class="data-area-label">
|
<span class="data-area-label">
|
||||||
<span>
|
<span style="margin-right: 4px">
|
||||||
{{ t('chart.content_formatter') }}
|
{{ t('chart.content_formatter') }}
|
||||||
</span>
|
</span>
|
||||||
<el-tooltip class="item" :effect="toolTip" placement="bottom">
|
<el-tooltip class="item" :effect="toolTip" placement="bottom">
|
||||||
@ -828,4 +828,12 @@ onMounted(() => {
|
|||||||
.form-item-checkbox {
|
.form-item-checkbox {
|
||||||
margin-bottom: 8px !important;
|
margin-bottom: 8px !important;
|
||||||
}
|
}
|
||||||
|
.data-area-label {
|
||||||
|
text-align: left;
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -262,9 +262,6 @@ const chartStyleShow = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const chartViewInstance = computed(() => {
|
const chartViewInstance = computed(() => {
|
||||||
if (view.value.render === 'highchart') {
|
|
||||||
return chartViewManager.getChartView('antv', view.value.type)
|
|
||||||
}
|
|
||||||
return chartViewManager.getChartView(view.value.render, view.value.type)
|
return chartViewManager.getChartView(view.value.render, view.value.type)
|
||||||
})
|
})
|
||||||
const showAxis = (axis: AxisType) => chartViewInstance.value?.axis?.includes(axis)
|
const showAxis = (axis: AxisType) => chartViewInstance.value?.axis?.includes(axis)
|
||||||
@ -559,6 +556,33 @@ const showAggregate = computed<boolean>(() => {
|
|||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const disableUpdate = computed(() => {
|
||||||
|
let flag = false
|
||||||
|
if (view.value.type === 'table-info') {
|
||||||
|
return flag
|
||||||
|
}
|
||||||
|
if (!chartViewInstance.value) {
|
||||||
|
return flag
|
||||||
|
}
|
||||||
|
const axisConfig = chartViewInstance.value.axisConfig
|
||||||
|
if (!axisConfig) {
|
||||||
|
return flag
|
||||||
|
}
|
||||||
|
for (const key in axisConfig) {
|
||||||
|
if (Object.prototype.hasOwnProperty.call(axisConfig, key)) {
|
||||||
|
const axis = view.value[key]
|
||||||
|
if (axis instanceof Array) {
|
||||||
|
axis.forEach(a => {
|
||||||
|
if (a.desensitized) {
|
||||||
|
flag = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return flag
|
||||||
|
})
|
||||||
|
|
||||||
const addAxis = (e, axis: AxisType) => {
|
const addAxis = (e, axis: AxisType) => {
|
||||||
recordSnapshotInfo('calcData')
|
recordSnapshotInfo('calcData')
|
||||||
const axisSpec = chartViewInstance.value?.axisConfig[axis]
|
const axisSpec = chartViewInstance.value?.axisConfig[axis]
|
||||||
@ -2210,8 +2234,26 @@ onMounted(() => {
|
|||||||
<!-- extBubble -->
|
<!-- extBubble -->
|
||||||
<el-row class="padding-lr drag-data" v-if="showAxis('extBubble')">
|
<el-row class="padding-lr drag-data" v-if="showAxis('extBubble')">
|
||||||
<div class="form-draggable-title">
|
<div class="form-draggable-title">
|
||||||
<span>
|
<span class="data-area-label">
|
||||||
{{ chartViewInstance.axisConfig.extBubble.name }}
|
<span style="margin-right: 4px">
|
||||||
|
{{ chartViewInstance.axisConfig.extBubble.name }}
|
||||||
|
</span>
|
||||||
|
<el-tooltip
|
||||||
|
v-if="chartViewInstance.axisConfig.extBubble.tooltip"
|
||||||
|
class="item"
|
||||||
|
:effect="toolTip"
|
||||||
|
placement="top"
|
||||||
|
>
|
||||||
|
<template #content>
|
||||||
|
<span> {{ chartViewInstance.axisConfig.extBubble.tooltip }}</span>
|
||||||
|
</template>
|
||||||
|
<el-icon
|
||||||
|
class="hint-icon"
|
||||||
|
:class="{ 'hint-icon--dark': themes === 'dark' }"
|
||||||
|
>
|
||||||
|
<Icon name="icon_info_outlined" />
|
||||||
|
</el-icon>
|
||||||
|
</el-tooltip>
|
||||||
</span>
|
</span>
|
||||||
<el-tooltip :effect="toolTip" placement="top" :content="t('common.delete')">
|
<el-tooltip :effect="toolTip" placement="top" :content="t('common.delete')">
|
||||||
<el-icon
|
<el-icon
|
||||||
@ -2464,6 +2506,7 @@ onMounted(() => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-button
|
<el-button
|
||||||
|
:disabled="disableUpdate"
|
||||||
type="primary"
|
type="primary"
|
||||||
class="result-style-button"
|
class="result-style-button"
|
||||||
@click="updateChartData(view)"
|
@click="updateChartData(view)"
|
||||||
|
|||||||
@ -55,7 +55,8 @@ export class SymbolicMap extends L7ChartView<Scene, L7Config> {
|
|||||||
extBubble: {
|
extBubble: {
|
||||||
name: `${t('chart.bubble_size')} / ${t('chart.quota')}`,
|
name: `${t('chart.bubble_size')} / ${t('chart.quota')}`,
|
||||||
type: 'q',
|
type: 'q',
|
||||||
limit: 1
|
limit: 1,
|
||||||
|
tooltip: '该指标生效时,样式基础样式中的大小属性将失效'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -139,9 +140,32 @@ export class SymbolicMap extends L7ChartView<Scene, L7Config> {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
scene.once('loaded', () => {
|
||||||
|
this.autoZoom(symbolicLayer, scene)
|
||||||
|
})
|
||||||
return new L7Wrapper(scene, configList)
|
return new L7Wrapper(scene, configList)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据数据自动缩放大小及位置
|
||||||
|
* @param symbolicLayer
|
||||||
|
* @param scene
|
||||||
|
*/
|
||||||
|
autoZoom = (symbolicLayer, scene) => {
|
||||||
|
const roamMap = flag => {
|
||||||
|
return flag ? scene.zoomIn() : scene.zoomOut()
|
||||||
|
}
|
||||||
|
const resetZoom = () => {
|
||||||
|
symbolicLayer.fitBounds()
|
||||||
|
}
|
||||||
|
symbolicLayer && resetZoom()
|
||||||
|
// 自动放大两级
|
||||||
|
let index = 2
|
||||||
|
while (index--) {
|
||||||
|
roamMap(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建符号图层
|
* 构建符号图层
|
||||||
* @param chart
|
* @param chart
|
||||||
|
|||||||
@ -45,6 +45,7 @@ import DeRichTextView from '@/custom-component/rich-text/DeRichTextView.vue'
|
|||||||
import ChartEmptyInfo from '@/views/chart/components/views/components/ChartEmptyInfo.vue'
|
import ChartEmptyInfo from '@/views/chart/components/views/components/ChartEmptyInfo.vue'
|
||||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||||
import { viewFieldTimeTrans } from '@/utils/viewUtils'
|
import { viewFieldTimeTrans } from '@/utils/viewUtils'
|
||||||
|
import { CHART_TYPE_CONFIGS } from '@/views/chart/components/editor/util/chart'
|
||||||
|
|
||||||
const { wsCache } = useCache()
|
const { wsCache } = useCache()
|
||||||
const chartComponent = ref<any>()
|
const chartComponent = ref<any>()
|
||||||
@ -473,9 +474,21 @@ const calcData = params => {
|
|||||||
dvMainStore.setLastViewRequestInfo(params.id, params.chartExtRequest)
|
dvMainStore.setLastViewRequestInfo(params.id, params.chartExtRequest)
|
||||||
if (chartComponent?.value) {
|
if (chartComponent?.value) {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
chartComponent?.value?.calcData?.(params, res => {
|
if (view.value.isPlugin) {
|
||||||
loading.value = false
|
chartComponent?.value?.invokeMethod({
|
||||||
})
|
methodName: 'calcData',
|
||||||
|
args: [
|
||||||
|
params,
|
||||||
|
res => {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
chartComponent?.value?.calcData?.(params, res => {
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -503,7 +516,9 @@ const listenerEnable = computed(() => {
|
|||||||
return !showPosition.value.includes('viewDialog')
|
return !showPosition.value.includes('viewDialog')
|
||||||
})
|
})
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
queryData(true && !showPosition.value.includes('viewDialog'))
|
if (!view.value.isPlugin) {
|
||||||
|
queryData(true && !showPosition.value.includes('viewDialog'))
|
||||||
|
}
|
||||||
if (!listenerEnable.value) {
|
if (!listenerEnable.value) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -693,6 +708,55 @@ const showActionIcons = computed(() => {
|
|||||||
}
|
}
|
||||||
return trackMenu.value.length > 0 || state.title_remark.show
|
return trackMenu.value.length > 0 || state.title_remark.show
|
||||||
})
|
})
|
||||||
|
const chartConfigs = ref(CHART_TYPE_CONFIGS)
|
||||||
|
const pluginLoaded = computed(() => {
|
||||||
|
let result = false
|
||||||
|
chartConfigs.value.forEach(cat => {
|
||||||
|
result = cat.details.find(chart => view.value?.type === chart.value) !== undefined
|
||||||
|
})
|
||||||
|
return result
|
||||||
|
})
|
||||||
|
// TODO 统一加载
|
||||||
|
const loadPluginCategory = data => {
|
||||||
|
data.forEach(item => {
|
||||||
|
const { category, title, render, chartValue, chartTitle, icon, staticMap } = item
|
||||||
|
const node = {
|
||||||
|
render,
|
||||||
|
category,
|
||||||
|
icon,
|
||||||
|
value: chartValue,
|
||||||
|
title: chartTitle,
|
||||||
|
isPlugin: true,
|
||||||
|
staticMap
|
||||||
|
}
|
||||||
|
if (view.value?.type === node.value) {
|
||||||
|
view.value.plugin = {
|
||||||
|
isPlugin: true,
|
||||||
|
staticMap
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const stack = [...chartConfigs.value]
|
||||||
|
let findParent = false
|
||||||
|
while (stack?.length) {
|
||||||
|
const parent = stack.pop()
|
||||||
|
if (parent.category === category) {
|
||||||
|
const chart = parent.details.find(chart => chart.value === node.value)
|
||||||
|
if (!chart) {
|
||||||
|
parent.details.push(node)
|
||||||
|
}
|
||||||
|
findParent = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!findParent) {
|
||||||
|
stack.push({
|
||||||
|
category,
|
||||||
|
title,
|
||||||
|
display: 'show',
|
||||||
|
details: [node]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -761,7 +825,7 @@ const showActionIcons = computed(() => {
|
|||||||
<!--这里去渲染不同图库的图表-->
|
<!--这里去渲染不同图库的图表-->
|
||||||
<div v-if="chartAreaShow" style="flex: 1; overflow: hidden">
|
<div v-if="chartAreaShow" style="flex: 1; overflow: hidden">
|
||||||
<plugin-component
|
<plugin-component
|
||||||
v-if="view.plugin?.isPlugin"
|
v-if="view.isPlugin"
|
||||||
:jsname="view.plugin.staticMap['index']"
|
:jsname="view.plugin.staticMap['index']"
|
||||||
:scale="scale"
|
:scale="scale"
|
||||||
:dynamic-area-id="dynamicAreaId"
|
:dynamic-area-id="dynamicAreaId"
|
||||||
@ -831,6 +895,11 @@ const showActionIcons = computed(() => {
|
|||||||
ref="openHandler"
|
ref="openHandler"
|
||||||
jsname="L2NvbXBvbmVudC9lbWJlZGRlZC1pZnJhbWUvT3BlbkhhbmRsZXI="
|
jsname="L2NvbXBvbmVudC9lbWJlZGRlZC1pZnJhbWUvT3BlbkhhbmRsZXI="
|
||||||
/>
|
/>
|
||||||
|
<XpackComponent
|
||||||
|
v-if="!pluginLoaded && view.isPlugin"
|
||||||
|
jsname="L2NvbXBvbmVudC9wbHVnaW5zLWhhbmRsZXIvVmlld0NhdGVnb3J5SGFuZGxlcg=="
|
||||||
|
@load-plugin-category="loadPluginCategory"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||||
import { onMounted, reactive } from 'vue'
|
import { onMounted, reactive, ref } from 'vue'
|
||||||
import DePreview from '@/components/data-visualization/canvas/DePreview.vue'
|
import DePreview from '@/components/data-visualization/canvas/DePreview.vue'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
|
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||||
|
import ExportExcel from '@/views/visualized/data/dataset/ExportExcel.vue'
|
||||||
import { initCanvasData } from '@/utils/canvasUtils'
|
import { initCanvasData } from '@/utils/canvasUtils'
|
||||||
import { queryTargetVisualizationJumpInfo } from '@/api/visualization/linkJump'
|
import { queryTargetVisualizationJumpInfo } from '@/api/visualization/linkJump'
|
||||||
import { Base64 } from 'js-base64'
|
import { Base64 } from 'js-base64'
|
||||||
@ -119,6 +121,12 @@ const loadCanvasDataAsync = async (dvId, dvType) => {
|
|||||||
let p = null
|
let p = null
|
||||||
const XpackLoaded = () => p(true)
|
const XpackLoaded = () => p(true)
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
useEmitt({
|
||||||
|
name: 'data-export-center',
|
||||||
|
callback: function (params) {
|
||||||
|
ExportExcelRef.value.init(params)
|
||||||
|
}
|
||||||
|
})
|
||||||
await new Promise(r => (p = r))
|
await new Promise(r => (p = r))
|
||||||
const dvId = embeddedStore.dvId || router.currentRoute.value.query.dvId
|
const dvId = embeddedStore.dvId || router.currentRoute.value.query.dvId
|
||||||
const { dvType, callBackFlag, taskId } = router.currentRoute.value.query
|
const { dvType, callBackFlag, taskId } = router.currentRoute.value.query
|
||||||
@ -132,6 +140,7 @@ onMounted(async () => {
|
|||||||
dvMainStore.setEmbeddedCallBack(callBackFlag || 'no')
|
dvMainStore.setEmbeddedCallBack(callBackFlag || 'no')
|
||||||
dvMainStore.setPublicLinkStatus(props.publicLinkStatus)
|
dvMainStore.setPublicLinkStatus(props.publicLinkStatus)
|
||||||
})
|
})
|
||||||
|
const ExportExcelRef = ref()
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
loadCanvasDataAsync
|
loadCanvasDataAsync
|
||||||
@ -156,6 +165,7 @@ defineExpose({
|
|||||||
@loaded="XpackLoaded"
|
@loaded="XpackLoaded"
|
||||||
@load-fail="XpackLoaded"
|
@load-fail="XpackLoaded"
|
||||||
/>
|
/>
|
||||||
|
<ExportExcel ref="ExportExcelRef"></ExportExcel>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
|||||||
@ -42,7 +42,7 @@
|
|||||||
:disabled="!linkCustom"
|
:disabled="!linkCustom"
|
||||||
@blur="finishEditUuid"
|
@blur="finishEditUuid"
|
||||||
>
|
>
|
||||||
<template #prefix>
|
<template v-if="!linkCustom" #prefix>
|
||||||
{{ formatLinkBase() }}
|
{{ formatLinkBase() }}
|
||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
@ -122,7 +122,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-if="shareEnable && showTicket" class="share-ticket-container">
|
<div v-if="shareEnable && showTicket" class="share-ticket-container">
|
||||||
<share-ticket
|
<share-ticket
|
||||||
:link-url="linkAddr"
|
|
||||||
:uuid="state.detailInfo.uuid"
|
:uuid="state.detailInfo.uuid"
|
||||||
:resource-id="props.resourceId"
|
:resource-id="props.resourceId"
|
||||||
:ticket-require="state.detailInfo.ticketRequire"
|
:ticket-require="state.detailInfo.ticketRequire"
|
||||||
@ -150,7 +149,8 @@ import { ShareInfo, SHARE_BASE, shortcuts } from './option'
|
|||||||
import { ElMessage, ElLoading } from 'element-plus-secondary'
|
import { ElMessage, ElLoading } from 'element-plus-secondary'
|
||||||
import useClipboard from 'vue-clipboard3'
|
import useClipboard from 'vue-clipboard3'
|
||||||
import ShareTicket from './ShareTicket.vue'
|
import ShareTicket from './ShareTicket.vue'
|
||||||
|
import { useEmbedded } from '@/store/modules/embedded'
|
||||||
|
const embeddedStore = useEmbedded()
|
||||||
const { toClipboard } = useClipboard()
|
const { toClipboard } = useClipboard()
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -311,8 +311,8 @@ const formatLinkAddr = () => {
|
|||||||
}
|
}
|
||||||
const formatLinkBase = () => {
|
const formatLinkBase = () => {
|
||||||
let prefix = '/'
|
let prefix = '/'
|
||||||
if (window.DataEaseBi?.baseUrl) {
|
if (embeddedStore.baseUrl) {
|
||||||
prefix = window.DataEaseBi.baseUrl + '#'
|
prefix = embeddedStore.baseUrl + '#'
|
||||||
} else {
|
} else {
|
||||||
const href = window.location.href
|
const href = window.location.href
|
||||||
prefix = href.substring(0, href.indexOf('#') + 1)
|
prefix = href.substring(0, href.indexOf('#') + 1)
|
||||||
|
|||||||
@ -156,11 +156,14 @@ import { useI18n } from '@/hooks/web/useI18n'
|
|||||||
import request from '@/config/axios'
|
import request from '@/config/axios'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus-secondary'
|
import { ElMessage, ElMessageBox } from 'element-plus-secondary'
|
||||||
import useClipboard from 'vue-clipboard3'
|
import useClipboard from 'vue-clipboard3'
|
||||||
|
import { useEmbedded } from '@/store/modules/embedded'
|
||||||
|
import { SHARE_BASE } from './option'
|
||||||
|
|
||||||
|
const embeddedStore = useEmbedded()
|
||||||
const { toClipboard } = useClipboard()
|
const { toClipboard } = useClipboard()
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
linkUrl: propTypes.string.def(null),
|
uuid: propTypes.string.def(''),
|
||||||
uuid: propTypes.string.def(null),
|
|
||||||
resourceId: propTypes.string.def(null),
|
resourceId: propTypes.string.def(null),
|
||||||
ticketRequire: propTypes.bool
|
ticketRequire: propTypes.bool
|
||||||
})
|
})
|
||||||
@ -234,9 +237,21 @@ const addRow = () => {
|
|||||||
state.tableData.splice(0, 0, row)
|
state.tableData.splice(0, 0, row)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const formatLinkAddr = () => {
|
||||||
|
return formatLinkBase() + props.uuid
|
||||||
|
}
|
||||||
|
const formatLinkBase = () => {
|
||||||
|
let prefix = '/'
|
||||||
|
if (embeddedStore.baseUrl) {
|
||||||
|
prefix = embeddedStore.baseUrl + '#'
|
||||||
|
} else {
|
||||||
|
const href = window.location.href
|
||||||
|
prefix = href.substring(0, href.indexOf('#') + 1)
|
||||||
|
}
|
||||||
|
return prefix + SHARE_BASE
|
||||||
|
}
|
||||||
const copyTicket = async ticket => {
|
const copyTicket = async ticket => {
|
||||||
const url = `${props.linkUrl}?ticket=${ticket}`
|
const url = `${formatLinkAddr()}?ticket=${ticket}`
|
||||||
try {
|
try {
|
||||||
await toClipboard(url)
|
await toClipboard(url)
|
||||||
ElMessage.success(t('common.copy_success'))
|
ElMessage.success(t('common.copy_success'))
|
||||||
|
|||||||
@ -123,7 +123,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-if="shareEnable && showTicket" class="share-ticket-container">
|
<div v-if="shareEnable && showTicket" class="share-ticket-container">
|
||||||
<share-ticket
|
<share-ticket
|
||||||
:link-url="linkAddr"
|
|
||||||
:uuid="state.detailInfo.uuid"
|
:uuid="state.detailInfo.uuid"
|
||||||
:resource-id="props.resourceId"
|
:resource-id="props.resourceId"
|
||||||
:ticket-require="state.detailInfo.ticketRequire"
|
:ticket-require="state.detailInfo.ticketRequire"
|
||||||
@ -143,7 +142,8 @@ import { ShareInfo, SHARE_BASE, shortcuts } from './option'
|
|||||||
import { ElMessage, ElLoading } from 'element-plus-secondary'
|
import { ElMessage, ElLoading } from 'element-plus-secondary'
|
||||||
import useClipboard from 'vue-clipboard3'
|
import useClipboard from 'vue-clipboard3'
|
||||||
import ShareTicket from './ShareTicket.vue'
|
import ShareTicket from './ShareTicket.vue'
|
||||||
|
import { useEmbedded } from '@/store/modules/embedded'
|
||||||
|
const embeddedStore = useEmbedded()
|
||||||
const { toClipboard } = useClipboard()
|
const { toClipboard } = useClipboard()
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -282,8 +282,8 @@ const formatLinkAddr = () => {
|
|||||||
}
|
}
|
||||||
const formatLinkBase = () => {
|
const formatLinkBase = () => {
|
||||||
let prefix = '/'
|
let prefix = '/'
|
||||||
if (window.DataEaseBi?.baseUrl) {
|
if (embeddedStore.baseUrl) {
|
||||||
prefix = window.DataEaseBi.baseUrl + '#'
|
prefix = embeddedStore.baseUrl + '#'
|
||||||
} else {
|
} else {
|
||||||
const href = window.location.href
|
const href = window.location.href
|
||||||
prefix = href.substring(0, href.indexOf('#') + 1)
|
prefix = href.substring(0, href.indexOf('#') + 1)
|
||||||
|
|||||||
@ -155,7 +155,7 @@ const rule = reactive<FormRules>({
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
const activeName = ref('third')
|
const activeName = ref('table')
|
||||||
provide('api-active-name', activeName)
|
provide('api-active-name', activeName)
|
||||||
const initApiItem = (val: ApiItem, from, name) => {
|
const initApiItem = (val: ApiItem, from, name) => {
|
||||||
activeName.value = name
|
activeName.value = name
|
||||||
@ -220,6 +220,21 @@ const saveItem = () => {
|
|||||||
ElMessage.error(t('datasource.api_field_not_empty'))
|
ElMessage.error(t('datasource.api_field_not_empty'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (apiItem.type === 'params') {
|
||||||
|
for (let i = 0; i < apiItem.fields.length; i++) {
|
||||||
|
for (let j = 0; j < paramsList.length; j++) {
|
||||||
|
for (let k = 0; k < paramsList[j].fields.length; k++) {
|
||||||
|
if (
|
||||||
|
apiItem.fields[i].name === paramsList[j].fields[k].name &&
|
||||||
|
apiItem.serialNumber !== paramsList[j].serialNumber
|
||||||
|
) {
|
||||||
|
ElMessage.error('已经存在同名参数:' + apiItem.fields[i].name)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
for (let i = 0; i < apiItem.fields.length - 1; i++) {
|
for (let i = 0; i < apiItem.fields.length - 1; i++) {
|
||||||
for (let j = i + 1; j < apiItem.fields.length; j++) {
|
for (let j = i + 1; j < apiItem.fields.length; j++) {
|
||||||
if (apiItem.fields[i].name === apiItem.fields[j].name) {
|
if (apiItem.fields[i].name === apiItem.fields[j].name) {
|
||||||
@ -241,15 +256,28 @@ const next = () => {
|
|||||||
ElMessage.error(t('datasource.please_input_dataPath'))
|
ElMessage.error(t('datasource.please_input_dataPath'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for (let i = 0; i < apiItemList.length; i++) {
|
if (apiItem.type === 'params') {
|
||||||
if (
|
for (let i = 0; i < paramsList.length; i++) {
|
||||||
apiItemList[i].name === apiItem.name &&
|
if (
|
||||||
apiItem.serialNumber !== apiItemList[i].serialNumber
|
paramsList[i].name === apiItem.name &&
|
||||||
) {
|
apiItem.serialNumber !== paramsList[i].serialNumber
|
||||||
ElMessage.error(t('datasource.has_repeat_name'))
|
) {
|
||||||
return
|
ElMessage.error('已经存在同名的参数表')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (let i = 0; i < apiItemList.length; i++) {
|
||||||
|
if (
|
||||||
|
apiItemList[i].name === apiItem.name &&
|
||||||
|
apiItem.serialNumber !== apiItemList[i].serialNumber
|
||||||
|
) {
|
||||||
|
ElMessage.error(t('datasource.has_repeat_name'))
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cancelMap['/datasource/checkApiDatasource']?.()
|
cancelMap['/datasource/checkApiDatasource']?.()
|
||||||
|
|
||||||
const params = Base64.encode(JSON.stringify(paramsList))
|
const params = Base64.encode(JSON.stringify(paramsList))
|
||||||
@ -441,7 +469,7 @@ defineExpose({
|
|||||||
{{ active <= 1 ? '2' : '' }}
|
{{ active <= 1 ? '2' : '' }}
|
||||||
</span>
|
</span>
|
||||||
<span class="title">{{
|
<span class="title">{{
|
||||||
activeName === 'third' ? t('datasource.api_step_2') : '提取参数'
|
activeName === 'table' ? t('datasource.api_step_2') : '提取参数'
|
||||||
}}</span>
|
}}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -82,7 +82,6 @@ const options = [
|
|||||||
value: 'fixed'
|
value: 'fixed'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
const value = ref('')
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { propTypes } from '@/utils/propTypes'
|
import { propTypes } from '@/utils/propTypes'
|
||||||
import { computed, onBeforeMount, PropType, toRefs } from 'vue'
|
import { computed, onBeforeMount, PropType, toRefs, inject } from 'vue'
|
||||||
import { useI18n } from '@/hooks/web/useI18n'
|
import { useI18n } from '@/hooks/web/useI18n'
|
||||||
import { KeyValue } from './ApiTestModel.js'
|
import { KeyValue } from './ApiTestModel.js'
|
||||||
import { guid } from '@/views/visualized/data/dataset/form/util'
|
import { guid } from '@/views/visualized/data/dataset/form/util'
|
||||||
@ -91,6 +91,7 @@ const createFilter = (queryString: string) => {
|
|||||||
return restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
|
return restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const activeName = inject('api-active-name')
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -149,7 +150,7 @@ const createFilter = (queryString: string) => {
|
|||||||
/>
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="5">
|
<el-col :span="activeName === 'params' ? 10 : 5">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="element.description"
|
v-model="element.description"
|
||||||
maxlength="200"
|
maxlength="200"
|
||||||
@ -157,7 +158,7 @@ const createFilter = (queryString: string) => {
|
|||||||
show-word-limit
|
show-word-limit
|
||||||
/>
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="5">
|
<el-col v-if="activeName !== 'params'" :span="5">
|
||||||
<el-autocomplete
|
<el-autocomplete
|
||||||
v-if="suggestions"
|
v-if="suggestions"
|
||||||
v-model="element.name"
|
v-model="element.name"
|
||||||
|
|||||||
@ -379,6 +379,9 @@ const returnItem = apiItem => {
|
|||||||
if (form.value.paramsConfiguration[i].serialNumber === apiItem.serialNumber) {
|
if (form.value.paramsConfiguration[i].serialNumber === apiItem.serialNumber) {
|
||||||
find = true
|
find = true
|
||||||
form.value.paramsConfiguration[i] = apiItem
|
form.value.paramsConfiguration[i] = apiItem
|
||||||
|
if (apiItem.serialNumber === activeParamsID.value) {
|
||||||
|
setActiveName(apiItem)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!find) {
|
if (!find) {
|
||||||
@ -498,6 +501,7 @@ const apiRule = {
|
|||||||
const dialogEditParams = ref(false)
|
const dialogEditParams = ref(false)
|
||||||
const dialogRenameApi = ref(false)
|
const dialogRenameApi = ref(false)
|
||||||
const activeParamsName = ref('')
|
const activeParamsName = ref('')
|
||||||
|
const activeParamsID = ref(0)
|
||||||
const paramsObj = ref({
|
const paramsObj = ref({
|
||||||
name: '',
|
name: '',
|
||||||
id: 1,
|
id: 1,
|
||||||
@ -542,6 +546,7 @@ const apiObjRules = {
|
|||||||
const setActiveName = val => {
|
const setActiveName = val => {
|
||||||
gridData.value = val.fields
|
gridData.value = val.fields
|
||||||
activeParamsName.value = val.name
|
activeParamsName.value = val.name
|
||||||
|
activeParamsName.value = val.serialNumber
|
||||||
}
|
}
|
||||||
|
|
||||||
const paramsObjRef = ref()
|
const paramsObjRef = ref()
|
||||||
|
|||||||
@ -2,12 +2,14 @@ package io.dataease.extensions.view.dto;
|
|||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class AxisFormatResult {
|
public class AxisFormatResult {
|
||||||
private Map<ChartAxis, List<ChartViewFieldDTO>> axisMap;
|
private Map<ChartAxis, List<ChartViewFieldDTO>> axisMap;
|
||||||
private Map<String, Object> context;
|
private Map<String, Object> context;
|
||||||
|
|||||||
@ -18,7 +18,7 @@ public abstract class AbstractChartPlugin implements DataEasePlugin {
|
|||||||
@Override
|
@Override
|
||||||
public void loadPlugin() {
|
public void loadPlugin() {
|
||||||
XpackPluginsViewVO viewConfig = getConfig();
|
XpackPluginsViewVO viewConfig = getConfig();
|
||||||
PluginsChartFactory.loadPlugin(viewConfig.getRender(), viewConfig.getCategory(), this);
|
PluginsChartFactory.loadPlugin(viewConfig.getRender(), viewConfig.getChartValue(), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user