forked from github/dataease
Merge branch 'dev' of github.com:dataease/dataease into dev
This commit is contained in:
commit
7052f9b945
@ -1,6 +1,6 @@
|
||||
FROM registry.cn-qingdao.aliyuncs.com/dataease/fabric8-java-alpine-openjdk8-jre:3.15.0
|
||||
FROM registry.cn-qingdao.aliyuncs.com/dataease/fabric8-java-alpine-openjdk8-jre:edge
|
||||
|
||||
RUN echo -e 'http://mirrors.aliyun.com/alpine/v3.15/main/\nhttp://mirrors.aliyun.com/alpine/v3.15/community/' > /etc/apk/repositories
|
||||
RUN echo -e 'http://mirrors.aliyun.com/alpine/edge/main/\nhttp://mirrors.aliyun.com/alpine/edge/community/' > /etc/apk/repositories
|
||||
|
||||
RUN apk add chromium chromium-chromedriver fontconfig --no-cache --allow-untrusted
|
||||
|
||||
|
@ -407,6 +407,17 @@
|
||||
<include name="*.html"/>
|
||||
</fileset>
|
||||
</move>
|
||||
|
||||
<move todir="src/main/resources/static/de-app">
|
||||
<fileset dir="../../dataease-app/dist/build/h5">
|
||||
<exclude name="*.html"/>
|
||||
</fileset>
|
||||
</move>
|
||||
|
||||
|
||||
<move file="../../dataease-app/dist/build/h5/index.html" tofile="src/main/resources/templates/app.html" />
|
||||
|
||||
|
||||
</target>
|
||||
</configuration>
|
||||
<goals>
|
||||
|
@ -61,7 +61,7 @@ public class IndexController {
|
||||
|
||||
@GetMapping("/tempMobileLink/{id}/{token}")
|
||||
public void tempMobileLink(@PathVariable("id") String id, @PathVariable("token") String token) {
|
||||
String url = "http://localhost:8081/#preview/" + id;
|
||||
String url = "/#preview/" + id;
|
||||
HttpServletResponse response = ServletUtils.response();
|
||||
Cookie cookie = new Cookie("Authorization", token);
|
||||
cookie.setPath("/");
|
||||
|
@ -770,15 +770,11 @@ public class CKQueryProvider extends QueryProvider {
|
||||
for (ChartFieldCustomFilterDTO request : requestList) {
|
||||
List<SQLObj> list = new ArrayList<>();
|
||||
DatasetTableField field = request.getField();
|
||||
List<ChartCustomFilterItemDTO> filter = request.getFilter();
|
||||
for (ChartCustomFilterItemDTO filterItemDTO : filter) {
|
||||
|
||||
if (ObjectUtils.isEmpty(field)) {
|
||||
continue;
|
||||
}
|
||||
String value = filterItemDTO.getValue();
|
||||
String whereName = "";
|
||||
String whereTerm = transMysqlFilterTerm(filterItemDTO.getTerm());
|
||||
String whereValue = "";
|
||||
String originName;
|
||||
if (ObjectUtils.isNotEmpty(field.getExtField()) && field.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
@ -802,6 +798,18 @@ public class CKQueryProvider extends QueryProvider {
|
||||
} else {
|
||||
whereName = originName;
|
||||
}
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(request.getFilterType(), "enum")) {
|
||||
if (CollectionUtils.isNotEmpty(request.getEnumCheckField())) {
|
||||
res.add("(" + whereName + " IN ('" + String.join("','", request.getEnumCheckField()) + "'))");
|
||||
}
|
||||
} else {
|
||||
List<ChartCustomFilterItemDTO> filter = request.getFilter();
|
||||
for (ChartCustomFilterItemDTO filterItemDTO : filter) {
|
||||
String value = filterItemDTO.getValue();
|
||||
String whereTerm = transMysqlFilterTerm(filterItemDTO.getTerm());
|
||||
String whereValue = "";
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "null")) {
|
||||
whereValue = "";
|
||||
} else if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "not_null")) {
|
||||
@ -844,6 +852,7 @@ public class CKQueryProvider extends QueryProvider {
|
||||
res.add("(" + String.join(" " + getLogic(request.getLogic()) + " ", strList) + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
return CollectionUtils.isNotEmpty(res) ? "(" + String.join(" AND ", res) + ")" : null;
|
||||
}
|
||||
|
||||
|
@ -737,15 +737,11 @@ public class Db2QueryProvider extends QueryProvider {
|
||||
for (ChartFieldCustomFilterDTO request : requestList) {
|
||||
List<SQLObj> list = new ArrayList<>();
|
||||
DatasetTableField field = request.getField();
|
||||
List<ChartCustomFilterItemDTO> filter = request.getFilter();
|
||||
for (ChartCustomFilterItemDTO filterItemDTO : filter) {
|
||||
|
||||
if (ObjectUtils.isEmpty(field)) {
|
||||
continue;
|
||||
}
|
||||
String value = filterItemDTO.getValue();
|
||||
String whereName = "";
|
||||
String whereTerm = transMysqlFilterTerm(filterItemDTO.getTerm());
|
||||
String whereValue = "";
|
||||
String originName;
|
||||
if (ObjectUtils.isNotEmpty(field.getExtField()) && field.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
@ -770,6 +766,18 @@ public class Db2QueryProvider extends QueryProvider {
|
||||
} else {
|
||||
whereName = originName;
|
||||
}
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(request.getFilterType(), "enum")) {
|
||||
if (CollectionUtils.isNotEmpty(request.getEnumCheckField())) {
|
||||
res.add("(" + whereName + " IN ('" + String.join("','", request.getEnumCheckField()) + "'))");
|
||||
}
|
||||
} else {
|
||||
List<ChartCustomFilterItemDTO> filter = request.getFilter();
|
||||
for (ChartCustomFilterItemDTO filterItemDTO : filter) {
|
||||
String value = filterItemDTO.getValue();
|
||||
String whereTerm = transMysqlFilterTerm(filterItemDTO.getTerm());
|
||||
String whereValue = "";
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "null")) {
|
||||
whereValue = "";
|
||||
} else if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "not_null")) {
|
||||
@ -801,6 +809,7 @@ public class Db2QueryProvider extends QueryProvider {
|
||||
res.add("(" + String.join(" " + getLogic(request.getLogic()) + " ", strList) + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
return CollectionUtils.isNotEmpty(res) ? "(" + String.join(" AND ", res) + ")" : null;
|
||||
}
|
||||
|
||||
|
@ -752,16 +752,11 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
for (ChartFieldCustomFilterDTO request : requestList) {
|
||||
List<SQLObj> list = new ArrayList<>();
|
||||
DatasetTableField field = request.getField();
|
||||
List<ChartCustomFilterItemDTO> filter = request.getFilter();
|
||||
for (ChartCustomFilterItemDTO filterItemDTO : filter) {
|
||||
|
||||
if (ObjectUtils.isEmpty(field)) {
|
||||
continue;
|
||||
}
|
||||
String value = filterItemDTO.getValue();
|
||||
String whereName = "";
|
||||
String whereTerm = transMysqlFilterTerm(filterItemDTO.getTerm());
|
||||
String whereValue = "";
|
||||
|
||||
String originName;
|
||||
if (ObjectUtils.isNotEmpty(field.getExtField()) && field.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
@ -785,6 +780,18 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
} else {
|
||||
whereName = originName;
|
||||
}
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(request.getFilterType(), "enum")) {
|
||||
if (CollectionUtils.isNotEmpty(request.getEnumCheckField())) {
|
||||
res.add("(" + whereName + " IN ('" + String.join("','", request.getEnumCheckField()) + "'))");
|
||||
}
|
||||
} else {
|
||||
List<ChartCustomFilterItemDTO> filter = request.getFilter();
|
||||
for (ChartCustomFilterItemDTO filterItemDTO : filter) {
|
||||
String value = filterItemDTO.getValue();
|
||||
String whereTerm = transMysqlFilterTerm(filterItemDTO.getTerm());
|
||||
String whereValue = "";
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "null")) {
|
||||
whereValue = "";
|
||||
} else if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "not_null")) {
|
||||
@ -816,6 +823,7 @@ public class DorisQueryProvider extends QueryProvider {
|
||||
res.add("(" + String.join(" " + getLogic(request.getLogic()) + " ", strList) + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
return CollectionUtils.isNotEmpty(res) ? "(" + String.join(" AND ", res) + ")" : null;
|
||||
}
|
||||
|
||||
|
@ -767,15 +767,11 @@ public class EsQueryProvider extends QueryProvider {
|
||||
for (ChartFieldCustomFilterDTO request : requestList) {
|
||||
List<SQLObj> list = new ArrayList<>();
|
||||
DatasetTableField field = request.getField();
|
||||
List<ChartCustomFilterItemDTO> filter = request.getFilter();
|
||||
for (ChartCustomFilterItemDTO filterItemDTO : filter) {
|
||||
|
||||
if (ObjectUtils.isEmpty(field)) {
|
||||
continue;
|
||||
}
|
||||
String value = filterItemDTO.getValue();
|
||||
String whereName = "";
|
||||
String whereTerm = transMysqlFilterTerm(filterItemDTO.getTerm());
|
||||
String whereValue = "";
|
||||
String originName;
|
||||
if (ObjectUtils.isNotEmpty(field.getExtField()) && field.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
@ -799,6 +795,18 @@ public class EsQueryProvider extends QueryProvider {
|
||||
} else {
|
||||
whereName = originName;
|
||||
}
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(request.getFilterType(), "enum")) {
|
||||
if (CollectionUtils.isNotEmpty(request.getEnumCheckField())) {
|
||||
res.add("(" + whereName + " IN ('" + String.join("','", request.getEnumCheckField()) + "'))");
|
||||
}
|
||||
} else {
|
||||
List<ChartCustomFilterItemDTO> filter = request.getFilter();
|
||||
for (ChartCustomFilterItemDTO filterItemDTO : filter) {
|
||||
String value = filterItemDTO.getValue();
|
||||
String whereTerm = transMysqlFilterTerm(filterItemDTO.getTerm());
|
||||
String whereValue = "";
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "null")) {
|
||||
whereValue = "";
|
||||
} else if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "not_null")) {
|
||||
@ -819,13 +827,13 @@ public class EsQueryProvider extends QueryProvider {
|
||||
.whereTermAndValue(whereTerm + whereValue)
|
||||
.build());
|
||||
}
|
||||
|
||||
List<String> strList = new ArrayList<>();
|
||||
list.forEach(ele -> strList.add(ele.getWhereField() + " " + ele.getWhereTermAndValue()));
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
res.add("(" + String.join(" " + getLogic(request.getLogic()) + " ", strList) + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
return CollectionUtils.isNotEmpty(res) ? "(" + String.join(" AND ", res) + ")" : null;
|
||||
}
|
||||
|
||||
|
@ -731,15 +731,11 @@ public class HiveQueryProvider extends QueryProvider {
|
||||
for (ChartFieldCustomFilterDTO request : requestList) {
|
||||
List<SQLObj> list = new ArrayList<>();
|
||||
DatasetTableField field = request.getField();
|
||||
List<ChartCustomFilterItemDTO> filter = request.getFilter();
|
||||
for (ChartCustomFilterItemDTO filterItemDTO : filter) {
|
||||
|
||||
if (ObjectUtils.isEmpty(field)) {
|
||||
continue;
|
||||
}
|
||||
String value = filterItemDTO.getValue();
|
||||
String whereName = "";
|
||||
String whereTerm = transMysqlFilterTerm(filterItemDTO.getTerm());
|
||||
String whereValue = "";
|
||||
String originName;
|
||||
if (ObjectUtils.isNotEmpty(field.getExtField()) && field.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
@ -763,6 +759,18 @@ public class HiveQueryProvider extends QueryProvider {
|
||||
} else {
|
||||
whereName = originName;
|
||||
}
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(request.getFilterType(), "enum")) {
|
||||
if (CollectionUtils.isNotEmpty(request.getEnumCheckField())) {
|
||||
res.add("(" + whereName + " IN ('" + String.join("','", request.getEnumCheckField()) + "'))");
|
||||
}
|
||||
} else {
|
||||
List<ChartCustomFilterItemDTO> filter = request.getFilter();
|
||||
for (ChartCustomFilterItemDTO filterItemDTO : filter) {
|
||||
String value = filterItemDTO.getValue();
|
||||
String whereTerm = transMysqlFilterTerm(filterItemDTO.getTerm());
|
||||
String whereValue = "";
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "null")) {
|
||||
whereValue = "";
|
||||
} else if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "not_null")) {
|
||||
@ -790,6 +798,7 @@ public class HiveQueryProvider extends QueryProvider {
|
||||
res.add("(" + String.join(" " + getLogic(request.getLogic()) + " ", strList) + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
return CollectionUtils.isNotEmpty(res) ? "(" + String.join(" AND ", res) + ")" : null;
|
||||
}
|
||||
|
||||
|
@ -710,15 +710,11 @@ public class MongoQueryProvider extends QueryProvider {
|
||||
for (ChartFieldCustomFilterDTO request : requestList) {
|
||||
List<SQLObj> list = new ArrayList<>();
|
||||
DatasetTableField field = request.getField();
|
||||
List<ChartCustomFilterItemDTO> filter = request.getFilter();
|
||||
for (ChartCustomFilterItemDTO filterItemDTO : filter) {
|
||||
|
||||
if (ObjectUtils.isEmpty(field)) {
|
||||
continue;
|
||||
}
|
||||
String value = filterItemDTO.getValue();
|
||||
String whereName = "";
|
||||
String whereTerm = transMysqlFilterTerm(filterItemDTO.getTerm());
|
||||
String whereValue = "";
|
||||
String originName;
|
||||
if (ObjectUtils.isNotEmpty(field.getExtField()) && field.getExtField() == DeTypeConstants.DE_INT) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
@ -729,6 +725,18 @@ public class MongoQueryProvider extends QueryProvider {
|
||||
originName = String.format(MongoConstants.KEYWORD_FIX, tableObj.getTableAlias(), field.getOriginName());
|
||||
}
|
||||
whereName = originName;
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(request.getFilterType(), "enum")) {
|
||||
if (CollectionUtils.isNotEmpty(request.getEnumCheckField())) {
|
||||
res.add("(" + whereName + " IN ('" + String.join("','", request.getEnumCheckField()) + "'))");
|
||||
}
|
||||
} else {
|
||||
List<ChartCustomFilterItemDTO> filter = request.getFilter();
|
||||
for (ChartCustomFilterItemDTO filterItemDTO : filter) {
|
||||
String value = filterItemDTO.getValue();
|
||||
String whereTerm = transMysqlFilterTerm(filterItemDTO.getTerm());
|
||||
String whereValue = "";
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "null")) {
|
||||
whereValue = "";
|
||||
} else if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "not_null")) {
|
||||
@ -756,6 +764,7 @@ public class MongoQueryProvider extends QueryProvider {
|
||||
res.add("(" + String.join(" " + getLogic(request.getLogic()) + " ", strList) + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
return CollectionUtils.isNotEmpty(res) ? "(" + String.join(" AND ", res) + ")" : null;
|
||||
}
|
||||
|
||||
|
@ -771,9 +771,6 @@ public class MysqlQueryProvider extends QueryProvider {
|
||||
} else {
|
||||
List<ChartCustomFilterItemDTO> filter = request.getFilter();
|
||||
for (ChartCustomFilterItemDTO filterItemDTO : filter) {
|
||||
if (ObjectUtils.isEmpty(field)) {
|
||||
continue;
|
||||
}
|
||||
String value = filterItemDTO.getValue();
|
||||
String whereTerm = transMysqlFilterTerm(filterItemDTO.getTerm());
|
||||
String whereValue = "";
|
||||
|
@ -786,16 +786,11 @@ public class OracleQueryProvider extends QueryProvider {
|
||||
for (ChartFieldCustomFilterDTO request : requestList) {
|
||||
List<SQLObj> list = new ArrayList<>();
|
||||
DatasetTableField field = request.getField();
|
||||
List<ChartCustomFilterItemDTO> filter = request.getFilter();
|
||||
for (ChartCustomFilterItemDTO filterItemDTO : filter) {
|
||||
|
||||
if (ObjectUtils.isEmpty(field)) {
|
||||
continue;
|
||||
}
|
||||
String value = filterItemDTO.getValue();
|
||||
String whereName = "";
|
||||
String whereTerm = transMysqlFilterTerm(filterItemDTO.getTerm());
|
||||
String whereValue = "";
|
||||
|
||||
String originName;
|
||||
if (ObjectUtils.isNotEmpty(field.getExtField()) && field.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
@ -820,6 +815,18 @@ public class OracleQueryProvider extends QueryProvider {
|
||||
} else {
|
||||
whereName = originName;
|
||||
}
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(request.getFilterType(), "enum")) {
|
||||
if (CollectionUtils.isNotEmpty(request.getEnumCheckField())) {
|
||||
res.add("(" + whereName + " IN ('" + String.join("','", request.getEnumCheckField()) + "'))");
|
||||
}
|
||||
} else {
|
||||
List<ChartCustomFilterItemDTO> filter = request.getFilter();
|
||||
for (ChartCustomFilterItemDTO filterItemDTO : filter) {
|
||||
String value = filterItemDTO.getValue();
|
||||
String whereTerm = transMysqlFilterTerm(filterItemDTO.getTerm());
|
||||
String whereValue = "";
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "null")) {
|
||||
whereValue = "";
|
||||
} else if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "not_null")) {
|
||||
@ -851,6 +858,7 @@ public class OracleQueryProvider extends QueryProvider {
|
||||
res.add("(" + String.join(" " + getLogic(request.getLogic()) + " ", strList) + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
return CollectionUtils.isNotEmpty(res) ? "(" + String.join(" AND ", res) + ")" : null;
|
||||
}
|
||||
|
||||
|
@ -762,15 +762,11 @@ public class PgQueryProvider extends QueryProvider {
|
||||
for (ChartFieldCustomFilterDTO request : requestList) {
|
||||
List<SQLObj> list = new ArrayList<>();
|
||||
DatasetTableField field = request.getField();
|
||||
List<ChartCustomFilterItemDTO> filter = request.getFilter();
|
||||
for (ChartCustomFilterItemDTO filterItemDTO : filter) {
|
||||
|
||||
if (ObjectUtils.isEmpty(field)) {
|
||||
continue;
|
||||
}
|
||||
String value = filterItemDTO.getValue();
|
||||
String whereName = "";
|
||||
String whereTerm = transMysqlFilterTerm(filterItemDTO.getTerm());
|
||||
String whereValue = "";
|
||||
String originName;
|
||||
if (ObjectUtils.isNotEmpty(field.getExtField()) && field.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
@ -794,6 +790,18 @@ public class PgQueryProvider extends QueryProvider {
|
||||
} else {
|
||||
whereName = originName;
|
||||
}
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(request.getFilterType(), "enum")) {
|
||||
if (CollectionUtils.isNotEmpty(request.getEnumCheckField())) {
|
||||
res.add("(" + whereName + " IN ('" + String.join("','", request.getEnumCheckField()) + "'))");
|
||||
}
|
||||
} else {
|
||||
List<ChartCustomFilterItemDTO> filter = request.getFilter();
|
||||
for (ChartCustomFilterItemDTO filterItemDTO : filter) {
|
||||
String value = filterItemDTO.getValue();
|
||||
String whereTerm = transMysqlFilterTerm(filterItemDTO.getTerm());
|
||||
String whereValue = "";
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "null")) {
|
||||
whereValue = "";
|
||||
} else if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "not_null")) {
|
||||
@ -821,6 +829,7 @@ public class PgQueryProvider extends QueryProvider {
|
||||
res.add("(" + String.join(" " + getLogic(request.getLogic()) + " ", strList) + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
return CollectionUtils.isNotEmpty(res) ? "(" + String.join(" AND ", res) + ")" : null;
|
||||
}
|
||||
|
||||
|
@ -703,15 +703,11 @@ public class RedshiftQueryProvider extends QueryProvider {
|
||||
for (ChartFieldCustomFilterDTO request : requestList) {
|
||||
List<SQLObj> list = new ArrayList<>();
|
||||
DatasetTableField field = request.getField();
|
||||
List<ChartCustomFilterItemDTO> filter = request.getFilter();
|
||||
for (ChartCustomFilterItemDTO filterItemDTO : filter) {
|
||||
|
||||
if (ObjectUtils.isEmpty(field)) {
|
||||
continue;
|
||||
}
|
||||
String value = filterItemDTO.getValue();
|
||||
String whereName = "";
|
||||
String whereTerm = transMysqlFilterTerm(filterItemDTO.getTerm());
|
||||
String whereValue = "";
|
||||
String originName;
|
||||
if (ObjectUtils.isNotEmpty(field.getExtField()) && field.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
@ -735,6 +731,18 @@ public class RedshiftQueryProvider extends QueryProvider {
|
||||
} else {
|
||||
whereName = originName;
|
||||
}
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(request.getFilterType(), "enum")) {
|
||||
if (CollectionUtils.isNotEmpty(request.getEnumCheckField())) {
|
||||
res.add("(" + whereName + " IN ('" + String.join("','", request.getEnumCheckField()) + "'))");
|
||||
}
|
||||
} else {
|
||||
List<ChartCustomFilterItemDTO> filter = request.getFilter();
|
||||
for (ChartCustomFilterItemDTO filterItemDTO : filter) {
|
||||
String value = filterItemDTO.getValue();
|
||||
String whereTerm = transMysqlFilterTerm(filterItemDTO.getTerm());
|
||||
String whereValue = "";
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "null")) {
|
||||
whereValue = PgConstants.WHERE_VALUE_NULL;
|
||||
} else if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "not_null")) {
|
||||
@ -758,6 +766,7 @@ public class RedshiftQueryProvider extends QueryProvider {
|
||||
res.add("(" + String.join(" " + getLogic(request.getLogic()) + " ", strList) + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
return CollectionUtils.isNotEmpty(res) ? "(" + String.join(" AND ", res) + ")" : null;
|
||||
}
|
||||
|
||||
|
@ -796,15 +796,11 @@ public class SqlserverQueryProvider extends QueryProvider {
|
||||
for (ChartFieldCustomFilterDTO request : requestList) {
|
||||
List<SQLObj> list = new ArrayList<>();
|
||||
DatasetTableField field = request.getField();
|
||||
List<ChartCustomFilterItemDTO> filter = request.getFilter();
|
||||
for (ChartCustomFilterItemDTO filterItemDTO : filter) {
|
||||
|
||||
if (ObjectUtils.isEmpty(field)) {
|
||||
continue;
|
||||
}
|
||||
String value = filterItemDTO.getValue();
|
||||
String whereName = "";
|
||||
String whereTerm = transMysqlFilterTerm(filterItemDTO.getTerm());
|
||||
String whereValue = "";
|
||||
String originName;
|
||||
if (ObjectUtils.isNotEmpty(field.getExtField()) && field.getExtField() == 2) {
|
||||
// 解析origin name中有关联的字段生成sql表达式
|
||||
@ -828,6 +824,18 @@ public class SqlserverQueryProvider extends QueryProvider {
|
||||
} else {
|
||||
whereName = originName;
|
||||
}
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(request.getFilterType(), "enum")) {
|
||||
if (CollectionUtils.isNotEmpty(request.getEnumCheckField())) {
|
||||
res.add("(" + whereName + " IN ('" + String.join("','", request.getEnumCheckField()) + "'))");
|
||||
}
|
||||
} else {
|
||||
List<ChartCustomFilterItemDTO> filter = request.getFilter();
|
||||
for (ChartCustomFilterItemDTO filterItemDTO : filter) {
|
||||
String value = filterItemDTO.getValue();
|
||||
String whereTerm = transMysqlFilterTerm(filterItemDTO.getTerm());
|
||||
String whereValue = "";
|
||||
|
||||
if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "null")) {
|
||||
whereValue = "";
|
||||
} else if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "not_null")) {
|
||||
@ -855,6 +863,7 @@ public class SqlserverQueryProvider extends QueryProvider {
|
||||
res.add("(" + String.join(" " + getLogic(request.getLogic()) + " ", strList) + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
return CollectionUtils.isNotEmpty(res) ? "(" + String.join(" AND ", res) + ")" : null;
|
||||
}
|
||||
|
||||
|
@ -509,7 +509,7 @@ public class ChartViewService {
|
||||
if (StringUtils.equalsIgnoreCase(resultData, "sub")) {
|
||||
item[dataIndex] = new BigDecimal(cValue).subtract(new BigDecimal(lastValue)).toString();
|
||||
} else if (StringUtils.equalsIgnoreCase(resultData, "percent")) {
|
||||
if (Integer.parseInt(lastValue) == 0) {
|
||||
if (new BigDecimal(lastValue).compareTo(BigDecimal.ZERO) == 0) {
|
||||
item[dataIndex] = null;
|
||||
} else {
|
||||
item[dataIndex] = new BigDecimal(cValue)
|
||||
|
@ -169,11 +169,7 @@ export default {
|
||||
this.$store.commit('setCurComponent', { component: this.config, index: this.index })
|
||||
},
|
||||
showViewDetails() {
|
||||
if (this.terminal === 'pc') {
|
||||
this.$refs.wrapperChild.openChartDetailsDialog()
|
||||
} else {
|
||||
this.previewVisible = true
|
||||
}
|
||||
},
|
||||
closePreview() {
|
||||
this.previewVisible = false
|
||||
|
@ -266,7 +266,7 @@ export default {
|
||||
if (this.terminal === 'pc') {
|
||||
this.chartDetailsVisible = true
|
||||
} else {
|
||||
this.mobileChartDetailsVisible
|
||||
this.mobileChartDetailsVisible = true
|
||||
}
|
||||
},
|
||||
exportExcel() {
|
||||
|
@ -23,6 +23,7 @@
|
||||
:chart="chart"
|
||||
:track-menu="trackMenu"
|
||||
:search-count="searchCount"
|
||||
:terminal-type="scaleCoefficientType"
|
||||
@onChartClick="chartClick"
|
||||
@onJumpClick="jumpClick"
|
||||
/>
|
||||
@ -141,10 +142,17 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
scaleCoefficient() {
|
||||
if (this.terminal === 'pc') {
|
||||
if (this.terminal === 'pc' && !this.mobileLayoutStatus) {
|
||||
return 1.1
|
||||
} else {
|
||||
return 4
|
||||
return 4.5
|
||||
}
|
||||
},
|
||||
scaleCoefficientType() {
|
||||
if (this.terminal === 'pc' && !this.mobileLayoutStatus) {
|
||||
return 'pc'
|
||||
} else {
|
||||
return 'mobile'
|
||||
}
|
||||
},
|
||||
editBarViewShowFlag() {
|
||||
@ -227,7 +235,8 @@ export default {
|
||||
'nowPanelTrackInfo',
|
||||
'nowPanelJumpInfo',
|
||||
'publicLinkStatus',
|
||||
'previewCanvasScale'
|
||||
'previewCanvasScale',
|
||||
'mobileLayoutStatus'
|
||||
])
|
||||
},
|
||||
|
||||
@ -310,17 +319,18 @@ export default {
|
||||
const scale = Math.min(this.previewCanvasScale.scalePointWidth, this.previewCanvasScale.scalePointHeight) * this.scaleCoefficient
|
||||
const customAttrChart = JSON.parse(this.sourceCustomAttrStr)
|
||||
const customStyleChart = JSON.parse(this.sourceCustomStyleStr)
|
||||
recursionTransObj(customAttrTrans, customAttrChart, scale)
|
||||
recursionTransObj(customStyleTrans, customStyleChart, scale)
|
||||
recursionTransObj(customAttrTrans, customAttrChart, scale, this.scaleCoefficientType)
|
||||
recursionTransObj(customStyleTrans, customStyleChart, scale, this.scaleCoefficientType)
|
||||
|
||||
// 移动端地图标签不显示
|
||||
if (this.chart.type === 'map' && this.scaleCoefficientType === 'mobile') {
|
||||
customAttrChart.label.show = false
|
||||
}
|
||||
this.chart = {
|
||||
...this.chart,
|
||||
customAttr: JSON.stringify(customAttrChart),
|
||||
customStyle: JSON.stringify(customStyleChart)
|
||||
}
|
||||
// console.log('customAttrChartSource:' + JSON.stringify(JSON.parse(this.sourceCustomAttrStr)))
|
||||
// console.log('customAttrChart:' + JSON.stringify(customAttrChart))
|
||||
// console.log('customStyleChartSource:' + JSON.stringify(JSON.parse(this.sourceCustomStyleStr)))
|
||||
// console.log('customStyleChart:' + JSON.stringify(customStyleChart))
|
||||
this.mergeStyle()
|
||||
},
|
||||
mergeStyle() {
|
||||
|
@ -150,27 +150,36 @@ export const customStyleTrans = {
|
||||
}
|
||||
}
|
||||
|
||||
// 移动端特殊属性
|
||||
export const mobileSpecialProps = {
|
||||
'lineWidth': 3, // 线宽固定值
|
||||
'lineSymbolSize': 5// 折点固定值
|
||||
}
|
||||
|
||||
export function getScaleValue(propValue, scale) {
|
||||
const propValueTemp = Math.round(propValue * scale)
|
||||
return propValueTemp > 1 ? propValueTemp : 1
|
||||
}
|
||||
|
||||
export function recursionTransObj(template, infoObj, scale) {
|
||||
// console.log('recursionObj++')
|
||||
export function recursionTransObj(template, infoObj, scale, terminal) {
|
||||
for (const templateKey in template) {
|
||||
// 如果是数组 进行赋值计算
|
||||
if (template[templateKey] instanceof Array) {
|
||||
template[templateKey].forEach(templateProp => {
|
||||
if (infoObj[templateKey] && infoObj[templateKey][templateProp]) {
|
||||
const afterValue = getScaleValue(infoObj[templateKey][templateProp], scale)
|
||||
console.log(templateKey + '.' + templateProp + '=' + infoObj[templateKey][templateProp] + ';scale:' + scale + ',after:' + afterValue)
|
||||
infoObj[templateKey][templateProp] = afterValue
|
||||
// 移动端特殊属性值设置
|
||||
if (terminal === 'mobile' && mobileSpecialProps[templateProp] !== undefined) {
|
||||
// console.log('mobile:' + templateProp + mobileSpecialProps[templateProp])
|
||||
infoObj[templateKey][templateProp] = mobileSpecialProps[templateProp]
|
||||
} else {
|
||||
infoObj[templateKey][templateProp] = getScaleValue(infoObj[templateKey][templateProp], scale)
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
// 如果是对象 继续进行递归
|
||||
if (infoObj[templateKey]) {
|
||||
recursionTransObj(template[templateKey], infoObj[templateKey], scale)
|
||||
recursionTransObj(template[templateKey], infoObj[templateKey], scale, terminal)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,8 +2,10 @@ import { hexColorToRGBA } from '@/views/chart/chart/util'
|
||||
import { componentStyle } from '../common/common'
|
||||
|
||||
let bubbleArray = []
|
||||
let terminalType = 'pc'
|
||||
|
||||
export function baseScatterOption(chart_option, chart) {
|
||||
export function baseScatterOption(chart_option, chart, terminal = 'pc') {
|
||||
terminalType = terminal
|
||||
// 处理shape attr
|
||||
let customAttr = {}
|
||||
if (chart.customAttr) {
|
||||
@ -59,7 +61,7 @@ export function baseScatterOption(chart_option, chart) {
|
||||
}
|
||||
|
||||
const funcSize = function(data) {
|
||||
const k = 80
|
||||
const k = terminalType === 'pc' ? 80 : 30
|
||||
const max = Math.max(...bubbleArray)
|
||||
return (data[2] / max) * k
|
||||
}
|
||||
|
@ -60,6 +60,10 @@ export default {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 0
|
||||
},
|
||||
terminalType: {
|
||||
type: String,
|
||||
default: 'pc'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -154,7 +158,7 @@ export default {
|
||||
} else if (chart.type === 'gauge') {
|
||||
chart_option = baseGaugeOption(JSON.parse(JSON.stringify(BASE_GAUGE)), chart)
|
||||
} else if (chart.type === 'scatter') {
|
||||
chart_option = baseScatterOption(JSON.parse(JSON.stringify(BASE_SCATTER)), chart)
|
||||
chart_option = baseScatterOption(JSON.parse(JSON.stringify(BASE_SCATTER)), chart, this.terminalType)
|
||||
} else if (chart.type === 'treemap') {
|
||||
chart_option = baseTreemapOption(JSON.parse(JSON.stringify(BASE_TREEMAP)), chart)
|
||||
} else if (chart.type === 'chart-mix') {
|
||||
|
@ -16,6 +16,7 @@
|
||||
<div style="display: inline-block;">
|
||||
<el-button icon="el-icon-plus" circle size="mini" style="margin-bottom: 10px;" @click="addFilter" />
|
||||
<el-radio-group
|
||||
v-show="item.filter && item.filter.length > 1"
|
||||
v-model="logic"
|
||||
size="mini"
|
||||
style="margin-left: 10px;"
|
||||
@ -61,6 +62,7 @@
|
||||
<el-select
|
||||
v-model="enumCheckField"
|
||||
filterable
|
||||
collapse-tags
|
||||
multiple
|
||||
:placeholder="$t('chart.pls_slc')"
|
||||
size="mini"
|
||||
@ -215,6 +217,7 @@ export default {
|
||||
mounted() {
|
||||
this.initOptions()
|
||||
this.init()
|
||||
this.initEnumOptions()
|
||||
},
|
||||
methods: {
|
||||
initOptions() {
|
||||
@ -232,10 +235,14 @@ export default {
|
||||
this.logic = this.item.logic
|
||||
this.filterType = this.item.filterType
|
||||
this.enumCheckField = this.item.enumCheckField
|
||||
// 查找枚举的
|
||||
},
|
||||
initEnumOptions() {
|
||||
// 查找枚举值
|
||||
if (this.item.deType === 0 || this.item.deType === 5) {
|
||||
multFieldValues([this.item.id]).then(res => {
|
||||
this.fieldOptions = this.optionDatas(res.data)
|
||||
})
|
||||
}
|
||||
},
|
||||
optionDatas(datas) {
|
||||
if (!datas) return null
|
||||
|
@ -112,7 +112,7 @@
|
||||
<el-row v-if="mobileLayoutStatus" class="mobile_canvas_main">
|
||||
<el-col :span="8" class="this_mobile_canvas_cell">
|
||||
<div
|
||||
v-proportion="2.5"
|
||||
v-proportion="2.1"
|
||||
:style="customCanvasMobileStyle"
|
||||
class="this_mobile_canvas"
|
||||
@drop="handleDrop"
|
||||
@ -955,10 +955,10 @@ export default {
|
||||
|
||||
.this_mobile_canvas{
|
||||
border-radius:30px;
|
||||
min-width: 280px;
|
||||
max-width: 300px;
|
||||
min-height: 700px;
|
||||
max-height: 750px;
|
||||
min-width: 300px;
|
||||
max-width: 350px;
|
||||
min-height: 600px;
|
||||
max-height: 700px;
|
||||
overflow: hidden;
|
||||
background-color: #000000;
|
||||
background-size:100% 100% !important;
|
||||
|
Loading…
Reference in New Issue
Block a user