feat: 模板新建仪表板可以更换数据集,未更换显示模板视图数据,并提示

This commit is contained in:
wangjiahao 2022-03-16 18:09:16 +08:00
parent ca6ad712c1
commit 343a386955
26 changed files with 555 additions and 435 deletions

View File

@ -1,42 +1,41 @@
package io.dataease.base.domain;
import java.io.Serializable;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ChartView implements Serializable {
@ApiModelProperty("ID")
private String id;
@ApiModelProperty("名称")
private String name;
@ApiModelProperty("数据集ID")
private String tableId;
@ApiModelProperty("图表类型")
private String type;
@ApiModelProperty("渲染方式")
private String render;
@ApiModelProperty("展示结果数量")
private Integer resultCount;
@ApiModelProperty("展示结果")
private String resultMode;
@ApiModelProperty("标题")
private String title;
@ApiModelProperty("场景ID")
private String sceneId;
@ApiModelProperty("创建人")
private String tableId;
private String type;
private String render;
private Integer resultCount;
private String resultMode;
private String createBy;
@ApiModelProperty("创建时间")
private Long createTime;
@ApiModelProperty("更新时间")
private Long updateTime;
@ApiModelProperty("样式优先级")
private String stylePriority;
@ApiModelProperty("public or private")
private String chartType;
@ApiModelProperty("是否插件")
private Boolean isPlugin;
private String dataFrom;
private static final long serialVersionUID = 1L;
}
}

View File

@ -35,5 +35,7 @@ public class ChartViewCache implements Serializable {
private Boolean isPlugin;
private String dataFrom;
private static final long serialVersionUID = 1L;
}

View File

@ -1113,6 +1113,76 @@ public class ChartViewCacheExample {
addCriterion("is_plugin not between", value1, value2, "isPlugin");
return (Criteria) this;
}
public Criteria andDataFromIsNull() {
addCriterion("data_from is null");
return (Criteria) this;
}
public Criteria andDataFromIsNotNull() {
addCriterion("data_from is not null");
return (Criteria) this;
}
public Criteria andDataFromEqualTo(String value) {
addCriterion("data_from =", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromNotEqualTo(String value) {
addCriterion("data_from <>", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromGreaterThan(String value) {
addCriterion("data_from >", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromGreaterThanOrEqualTo(String value) {
addCriterion("data_from >=", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromLessThan(String value) {
addCriterion("data_from <", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromLessThanOrEqualTo(String value) {
addCriterion("data_from <=", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromLike(String value) {
addCriterion("data_from like", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromNotLike(String value) {
addCriterion("data_from not like", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromIn(List<String> values) {
addCriterion("data_from in", values, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromNotIn(List<String> values) {
addCriterion("data_from not in", values, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromBetween(String value1, String value2) {
addCriterion("data_from between", value1, value2, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromNotBetween(String value1, String value2) {
addCriterion("data_from not between", value1, value2, "dataFrom");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

View File

@ -244,6 +244,146 @@ public class ChartViewExample {
return (Criteria) this;
}
public Criteria andTitleIsNull() {
addCriterion("title is null");
return (Criteria) this;
}
public Criteria andTitleIsNotNull() {
addCriterion("title is not null");
return (Criteria) this;
}
public Criteria andTitleEqualTo(String value) {
addCriterion("title =", value, "title");
return (Criteria) this;
}
public Criteria andTitleNotEqualTo(String value) {
addCriterion("title <>", value, "title");
return (Criteria) this;
}
public Criteria andTitleGreaterThan(String value) {
addCriterion("title >", value, "title");
return (Criteria) this;
}
public Criteria andTitleGreaterThanOrEqualTo(String value) {
addCriterion("title >=", value, "title");
return (Criteria) this;
}
public Criteria andTitleLessThan(String value) {
addCriterion("title <", value, "title");
return (Criteria) this;
}
public Criteria andTitleLessThanOrEqualTo(String value) {
addCriterion("title <=", value, "title");
return (Criteria) this;
}
public Criteria andTitleLike(String value) {
addCriterion("title like", value, "title");
return (Criteria) this;
}
public Criteria andTitleNotLike(String value) {
addCriterion("title not like", value, "title");
return (Criteria) this;
}
public Criteria andTitleIn(List<String> values) {
addCriterion("title in", values, "title");
return (Criteria) this;
}
public Criteria andTitleNotIn(List<String> values) {
addCriterion("title not in", values, "title");
return (Criteria) this;
}
public Criteria andTitleBetween(String value1, String value2) {
addCriterion("title between", value1, value2, "title");
return (Criteria) this;
}
public Criteria andTitleNotBetween(String value1, String value2) {
addCriterion("title not between", value1, value2, "title");
return (Criteria) this;
}
public Criteria andSceneIdIsNull() {
addCriterion("scene_id is null");
return (Criteria) this;
}
public Criteria andSceneIdIsNotNull() {
addCriterion("scene_id is not null");
return (Criteria) this;
}
public Criteria andSceneIdEqualTo(String value) {
addCriterion("scene_id =", value, "sceneId");
return (Criteria) this;
}
public Criteria andSceneIdNotEqualTo(String value) {
addCriterion("scene_id <>", value, "sceneId");
return (Criteria) this;
}
public Criteria andSceneIdGreaterThan(String value) {
addCriterion("scene_id >", value, "sceneId");
return (Criteria) this;
}
public Criteria andSceneIdGreaterThanOrEqualTo(String value) {
addCriterion("scene_id >=", value, "sceneId");
return (Criteria) this;
}
public Criteria andSceneIdLessThan(String value) {
addCriterion("scene_id <", value, "sceneId");
return (Criteria) this;
}
public Criteria andSceneIdLessThanOrEqualTo(String value) {
addCriterion("scene_id <=", value, "sceneId");
return (Criteria) this;
}
public Criteria andSceneIdLike(String value) {
addCriterion("scene_id like", value, "sceneId");
return (Criteria) this;
}
public Criteria andSceneIdNotLike(String value) {
addCriterion("scene_id not like", value, "sceneId");
return (Criteria) this;
}
public Criteria andSceneIdIn(List<String> values) {
addCriterion("scene_id in", values, "sceneId");
return (Criteria) this;
}
public Criteria andSceneIdNotIn(List<String> values) {
addCriterion("scene_id not in", values, "sceneId");
return (Criteria) this;
}
public Criteria andSceneIdBetween(String value1, String value2) {
addCriterion("scene_id between", value1, value2, "sceneId");
return (Criteria) this;
}
public Criteria andSceneIdNotBetween(String value1, String value2) {
addCriterion("scene_id not between", value1, value2, "sceneId");
return (Criteria) this;
}
public Criteria andTableIdIsNull() {
addCriterion("table_id is null");
return (Criteria) this;
@ -584,146 +724,6 @@ public class ChartViewExample {
return (Criteria) this;
}
public Criteria andTitleIsNull() {
addCriterion("title is null");
return (Criteria) this;
}
public Criteria andTitleIsNotNull() {
addCriterion("title is not null");
return (Criteria) this;
}
public Criteria andTitleEqualTo(String value) {
addCriterion("title =", value, "title");
return (Criteria) this;
}
public Criteria andTitleNotEqualTo(String value) {
addCriterion("title <>", value, "title");
return (Criteria) this;
}
public Criteria andTitleGreaterThan(String value) {
addCriterion("title >", value, "title");
return (Criteria) this;
}
public Criteria andTitleGreaterThanOrEqualTo(String value) {
addCriterion("title >=", value, "title");
return (Criteria) this;
}
public Criteria andTitleLessThan(String value) {
addCriterion("title <", value, "title");
return (Criteria) this;
}
public Criteria andTitleLessThanOrEqualTo(String value) {
addCriterion("title <=", value, "title");
return (Criteria) this;
}
public Criteria andTitleLike(String value) {
addCriterion("title like", value, "title");
return (Criteria) this;
}
public Criteria andTitleNotLike(String value) {
addCriterion("title not like", value, "title");
return (Criteria) this;
}
public Criteria andTitleIn(List<String> values) {
addCriterion("title in", values, "title");
return (Criteria) this;
}
public Criteria andTitleNotIn(List<String> values) {
addCriterion("title not in", values, "title");
return (Criteria) this;
}
public Criteria andTitleBetween(String value1, String value2) {
addCriterion("title between", value1, value2, "title");
return (Criteria) this;
}
public Criteria andTitleNotBetween(String value1, String value2) {
addCriterion("title not between", value1, value2, "title");
return (Criteria) this;
}
public Criteria andSceneIdIsNull() {
addCriterion("scene_id is null");
return (Criteria) this;
}
public Criteria andSceneIdIsNotNull() {
addCriterion("scene_id is not null");
return (Criteria) this;
}
public Criteria andSceneIdEqualTo(String value) {
addCriterion("scene_id =", value, "sceneId");
return (Criteria) this;
}
public Criteria andSceneIdNotEqualTo(String value) {
addCriterion("scene_id <>", value, "sceneId");
return (Criteria) this;
}
public Criteria andSceneIdGreaterThan(String value) {
addCriterion("scene_id >", value, "sceneId");
return (Criteria) this;
}
public Criteria andSceneIdGreaterThanOrEqualTo(String value) {
addCriterion("scene_id >=", value, "sceneId");
return (Criteria) this;
}
public Criteria andSceneIdLessThan(String value) {
addCriterion("scene_id <", value, "sceneId");
return (Criteria) this;
}
public Criteria andSceneIdLessThanOrEqualTo(String value) {
addCriterion("scene_id <=", value, "sceneId");
return (Criteria) this;
}
public Criteria andSceneIdLike(String value) {
addCriterion("scene_id like", value, "sceneId");
return (Criteria) this;
}
public Criteria andSceneIdNotLike(String value) {
addCriterion("scene_id not like", value, "sceneId");
return (Criteria) this;
}
public Criteria andSceneIdIn(List<String> values) {
addCriterion("scene_id in", values, "sceneId");
return (Criteria) this;
}
public Criteria andSceneIdNotIn(List<String> values) {
addCriterion("scene_id not in", values, "sceneId");
return (Criteria) this;
}
public Criteria andSceneIdBetween(String value1, String value2) {
addCriterion("scene_id between", value1, value2, "sceneId");
return (Criteria) this;
}
public Criteria andSceneIdNotBetween(String value1, String value2) {
addCriterion("scene_id not between", value1, value2, "sceneId");
return (Criteria) this;
}
public Criteria andCreateByIsNull() {
addCriterion("create_by is null");
return (Criteria) this;
@ -1113,6 +1113,76 @@ public class ChartViewExample {
addCriterion("is_plugin not between", value1, value2, "isPlugin");
return (Criteria) this;
}
public Criteria andDataFromIsNull() {
addCriterion("data_from is null");
return (Criteria) this;
}
public Criteria andDataFromIsNotNull() {
addCriterion("data_from is not null");
return (Criteria) this;
}
public Criteria andDataFromEqualTo(String value) {
addCriterion("data_from =", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromNotEqualTo(String value) {
addCriterion("data_from <>", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromGreaterThan(String value) {
addCriterion("data_from >", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromGreaterThanOrEqualTo(String value) {
addCriterion("data_from >=", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromLessThan(String value) {
addCriterion("data_from <", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromLessThanOrEqualTo(String value) {
addCriterion("data_from <=", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromLike(String value) {
addCriterion("data_from like", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromNotLike(String value) {
addCriterion("data_from not like", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromIn(List<String> values) {
addCriterion("data_from in", values, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromNotIn(List<String> values) {
addCriterion("data_from not in", values, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromBetween(String value1, String value2) {
addCriterion("data_from between", value1, value2, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromNotBetween(String value1, String value2) {
addCriterion("data_from not between", value1, value2, "dataFrom");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
@ -1207,4 +1277,4 @@ public class ChartViewExample {
this(condition, value, secondValue, null);
}
}
}
}

View File

@ -1,8 +1,6 @@
package io.dataease.base.domain;
import java.io.Serializable;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@ -11,30 +9,29 @@ import lombok.ToString;
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ChartViewWithBLOBs extends ChartView implements Serializable {
@ApiModelProperty("x轴")
private String xAxis;
@ApiModelProperty("x副轴")
private String xAxisExt;
@ApiModelProperty("y轴")
private String yAxis;
@ApiModelProperty("y副轴")
private String yAxisExt;
@ApiModelProperty("堆叠字段")
private String extStack;
@ApiModelProperty("气泡大小字段")
private String extBubble;
@ApiModelProperty("图形属性")
private String customAttr;
@ApiModelProperty("组件样式")
private String customStyle;
@ApiModelProperty("过滤器字段")
private String customFilter;
@ApiModelProperty("下钻字段")
private String drillFields;
@ApiModelProperty("高级设置")
private String senior;
@ApiModelProperty("视图截图快照")
private String snapshot;
private static final long serialVersionUID = 1L;
}
}

View File

@ -29,8 +29,6 @@ public class PanelView implements Serializable {
private String copyId;
private String dataFrom;
private byte[] content;
private static final long serialVersionUID = 1L;

View File

@ -923,76 +923,6 @@ public class PanelViewExample {
addCriterion("copy_id not between", value1, value2, "copyId");
return (Criteria) this;
}
public Criteria andDataFromIsNull() {
addCriterion("data_from is null");
return (Criteria) this;
}
public Criteria andDataFromIsNotNull() {
addCriterion("data_from is not null");
return (Criteria) this;
}
public Criteria andDataFromEqualTo(String value) {
addCriterion("data_from =", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromNotEqualTo(String value) {
addCriterion("data_from <>", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromGreaterThan(String value) {
addCriterion("data_from >", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromGreaterThanOrEqualTo(String value) {
addCriterion("data_from >=", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromLessThan(String value) {
addCriterion("data_from <", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromLessThanOrEqualTo(String value) {
addCriterion("data_from <=", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromLike(String value) {
addCriterion("data_from like", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromNotLike(String value) {
addCriterion("data_from not like", value, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromIn(List<String> values) {
addCriterion("data_from in", values, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromNotIn(List<String> values) {
addCriterion("data_from not in", values, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromBetween(String value1, String value2) {
addCriterion("data_from between", value1, value2, "dataFrom");
return (Criteria) this;
}
public Criteria andDataFromNotBetween(String value1, String value2) {
addCriterion("data_from not between", value1, value2, "dataFrom");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

View File

@ -17,6 +17,7 @@
<result column="style_priority" jdbcType="VARCHAR" property="stylePriority" />
<result column="chart_type" jdbcType="VARCHAR" property="chartType" />
<result column="is_plugin" jdbcType="BIT" property="isPlugin" />
<result column="data_from" jdbcType="VARCHAR" property="dataFrom" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.dataease.base.domain.ChartViewCacheWithBLOBs">
<result column="x_axis" jdbcType="LONGVARCHAR" property="xAxis" />
@ -92,7 +93,7 @@
</sql>
<sql id="Base_Column_List">
id, `name`, title, scene_id, table_id, `type`, render, result_count, result_mode,
create_by, create_time, update_time, style_priority, chart_type, is_plugin
create_by, create_time, update_time, style_priority, chart_type, is_plugin, data_from
</sql>
<sql id="Blob_Column_List">
x_axis, x_axis_ext, y_axis, y_axis_ext, ext_stack, ext_bubble, custom_attr, custom_style,
@ -152,21 +153,21 @@
render, result_count, result_mode,
create_by, create_time, update_time,
style_priority, chart_type, is_plugin,
x_axis, x_axis_ext, y_axis,
y_axis_ext, ext_stack, ext_bubble,
custom_attr, custom_style, custom_filter,
drill_fields, senior, snapshot
)
data_from, x_axis, x_axis_ext,
y_axis, y_axis_ext, ext_stack,
ext_bubble, custom_attr, custom_style,
custom_filter, drill_fields, senior,
snapshot)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR},
#{sceneId,jdbcType=VARCHAR}, #{tableId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{render,jdbcType=VARCHAR}, #{resultCount,jdbcType=INTEGER}, #{resultMode,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{stylePriority,jdbcType=VARCHAR}, #{chartType,jdbcType=VARCHAR}, #{isPlugin,jdbcType=BIT},
#{xAxis,jdbcType=LONGVARCHAR}, #{xAxisExt,jdbcType=LONGVARCHAR}, #{yAxis,jdbcType=LONGVARCHAR},
#{yAxisExt,jdbcType=LONGVARCHAR}, #{extStack,jdbcType=LONGVARCHAR}, #{extBubble,jdbcType=LONGVARCHAR},
#{customAttr,jdbcType=LONGVARCHAR}, #{customStyle,jdbcType=LONGVARCHAR}, #{customFilter,jdbcType=LONGVARCHAR},
#{drillFields,jdbcType=LONGVARCHAR}, #{senior,jdbcType=LONGVARCHAR}, #{snapshot,jdbcType=LONGVARCHAR}
)
#{dataFrom,jdbcType=VARCHAR}, #{xAxis,jdbcType=LONGVARCHAR}, #{xAxisExt,jdbcType=LONGVARCHAR},
#{yAxis,jdbcType=LONGVARCHAR}, #{yAxisExt,jdbcType=LONGVARCHAR}, #{extStack,jdbcType=LONGVARCHAR},
#{extBubble,jdbcType=LONGVARCHAR}, #{customAttr,jdbcType=LONGVARCHAR}, #{customStyle,jdbcType=LONGVARCHAR},
#{customFilter,jdbcType=LONGVARCHAR}, #{drillFields,jdbcType=LONGVARCHAR}, #{senior,jdbcType=LONGVARCHAR},
#{snapshot,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.ChartViewCacheWithBLOBs">
insert into chart_view_cache
@ -216,6 +217,9 @@
<if test="isPlugin != null">
is_plugin,
</if>
<if test="dataFrom != null">
data_from,
</if>
<if test="xAxis != null">
x_axis,
</if>
@ -299,6 +303,9 @@
<if test="isPlugin != null">
#{isPlugin,jdbcType=BIT},
</if>
<if test="dataFrom != null">
#{dataFrom,jdbcType=VARCHAR},
</if>
<if test="xAxis != null">
#{xAxis,jdbcType=LONGVARCHAR},
</if>
@ -391,6 +398,9 @@
<if test="record.isPlugin != null">
is_plugin = #{record.isPlugin,jdbcType=BIT},
</if>
<if test="record.dataFrom != null">
data_from = #{record.dataFrom,jdbcType=VARCHAR},
</if>
<if test="record.xAxis != null">
x_axis = #{record.xAxis,jdbcType=LONGVARCHAR},
</if>
@ -449,6 +459,7 @@
style_priority = #{record.stylePriority,jdbcType=VARCHAR},
chart_type = #{record.chartType,jdbcType=VARCHAR},
is_plugin = #{record.isPlugin,jdbcType=BIT},
data_from = #{record.dataFrom,jdbcType=VARCHAR},
x_axis = #{record.xAxis,jdbcType=LONGVARCHAR},
x_axis_ext = #{record.xAxisExt,jdbcType=LONGVARCHAR},
y_axis = #{record.yAxis,jdbcType=LONGVARCHAR},
@ -481,7 +492,8 @@
update_time = #{record.updateTime,jdbcType=BIGINT},
style_priority = #{record.stylePriority,jdbcType=VARCHAR},
chart_type = #{record.chartType,jdbcType=VARCHAR},
is_plugin = #{record.isPlugin,jdbcType=BIT}
is_plugin = #{record.isPlugin,jdbcType=BIT},
data_from = #{record.dataFrom,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -531,6 +543,9 @@
<if test="isPlugin != null">
is_plugin = #{isPlugin,jdbcType=BIT},
</if>
<if test="dataFrom != null">
data_from = #{dataFrom,jdbcType=VARCHAR},
</if>
<if test="xAxis != null">
x_axis = #{xAxis,jdbcType=LONGVARCHAR},
</if>
@ -586,6 +601,7 @@
style_priority = #{stylePriority,jdbcType=VARCHAR},
chart_type = #{chartType,jdbcType=VARCHAR},
is_plugin = #{isPlugin,jdbcType=BIT},
data_from = #{dataFrom,jdbcType=VARCHAR},
x_axis = #{xAxis,jdbcType=LONGVARCHAR},
x_axis_ext = #{xAxisExt,jdbcType=LONGVARCHAR},
y_axis = #{yAxis,jdbcType=LONGVARCHAR},
@ -615,7 +631,8 @@
update_time = #{updateTime,jdbcType=BIGINT},
style_priority = #{stylePriority,jdbcType=VARCHAR},
chart_type = #{chartType,jdbcType=VARCHAR},
is_plugin = #{isPlugin,jdbcType=BIT}
is_plugin = #{isPlugin,jdbcType=BIT},
data_from = #{dataFrom,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -4,19 +4,20 @@
<resultMap id="BaseResultMap" type="io.dataease.base.domain.ChartView">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="scene_id" jdbcType="VARCHAR" property="sceneId" />
<result column="table_id" jdbcType="VARCHAR" property="tableId" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="render" jdbcType="VARCHAR" property="render" />
<result column="result_count" jdbcType="INTEGER" property="resultCount" />
<result column="result_mode" jdbcType="VARCHAR" property="resultMode" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="scene_id" jdbcType="VARCHAR" property="sceneId" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="style_priority" jdbcType="VARCHAR" property="stylePriority" />
<result column="chart_type" jdbcType="VARCHAR" property="chartType" />
<result column="is_plugin" jdbcType="BIT" property="isPlugin" />
<result column="data_from" jdbcType="VARCHAR" property="dataFrom" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.dataease.base.domain.ChartViewWithBLOBs">
<result column="x_axis" jdbcType="LONGVARCHAR" property="xAxis" />
@ -91,11 +92,11 @@
</where>
</sql>
<sql id="Base_Column_List">
id, `name`, table_id, `type`, render, result_count, result_mode, title, scene_id,
create_by, create_time, update_time, style_priority, chart_type, is_plugin
id, `name`, title, scene_id, table_id, `type`, render, result_count, result_mode,
create_by, create_time, update_time, style_priority, chart_type, is_plugin, data_from
</sql>
<sql id="Blob_Column_List">
x_axis, x_axis_ext, y_axis, y_axis_ext, ext_stack, ext_bubble, custom_attr, custom_style,
x_axis, x_axis_ext, y_axis, y_axis_ext, ext_stack, ext_bubble, custom_attr, custom_style,
custom_filter, drill_fields, senior, snapshot
</sql>
<select id="selectByExampleWithBLOBs" parameterType="io.dataease.base.domain.ChartViewExample" resultMap="ResultMapWithBLOBs">
@ -129,7 +130,7 @@
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
select
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
@ -147,26 +148,26 @@
</if>
</delete>
<insert id="insert" parameterType="io.dataease.base.domain.ChartViewWithBLOBs">
insert into chart_view (id, `name`, table_id,
`type`, render, result_count,
result_mode, title, scene_id,
create_by, create_time, update_time,
style_priority, chart_type, is_plugin,
x_axis, x_axis_ext, y_axis,
y_axis_ext, ext_stack, ext_bubble,
custom_attr, custom_style, custom_filter,
drill_fields, senior, snapshot
)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{tableId,jdbcType=VARCHAR},
#{type,jdbcType=VARCHAR}, #{render,jdbcType=VARCHAR}, #{resultCount,jdbcType=INTEGER},
#{resultMode,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{sceneId,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{stylePriority,jdbcType=VARCHAR}, #{chartType,jdbcType=VARCHAR}, #{isPlugin,jdbcType=BIT},
#{xAxis,jdbcType=LONGVARCHAR}, #{xAxisExt,jdbcType=LONGVARCHAR}, #{yAxis,jdbcType=LONGVARCHAR},
#{yAxisExt,jdbcType=LONGVARCHAR}, #{extStack,jdbcType=LONGVARCHAR}, #{extBubble,jdbcType=LONGVARCHAR},
#{customAttr,jdbcType=LONGVARCHAR}, #{customStyle,jdbcType=LONGVARCHAR}, #{customFilter,jdbcType=LONGVARCHAR},
#{drillFields,jdbcType=LONGVARCHAR}, #{senior,jdbcType=LONGVARCHAR}, #{snapshot,jdbcType=LONGVARCHAR}
)
insert into chart_view (id, `name`, title,
scene_id, table_id, `type`,
render, result_count, result_mode,
create_by, create_time, update_time,
style_priority, chart_type, is_plugin,
data_from, x_axis, x_axis_ext,
y_axis, y_axis_ext, ext_stack,
ext_bubble, custom_attr, custom_style,
custom_filter, drill_fields, senior,
snapshot)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR},
#{sceneId,jdbcType=VARCHAR}, #{tableId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{render,jdbcType=VARCHAR}, #{resultCount,jdbcType=INTEGER}, #{resultMode,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{stylePriority,jdbcType=VARCHAR}, #{chartType,jdbcType=VARCHAR}, #{isPlugin,jdbcType=BIT},
#{dataFrom,jdbcType=VARCHAR}, #{xAxis,jdbcType=LONGVARCHAR}, #{xAxisExt,jdbcType=LONGVARCHAR},
#{yAxis,jdbcType=LONGVARCHAR}, #{yAxisExt,jdbcType=LONGVARCHAR}, #{extStack,jdbcType=LONGVARCHAR},
#{extBubble,jdbcType=LONGVARCHAR}, #{customAttr,jdbcType=LONGVARCHAR}, #{customStyle,jdbcType=LONGVARCHAR},
#{customFilter,jdbcType=LONGVARCHAR}, #{drillFields,jdbcType=LONGVARCHAR}, #{senior,jdbcType=LONGVARCHAR},
#{snapshot,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.ChartViewWithBLOBs">
insert into chart_view
@ -177,6 +178,12 @@
<if test="name != null">
`name`,
</if>
<if test="title != null">
title,
</if>
<if test="sceneId != null">
scene_id,
</if>
<if test="tableId != null">
table_id,
</if>
@ -192,12 +199,6 @@
<if test="resultMode != null">
result_mode,
</if>
<if test="title != null">
title,
</if>
<if test="sceneId != null">
scene_id,
</if>
<if test="createBy != null">
create_by,
</if>
@ -216,6 +217,9 @@
<if test="isPlugin != null">
is_plugin,
</if>
<if test="dataFrom != null">
data_from,
</if>
<if test="xAxis != null">
x_axis,
</if>
@ -260,6 +264,12 @@
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="sceneId != null">
#{sceneId,jdbcType=VARCHAR},
</if>
<if test="tableId != null">
#{tableId,jdbcType=VARCHAR},
</if>
@ -275,12 +285,6 @@
<if test="resultMode != null">
#{resultMode,jdbcType=VARCHAR},
</if>
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="sceneId != null">
#{sceneId,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
@ -299,6 +303,9 @@
<if test="isPlugin != null">
#{isPlugin,jdbcType=BIT},
</if>
<if test="dataFrom != null">
#{dataFrom,jdbcType=VARCHAR},
</if>
<if test="xAxis != null">
#{xAxis,jdbcType=LONGVARCHAR},
</if>
@ -352,6 +359,12 @@
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.title != null">
title = #{record.title,jdbcType=VARCHAR},
</if>
<if test="record.sceneId != null">
scene_id = #{record.sceneId,jdbcType=VARCHAR},
</if>
<if test="record.tableId != null">
table_id = #{record.tableId,jdbcType=VARCHAR},
</if>
@ -367,12 +380,6 @@
<if test="record.resultMode != null">
result_mode = #{record.resultMode,jdbcType=VARCHAR},
</if>
<if test="record.title != null">
title = #{record.title,jdbcType=VARCHAR},
</if>
<if test="record.sceneId != null">
scene_id = #{record.sceneId,jdbcType=VARCHAR},
</if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
@ -391,6 +398,9 @@
<if test="record.isPlugin != null">
is_plugin = #{record.isPlugin,jdbcType=BIT},
</if>
<if test="record.dataFrom != null">
data_from = #{record.dataFrom,jdbcType=VARCHAR},
</if>
<if test="record.xAxis != null">
x_axis = #{record.xAxis,jdbcType=LONGVARCHAR},
</if>
@ -436,19 +446,20 @@
update chart_view
set id = #{record.id,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
title = #{record.title,jdbcType=VARCHAR},
scene_id = #{record.sceneId,jdbcType=VARCHAR},
table_id = #{record.tableId,jdbcType=VARCHAR},
`type` = #{record.type,jdbcType=VARCHAR},
render = #{record.render,jdbcType=VARCHAR},
result_count = #{record.resultCount,jdbcType=INTEGER},
result_mode = #{record.resultMode,jdbcType=VARCHAR},
title = #{record.title,jdbcType=VARCHAR},
scene_id = #{record.sceneId,jdbcType=VARCHAR},
create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
style_priority = #{record.stylePriority,jdbcType=VARCHAR},
chart_type = #{record.chartType,jdbcType=VARCHAR},
is_plugin = #{record.isPlugin,jdbcType=BIT},
data_from = #{record.dataFrom,jdbcType=VARCHAR},
x_axis = #{record.xAxis,jdbcType=LONGVARCHAR},
x_axis_ext = #{record.xAxisExt,jdbcType=LONGVARCHAR},
y_axis = #{record.yAxis,jdbcType=LONGVARCHAR},
@ -469,19 +480,20 @@
update chart_view
set id = #{record.id,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
title = #{record.title,jdbcType=VARCHAR},
scene_id = #{record.sceneId,jdbcType=VARCHAR},
table_id = #{record.tableId,jdbcType=VARCHAR},
`type` = #{record.type,jdbcType=VARCHAR},
render = #{record.render,jdbcType=VARCHAR},
result_count = #{record.resultCount,jdbcType=INTEGER},
result_mode = #{record.resultMode,jdbcType=VARCHAR},
title = #{record.title,jdbcType=VARCHAR},
scene_id = #{record.sceneId,jdbcType=VARCHAR},
create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
style_priority = #{record.stylePriority,jdbcType=VARCHAR},
chart_type = #{record.chartType,jdbcType=VARCHAR},
is_plugin = #{record.isPlugin,jdbcType=BIT}
is_plugin = #{record.isPlugin,jdbcType=BIT},
data_from = #{record.dataFrom,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -492,6 +504,12 @@
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="sceneId != null">
scene_id = #{sceneId,jdbcType=VARCHAR},
</if>
<if test="tableId != null">
table_id = #{tableId,jdbcType=VARCHAR},
</if>
@ -507,12 +525,6 @@
<if test="resultMode != null">
result_mode = #{resultMode,jdbcType=VARCHAR},
</if>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="sceneId != null">
scene_id = #{sceneId,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
@ -531,6 +543,9 @@
<if test="isPlugin != null">
is_plugin = #{isPlugin,jdbcType=BIT},
</if>
<if test="dataFrom != null">
data_from = #{dataFrom,jdbcType=VARCHAR},
</if>
<if test="xAxis != null">
x_axis = #{xAxis,jdbcType=LONGVARCHAR},
</if>
@ -573,19 +588,20 @@
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.dataease.base.domain.ChartViewWithBLOBs">
update chart_view
set `name` = #{name,jdbcType=VARCHAR},
title = #{title,jdbcType=VARCHAR},
scene_id = #{sceneId,jdbcType=VARCHAR},
table_id = #{tableId,jdbcType=VARCHAR},
`type` = #{type,jdbcType=VARCHAR},
render = #{render,jdbcType=VARCHAR},
result_count = #{resultCount,jdbcType=INTEGER},
result_mode = #{resultMode,jdbcType=VARCHAR},
title = #{title,jdbcType=VARCHAR},
scene_id = #{sceneId,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
style_priority = #{stylePriority,jdbcType=VARCHAR},
chart_type = #{chartType,jdbcType=VARCHAR},
is_plugin = #{isPlugin,jdbcType=BIT},
data_from = #{dataFrom,jdbcType=VARCHAR},
x_axis = #{xAxis,jdbcType=LONGVARCHAR},
x_axis_ext = #{xAxisExt,jdbcType=LONGVARCHAR},
y_axis = #{yAxis,jdbcType=LONGVARCHAR},
@ -603,19 +619,20 @@
<update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.ChartView">
update chart_view
set `name` = #{name,jdbcType=VARCHAR},
title = #{title,jdbcType=VARCHAR},
scene_id = #{sceneId,jdbcType=VARCHAR},
table_id = #{tableId,jdbcType=VARCHAR},
`type` = #{type,jdbcType=VARCHAR},
render = #{render,jdbcType=VARCHAR},
result_count = #{resultCount,jdbcType=INTEGER},
result_mode = #{resultMode,jdbcType=VARCHAR},
title = #{title,jdbcType=VARCHAR},
scene_id = #{sceneId,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
style_priority = #{stylePriority,jdbcType=VARCHAR},
chart_type = #{chartType,jdbcType=VARCHAR},
is_plugin = #{isPlugin,jdbcType=BIT}
is_plugin = #{isPlugin,jdbcType=BIT},
data_from = #{dataFrom,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
</mapper>

View File

@ -14,7 +14,6 @@
<result column="copy_from_view" jdbcType="VARCHAR" property="copyFromView" />
<result column="copy_from" jdbcType="VARCHAR" property="copyFrom" />
<result column="copy_id" jdbcType="VARCHAR" property="copyId" />
<result column="data_from" jdbcType="VARCHAR" property="dataFrom" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.dataease.base.domain.PanelView">
<result column="content" jdbcType="LONGVARBINARY" property="content" />
@ -79,7 +78,7 @@
</sql>
<sql id="Base_Column_List">
id, panel_id, chart_view_id, create_by, create_time, update_by, update_time, `position`,
copy_from_panel, copy_from_view, copy_from, copy_id, data_from
copy_from_panel, copy_from_view, copy_from, copy_id
</sql>
<sql id="Blob_Column_List">
content
@ -137,12 +136,12 @@
create_by, create_time, update_by,
update_time, `position`, copy_from_panel,
copy_from_view, copy_from, copy_id,
data_from, content)
content)
values (#{id,jdbcType=VARCHAR}, #{panelId,jdbcType=VARCHAR}, #{chartViewId,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=BIGINT}, #{position,jdbcType=VARCHAR}, #{copyFromPanel,jdbcType=VARCHAR},
#{copyFromView,jdbcType=VARCHAR}, #{copyFrom,jdbcType=VARCHAR}, #{copyId,jdbcType=VARCHAR},
#{dataFrom,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARBINARY})
#{content,jdbcType=LONGVARBINARY})
</insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.PanelView">
insert into panel_view
@ -183,9 +182,6 @@
<if test="copyId != null">
copy_id,
</if>
<if test="dataFrom != null">
data_from,
</if>
<if test="content != null">
content,
</if>
@ -227,9 +223,6 @@
<if test="copyId != null">
#{copyId,jdbcType=VARCHAR},
</if>
<if test="dataFrom != null">
#{dataFrom,jdbcType=VARCHAR},
</if>
<if test="content != null">
#{content,jdbcType=LONGVARBINARY},
</if>
@ -280,9 +273,6 @@
<if test="record.copyId != null">
copy_id = #{record.copyId,jdbcType=VARCHAR},
</if>
<if test="record.dataFrom != null">
data_from = #{record.dataFrom,jdbcType=VARCHAR},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=LONGVARBINARY},
</if>
@ -305,7 +295,6 @@
copy_from_view = #{record.copyFromView,jdbcType=VARCHAR},
copy_from = #{record.copyFrom,jdbcType=VARCHAR},
copy_id = #{record.copyId,jdbcType=VARCHAR},
data_from = #{record.dataFrom,jdbcType=VARCHAR},
content = #{record.content,jdbcType=LONGVARBINARY}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -324,8 +313,7 @@
copy_from_panel = #{record.copyFromPanel,jdbcType=VARCHAR},
copy_from_view = #{record.copyFromView,jdbcType=VARCHAR},
copy_from = #{record.copyFrom,jdbcType=VARCHAR},
copy_id = #{record.copyId,jdbcType=VARCHAR},
data_from = #{record.dataFrom,jdbcType=VARCHAR}
copy_id = #{record.copyId,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -366,9 +354,6 @@
<if test="copyId != null">
copy_id = #{copyId,jdbcType=VARCHAR},
</if>
<if test="dataFrom != null">
data_from = #{dataFrom,jdbcType=VARCHAR},
</if>
<if test="content != null">
content = #{content,jdbcType=LONGVARBINARY},
</if>
@ -388,7 +373,6 @@
copy_from_view = #{copyFromView,jdbcType=VARCHAR},
copy_from = #{copyFrom,jdbcType=VARCHAR},
copy_id = #{copyId,jdbcType=VARCHAR},
data_from = #{dataFrom,jdbcType=VARCHAR},
content = #{content,jdbcType=LONGVARBINARY}
where id = #{id,jdbcType=VARCHAR}
</update>
@ -404,8 +388,7 @@
copy_from_panel = #{copyFromPanel,jdbcType=VARCHAR},
copy_from_view = #{copyFromView,jdbcType=VARCHAR},
copy_from = #{copyFrom,jdbcType=VARCHAR},
copy_id = #{copyId,jdbcType=VARCHAR},
data_from = #{dataFrom,jdbcType=VARCHAR}
copy_id = #{copyId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@ -54,7 +54,8 @@
custom_filter,
drill_fields,
senior,
SNAPSHOT
SNAPSHOT,
data_from
) SELECT
id,
`name`,
@ -82,7 +83,8 @@
custom_filter,
drill_fields,
senior,
SNAPSHOT from chart_view
SNAPSHOT,
data_from from chart_view
WHERE
chart_view.id = #{id}
</insert>
@ -181,7 +183,8 @@
`result_count`,
`result_mode`,
`chart_type`,
`senior`)
`senior`,
`data_from`)
SELECT #{newChartId},
`name`,
#{panelId},
@ -207,7 +210,8 @@
`result_count`,
`result_mode`,
'private',
`senior`
`senior`,
`data_from`
FROM chart_view_cache
WHERE id = #{oldChartId}
</insert>
@ -256,7 +260,8 @@
custom_style,
custom_filter,
drill_fields,
SNAPSHOT)
SNAPSHOT,
data_from)
SELECT pv_copy.chart_view_id AS id,
`name`,
title,
@ -282,7 +287,8 @@
custom_style,
custom_filter,
drill_fields,
SNAPSHOT
SNAPSHOT,
data_from
FROM (
SELECT panel_id,
copy_from_view,
@ -389,7 +395,9 @@
cv.custom_filter = cve.custom_filter,
cv.drill_fields = cve.drill_fields,
cv.senior = cve.senior,
cv.SNAPSHOT = cve.SNAPSHOT where cve.id = cv.id and cv.id in
cv.SNAPSHOT = cve.SNAPSHOT,
cv.data_from = cve.data_from
where cve.id = cv.id and cv.id in
<foreach collection="viewIds" item="viewId" open='(' separator=',' close=')'>
#{viewId}
</foreach>

View File

@ -71,9 +71,9 @@
</delete>
<insert id="savePanelView">
INSERT INTO `panel_view` (id,chart_view_id, panel_id,data_from) VALUES
INSERT INTO `panel_view` (id,chart_view_id, panel_id) VALUES
<foreach collection="panelViews" item="panelView" index="index" separator=",">
(uuid(),#{panelView.chartViewId},#{panelView.panelId},#{panelView.dataFrom})
(uuid(),#{panelView.chartViewId},#{panelView.panelId})
</foreach>
</insert>

View File

@ -76,8 +76,8 @@ public class CommonConstants {
// 模板数据
public static final String TEMPLATE = "template";
// 视图数据
public static final String CHART = "chart";
//数据集数据
public static final String CHART = "dataset";
}
}

View File

@ -76,8 +76,8 @@ public class ChartViewController {
@ApiOperation("详细信息")
@PostMapping("/get/{id}/{panelId}")
public ChartViewDTO get(@PathVariable String id, @PathVariable String panelId,@RequestBody ChartViewRequest viewRequest) {
String dataFrom = panelViewService.findViewDataFrom(id);
return chartViewService.getOne(id,viewRequest.getQueryFrom(),dataFrom);
ChartViewDTO result = chartViewService.getOne(id,viewRequest.getQueryFrom());
return result;
}
@ApiIgnore

View File

@ -30,6 +30,6 @@ public class ChartViewDTO extends ChartViewWithBLOBs {
private boolean drill;
@ApiModelProperty("下钻条件集合")
private List<ChartExtFilterRequest> drillFilters;
@ApiModelProperty("当前数据来源")
private String dataFrom;
@ApiModelProperty("视图存放位置")
private String position;
}

View File

@ -24,12 +24,5 @@ public class PanelViewInsertDTO extends PanelView {
super.setPanelId(panelGroupId);
super.setPosition(position);
}
public PanelViewInsertDTO(String chartViewId,String panelGroupId,String position,String dataFrom) {
super();
super.setChartViewId(chartViewId);
super.setPanelId(panelGroupId);
super.setPosition(position);
super.setDataFrom(dataFrom);
}
}

View File

@ -87,7 +87,6 @@ public class ChartViewService {
private PanelGroupExtendDataService extendDataService;
//默认使用非公平
private ReentrantLock lock = new ReentrantLock();
@ -234,33 +233,30 @@ public class ChartViewService {
}
public ChartViewDTO getOne(String id, String queryFrom) {
return getOne(id,queryFrom,CommonConstants.VIEW_DATA_FROM.CHART);
}
@Transactional
public ChartViewDTO getOne(String id, String queryFrom,String dataFrom) {
ChartViewDTO result;
//从模板中去数据
if(CommonConstants.VIEW_DATA_FROM.TEMPLATE.equals(dataFrom)){
result = extendDataService.getChartInfo(id);
if(result!=null){
result.setData(null);
}
}else if (CommonConstants.VIEW_QUERY_FROM.PANEL_EDIT.equals(queryFrom)) {
//仪表板编辑页面 从缓存表中取数据 缓存表中没有数据则进行插入
result = extChartViewMapper.searchOneFromCache(id);
if (result == null) {
extChartViewMapper.copyToCache(id);
public ChartViewDTO getOne(String id, String queryFrom) {
try{
ChartViewDTO result;
if(CommonConstants.VIEW_QUERY_FROM.PANEL_EDIT.equals(queryFrom)) {
//仪表板编辑页面 从缓存表中取数据 缓存表中没有数据则进行插入
result = extChartViewMapper.searchOneFromCache(id);
if (result == null) {
extChartViewMapper.copyToCache(id);
result = extChartViewMapper.searchOneFromCache(id);
}
} else {
result = extChartViewMapper.searchOne(id);
}
result.setDataFrom(CommonConstants.VIEW_DATA_FROM.CHART);
} else {
result = extChartViewMapper.searchOne(id);
result.setDataFrom(CommonConstants.VIEW_DATA_FROM.CHART);
if(result==null){
DataEaseException.throwException(Translator.get("i18n_chart_delete"));
}
return result;
}catch (Exception e){
e.printStackTrace();
DataEaseException.throwException(e);
}
return result;
return null;
}
public void delete(String id) {
@ -274,22 +270,21 @@ public class ChartViewService {
}
public ChartViewDTO getData(String id, ChartExtRequest request) throws Exception {
try{
String dataFrom = panelViewService.findViewDataFrom(id);
if(CommonConstants.VIEW_DATA_FROM.TEMPLATE.equals(dataFrom)){
return extendDataService.getChartInfo(id);
}else{// 从视图读取数据
ChartViewDTO view = this.getOne(id,request.getQueryFrom());
view.setDataFrom(dataFrom);
// 如果是从仪表板获取视图数据则仪表板的查询模式查询结果的数量覆盖视图对应的属性
if (CommonConstants.VIEW_QUERY_FROM.PANEL.equals(request.getQueryFrom()) && CommonConstants.VIEW_RESULT_MODE.CUSTOM.equals(request.getResultMode())) {
view.setResultMode(request.getResultMode());
view.setResultCount(request.getResultCount());
}
try {
ChartViewDTO view = this.getOne(id, request.getQueryFrom());
// 如果是从仪表板获取视图数据则仪表板的查询模式查询结果的数量覆盖视图对应的属性
if (CommonConstants.VIEW_QUERY_FROM.PANEL.equals(request.getQueryFrom()) && CommonConstants.VIEW_RESULT_MODE.CUSTOM.equals(request.getResultMode())) {
view.setResultMode(request.getResultMode());
view.setResultCount(request.getResultCount());
}
// 数据来源在模板中直接从模板取数据
if (CommonConstants.VIEW_DATA_FROM.TEMPLATE.equals(view.getDataFrom())) {
return extendDataService.getChartDataInfo(id, view);
} else {
return calcData(view, request, request.isCache());
}
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
DataEaseException.throwException(e);
}

View File

@ -24,18 +24,17 @@ public class PanelGroupExtendDataService {
@Resource
private PanelGroupExtendDataMapper panelGroupExtendDataMapper;
public ChartViewDTO getChartInfo(String viewId){
public ChartViewDTO getChartDataInfo(String viewId,ChartViewDTO view){
PanelGroupExtendDataExample extendDataExample = new PanelGroupExtendDataExample();
extendDataExample.createCriteria().andViewIdEqualTo(viewId);
List<PanelGroupExtendData> extendDataList = panelGroupExtendDataMapper.selectByExampleWithBLOBs(extendDataExample);
if(CollectionUtils.isNotEmpty(extendDataList)){
ChartViewDTO chartView = JSONObject.parseObject(extendDataList.get(0).getViewDetails(),ChartViewDTO.class);
chartView.setDataFrom(CommonConstants.VIEW_DATA_FROM.TEMPLATE);
return chartView;
ChartViewDTO chartViewTemplate = JSONObject.parseObject(extendDataList.get(0).getViewDetails(),ChartViewDTO.class);
view.setData(chartViewTemplate.getData());
}else{
DataEaseException.throwException("模板缓存数据中未获取指定视图数据:"+viewId);
}
return null;
return view;
}

View File

@ -6,6 +6,7 @@ import io.dataease.auth.annotation.DeCleaner;
import io.dataease.base.domain.*;
import io.dataease.base.mapper.*;
import io.dataease.base.mapper.ext.*;
import io.dataease.commons.constants.CommonConstants;
import io.dataease.commons.constants.DePermissionType;
import io.dataease.commons.constants.PanelConstants;
import io.dataease.commons.utils.AuthUtils;
@ -324,22 +325,24 @@ public class PanelGroupService {
Map<String,String> dynamicDataMap = JSON.parseObject(dynamicData,Map.class);
List<PanelViewInsertDTO> panelViews = new ArrayList<>();
List<PanelGroupExtendDataDTO> viewsData = new ArrayList<>();
List<ChartViewWithBLOBs> chartViews = new ArrayList<>();
for(Map.Entry<String, String> entry : dynamicDataMap.entrySet()){
String originViewId = entry.getKey();
String originViewData = entry.getValue();
JSONObject chartViewJson = JSON.parseObject(originViewData);
String position = chartViewJson.getString("position");
ChartViewDTO chartView = JSON.parseObject(originViewData,ChartViewDTO.class);
String position = chartView.getPosition();
String newViewId = UUIDUtil.getUUIDAsString();
chartView.setId(newViewId);
chartView.setSceneId(newPanelId);
chartView.setDataFrom(CommonConstants.VIEW_DATA_FROM.TEMPLATE);
//TODO 数据处理 1.替换viewId 2.加入panelView 数据(数据来源为template) 3.加入模板view data数据
templateData = templateData.replaceAll(originViewId,newViewId);
panelViews.add(new PanelViewInsertDTO(newViewId,newPanelId,position,"template"));
panelViews.add(new PanelViewInsertDTO(newViewId,newPanelId,position));
viewsData.add(new PanelGroupExtendDataDTO(newPanelId,newViewId,originViewData));
chartViewMapper.insertSelective(chartView);
extChartViewMapper.copyToCache(newViewId);
}
if(CollectionUtils.isNotEmpty(panelViews)){
extPanelViewMapper.savePanelView(panelViews);
}
if(CollectionUtils.isNotEmpty(viewsData)){
extPanelGroupExtendDataMapper.savePanelExtendData(viewsData);
}
request.setPanelData(templateData);

View File

@ -154,15 +154,4 @@ public class PanelViewService {
return null;
}
}
public String findViewDataFrom(String viewId){
PanelViewExample panelViewExample = new PanelViewExample();
panelViewExample.createCriteria().andChartViewIdEqualTo(viewId);
List<PanelView> result = panelViewMapper.selectByExample(panelViewExample);
if(CollectionUtils.isNotEmpty(result)&& CommonConstants.VIEW_DATA_FROM.TEMPLATE.equals(result.get(0).getDataFrom())){
return "template";
}else{
return "chart";
}
}
}

View File

@ -34,8 +34,11 @@ CREATE TABLE `chart_view_cache` (
SET FOREIGN_KEY_CHECKS = 1;
ALTER TABLE `panel_view`
ADD COLUMN `data_from` varchar(255) NULL DEFAULT 'chart' COMMENT '当前数据来源 chart 视图 template 模板' AFTER `copy_id`;
ALTER TABLE `chart_view`
ADD COLUMN `data_from` varchar(255) NULL DEFAULT 'dataset' COMMENT '数据来源 template 模板数据 dataset 数据集数据' AFTER `is_plugin`;
ALTER TABLE `chart_view_cache`
ADD COLUMN `data_from` varchar(255) NULL DEFAULT 'dataset' COMMENT '数据来源 template 模板数据 dataset 数据集数据' AFTER `is_plugin`;
SET NAMES utf8mb4;

View File

@ -60,9 +60,11 @@
</javaClientGenerator>
<!--要生成的数据库表 -->
<table tableName="de_engine">
<columnOverride column="configuration" property="configuration" javaType="java.lang.String"/>
</table>
<!-- <table tableName="de_engine">-->
<!-- <columnOverride column="configuration" property="configuration" javaType="java.lang.String"/>-->
<!-- </table>-->
<table tableName="panel_view"/>
<table tableName="chart_view"/>
<table tableName="chart_view_cache"/>
</context>
</generatorConfiguration>

View File

@ -1381,6 +1381,7 @@ export default {
sure_bt: 'Confirm'
},
panel: {
template_view_tips: "Template's Views. Please Change",
no_auth_role: 'Unshared roles',
auth_role: 'Shared roles',
picture_limit: 'Only pictures can be inserted',

View File

@ -1382,6 +1382,7 @@ export default {
sure_bt: '確定'
},
panel: {
template_view_tips: '当前是模板视图,请点击更换数据集',
no_auth_role: '未分享角色',
auth_role: '已分享角色',
picture_limit: '只能插入圖片',

View File

@ -1390,6 +1390,7 @@ export default {
sure_bt: '确定'
},
panel: {
template_view_tips: '当前是模板视图,请点击更换数据集',
no_auth_role: '未分享角色',
auth_role: '已分享角色',
picture_limit: '只能插入图片',

View File

@ -41,6 +41,20 @@
<el-row class="view-panel-row">
<el-tabs :stretch="true" class="tab-header">
<el-tab-pane :label="$t('chart.chart_data')" class="padding-tab" style="width: 300px">
<div v-if="view.dataFrom==='template'" class="view-panel-Mask">
<span style="opacity: 1;">
<el-button
style="opacity: 1!important;"
type="warning"
:title="$t('chart.change_ds')"
size="mini"
round
@click="changeDs"
>
<span style="font-weight: bold">{{ $t('panel.template_view_tips') }}<i class="el-icon-refresh el-icon--right" /></span>
</el-button>
</span>
</div>
<el-row class="view-panel">
<el-col class="theme-border-class" :span="12" style="border-right: 1px solid #E6E6E6;">
<div style="display: flex;align-items: center;justify-content: center;padding: 6px;">
@ -1403,6 +1417,13 @@ export default {
},
methods: {
emptyTableData() {
this.table = {}
this.dimension = []
this.quota = []
this.dimensionData = []
this.quotaData = []
},
initFromPanel() {
this.hasEdit = (this.panelViewEditInfo[this.param.id] || false)
},
@ -1790,7 +1811,11 @@ export default {
getChart(id, queryFrom = 'panel_edit') {
if (id) {
getChartDetails(id, this.panelInfo.id, { queryFrom: queryFrom }).then(response => {
response.data.dataFrom !== 'template' && this.initTableData(response.data.tableId)
if (response.data.dataFrom === 'template') {
this.emptyTableData()
} else {
this.initTableData(response.data.tableId)
}
this.view = JSON.parse(JSON.stringify(response.data))
this.view.xaxis = this.view.xaxis ? JSON.parse(this.view.xaxis) : []
this.view.xaxisExt = this.view.xaxisExt ? JSON.parse(this.view.xaxisExt) : []
@ -2148,6 +2173,7 @@ export default {
this.view.extStack = []
this.view.extBubble = []
this.view.drillFields = []
this.view.dataFrom = 'dataset'
}
// this.save(true, 'chart', false)
this.calcData(true, 'chart', false)
@ -2520,6 +2546,22 @@ export default {
height: calc(100vh - 75px);
}
.view-panel-Mask {
display: flex;
height: calc(100vh - 60px);
background-color: #5c5e61;
opacity: 0.7;
position:absolute;
top:0px;
left: 0px;
width: 300px;
z-index: 2;
cursor:not-allowed;
display: flex;
align-items: center;
justify-content: center;
}
.view-panel {
display: flex;
height: calc(100% - 80px);