diff --git a/README.md b/README.md index ec857810b3..e1cc6204b4 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ DataEase 是开源的数据可视化分析工具,帮助用户快速分析数 - [在线文档](https://dataease.io/docs/) - [社区论坛](https://bbs.fit2cloud.com/c/de/6) - [快速入门视频](https://www.bilibili.com/video/BV1Z84y1X7eF/) +- [嵌入式 BI 体验](https://embedded-bi.dataease.cn/) ## License diff --git a/core/core-backend/src/main/java/io/dataease/MybatisPlusGenerator.java b/core/core-backend/src/main/java/io/dataease/MybatisPlusGenerator.java index 12bd3304f8..0f1a1971a2 100644 --- a/core/core-backend/src/main/java/io/dataease/MybatisPlusGenerator.java +++ b/core/core-backend/src/main/java/io/dataease/MybatisPlusGenerator.java @@ -21,11 +21,11 @@ public class MybatisPlusGenerator { /** * 业务模块例如datasource,dataset,panel等 */ - private static final String busi = "template"; + private static final String busi = "visualization"; /** * 这是要生成代码的表名称 */ - private static final String TABLE_NAME = "visualization_template"; + private static final String TABLE_NAME = "visualization_outer_params_target_view_info"; /** * 下面两个配置基本上不用动 diff --git a/core/core-backend/src/main/java/io/dataease/engine/trans/CustomWhere2Str.java b/core/core-backend/src/main/java/io/dataease/engine/trans/CustomWhere2Str.java index 7b4bbb1929..599dc2c81f 100644 --- a/core/core-backend/src/main/java/io/dataease/engine/trans/CustomWhere2Str.java +++ b/core/core-backend/src/main/java/io/dataease/engine/trans/CustomWhere2Str.java @@ -6,13 +6,13 @@ import io.dataease.api.dataset.union.model.SQLMeta; import io.dataease.api.dataset.union.model.SQLObj; import io.dataease.dto.dataset.DatasetTableFieldDTO; import io.dataease.engine.constant.SQLConstants; -import io.dataease.engine.utils.DateUtils; import io.dataease.engine.utils.Utils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import java.util.ArrayList; import java.util.List; +import java.util.Map; /** * @Author Junjun @@ -47,18 +47,15 @@ public class CustomWhere2Str { if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) { // 此处获取标准格式的日期 whereName = String.format(SQLConstants.DE_STR_TO_DATE, originName, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : SQLConstants.DEFAULT_DATE_FORMAT); - whereName = String.format(SQLConstants.DATE_FORMAT, whereName, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : SQLConstants.DEFAULT_DATE_FORMAT); } if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) { String cast = String.format(SQLConstants.CAST, originName, SQLConstants.DEFAULT_INT_FORMAT); // 此处获取标准格式的日期 - whereName = String.format(SQLConstants.FROM_UNIXTIME, cast, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : SQLConstants.DEFAULT_DATE_FORMAT); - whereName = String.format(SQLConstants.DATE_FORMAT, whereName, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : SQLConstants.DEFAULT_DATE_FORMAT); + whereName = String.format(SQLConstants.FROM_UNIXTIME, cast, SQLConstants.DEFAULT_DATE_FORMAT); } if (field.getDeExtractType() == 1) { // 此处获取标准格式的日期 - String f = DateUtils.get_date_format(originName); - whereName = String.format(SQLConstants.DATE_FORMAT, originName, f); + whereName = originName; } } else if (field.getDeType() == 2 || field.getDeType() == 3) { if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) { @@ -88,14 +85,10 @@ public class CustomWhere2Str { String whereTerm = Utils.transFilterTerm(filterItemDTO.getTerm()); String whereValue = ""; - String whereNameReal; +// String whereNameReal; if (field.getDeType() == 1) { // 规定几种日期格式,一一匹配,匹配到就是该格式 - String f = DateUtils.get_date_format(filterItemDTO.getValue()); - String n = String.format(SQLConstants.DE_STR_TO_DATE, whereName, f); - whereNameReal = String.format(SQLConstants.UNIX_TIMESTAMP, n); - } else { - whereNameReal = whereName; + whereName = String.format(SQLConstants.UNIX_TIMESTAMP, whereName); } if (StringUtils.equalsIgnoreCase(filterItemDTO.getTerm(), "null")) { @@ -111,13 +104,27 @@ public class CustomWhere2Str { } else if (StringUtils.containsIgnoreCase(filterItemDTO.getTerm(), "like")) { whereValue = "'%" + value + "%'"; } else { + // 如果是时间字段过滤,当条件是等于和不等于的时候转换成between和not between if (field.getDeType() == 1) { - value = Utils.allDateFormat2Long(value) + ""; + if (StringUtils.containsIgnoreCase(whereTerm, "=")) { + whereTerm = " BETWEEN "; + // 把value类似过滤组件处理,获得start time和end time + Map stringLongMap = Utils.parseDateTimeValue(value); + whereValue = String.format(SQLConstants.WHERE_VALUE_BETWEEN, stringLongMap.get("startTime"), stringLongMap.get("endTime")); + } else if (StringUtils.containsIgnoreCase(whereTerm, "<>")) { + whereTerm = " NOT BETWEEN "; + Map stringLongMap = Utils.parseDateTimeValue(value); + whereValue = String.format(SQLConstants.WHERE_VALUE_BETWEEN, stringLongMap.get("startTime"), stringLongMap.get("endTime")); + } else { + value = Utils.allDateFormat2Long(value) + ""; + whereValue = String.format(SQLConstants.WHERE_VALUE_VALUE, value); + } + } else { + whereValue = String.format(SQLConstants.WHERE_VALUE_VALUE, value); } - whereValue = String.format(SQLConstants.WHERE_VALUE_VALUE, value); } list.add(SQLObj.builder() - .whereField(whereNameReal) + .whereField(whereName) .whereTermAndValue(whereTerm + whereValue) .build()); } diff --git a/core/core-backend/src/main/java/io/dataease/engine/trans/ExtWhere2Str.java b/core/core-backend/src/main/java/io/dataease/engine/trans/ExtWhere2Str.java index 6f8cb4b996..7382489ad2 100644 --- a/core/core-backend/src/main/java/io/dataease/engine/trans/ExtWhere2Str.java +++ b/core/core-backend/src/main/java/io/dataease/engine/trans/ExtWhere2Str.java @@ -5,7 +5,6 @@ import io.dataease.api.dataset.union.model.SQLMeta; import io.dataease.api.dataset.union.model.SQLObj; import io.dataease.dto.dataset.DatasetTableFieldDTO; import io.dataease.engine.constant.SQLConstants; -import io.dataease.engine.utils.DateUtils; import io.dataease.engine.utils.Utils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; @@ -53,12 +52,6 @@ public class ExtWhere2Str { } if (field.getDeType() == 1) { - String date_format; - if (StringUtils.containsIgnoreCase(request.getOperator(), "between")) { - date_format = "yyyy-MM-dd HH:mm:ss"; - } else { - date_format = DateUtils.get_date_format(value.get(0)); - } if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) { // 此处获取标准格式的日期 whereName = String.format(SQLConstants.DE_STR_TO_DATE, originName, StringUtils.isEmpty(field.getDateFormat()) ? SQLConstants.DEFAULT_DATE_FORMAT : field.getDateFormat()); @@ -66,12 +59,12 @@ public class ExtWhere2Str { if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) { String cast = String.format(SQLConstants.CAST, originName, SQLConstants.DEFAULT_INT_FORMAT); // 此处获取标准格式的日期 - whereName = String.format(SQLConstants.FROM_UNIXTIME, cast, date_format); + whereName = String.format(SQLConstants.FROM_UNIXTIME, cast, SQLConstants.DEFAULT_DATE_FORMAT); whereName = String.format(SQLConstants.UNIX_TIMESTAMP, whereName); } if (field.getDeExtractType() == 1) { // 此处获取标准格式的日期 - whereName = String.format(SQLConstants.DE_STR_TO_DATE, originName, StringUtils.isEmpty(field.getDateFormat()) ? SQLConstants.DEFAULT_DATE_FORMAT : field.getDateFormat()); + whereName = originName; } } else if (field.getDeType() == 2 || field.getDeType() == 3) { if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) { diff --git a/core/core-backend/src/main/java/io/dataease/engine/trans/WhereTree2Str.java b/core/core-backend/src/main/java/io/dataease/engine/trans/WhereTree2Str.java index 5ae06c268c..3f29d4b060 100644 --- a/core/core-backend/src/main/java/io/dataease/engine/trans/WhereTree2Str.java +++ b/core/core-backend/src/main/java/io/dataease/engine/trans/WhereTree2Str.java @@ -8,7 +8,6 @@ import io.dataease.api.permissions.dataset.dto.DatasetRowPermissionsTreeObj; import io.dataease.dto.dataset.DatasetTableFieldDTO; import io.dataease.engine.constant.ExtFieldConstant; import io.dataease.engine.constant.SQLConstants; -import io.dataease.engine.utils.DateUtils; import io.dataease.engine.utils.Utils; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; @@ -16,6 +15,7 @@ import org.apache.commons.lang3.StringUtils; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; /** @@ -92,16 +92,13 @@ public class WhereTree2Str { if (field.getDeType() == 1) { if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) { whereName = String.format(SQLConstants.DE_STR_TO_DATE, originName, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : SQLConstants.DEFAULT_DATE_FORMAT); - whereName = String.format(SQLConstants.DATE_FORMAT, whereName, StringUtils.isNotEmpty(field.getDateFormat()) ? field.getDateFormat() : SQLConstants.DEFAULT_DATE_FORMAT); } if (field.getDeExtractType() == 2 || field.getDeExtractType() == 3 || field.getDeExtractType() == 4) { String cast = String.format(SQLConstants.CAST, originName, SQLConstants.DEFAULT_INT_FORMAT); whereName = String.format(SQLConstants.FROM_UNIXTIME, cast, SQLConstants.DEFAULT_DATE_FORMAT); - whereName = String.format(SQLConstants.DATE_FORMAT, whereName, SQLConstants.DEFAULT_DATE_FORMAT); } if (field.getDeExtractType() == 1) { - String f = DateUtils.get_date_format(originName); - whereName = String.format(SQLConstants.DATE_FORMAT, originName, f); + whereName = originName; } } else if (field.getDeType() == 2 || field.getDeType() == 3) { if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) { @@ -130,16 +127,7 @@ public class WhereTree2Str { String whereValue = ""; if (field.getDeType() == 1) { - // 规定几种日期格式,一一匹配,匹配到就是该格式 - if (field.getDeExtractType() == 0 || field.getDeExtractType() == 5) { - String f = DateUtils.get_date_format(item.getValue()); - whereName = String.format(SQLConstants.DE_STR_TO_DATE, whereName, f); - whereName = String.format(SQLConstants.UNIX_TIMESTAMP, whereName); - } else { - String f = DateUtils.get_date_format(item.getValue()); - whereName = String.format(SQLConstants.DE_STR_TO_DATE, whereName, f); - whereName = String.format(SQLConstants.UNIX_TIMESTAMP, whereName); - } + whereName = String.format(SQLConstants.UNIX_TIMESTAMP, whereName); } if (StringUtils.equalsIgnoreCase(item.getTerm(), "null")) { @@ -155,10 +143,24 @@ public class WhereTree2Str { } else if (StringUtils.containsIgnoreCase(item.getTerm(), "like")) { whereValue = "'%" + value + "%'"; } else { + // 如果是时间字段过滤,当条件是等于和不等于的时候转换成between和not between if (field.getDeType() == 1) { - value = Utils.allDateFormat2Long(value) + ""; + if (StringUtils.containsIgnoreCase(whereTerm, "=")) { + whereTerm = " BETWEEN "; + // 把value类似过滤组件处理,获得start time和end time + Map stringLongMap = Utils.parseDateTimeValue(value); + whereValue = String.format(SQLConstants.WHERE_VALUE_BETWEEN, stringLongMap.get("startTime"), stringLongMap.get("endTime")); + } else if (StringUtils.containsIgnoreCase(whereTerm, "<>")) { + whereTerm = " NOT BETWEEN "; + Map stringLongMap = Utils.parseDateTimeValue(value); + whereValue = String.format(SQLConstants.WHERE_VALUE_BETWEEN, stringLongMap.get("startTime"), stringLongMap.get("endTime")); + } else { + value = Utils.allDateFormat2Long(value) + ""; + whereValue = String.format(SQLConstants.WHERE_VALUE_VALUE, value); + } + } else { + whereValue = String.format(SQLConstants.WHERE_VALUE_VALUE, value); } - whereValue = String.format(SQLConstants.WHERE_VALUE_VALUE, value); } SQLObj build = SQLObj.builder() .whereField(whereName) diff --git a/core/core-backend/src/main/java/io/dataease/engine/utils/Utils.java b/core/core-backend/src/main/java/io/dataease/engine/utils/Utils.java index a41b3589a0..02afda803a 100644 --- a/core/core-backend/src/main/java/io/dataease/engine/utils/Utils.java +++ b/core/core-backend/src/main/java/io/dataease/engine/utils/Utils.java @@ -273,4 +273,97 @@ public class Utils { } return time; } + + public static Map parseDateTimeValue(String value) { + Map map = new LinkedHashMap<>(); + long startTime = 0; + long endTime = 0; + + String split = "-"; + if (value != null && value.contains("/")) { + split = "/"; + } + try { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy" + split + "MM" + split + "dd HH:mm:ss"); + startTime = simpleDateFormat.parse(value).getTime(); + endTime = startTime + 999; + + map.put("startTime", startTime); + map.put("endTime", endTime); + return map; + } catch (Exception e) { + } + try { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy" + split + "MM" + split + "dd HH:mm"); + startTime = simpleDateFormat.parse(value).getTime(); + endTime = startTime + (60 * 1000 - 1); + + map.put("startTime", startTime); + map.put("endTime", endTime); + return map; + } catch (Exception e) { + } + try { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy" + split + "MM" + split + "dd HH"); + startTime = simpleDateFormat.parse(value).getTime(); + endTime = startTime + (60 * 60 * 1000 - 1); + + map.put("startTime", startTime); + map.put("endTime", endTime); + return map; + } catch (Exception e) { + } + try { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm:ss"); + startTime = simpleDateFormat.parse(value).getTime(); + endTime = startTime + 999; + + map.put("startTime", startTime); + map.put("endTime", endTime); + return map; + } catch (Exception e) { + } + try { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy" + split + "MM" + split + "dd"); + startTime = simpleDateFormat.parse(value).getTime(); + endTime = startTime + (24 * 60 * 60 * 1000 - 1); + + map.put("startTime", startTime); + map.put("endTime", endTime); + return map; + } catch (Exception e) { + } + try { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy" + split + "MM"); + Date parse = simpleDateFormat.parse(value); + startTime = parse.getTime(); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(parse); + calendar.add(Calendar.MONTH, 1); + endTime = calendar.getTime().getTime() - 1; + + map.put("startTime", startTime); + map.put("endTime", endTime); + return map; + } catch (Exception e) { + } + try { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy"); + Date parse = simpleDateFormat.parse(value); + startTime = parse.getTime(); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(parse); + calendar.add(Calendar.YEAR, 1); + endTime = calendar.getTime().getTime() - 1; + + map.put("startTime", startTime); + map.put("endTime", endTime); + return map; + } catch (Exception e) { + } + + map.put("startTime", startTime); + map.put("endTime", endTime); + return map; + } } diff --git a/core/core-backend/src/main/java/io/dataease/visualization/dao/auto/entity/VisualizationOuterParams.java b/core/core-backend/src/main/java/io/dataease/visualization/dao/auto/entity/VisualizationOuterParams.java new file mode 100644 index 0000000000..79f61e6c1e --- /dev/null +++ b/core/core-backend/src/main/java/io/dataease/visualization/dao/auto/entity/VisualizationOuterParams.java @@ -0,0 +1,108 @@ +package io.dataease.visualization.dao.auto.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; + +/** + *

+ * 外部参数关联关系表 + *

+ * + * @author fit2cloud + * @since 2024-03-08 + */ +@TableName("visualization_outer_params") +public class VisualizationOuterParams implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String paramsId; + + /** + * 可视化资源ID + */ + private String visualizationId; + + /** + * 是否启用外部参数标识(1-是,0-否) + */ + private Boolean checked; + + /** + * 备注 + */ + private String remark; + + /** + * 复制来源 + */ + private String copyFrom; + + /** + * 复制来源ID + */ + private String copyId; + + public String getParamsId() { + return paramsId; + } + + public void setParamsId(String paramsId) { + this.paramsId = paramsId; + } + + public String getVisualizationId() { + return visualizationId; + } + + public void setVisualizationId(String visualizationId) { + this.visualizationId = visualizationId; + } + + public Boolean getChecked() { + return checked; + } + + public void setChecked(Boolean checked) { + this.checked = checked; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getCopyFrom() { + return copyFrom; + } + + public void setCopyFrom(String copyFrom) { + this.copyFrom = copyFrom; + } + + public String getCopyId() { + return copyId; + } + + public void setCopyId(String copyId) { + this.copyId = copyId; + } + + @Override + public String toString() { + return "VisualizationOuterParams{" + + "paramsId = " + paramsId + + ", visualizationId = " + visualizationId + + ", checked = " + checked + + ", remark = " + remark + + ", copyFrom = " + copyFrom + + ", copyId = " + copyId + + "}"; + } +} diff --git a/core/core-backend/src/main/java/io/dataease/visualization/dao/auto/entity/VisualizationOuterParamsInfo.java b/core/core-backend/src/main/java/io/dataease/visualization/dao/auto/entity/VisualizationOuterParamsInfo.java new file mode 100644 index 0000000000..f6ea29e0d9 --- /dev/null +++ b/core/core-backend/src/main/java/io/dataease/visualization/dao/auto/entity/VisualizationOuterParamsInfo.java @@ -0,0 +1,108 @@ +package io.dataease.visualization.dao.auto.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; + +/** + *

+ * 外部参数配置表 + *

+ * + * @author fit2cloud + * @since 2024-03-08 + */ +@TableName("visualization_outer_params_info") +public class VisualizationOuterParamsInfo implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String paramsInfoId; + + /** + * visualization_outer_params 表的 ID + */ + private String paramsId; + + /** + * 参数名 + */ + private String paramName; + + /** + * 是否启用 + */ + private Boolean checked; + + /** + * 复制来源 + */ + private String copyFrom; + + /** + * 复制来源ID + */ + private String copyId; + + public String getParamsInfoId() { + return paramsInfoId; + } + + public void setParamsInfoId(String paramsInfoId) { + this.paramsInfoId = paramsInfoId; + } + + public String getParamsId() { + return paramsId; + } + + public void setParamsId(String paramsId) { + this.paramsId = paramsId; + } + + public String getParamName() { + return paramName; + } + + public void setParamName(String paramName) { + this.paramName = paramName; + } + + public Boolean getChecked() { + return checked; + } + + public void setChecked(Boolean checked) { + this.checked = checked; + } + + public String getCopyFrom() { + return copyFrom; + } + + public void setCopyFrom(String copyFrom) { + this.copyFrom = copyFrom; + } + + public String getCopyId() { + return copyId; + } + + public void setCopyId(String copyId) { + this.copyId = copyId; + } + + @Override + public String toString() { + return "VisualizationOuterParamsInfo{" + + "paramsInfoId = " + paramsInfoId + + ", paramsId = " + paramsId + + ", paramName = " + paramName + + ", checked = " + checked + + ", copyFrom = " + copyFrom + + ", copyId = " + copyId + + "}"; + } +} diff --git a/core/core-backend/src/main/java/io/dataease/visualization/dao/auto/entity/VisualizationOuterParamsTargetViewInfo.java b/core/core-backend/src/main/java/io/dataease/visualization/dao/auto/entity/VisualizationOuterParamsTargetViewInfo.java new file mode 100644 index 0000000000..393127f6f2 --- /dev/null +++ b/core/core-backend/src/main/java/io/dataease/visualization/dao/auto/entity/VisualizationOuterParamsTargetViewInfo.java @@ -0,0 +1,108 @@ +package io.dataease.visualization.dao.auto.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; + +/** + *

+ * 外部参数联动视图字段信息表 + *

+ * + * @author fit2cloud + * @since 2024-03-08 + */ +@TableName("visualization_outer_params_target_view_info") +public class VisualizationOuterParamsTargetViewInfo implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String targetId; + + /** + * visualization_outer_params_info 表的 ID + */ + private String paramsInfoId; + + /** + * 联动视图ID + */ + private String targetViewId; + + /** + * 联动字段ID + */ + private String targetFieldId; + + /** + * 复制来源 + */ + private String copyFrom; + + /** + * 复制来源ID + */ + private String copyId; + + public String getTargetId() { + return targetId; + } + + public void setTargetId(String targetId) { + this.targetId = targetId; + } + + public String getParamsInfoId() { + return paramsInfoId; + } + + public void setParamsInfoId(String paramsInfoId) { + this.paramsInfoId = paramsInfoId; + } + + public String getTargetViewId() { + return targetViewId; + } + + public void setTargetViewId(String targetViewId) { + this.targetViewId = targetViewId; + } + + public String getTargetFieldId() { + return targetFieldId; + } + + public void setTargetFieldId(String targetFieldId) { + this.targetFieldId = targetFieldId; + } + + public String getCopyFrom() { + return copyFrom; + } + + public void setCopyFrom(String copyFrom) { + this.copyFrom = copyFrom; + } + + public String getCopyId() { + return copyId; + } + + public void setCopyId(String copyId) { + this.copyId = copyId; + } + + @Override + public String toString() { + return "VisualizationOuterParamsTargetViewInfo{" + + "targetId = " + targetId + + ", paramsInfoId = " + paramsInfoId + + ", targetViewId = " + targetViewId + + ", targetFieldId = " + targetFieldId + + ", copyFrom = " + copyFrom + + ", copyId = " + copyId + + "}"; + } +} diff --git a/core/core-backend/src/main/java/io/dataease/visualization/dao/auto/mapper/VisualizationOuterParamsInfoMapper.java b/core/core-backend/src/main/java/io/dataease/visualization/dao/auto/mapper/VisualizationOuterParamsInfoMapper.java new file mode 100644 index 0000000000..5553c7325b --- /dev/null +++ b/core/core-backend/src/main/java/io/dataease/visualization/dao/auto/mapper/VisualizationOuterParamsInfoMapper.java @@ -0,0 +1,18 @@ +package io.dataease.visualization.dao.auto.mapper; + +import io.dataease.visualization.dao.auto.entity.VisualizationOuterParamsInfo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 外部参数配置表 Mapper 接口 + *

+ * + * @author fit2cloud + * @since 2024-03-08 + */ +@Mapper +public interface VisualizationOuterParamsInfoMapper extends BaseMapper { + +} diff --git a/core/core-backend/src/main/java/io/dataease/visualization/dao/auto/mapper/VisualizationOuterParamsMapper.java b/core/core-backend/src/main/java/io/dataease/visualization/dao/auto/mapper/VisualizationOuterParamsMapper.java new file mode 100644 index 0000000000..1b87b7e077 --- /dev/null +++ b/core/core-backend/src/main/java/io/dataease/visualization/dao/auto/mapper/VisualizationOuterParamsMapper.java @@ -0,0 +1,18 @@ +package io.dataease.visualization.dao.auto.mapper; + +import io.dataease.visualization.dao.auto.entity.VisualizationOuterParams; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 外部参数关联关系表 Mapper 接口 + *

+ * + * @author fit2cloud + * @since 2024-03-08 + */ +@Mapper +public interface VisualizationOuterParamsMapper extends BaseMapper { + +} diff --git a/core/core-backend/src/main/java/io/dataease/visualization/dao/auto/mapper/VisualizationOuterParamsTargetViewInfoMapper.java b/core/core-backend/src/main/java/io/dataease/visualization/dao/auto/mapper/VisualizationOuterParamsTargetViewInfoMapper.java new file mode 100644 index 0000000000..1d4f56197a --- /dev/null +++ b/core/core-backend/src/main/java/io/dataease/visualization/dao/auto/mapper/VisualizationOuterParamsTargetViewInfoMapper.java @@ -0,0 +1,18 @@ +package io.dataease.visualization.dao.auto.mapper; + +import io.dataease.visualization.dao.auto.entity.VisualizationOuterParamsTargetViewInfo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + *

+ * 外部参数联动视图字段信息表 Mapper 接口 + *

+ * + * @author fit2cloud + * @since 2024-03-08 + */ +@Mapper +public interface VisualizationOuterParamsTargetViewInfoMapper extends BaseMapper { + +} diff --git a/core/core-frontend/src/api/visualization/dataVisualization.ts b/core/core-frontend/src/api/visualization/dataVisualization.ts index 4cc7e31538..73f5143273 100644 --- a/core/core-frontend/src/api/visualization/dataVisualization.ts +++ b/core/core-frontend/src/api/visualization/dataVisualization.ts @@ -73,3 +73,18 @@ export const storeStatusApi = (id: string): Promise => { } export const decompression = data => request.post({ url: '/dataVisualization/decompression', data }) + +export const detailList = dvId => { + return request.get({ + url: '/dataVisualization/view/detailList/' + dvId, + method: 'get', + loading: false + }) +} + +export const getComponentInfo = dvId => { + return request.get({ + url: '/panel/view/getComponentInfo/' + dvId, + loading: false + }) +} diff --git a/core/core-frontend/src/api/visualization/outerParams.ts b/core/core-frontend/src/api/visualization/outerParams.ts index c42924cd74..faa57deea5 100644 --- a/core/core-frontend/src/api/visualization/outerParams.ts +++ b/core/core-frontend/src/api/visualization/outerParams.ts @@ -1,8 +1,8 @@ import request from '@/config/axios' -export function queryWithPanelId(panelId) { +export function queryWithDvId(dvId) { return request.get({ - url: '/outerParams/queryWithPanelId/' + panelId + url: '/outerParams/queryWithDvId/' + dvId }) } @@ -14,9 +14,10 @@ export function updateOuterParamsSet(requestInfo) { }) } -export function getOuterParamsInfo(panelId) { +export function getOuterParamsInfo(dvId) { return request.get({ - url: '/outerParams/getOuterParamsInfo/' + panelId, - loading: true + url: '/outerParams/getOuterParamsInfo/' + dvId, + method: 'get', + loading: false }) } diff --git a/core/core-frontend/src/components/visualization/outer-params-set/index.vue b/core/core-frontend/src/components/visualization/outer-params-set/index.vue new file mode 100644 index 0000000000..fc22af9a25 --- /dev/null +++ b/core/core-frontend/src/components/visualization/outer-params-set/index.vue @@ -0,0 +1,567 @@ + + + + + diff --git a/core/core-frontend/src/layout/components/Menu.vue b/core/core-frontend/src/layout/components/Menu.vue index c3875e0f82..31f9faa6e0 100644 --- a/core/core-frontend/src/layout/components/Menu.vue +++ b/core/core-frontend/src/layout/components/Menu.vue @@ -4,6 +4,14 @@ import { ElMenu } from 'element-plus-secondary' import { useRoute, useRouter } from 'vue-router' import { isExternal } from '@/utils/validate' import MenuItem from './MenuItem.vue' +import { useAppearanceStoreWithOut } from '@/store/modules/appearance' +const appearanceStore = useAppearanceStoreWithOut() +const tempColor = computed(() => { + return { + '--temp-color': + (appearanceStore.themeColor === 'custom' ? appearanceStore.customColor : '#3370FF') + '1A' + } +}) const isCollapse = ref(false) const route = useRoute() const { push } = useRouter() @@ -26,6 +34,7 @@ const menuSelect = (index: string, indexPath: string[]) => {