Merge branch 'dev' into pr@dev@fixSql
This commit is contained in:
commit
9ad092228f
@ -781,11 +781,38 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
|
||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||
List<String> yWheres = new ArrayList<>();
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
ChartViewFieldDTO x = xAxis.get(i);
|
||||
String originField;
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(x.getGroupType(), "q")) {
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||
originField = String.format(DorisConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName());
|
||||
} else {
|
||||
originField = String.format(DorisConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName());
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_Y_PREFIX, i);
|
||||
// 处理纵轴字段
|
||||
yFields.add(getYFields(x, originField, fieldAlias));
|
||||
// 处理纵轴过滤
|
||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||
// 处理纵轴排序
|
||||
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
||||
yOrders.add(SQLObj.builder()
|
||||
.orderField(originField)
|
||||
.orderAlias(fieldAlias)
|
||||
.orderDirection(x.getSort())
|
||||
.build());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
@ -824,8 +851,6 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
}
|
||||
}
|
||||
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
// 处理视图中字段过滤
|
||||
String customWheres = transChartFilterTrees(tableObj, fieldCustomFilter);
|
||||
// 处理仪表板字段过滤
|
||||
|
||||
@ -387,11 +387,39 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
|
||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||
List<String> yWheres = new ArrayList<>();
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
ChartViewFieldDTO x = xAxis.get(i);
|
||||
String originField;
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(x.getGroupType(), "q")) {
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||
originField = String.format(MysqlConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName());
|
||||
} else {
|
||||
originField = String.format(MysqlConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName());
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_Y_PREFIX, i);
|
||||
// 处理纵轴字段
|
||||
yFields.add(getYFields(x, originField, fieldAlias));
|
||||
// 处理纵轴过滤
|
||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||
// 处理纵轴排序
|
||||
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
||||
yOrders.add(SQLObj.builder()
|
||||
.orderField(originField)
|
||||
.orderAlias(fieldAlias)
|
||||
.orderDirection(x.getSort())
|
||||
.build());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 计算字段和视图字段,规则为 函数([原始字段id]),这边把[原始字段id] 换成 表名.原始字段id
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
@ -432,8 +460,6 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
}
|
||||
}
|
||||
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
// 处理视图中字段过滤
|
||||
String customWheres = transChartFilterTrees(tableObj, fieldCustomFilter);
|
||||
// 处理仪表板字段过滤
|
||||
|
||||
@ -774,11 +774,38 @@ public class CKQueryProvider extends QueryProvider {
|
||||
|
||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||
List<String> yWheres = new ArrayList<>();
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
ChartViewFieldDTO x = xAxis.get(i);
|
||||
String originField;
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(x.getGroupType(), "q")) {
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||
originField = String.format(CKConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
} else {
|
||||
originField = String.format(CKConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_Y_PREFIX, i);
|
||||
// 处理纵轴字段
|
||||
yFields.add(getYFields(x, originField, fieldAlias));
|
||||
// 处理纵轴过滤
|
||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||
// 处理纵轴排序
|
||||
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
||||
yOrders.add(SQLObj.builder()
|
||||
.orderField(originField)
|
||||
.orderAlias(fieldAlias)
|
||||
.orderDirection(x.getSort())
|
||||
.build());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
@ -816,7 +843,6 @@ public class CKQueryProvider extends QueryProvider {
|
||||
}
|
||||
}
|
||||
}
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
// 处理视图中字段过滤
|
||||
String customWheres = transChartFilterTrees(tableObj, fieldCustomFilter);
|
||||
|
||||
@ -760,11 +760,38 @@ public class Db2QueryProvider extends QueryProvider {
|
||||
|
||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||
List<String> yWheres = new ArrayList<>();
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
ChartViewFieldDTO x = xAxis.get(i);
|
||||
String originField;
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(x.getGroupType(), "q")) {
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||
originField = String.format(Db2Constants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
} else {
|
||||
originField = String.format(Db2Constants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_Y_PREFIX, i);
|
||||
// 处理纵轴字段
|
||||
yFields.add(getYFields(x, originField, fieldAlias));
|
||||
// 处理纵轴过滤
|
||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||
// 处理纵轴排序
|
||||
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
||||
yOrders.add(SQLObj.builder()
|
||||
.orderField(originField)
|
||||
.orderAlias(fieldAlias)
|
||||
.orderDirection(x.getSort())
|
||||
.build());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
@ -803,8 +830,6 @@ public class Db2QueryProvider extends QueryProvider {
|
||||
}
|
||||
}
|
||||
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
// 处理视图中字段过滤
|
||||
String customWheres = transChartFilterTrees(tableObj, fieldCustomFilter);
|
||||
// 处理仪表板字段过滤
|
||||
|
||||
@ -775,11 +775,44 @@ public class EsQueryProvider extends QueryProvider {
|
||||
|
||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||
List<String> yWheres = new ArrayList<>();
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
ChartViewFieldDTO x = xAxis.get(i);
|
||||
String originField;
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(x.getGroupType(), "q")) {
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == DeTypeConstants.DE_INT) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == DeTypeConstants.DE_TIME) {
|
||||
originField = String.format(EsSqlLConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
} else {
|
||||
if (x.getDeType() == 2) {
|
||||
originField = String.format(EsSqlLConstants.CAST, String.format(EsSqlLConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName()), "bigint");
|
||||
} else if (x.getDeType() == 3) {
|
||||
originField = String.format(EsSqlLConstants.CAST, String.format(EsSqlLConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName()), "float");
|
||||
} else {
|
||||
originField = String.format(EsSqlLConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
}
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_Y_PREFIX, i);
|
||||
// 处理纵轴字段
|
||||
yFields.add(getYFields(x, originField, fieldAlias));
|
||||
// 处理纵轴过滤
|
||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||
// 处理纵轴排序
|
||||
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
||||
yOrders.add(SQLObj.builder()
|
||||
.orderField(originField)
|
||||
.orderAlias(fieldAlias)
|
||||
.orderDirection(x.getSort())
|
||||
.build());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == DeTypeConstants.DE_INT) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
@ -822,8 +855,6 @@ public class EsQueryProvider extends QueryProvider {
|
||||
}
|
||||
}
|
||||
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
// 处理视图中字段过滤
|
||||
String customWheres = transChartFilterTrees(tableObj, fieldCustomFilter);
|
||||
// 处理仪表板字段过滤
|
||||
|
||||
@ -724,11 +724,38 @@ public class HiveQueryProvider extends QueryProvider {
|
||||
|
||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||
List<String> yWheres = new ArrayList<>();
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
ChartViewFieldDTO x = xAxis.get(i);
|
||||
String originField;
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(x.getGroupType(), "q")) {
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||
originField = String.format(HiveConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
} else {
|
||||
originField = String.format(HiveConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_Y_PREFIX, i);
|
||||
// 处理纵轴字段
|
||||
yFields.add(getYFields(x, originField, fieldAlias));
|
||||
// 处理纵轴过滤
|
||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||
// 处理纵轴排序
|
||||
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
||||
yOrders.add(SQLObj.builder()
|
||||
.orderField(originField)
|
||||
.orderAlias(fieldAlias)
|
||||
.orderDirection(x.getSort())
|
||||
.build());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
@ -766,7 +793,6 @@ public class HiveQueryProvider extends QueryProvider {
|
||||
}
|
||||
}
|
||||
}
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
// 处理视图中字段过滤
|
||||
String customWheres = transChartFilterTrees(tableObj, fieldCustomFilter);
|
||||
|
||||
@ -728,11 +728,38 @@ public class ImpalaQueryProvider extends QueryProvider {
|
||||
|
||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||
List<String> yWheres = new ArrayList<>();
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
ChartViewFieldDTO x = xAxis.get(i);
|
||||
String originField;
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(x.getGroupType(), "q")) {
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||
originField = String.format(ImpalaConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
} else {
|
||||
originField = String.format(ImpalaConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_Y_PREFIX, i);
|
||||
// 处理纵轴字段
|
||||
yFields.add(getYFields(x, originField, fieldAlias));
|
||||
// 处理纵轴过滤
|
||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||
// 处理纵轴排序
|
||||
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
||||
yOrders.add(SQLObj.builder()
|
||||
.orderField(originField)
|
||||
.orderAlias(fieldAlias)
|
||||
.orderDirection(x.getSort())
|
||||
.build());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
@ -770,7 +797,7 @@ public class ImpalaQueryProvider extends QueryProvider {
|
||||
}
|
||||
}
|
||||
}
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
|
||||
// 处理视图中字段过滤
|
||||
String customWheres = transChartFilterTrees(tableObj, fieldCustomFilter);
|
||||
|
||||
@ -697,10 +697,41 @@ public class MongoQueryProvider extends QueryProvider {
|
||||
.build();
|
||||
List<SQLObj> xFields = new ArrayList<>();
|
||||
List<SQLObj> xOrders = new ArrayList<>();
|
||||
|
||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||
List<String> yWheres = new ArrayList<>();
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
ChartViewFieldDTO x = xAxis.get(i);
|
||||
String originField;
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(x.getGroupType(), "q")) {
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == DeTypeConstants.DE_INT) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == DeTypeConstants.DE_TIME) {
|
||||
originField = String.format(MongoConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
} else {
|
||||
originField = String.format(MongoConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
}
|
||||
String fieldAlias = String.format(MongoConstants.ALIAS_FIX, String.format(SQLConstants.FIELD_ALIAS_Y_PREFIX, i));
|
||||
// 处理纵轴字段
|
||||
yFields.add(getYFields(x, originField, fieldAlias));
|
||||
// 处理纵轴过滤
|
||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||
// 处理纵轴排序
|
||||
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
||||
yOrders.add(SQLObj.builder()
|
||||
.orderField(originField)
|
||||
.orderAlias(fieldAlias)
|
||||
.orderDirection(x.getSort())
|
||||
.build());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == DeTypeConstants.DE_INT) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
@ -710,8 +741,23 @@ public class MongoQueryProvider extends QueryProvider {
|
||||
originField = String.format(MongoConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||
// 处理横轴字段
|
||||
xFields.add(getXFields(x, originField, fieldAlias));
|
||||
|
||||
if (i == baseXAxis.size()) {// 起止时间
|
||||
String fieldName = String.format(MongoConstants.AGG_FIELD, "min", originField);
|
||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||
|
||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||
|
||||
} else if (i == baseXAxis.size() + 1) {
|
||||
String fieldName = String.format(MongoConstants.AGG_FIELD, "max", originField);
|
||||
|
||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||
|
||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||
} else {
|
||||
// 处理横轴字段
|
||||
xFields.add(getXFields(x, originField, fieldAlias));
|
||||
}
|
||||
// 处理横轴排序
|
||||
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
||||
xOrders.add(SQLObj.builder()
|
||||
@ -722,36 +768,7 @@ public class MongoQueryProvider extends QueryProvider {
|
||||
}
|
||||
}
|
||||
}
|
||||
List<SQLObj> yFields = new ArrayList<>();
|
||||
List<String> yWheres = new ArrayList<>();
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(yAxis)) {
|
||||
for (int i = 0; i < yAxis.size(); i++) {
|
||||
ChartViewFieldDTO y = yAxis.get(i);
|
||||
String originField;
|
||||
if (ObjectUtils.isNotEmpty(y.getExtField()) && y.getExtField() == DeTypeConstants.DE_INT) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(y.getOriginName(), tableObj);
|
||||
} else if (ObjectUtils.isNotEmpty(y.getExtField()) && y.getExtField() == DeTypeConstants.DE_TIME) {
|
||||
originField = String.format(MongoConstants.KEYWORD_FIX, tableObj.getTableAlias(), y.getOriginName());
|
||||
} else {
|
||||
originField = String.format(MongoConstants.KEYWORD_FIX, tableObj.getTableAlias(), y.getOriginName());
|
||||
}
|
||||
String fieldAlias = String.format(MongoConstants.ALIAS_FIX, String.format(SQLConstants.FIELD_ALIAS_Y_PREFIX, i));
|
||||
// 处理纵轴字段
|
||||
yFields.add(getYFields(y, originField, fieldAlias));
|
||||
// 处理纵轴过滤
|
||||
yWheres.add(getYWheres(y, originField, fieldAlias));
|
||||
// 处理纵轴排序
|
||||
if (StringUtils.isNotEmpty(y.getSort()) && Utils.joinSort(y.getSort())) {
|
||||
yOrders.add(SQLObj.builder()
|
||||
.orderField(originField)
|
||||
.orderAlias(fieldAlias)
|
||||
.orderDirection(y.getSort())
|
||||
.build());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 处理视图中字段过滤
|
||||
String customWheres = transChartFilterTrees(tableObj, fieldCustomFilter);
|
||||
// 处理仪表板字段过滤
|
||||
|
||||
@ -11,7 +11,6 @@ import io.dataease.plugins.common.constants.DeTypeConstants;
|
||||
import io.dataease.plugins.common.constants.datasource.DorisConstants;
|
||||
import io.dataease.plugins.common.constants.datasource.MySQLConstants;
|
||||
import io.dataease.plugins.common.constants.datasource.SQLConstants;
|
||||
import io.dataease.plugins.common.constants.engine.MysqlConstants;
|
||||
import io.dataease.plugins.common.dto.chart.ChartCustomFilterItemDTO;
|
||||
import io.dataease.plugins.common.dto.chart.ChartFieldCustomFilterDTO;
|
||||
import io.dataease.plugins.common.dto.chart.ChartViewFieldDTO;
|
||||
@ -138,7 +137,7 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
} else if (f.getDeType() == 3) {
|
||||
fieldName = String.format(MySQLConstants.CAST, originField, MySQLConstants.DEFAULT_FLOAT_FORMAT);
|
||||
} else if (f.getDeType() == 1) {
|
||||
fieldName = StringUtils.isEmpty(f.getDateFormat()) ? String.format(MySQLConstants.STR_TO_DATE, originField, MysqlConstants.DEFAULT_DATE_FORMAT) :
|
||||
fieldName = StringUtils.isEmpty(f.getDateFormat()) ? String.format(MySQLConstants.STR_TO_DATE, originField, MySQLConstants.DEFAULT_DATE_FORMAT) :
|
||||
String.format(MySQLConstants.DATE_FORMAT, String.format(MySQLConstants.STR_TO_DATE, originField, f.getDateFormat()), MySQLConstants.DEFAULT_DATE_FORMAT);
|
||||
} else {
|
||||
fieldName = originField;
|
||||
@ -210,7 +209,7 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
} else if (f.getDeType() == 3) {
|
||||
fieldName = String.format(MySQLConstants.CAST, originField, MySQLConstants.DEFAULT_FLOAT_FORMAT);
|
||||
} else if (f.getDeType() == 1) {
|
||||
fieldName = StringUtils.isEmpty(f.getDateFormat()) ? String.format(MySQLConstants.STR_TO_DATE, originField, MysqlConstants.DEFAULT_DATE_FORMAT) :
|
||||
fieldName = StringUtils.isEmpty(f.getDateFormat()) ? String.format(MySQLConstants.STR_TO_DATE, originField, MySQLConstants.DEFAULT_DATE_FORMAT) :
|
||||
String.format(MySQLConstants.DATE_FORMAT, String.format(MySQLConstants.STR_TO_DATE, originField, f.getDateFormat()), MySQLConstants.DEFAULT_DATE_FORMAT);
|
||||
} else {
|
||||
fieldName = originField;
|
||||
@ -414,7 +413,7 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
@Override
|
||||
public String getSQLRangeBar(String table, List<ChartViewFieldDTO> baseXAxis, List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> yAxis, FilterTreeObj fieldCustomFilter, List<DataSetRowPermissionsTreeDTO> rowPermissionsTree, List<ChartExtFilterRequest> extFilterRequestList, List<ChartViewFieldDTO> extStack, Datasource ds, ChartViewWithBLOBs view) {
|
||||
SQLObj tableObj = SQLObj.builder()
|
||||
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format(MysqlConstants.KEYWORD_TABLE, table))
|
||||
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format(MySQLConstants.KEYWORD_TABLE, table))
|
||||
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
|
||||
.build();
|
||||
List<SQLObj> xFields = new ArrayList<>();
|
||||
@ -422,30 +421,56 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
|
||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||
List<String> yWheres = new ArrayList<>();
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
ChartViewFieldDTO x = xAxis.get(i);
|
||||
String originField;
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(x.getGroupType(), "q")) {
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||
originField = String.format(MySQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
} else {
|
||||
originField = String.format(MySQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_Y_PREFIX, i);
|
||||
// 处理纵轴字段
|
||||
yFields.add(getYFields(x, originField, fieldAlias));
|
||||
// 处理纵轴过滤
|
||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||
// 处理纵轴排序
|
||||
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
||||
yOrders.add(SQLObj.builder()
|
||||
.orderField(originField)
|
||||
.orderAlias(fieldAlias)
|
||||
.orderDirection(x.getSort())
|
||||
.build());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 计算字段和视图字段,规则为 函数([原始字段id]),这边把[原始字段id] 换成 表名.原始字段id
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||
originField = String.format(MysqlConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName());
|
||||
originField = String.format(MySQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
} else {
|
||||
originField = String.format(MysqlConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getDataeaseName());
|
||||
originField = String.format(MySQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_X_PREFIX, i);
|
||||
|
||||
if (i == baseXAxis.size()) {// 起止时间
|
||||
String fieldName = String.format(MysqlConstants.AGG_FIELD, "min", originField);
|
||||
String fieldName = String.format(MySQLConstants.AGG_FIELD, "min", originField);
|
||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||
|
||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||
|
||||
} else if (i == baseXAxis.size() + 1) {
|
||||
String fieldName = String.format(MysqlConstants.AGG_FIELD, "max", originField);
|
||||
String fieldName = String.format(MySQLConstants.AGG_FIELD, "max", originField);
|
||||
|
||||
yFields.add(getXFields(x, fieldName, fieldAlias));
|
||||
|
||||
@ -466,8 +491,6 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
}
|
||||
}
|
||||
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
// 处理视图中字段过滤
|
||||
String customWheres = transChartFilterTrees(tableObj, fieldCustomFilter);
|
||||
// 处理仪表板字段过滤
|
||||
@ -500,7 +523,7 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
|
||||
ST st = stg.getInstanceOf("querySql");
|
||||
SQLObj tableSQL = SQLObj.builder()
|
||||
.tableName(String.format(MysqlConstants.BRACKETS, sql))
|
||||
.tableName(String.format(MySQLConstants.BRACKETS, sql))
|
||||
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 1))
|
||||
.build();
|
||||
if (CollectionUtils.isNotEmpty(aggWheres)) st.add("filters", aggWheres);
|
||||
@ -1011,7 +1034,7 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
}
|
||||
if (field.getDeType() == 1) {
|
||||
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
|
||||
whereName = String.format(MySQLConstants.STR_TO_DATE, originName, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : MysqlConstants.DEFAULT_DATE_FORMAT);
|
||||
whereName = String.format(MySQLConstants.STR_TO_DATE, originName, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : MySQLConstants.DEFAULT_DATE_FORMAT);
|
||||
}
|
||||
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
|
||||
String cast = String.format(MySQLConstants.CAST, originName, MySQLConstants.DEFAULT_INT_FORMAT) + "/1000";
|
||||
@ -1086,7 +1109,7 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
}
|
||||
if (field.getDeType() == 1) {
|
||||
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
|
||||
whereName = String.format(MySQLConstants.STR_TO_DATE, originName, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : MysqlConstants.DEFAULT_DATE_FORMAT);
|
||||
whereName = String.format(MySQLConstants.STR_TO_DATE, originName, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : MySQLConstants.DEFAULT_DATE_FORMAT);
|
||||
}
|
||||
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
|
||||
String cast = String.format(MySQLConstants.CAST, originName, MySQLConstants.DEFAULT_INT_FORMAT) + "/1000";
|
||||
@ -1209,7 +1232,7 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
}
|
||||
if (field.getDeType() == 1) {
|
||||
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) {
|
||||
whereName = String.format(MySQLConstants.STR_TO_DATE, originName, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : MysqlConstants.DEFAULT_DATE_FORMAT);
|
||||
whereName = String.format(MySQLConstants.STR_TO_DATE, originName, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : MySQLConstants.DEFAULT_DATE_FORMAT);
|
||||
}
|
||||
if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) {
|
||||
String cast = String.format(MySQLConstants.CAST, originName, MySQLConstants.DEFAULT_INT_FORMAT) + "/1000";
|
||||
@ -1310,17 +1333,17 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5 || field.getDeExtractType() == 1) {
|
||||
String date;
|
||||
if (field.getType().equalsIgnoreCase("YEAR") || StringUtils.equalsIgnoreCase(field.getDateFormat(), "%Y")) {
|
||||
date = String.format(MySQLConstants.DATE_FORMAT, "CONCAT(" + originName + ",'-01-01')", StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : MysqlConstants.DEFAULT_DATE_FORMAT);
|
||||
date = String.format(MySQLConstants.DATE_FORMAT, "CONCAT(" + originName + ",'-01-01')", StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : MySQLConstants.DEFAULT_DATE_FORMAT);
|
||||
} else {
|
||||
date = String.format(MySQLConstants.DATE_FORMAT, originName, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : MysqlConstants.DEFAULT_DATE_FORMAT);
|
||||
date = String.format(MySQLConstants.DATE_FORMAT, originName, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : MySQLConstants.DEFAULT_DATE_FORMAT);
|
||||
}
|
||||
if (request.getOperator().equals("between") && request.getDatasetTableField().getDeExtractType() != 1) {
|
||||
whereName = String.format(MySQLConstants.UNIX_TIMESTAMP, date) + "*1000";
|
||||
} else {
|
||||
if (StringUtils.equalsIgnoreCase(request.getDateStyle(), "y_Q")) {
|
||||
whereName = String.format(format,
|
||||
String.format(MysqlConstants.DATE_FORMAT, originName, "%Y"),
|
||||
String.format(MysqlConstants.QUARTER, String.format(MysqlConstants.DATE_FORMAT, originName, MysqlConstants.DEFAULT_DATE_FORMAT)));
|
||||
String.format(MySQLConstants.DATE_FORMAT, originName, "%Y"),
|
||||
String.format(MySQLConstants.QUARTER, String.format(MySQLConstants.DATE_FORMAT, originName, MySQLConstants.DEFAULT_DATE_FORMAT)));
|
||||
} else {
|
||||
whereName = String.format(MySQLConstants.DATE_FORMAT, date, format);
|
||||
}
|
||||
@ -1334,8 +1357,8 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
String cast = String.format(MySQLConstants.CAST, originName, MySQLConstants.DEFAULT_INT_FORMAT) + "/1000";
|
||||
if (StringUtils.equalsIgnoreCase(request.getDateStyle(), "y_Q")) {
|
||||
whereName = String.format(format,
|
||||
String.format(MysqlConstants.DATE_FORMAT, cast, "%Y"),
|
||||
String.format(MysqlConstants.QUARTER, String.format(MysqlConstants.DATE_FORMAT, field, MysqlConstants.DEFAULT_DATE_FORMAT)));
|
||||
String.format(MySQLConstants.DATE_FORMAT, cast, "%Y"),
|
||||
String.format(MySQLConstants.QUARTER, String.format(MySQLConstants.DATE_FORMAT, field, MySQLConstants.DEFAULT_DATE_FORMAT)));
|
||||
} else {
|
||||
whereName = String.format(MySQLConstants.FROM_UNIXTIME, cast, format);
|
||||
}
|
||||
@ -1380,7 +1403,7 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
String endTime = simpleDateFormat.format(new Date(Long.parseLong(value.get(1))));
|
||||
whereValue = String.format(MySQLConstants.WHERE_BETWEEN, startTime, endTime);
|
||||
} else {
|
||||
whereValue = String.format(MysqlConstants.WHERE_BETWEEN, value.get(0), value.get(1));
|
||||
whereValue = String.format(MySQLConstants.WHERE_BETWEEN, value.get(0), value.get(1));
|
||||
}
|
||||
} else {
|
||||
whereValue = String.format(MySQLConstants.WHERE_BETWEEN, value.get(0), value.get(1));
|
||||
@ -1479,10 +1502,10 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
if (x.getDeExtractType() == 0) {
|
||||
if (StringUtils.equalsIgnoreCase(x.getDateStyle(), "y_Q")) {
|
||||
fieldName = String.format(format,
|
||||
String.format(MysqlConstants.DATE_FORMAT, String.format(MySQLConstants.STR_TO_DATE, originField, StringUtils.isNotEmpty(x.getDateFormat()) ? x.getDateFormat() : MysqlConstants.DEFAULT_DATE_FORMAT), "%Y"),
|
||||
String.format(MysqlConstants.QUARTER, String.format(MySQLConstants.STR_TO_DATE, originField, StringUtils.isNotEmpty(x.getDateFormat()) ? x.getDateFormat() : MysqlConstants.DEFAULT_DATE_FORMAT)));
|
||||
String.format(MySQLConstants.DATE_FORMAT, String.format(MySQLConstants.STR_TO_DATE, originField, StringUtils.isNotEmpty(x.getDateFormat()) ? x.getDateFormat() : MySQLConstants.DEFAULT_DATE_FORMAT), "%Y"),
|
||||
String.format(MySQLConstants.QUARTER, String.format(MySQLConstants.STR_TO_DATE, originField, StringUtils.isNotEmpty(x.getDateFormat()) ? x.getDateFormat() : MySQLConstants.DEFAULT_DATE_FORMAT)));
|
||||
} else {
|
||||
fieldName = String.format(MySQLConstants.DATE_FORMAT, String.format(MySQLConstants.STR_TO_DATE, originField, StringUtils.isNotEmpty(x.getDateFormat()) ? x.getDateFormat() : MysqlConstants.DEFAULT_DATE_FORMAT), format);
|
||||
fieldName = String.format(MySQLConstants.DATE_FORMAT, String.format(MySQLConstants.STR_TO_DATE, originField, StringUtils.isNotEmpty(x.getDateFormat()) ? x.getDateFormat() : MySQLConstants.DEFAULT_DATE_FORMAT), format);
|
||||
}
|
||||
} else {
|
||||
String cast = String.format(MySQLConstants.CAST, originField, MySQLConstants.DEFAULT_INT_FORMAT) + "/1000";
|
||||
|
||||
@ -830,11 +830,38 @@ public class OracleQueryProvider extends QueryProvider {
|
||||
|
||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||
List<String> yWheres = new ArrayList<>();
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
ChartViewFieldDTO x = xAxis.get(i);
|
||||
String originField;
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(x.getGroupType(), "q")) {
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||
originField = String.format(OracleConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
} else {
|
||||
originField = String.format(OracleConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
}
|
||||
String fieldAlias = String.format(OracleConstants.ALIAS_FIX, String.format(SQLConstants.FIELD_ALIAS_Y_PREFIX, i));
|
||||
// 处理纵轴字段
|
||||
yFields.add(getYFields(x, originField, fieldAlias));
|
||||
// 处理纵轴过滤
|
||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||
// 处理纵轴排序
|
||||
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
||||
yOrders.add(SQLObj.builder()
|
||||
.orderField(originField)
|
||||
.orderAlias(fieldAlias)
|
||||
.orderDirection(x.getSort())
|
||||
.build());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
@ -872,7 +899,7 @@ public class OracleQueryProvider extends QueryProvider {
|
||||
}
|
||||
}
|
||||
}
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
|
||||
// 处理视图中字段过滤
|
||||
String customWheres = transChartFilterTrees(tableObj, fieldCustomFilter);
|
||||
|
||||
@ -183,8 +183,13 @@ public class PgQueryProvider extends QueryProvider {
|
||||
String whereTrees = transFilterTrees(tableObj, rowPermissionsTree);
|
||||
List<String> wheres = new ArrayList<>();
|
||||
if (customWheres != null) wheres.add(customWheres);
|
||||
if (StringUtils.isNotBlank(keyword)) {
|
||||
String keyWhere = "(" + transKeywordFilterList(tableObj, xFields, keyword) + ")";
|
||||
if (StringUtils.isNotBlank(keyword) && CollectionUtils.isNotEmpty(xFields)) {
|
||||
List<SQLObj> formatFields = xFields.stream().peek(f -> {
|
||||
String fieldOriginName = f.getFieldOriginName();
|
||||
String format = String.format(PgConstants.CAST, fieldOriginName, "VARCHAR");
|
||||
f.setFieldOriginName(format);
|
||||
}).collect(Collectors.toList());
|
||||
String keyWhere = "(" + transKeywordFilterList(tableObj, formatFields, keyword) + ")";
|
||||
wheres.add(keyWhere);
|
||||
}
|
||||
if (whereTrees != null) wheres.add(whereTrees);
|
||||
@ -754,11 +759,38 @@ public class PgQueryProvider extends QueryProvider {
|
||||
|
||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||
List<String> yWheres = new ArrayList<>();
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
ChartViewFieldDTO x = xAxis.get(i);
|
||||
String originField;
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(x.getGroupType(), "q")) {
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
} else {
|
||||
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_Y_PREFIX, i);
|
||||
// 处理纵轴字段
|
||||
yFields.add(getYFields(x, originField, fieldAlias));
|
||||
// 处理纵轴过滤
|
||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||
// 处理纵轴排序
|
||||
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
||||
yOrders.add(SQLObj.builder()
|
||||
.orderField(originField)
|
||||
.orderAlias(fieldAlias)
|
||||
.orderDirection(x.getSort())
|
||||
.build());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
@ -796,7 +828,6 @@ public class PgQueryProvider extends QueryProvider {
|
||||
}
|
||||
}
|
||||
}
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
// 处理视图中字段过滤
|
||||
String customWheres = transChartFilterTrees(tableObj, fieldCustomFilter);
|
||||
|
||||
@ -760,11 +760,38 @@ public class RedshiftQueryProvider extends QueryProvider {
|
||||
|
||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||
List<String> yWheres = new ArrayList<>();
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
ChartViewFieldDTO x = xAxis.get(i);
|
||||
String originField;
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(x.getGroupType(), "q")) {
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
} else {
|
||||
originField = String.format(PgConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_Y_PREFIX, i);
|
||||
// 处理纵轴字段
|
||||
yFields.add(getYFields(x, originField, fieldAlias));
|
||||
// 处理纵轴过滤
|
||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||
// 处理纵轴排序
|
||||
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
||||
yOrders.add(SQLObj.builder()
|
||||
.orderField(originField)
|
||||
.orderAlias(fieldAlias)
|
||||
.orderDirection(x.getSort())
|
||||
.build());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
@ -802,7 +829,7 @@ public class RedshiftQueryProvider extends QueryProvider {
|
||||
}
|
||||
}
|
||||
}
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
|
||||
// 处理视图中字段过滤
|
||||
String customWheres = transChartFilterTrees(tableObj, fieldCustomFilter);
|
||||
|
||||
@ -436,10 +436,10 @@ public class SqlserverQueryProvider extends QueryProvider {
|
||||
|
||||
@Override
|
||||
public String getSQLTableInfo(String table, List<ChartViewFieldDTO> xAxis, FilterTreeObj fieldCustomFilter, List<DataSetRowPermissionsTreeDTO> rowPermissionsTree, List<ChartExtFilterRequest> extFilterRequestList, Datasource ds, ChartViewWithBLOBs view) {
|
||||
return originTableInfo(table, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, true);
|
||||
return originTableInfo(table, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, true, true);
|
||||
}
|
||||
|
||||
public String originTableInfo(String table, List<ChartViewFieldDTO> xAxis, FilterTreeObj fieldCustomFilter, List<DataSetRowPermissionsTreeDTO> rowPermissionsTree, List<ChartExtFilterRequest> extFilterRequestList, Datasource ds, ChartViewWithBLOBs view, boolean needOrder) {
|
||||
public String originTableInfo(String table, List<ChartViewFieldDTO> xAxis, FilterTreeObj fieldCustomFilter, List<DataSetRowPermissionsTreeDTO> rowPermissionsTree, List<ChartExtFilterRequest> extFilterRequestList, Datasource ds, ChartViewWithBLOBs view, boolean needOrder, boolean needResultCount) {
|
||||
SQLObj tableObj = SQLObj.builder()
|
||||
.tableName((table.startsWith("(") && table.endsWith(")")) ? table : String.format(SqlServerSQLConstants.KEYWORD_TABLE, table))
|
||||
.tableAlias(String.format(TABLE_ALIAS_PREFIX, 0))
|
||||
@ -518,7 +518,7 @@ public class SqlserverQueryProvider extends QueryProvider {
|
||||
.build();
|
||||
if (CollectionUtils.isNotEmpty(orders)) st.add("orders", orders);
|
||||
if (ObjectUtils.isNotEmpty(tableSQL)) st.add("table", tableSQL);
|
||||
if (StringUtils.equalsIgnoreCase(view.getResultMode(), "custom")) {
|
||||
if (StringUtils.equalsIgnoreCase(view.getResultMode(), "custom") && needResultCount) {
|
||||
SQLObj limitFiled = SQLObj.builder().limitFiled("top " + view.getResultCount() + " ").build();
|
||||
st.add("limitFiled", limitFiled);
|
||||
}
|
||||
@ -526,16 +526,17 @@ public class SqlserverQueryProvider extends QueryProvider {
|
||||
}
|
||||
|
||||
public String originSQLAsTmpTableInfo(String sql, List<ChartViewFieldDTO> xAxis, FilterTreeObj fieldCustomFilter, List<DataSetRowPermissionsTreeDTO> rowPermissionsTree, List<ChartExtFilterRequest> extFilterRequestList, Datasource ds, ChartViewWithBLOBs view, boolean needOrder) {
|
||||
return originTableInfo("(" + sqlFix(sql) + ")", xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, null, view, needOrder);
|
||||
return originTableInfo("(" + sqlFix(sql) + ")", xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, null, view, needOrder, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSQLWithPage(boolean isTable, String sql, List<ChartViewFieldDTO> xAxis, FilterTreeObj fieldCustomFilter, List<DataSetRowPermissionsTreeDTO> rowPermissionsTree, List<ChartExtFilterRequest> extFilterRequestList, Datasource ds, ChartViewWithBLOBs view, PageInfo pageInfo) {
|
||||
String limit = ((pageInfo.getGoPage() != null && pageInfo.getPageSize() != null) ? " OFFSET " + (pageInfo.getGoPage() - 1) * pageInfo.getPageSize() + " ROW FETCH NEXT " + pageInfo.getPageSize() + " ROW ONLY " : "");
|
||||
boolean isPage = (pageInfo.getGoPage() != null && pageInfo.getPageSize() != null);
|
||||
String limit = (isPage ? " OFFSET " + (pageInfo.getGoPage() - 1) * pageInfo.getPageSize() + " ROW FETCH NEXT " + pageInfo.getPageSize() + " ROW ONLY " : "");
|
||||
if (isTable) {
|
||||
return getSQLTableInfo(sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view) + limit;
|
||||
return originTableInfo(sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, true, !isPage) + limit;
|
||||
} else {
|
||||
return getSQLTableInfo("(" + sqlFix(sql) + ")", xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view) + limit;
|
||||
return originTableInfo("(" + sqlFix(sql) + ")", xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, true, !isPage) + limit;
|
||||
}
|
||||
}
|
||||
|
||||
@ -838,11 +839,38 @@ public class SqlserverQueryProvider extends QueryProvider {
|
||||
|
||||
List<SQLObj> yFields = new ArrayList<>(); // 要把两个时间字段放进y里面
|
||||
List<String> yWheres = new ArrayList<>();
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
if (CollectionUtils.isNotEmpty(xAxis)) {
|
||||
for (int i = 0; i < xAxis.size(); i++) {
|
||||
ChartViewFieldDTO x = xAxis.get(i);
|
||||
String originField;
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(x.getGroupType(), "q")) {
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
} else if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 1) {
|
||||
originField = String.format(SqlServerSQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
} else {
|
||||
originField = String.format(SqlServerSQLConstants.KEYWORD_FIX, tableObj.getTableAlias(), x.getOriginName());
|
||||
}
|
||||
String fieldAlias = String.format(SQLConstants.FIELD_ALIAS_Y_PREFIX, i);
|
||||
// 处理纵轴字段
|
||||
yFields.add(getYFields(x, originField, fieldAlias));
|
||||
// 处理纵轴过滤
|
||||
yWheres.add(getYWheres(x, originField, fieldAlias));
|
||||
// 处理纵轴排序
|
||||
if (StringUtils.isNotEmpty(x.getSort()) && Utils.joinSort(x.getSort())) {
|
||||
yOrders.add(SQLObj.builder()
|
||||
.orderField(originField)
|
||||
.orderAlias(fieldAlias)
|
||||
.orderDirection(x.getSort())
|
||||
.build());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ObjectUtils.isNotEmpty(x.getExtField()) && x.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
originField = calcFieldRegex(x.getOriginName(), tableObj);
|
||||
@ -880,7 +908,7 @@ public class SqlserverQueryProvider extends QueryProvider {
|
||||
}
|
||||
}
|
||||
}
|
||||
List<SQLObj> yOrders = new ArrayList<>();
|
||||
|
||||
|
||||
// 处理视图中字段过滤
|
||||
String customWheres = transChartFilterTrees(tableObj, fieldCustomFilter);
|
||||
@ -1450,7 +1478,7 @@ public class SqlserverQueryProvider extends QueryProvider {
|
||||
String whereValue = "";
|
||||
|
||||
if (StringUtils.containsIgnoreCase(request.getOperator(), "in")) {
|
||||
if ((request.getDatasetTableField() != null && request.getDatasetTableField().getType().equalsIgnoreCase("NVARCHAR")) || (request.getDatasetTableFieldList() != null && request.getDatasetTableFieldList().stream().map(DatasetTableField::getType).collect(Collectors.toList()).contains("nvarchar"))) {
|
||||
if ((request.getDatasetTableField() != null && request.getDatasetTableField().getType().equalsIgnoreCase("NVARCHAR")) || (request.getDatasetTableFieldList() != null && request.getDatasetTableFieldList().stream().map(DatasetTableField::getType).collect(Collectors.toList()).contains("nvarchar"))) {
|
||||
whereValue = "(" + value.stream().map(str -> {
|
||||
return "N" + "'" + str + "'";
|
||||
}).collect(Collectors.joining(",")) + ")";
|
||||
@ -1472,7 +1500,7 @@ public class SqlserverQueryProvider extends QueryProvider {
|
||||
}
|
||||
} else {
|
||||
|
||||
if ((request.getDatasetTableField() != null && request.getDatasetTableField().getType().equalsIgnoreCase("NVARCHAR")) || (request.getDatasetTableFieldList() != null && request.getDatasetTableFieldList().stream().map(DatasetTableField::getType).collect(Collectors.toList()).contains("nvarchar"))) {
|
||||
if ((request.getDatasetTableField() != null && request.getDatasetTableField().getType().equalsIgnoreCase("NVARCHAR")) || (request.getDatasetTableFieldList() != null && request.getDatasetTableFieldList().stream().map(DatasetTableField::getType).collect(Collectors.toList()).contains("nvarchar"))) {
|
||||
whereValue = String.format(SqlServerSQLConstants.WHERE_VALUE_VALUE_CH, value.get(0));
|
||||
} else {
|
||||
whereValue = String.format(SqlServerSQLConstants.WHERE_VALUE_VALUE, value.get(0));
|
||||
@ -1738,7 +1766,7 @@ public class SqlserverQueryProvider extends QueryProvider {
|
||||
@Override
|
||||
public String getResultCount(boolean isTable, String sql, List<ChartViewFieldDTO> xAxis, FilterTreeObj fieldCustomFilter, List<DataSetRowPermissionsTreeDTO> rowPermissionsTree, List<ChartExtFilterRequest> extFilterRequestList, Datasource ds, ChartViewWithBLOBs view) {
|
||||
if (isTable) {
|
||||
return "SELECT COUNT(*) AS count from (" + originTableInfo(sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, false) + ") COUNT_TEMP";
|
||||
return "SELECT COUNT(*) AS count from (" + originTableInfo(sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, false, true) + ") COUNT_TEMP";
|
||||
} else {
|
||||
return "SELECT COUNT(*) AS count from (" + originSQLAsTmpTableInfo(sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterRequestList, ds, view, false) + ") COUNT_TEMP";
|
||||
}
|
||||
|
||||
@ -52,87 +52,20 @@ public class ChartViewOldDataMergeService {
|
||||
for (ChartViewWithBLOBs view : chartViewWithBLOBs) {
|
||||
Type filterTokenType = new TypeToken<List<ChartFieldCustomFilterDTO>>() {
|
||||
}.getType();
|
||||
List<ChartFieldCustomFilterDTO> fieldCustomFilter = gson.fromJson(view.getCustomFilter(), filterTokenType);
|
||||
List<ChartFieldCustomFilterDTO> fieldCustomFilter;
|
||||
// 尝试将历史数据转成list,如果转换出现异常,则忽略该视图继续执行下一个
|
||||
try {
|
||||
fieldCustomFilter = gson.fromJson(view.getCustomFilter(), filterTokenType);
|
||||
} catch (Exception e) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (CollectionUtils.isEmpty(fieldCustomFilter)) {
|
||||
// 将 '[]' 转换成 '{}'
|
||||
view.setCustomFilter("{}");
|
||||
} else {
|
||||
FilterTreeObj tree = new FilterTreeObj();
|
||||
tree.setItems(new ArrayList<>());
|
||||
if (fieldCustomFilter.size() == 1) {
|
||||
ChartFieldCustomFilterDTO filterDTO = fieldCustomFilter.get(0);
|
||||
tree.setLogic(filterDTO.getLogic());
|
||||
if (StringUtils.equalsIgnoreCase(filterDTO.getFilterType(), "enum")) {
|
||||
FilterTreeItem item = new FilterTreeItem();
|
||||
item.setType("item");
|
||||
item.setFieldId(filterDTO.getId());
|
||||
item.setFilterType(filterDTO.getFilterType());
|
||||
item.setEnumValue(filterDTO.getEnumCheckField());
|
||||
tree.getItems().add(item);
|
||||
} else {
|
||||
List<ChartCustomFilterItemDTO> filter = filterDTO.getFilter();
|
||||
if (CollectionUtils.isEmpty(filter)) {
|
||||
continue;
|
||||
}
|
||||
for (ChartCustomFilterItemDTO f : filter) {
|
||||
FilterTreeItem item = new FilterTreeItem();
|
||||
item.setType("item");
|
||||
item.setFieldId(filterDTO.getId());
|
||||
item.setFilterType(filterDTO.getFilterType());
|
||||
item.setTerm(f.getTerm());
|
||||
item.setValue(f.getValue());
|
||||
item.setEnumValue(new ArrayList<>());
|
||||
tree.getItems().add(item);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
tree.setLogic("and");
|
||||
for (ChartFieldCustomFilterDTO dto : fieldCustomFilter) {
|
||||
if (StringUtils.equalsIgnoreCase(dto.getFilterType(), "enum")) {
|
||||
FilterTreeItem item = new FilterTreeItem();
|
||||
item.setType("item");
|
||||
item.setFieldId(dto.getId());
|
||||
item.setFilterType(dto.getFilterType());
|
||||
item.setEnumValue(dto.getEnumCheckField());
|
||||
tree.getItems().add(item);
|
||||
} else {
|
||||
List<ChartCustomFilterItemDTO> filter = dto.getFilter();
|
||||
if (CollectionUtils.isEmpty(filter)) {
|
||||
continue;
|
||||
}
|
||||
if (filter.size() == 1) {
|
||||
ChartCustomFilterItemDTO f = filter.get(0);
|
||||
FilterTreeItem item = new FilterTreeItem();
|
||||
item.setType("item");
|
||||
item.setFieldId(dto.getId());
|
||||
item.setFilterType(dto.getFilterType());
|
||||
item.setTerm(f.getTerm());
|
||||
item.setValue(f.getValue());
|
||||
item.setEnumValue(new ArrayList<>());
|
||||
tree.getItems().add(item);
|
||||
} else {
|
||||
FilterTreeItem item = new FilterTreeItem();
|
||||
item.setType("tree");
|
||||
item.setEnumValue(new ArrayList<>());
|
||||
FilterTreeObj subTree = new FilterTreeObj();
|
||||
subTree.setLogic(dto.getLogic());
|
||||
subTree.setItems(new ArrayList<>());
|
||||
for (ChartCustomFilterItemDTO f : filter) {
|
||||
FilterTreeItem itemTree = new FilterTreeItem();
|
||||
itemTree.setType("item");
|
||||
itemTree.setFieldId(dto.getId());
|
||||
itemTree.setFilterType(dto.getFilterType());
|
||||
itemTree.setTerm(f.getTerm());
|
||||
itemTree.setValue(f.getValue());
|
||||
itemTree.setEnumValue(new ArrayList<>());
|
||||
subTree.getItems().add(itemTree);
|
||||
}
|
||||
item.setSubTree(subTree);
|
||||
tree.getItems().add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// array -> tree
|
||||
FilterTreeObj tree = transArr2Obj(fieldCustomFilter);
|
||||
view.setCustomFilter(gson.toJson(tree));
|
||||
}
|
||||
|
||||
@ -160,87 +93,21 @@ public class ChartViewOldDataMergeService {
|
||||
for (ChartViewCacheWithBLOBs view : chartViewWithBLOBs) {
|
||||
Type filterTokenType = new TypeToken<List<ChartFieldCustomFilterDTO>>() {
|
||||
}.getType();
|
||||
List<ChartFieldCustomFilterDTO> fieldCustomFilter = gson.fromJson(view.getCustomFilter(), filterTokenType);
|
||||
|
||||
List<ChartFieldCustomFilterDTO> fieldCustomFilter;
|
||||
// 尝试将历史数据转成list,如果转换出现异常,则忽略该视图继续执行下一个
|
||||
try {
|
||||
fieldCustomFilter = gson.fromJson(view.getCustomFilter(), filterTokenType);
|
||||
} catch (Exception e) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (CollectionUtils.isEmpty(fieldCustomFilter)) {
|
||||
// 将 '[]' 转换成 '{}'
|
||||
view.setCustomFilter("{}");
|
||||
} else {
|
||||
FilterTreeObj tree = new FilterTreeObj();
|
||||
tree.setItems(new ArrayList<>());
|
||||
if (fieldCustomFilter.size() == 1) {
|
||||
ChartFieldCustomFilterDTO filterDTO = fieldCustomFilter.get(0);
|
||||
tree.setLogic(filterDTO.getLogic());
|
||||
if (StringUtils.equalsIgnoreCase(filterDTO.getFilterType(), "enum")) {
|
||||
FilterTreeItem item = new FilterTreeItem();
|
||||
item.setType("item");
|
||||
item.setFieldId(filterDTO.getId());
|
||||
item.setFilterType(filterDTO.getFilterType());
|
||||
item.setEnumValue(filterDTO.getEnumCheckField());
|
||||
tree.getItems().add(item);
|
||||
} else {
|
||||
List<ChartCustomFilterItemDTO> filter = filterDTO.getFilter();
|
||||
if (CollectionUtils.isEmpty(filter)) {
|
||||
continue;
|
||||
}
|
||||
for (ChartCustomFilterItemDTO f : filter) {
|
||||
FilterTreeItem item = new FilterTreeItem();
|
||||
item.setType("item");
|
||||
item.setFieldId(filterDTO.getId());
|
||||
item.setFilterType(filterDTO.getFilterType());
|
||||
item.setTerm(f.getTerm());
|
||||
item.setValue(f.getValue());
|
||||
item.setEnumValue(new ArrayList<>());
|
||||
tree.getItems().add(item);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
tree.setLogic("and");
|
||||
for (ChartFieldCustomFilterDTO dto : fieldCustomFilter) {
|
||||
if (StringUtils.equalsIgnoreCase(dto.getFilterType(), "enum")) {
|
||||
FilterTreeItem item = new FilterTreeItem();
|
||||
item.setType("item");
|
||||
item.setFieldId(dto.getId());
|
||||
item.setFilterType(dto.getFilterType());
|
||||
item.setEnumValue(dto.getEnumCheckField());
|
||||
tree.getItems().add(item);
|
||||
} else {
|
||||
List<ChartCustomFilterItemDTO> filter = dto.getFilter();
|
||||
if (CollectionUtils.isEmpty(filter)) {
|
||||
continue;
|
||||
}
|
||||
if (filter.size() == 1) {
|
||||
ChartCustomFilterItemDTO f = filter.get(0);
|
||||
FilterTreeItem item = new FilterTreeItem();
|
||||
item.setType("item");
|
||||
item.setFieldId(dto.getId());
|
||||
item.setFilterType(dto.getFilterType());
|
||||
item.setTerm(f.getTerm());
|
||||
item.setValue(f.getValue());
|
||||
item.setEnumValue(new ArrayList<>());
|
||||
tree.getItems().add(item);
|
||||
} else {
|
||||
FilterTreeItem item = new FilterTreeItem();
|
||||
item.setType("tree");
|
||||
item.setEnumValue(new ArrayList<>());
|
||||
FilterTreeObj subTree = new FilterTreeObj();
|
||||
subTree.setLogic(dto.getLogic());
|
||||
subTree.setItems(new ArrayList<>());
|
||||
for (ChartCustomFilterItemDTO f : filter) {
|
||||
FilterTreeItem itemTree = new FilterTreeItem();
|
||||
itemTree.setType("item");
|
||||
itemTree.setFieldId(dto.getId());
|
||||
itemTree.setFilterType(dto.getFilterType());
|
||||
itemTree.setTerm(f.getTerm());
|
||||
itemTree.setValue(f.getValue());
|
||||
itemTree.setEnumValue(new ArrayList<>());
|
||||
subTree.getItems().add(itemTree);
|
||||
}
|
||||
item.setSubTree(subTree);
|
||||
tree.getItems().add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// array -> tree
|
||||
FilterTreeObj tree = transArr2Obj(fieldCustomFilter);
|
||||
view.setCustomFilter(gson.toJson(tree));
|
||||
}
|
||||
|
||||
@ -252,4 +119,82 @@ public class ChartViewOldDataMergeService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public FilterTreeObj transArr2Obj(List<ChartFieldCustomFilterDTO> fieldCustomFilter) {
|
||||
FilterTreeObj tree = new FilterTreeObj();
|
||||
tree.setItems(new ArrayList<>());
|
||||
if (fieldCustomFilter.size() == 1) {
|
||||
ChartFieldCustomFilterDTO filterDTO = fieldCustomFilter.get(0);
|
||||
tree.setLogic(filterDTO.getLogic());
|
||||
if (StringUtils.equalsIgnoreCase(filterDTO.getFilterType(), "enum")) {
|
||||
FilterTreeItem item = new FilterTreeItem();
|
||||
item.setType("item");
|
||||
item.setFieldId(filterDTO.getId());
|
||||
item.setFilterType(filterDTO.getFilterType());
|
||||
item.setEnumValue(filterDTO.getEnumCheckField());
|
||||
tree.getItems().add(item);
|
||||
} else {
|
||||
List<ChartCustomFilterItemDTO> filter = filterDTO.getFilter();
|
||||
if (CollectionUtils.isNotEmpty(filter)) {
|
||||
for (ChartCustomFilterItemDTO f : filter) {
|
||||
FilterTreeItem item = new FilterTreeItem();
|
||||
item.setType("item");
|
||||
item.setFieldId(filterDTO.getId());
|
||||
item.setFilterType(filterDTO.getFilterType());
|
||||
item.setTerm(f.getTerm());
|
||||
item.setValue(f.getValue());
|
||||
item.setEnumValue(new ArrayList<>());
|
||||
tree.getItems().add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
tree.setLogic("and");
|
||||
for (ChartFieldCustomFilterDTO dto : fieldCustomFilter) {
|
||||
if (StringUtils.equalsIgnoreCase(dto.getFilterType(), "enum")) {
|
||||
FilterTreeItem item = new FilterTreeItem();
|
||||
item.setType("item");
|
||||
item.setFieldId(dto.getId());
|
||||
item.setFilterType(dto.getFilterType());
|
||||
item.setEnumValue(dto.getEnumCheckField());
|
||||
tree.getItems().add(item);
|
||||
} else {
|
||||
List<ChartCustomFilterItemDTO> filter = dto.getFilter();
|
||||
if (CollectionUtils.isNotEmpty(filter)) {
|
||||
if (filter.size() == 1) {
|
||||
ChartCustomFilterItemDTO f = filter.get(0);
|
||||
FilterTreeItem item = new FilterTreeItem();
|
||||
item.setType("item");
|
||||
item.setFieldId(dto.getId());
|
||||
item.setFilterType(dto.getFilterType());
|
||||
item.setTerm(f.getTerm());
|
||||
item.setValue(f.getValue());
|
||||
item.setEnumValue(new ArrayList<>());
|
||||
tree.getItems().add(item);
|
||||
} else {
|
||||
FilterTreeItem item = new FilterTreeItem();
|
||||
item.setType("tree");
|
||||
item.setEnumValue(new ArrayList<>());
|
||||
FilterTreeObj subTree = new FilterTreeObj();
|
||||
subTree.setLogic(dto.getLogic());
|
||||
subTree.setItems(new ArrayList<>());
|
||||
for (ChartCustomFilterItemDTO f : filter) {
|
||||
FilterTreeItem itemTree = new FilterTreeItem();
|
||||
itemTree.setType("item");
|
||||
itemTree.setFieldId(dto.getId());
|
||||
itemTree.setFilterType(dto.getFilterType());
|
||||
itemTree.setTerm(f.getTerm());
|
||||
itemTree.setValue(f.getValue());
|
||||
itemTree.setEnumValue(new ArrayList<>());
|
||||
subTree.getItems().add(itemTree);
|
||||
}
|
||||
item.setSubTree(subTree);
|
||||
tree.getItems().add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,6 +34,7 @@ import io.dataease.plugins.common.constants.DatasetType;
|
||||
import io.dataease.plugins.common.constants.DatasourceTypes;
|
||||
import io.dataease.plugins.common.constants.datasource.SQLConstants;
|
||||
import io.dataease.plugins.common.dto.chart.ChartFieldCompareDTO;
|
||||
import io.dataease.plugins.common.dto.chart.ChartFieldCustomFilterDTO;
|
||||
import io.dataease.plugins.common.dto.chart.ChartViewFieldDTO;
|
||||
import io.dataease.plugins.common.dto.dataset.SqlVariableDetails;
|
||||
import io.dataease.plugins.common.exception.DataEaseException;
|
||||
@ -123,6 +124,8 @@ public class ChartViewService {
|
||||
private DatasetTableFieldMapper datasetTableFieldMapper;
|
||||
@Resource
|
||||
private ChartFilterTreeService chartFilterTreeService;
|
||||
@Resource
|
||||
private ChartViewOldDataMergeService chartViewOldDataMergeService;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ChartViewService.class);
|
||||
|
||||
@ -284,6 +287,9 @@ public class ChartViewService {
|
||||
if (result == null) {
|
||||
DataEaseException.throwException(Translator.get("i18n_chart_delete"));
|
||||
}
|
||||
// trans chart filter
|
||||
tranChartFilter(result);
|
||||
|
||||
DatasetTable datasetTable = dataSetTableService.get(result.getTableId());
|
||||
if (ObjectUtils.isNotEmpty(datasetTable)) {
|
||||
result.setDatasetMode(datasetTable.getMode());
|
||||
@ -344,7 +350,9 @@ public class ChartViewService {
|
||||
}
|
||||
List<ChartViewFieldDTO> xAxis = gson.fromJson(view.getXAxis(), new TypeToken<List<ChartViewFieldDTO>>() {
|
||||
}.getType());
|
||||
if (StringUtils.equalsIgnoreCase(view.getType(), "table-pivot") || StringUtils.equalsIgnoreCase(view.getType(), "bar-time-range")) {
|
||||
if (StringUtils.equalsAnyIgnoreCase(view.getType(), "table-pivot", "bar-time-range")
|
||||
|| StringUtils.containsIgnoreCase(view.getType(), "group")
|
||||
|| ("antv".equalsIgnoreCase(view.getRender()) && "line".equalsIgnoreCase(view.getType()))) {
|
||||
List<ChartViewFieldDTO> xAxisExt = gson.fromJson(view.getXAxisExt(), new TypeToken<List<ChartViewFieldDTO>>() {
|
||||
}.getType());
|
||||
xAxis.addAll(xAxisExt);
|
||||
@ -402,7 +410,7 @@ public class ChartViewService {
|
||||
|
||||
switch (view.getType()) {
|
||||
case "label":
|
||||
xAxis = xAxis.stream().filter(item -> !desensitizationList.keySet().contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName())).collect(Collectors.toList());
|
||||
xAxis = xAxis.stream().filter(item -> !desensitizationList.containsKey(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName())).collect(Collectors.toList());
|
||||
yAxis = new ArrayList<>();
|
||||
if (CollectionUtils.isEmpty(xAxis)) {
|
||||
return new ArrayList<String[]>();
|
||||
@ -412,7 +420,7 @@ public class ChartViewService {
|
||||
case "gauge":
|
||||
case "liquid":
|
||||
xAxis = new ArrayList<>();
|
||||
yAxis = yAxis.stream().filter(item -> !desensitizationList.keySet().contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName())).collect(Collectors.toList());
|
||||
yAxis = yAxis.stream().filter(item -> !desensitizationList.containsKey(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName())).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(yAxis)) {
|
||||
return new ArrayList<String[]>();
|
||||
}
|
||||
@ -429,8 +437,8 @@ public class ChartViewService {
|
||||
yAxis = yAxis.stream().filter(item -> dataeaseNames.contains(item.getDataeaseName())).collect(Collectors.toList());
|
||||
break;
|
||||
default:
|
||||
xAxis = xAxis.stream().filter(item -> !desensitizationList.keySet().contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName())).collect(Collectors.toList());
|
||||
yAxis = yAxis.stream().filter(item -> !desensitizationList.keySet().contains(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName())).collect(Collectors.toList());
|
||||
xAxis = xAxis.stream().filter(item -> !desensitizationList.containsKey(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName())).collect(Collectors.toList());
|
||||
yAxis = yAxis.stream().filter(item -> !desensitizationList.containsKey(item.getDataeaseName()) && dataeaseNames.contains(item.getDataeaseName())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
List<ChartExtFilterRequest> extFilterList = new ArrayList<>();
|
||||
@ -520,7 +528,7 @@ public class ChartViewService {
|
||||
} else if (StringUtils.equalsIgnoreCase("bar-time-range", view.getType())) {
|
||||
List<ChartViewFieldDTO> xAxisBase = gson.fromJson(view.getXAxis(), new TypeToken<List<ChartViewFieldDTO>>() {
|
||||
}.getType());
|
||||
datasourceRequest.setQuery(qp.getSQLAsTmpRangeBar(dataTableInfoDTO.getTable(), xAxisBase, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extStack, view));
|
||||
datasourceRequest.setQuery(qp.getSQLAsTmpRangeBar(sql, xAxisBase, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extStack, view));
|
||||
|
||||
} else {
|
||||
datasourceRequest.setQuery(qp.getSQLAsTmp(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, view));
|
||||
@ -537,12 +545,12 @@ public class ChartViewService {
|
||||
datasourceRequest.setQuery(qp.getSQLAsTmpScatter(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extBubble, extStack, view));
|
||||
} else if (StringUtils.equalsIgnoreCase("table-info", view.getType())) {
|
||||
datasourceRequest.setQuery(qp.getSQLAsTmpTableInfo(sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, ds, view));
|
||||
}else if (StringUtils.equalsIgnoreCase("bar-time-range", view.getType())) {
|
||||
} else if (StringUtils.equalsIgnoreCase("bar-time-range", view.getType())) {
|
||||
List<ChartViewFieldDTO> xAxisBase = gson.fromJson(view.getXAxis(), new TypeToken<List<ChartViewFieldDTO>>() {
|
||||
}.getType());
|
||||
datasourceRequest.setQuery(qp.getSQLAsTmpRangeBar(dataTableInfoDTO.getTable(), xAxisBase, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extStack, view));
|
||||
datasourceRequest.setQuery(qp.getSQLAsTmpRangeBar(sql, xAxisBase, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extStack, view));
|
||||
|
||||
} else {
|
||||
} else {
|
||||
datasourceRequest.setQuery(qp.getSQLAsTmp(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, view));
|
||||
}
|
||||
} else if (StringUtils.equalsIgnoreCase(table.getType(), DatasetType.UNION.name())) {
|
||||
@ -561,7 +569,7 @@ public class ChartViewService {
|
||||
} else if (StringUtils.equalsIgnoreCase("bar-time-range", view.getType())) {
|
||||
List<ChartViewFieldDTO> xAxisBase = gson.fromJson(view.getXAxis(), new TypeToken<List<ChartViewFieldDTO>>() {
|
||||
}.getType());
|
||||
datasourceRequest.setQuery(qp.getSQLAsTmpRangeBar(dataTableInfoDTO.getTable(), xAxisBase, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extStack, view));
|
||||
datasourceRequest.setQuery(qp.getSQLAsTmpRangeBar(sql, xAxisBase, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extStack, view));
|
||||
|
||||
} else {
|
||||
datasourceRequest.setQuery(qp.getSQLAsTmp(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, view));
|
||||
@ -1153,7 +1161,7 @@ public class ChartViewService {
|
||||
totalPageSql = qp.getResultCount(false, sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, ds, view);
|
||||
} else if (StringUtils.equalsIgnoreCase("bar-time-range", view.getType())) {
|
||||
|
||||
querySql = qp.getSQLAsTmpRangeBar(dataTableInfoDTO.getTable(), xAxisBase, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extStack, view);
|
||||
querySql = qp.getSQLAsTmpRangeBar(sql, xAxisBase, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extStack, view);
|
||||
|
||||
} else {
|
||||
querySql = qp.getSQLAsTmp(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, view);
|
||||
@ -1180,7 +1188,7 @@ public class ChartViewService {
|
||||
querySql = qp.getSQLWithPage(false, sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, ds, view, pageInfo);
|
||||
totalPageSql = qp.getResultCount(false, sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, ds, view);
|
||||
} else if (StringUtils.equalsIgnoreCase("bar-time-range", view.getType())) {
|
||||
querySql = qp.getSQLAsTmpRangeBar(dataTableInfoDTO.getTable(), xAxisBase, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extStack, view);
|
||||
querySql = qp.getSQLAsTmpRangeBar(sql, xAxisBase, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extStack, view);
|
||||
|
||||
} else {
|
||||
querySql = qp.getSQLAsTmp(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, view);
|
||||
@ -1208,7 +1216,7 @@ public class ChartViewService {
|
||||
totalPageSql = qp.getResultCount(false, sql, xAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, ds, view);
|
||||
} else if (StringUtils.equalsIgnoreCase("bar-time-range", view.getType())) {
|
||||
|
||||
querySql = qp.getSQLAsTmpRangeBar(dataTableInfoDTO.getTable(), xAxisBase, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extStack, view);
|
||||
querySql = qp.getSQLAsTmpRangeBar(sql, xAxisBase, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extStack, view);
|
||||
|
||||
} else {
|
||||
querySql = qp.getSQLAsTmp(sql, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, view);
|
||||
@ -1268,7 +1276,7 @@ public class ChartViewService {
|
||||
|
||||
datasourceRequest.setQuery(qp.getSQLRangeBar(tableName, xAxisBase, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, extStack, ds, view));
|
||||
|
||||
}else {
|
||||
} else {
|
||||
datasourceRequest.setQuery(qp.getSQL(tableName, xAxis, yAxis, fieldCustomFilter, rowPermissionsTree, extFilterList, ds, view));
|
||||
if (containDetailField(view) && CollectionUtils.isNotEmpty(viewFields)) {
|
||||
detailFieldList.addAll(xAxis);
|
||||
@ -1467,7 +1475,7 @@ public class ChartViewService {
|
||||
} else if (StringUtils.equalsIgnoreCase(view.getType(), "bar-group-stack")) {
|
||||
mapChart = ChartDataBuild.transGroupStackDataAntV(xAxisBase, xAxis, xAxisExt, yAxis, extStack, data, view, isDrill);
|
||||
} else if (StringUtils.equalsIgnoreCase(view.getType(), "bar-time-range")) {
|
||||
mapChart = ChartDataBuild.transTimeBarDataAntV(xAxisBase, xAxis, xAxisExt, yAxis, extStack, data, view, isDrill);
|
||||
mapChart = ChartDataBuild.transTimeBarDataAntV(xAxisBase, xAxis, xAxisExt, yAxis, extStack, data, view, isDrill, drillRequestList);
|
||||
} else if (StringUtils.containsIgnoreCase(view.getType(), "bar-stack")) {
|
||||
mapChart = ChartDataBuild.transStackChartDataAntV(xAxis, yAxis, view, data, extStack, isDrill);
|
||||
} else if (StringUtils.containsIgnoreCase(view.getType(), "line-stack")) {
|
||||
@ -1495,6 +1503,18 @@ public class ChartViewService {
|
||||
if (CollectionUtils.isNotEmpty(detailData)) {
|
||||
mapTableNormal = ChartDataBuild.transTableNormalWithDetail(xAxis, yAxis, data, detailFieldList, detailData, desensitizationList);
|
||||
} else {
|
||||
if (StringUtils.equalsIgnoreCase(view.getType(), "bar-time-range") && CollectionUtils.isNotEmpty(drillRequestList) && CollectionUtils.isNotEmpty(xAxisExt)) { // 针对区间条形图,还需要给xAxis排个序, 把xAxisExt放到最后
|
||||
int count = 0;
|
||||
for (int i = xAxis.size() - drillRequestList.size() - 1; i >= 0; i--) {
|
||||
xAxis.remove(i);
|
||||
count++;
|
||||
if (xAxisExt.size() == count) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
xAxis.addAll(xAxisExt);
|
||||
}
|
||||
|
||||
mapTableNormal = ChartDataBuild.transTableNormal(xAxis, yAxis, view, data, extStack, desensitizationList);
|
||||
}
|
||||
chartViewDTO = uniteViewResult(datasourceRequest.getQuery(), mapChart, mapTableNormal, view, isDrill, drillFilters, dynamicAssistFields, assistData);
|
||||
@ -1913,17 +1933,29 @@ public class ChartViewService {
|
||||
ChartViewDTO view = getOne(id, requestList.getQueryFrom());
|
||||
List<String[]> sqlData = sqlData(view, requestList, cache, fieldId);
|
||||
List<ChartViewFieldDTO> fieldList = new ArrayList<>();
|
||||
if (StringUtils.equalsIgnoreCase(fieldType, "xAxis")) {
|
||||
fieldList = gson.fromJson(view.getXAxis(), new TypeToken<List<ChartViewFieldDTO>>() {
|
||||
}.getType());
|
||||
} else if (StringUtils.equalsIgnoreCase(fieldType, "extStack")) {
|
||||
fieldList = gson.fromJson(view.getExtStack(), new TypeToken<List<ChartViewFieldDTO>>() {
|
||||
}.getType());
|
||||
switch (fieldType) {
|
||||
case "xaxis": {
|
||||
fieldList = gson.fromJson(view.getXAxis(), new TypeToken<List<ChartViewFieldDTO>>() {
|
||||
}.getType());
|
||||
break;
|
||||
}
|
||||
case "extStack": {
|
||||
fieldList = gson.fromJson(view.getExtStack(), new TypeToken<List<ChartViewFieldDTO>>() {
|
||||
}.getType());
|
||||
break;
|
||||
}
|
||||
case "xaxisExt": {
|
||||
fieldList = gson.fromJson(view.getXAxisExt(), new TypeToken<List<ChartViewFieldDTO>>() {
|
||||
}.getType());
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return Collections.emptyList();
|
||||
}
|
||||
DatasetTableField field = dataSetTableFieldsService.get(fieldId);
|
||||
|
||||
List<String> res = new ArrayList<>();
|
||||
if (ObjectUtils.isNotEmpty(field) && fieldList.size() > 0) {
|
||||
if (ObjectUtils.isNotEmpty(field) && !fieldList.isEmpty()) {
|
||||
// 找到对应维度
|
||||
ChartViewFieldDTO chartViewFieldDTO = null;
|
||||
int index = 0;
|
||||
@ -1947,10 +1979,22 @@ public class ChartViewService {
|
||||
}
|
||||
}
|
||||
if (StringUtils.equalsIgnoreCase(fieldType, "extStack") && !skipAddIndex) {
|
||||
List<ChartViewFieldDTO> stack = gson.fromJson(view.getXAxis(), new TypeToken<List<ChartViewFieldDTO>>() {
|
||||
List<ChartViewFieldDTO> xaxis = gson.fromJson(view.getXAxis(), new TypeToken<List<ChartViewFieldDTO>>() {
|
||||
}.getType());
|
||||
index += stack.size();
|
||||
getIndex += stack.size();
|
||||
index += xaxis.size();
|
||||
getIndex += xaxis.size();
|
||||
if (StringUtils.containsIgnoreCase(view.getType(), "group")) {
|
||||
List<ChartViewFieldDTO> ext = gson.fromJson(view.getXAxisExt(), new TypeToken<List<ChartViewFieldDTO>>() {
|
||||
}.getType());
|
||||
index += ext.size();
|
||||
getIndex += ext.size();
|
||||
}
|
||||
}
|
||||
if (StringUtils.equalsIgnoreCase(fieldType, "xaxisExt") && !skipAddIndex) {
|
||||
List<ChartViewFieldDTO> xaxis = gson.fromJson(view.getXAxis(), new TypeToken<List<ChartViewFieldDTO>>() {
|
||||
}.getType());
|
||||
index += xaxis.size();
|
||||
getIndex += xaxis.size();
|
||||
}
|
||||
List<String[]> sortResult = resultCustomSort(fieldList, sqlData);
|
||||
if (ObjectUtils.isNotEmpty(chartViewFieldDTO) && (getIndex >= index)) {
|
||||
@ -2300,4 +2344,26 @@ public class ChartViewService {
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public void tranChartFilter(ChartViewDTO view) {
|
||||
Type filterTokenType = new TypeToken<List<ChartFieldCustomFilterDTO>>() {
|
||||
}.getType();
|
||||
|
||||
List<ChartFieldCustomFilterDTO> fieldCustomFilter;
|
||||
// 尝试将历史数据转成list,如果转换出现异常,则忽略该视图继续执行下一个
|
||||
try {
|
||||
fieldCustomFilter = gson.fromJson(view.getCustomFilter(), filterTokenType);
|
||||
} catch (Exception e) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (CollectionUtils.isEmpty(fieldCustomFilter)) {
|
||||
// 将 '[]' 转换成 '{}'
|
||||
view.setCustomFilter("{}");
|
||||
} else {
|
||||
// array -> tree
|
||||
FilterTreeObj tree = chartViewOldDataMergeService.transArr2Obj(fieldCustomFilter);
|
||||
view.setCustomFilter(gson.toJson(tree));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,6 +71,7 @@ public class ViewExportExcel {
|
||||
|
||||
Map<String, ChartExtRequest> result = new HashMap<>();
|
||||
Map<String, List<ChartExtFilterRequest>> panelFilters = justView ? FilterBuildTemplate.buildFilters(components) : FilterBuildTemplate.buildEmpty(components);
|
||||
List<String> tableInfoViewIds = findTableInfoViewIds(components);
|
||||
for (Map.Entry<String, List<ChartExtFilterRequest>> entry : panelFilters.entrySet()) {
|
||||
List<ChartExtFilterRequest> chartExtFilterRequests = entry.getValue();
|
||||
ChartExtRequest chartExtRequest = new ChartExtRequest();
|
||||
@ -78,11 +79,26 @@ public class ViewExportExcel {
|
||||
chartExtRequest.setFilter(chartExtFilterRequests);
|
||||
chartExtRequest.setResultCount((int) resultCount);
|
||||
chartExtRequest.setResultMode(resultMode);
|
||||
if(tableInfoViewIds.contains(entry.getKey())){
|
||||
chartExtRequest.setGoPage(1L);
|
||||
chartExtRequest.setPageSize(1000000L);
|
||||
chartExtRequest.setExcelExportFlag(true);
|
||||
}
|
||||
result.put(entry.getKey(), chartExtRequest);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<String> findTableInfoViewIds(List<Map<String, Object>> components) {
|
||||
List<String> tableInfoViewIds = new ArrayList<>();
|
||||
components.forEach(element -> {
|
||||
if (StringUtils.equals(element.get("type").toString(), "view") && StringUtils.equals(((Map<String, Object>) element.get("propValue")).get("innerType").toString(), "table-info")) {
|
||||
tableInfoViewIds.add(((Map<String, Object>) element.get("propValue")).get("viewId").toString());
|
||||
}
|
||||
});
|
||||
return tableInfoViewIds;
|
||||
}
|
||||
|
||||
private ExcelSheetModel viewFiles(String viewId, ChartExtRequest request) {
|
||||
ExcelSheetModel result = new ExcelSheetModel();
|
||||
ChartViewDTO chartViewDTO = null;
|
||||
|
||||
@ -30,6 +30,8 @@ import io.dataease.service.dataset.DataSetTableService;
|
||||
import io.dataease.service.dataset.DataSetTableUnionService;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -56,6 +58,8 @@ public class ViewPluginBaseServiceImpl implements ViewPluginBaseService {
|
||||
@Resource
|
||||
private ChartViewService chartViewService;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ViewPluginBaseServiceImpl.class);
|
||||
|
||||
|
||||
@Override
|
||||
public PluginSingleField buildField(String dsType, PluginViewField pluginViewField, PluginViewSQL tableObj, int index) {
|
||||
@ -85,7 +89,7 @@ public class ViewPluginBaseServiceImpl implements ViewPluginBaseService {
|
||||
SQLObj sqlObj = BeanUtils.copyBean(SQLObj.builder().build(), pluginViewSQL);
|
||||
FilterTreeObj filters = gson.fromJson(gson.toJson(obj), FilterTreeObj.class);
|
||||
Object o;
|
||||
if ((o = execProviderMethod(queryProvider, methodName, sqlObj, filters)) != null) {
|
||||
if ((o = execProviderSuperMethod(queryProvider, methodName, sqlObj, filters)) != null) {
|
||||
return (String) o;
|
||||
}
|
||||
return null;
|
||||
@ -222,6 +226,18 @@ public class ViewPluginBaseServiceImpl implements ViewPluginBaseService {
|
||||
return null;
|
||||
}
|
||||
|
||||
private Object execProviderSuperMethod(QueryProvider queryProvider, String methodName, Object... args) {
|
||||
Method[] declaredMethods = queryProvider.getClass().getMethods();
|
||||
for (int i = 0; i < declaredMethods.length; i++) {
|
||||
Method method = declaredMethods[i];
|
||||
if (StringUtils.equals(method.getName(), methodName)) {
|
||||
method.setAccessible(true);
|
||||
return ReflectUtil.invoke(queryProvider, method, args);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Object execProviderMethod(QueryProvider queryProvider, String methodName, Object... args) {
|
||||
Method[] declaredMethods = queryProvider.getClass().getDeclaredMethods();
|
||||
for (int i = 0; i < declaredMethods.length; i++) {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package io.dataease.service.chart.util;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import io.dataease.controller.request.chart.ChartDrillRequest;
|
||||
import io.dataease.dto.chart.*;
|
||||
import io.dataease.plugins.common.base.domain.ChartViewWithBLOBs;
|
||||
import io.dataease.plugins.common.dto.chart.ChartViewFieldDTO;
|
||||
@ -1310,7 +1311,7 @@ public class ChartDataBuild {
|
||||
}
|
||||
}
|
||||
|
||||
public static Map<String, Object> transTimeBarDataAntV(List<ChartViewFieldDTO> xAxisBase, List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> xAxisExt, List<ChartViewFieldDTO> yAxis, List<ChartViewFieldDTO> extStack, List<String[]> data, ChartViewWithBLOBs view, boolean isDrill) {
|
||||
public static Map<String, Object> transTimeBarDataAntV(List<ChartViewFieldDTO> xAxisBase, List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> xAxisExt, List<ChartViewFieldDTO> yAxis, List<ChartViewFieldDTO> extStack, List<String[]> data, ChartViewWithBLOBs view, boolean isDrill, List<ChartDrillRequest> drillRequestList) {
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if (CollectionUtils.isEmpty(xAxisBase) || CollectionUtils.isEmpty(xAxisExt) || xAxisExt.size() < 2) {
|
||||
@ -1323,9 +1324,17 @@ public class ChartDataBuild {
|
||||
}
|
||||
|
||||
List<Date> dates = new ArrayList<>();
|
||||
List<BigDecimal> numbers = new ArrayList<>();
|
||||
|
||||
ChartViewFieldDTO xAxis1 = xAxis.get(xAxisBase.size());
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(getDateFormat(xAxis1.getDateStyle(), xAxis1.getDatePattern()));
|
||||
boolean isDate = true;
|
||||
if (StringUtils.equalsIgnoreCase(xAxis1.getGroupType(), "q")) {
|
||||
isDate = false;
|
||||
}
|
||||
SimpleDateFormat sdf = null;
|
||||
if (isDate) {
|
||||
sdf = new SimpleDateFormat(getDateFormat(xAxis1.getDateStyle(), xAxis1.getDatePattern()));
|
||||
}
|
||||
|
||||
List<Object> dataList = new ArrayList<>();
|
||||
for (int i1 = 0; i1 < data.size(); i1++) {
|
||||
@ -1350,49 +1359,73 @@ public class ChartDataBuild {
|
||||
List<ChartDimensionDTO> dimensionList = new ArrayList<>();
|
||||
|
||||
for (int j = 0; j < xAxis.size(); j++) {
|
||||
if (j == xAxisBase.size() || j == xAxisBase.size() + 1) {
|
||||
continue;
|
||||
}
|
||||
int index = j;
|
||||
if (j > xAxisBase.size() + 1) {
|
||||
index = j - 2;
|
||||
}
|
||||
ChartDimensionDTO chartDimensionDTO = new ChartDimensionDTO();
|
||||
chartDimensionDTO.setId(xAxis.get(j).getId());
|
||||
chartDimensionDTO.setValue(row[j]);
|
||||
chartDimensionDTO.setValue(row[index]);
|
||||
dimensionList.add(chartDimensionDTO);
|
||||
}
|
||||
|
||||
obj.put("dimensionList", dimensionList);
|
||||
|
||||
List<String> values = new ArrayList<>();
|
||||
List<Object> values = new ArrayList<>();
|
||||
|
||||
// 由于起止时间字段是放到最后的yField里去查询的,所以拿倒数两个
|
||||
if (row[xAxis.size() - 1] == null || row[xAxis.size() - 2] == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
values.add(row[xAxis.size() - 2]);
|
||||
values.add(row[xAxis.size() - 1]);
|
||||
obj.put("values", values);
|
||||
|
||||
|
||||
try {
|
||||
Date date = sdf.parse(row[xAxis.size() - 2]);
|
||||
if (date != null) {
|
||||
dates.add(date);
|
||||
if (isDate) {
|
||||
values.add(row[xAxis.size() - 2]);
|
||||
values.add(row[xAxis.size() - 1]);
|
||||
obj.put("values", values);
|
||||
try {
|
||||
Date date = sdf.parse(row[xAxis.size() - 2]);
|
||||
if (date != null) {
|
||||
dates.add(date);
|
||||
}
|
||||
} catch (Exception ignore) {
|
||||
}
|
||||
} catch (Exception ignore) {
|
||||
}
|
||||
try {
|
||||
Date date = sdf.parse(row[xAxis.size() - 1]);
|
||||
if (date != null) {
|
||||
dates.add(date);
|
||||
try {
|
||||
Date date = sdf.parse(row[xAxis.size() - 1]);
|
||||
if (date != null) {
|
||||
dates.add(date);
|
||||
}
|
||||
} catch (Exception ignore) {
|
||||
}
|
||||
} catch (Exception ignore) {
|
||||
} else {
|
||||
values.add(new BigDecimal(row[xAxis.size() - 2]));
|
||||
values.add(new BigDecimal(row[xAxis.size() - 1]));
|
||||
obj.put("values", values);
|
||||
|
||||
numbers.add(new BigDecimal(row[xAxis.size() - 2]));
|
||||
numbers.add(new BigDecimal(row[xAxis.size() - 1]));
|
||||
}
|
||||
|
||||
dataList.add(obj);
|
||||
}
|
||||
|
||||
map.put("minTime", sdf.format(dates.stream().min(Date::compareTo).orElse(null)));
|
||||
|
||||
|
||||
map.put("maxTime", sdf.format(dates.stream().max(Date::compareTo).orElse(null)));
|
||||
if (isDate) {
|
||||
Date minDate = dates.stream().min(Date::compareTo).orElse(null);
|
||||
if (minDate != null) {
|
||||
map.put("minTime", sdf.format(minDate));
|
||||
}
|
||||
Date maxDate = dates.stream().max(Date::compareTo).orElse(null);
|
||||
if (maxDate != null) {
|
||||
map.put("maxTime", sdf.format(maxDate));
|
||||
}
|
||||
} else {
|
||||
map.put("min", numbers.stream().min(BigDecimal::compareTo).orElse(null));
|
||||
map.put("max", numbers.stream().max(BigDecimal::compareTo).orElse(null));
|
||||
}
|
||||
|
||||
map.put("isDate", isDate);
|
||||
map.put("data", dataList);
|
||||
return map;
|
||||
|
||||
|
||||
@ -91,6 +91,7 @@ public class DirectFieldService implements DataSetFieldService {
|
||||
|
||||
return CollectionUtil.sort(list, (v1, v2) -> {
|
||||
Collator instance = Collator.getInstance(Locale.CHINESE);
|
||||
if (ObjectUtils.isEmpty(v1) || ObjectUtils.isEmpty(v2)) return 0;
|
||||
if (StringUtils.equals("desc", sortStr)) {
|
||||
return instance.compare(v2, v1);
|
||||
}
|
||||
@ -152,7 +153,7 @@ public class DirectFieldService implements DataSetFieldService {
|
||||
DatasourceRequest datasourceRequest = new DatasourceRequest();
|
||||
Provider datasourceProvider = null;
|
||||
String createSQL = null;
|
||||
Long calcLimit = needMapping ? null : 1000L;
|
||||
Long calcLimit = needMapping ? null : 100000L;
|
||||
if (datasetTable.getMode() == 0) {// 直连
|
||||
if (StringUtils.isEmpty(datasetTable.getDataSourceId())) return null;
|
||||
Datasource ds = datasourceService.get(datasetTable.getDataSourceId());
|
||||
@ -184,7 +185,8 @@ public class DirectFieldService implements DataSetFieldService {
|
||||
String sql = (String) dataSetTableService.getUnionSQLDatasource(dt, ds).get("sql");
|
||||
createSQL = qp.createQuerySQLAsTmp(sql, permissionFields, !needSort, customFilter, rowPermissionsTree, deSortFields, calcLimit, keyword);
|
||||
}
|
||||
datasourceRequest.setQuery(needMapping ? createSQL : qp.createSQLPreview(createSQL, null));
|
||||
// datasourceRequest.setQuery(needMapping ? createSQL : qp.createSQLPreview(createSQL, null));
|
||||
datasourceRequest.setQuery(createSQL);
|
||||
|
||||
} else if (datasetTable.getMode() == 1) {// 抽取
|
||||
// 连接doris,构建doris数据源查询
|
||||
@ -219,7 +221,7 @@ public class DirectFieldService implements DataSetFieldService {
|
||||
assert datasourceProvider != null;
|
||||
List<String[]> rows = datasourceProvider.getData(datasourceRequest);
|
||||
if (!needMapping) {
|
||||
return rows.stream().map(row -> row[0]).distinct().collect(Collectors.toList());
|
||||
return rows.stream().map(row -> row[0]).distinct().limit(1000L).collect(Collectors.toList());
|
||||
}
|
||||
Set<String> pkSet = new HashSet<>();
|
||||
if (CollectionUtils.isNotEmpty(rows) && existExtSortField && originSize > 0) {
|
||||
|
||||
@ -166,6 +166,7 @@ export function delGroup(groupId) {
|
||||
}
|
||||
|
||||
export function initPanelData(panelId, useCache = false, callback) {
|
||||
store.commit('resetLastValidFilters')
|
||||
const queryMethod = useCache ? findUserCacheRequest : findOne
|
||||
// 加载视图数据
|
||||
queryMethod(panelId).then(response => {
|
||||
|
||||
@ -5,6 +5,7 @@ import { $error } from '@/utils/message'
|
||||
import i18n from '@/lang'
|
||||
|
||||
export function proxyInitPanelData(panelId, proxy, callback) {
|
||||
store.commit('resetLastValidFilters')
|
||||
// 加载视图数据
|
||||
findOne(panelId, proxy).then(response => {
|
||||
if (response.data) {
|
||||
|
||||
@ -4,7 +4,7 @@ export function get(url) {
|
||||
return request({
|
||||
url: url,
|
||||
method: 'get',
|
||||
loading: true
|
||||
loading: false
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ export default {
|
||||
position: relative;
|
||||
|
||||
.route-title {
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 20px;
|
||||
font-weight: 500;
|
||||
line-height: 28px;
|
||||
|
||||
@ -509,6 +509,7 @@ export default {
|
||||
this.$store.commit('setComponentWithId', this.currentFilterCom)
|
||||
this.$store.commit('recordSnapshot', 'sureFilter')
|
||||
this.$store.commit('setCurComponent', { component: this.currentFilterCom, index: this.curComponentIndex })
|
||||
this.$store.commit('delLastValidFilterWithId', this.currentFilterCom.id)
|
||||
bus.$emit('reset-default-value', this.currentFilterCom)
|
||||
this.closeFilter()
|
||||
},
|
||||
|
||||
@ -735,7 +735,7 @@ export default {
|
||||
display: inline-block;
|
||||
font-weight: 400 !important;
|
||||
font-size: 16px;
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
line-height: 1;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
|
||||
@ -587,14 +587,14 @@ export default {
|
||||
result.relationFilterIds = matchFilters.map(item => item.id)
|
||||
|
||||
let matchViewIds = []
|
||||
matchFilters.forEach(item => {
|
||||
for (let index = 0; index < matchFilters.length; index++) {
|
||||
const item = matchFilters[index]
|
||||
if (!item.options.attrs.viewIds?.length) {
|
||||
matchViewIds = null
|
||||
return false
|
||||
break
|
||||
}
|
||||
matchViewIds = matchViewIds.concat(item.options.attrs.viewIds)
|
||||
})
|
||||
|
||||
}
|
||||
let viewKeyMap = buildViewKeyMap(panelItems)
|
||||
if (matchViewIds) {
|
||||
matchViewIds = [...new Set(matchViewIds)]
|
||||
@ -708,8 +708,8 @@ export default {
|
||||
}
|
||||
if (this.isMainCanvas()) {
|
||||
this.$store.commit('setPreviewCanvasScale', {
|
||||
scaleWidth: this.canvasStyleData.autoSizeAdaptor ? (this.scaleWidth / 100) : 1,
|
||||
scaleHeight: this.canvasStyleData.autoSizeAdaptor ? (this.scaleHeight / 100) : 1
|
||||
scaleWidth: (this.canvasStyleData.autoSizeAdaptor || this.terminal === 'mobile') ? (this.scaleWidth / 100) : 1,
|
||||
scaleHeight: (this.canvasStyleData.autoSizeAdaptor || this.terminal === 'mobile') ? (this.scaleHeight / 100) : 1
|
||||
})
|
||||
}
|
||||
this.handleScaleChange()
|
||||
|
||||
@ -542,18 +542,17 @@ export default {
|
||||
},
|
||||
// 监听外部的样式变化 (非实时性要求)
|
||||
'hw': {
|
||||
handler(newVal, oldVla) {
|
||||
if (newVal !== oldVla && this.$refs[this.element.propValue.id]) {
|
||||
handler(newVal, oldVal) {
|
||||
if (!newVal) {
|
||||
return
|
||||
}
|
||||
if (this.requestStatus === 'waiting') {
|
||||
return
|
||||
}
|
||||
if (newVal !== oldVal && this.$refs[this.element.propValue.id]) {
|
||||
this.resizeChart()
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
// 监听外部的样式变化 (非实时性要求)
|
||||
outStyle: {
|
||||
handler(newVal, oldVla) {
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
// 监听外部计时器变化
|
||||
searchCount: function(val1) {
|
||||
@ -655,6 +654,7 @@ export default {
|
||||
equalsAny,
|
||||
tabSwitch(tabCanvasId) {
|
||||
if (this.charViewS2ShowFlag && tabCanvasId === this.canvasId && this.$refs[this.element.propValue.id]) {
|
||||
// do nothing
|
||||
this.$refs[this.element.propValue.id].chartResize()
|
||||
}
|
||||
},
|
||||
@ -786,9 +786,10 @@ export default {
|
||||
param.viewId && param.viewId === this.element.propValue.viewId && this.getDataEdit(param)
|
||||
},
|
||||
clearPanelLinkage(param) {
|
||||
console.log('clear linkage')
|
||||
if (param.viewId === 'all' || param.viewId === this.element.propValue.viewId) {
|
||||
try {
|
||||
this.$refs[this.element.propValue.id]?.reDrawView?.()
|
||||
// do nothing
|
||||
} catch (e) {
|
||||
console.error('reDrawView-error:', this.element.propValue.id)
|
||||
}
|
||||
@ -842,9 +843,7 @@ export default {
|
||||
this.getDataLoading = false
|
||||
this.getData(id, cache, dataBroadcast)
|
||||
clearTimeout(this.cancelTime)
|
||||
this.cancelTime = setTimeout(() => {
|
||||
this.requestStatus = 'waiting'
|
||||
}, 0)
|
||||
this.requestStatus = 'waiting'
|
||||
return
|
||||
}
|
||||
this.requestStatus = 'waiting'
|
||||
|
||||
@ -45,7 +45,6 @@
|
||||
</div> -->
|
||||
<div class="first-element">
|
||||
<div
|
||||
v-clickoutside="lostFocus"
|
||||
:class="element.component === 'de-select-grid' ? 'first-element-grid-container': ''"
|
||||
:style="deSelectGridBg"
|
||||
class="first-element-container"
|
||||
@ -78,14 +77,10 @@
|
||||
|
||||
<script>
|
||||
import inputStyleMixin from '@/components/widget/deWidget/inputStyleMixin'
|
||||
import clickoutside from 'element-ui/src/utils/clickoutside.js'
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'DeOutWidget',
|
||||
directives: {
|
||||
clickoutside
|
||||
},
|
||||
mixins: [inputStyleMixin],
|
||||
props: {
|
||||
canvasId: {
|
||||
@ -201,9 +196,6 @@ export default {
|
||||
this.$set(this.element.style, 'innerBgColor', innerBgColor || '')
|
||||
},
|
||||
methods: {
|
||||
lostFocus() {
|
||||
this.$refs['deOutWidget'].onScroll?.()
|
||||
},
|
||||
filterLoaded(p) {
|
||||
this.$emit('filter-loaded', p)
|
||||
},
|
||||
|
||||
@ -155,7 +155,7 @@ $B: null;
|
||||
}
|
||||
}
|
||||
@include b(button) {
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
|
||||
@ -116,6 +116,7 @@ import EditBar from '@/components/canvas/components/editor/EditBar'
|
||||
import MobileCheckBar from '@/components/canvas/components/editor/MobileCheckBar'
|
||||
import { hexColorToRGBA } from '@/views/chart/chart/util'
|
||||
import { imgUrlTrans } from '@/components/canvas/utils/utils'
|
||||
import bus from '@/utils/bus'
|
||||
|
||||
let eventsFor = events.mouse
|
||||
|
||||
@ -717,6 +718,7 @@ export default {
|
||||
active(val) {
|
||||
this.enabled = val
|
||||
if (val) {
|
||||
bus.$emit('select-pop-change', this.element.id)
|
||||
this.$emit('activated')
|
||||
} else {
|
||||
this.$emit('deactivated')
|
||||
|
||||
@ -216,7 +216,7 @@ export default {
|
||||
}
|
||||
|
||||
::v-deep .el-pagination__total {
|
||||
font-family: "PingFang SC";
|
||||
font-family: "AlibabaPuHuiTi";
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
|
||||
@ -459,6 +459,9 @@ export default {
|
||||
return param
|
||||
},
|
||||
setCondition() {
|
||||
if (this.showRequiredTips) {
|
||||
return
|
||||
}
|
||||
const param = this.getCondition()
|
||||
!this.isRelation && this.inDraw && this.$store.commit('addViewFilter', param)
|
||||
},
|
||||
@ -472,6 +475,12 @@ export default {
|
||||
this.element.options.manualModify = false
|
||||
} else {
|
||||
this.element.options.manualModify = true
|
||||
if (!this.showRequiredTips) {
|
||||
this.$store.commit('setLastValidFilters', {
|
||||
componentId: this.element.id,
|
||||
val: (this.values && Array.isArray(this.values)) ? this.values.join(',') : this.values
|
||||
})
|
||||
}
|
||||
}
|
||||
this.setCondition()
|
||||
},
|
||||
@ -501,7 +510,16 @@ export default {
|
||||
}
|
||||
},
|
||||
fillValueDerfault() {
|
||||
const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
|
||||
let defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
|
||||
if (this.inDraw) {
|
||||
let lastFilters = null
|
||||
if (this.$store.state.lastValidFilters) {
|
||||
lastFilters = this.$store.state.lastValidFilters[this.element.id]
|
||||
if (lastFilters) {
|
||||
defaultV = (lastFilters.val === null || typeof lastFilters.val === 'undefined') ? '' : lastFilters.val.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.element.options.attrs.type === 'daterange') {
|
||||
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV ===
|
||||
'[object Object]') {
|
||||
|
||||
@ -114,6 +114,11 @@ export default {
|
||||
search() {
|
||||
if (!this.inDraw) {
|
||||
this.element.options.value = this.value
|
||||
} else if (!this.showRequiredTips) {
|
||||
this.$store.commit('setLastValidFilters', {
|
||||
componentId: this.element.id,
|
||||
val: (this.value && Array.isArray(this.value)) ? this.value.join(',') : this.value
|
||||
})
|
||||
}
|
||||
this.setCondition()
|
||||
},
|
||||
@ -127,6 +132,9 @@ export default {
|
||||
return param
|
||||
},
|
||||
setCondition() {
|
||||
if (this.showRequiredTips) {
|
||||
return
|
||||
}
|
||||
const param = this.getCondition()
|
||||
!this.isRelation && this.inDraw && this.$store.commit('addViewFilter', param)
|
||||
},
|
||||
@ -142,7 +150,16 @@ export default {
|
||||
}
|
||||
},
|
||||
fillValueDerfault() {
|
||||
const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
|
||||
let defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
|
||||
if (this.inDraw) {
|
||||
let lastFilters = null
|
||||
if (this.$store.state.lastValidFilters) {
|
||||
lastFilters = this.$store.state.lastValidFilters[this.element.id]
|
||||
if (lastFilters) {
|
||||
defaultV = lastFilters.val === null ? '' : lastFilters.val.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return null
|
||||
return defaultV.split(',')[0]
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ export default {
|
||||
},
|
||||
'defaultvalues': function(value, old) {
|
||||
if (value === old) return
|
||||
const values = this.element.options.value
|
||||
const values = this.fillValueDerfault()
|
||||
this.form.min = values[0]
|
||||
if (values.length > 1) {
|
||||
this.form.max = values[1]
|
||||
@ -145,7 +145,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
if (this.element.options.value && this.element.options.value.length > 0) {
|
||||
const values = this.element.options.value
|
||||
const values = this.fillValueDerfault()
|
||||
this.form.min = values[0]
|
||||
if (values.length > 1) {
|
||||
this.form.max = values[1]
|
||||
@ -174,13 +174,12 @@ export default {
|
||||
this.form.min = null
|
||||
this.form.max = null
|
||||
} else {
|
||||
const values = this.element.options.value
|
||||
const values = this.fillValueDerfault()
|
||||
this.form.min = values[0]
|
||||
if (values.length > 1) {
|
||||
this.form.max = values[1]
|
||||
}
|
||||
}
|
||||
|
||||
this.search()
|
||||
}
|
||||
},
|
||||
@ -251,7 +250,13 @@ export default {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (!this.showRequiredTips) {
|
||||
const values = [this.form.min, this.form.max]
|
||||
this.$store.commit('setLastValidFilters', {
|
||||
componentId: this.element.id,
|
||||
val: (values && Array.isArray(values)) ? values.join(',') : values
|
||||
})
|
||||
}
|
||||
this.setCondition()
|
||||
})
|
||||
})
|
||||
@ -283,6 +288,9 @@ export default {
|
||||
return param
|
||||
},
|
||||
setCondition() {
|
||||
if (this.showRequiredTips) {
|
||||
return
|
||||
}
|
||||
const param = this.getCondition()
|
||||
|
||||
if (this.form.min && this.form.max) {
|
||||
@ -316,6 +324,20 @@ export default {
|
||||
} else {
|
||||
this.element.options.manualModify = true
|
||||
}
|
||||
},
|
||||
fillValueDerfault() {
|
||||
let defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
|
||||
if (this.inDraw) {
|
||||
let lastFilters = null
|
||||
if (this.$store.state.lastValidFilters) {
|
||||
lastFilters = this.$store.state.lastValidFilters[this.element.id]
|
||||
if (lastFilters) {
|
||||
defaultV = lastFilters.val === null ? '' : lastFilters.val.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return []
|
||||
return defaultV.split(',')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -98,7 +98,8 @@ export default {
|
||||
separator: ',',
|
||||
timeMachine: null,
|
||||
changeIndex: 0,
|
||||
flag: uuid.v1()
|
||||
flag: uuid.v1(),
|
||||
hasDestroy: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -145,7 +146,7 @@ export default {
|
||||
return this.element.serviceName === 'textSelectWidget' && this.element.options.attrs.selectFirst
|
||||
},
|
||||
showRequiredTips() {
|
||||
return this.inDraw && this.element.options.attrs.required && !this.value
|
||||
return this.inDraw && this.element.options.attrs.required && (!this.value || this.value.length === 0)
|
||||
}
|
||||
},
|
||||
|
||||
@ -267,15 +268,23 @@ export default {
|
||||
|
||||
mounted() {
|
||||
bus.$on('onScroll', this.onScroll)
|
||||
bus.$on('select-pop-change', this.popChange)
|
||||
if (this.inDraw) {
|
||||
bus.$on('reset-default-value', this.resetDefaultValue)
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
bus.$off('select-pop-change', this.popChange)
|
||||
bus.$off('onScroll', this.onScroll)
|
||||
bus.$off('reset-default-value', this.resetDefaultValue)
|
||||
this.hasDestroy = true
|
||||
},
|
||||
methods: {
|
||||
popChange(id) {
|
||||
if (id !== this.element.id) {
|
||||
this.onScroll()
|
||||
}
|
||||
},
|
||||
clearDefault(optionList) {
|
||||
const emptyOption = !optionList?.length
|
||||
|
||||
@ -353,14 +362,16 @@ export default {
|
||||
resetDefaultValue(ele) {
|
||||
const id = ele.id
|
||||
const eleVal = ele.options.value.toString()
|
||||
if (this.inDraw && this.manualModify && this.element.id === id && this.value.toString() !== eleVal && this.defaultValueStr === eleVal) {
|
||||
if (this.inDraw && this.manualModify && this.element.id === id) {
|
||||
if (this.selectFirst) {
|
||||
this.fillFirstValue()
|
||||
this.firstChange(this.value)
|
||||
return
|
||||
}
|
||||
this.value = this.fillValueDerfault()
|
||||
this.changeValue(this.value)
|
||||
if (this.value.toString() !== eleVal && this.defaultValueStr === eleVal) {
|
||||
this.value = this.fillValueDerfault()
|
||||
this.changeValue(this.value)
|
||||
}
|
||||
}
|
||||
},
|
||||
onBlur() {
|
||||
@ -373,7 +384,6 @@ export default {
|
||||
}, 500)
|
||||
},
|
||||
initLoad() {
|
||||
// this.value = this.fillValueDerfault()
|
||||
this.initOptions(this.fillFirstSelected)
|
||||
if (this.element.options.value && !this.selectFirst) {
|
||||
this.value = this.fillValueDerfault()
|
||||
@ -381,6 +391,9 @@ export default {
|
||||
}
|
||||
},
|
||||
fillFirstSelected() {
|
||||
if (this.hasDestroy) {
|
||||
return
|
||||
}
|
||||
if (this.selectFirst && this.data?.length) {
|
||||
this.fillFirstValue()
|
||||
this.$emit('filter-loaded', {
|
||||
@ -434,6 +447,12 @@ export default {
|
||||
this.element.options.manualModify = false
|
||||
} else {
|
||||
this.element.options.manualModify = true
|
||||
if (!this.showRequiredTips) {
|
||||
this.$store.commit('setLastValidFilters', {
|
||||
componentId: this.element.id,
|
||||
val: (this.value && Array.isArray(this.value)) ? this.value.join(',') : this.value
|
||||
})
|
||||
}
|
||||
}
|
||||
this.setCondition()
|
||||
this.handleShowNumber()
|
||||
@ -470,6 +489,9 @@ export default {
|
||||
return param
|
||||
},
|
||||
setCondition() {
|
||||
if (this.showRequiredTips) {
|
||||
return
|
||||
}
|
||||
const param = this.getCondition()
|
||||
!this.isRelation && this.inDraw && this.$store.commit('addViewFilter', param)
|
||||
},
|
||||
@ -485,7 +507,16 @@ export default {
|
||||
if (!this.selectFirst) {
|
||||
return
|
||||
}
|
||||
const defaultV = this.data[0].id
|
||||
let defaultV = this.data[0].id
|
||||
if (this.inDraw) {
|
||||
let lastFilters = null
|
||||
if (this.$store.state.lastValidFilters) {
|
||||
lastFilters = this.$store.state.lastValidFilters[this.element.id]
|
||||
if (lastFilters) {
|
||||
defaultV = lastFilters.val === null ? '' : lastFilters.val.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.element.options.attrs.multiple) {
|
||||
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return []
|
||||
this.value = defaultV.split(this.separator)
|
||||
@ -496,7 +527,17 @@ export default {
|
||||
this.firstChange(this.value)
|
||||
},
|
||||
fillValueDerfault() {
|
||||
const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
|
||||
let defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
|
||||
if (this.inDraw) {
|
||||
let lastFilters = null
|
||||
if (this.$store.state.lastValidFilters) {
|
||||
lastFilters = this.$store.state.lastValidFilters[this.element.id]
|
||||
if (lastFilters) {
|
||||
defaultV = lastFilters.val === null ? '' : lastFilters.val.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.element.options.attrs.multiple) {
|
||||
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return []
|
||||
return defaultV.split(this.separator)
|
||||
|
||||
@ -381,6 +381,12 @@ export default {
|
||||
this.element.options.manualModify = false
|
||||
} else {
|
||||
this.element.options.manualModify = true
|
||||
if (!this.showRequiredTips) {
|
||||
this.$store.commit('setLastValidFilters', {
|
||||
componentId: this.element.id,
|
||||
val: (this.value && Array.isArray(this.value)) ? this.value.join(',') : this.value
|
||||
})
|
||||
}
|
||||
}
|
||||
this.setCondition()
|
||||
},
|
||||
@ -394,6 +400,9 @@ export default {
|
||||
return param
|
||||
},
|
||||
setCondition() {
|
||||
if (this.showRequiredTips) {
|
||||
return
|
||||
}
|
||||
const param = this.getCondition()
|
||||
!this.isRelation && this.inDraw && this.$store.commit('addViewFilter', param)
|
||||
},
|
||||
@ -403,7 +412,16 @@ export default {
|
||||
return this.value.split(',')
|
||||
},
|
||||
fillValueDerfault() {
|
||||
const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
|
||||
let defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
|
||||
if (this.inDraw) {
|
||||
let lastFilters = null
|
||||
if (this.$store.state.lastValidFilters) {
|
||||
lastFilters = this.$store.state.lastValidFilters[this.element.id]
|
||||
if (lastFilters) {
|
||||
defaultV = lastFilters.val === null ? '' : lastFilters.val.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.element.options.attrs.multiple) {
|
||||
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') {
|
||||
return []
|
||||
|
||||
@ -313,6 +313,12 @@ export default {
|
||||
this.element.options.manualModify = false
|
||||
} else {
|
||||
this.element.options.manualModify = true
|
||||
if (!this.showRequiredTips) {
|
||||
this.$store.commit('setLastValidFilters', {
|
||||
componentId: this.element.id,
|
||||
val: (this.value && Array.isArray(this.value)) ? this.value.join(',') : this.value
|
||||
})
|
||||
}
|
||||
}
|
||||
this.setCondition()
|
||||
},
|
||||
@ -331,6 +337,9 @@ export default {
|
||||
},
|
||||
|
||||
setCondition() {
|
||||
if (this.showRequiredTips) {
|
||||
return
|
||||
}
|
||||
const param = this.getCondition()
|
||||
!this.isRelation && this.inDraw && this.$store.commit('addViewFilter', param)
|
||||
},
|
||||
@ -370,7 +379,16 @@ export default {
|
||||
},
|
||||
|
||||
fillValueDerfault() {
|
||||
const defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
|
||||
let defaultV = this.element.options.value === null ? '' : this.element.options.value.toString()
|
||||
if (this.inDraw) {
|
||||
let lastFilters = null
|
||||
if (this.$store.state.lastValidFilters) {
|
||||
lastFilters = this.$store.state.lastValidFilters[this.element.id]
|
||||
if (lastFilters) {
|
||||
defaultV = lastFilters.val === null ? '' : lastFilters.val.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.element.options.attrs.multiple) {
|
||||
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV === '[object Object]') return []
|
||||
return defaultV.split(',')
|
||||
@ -433,7 +451,9 @@ export default {
|
||||
.test-class-wrap {
|
||||
background: var(--BgSelectTreeColor, #FFFFFF) !important;
|
||||
border-color: var(--BrSelectTreeColor, #E4E7ED) !important;
|
||||
|
||||
.el-tree__empty-text {
|
||||
position: relative !important;
|
||||
}
|
||||
.popper__arrow,
|
||||
.popper__arrow::after {
|
||||
display: none !important;
|
||||
@ -471,5 +491,6 @@ export default {
|
||||
border-left: none;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -67,9 +67,14 @@ class NumberRangeServiceImpl extends WidgetService {
|
||||
})
|
||||
}
|
||||
|
||||
getParam(element) {
|
||||
if (element.options.value && element.options.value.length > 0) {
|
||||
const values = element.options.value
|
||||
getParam(element, val) {
|
||||
let values = null
|
||||
if (val === null || val === '' || typeof val === 'undefined') {
|
||||
values = element.options.value
|
||||
} else {
|
||||
values = val.split(',')
|
||||
}
|
||||
if (values && values.length > 0) {
|
||||
const min = values[0]
|
||||
let max = null
|
||||
if (values.length > 1) {
|
||||
|
||||
@ -82,8 +82,13 @@ class NumberSelectGridServiceImpl extends WidgetService {
|
||||
}
|
||||
})
|
||||
}
|
||||
getParam(element) {
|
||||
const value = this.fillValueDerfault(element)
|
||||
getParam(element, val) {
|
||||
let value = null
|
||||
if (val === null || val === '' || typeof val === 'undefined') {
|
||||
value = this.fillValueDerfault(element)
|
||||
} else {
|
||||
value = [val]
|
||||
}
|
||||
const param = {
|
||||
component: element,
|
||||
value: !value ? [] : Array.isArray(value) ? value : value.toString().split(','),
|
||||
|
||||
@ -84,8 +84,13 @@ class NumberSelectServiceImpl extends WidgetService {
|
||||
}
|
||||
})
|
||||
}
|
||||
getParam(element) {
|
||||
const value = this.fillValueDerfault(element)
|
||||
getParam(element, val) {
|
||||
let value = null
|
||||
if (val === null || val === '' || typeof val === 'undefined') {
|
||||
value = this.fillValueDerfault(element)
|
||||
} else {
|
||||
value = [val]
|
||||
}
|
||||
const param = {
|
||||
component: element,
|
||||
value: !value ? [] : Array.isArray(value) ? value : value.toString().split(','),
|
||||
|
||||
@ -68,8 +68,13 @@ class TextInputServiceImpl extends WidgetService {
|
||||
return field['deType'] === 0
|
||||
})
|
||||
}
|
||||
getParam(element) {
|
||||
const value = this.fillValueDerfault(element)
|
||||
getParam(element, val) {
|
||||
let value = null
|
||||
if (!val) {
|
||||
value = this.fillValueDerfault(element)
|
||||
} else {
|
||||
value = [val]
|
||||
}
|
||||
const param = {
|
||||
component: element,
|
||||
value: !value ? [] : Array.isArray(value) ? value : [value],
|
||||
|
||||
@ -83,8 +83,13 @@ class TextSelectGridServiceImpl extends WidgetService {
|
||||
}
|
||||
})
|
||||
}
|
||||
getParam(element) {
|
||||
const value = this.fillValueDerfault(element)
|
||||
getParam(element, val) {
|
||||
let value = null
|
||||
if (!val) {
|
||||
value = this.fillValueDerfault(element)
|
||||
} else {
|
||||
value = [val]
|
||||
}
|
||||
const param = {
|
||||
component: element,
|
||||
value: !value ? [] : Array.isArray(value) ? value : value.toString().split(','),
|
||||
|
||||
@ -86,8 +86,13 @@ class TextSelectTreeServiceImpl extends WidgetService {
|
||||
})
|
||||
}
|
||||
|
||||
getParam(element) {
|
||||
const value = this.fillValueDerfault(element)
|
||||
getParam(element, val) {
|
||||
let value = null
|
||||
if (!val) {
|
||||
value = this.fillValueDerfault(element)
|
||||
} else {
|
||||
value = [val]
|
||||
}
|
||||
const param = {
|
||||
component: element,
|
||||
value: !value ? [] : Array.isArray(value) ? value : value.toString().split(','),
|
||||
|
||||
@ -310,9 +310,13 @@ class TimeDateRangeServiceImpl extends WidgetService {
|
||||
return false
|
||||
}
|
||||
}
|
||||
getParam(element) {
|
||||
getParam(element, val) {
|
||||
let timeArr = []
|
||||
if (element.options.attrs.default && element.options.attrs.default.isDynamic) {
|
||||
if (val) {
|
||||
let value = [val]
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
} else if (element.options.attrs.default && element.options.attrs.default.isDynamic) {
|
||||
let value = this.dynamicDateFormNow(element)
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
|
||||
@ -167,9 +167,13 @@ class TimeDateServiceImpl extends WidgetService {
|
||||
}
|
||||
}
|
||||
}
|
||||
getParam(element) {
|
||||
getParam(element, val) {
|
||||
let timeArr = []
|
||||
if (element.options.attrs.default && element.options.attrs.default.isDynamic) {
|
||||
if (val) {
|
||||
let value = [val]
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
} else if (element.options.attrs.default && element.options.attrs.default.isDynamic) {
|
||||
let value = this.dynamicDateFormNow(element)
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
|
||||
@ -128,9 +128,13 @@ class TimeMonthServiceImpl extends WidgetService {
|
||||
}
|
||||
}
|
||||
}
|
||||
getParam(element) {
|
||||
getParam(element, val) {
|
||||
let timeArr = []
|
||||
if (element.options.attrs.default && element.options.attrs.default.isDynamic) {
|
||||
if (val) {
|
||||
let value = [val]
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
} else if (element.options.attrs.default && element.options.attrs.default.isDynamic) {
|
||||
let value = this.dynamicDateFormNow(element)
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
|
||||
@ -115,9 +115,13 @@ class TimeYearServiceImpl extends WidgetService {
|
||||
return new Date(dynamicSuffix === 'before' ? (nowYear - dynamicPrefix) : (nowYear + dynamicPrefix), 0, 1).getTime()
|
||||
}
|
||||
}
|
||||
getParam(element) {
|
||||
getParam(element, val) {
|
||||
let timeArr = []
|
||||
if (element.options.attrs.default && element.options.attrs.default.isDynamic) {
|
||||
if (val) {
|
||||
let value = [val]
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
} else if (element.options.attrs.default && element.options.attrs.default.isDynamic) {
|
||||
let value = this.dynamicDateFormNow(element)
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
.vjs-custom-skin > .video-js {
|
||||
width: 100%;
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
font-family: "PingFang SC","Helvetica Neue","Hiragino Sans GB","Segoe UI","Microsoft YaHei","微软雅黑",sans-serif;
|
||||
font-family: "AlibabaPuHuiTi","Helvetica Neue","Hiragino Sans GB","Segoe UI","Microsoft YaHei","微软雅黑",sans-serif;
|
||||
}
|
||||
|
||||
.vjs-custom-skin > .video-js .vjs-menu-button-inline.vjs-slider-active,.vjs-custom-skin > .video-js .vjs-menu-button-inline:focus,.vjs-custom-skin > .video-js .vjs-menu-button-inline:hover,.video-js.vjs-no-flex .vjs-menu-button-inline {
|
||||
@ -108,7 +108,7 @@
|
||||
padding: 0;
|
||||
line-height: 2em;
|
||||
font-size: 1.1em;
|
||||
font-family: "PingFang SC","Helvetica Neue","Hiragino Sans GB","Segoe UI","Microsoft YaHei","微软雅黑",sans-serif;
|
||||
font-family: "AlibabaPuHuiTi","Helvetica Neue","Hiragino Sans GB","Segoe UI","Microsoft YaHei","微软雅黑",sans-serif;
|
||||
}
|
||||
|
||||
.vjs-custom-skin > .video-js .vjs-time-tooltip,
|
||||
|
||||
@ -1184,7 +1184,7 @@ export default {
|
||||
chart_bar_stack: 'Stack Bar',
|
||||
chart_percentage_bar_stack: 'Percentage Stack Bar',
|
||||
chart_bar_horizontal: 'Horizontal Bar',
|
||||
chart_bar_time_range: 'Time Bar',
|
||||
chart_bar_time_range: 'Range Bar',
|
||||
chart_bar_stack_horizontal: 'Stack Horizontal Bar',
|
||||
chart_percentage_bar_stack_horizontal: 'Horizontal Percentage Stack Bar',
|
||||
chart_bidirectional_bar: 'Bidirectional Bar',
|
||||
@ -1386,9 +1386,9 @@ export default {
|
||||
filter_value_can_not_str: 'Value type can not input string',
|
||||
enum_value_can_not_null: 'Enum Value can not empty.',
|
||||
column: 'Column',
|
||||
table_freeze: 'Table Freeze',
|
||||
table_config: 'Table Config',
|
||||
table_column_width_config: 'Column Width',
|
||||
table_column_freeze: 'Column Freeze',
|
||||
table_column_adapt: 'Adapt',
|
||||
table_column_custom: 'Custom',
|
||||
chart_table_pivot: 'Pivot Table',
|
||||
@ -1497,7 +1497,7 @@ export default {
|
||||
dynamic: 'Dynamic',
|
||||
gauge_size_field_delete: 'Dynamic field changed,please edit again',
|
||||
chart_group: 'Sub Type',
|
||||
chart_bar_time: 'Times',
|
||||
chart_bar_time: 'Range',
|
||||
chart_bar_group: 'Bar Group',
|
||||
chart_bar_group_stack: 'Group Stack Bar',
|
||||
field_dynamic: 'Dynamic',
|
||||
@ -1525,7 +1525,7 @@ export default {
|
||||
set_zero: 'Set Zero',
|
||||
ignore_data: 'Hide Data',
|
||||
sub_dimension_tip: 'This field is required, and cannot be included in the type axis, you should choose non-group chart if you don\'t need it, or you will get unexpected chart.',
|
||||
time_bar_tip: 'This field is required, and axis type must be time',
|
||||
time_bar_tip: 'This field is required, and need two time dimensions or two quotas',
|
||||
drill_dimension_tip: 'Only fields in the dataset can be drilled',
|
||||
table_scroll_tip: 'The detail table is only effective when the pagination mode is "Drop-down".',
|
||||
table_threshold_tip: 'Tip: Do not select fields repeatedly. If the same field is configured repeatedly, only the last field will take effect.',
|
||||
@ -1594,7 +1594,8 @@ export default {
|
||||
gauge_axis_label: 'Axis Label',
|
||||
word_size_range: 'Word Size Range',
|
||||
word_spacing: 'Word Spacing',
|
||||
axis_multi_select_tip: 'Hold down the Ctrl/Cmd or Shift key and click to select more than one'
|
||||
axis_multi_select_tip: 'Hold down the Ctrl/Cmd or Shift key and click to select more than one',
|
||||
needs_to_be_integer: 'Needs to be an integer'
|
||||
},
|
||||
dataset: {
|
||||
scope_edit: 'Effective only when editing',
|
||||
@ -2785,7 +2786,7 @@ export default {
|
||||
fire_now_success: 'Task executing',
|
||||
larkgroups: 'Lark group',
|
||||
ext_wait_time: 'Additional waiting time for dashboard loading (unit: seconds)',
|
||||
wat_time_limit: 'The additional waiting time must be between [0 - 30]'
|
||||
wat_time_limit: 'The additional waiting time must be an integer between [0 - 30]'
|
||||
},
|
||||
dynamic_time: {
|
||||
set_default: 'Set Default',
|
||||
|
||||
@ -1182,7 +1182,7 @@ export default {
|
||||
chart_bar_stack: '堆疊柱狀圖',
|
||||
chart_percentage_bar_stack: '百分比柱狀圖',
|
||||
chart_bar_horizontal: '橫嚮柱狀圖',
|
||||
chart_bar_time_range: '時間條形圖',
|
||||
chart_bar_time_range: '區間條形圖',
|
||||
chart_bar_stack_horizontal: '橫嚮堆疊柱狀圖',
|
||||
chart_percentage_bar_stack_horizontal: '橫嚮百分比柱狀圖',
|
||||
chart_bidirectional_bar: '對稱柱狀圖',
|
||||
@ -1386,7 +1386,7 @@ export default {
|
||||
column: '列',
|
||||
table_config: '表格配置',
|
||||
table_column_width_config: '列寬調整',
|
||||
table_column_freeze: '列凍結',
|
||||
table_freeze: '表格凍結',
|
||||
table_column_adapt: '自適應',
|
||||
table_column_custom: '自定義',
|
||||
chart_table_pivot: '透視表',
|
||||
@ -1494,7 +1494,7 @@ export default {
|
||||
dynamic: '動態值',
|
||||
gauge_size_field_delete: '動態值中字段發生變更,請重新編輯',
|
||||
chart_group: '子類別',
|
||||
chart_bar_time: '起止時間',
|
||||
chart_bar_time: '區間范圍',
|
||||
chart_bar_group: '分組柱狀圖',
|
||||
chart_bar_group_stack: '分組堆疊柱狀圖',
|
||||
field_dynamic: '動態值',
|
||||
@ -1522,7 +1522,7 @@ export default {
|
||||
ignore_data: '隱藏空值',
|
||||
empty_data_field_ctrl: '字段設置',
|
||||
sub_dimension_tip: '該字段為必填項,且不應使用類別軸中的字段,若無需該字段,請選擇基礎圖表進行展示,否則展示效果不理想',
|
||||
time_bar_tip: '該字段為必填項,且需要兩個時間類型字段',
|
||||
time_bar_tip: '該字段為必填項,且需要兩個指標或者時間類型維度字段',
|
||||
drill_dimension_tip: '鑽取字段僅支持數據集中的字段',
|
||||
table_scroll_tip: '明細表僅在分頁模式為"下拉"時生效。',
|
||||
table_threshold_tip: '提示:請勿重複選擇字段,若同一字段重複配置,則只有最後的字段配置生效。',
|
||||
@ -1586,7 +1586,8 @@ export default {
|
||||
gauge_axis_label: '刻度標籤',
|
||||
word_size_range: '字號區間',
|
||||
word_spacing: '文字間隔',
|
||||
axis_multi_select_tip: '按住 Ctrl/Cmd 鍵或者 Shift 鍵再點擊可多選'
|
||||
axis_multi_select_tip: '按住 Ctrl/Cmd 鍵或者 Shift 鍵再點擊可多選',
|
||||
needs_to_be_integer: '需要為整數'
|
||||
},
|
||||
dataset: {
|
||||
scope_edit: '僅編輯時生效',
|
||||
@ -2777,7 +2778,7 @@ export default {
|
||||
fire_now_success: '任務發起成功',
|
||||
larkgroups: '飛書群',
|
||||
ext_wait_time: '加載儀表板額外等待時間(單位:秒)',
|
||||
wat_time_limit: '額外等待時間必須在[0 - 30]'
|
||||
wat_time_limit: '額外等待時間必須是[0 - 30]之間整數'
|
||||
},
|
||||
dynamic_time: {
|
||||
set_default: '設置默認值',
|
||||
|
||||
@ -1182,7 +1182,7 @@ export default {
|
||||
chart_bar_stack: '堆叠柱状图',
|
||||
chart_percentage_bar_stack: '百分比柱状图',
|
||||
chart_bar_horizontal: '横向柱状图',
|
||||
chart_bar_time_range: '时间条形图',
|
||||
chart_bar_time_range: '区间条形图',
|
||||
chart_bar_stack_horizontal: '横向堆叠柱状图',
|
||||
chart_percentage_bar_stack_horizontal: '横向百分比柱状图',
|
||||
chart_bidirectional_bar: '对称柱状图',
|
||||
@ -1384,9 +1384,9 @@ export default {
|
||||
filter_value_can_not_str: '数值类型字段过滤值不能包含文本',
|
||||
enum_value_can_not_null: '字段枚举值不能为空',
|
||||
column: '列',
|
||||
table_freeze: '表格冻结',
|
||||
table_config: '表格配置',
|
||||
table_column_width_config: '列宽调整',
|
||||
table_column_freeze: '列冻结',
|
||||
table_column_adapt: '自适应',
|
||||
table_column_custom: '自定义',
|
||||
chart_table_pivot: '透视表',
|
||||
@ -1494,7 +1494,7 @@ export default {
|
||||
dynamic: '动态值',
|
||||
gauge_size_field_delete: '动态值中字段发生变更,请重新编辑',
|
||||
chart_group: '子类别',
|
||||
chart_bar_time: '起止时间',
|
||||
chart_bar_time: '区间范围',
|
||||
chart_bar_group: '分组柱状图',
|
||||
chart_bar_group_stack: '分组堆叠柱状图',
|
||||
field_dynamic: '动态值',
|
||||
@ -1522,7 +1522,7 @@ export default {
|
||||
set_zero: '置为0',
|
||||
ignore_data: '隐藏空值',
|
||||
sub_dimension_tip: '该字段为必填项,且不应使用类别轴中的字段,若无需该字段,请选择基础图表进行展示,否则展示效果不理想。',
|
||||
time_bar_tip: '该字段为必填项,且需要两个时间类型字段',
|
||||
time_bar_tip: '该字段为必填项,且需要两个指标或者时间类型维度字段',
|
||||
drill_dimension_tip: '钻取字段仅支持数据集中的字段',
|
||||
table_scroll_tip: '明细表仅在分页模式为"下拉"时生效。',
|
||||
table_threshold_tip: '提示:请勿重复选择字段,若同一字段重复配置,则只有最后的字段配置生效',
|
||||
@ -1586,7 +1586,8 @@ export default {
|
||||
gauge_axis_label: '刻度标签',
|
||||
word_size_range: '字号区间',
|
||||
word_spacing: '文字间隔',
|
||||
axis_multi_select_tip: '按住 Ctrl/Cmd 键或者 Shift 键再点击可多选'
|
||||
axis_multi_select_tip: '按住 Ctrl/Cmd 键或者 Shift 键再点击可多选',
|
||||
needs_to_be_integer: '需要为整数'
|
||||
},
|
||||
dataset: {
|
||||
scope_edit: '仅编辑时生效',
|
||||
@ -2780,7 +2781,7 @@ export default {
|
||||
fire_now_success: '任务发起成功',
|
||||
larkgroups: '飞书群',
|
||||
ext_wait_time: '加载仪表板额外等待时间(单位:秒)',
|
||||
wat_time_limit: '额外等待时间必须在[0 - 30]'
|
||||
wat_time_limit: '额外等待时间必须是[0 - 30]之间整数'
|
||||
},
|
||||
dynamic_time: {
|
||||
set_default: '设置默认值',
|
||||
|
||||
@ -98,7 +98,7 @@ export default {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
//styleName: 中文/桌面端/正文 14 22 Regular;
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: var(--SiderTextColor, #646a73);
|
||||
|
||||
@ -92,6 +92,7 @@ router.beforeEach(async(to, from, next) => routeBefore(() => {
|
||||
const hasGetUserInfo = store.getters.name
|
||||
if (hasGetUserInfo || to.path.indexOf('/previewScreenShot/') > -1 || to.path.indexOf('/preview/') > -1 || to.path.indexOf('/delink') > -1 || to.path.indexOf('/nolic') > -1) {
|
||||
next()
|
||||
if (to.path.indexOf('/task-ds-form') > -1) return
|
||||
store.dispatch('permission/setCurrentPath', to.path)
|
||||
let route = store.getters.permission_routes.find(
|
||||
item => item.path === '/' + to.path.split('/')[1]
|
||||
|
||||
@ -156,7 +156,8 @@ const data = {
|
||||
previewComponentData: [],
|
||||
currentCanvasNewId: [],
|
||||
lastViewRequestInfo: {},
|
||||
multiplexingStyleAdapt: true // 复用样式跟随主题
|
||||
multiplexingStyleAdapt: true, // 复用样式跟随主题
|
||||
lastValidFilters: {}
|
||||
},
|
||||
mutations: {
|
||||
...animation.mutations,
|
||||
@ -562,6 +563,9 @@ const data = {
|
||||
state.componentData.push(component)
|
||||
},
|
||||
deleteComponentWithId(state, id) {
|
||||
if (state.lastValidFilters && state.lastValidFilters[id]) {
|
||||
delete state.lastValidFilters[id]
|
||||
}
|
||||
for (let index = 0; index < state.componentData.length; index++) {
|
||||
const element = state.componentData[index]
|
||||
if (element.id && element.id === id) {
|
||||
@ -819,6 +823,7 @@ const data = {
|
||||
state.changeProperties[propertyInfo.custom][propertyInfo.property] = propertyInfo.value
|
||||
},
|
||||
initCanvasBase(state) {
|
||||
this.commit('resetLastValidFilters')
|
||||
this.commit('setCurComponent', { component: null, index: null })
|
||||
this.commit('clearLinkageSettingInfo', false)
|
||||
this.commit('resetViewEditInfo')
|
||||
@ -889,6 +894,10 @@ const data = {
|
||||
for (let index = 0; index < state.componentData.length; index++) {
|
||||
const element = state.componentData[index]
|
||||
if (element.canvasId && element.canvasId.includes(canvasId)) {
|
||||
const cid = state.componentData[index]
|
||||
if (state.lastValidFilters && state.lastValidFilters[cid]) {
|
||||
delete state.lastValidFilters[cid]
|
||||
}
|
||||
state.componentData.splice(index, 1)
|
||||
}
|
||||
}
|
||||
@ -913,6 +922,17 @@ const data = {
|
||||
},
|
||||
setMultiplexingStyleAdapt(state, value) {
|
||||
state.multiplexingStyleAdapt = value
|
||||
},
|
||||
setLastValidFilters(state, data) {
|
||||
state.lastValidFilters[data.componentId] = data
|
||||
},
|
||||
resetLastValidFilters(state) {
|
||||
state.lastValidFilters = {}
|
||||
},
|
||||
delLastValidFilterWithId(state, id) {
|
||||
if (state.lastValidFilters[id]) {
|
||||
delete state.lastValidFilters[id]
|
||||
}
|
||||
}
|
||||
},
|
||||
modules: {
|
||||
|
||||
@ -5,7 +5,12 @@
|
||||
@import './theme/dark.scss';
|
||||
@import "~element-ui/packages/theme-chalk/src/index";
|
||||
} */
|
||||
|
||||
@font-face {
|
||||
font-family: 'AlibabaPuHuiTi';
|
||||
src: url('../../static/fonts/AlibabaPuHuiTi-3-55-RegularL3.woff2') format('woff2');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
|
||||
@import '~normalize.css/normalize.css';
|
||||
@ -27,7 +32,7 @@ body {
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
text-rendering: optimizeLegibility;
|
||||
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, FangSong, SimHei, STHeiti, STKaiti, STSong, STFangsong sans-serif;
|
||||
font-family: AlibabaPuHuiTi, Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, FangSong, SimHei, STHeiti, STKaiti, STSong, STFangsong sans-serif !important;
|
||||
}
|
||||
|
||||
label {
|
||||
@ -895,7 +900,7 @@ div:focus {
|
||||
box-shadow: 0px 4px 8px 0px #1f23291a;
|
||||
|
||||
span {
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
line-height: 22px;
|
||||
@ -954,7 +959,7 @@ div:focus {
|
||||
}
|
||||
|
||||
.el-pagination__total {
|
||||
font-family: "PingFang SC";
|
||||
font-family: "AlibabaPuHuiTi";
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
@ -1020,7 +1025,7 @@ div:focus {
|
||||
}
|
||||
|
||||
.el-textarea .el-input__count {
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
color: #8F959E;
|
||||
@ -1080,7 +1085,7 @@ div:focus {
|
||||
|
||||
.el-message-box__message {
|
||||
//styleName: 中文/桌面端/四级标题 16 24 Medium;
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
line-height: 24px;
|
||||
@ -1097,7 +1102,7 @@ div:focus {
|
||||
height: 32px;
|
||||
width: 80px;
|
||||
border-radius: 4px;
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 22px;
|
||||
@ -1123,7 +1128,7 @@ div:focus {
|
||||
|
||||
.use-html {
|
||||
//styleName: 中文/桌面端/正文 14 22 Regular;
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 22px;
|
||||
@ -1232,7 +1237,7 @@ div:focus {
|
||||
.el-drawer__header {
|
||||
padding: 16px 24px;
|
||||
margin: 0;
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
line-height: 24px;
|
||||
@ -1281,7 +1286,7 @@ div:focus {
|
||||
|
||||
> :nth-child(1) {
|
||||
color: var(--deTextSecondary, #1f2329);
|
||||
font-family: "PingFang SC";
|
||||
font-family: "AlibabaPuHuiTi";
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
@ -1295,7 +1300,7 @@ div:focus {
|
||||
|
||||
.item,
|
||||
.more {
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
white-space: nowrap;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
@ -1360,7 +1365,7 @@ div:focus {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
line-height: 22px;
|
||||
@ -1510,7 +1515,7 @@ div:focus {
|
||||
}
|
||||
|
||||
.de-text-btn {
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 22px;
|
||||
@ -1582,7 +1587,7 @@ div:focus {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 17px 0;
|
||||
font-family: "PingFang SC";
|
||||
font-family: "AlibabaPuHuiTi";
|
||||
font-weight: 400;
|
||||
|
||||
.sum {
|
||||
@ -1734,7 +1739,7 @@ div:focus {
|
||||
top: 0;
|
||||
z-index: 15;
|
||||
.title {
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
line-height: 24px;
|
||||
|
||||
@ -96,6 +96,7 @@ export const buildViewKeyFilters = (panelItems, result, isEdit = false) => {
|
||||
return result
|
||||
}
|
||||
const buildItems = panelItems[0].canvasId === 'canvas-main' ? panelItems : store.state.componentData
|
||||
const lastValidFilters = store.state.lastValidFilters
|
||||
const canvasIdMap = buildCanvasIdMap(buildItems)
|
||||
buildItems.forEach((element, index) => {
|
||||
if (element.type !== 'custom') {
|
||||
@ -105,15 +106,22 @@ export const buildViewKeyFilters = (panelItems, result, isEdit = false) => {
|
||||
|
||||
let param = null
|
||||
const widget = ApplicationContext.getService(element.serviceName)
|
||||
param = widget.getParam(element)
|
||||
let lastFilter = null
|
||||
if (lastValidFilters) {
|
||||
lastFilter = lastValidFilters[element.id]
|
||||
}
|
||||
param = widget.getParam(element, lastFilter?.val)
|
||||
const condition = formatCondition(param)
|
||||
const vValid = valueValid(condition)
|
||||
let vValid = valueValid(condition)
|
||||
if (lastFilter && !lastFilter.val) {
|
||||
vValid = false
|
||||
}
|
||||
const filterComponentId = condition.componentId
|
||||
Object.keys(result).forEach(viewId => {
|
||||
// 进行过滤时 如果过滤组件在主画布 则条件适用于所有画布视图 否则需要过滤组件和视图在相同画布
|
||||
if (element.canvasId === 'canvas-main' || element.canvasId === canvasIdMap[viewId]) {
|
||||
const vidMatch = viewIdMatch(condition.viewIds, viewId)
|
||||
if (vidMatch && selectFirst && !element.options.loaded) {
|
||||
if (vidMatch && selectFirst && !element.options.loaded && !lastFilter) {
|
||||
const obj = {}
|
||||
const promise = new Promise(resolve => {
|
||||
cacheCondition(cbParam => {
|
||||
|
||||
@ -275,9 +275,14 @@ export function timeRangeBarOptionAntV(plot, container, chart, action) {
|
||||
// data
|
||||
const data = _.cloneDeep(chart.data.data)
|
||||
|
||||
const isDate = !!chart.data.isDate
|
||||
|
||||
const minTime = chart.data.minTime
|
||||
const maxTime = chart.data.maxTime
|
||||
|
||||
const minNumber = chart.data.min
|
||||
const maxNumber = chart.data.max
|
||||
|
||||
// config
|
||||
const slider = getSlider(chart)
|
||||
const analyse = getAnalyse(chart)
|
||||
@ -297,13 +302,6 @@ export function timeRangeBarOptionAntV(plot, container, chart, action) {
|
||||
slider: slider,
|
||||
annotations: analyse,
|
||||
isRange: true,
|
||||
meta: {
|
||||
values: {
|
||||
type: 'time',
|
||||
min: minTime,
|
||||
max: maxTime
|
||||
}
|
||||
},
|
||||
brush: {
|
||||
enabled: true,
|
||||
isStartEnable: (context) => {
|
||||
@ -340,6 +338,24 @@ export function timeRangeBarOptionAntV(plot, container, chart, action) {
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
if (isDate) {
|
||||
options.meta = {
|
||||
values: {
|
||||
type: 'time',
|
||||
min: minTime,
|
||||
max: maxTime
|
||||
}
|
||||
}
|
||||
} else {
|
||||
options.meta = {
|
||||
values: {
|
||||
min: minNumber,
|
||||
max: maxNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// size
|
||||
let customAttr = {}
|
||||
if (chart.customAttr) {
|
||||
|
||||
@ -172,7 +172,8 @@ export const DEFAULT_SIZE = {
|
||||
quotaSuffixLetterSpace: '0',
|
||||
quotaSuffixFontShadow: false,
|
||||
tableColumnFreezeHead: 0,
|
||||
tableColumnFreezeTail: 0
|
||||
tableColumnFreezeTail: 0,
|
||||
tableRowFreezeHead: 0
|
||||
}
|
||||
export const DEFAULT_SUSPENSION = {
|
||||
show: true
|
||||
@ -927,7 +928,7 @@ export const BASE_CHART_STRING = {
|
||||
yAxis: DEFAULT_YAXIS_STYLE,
|
||||
yAxisExt: DEFAULT_YAXIS_EXT_STYLE
|
||||
}),
|
||||
customFilter: '[]'
|
||||
customFilter: '{}'
|
||||
}
|
||||
|
||||
export const BASE_CHART = {
|
||||
@ -950,7 +951,7 @@ export const BASE_CHART = {
|
||||
yAxis: DEFAULT_YAXIS_STYLE,
|
||||
yAxisExt: DEFAULT_YAXIS_EXT_STYLE
|
||||
},
|
||||
customFilter: []
|
||||
customFilter: {}
|
||||
}
|
||||
|
||||
export const BASE_MAP = {
|
||||
|
||||
@ -344,6 +344,9 @@ export function getTooltip(chart) {
|
||||
|
||||
// tooltip value formatter
|
||||
if (chart.type && chart.type !== 'waterfall') {
|
||||
if (chart.type === 'bar-group-stack') {
|
||||
tooltip.fields = []
|
||||
}
|
||||
tooltip.formatter = function(param) {
|
||||
let res = param.value
|
||||
|
||||
@ -455,7 +458,7 @@ export function getTooltip(chart) {
|
||||
} else {
|
||||
let name = ''
|
||||
if (param.group) {
|
||||
name = param.name + '-'
|
||||
name = param.group + '-'
|
||||
}
|
||||
if (param.category) {
|
||||
name += param.category
|
||||
|
||||
@ -92,16 +92,16 @@ export function baseTableInfo(s2, container, chart, action, tableData, pageInfo)
|
||||
showSeriesNumber: customAttr.size.showIndex,
|
||||
style: getSize(chart),
|
||||
conditions: getConditions(chart),
|
||||
frozenColCount: customAttr.size.tableColumnFreezeHead ?? 0
|
||||
frozenColCount: customAttr.size.tableColumnFreezeHead ?? 0,
|
||||
frozenRowCount: customAttr.size.tableRowFreezeHead ?? 0
|
||||
}
|
||||
// 开启序号之后,第一列就是序号列,修改 label 即可
|
||||
if (s2Options.showSeriesNumber) {
|
||||
s2Options.colCell = (node) => {
|
||||
if (node.colIndex === 0) {
|
||||
if (!customAttr.size.indexLabel) {
|
||||
node.label = customAttr.size.indexLabel
|
||||
if (!customAttr.size.indexLabel || customAttr.size.showTableHeader === false) {
|
||||
node.label = ' '
|
||||
} else {
|
||||
node.label = customAttr.size.indexLabel
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -120,6 +120,9 @@ export function baseTableInfo(s2, container, chart, action, tableData, pageInfo)
|
||||
colCellVertical: false
|
||||
}
|
||||
}
|
||||
s2Options.colCell = (node) => {
|
||||
node.label = ' '
|
||||
}
|
||||
}
|
||||
|
||||
// 开始渲染
|
||||
@ -281,16 +284,16 @@ export function baseTableNormal(s2, container, chart, action, tableData) {
|
||||
showSeriesNumber: customAttr.size.showIndex,
|
||||
style: getSize(chart),
|
||||
conditions: getConditions(chart),
|
||||
frozenColCount: customAttr.size.tableColumnFreezeHead ?? 0
|
||||
frozenColCount: customAttr.size.tableColumnFreezeHead ?? 0,
|
||||
frozenRowCount: customAttr.size.tableRowFreezeHead ?? 0
|
||||
}
|
||||
// 开启序号之后,第一列就是序号列,修改 label 即可
|
||||
if (s2Options.showSeriesNumber) {
|
||||
s2Options.colCell = (node) => {
|
||||
if (node.colIndex === 0) {
|
||||
if (!customAttr.size.indexLabel) {
|
||||
node.label = customAttr.size.indexLabel
|
||||
if (!customAttr.size.indexLabel || customAttr.size.showTableHeader === false) {
|
||||
node.label = ' '
|
||||
} else {
|
||||
node.label = customAttr.size.indexLabel
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -306,6 +309,9 @@ export function baseTableNormal(s2, container, chart, action, tableData) {
|
||||
colCellVertical: false
|
||||
}
|
||||
}
|
||||
s2Options.colCell = (node) => {
|
||||
node.label = ' '
|
||||
}
|
||||
}
|
||||
|
||||
// 开始渲染
|
||||
|
||||
@ -63,7 +63,7 @@ export const TYPE_CONFIGS = [
|
||||
'tableTitleHeight',
|
||||
'tableItemHeight',
|
||||
'tableColumnMode',
|
||||
'tableColumnFreeze',
|
||||
'tableFreeze',
|
||||
'showIndex',
|
||||
'indexLabel',
|
||||
'tableColTooltip',
|
||||
@ -121,7 +121,7 @@ export const TYPE_CONFIGS = [
|
||||
'indexLabel',
|
||||
'tableColTooltip',
|
||||
'showTableHeader',
|
||||
'tableColumnFreeze'
|
||||
'tableFreeze'
|
||||
],
|
||||
'title-selector-ant-v': [
|
||||
'show',
|
||||
@ -2083,7 +2083,7 @@ export const TYPE_CONFIGS = [
|
||||
'tableTitleHeight',
|
||||
'tableItemHeight',
|
||||
'tableColumnWidth',
|
||||
'tableColumnFreeze',
|
||||
'tableFreeze',
|
||||
'showIndex',
|
||||
'indexLabel',
|
||||
'tableAutoBreakLine',
|
||||
@ -2133,7 +2133,7 @@ export const TYPE_CONFIGS = [
|
||||
'tableColumnWidth',
|
||||
'showIndex',
|
||||
'indexLabel',
|
||||
'tableColumnFreeze',
|
||||
'tableFreeze',
|
||||
'tableAutoBreakLine',
|
||||
'showTableHeader'
|
||||
],
|
||||
|
||||
@ -144,7 +144,8 @@ export default {
|
||||
'line',
|
||||
'line-stack',
|
||||
'scatter'
|
||||
]
|
||||
],
|
||||
resizeTimer: null
|
||||
}
|
||||
},
|
||||
|
||||
@ -511,9 +512,16 @@ export default {
|
||||
},
|
||||
chartResize() {
|
||||
// 指定图表的配置项和数据
|
||||
const chart = this.myChart
|
||||
chart.resize()
|
||||
this.reDrawMap()
|
||||
this.resizeTimer && clearTimeout(this.resizeTimer)
|
||||
this.resizeTimer = setTimeout(() => {
|
||||
const { offsetWidth, offsetHeight } = document.getElementById(this.chartId)
|
||||
const chartWidth = this.myChart.getWidth()
|
||||
const chartHeight = this.myChart.getHeight()
|
||||
if (offsetWidth !== chartWidth || offsetHeight !== chartHeight) {
|
||||
this.myChart.resize()
|
||||
this.reDrawMap()
|
||||
}
|
||||
}, 100)
|
||||
},
|
||||
reDrawMap() {
|
||||
const chart = this.chart
|
||||
|
||||
@ -127,8 +127,8 @@ export default {
|
||||
remarkCfg: {
|
||||
show: false,
|
||||
content: ''
|
||||
}
|
||||
|
||||
},
|
||||
resizeTimer: null
|
||||
}
|
||||
},
|
||||
|
||||
@ -156,17 +156,9 @@ export default {
|
||||
chart: {
|
||||
handler(newVal, oldVla) {
|
||||
this.initTitle()
|
||||
this.calcHeightDelay()
|
||||
new Promise((resolve) => {
|
||||
resolve()
|
||||
}).then(() => {
|
||||
this.drawView()
|
||||
})
|
||||
this.calcHeightRightNow(this.drawView)
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
resize() {
|
||||
this.drawEcharts()
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
@ -192,7 +184,7 @@ export default {
|
||||
for (const key in this.pointParam) {
|
||||
this.$delete(this.pointParam, key)
|
||||
}
|
||||
window.removeEventListener('resize', this.calcHeightDelay)
|
||||
window.removeEventListener('resize', this.chartResize)
|
||||
this.myChart = null
|
||||
},
|
||||
mounted() {
|
||||
@ -238,13 +230,8 @@ export default {
|
||||
},
|
||||
preDraw() {
|
||||
this.initTitle()
|
||||
this.calcHeightDelay()
|
||||
new Promise((resolve) => {
|
||||
resolve()
|
||||
}).then(() => {
|
||||
this.drawView()
|
||||
})
|
||||
window.addEventListener('resize', this.calcHeightDelay)
|
||||
this.calcHeightRightNow(this.drawView)
|
||||
window.addEventListener('resize', this.chartResize)
|
||||
},
|
||||
async drawView() {
|
||||
const chart = JSON.parse(JSON.stringify(this.chart))
|
||||
@ -380,7 +367,10 @@ export default {
|
||||
}
|
||||
},
|
||||
chartResize() {
|
||||
this.calcHeightDelay()
|
||||
this.resizeTimer && clearTimeout(this.resizeTimer)
|
||||
this.resizeTimer = setTimeout(() => {
|
||||
this.calcHeightRightNow()
|
||||
}, 100)
|
||||
},
|
||||
trackClick(trackAction) {
|
||||
const param = this.pointParam
|
||||
@ -470,22 +460,19 @@ export default {
|
||||
this.initRemark()
|
||||
},
|
||||
|
||||
calcHeightRightNow() {
|
||||
calcHeightRightNow(callback) {
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.chartContainer) {
|
||||
const currentHeight = this.$refs.chartContainer.offsetHeight
|
||||
const { offsetHeight } = this.$refs.chartContainer
|
||||
let titleHeight = 0
|
||||
if (this.$refs.title) {
|
||||
const titleHeight = this.$refs.title.offsetHeight
|
||||
this.chartHeight = (currentHeight - titleHeight) + 'px'
|
||||
titleHeight = this.$refs.title.offsetHeight
|
||||
}
|
||||
this.chartHeight = (offsetHeight - titleHeight) + 'px'
|
||||
this.$nextTick(() => callback?.())
|
||||
}
|
||||
})
|
||||
},
|
||||
calcHeightDelay() {
|
||||
setTimeout(() => {
|
||||
this.calcHeightRightNow()
|
||||
}, 100)
|
||||
},
|
||||
initRemark() {
|
||||
this.remarkCfg = getRemark(this.chart)
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
<div
|
||||
ref="tableContainer"
|
||||
style="width: 100%;overflow: hidden;"
|
||||
:style="{background:container_bg_class.background}"
|
||||
:style="{background:container_bg_class.background, height: chartHeight}"
|
||||
>
|
||||
<div
|
||||
v-if="chart.type === 'table-normal'"
|
||||
@ -180,7 +180,8 @@ export default {
|
||||
totalStyle: {
|
||||
color: '#606266'
|
||||
},
|
||||
not_support_page_dataset: NOT_SUPPORT_PAGE_DATASET
|
||||
not_support_page_dataset: NOT_SUPPORT_PAGE_DATASET,
|
||||
resizeTimer: null
|
||||
}
|
||||
},
|
||||
|
||||
@ -225,17 +226,9 @@ export default {
|
||||
handler(newVal, oldVla) {
|
||||
this.initData()
|
||||
this.initTitle()
|
||||
this.calcHeightDelay()
|
||||
new Promise((resolve) => {
|
||||
resolve()
|
||||
}).then(() => {
|
||||
this.drawView()
|
||||
})
|
||||
this.calcHeightRightNow(this.drawView)
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
resize() {
|
||||
this.drawEcharts()
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -243,7 +236,7 @@ export default {
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearInterval(this.scrollTimer)
|
||||
window.removeEventListener('resize', this.onResize)
|
||||
window.removeEventListener('resize', this.chartResize)
|
||||
this.myChart?.destroy?.()
|
||||
this.myChart = null
|
||||
},
|
||||
@ -282,18 +275,10 @@ export default {
|
||||
this.tableData = data
|
||||
},
|
||||
preDraw() {
|
||||
this.onResize()
|
||||
window.addEventListener('resize', this.onResize)
|
||||
},
|
||||
onResize() {
|
||||
this.initData()
|
||||
this.initTitle()
|
||||
this.calcHeightDelay()
|
||||
new Promise((resolve) => {
|
||||
resolve()
|
||||
}).then(() => {
|
||||
this.drawView()
|
||||
})
|
||||
this.calcHeightRightNow(this.drawView)
|
||||
window.addEventListener('resize', this.chartResize)
|
||||
},
|
||||
drawView() {
|
||||
const chart = this.chart
|
||||
@ -403,14 +388,22 @@ export default {
|
||||
}
|
||||
},
|
||||
chartResize() {
|
||||
this.initData()
|
||||
this.initTitle()
|
||||
this.calcHeightDelay()
|
||||
new Promise((resolve) => {
|
||||
resolve()
|
||||
}).then(() => {
|
||||
this.drawView()
|
||||
})
|
||||
this.resizeTimer && clearTimeout(this.resizeTimer)
|
||||
this.resizeTimer = setTimeout(() => {
|
||||
this.initData()
|
||||
this.initTitle()
|
||||
this.calcHeightRightNow((width, height) => {
|
||||
const { width: chartWidth, height: chartHeight } = this.myChart.options
|
||||
if (width !== chartWidth || height !== chartHeight) {
|
||||
this.myChart?.changeSheetSize(width, height)
|
||||
// 大小变化或者tab变化重新渲染
|
||||
if (chartWidth || chartHeight || !(chartHeight || chartWidth)) {
|
||||
this.myChart.render()
|
||||
}
|
||||
this.initScroll()
|
||||
}
|
||||
})
|
||||
}, 100)
|
||||
},
|
||||
trackClick(trackAction) {
|
||||
const param = this.pointParam
|
||||
@ -483,24 +476,19 @@ export default {
|
||||
this.initRemark()
|
||||
},
|
||||
|
||||
calcHeightRightNow() {
|
||||
calcHeightRightNow(callback) {
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.chartContainer) {
|
||||
const currentHeight = this.$refs.chartContainer.offsetHeight
|
||||
const { offsetWidth, offsetHeight } = this.$refs.chartContainer
|
||||
let titleHeight = 0
|
||||
if (this.$refs.title) {
|
||||
const titleHeight = this.$refs.title.offsetHeight
|
||||
this.chartHeight = (currentHeight - titleHeight) + 'px'
|
||||
this.$refs.tableContainer.style.height = this.chartHeight
|
||||
titleHeight = this.$refs.title.offsetHeight
|
||||
}
|
||||
this.chartHeight = (offsetHeight - titleHeight) + 'px'
|
||||
this.$nextTick(() => callback?.(offsetWidth, offsetHeight - titleHeight))
|
||||
}
|
||||
})
|
||||
},
|
||||
calcHeightDelay() {
|
||||
this.calcHeightRightNow()
|
||||
setTimeout(() => {
|
||||
this.calcHeightRightNow()
|
||||
}, 100)
|
||||
},
|
||||
pageChange(val) {
|
||||
this.currentPage.pageSize = val
|
||||
if (this.chart.datasetMode === 0 && !NOT_SUPPORT_PAGE_DATASET.includes(this.chart.datasourceType)) {
|
||||
@ -536,23 +524,28 @@ export default {
|
||||
const senior = JSON.parse(this.chart.senior)
|
||||
|
||||
this.scrollTop = 0
|
||||
this.myChart.store.set('scrollY', this.scrollTop)
|
||||
this.myChart.render()
|
||||
|
||||
if (senior && senior.scrollCfg && senior.scrollCfg.open && (this.chart.type === 'table-normal' || (this.chart.type === 'table-info' && !this.showPage))) {
|
||||
const rowHeight = customAttr.size.tableItemHeight
|
||||
const headerHeight = customAttr.size.tableTitleHeight
|
||||
|
||||
this.scrollTimer = setInterval(() => {
|
||||
const offsetHeight = document.getElementById(this.chartId).offsetHeight
|
||||
const top = rowHeight * senior.scrollCfg.row
|
||||
const dom = document.getElementById(this.chartId)
|
||||
if ((dom.offsetHeight - headerHeight + this.scrollTop) < rowHeight * this.chart.data.tableRow.length) {
|
||||
if ((offsetHeight - headerHeight + this.scrollTop) < rowHeight * this.chart.data.tableRow.length) {
|
||||
this.scrollTop += top
|
||||
} else {
|
||||
this.scrollTop = 0
|
||||
}
|
||||
this.myChart.store.set('scrollY', this.scrollTop)
|
||||
this.myChart.render()
|
||||
if (!offsetHeight) {
|
||||
return
|
||||
}
|
||||
this.myChart.facet.scrollWithAnimation({
|
||||
offsetY: {
|
||||
value: this.scrollTop,
|
||||
animate: false
|
||||
}
|
||||
})
|
||||
}, senior.scrollCfg.interval)
|
||||
}
|
||||
},
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
>
|
||||
<input
|
||||
ref="chartTitle"
|
||||
v-model="chartTitleUpdate"
|
||||
v-model.trim="chartTitleUpdate"
|
||||
type="text"
|
||||
:style="inputStyle"
|
||||
class="chart-input-title"
|
||||
@ -402,7 +402,7 @@ export default {
|
||||
.chart-input-title {
|
||||
word-break: break-word;
|
||||
font: 12px / 1.231 -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial,
|
||||
'Microsoft YaHei', 'PingFang SC', sans-serif, 'Segoe UI Symbol';
|
||||
'Microsoft YaHei', 'AlibabaPuHuiTi', sans-serif, 'Segoe UI Symbol';
|
||||
overflow: visible;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
class="form-item"
|
||||
>
|
||||
<el-input
|
||||
v-model="titleForm.title"
|
||||
v-model.trim="titleForm.title"
|
||||
size="mini"
|
||||
:placeholder="$t('chart.title')"
|
||||
clearable
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
class="form-item"
|
||||
>
|
||||
<el-input
|
||||
v-model="titleForm.title"
|
||||
v-model.trim="titleForm.title"
|
||||
size="mini"
|
||||
:placeholder="$t('chart.title')"
|
||||
clearable
|
||||
|
||||
@ -456,6 +456,9 @@ export default {
|
||||
if (!this.axisForm.axisLine) {
|
||||
this.axisForm.axisLine = JSON.parse(JSON.stringify(DEFAULT_XAXIS_STYLE.axisLine))
|
||||
}
|
||||
if (this.axisForm.splitLine.enableDash === undefined) {
|
||||
this.axisForm.splitLine.enableDash = DEFAULT_XAXIS_STYLE.splitLine.enableDash
|
||||
}
|
||||
if (!this.axisForm.splitLine.dashStyle) {
|
||||
this.axisForm.splitLine.dashStyle = JSON.parse(JSON.stringify(DEFAULT_XAXIS_STYLE.splitLine.dashStyle))
|
||||
}
|
||||
|
||||
@ -447,6 +447,9 @@ export default {
|
||||
if (!this.axisForm.axisLine) {
|
||||
this.axisForm.axisLine = JSON.parse(JSON.stringify(DEFAULT_YAXIS_EXT_STYLE.axisLine))
|
||||
}
|
||||
if (this.axisForm.splitLine.enableDash === undefined) {
|
||||
this.axisForm.splitLine.enableDash = DEFAULT_YAXIS_EXT_STYLE.splitLine.enableDash
|
||||
}
|
||||
if (!this.axisForm.splitLine.dashStyle) {
|
||||
this.axisForm.splitLine.dashStyle = JSON.parse(JSON.stringify(DEFAULT_YAXIS_EXT_STYLE.splitLine.dashStyle))
|
||||
}
|
||||
|
||||
@ -451,6 +451,9 @@ export default {
|
||||
if (!this.axisForm.axisLine) {
|
||||
this.axisForm.axisLine = JSON.parse(JSON.stringify(DEFAULT_YAXIS_STYLE.axisLine))
|
||||
}
|
||||
if (this.axisForm.splitLine.enableDash === undefined) {
|
||||
this.axisForm.splitLine.enableDash = DEFAULT_YAXIS_STYLE.splitLine.enableDash
|
||||
}
|
||||
if (!this.axisForm.splitLine.dashStyle) {
|
||||
this.axisForm.splitLine.dashStyle = JSON.parse(JSON.stringify(DEFAULT_YAXIS_STYLE.splitLine.dashStyle))
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@
|
||||
<el-dropdown-item :command="beforeSort('asc')">{{ $t('chart.asc') }}</el-dropdown-item>
|
||||
<el-dropdown-item :command="beforeSort('desc')">{{ $t('chart.desc') }}</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-show="!item.chartId"
|
||||
v-show="showCustomSort"
|
||||
:command="beforeSort('custom_sort')"
|
||||
>{{ $t('chart.custom_sort') }}...</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
@ -228,6 +228,7 @@
|
||||
import { getItemType, getOriginFieldName } from '@/views/chart/components/dragItem/utils'
|
||||
import FieldErrorTips from '@/views/chart/components/dragItem/components/FieldErrorTips'
|
||||
import bus from '@/utils/bus'
|
||||
import { equalsAny } from '@/utils/StringUtils'
|
||||
|
||||
export default {
|
||||
name: 'ChartDragItem',
|
||||
@ -273,6 +274,10 @@ export default {
|
||||
this.chart.datasourceType === 'ds_doris' ||
|
||||
this.chart.datasourceType === 'StarRocks' ||
|
||||
this.chart.datasetMode === 1
|
||||
},
|
||||
showCustomSort() {
|
||||
return !equalsAny(this.chart.type, 'scatter') &&
|
||||
!this.item.chartId
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
@ -84,6 +84,12 @@
|
||||
<el-dropdown-item :command="beforeSort('none')">{{ $t('chart.none') }}</el-dropdown-item>
|
||||
<el-dropdown-item :command="beforeSort('asc')">{{ $t('chart.asc') }}</el-dropdown-item>
|
||||
<el-dropdown-item :command="beforeSort('desc')">{{ $t('chart.desc') }}</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-show="showCustomSort"
|
||||
:command="beforeSort('custom_sort')"
|
||||
>
|
||||
{{ $t('chart.custom_sort') }}...
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</el-dropdown-item>
|
||||
@ -181,6 +187,7 @@
|
||||
import { getItemType, getOriginFieldName } from '@/views/chart/components/dragItem/utils'
|
||||
import FieldErrorTips from '@/views/chart/components/dragItem/components/FieldErrorTips'
|
||||
import bus from '@/utils/bus'
|
||||
import { equalsAny } from '@/utils/StringUtils'
|
||||
|
||||
export default {
|
||||
name: 'DimensionExtItem',
|
||||
@ -220,6 +227,10 @@ export default {
|
||||
computed: {
|
||||
hideSpecial() {
|
||||
return this.chart.type === 'bar-time-range'
|
||||
},
|
||||
showCustomSort() {
|
||||
return !equalsAny(this.chart.type, 'bar-time-range', 'scatter') &&
|
||||
!this.item.chartId
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -265,8 +276,18 @@ export default {
|
||||
}
|
||||
},
|
||||
sort(param) {
|
||||
this.item.sort = param.type
|
||||
this.$emit('onDimensionItemChange', this.item)
|
||||
if (param.type === 'custom_sort') {
|
||||
const item = {
|
||||
index: this.index,
|
||||
sort: param.type
|
||||
}
|
||||
this.$emit('onItemCustomSort', item)
|
||||
} else {
|
||||
this.item.index = this.index
|
||||
this.item.sort = param.type
|
||||
this.item.customSort = []
|
||||
this.$emit('onDimensionItemChange', this.item)
|
||||
}
|
||||
},
|
||||
beforeSort(type) {
|
||||
return {
|
||||
|
||||
@ -90,9 +90,11 @@
|
||||
<el-dropdown-item :command="beforeSort('asc')">{{ $t('chart.asc') }}</el-dropdown-item>
|
||||
<el-dropdown-item :command="beforeSort('desc')">{{ $t('chart.desc') }}</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-show="!item.chartId && (item.deType === 0 || item.deType === 5)"
|
||||
v-show="showCustomSort"
|
||||
:command="beforeSort('custom_sort')"
|
||||
>{{ $t('chart.custom_sort') }}...</el-dropdown-item>
|
||||
>
|
||||
{{ $t('chart.custom_sort') }}...
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</el-dropdown-item>
|
||||
@ -191,6 +193,7 @@ import { getItemType, getOriginFieldName } from '@/views/chart/components/dragIt
|
||||
import FieldErrorTips from '@/views/chart/components/dragItem/components/FieldErrorTips'
|
||||
import bus from '@/utils/bus'
|
||||
import { formatterItem } from '@/views/chart/chart/formatter'
|
||||
import { equalsAny } from '@/utils/StringUtils'
|
||||
|
||||
export default {
|
||||
name: 'DimensionItem',
|
||||
@ -228,6 +231,13 @@ export default {
|
||||
showDateExt: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
showCustomSort() {
|
||||
return !equalsAny(this.chart.type, 'scatter') &&
|
||||
!this.item.chartId &&
|
||||
(this.item.deType === 0 || this.item.deType === 5)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dimensionData: function() {
|
||||
this.getItemTagType()
|
||||
|
||||
@ -154,7 +154,7 @@
|
||||
</el-dropdown-item>
|
||||
|
||||
<!--同比/环比等快速计算-->
|
||||
<el-dropdown-item v-show="!item.chartId && chart.type !== 'table-info'">
|
||||
<el-dropdown-item v-show="!item.chartId && chart.type !== 'table-info' && chart.type !== 'bar-time-range'">
|
||||
<el-dropdown
|
||||
placement="right-start"
|
||||
size="mini"
|
||||
@ -212,7 +212,7 @@
|
||||
<span>{{ $t('chart.filter') }}...</span>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-if="chart.render === 'antv' && chart.type !== 'gauge' && chart.type !== 'liquid'"
|
||||
v-if="chart.render === 'antv' && chart.type !== 'gauge' && chart.type !== 'liquid' && chart.type !== 'bar-time-range'"
|
||||
icon="el-icon-notebook-2"
|
||||
divided
|
||||
:command="beforeClickItem('formatter')"
|
||||
|
||||
@ -330,8 +330,8 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="showProperty('tableColumnFreeze')"
|
||||
:label="$t('chart.table_column_freeze')"
|
||||
v-if="showProperty('tableFreeze')"
|
||||
:label="$t('chart.table_freeze')"
|
||||
class="form-item"
|
||||
>
|
||||
<span>{{ $t('dynamic_time.before') }} </span>
|
||||
@ -1307,6 +1307,11 @@ export default {
|
||||
this.$message.error(this.$t('chart.max_more_than_mix'))
|
||||
return
|
||||
}
|
||||
const reg = /^\d+$/m
|
||||
if (!reg.test(this.sizeForm.tableColumnFreezeHead)) {
|
||||
this.$message.error(this.$t('chart.table_freeze') + this.$t('chart.needs_to_be_integer'))
|
||||
return
|
||||
}
|
||||
this.$emit('onSizeChange', this.sizeForm)
|
||||
},
|
||||
showProperty(property) {
|
||||
|
||||
@ -296,8 +296,8 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="showProperty('tableColumnFreeze')"
|
||||
:label="$t('chart.table_column_freeze')"
|
||||
v-if="showProperty('tableFreeze')"
|
||||
:label="$t('chart.table_freeze')"
|
||||
class="form-item"
|
||||
>
|
||||
<span>{{ $t('dynamic_time.before') }} </span>
|
||||
@ -309,6 +309,16 @@
|
||||
@change="changeBarSizeCase('tableColumnFreezeHead')"
|
||||
/>
|
||||
<span> {{ $t('chart.column') }}</span>
|
||||
<div style="margin: 5px 0" />
|
||||
<span>{{ $t('dynamic_time.before') }} </span>
|
||||
<el-input-number
|
||||
v-model="sizeForm.tableRowFreezeHead"
|
||||
:min="0"
|
||||
:max="1000"
|
||||
:step-strictly="true"
|
||||
@change="changeBarSizeCase('tableRowFreezeHead')"
|
||||
/>
|
||||
<span> {{ $t('deDataset.row') }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="showProperty('showIndex')"
|
||||
@ -349,7 +359,7 @@
|
||||
<el-radio :label="false">{{ $t('commons.no') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<div v-if="showProperty('showTableHeader') && sizeForm.showTableHeader">
|
||||
<div v-if="(showProperty('showTableHeader') && sizeForm.showTableHeader) || chart.type === 'table-pivot'">
|
||||
<el-form-item
|
||||
v-if="showProperty('tableTitleFontSize')"
|
||||
:label="$t('chart.table_title_fontsize')"
|
||||
@ -1697,6 +1707,7 @@ export default {
|
||||
this.sizeForm.tableColTooltip = this.sizeForm.tableColTooltip ?? DEFAULT_SIZE.tableColTooltip
|
||||
this.sizeForm.tableColumnFreezeHead = this.sizeForm.tableColumnFreezeHead ?? DEFAULT_SIZE.tableColumnFreezeHead
|
||||
this.sizeForm.tableColumnFreezeTail = this.sizeForm.tableColumnFreezeTail ?? DEFAULT_SIZE.tableColumnFreezeTail
|
||||
this.sizeForm.tableRowFreezeHead = this.sizeForm.tableRowFreezeHead ?? DEFAULT_SIZE.tableRowFreezeHead
|
||||
|
||||
this.sizeForm.showIndex = this.sizeForm.showIndex ? this.sizeForm.showIndex : DEFAULT_SIZE.showIndex
|
||||
this.sizeForm.showTableHeader = this.sizeForm.showTableHeader !== false
|
||||
@ -1771,6 +1782,11 @@ export default {
|
||||
this.$message.error(this.$t('chart.max_more_than_mix'))
|
||||
return
|
||||
}
|
||||
const reg = /^\d+$/m
|
||||
if (!reg.test(this.sizeForm.tableRowFreezeHead) || !reg.test(this.sizeForm.tableColumnFreezeHead)) {
|
||||
this.$message.error(this.$t('chart.table_freeze') + this.$t('chart.needs_to_be_integer'))
|
||||
return
|
||||
}
|
||||
this.$emit('onSizeChange', this.sizeForm)
|
||||
},
|
||||
showProperty(property) {
|
||||
|
||||
@ -214,7 +214,8 @@ export default {
|
||||
top: '0px'
|
||||
},
|
||||
pointParam: null,
|
||||
showSummary: true
|
||||
showSummary: true,
|
||||
resizeTimer: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -239,7 +240,11 @@ export default {
|
||||
tableStyle() {
|
||||
return {
|
||||
width: '100%',
|
||||
'--scroll-bar-color': this.scrollBarColor
|
||||
'--scroll-bar-color': this.scrollBarColor,
|
||||
'--footer-font-color': this.table_header_class.color,
|
||||
'--footer-bg-color': this.table_header_class.background,
|
||||
'--footer-font-size': this.table_header_class.fontSize,
|
||||
'--footer-height': this.table_header_class.height
|
||||
}
|
||||
},
|
||||
...mapState([
|
||||
@ -421,7 +426,8 @@ export default {
|
||||
})
|
||||
},
|
||||
calcHeightDelay() {
|
||||
setTimeout(() => {
|
||||
this.resizeTimer && clearTimeout(this.resizeTimer)
|
||||
this.resizeTimer = setTimeout(() => {
|
||||
this.calcHeightRightNow()
|
||||
}, 100)
|
||||
},
|
||||
@ -441,16 +447,14 @@ export default {
|
||||
this.table_item_class.fontSize = customAttr.size.tableItemFontSize + 'px'
|
||||
this.table_header_class.height = customAttr.size.tableTitleHeight + 'px'
|
||||
this.table_item_class.height = customAttr.size.tableItemHeight + 'px'
|
||||
|
||||
const visibleColumn = this.$refs.plxTable.getTableColumn().fullColumn
|
||||
for (let i = 0, column = visibleColumn[i]; i < visibleColumn.length; i++) {
|
||||
// 有变更才刷新
|
||||
if (column.type === 'index' && column.visible !== customAttr.size.showIndex) {
|
||||
column.visible = customAttr.size.showIndex
|
||||
this.$refs.plxTable.refreshColumn()
|
||||
break
|
||||
}
|
||||
}
|
||||
this.$refs.plxTable.refreshColumn()
|
||||
if (!customAttr.size.indexLabel) {
|
||||
this.indexLabel = ' '
|
||||
} else {
|
||||
@ -476,16 +480,6 @@ export default {
|
||||
}
|
||||
}
|
||||
this.table_item_class_stripe = JSON.parse(JSON.stringify(this.table_item_class))
|
||||
// 暂不支持斑马纹
|
||||
// if (customAttr.color.tableStripe) {
|
||||
// // this.table_item_class_stripe.background = hexColorToRGBA(customAttr.color.tableItemBgColor, customAttr.color.alpha - 40)
|
||||
// if (this.chart.customStyle) {
|
||||
// const customStyle = JSON.parse(this.chart.customStyle)
|
||||
// if (customStyle.background) {
|
||||
// this.table_item_class_stripe.background = hexColorToRGBA(customStyle.background.color, customStyle.background.alpha)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
if (customAttr.color.enableTableCrossBG) {
|
||||
this.table_item_class_stripe.background = hexColorToRGBA(customAttr.color.tableItemSubBgColor, customAttr.color.alpha)
|
||||
}
|
||||
@ -506,20 +500,6 @@ export default {
|
||||
this.bg_class.background = hexColorToRGBA(customStyle.background.color, customStyle.background.alpha)
|
||||
}
|
||||
}
|
||||
// 修改footer合计样式
|
||||
const table = document.getElementsByClassName(this.chart.id)
|
||||
this.$refs.plxTable.updateFooter().then(() => {
|
||||
for (let i = 0; i < table.length; i++) {
|
||||
const s_table = table[i].getElementsByClassName('elx-table--footer')
|
||||
let s = ''
|
||||
for (const i in this.table_header_class) {
|
||||
s += (i === 'fontSize' ? 'font-size' : i) + ':' + this.table_header_class[i] + ';'
|
||||
}
|
||||
for (let i = 0; i < s_table.length; i++) {
|
||||
s_table[i].setAttribute('style', s)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
getRowStyle({ row, rowIndex }) {
|
||||
if (rowIndex % 2 !== 0) {
|
||||
@ -619,12 +599,6 @@ export default {
|
||||
const scrollContainer = document.getElementsByClassName(this.chart.id)[0].getElementsByClassName('elx-table--body-wrapper')[0]
|
||||
|
||||
this.scrollTop = 0
|
||||
setTimeout(() => {
|
||||
scrollContainer.scrollTo({
|
||||
top: this.scrollTop,
|
||||
behavior: this.scrollTop === 0 ? 'instant' : 'smooth'
|
||||
})
|
||||
}, 0)
|
||||
|
||||
if (senior && senior.scrollCfg && senior.scrollCfg.open && (this.chart.type === 'table-normal' || (this.chart.type === 'table-info' && !this.showPage))) {
|
||||
let rowHeight = customAttr.size.tableItemHeight
|
||||
@ -643,11 +617,16 @@ export default {
|
||||
top = rowHeight * senior.scrollCfg.row
|
||||
}
|
||||
|
||||
if (scrollContainer.clientHeight + scrollContainer.scrollTop < scrollContainer.scrollHeight) {
|
||||
const { clientHeight, scrollTop, scrollHeight } = scrollContainer
|
||||
|
||||
if (clientHeight + scrollTop < scrollHeight) {
|
||||
this.scrollTop += top
|
||||
} else {
|
||||
this.scrollTop = 0
|
||||
}
|
||||
if (!clientHeight) {
|
||||
return
|
||||
}
|
||||
scrollContainer.scrollTo({
|
||||
top: this.scrollTop,
|
||||
behavior: this.scrollTop === 0 ? 'instant' : 'smooth'
|
||||
@ -828,6 +807,12 @@ export default {
|
||||
text-overflow: var(--text-overflow, 'ellipsis');
|
||||
white-space: var(--white-space, 'nowrap');
|
||||
}
|
||||
::v-deep .elx-table--footer {
|
||||
color: var(--footer-font-color);
|
||||
background: var(--footer-bg-color);
|
||||
font-size: var(--footer-font-size);
|
||||
height: var(--footer-height);
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@ -1046,7 +1046,7 @@ export default {
|
||||
view.yaxis = JSON.stringify([])
|
||||
view.yaxisExt = JSON.stringify([])
|
||||
view.extStack = JSON.stringify([])
|
||||
view.customFilter = JSON.stringify([])
|
||||
view.customFilter = JSON.stringify({})
|
||||
view.drillFields = JSON.stringify([])
|
||||
view.extBubble = JSON.stringify([])
|
||||
view.viewFields = JSON.stringify([])
|
||||
|
||||
@ -568,6 +568,7 @@
|
||||
:chart="chart"
|
||||
@onDimensionItemChange="dimensionItemChange"
|
||||
@onDimensionItemRemove="dimensionItemRemove"
|
||||
@onItemCustomSort="item => onCustomSort(item, 'xaxisExt')"
|
||||
@editItemFilter="showDimensionEditFilter"
|
||||
@onNameEdit="showRename"
|
||||
/>
|
||||
@ -670,7 +671,7 @@
|
||||
@editItemFilter="showDimensionEditFilter"
|
||||
@onNameEdit="showRename"
|
||||
@valueFormatter="valueFormatter"
|
||||
@onCustomSort="onCustomSort"
|
||||
@onCustomSort="item => onCustomSort(item, 'xaxis')"
|
||||
/>
|
||||
</template>
|
||||
</transition-group>
|
||||
@ -702,7 +703,8 @@
|
||||
>*</span>
|
||||
</span>
|
||||
/
|
||||
<span>{{ $t('chart.dimension') }}</span>
|
||||
<span v-if="view.type !== 'bar-time-range'">{{ $t('chart.dimension') }}</span>
|
||||
<span v-else>{{ $t('chart.dimension_or_quota') }}</span>
|
||||
<el-tooltip
|
||||
v-show="view.type !== 'line'"
|
||||
class="item"
|
||||
@ -737,20 +739,39 @@
|
||||
@update="calcData(true)"
|
||||
>
|
||||
<transition-group class="draggable-group">
|
||||
<dimension-ext-item
|
||||
v-for="(item,index) in view.xaxisExt"
|
||||
:key="item.id"
|
||||
:param="param"
|
||||
:index="index"
|
||||
:item="item"
|
||||
:dimension-data="dimension"
|
||||
:quota-data="quota"
|
||||
:chart="chart"
|
||||
@onDimensionItemChange="dimensionExtItemChange"
|
||||
@onDimensionItemRemove="dimensionItemRemove"
|
||||
@editItemFilter="showDimensionEditFilter"
|
||||
@onNameEdit="showRename"
|
||||
/>
|
||||
<template v-for="(item,index) in view.xaxisExt">
|
||||
<dimension-ext-item
|
||||
v-if="item.groupType === 'd'"
|
||||
:key="item.id"
|
||||
:param="param"
|
||||
:index="index"
|
||||
:item="item"
|
||||
:dimension-data="dimension"
|
||||
:quota-data="quota"
|
||||
:chart="chart"
|
||||
@onDimensionItemChange="dimensionExtItemChange"
|
||||
@onDimensionItemRemove="dimensionItemExtRemove"
|
||||
@onItemCustomSort="item => onCustomSort(item, 'xaxisExt')"
|
||||
@editItemFilter="showDimensionEditFilter"
|
||||
@onNameEdit="showRename"
|
||||
/>
|
||||
<quota-item
|
||||
v-else-if="item.groupType === 'q'"
|
||||
:key="item.id"
|
||||
:param="param"
|
||||
:index="index"
|
||||
:item="item"
|
||||
:chart="chart"
|
||||
:dimension-data="dimension"
|
||||
:quota-data="quota"
|
||||
@onQuotaItemChange="dimensionExtItemChange"
|
||||
@onQuotaItemRemove="dimensionItemExtRemove"
|
||||
@editItemFilter="showQuotaEditFilter"
|
||||
@onNameEdit="showRename"
|
||||
@editItemCompare="showQuotaEditCompare"
|
||||
@valueFormatter="valueFormatter"
|
||||
/>
|
||||
</template>
|
||||
</transition-group>
|
||||
</draggable>
|
||||
<div
|
||||
@ -947,7 +968,7 @@
|
||||
:quota-data="quota"
|
||||
@onItemChange="stackItemChange"
|
||||
@onItemRemove="stackItemRemove"
|
||||
@onItemCustomSort="stackItemCustomSort"
|
||||
@onItemCustomSort="item => onCustomSort(item, 'extStack')"
|
||||
@onNameEdit="showRename"
|
||||
/>
|
||||
</transition-group>
|
||||
@ -1097,10 +1118,13 @@
|
||||
>
|
||||
<span class="data-area-label">
|
||||
<span>{{ $t('chart.result_filter') }}</span>
|
||||
<span v-if="!!view.customFilter.logic" class="setting">已设置</span>
|
||||
<span
|
||||
v-if="!!view.customFilter.logic"
|
||||
class="setting"
|
||||
>已设置</span>
|
||||
<i
|
||||
@click="deleteTreeFilter"
|
||||
class="el-icon-arrow-down el-icon-delete data-area-clear"
|
||||
@click="deleteTreeFilter"
|
||||
/>
|
||||
</span>
|
||||
<div
|
||||
@ -1748,7 +1772,7 @@
|
||||
>
|
||||
<custom-sort-edit
|
||||
:chart="chart"
|
||||
field-type="xAxis"
|
||||
:field-type="customSortFieldType"
|
||||
:field="customSortField"
|
||||
@onSortChange="customSortChange"
|
||||
/>
|
||||
@ -1770,40 +1794,6 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!--extStack自定义排序-->
|
||||
<el-dialog
|
||||
v-if="showStackCustomSort"
|
||||
v-dialogDrag
|
||||
:title="$t('chart.custom_sort')"
|
||||
:visible="showStackCustomSort"
|
||||
:show-close="false"
|
||||
width="500px"
|
||||
class="dialog-css"
|
||||
>
|
||||
<custom-sort-edit
|
||||
:chart="chart"
|
||||
field-type="extStack"
|
||||
:field="customSortField"
|
||||
@onSortChange="customSortChange"
|
||||
/>
|
||||
<div
|
||||
slot="footer"
|
||||
class="dialog-footer"
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="closeStackCustomSort"
|
||||
>{{ $t('chart.cancel') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
@click="saveStackCustomSort"
|
||||
>{{ $t('chart.confirm') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!--视图计算字段弹框-->
|
||||
<el-dialog
|
||||
v-if="editChartCalcField"
|
||||
@ -2068,12 +2058,13 @@ export default {
|
||||
lastDimensionIndex: 0,
|
||||
lastQuotaIndex: 0,
|
||||
selectedDimension: [],
|
||||
selectedQuota: []
|
||||
selectedQuota: [],
|
||||
customSortFieldType: 'xaxis'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
filedList() {
|
||||
return [...this.dimension, ...this.quota]
|
||||
return [...this.dimension, ...this.quota].filter(ele => ele.id !== 'count')
|
||||
},
|
||||
obj() {
|
||||
return {
|
||||
@ -2255,6 +2246,10 @@ export default {
|
||||
this.view.xaxis = []
|
||||
}
|
||||
}
|
||||
if (newVal.type !== oldVal.type && (newVal.type === 'bar-time-range' || oldVal.type === 'bar-time-range')) {
|
||||
this.view.xaxisExt = []
|
||||
this.view.yaxis = []
|
||||
}
|
||||
if (newVal.type !== oldVal.type || newVal.render !== oldVal.render) {
|
||||
this.setChartDefaultOptions()
|
||||
this.calcData(true, 'chart', true, newVal.type !== oldVal.type, newVal.render !== oldVal.render)
|
||||
@ -2441,6 +2436,7 @@ export default {
|
||||
}
|
||||
},
|
||||
resetChangeTable() {
|
||||
this.view.customFilter = {}
|
||||
const compareData = {}
|
||||
this.dimensionData.forEach(deimension => {
|
||||
compareData[deimension.originName] = deimension
|
||||
@ -2448,7 +2444,7 @@ export default {
|
||||
this.quotaData.forEach(quota => {
|
||||
compareData[quota.originName] = quota
|
||||
})
|
||||
const compareCols = ['xaxis', 'xaxisExt', 'yaxis', 'yaxisExt', 'customFilter', 'extStack', 'extBubble', 'drillFields']
|
||||
const compareCols = ['xaxis', 'xaxisExt', 'yaxis', 'yaxisExt', 'extStack', 'extBubble', 'drillFields']
|
||||
this.viewFieldChange(compareData, compareCols)
|
||||
},
|
||||
viewFieldChange(compareData, compareCols) {
|
||||
@ -2533,6 +2529,21 @@ export default {
|
||||
if (!ele.filter) {
|
||||
ele.filter = []
|
||||
}
|
||||
|
||||
if (ele.chartId) {
|
||||
ele.summary = ''
|
||||
} else {
|
||||
if (!ele.summary || ele.summary === '') {
|
||||
if (ele.id === 'count' || ele.deType === 0 || ele.deType === 1) {
|
||||
ele.summary = 'count'
|
||||
} else {
|
||||
ele.summary = 'sum'
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!ele.compareCalc) {
|
||||
ele.compareCalc = compareItem
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@ -2849,9 +2860,10 @@ export default {
|
||||
this.moveId = e.draggedContext.element.id
|
||||
return true
|
||||
},
|
||||
onCustomSort(item) {
|
||||
this.customSortField = this.view.xaxis[item.index]
|
||||
this.customSort()
|
||||
onCustomSort(item, axis) {
|
||||
this.customSortFieldType = axis
|
||||
this.customSortField = this.view[axis][item.index]
|
||||
this.showCustomSort = true
|
||||
},
|
||||
|
||||
dimensionItemChange(item) {
|
||||
@ -2876,6 +2888,11 @@ export default {
|
||||
}
|
||||
this.calcData(true)
|
||||
},
|
||||
dimensionItemExtRemove(item) {
|
||||
this.view.xaxisExt.splice(item.index, 1)
|
||||
|
||||
this.calcData(true)
|
||||
},
|
||||
|
||||
quotaItemChange(item) {
|
||||
this.calcData(true)
|
||||
@ -3047,7 +3064,7 @@ export default {
|
||||
return
|
||||
}
|
||||
}
|
||||
if (this.quotaItem.filterType === 'quota') {
|
||||
if (this.quotaItem.filterType === 'quota' && this.chart.type !== 'bar-time-range') {
|
||||
this.view.yaxis[this.quotaItem.index].filter = this.quotaItem.filter
|
||||
this.view.yaxis[this.quotaItem.index].logic = this.quotaItem.logic
|
||||
} else if (this.quotaItem.filterType === 'quotaExt') {
|
||||
@ -3056,6 +3073,9 @@ export default {
|
||||
} else if (this.quotaItem.filterType === 'dimension') {
|
||||
this.view.xaxis[this.quotaItem.index].filter = this.quotaItem.filter
|
||||
this.view.xaxis[this.quotaItem.index].logic = this.quotaItem.logic
|
||||
} else if (this.chart.type === 'bar-time-range') {
|
||||
this.view.xaxisExt[this.quotaItem.index].filter = this.quotaItem.filter
|
||||
this.view.xaxisExt[this.quotaItem.index].logic = this.quotaItem.logic
|
||||
}
|
||||
this.calcData(true)
|
||||
this.closeQuotaFilter()
|
||||
@ -3068,13 +3088,13 @@ export default {
|
||||
saveRename() {
|
||||
this.$refs['itemForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.itemForm.renameType === 'quota') {
|
||||
if (this.itemForm.renameType === 'quota' && this.chart.type !== 'bar-time-range') {
|
||||
this.view.yaxis[this.itemForm.index].name = this.itemForm.name
|
||||
} else if (this.itemForm.renameType === 'dimension') {
|
||||
this.view.xaxis[this.itemForm.index].name = this.itemForm.name
|
||||
} else if (this.itemForm.renameType === 'quotaExt') {
|
||||
this.view.yaxisExt[this.itemForm.index].name = this.itemForm.name
|
||||
} else if (this.itemForm.renameType === 'dimensionExt') {
|
||||
} else if (this.itemForm.renameType === 'dimensionExt' || this.chart.type === 'bar-time-range') {
|
||||
this.view.xaxisExt[this.itemForm.index].name = this.itemForm.name
|
||||
} else if (this.itemForm.renameType === 'extStack') {
|
||||
this.view.extStack[this.itemForm.index].name = this.itemForm.name
|
||||
@ -3272,19 +3292,21 @@ export default {
|
||||
addXaxisExt(e) {
|
||||
this.multiAdd(e, this.view.xaxisExt)
|
||||
this.dragMoveDuplicate(this.view.xaxisExt, e)
|
||||
if (this.view.type !== 'table-info') {
|
||||
|
||||
if (this.view.type !== 'table-info' && this.view.type !== 'bar-time-range') {
|
||||
this.dragCheckType(this.view.xaxisExt, 'd')
|
||||
}
|
||||
if (this.view.type === 'bar-time-range') {
|
||||
// 针对时间条形图,需要限定类型为时间类型
|
||||
if (this.view.xaxisExt && this.view.xaxisExt.length > 0) {
|
||||
const baseXaxisExt = this.view.xaxisExt[0]
|
||||
for (let i = this.view.xaxisExt.length - 1; i >= 0; i--) {
|
||||
// 针对时间条形图,需要限定类型为时间类型
|
||||
if (baseXaxisExt.groupType !== this.view.xaxisExt[i].groupType || baseXaxisExt.groupType === 'd' && this.view.xaxisExt[i].deType !== 1) {
|
||||
this.view.xaxisExt.splice(i, 1)
|
||||
continue
|
||||
}
|
||||
this.view.xaxisExt[i].dateStyle = baseXaxisExt.dateStyle
|
||||
this.view.xaxisExt[i].datePattern = baseXaxisExt.datePattern
|
||||
if (this.view.xaxisExt[i].deType !== 1) {
|
||||
this.view.xaxisExt.splice(i, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.view.xaxisExt.length > 2) {
|
||||
@ -3373,11 +3395,6 @@ export default {
|
||||
this.view.extStack.splice(item.index, 1)
|
||||
this.calcData(true)
|
||||
},
|
||||
stackItemCustomSort(item) {
|
||||
this.customSortField = this.view.extStack[item.index]
|
||||
this.stackCustomSort()
|
||||
},
|
||||
|
||||
drillItemChange(item) {
|
||||
this.calcData(true)
|
||||
},
|
||||
@ -3618,20 +3635,19 @@ export default {
|
||||
return
|
||||
}
|
||||
// 更新指标
|
||||
if (this.valueFormatterItem.formatterType === 'quota') {
|
||||
if (this.valueFormatterItem.formatterType === 'quota' && this.chart.type !== 'bar-time-range') {
|
||||
this.view.yaxis[this.valueFormatterItem.index].formatterCfg = this.valueFormatterItem.formatterCfg
|
||||
} else if (this.valueFormatterItem.formatterType === 'quotaExt') {
|
||||
this.view.yaxisExt[this.valueFormatterItem.index].formatterCfg = this.valueFormatterItem.formatterCfg
|
||||
} else if (this.valueFormatterItem.formatterType === 'dimension') {
|
||||
this.view.xaxis[this.valueFormatterItem.index].formatterCfg = this.valueFormatterItem.formatterCfg
|
||||
} else if (this.chart.type === 'bar-time-range') {
|
||||
this.view.xaxisExt[this.valueFormatterItem.index].formatterCfg = this.valueFormatterItem.formatterCfg
|
||||
}
|
||||
this.calcData(true)
|
||||
this.closeValueFormatter()
|
||||
},
|
||||
|
||||
customSort() {
|
||||
this.showCustomSort = true
|
||||
},
|
||||
customSortChange(val) {
|
||||
this.customSortList = val
|
||||
},
|
||||
@ -3641,7 +3657,7 @@ export default {
|
||||
this.customSortList = []
|
||||
},
|
||||
saveCustomSort() {
|
||||
this.view.xaxis.forEach(ele => {
|
||||
this.view[this.customSortFieldType].forEach(ele => {
|
||||
if (ele.id === this.customSortField.id) {
|
||||
ele.sort = 'custom_sort'
|
||||
ele.customSort = this.customSortList
|
||||
@ -3650,24 +3666,6 @@ export default {
|
||||
this.closeCustomSort()
|
||||
this.calcData(true)
|
||||
},
|
||||
|
||||
stackCustomSort() {
|
||||
this.showStackCustomSort = true
|
||||
},
|
||||
closeStackCustomSort() {
|
||||
this.showStackCustomSort = false
|
||||
},
|
||||
saveStackCustomSort() {
|
||||
this.view.extStack.forEach(ele => {
|
||||
if (ele.id === this.customSortField.id) {
|
||||
ele.sort = 'custom_sort'
|
||||
ele.customSort = this.customSortList
|
||||
}
|
||||
})
|
||||
this.closeStackCustomSort()
|
||||
this.calcData(true)
|
||||
},
|
||||
|
||||
fieldEdit(param) {
|
||||
switch (param.type) {
|
||||
case 'ds':
|
||||
@ -4231,6 +4229,10 @@ span {
|
||||
top: 1px;
|
||||
right: 23px;
|
||||
z-index: 1;
|
||||
font-size: 10px;
|
||||
font-weight: 500;
|
||||
line-height: 14px;
|
||||
height: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -16,15 +16,16 @@
|
||||
slot="footer"
|
||||
class="dialog-footer"
|
||||
>
|
||||
<el-button
|
||||
<de-btn
|
||||
secondary
|
||||
@click="closeFilter"
|
||||
>{{ $t('chart.cancel') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
</de-btn>
|
||||
<de-btn
|
||||
type="primary"
|
||||
@click="changeFilter"
|
||||
>{{ $t('chart.confirm') }}
|
||||
</el-button>
|
||||
</de-btn>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@ -105,13 +106,13 @@ export default {
|
||||
<style lang="scss">
|
||||
.filter-tree-cont {
|
||||
.tree-cont {
|
||||
height: 200px;
|
||||
min-height: 67px;
|
||||
width: 100%;
|
||||
padding: 16px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--deBorderBase, #DCDFE6);
|
||||
overflow: auto;
|
||||
|
||||
max-height: 500px;
|
||||
.content {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
@ -278,7 +278,7 @@ export default {
|
||||
box-shadow: 0 2px 2px 0 rgb(0 0 0 / 10%);
|
||||
|
||||
.name {
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
display: flex;
|
||||
@ -299,7 +299,7 @@ export default {
|
||||
}
|
||||
.oprate {
|
||||
.table-num {
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
margin-right: 16px;
|
||||
|
||||
@ -498,7 +498,7 @@ export default {
|
||||
height: 100%;
|
||||
width: 240px;
|
||||
padding: 16px 12px;
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
border-right: 1px solid rgba(31, 35, 41, 0.15);
|
||||
|
||||
.select-ds {
|
||||
@ -536,7 +536,7 @@ export default {
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
padding: 12px;
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: var(--deTextPrimary, #1f2329);
|
||||
@ -581,7 +581,7 @@ export default {
|
||||
}
|
||||
|
||||
.table-detail {
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
|
||||
@ -629,7 +629,7 @@ export default {
|
||||
.result-num {
|
||||
font-weight: 400;
|
||||
display: inline-block;
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
color: var(--deTextSecondary, #646a73);
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
@ -520,7 +520,7 @@ export default {
|
||||
height: 100%;
|
||||
width: 240px;
|
||||
padding: 16px 12px;
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
border-right: 1px solid rgba(31, 35, 41, 0.15);
|
||||
|
||||
.select-ds {
|
||||
@ -558,7 +558,7 @@ export default {
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
padding: 12px;
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: var(--deTextPrimary, #1f2329);
|
||||
@ -603,7 +603,7 @@ export default {
|
||||
}
|
||||
|
||||
.table-detail {
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
|
||||
@ -651,7 +651,7 @@ export default {
|
||||
.result-num {
|
||||
font-weight: 400;
|
||||
display: inline-block;
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
color: var(--deTextSecondary, #646a73);
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
@ -680,7 +680,7 @@ export default {
|
||||
height: 100%;
|
||||
width: 240px;
|
||||
padding: 16px 12px;
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
border-right: 1px solid rgba(31, 35, 41, 0.15);
|
||||
|
||||
.select-ds {
|
||||
@ -749,7 +749,7 @@ export default {
|
||||
}
|
||||
|
||||
.table-detail {
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
flex: 1;
|
||||
overflow-x: auto;
|
||||
|
||||
@ -780,7 +780,7 @@ export default {
|
||||
overflow-y: auto;
|
||||
|
||||
.result-num {
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: var(--deTextSecondary, #646a73);
|
||||
|
||||
@ -1193,7 +1193,7 @@ export default {
|
||||
background: #e1eaff;
|
||||
position: relative;
|
||||
padding: 9px 0 9px 40px;
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
|
||||
@ -1233,7 +1233,7 @@ export default {
|
||||
border-left: 1px solid var(--deCardStrokeColor, #dee0e3);
|
||||
|
||||
.no-select-datasource {
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 14px;
|
||||
color: var(--deTextPrimary, #1f2329);
|
||||
font-weight: 400;
|
||||
@ -1243,7 +1243,7 @@ export default {
|
||||
}
|
||||
|
||||
.table-database-name {
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
color: var(--deTextPrimary, #1f2329);
|
||||
@ -1346,7 +1346,7 @@ export default {
|
||||
}
|
||||
|
||||
.sql-result {
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 14px;
|
||||
overflow-y: auto;
|
||||
box-sizing: border-box;
|
||||
@ -1396,7 +1396,7 @@ export default {
|
||||
|
||||
.el-empty__bottom,
|
||||
.el-empty__description p {
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
margin-top: 0;
|
||||
|
||||
@ -425,7 +425,7 @@ export default {
|
||||
|
||||
.preview-container {
|
||||
flex: 1;
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 14px;
|
||||
overflow-y: auto;
|
||||
box-sizing: border-box;
|
||||
|
||||
@ -110,7 +110,7 @@ export default {
|
||||
width: 50%;
|
||||
|
||||
& > p {
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
margin: 0;
|
||||
|
||||
@ -154,7 +154,7 @@ export default {
|
||||
.field-block-style {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
.field-block-head {
|
||||
height: 46px;
|
||||
display: flex;
|
||||
|
||||
@ -250,7 +250,7 @@ export default {
|
||||
<style lang="scss" scoped>
|
||||
.union-container {
|
||||
height: 275px;
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
}
|
||||
.union-header {
|
||||
display: flex;
|
||||
|
||||
@ -246,7 +246,7 @@ export default {
|
||||
.info-tab {
|
||||
width: 100%;
|
||||
padding: 0 4px;
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
box-sizing: border-box;
|
||||
|
||||
.title-type {
|
||||
@ -261,7 +261,7 @@ export default {
|
||||
border-bottom: 1px solid rgba(31, 35, 41, 0.15);
|
||||
margin-bottom: 12px;
|
||||
.info-item {
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-weight: 400;
|
||||
margin: 6px 0 12px 0;
|
||||
}
|
||||
|
||||
@ -187,7 +187,7 @@ export default {
|
||||
<style lang="scss" scoped>
|
||||
.table-count {
|
||||
color: var(--deTextSecondary, #606266);
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 22px;
|
||||
@ -200,7 +200,7 @@ export default {
|
||||
<style lang="scss">
|
||||
.de-set-count {
|
||||
padding: 20px 24px;
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: var(--deTextPrimary, #1f2329);
|
||||
|
||||
@ -1207,7 +1207,7 @@ export default {
|
||||
justify-content: space-between;
|
||||
padding-bottom: 9px;
|
||||
&:nth-child(1) {
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: var(--deTextPrimary, #1f2329);
|
||||
|
||||
@ -559,7 +559,7 @@ export default {
|
||||
|
||||
.de-dataset-name {
|
||||
display: flex;
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
align-items: center;
|
||||
margin-bottom: 20px;
|
||||
|
||||
|
||||
@ -350,8 +350,8 @@ export default {
|
||||
}
|
||||
this.showTextArea = true
|
||||
},
|
||||
filterTypeChange() {
|
||||
this.item.term = ''
|
||||
filterTypeChange(val) {
|
||||
this.item.term = val === 'logic' ? 'eq' : ''
|
||||
this.item.value = ''
|
||||
this.initEnumOptions()
|
||||
},
|
||||
@ -389,7 +389,7 @@ export default {
|
||||
filterType: 'logic',
|
||||
enumValue: '',
|
||||
value: '',
|
||||
term: ''
|
||||
term: 'eq'
|
||||
})
|
||||
this.filterListInit(deType)
|
||||
this.checklist = []
|
||||
@ -537,7 +537,7 @@ export default {
|
||||
}
|
||||
|
||||
.de-bottom-line {
|
||||
font-family: PingFang SC, Hiragino Sans GB, Microsoft YaHei, sans-serif;
|
||||
font-family: AlibabaPuHuiTi, Hiragino Sans GB, Microsoft YaHei, sans-serif;
|
||||
font-variant: tabular-nums;
|
||||
font-feature-settings: "tnum";
|
||||
word-wrap: break-word;
|
||||
@ -590,7 +590,7 @@ export default {
|
||||
border-radius: 0;
|
||||
height: 26px;
|
||||
|
||||
font-family: PingFang SC, Hiragino Sans GB, Microsoft YaHei, sans-serif;
|
||||
font-family: AlibabaPuHuiTi, Hiragino Sans GB, Microsoft YaHei, sans-serif;
|
||||
word-wrap: break-word;
|
||||
text-align: left;
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
@ -631,7 +631,7 @@ export default {
|
||||
padding: 0;
|
||||
li {
|
||||
font-family: Alibaba-PuHuiTi-Regular, Helvetica Neue, Helvetica, Arial,
|
||||
PingFang SC, Hiragino Sans GB, Microsoft YaHei, sans-serif;
|
||||
AlibabaPuHuiTi, Hiragino Sans GB, Microsoft YaHei, sans-serif;
|
||||
font-variant: tabular-nums;
|
||||
font-feature-settings: "tnum";
|
||||
list-style: none;
|
||||
@ -698,7 +698,7 @@ export default {
|
||||
|
||||
.el-input {
|
||||
font-family: Alibaba-PuHuiTi-Regular, Helvetica Neue, Helvetica, Arial,
|
||||
PingFang SC, Hiragino Sans GB, Microsoft YaHei, sans-serif;
|
||||
AlibabaPuHuiTi, Hiragino Sans GB, Microsoft YaHei, sans-serif;
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
@ -729,7 +729,7 @@ export default {
|
||||
box-shadow: none;
|
||||
border: 1px solid rgba(0, 0, 0, 0.05);
|
||||
.mod-left {
|
||||
font-family: PingFang SC, Hiragino Sans GB, Microsoft YaHei, sans-serif;
|
||||
font-family: AlibabaPuHuiTi, Hiragino Sans GB, Microsoft YaHei, sans-serif;
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
font-size: 12px;
|
||||
vertical-align: top;
|
||||
@ -775,7 +775,7 @@ export default {
|
||||
border-left: 1px solid hsla(0, 0%, 59%, 0.1);
|
||||
}
|
||||
.autochecker-list {
|
||||
font-family: PingFang SC, Hiragino Sans GB, Microsoft YaHei, sans-serif;
|
||||
font-family: AlibabaPuHuiTi, Hiragino Sans GB, Microsoft YaHei, sans-serif;
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
@ -820,7 +820,7 @@ export default {
|
||||
}
|
||||
|
||||
label {
|
||||
font-family: PingFang SC, Hiragino Sans GB, Microsoft YaHei,
|
||||
font-family: AlibabaPuHuiTi, Hiragino Sans GB, Microsoft YaHei,
|
||||
sans-serif;
|
||||
font-size: 12px;
|
||||
direction: ltr;
|
||||
|
||||
@ -152,7 +152,7 @@ export default {
|
||||
z-index: 10;
|
||||
|
||||
.operate-title {
|
||||
font-family: PingFang SC, Hiragino Sans GB, Microsoft YaHei, sans-serif;
|
||||
font-family: AlibabaPuHuiTi, Hiragino Sans GB, Microsoft YaHei, sans-serif;
|
||||
word-wrap: break-word;
|
||||
box-sizing: border-box;
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
|
||||
@ -1238,7 +1238,7 @@ export default {
|
||||
.no-tdata {
|
||||
text-align: center;
|
||||
margin-top: 80px;
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 14px;
|
||||
color: var(--deTextSecondary, #646a73);
|
||||
font-weight: 400;
|
||||
@ -1372,7 +1372,7 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 12px 9px;
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
|
||||
|
||||
@ -138,7 +138,7 @@ export default {
|
||||
-o-user-select: none;
|
||||
user-select: none;
|
||||
color: #3d4d66;
|
||||
font: normal 12px Helvetica Neue,Arial,PingFang SC,Hiragino Sans GB,Microsoft YaHei,微软雅黑,Heiti,黑体,sans-serif;
|
||||
font: normal 12px Helvetica Neue,Arial,AlibabaPuHuiTi,Hiragino Sans GB,Microsoft YaHei,微软雅黑,Heiti,黑体,sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
text-decoration: none;
|
||||
|
||||
@ -127,7 +127,7 @@ export default {
|
||||
Segoe UI,
|
||||
Arial,
|
||||
Roboto,
|
||||
"PingFang SC",
|
||||
"AlibabaPuHuiTi",
|
||||
"miui",
|
||||
"Hiragino Sans GB",
|
||||
"Microsoft Yahei",
|
||||
|
||||
@ -136,6 +136,9 @@ export default {
|
||||
} else if (node.indeterminate_number_map[key] > 0) {
|
||||
node.check_all_map[key] = false
|
||||
node.indeterminate_map[key] = true
|
||||
} else {
|
||||
node.check_all_map[key] = false
|
||||
node.indeterminate_map[key] = false
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -269,7 +272,7 @@ export default {
|
||||
background-color: var(--SiderBG, #f7f8fa);
|
||||
font-size: 12px;
|
||||
color: var(--TableColor, #3d4d66);
|
||||
font-family: PingFang SC;
|
||||
font-family: AlibabaPuHuiTi;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
padding: 0 12px
|
||||
|
||||
@ -546,7 +546,7 @@ export default {
|
||||
.active-template {
|
||||
margin: 4px 0 20px 0;
|
||||
padding-right: 24px;
|
||||
font-family: "PingFang SC";
|
||||
font-family: "AlibabaPuHuiTi";
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
font-size: 16px;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user