提交 f4ee879c authored 作者: taojinlong's avatar taojinlong

Merge branch 'dev' into pr@dev@impala

package io.dataease.base.domain; package io.dataease.base.domain;
import java.io.Serializable; import java.io.Serializable;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@Data @Data
public class ChartView implements Serializable { public class ChartView implements Serializable {
@ApiModelProperty("ID")
private String id; private String id;
@ApiModelProperty("名称")
private String name; private String name;
@ApiModelProperty("数据集ID")
private String title;
private String sceneId;
private String tableId; private String tableId;
@ApiModelProperty("图表类型")
private String type; private String type;
@ApiModelProperty("渲染方式")
private String render; private String render;
@ApiModelProperty("展示结果数量")
private Integer resultCount; private Integer resultCount;
@ApiModelProperty("展示结果")
private String resultMode; private String resultMode;
@ApiModelProperty("标题")
private String title;
@ApiModelProperty("场景ID")
private String sceneId;
@ApiModelProperty("创建人")
private String createBy; private String createBy;
@ApiModelProperty("创建时间")
private Long createTime; private Long createTime;
@ApiModelProperty("更新时间")
private Long updateTime; private Long updateTime;
@ApiModelProperty("样式优先级")
private String stylePriority; private String stylePriority;
@ApiModelProperty("public or private")
private String chartType; private String chartType;
@ApiModelProperty("是否插件")
private Boolean isPlugin; private Boolean isPlugin;
private String dataFrom;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -35,5 +35,7 @@ public class ChartViewCache implements Serializable { ...@@ -35,5 +35,7 @@ public class ChartViewCache implements Serializable {
private Boolean isPlugin; private Boolean isPlugin;
private String dataFrom;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -1113,6 +1113,76 @@ public class ChartViewCacheExample { ...@@ -1113,6 +1113,76 @@ public class ChartViewCacheExample {
addCriterion("is_plugin not between", value1, value2, "isPlugin"); addCriterion("is_plugin not between", value1, value2, "isPlugin");
return (Criteria) this; 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 { public static class Criteria extends GeneratedCriteria {
......
package io.dataease.base.domain; package io.dataease.base.domain;
import java.io.Serializable; import java.io.Serializable;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
...@@ -11,30 +9,29 @@ import lombok.ToString; ...@@ -11,30 +9,29 @@ import lombok.ToString;
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class ChartViewWithBLOBs extends ChartView implements Serializable { public class ChartViewWithBLOBs extends ChartView implements Serializable {
@ApiModelProperty("x轴")
private String xAxis; private String xAxis;
@ApiModelProperty("x副轴")
private String xAxisExt; private String xAxisExt;
@ApiModelProperty("y轴")
private String yAxis; private String yAxis;
@ApiModelProperty("y副轴")
private String yAxisExt; private String yAxisExt;
@ApiModelProperty("堆叠字段")
private String extStack; private String extStack;
@ApiModelProperty("气泡大小字段")
private String extBubble; private String extBubble;
@ApiModelProperty("图形属性")
private String customAttr; private String customAttr;
@ApiModelProperty("组件样式")
private String customStyle; private String customStyle;
@ApiModelProperty("过滤器字段")
private String customFilter; private String customFilter;
@ApiModelProperty("下钻字段")
private String drillFields; private String drillFields;
@ApiModelProperty("高级设置")
private String senior; private String senior;
@ApiModelProperty("视图截图快照")
private String snapshot; private String snapshot;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -29,8 +29,6 @@ public class PanelView implements Serializable { ...@@ -29,8 +29,6 @@ public class PanelView implements Serializable {
private String copyId; private String copyId;
private String dataFrom;
private byte[] content; private byte[] content;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -923,76 +923,6 @@ public class PanelViewExample { ...@@ -923,76 +923,6 @@ public class PanelViewExample {
addCriterion("copy_id not between", value1, value2, "copyId"); addCriterion("copy_id not between", value1, value2, "copyId");
return (Criteria) this; 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 { public static class Criteria extends GeneratedCriteria {
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
<result column="style_priority" jdbcType="VARCHAR" property="stylePriority" /> <result column="style_priority" jdbcType="VARCHAR" property="stylePriority" />
<result column="chart_type" jdbcType="VARCHAR" property="chartType" /> <result column="chart_type" jdbcType="VARCHAR" property="chartType" />
<result column="is_plugin" jdbcType="BIT" property="isPlugin" /> <result column="is_plugin" jdbcType="BIT" property="isPlugin" />
<result column="data_from" jdbcType="VARCHAR" property="dataFrom" />
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.dataease.base.domain.ChartViewCacheWithBLOBs"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.dataease.base.domain.ChartViewCacheWithBLOBs">
<result column="x_axis" jdbcType="LONGVARCHAR" property="xAxis" /> <result column="x_axis" jdbcType="LONGVARCHAR" property="xAxis" />
...@@ -92,7 +93,7 @@ ...@@ -92,7 +93,7 @@
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, `name`, title, scene_id, table_id, `type`, render, result_count, result_mode, 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>
<sql id="Blob_Column_List"> <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,
...@@ -152,21 +153,21 @@ ...@@ -152,21 +153,21 @@
render, result_count, result_mode, render, result_count, result_mode,
create_by, create_time, update_time, create_by, create_time, update_time,
style_priority, chart_type, is_plugin, style_priority, chart_type, is_plugin,
x_axis, x_axis_ext, y_axis, data_from, x_axis, x_axis_ext,
y_axis_ext, ext_stack, ext_bubble, y_axis, y_axis_ext, ext_stack,
custom_attr, custom_style, custom_filter, ext_bubble, custom_attr, custom_style,
drill_fields, senior, snapshot custom_filter, drill_fields, senior,
) snapshot)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR},
#{sceneId,jdbcType=VARCHAR}, #{tableId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{sceneId,jdbcType=VARCHAR}, #{tableId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{render,jdbcType=VARCHAR}, #{resultCount,jdbcType=INTEGER}, #{resultMode,jdbcType=VARCHAR}, #{render,jdbcType=VARCHAR}, #{resultCount,jdbcType=INTEGER}, #{resultMode,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{stylePriority,jdbcType=VARCHAR}, #{chartType,jdbcType=VARCHAR}, #{isPlugin,jdbcType=BIT}, #{stylePriority,jdbcType=VARCHAR}, #{chartType,jdbcType=VARCHAR}, #{isPlugin,jdbcType=BIT},
#{xAxis,jdbcType=LONGVARCHAR}, #{xAxisExt,jdbcType=LONGVARCHAR}, #{yAxis,jdbcType=LONGVARCHAR}, #{dataFrom,jdbcType=VARCHAR}, #{xAxis,jdbcType=LONGVARCHAR}, #{xAxisExt,jdbcType=LONGVARCHAR},
#{yAxisExt,jdbcType=LONGVARCHAR}, #{extStack,jdbcType=LONGVARCHAR}, #{extBubble,jdbcType=LONGVARCHAR}, #{yAxis,jdbcType=LONGVARCHAR}, #{yAxisExt,jdbcType=LONGVARCHAR}, #{extStack,jdbcType=LONGVARCHAR},
#{customAttr,jdbcType=LONGVARCHAR}, #{customStyle,jdbcType=LONGVARCHAR}, #{customFilter,jdbcType=LONGVARCHAR}, #{extBubble,jdbcType=LONGVARCHAR}, #{customAttr,jdbcType=LONGVARCHAR}, #{customStyle,jdbcType=LONGVARCHAR},
#{drillFields,jdbcType=LONGVARCHAR}, #{senior,jdbcType=LONGVARCHAR}, #{snapshot,jdbcType=LONGVARCHAR} #{customFilter,jdbcType=LONGVARCHAR}, #{drillFields,jdbcType=LONGVARCHAR}, #{senior,jdbcType=LONGVARCHAR},
) #{snapshot,jdbcType=LONGVARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.ChartViewCacheWithBLOBs"> <insert id="insertSelective" parameterType="io.dataease.base.domain.ChartViewCacheWithBLOBs">
insert into chart_view_cache insert into chart_view_cache
...@@ -216,6 +217,9 @@ ...@@ -216,6 +217,9 @@
<if test="isPlugin != null"> <if test="isPlugin != null">
is_plugin, is_plugin,
</if> </if>
<if test="dataFrom != null">
data_from,
</if>
<if test="xAxis != null"> <if test="xAxis != null">
x_axis, x_axis,
</if> </if>
...@@ -299,6 +303,9 @@ ...@@ -299,6 +303,9 @@
<if test="isPlugin != null"> <if test="isPlugin != null">
#{isPlugin,jdbcType=BIT}, #{isPlugin,jdbcType=BIT},
</if> </if>
<if test="dataFrom != null">
#{dataFrom,jdbcType=VARCHAR},
</if>
<if test="xAxis != null"> <if test="xAxis != null">
#{xAxis,jdbcType=LONGVARCHAR}, #{xAxis,jdbcType=LONGVARCHAR},
</if> </if>
...@@ -391,6 +398,9 @@ ...@@ -391,6 +398,9 @@
<if test="record.isPlugin != null"> <if test="record.isPlugin != null">
is_plugin = #{record.isPlugin,jdbcType=BIT}, is_plugin = #{record.isPlugin,jdbcType=BIT},
</if> </if>
<if test="record.dataFrom != null">
data_from = #{record.dataFrom,jdbcType=VARCHAR},
</if>
<if test="record.xAxis != null"> <if test="record.xAxis != null">
x_axis = #{record.xAxis,jdbcType=LONGVARCHAR}, x_axis = #{record.xAxis,jdbcType=LONGVARCHAR},
</if> </if>
...@@ -449,6 +459,7 @@ ...@@ -449,6 +459,7 @@
style_priority = #{record.stylePriority,jdbcType=VARCHAR}, style_priority = #{record.stylePriority,jdbcType=VARCHAR},
chart_type = #{record.chartType,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},
x_axis = #{record.xAxis,jdbcType=LONGVARCHAR}, x_axis = #{record.xAxis,jdbcType=LONGVARCHAR},
x_axis_ext = #{record.xAxisExt,jdbcType=LONGVARCHAR}, x_axis_ext = #{record.xAxisExt,jdbcType=LONGVARCHAR},
y_axis = #{record.yAxis,jdbcType=LONGVARCHAR}, y_axis = #{record.yAxis,jdbcType=LONGVARCHAR},
...@@ -481,7 +492,8 @@ ...@@ -481,7 +492,8 @@
update_time = #{record.updateTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT},
style_priority = #{record.stylePriority,jdbcType=VARCHAR}, style_priority = #{record.stylePriority,jdbcType=VARCHAR},
chart_type = #{record.chartType,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"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
...@@ -531,6 +543,9 @@ ...@@ -531,6 +543,9 @@
<if test="isPlugin != null"> <if test="isPlugin != null">
is_plugin = #{isPlugin,jdbcType=BIT}, is_plugin = #{isPlugin,jdbcType=BIT},
</if> </if>
<if test="dataFrom != null">
data_from = #{dataFrom,jdbcType=VARCHAR},
</if>
<if test="xAxis != null"> <if test="xAxis != null">
x_axis = #{xAxis,jdbcType=LONGVARCHAR}, x_axis = #{xAxis,jdbcType=LONGVARCHAR},
</if> </if>
...@@ -586,6 +601,7 @@ ...@@ -586,6 +601,7 @@
style_priority = #{stylePriority,jdbcType=VARCHAR}, style_priority = #{stylePriority,jdbcType=VARCHAR},
chart_type = #{chartType,jdbcType=VARCHAR}, chart_type = #{chartType,jdbcType=VARCHAR},
is_plugin = #{isPlugin,jdbcType=BIT}, is_plugin = #{isPlugin,jdbcType=BIT},
data_from = #{dataFrom,jdbcType=VARCHAR},
x_axis = #{xAxis,jdbcType=LONGVARCHAR}, x_axis = #{xAxis,jdbcType=LONGVARCHAR},
x_axis_ext = #{xAxisExt,jdbcType=LONGVARCHAR}, x_axis_ext = #{xAxisExt,jdbcType=LONGVARCHAR},
y_axis = #{yAxis,jdbcType=LONGVARCHAR}, y_axis = #{yAxis,jdbcType=LONGVARCHAR},
...@@ -615,7 +631,8 @@ ...@@ -615,7 +631,8 @@
update_time = #{updateTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT},
style_priority = #{stylePriority,jdbcType=VARCHAR}, style_priority = #{stylePriority,jdbcType=VARCHAR},
chart_type = #{chartType,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} where id = #{id,jdbcType=VARCHAR}
</update> </update>
</mapper> </mapper>
\ No newline at end of file
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
<result column="copy_from_view" jdbcType="VARCHAR" property="copyFromView" /> <result column="copy_from_view" jdbcType="VARCHAR" property="copyFromView" />
<result column="copy_from" jdbcType="VARCHAR" property="copyFrom" /> <result column="copy_from" jdbcType="VARCHAR" property="copyFrom" />
<result column="copy_id" jdbcType="VARCHAR" property="copyId" /> <result column="copy_id" jdbcType="VARCHAR" property="copyId" />
<result column="data_from" jdbcType="VARCHAR" property="dataFrom" />
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.dataease.base.domain.PanelView"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.dataease.base.domain.PanelView">
<result column="content" jdbcType="LONGVARBINARY" property="content" /> <result column="content" jdbcType="LONGVARBINARY" property="content" />
...@@ -79,7 +78,7 @@ ...@@ -79,7 +78,7 @@
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, panel_id, chart_view_id, create_by, create_time, update_by, update_time, `position`, 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>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
content content
...@@ -137,12 +136,12 @@ ...@@ -137,12 +136,12 @@
create_by, create_time, update_by, create_by, create_time, update_by,
update_time, `position`, copy_from_panel, update_time, `position`, copy_from_panel,
copy_from_view, copy_from, copy_id, copy_from_view, copy_from, copy_id,
data_from, content) content)
values (#{id,jdbcType=VARCHAR}, #{panelId,jdbcType=VARCHAR}, #{chartViewId,jdbcType=VARCHAR}, values (#{id,jdbcType=VARCHAR}, #{panelId,jdbcType=VARCHAR}, #{chartViewId,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateBy,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=BIGINT}, #{position,jdbcType=VARCHAR}, #{copyFromPanel,jdbcType=VARCHAR}, #{updateTime,jdbcType=BIGINT}, #{position,jdbcType=VARCHAR}, #{copyFromPanel,jdbcType=VARCHAR},
#{copyFromView,jdbcType=VARCHAR}, #{copyFrom,jdbcType=VARCHAR}, #{copyId,jdbcType=VARCHAR}, #{copyFromView,jdbcType=VARCHAR}, #{copyFrom,jdbcType=VARCHAR}, #{copyId,jdbcType=VARCHAR},
#{dataFrom,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARBINARY}) #{content,jdbcType=LONGVARBINARY})
</insert> </insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.PanelView"> <insert id="insertSelective" parameterType="io.dataease.base.domain.PanelView">
insert into panel_view insert into panel_view
...@@ -183,9 +182,6 @@ ...@@ -183,9 +182,6 @@
<if test="copyId != null"> <if test="copyId != null">
copy_id, copy_id,
</if> </if>
<if test="dataFrom != null">
data_from,
</if>
<if test="content != null"> <if test="content != null">
content, content,
</if> </if>
...@@ -227,9 +223,6 @@ ...@@ -227,9 +223,6 @@
<if test="copyId != null"> <if test="copyId != null">
#{copyId,jdbcType=VARCHAR}, #{copyId,jdbcType=VARCHAR},
</if> </if>
<if test="dataFrom != null">
#{dataFrom,jdbcType=VARCHAR},
</if>
<if test="content != null"> <if test="content != null">
#{content,jdbcType=LONGVARBINARY}, #{content,jdbcType=LONGVARBINARY},
</if> </if>
...@@ -280,9 +273,6 @@ ...@@ -280,9 +273,6 @@
<if test="record.copyId != null"> <if test="record.copyId != null">
copy_id = #{record.copyId,jdbcType=VARCHAR}, copy_id = #{record.copyId,jdbcType=VARCHAR},
</if> </if>
<if test="record.dataFrom != null">
data_from = #{record.dataFrom,jdbcType=VARCHAR},
</if>
<if test="record.content != null"> <if test="record.content != null">
content = #{record.content,jdbcType=LONGVARBINARY}, content = #{record.content,jdbcType=LONGVARBINARY},
</if> </if>
...@@ -305,7 +295,6 @@ ...@@ -305,7 +295,6 @@
copy_from_view = #{record.copyFromView,jdbcType=VARCHAR}, copy_from_view = #{record.copyFromView,jdbcType=VARCHAR},
copy_from = #{record.copyFrom,jdbcType=VARCHAR}, copy_from = #{record.copyFrom,jdbcType=VARCHAR},
copy_id = #{record.copyId,jdbcType=VARCHAR}, copy_id = #{record.copyId,jdbcType=VARCHAR},
data_from = #{record.dataFrom,jdbcType=VARCHAR},
content = #{record.content,jdbcType=LONGVARBINARY} content = #{record.content,jdbcType=LONGVARBINARY}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
...@@ -324,8 +313,7 @@ ...@@ -324,8 +313,7 @@
copy_from_panel = #{record.copyFromPanel,jdbcType=VARCHAR}, copy_from_panel = #{record.copyFromPanel,jdbcType=VARCHAR},
copy_from_view = #{record.copyFromView,jdbcType=VARCHAR}, copy_from_view = #{record.copyFromView,jdbcType=VARCHAR},
copy_from = #{record.copyFrom,jdbcType=VARCHAR}, copy_from = #{record.copyFrom,jdbcType=VARCHAR},
copy_id = #{record.copyId,jdbcType=VARCHAR}, copy_id = #{record.copyId,jdbcType=VARCHAR}
data_from = #{record.dataFrom,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
...@@ -366,9 +354,6 @@ ...@@ -366,9 +354,6 @@
<if test="copyId != null"> <if test="copyId != null">
copy_id = #{copyId,jdbcType=VARCHAR}, copy_id = #{copyId,jdbcType=VARCHAR},
</if> </if>
<if test="dataFrom != null">
data_from = #{dataFrom,jdbcType=VARCHAR},
</if>
<if test="content != null"> <if test="content != null">
content = #{content,jdbcType=LONGVARBINARY}, content = #{content,jdbcType=LONGVARBINARY},
</if> </if>
...@@ -388,7 +373,6 @@ ...@@ -388,7 +373,6 @@
copy_from_view = #{copyFromView,jdbcType=VARCHAR}, copy_from_view = #{copyFromView,jdbcType=VARCHAR},
copy_from = #{copyFrom,jdbcType=VARCHAR}, copy_from = #{copyFrom,jdbcType=VARCHAR},
copy_id = #{copyId,jdbcType=VARCHAR}, copy_id = #{copyId,jdbcType=VARCHAR},
data_from = #{dataFrom,jdbcType=VARCHAR},
content = #{content,jdbcType=LONGVARBINARY} content = #{content,jdbcType=LONGVARBINARY}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
...@@ -404,8 +388,7 @@ ...@@ -404,8 +388,7 @@
copy_from_panel = #{copyFromPanel,jdbcType=VARCHAR}, copy_from_panel = #{copyFromPanel,jdbcType=VARCHAR},
copy_from_view = #{copyFromView,jdbcType=VARCHAR}, copy_from_view = #{copyFromView,jdbcType=VARCHAR},
copy_from = #{copyFrom,jdbcType=VARCHAR}, copy_from = #{copyFrom,jdbcType=VARCHAR},
copy_id = #{copyId,jdbcType=VARCHAR}, copy_id = #{copyId,jdbcType=VARCHAR}
data_from = #{dataFrom,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
</mapper> </mapper>
\ No newline at end of file
...@@ -54,7 +54,8 @@ ...@@ -54,7 +54,8 @@
custom_filter, custom_filter,
drill_fields, drill_fields,
senior, senior,
SNAPSHOT SNAPSHOT,
data_from
) SELECT ) SELECT
id, id,
`name`, `name`,
...@@ -82,7 +83,8 @@ ...@@ -82,7 +83,8 @@
custom_filter, custom_filter,
drill_fields, drill_fields,
senior, senior,
SNAPSHOT from chart_view SNAPSHOT,
data_from from chart_view
WHERE WHERE
chart_view.id = #{id} chart_view.id = #{id}
</insert> </insert>
...@@ -181,7 +183,8 @@ ...@@ -181,7 +183,8 @@
`result_count`, `result_count`,
`result_mode`, `result_mode`,
`chart_type`, `chart_type`,
`senior`) `senior`,
`data_from`)
SELECT #{newChartId}, SELECT #{newChartId},
`name`, `name`,
#{panelId}, #{panelId},
...@@ -207,7 +210,8 @@ ...@@ -207,7 +210,8 @@
`result_count`, `result_count`,
`result_mode`, `result_mode`,
'private', 'private',
`senior` `senior`,
`data_from`
FROM chart_view_cache FROM chart_view_cache
WHERE id = #{oldChartId} WHERE id = #{oldChartId}
</insert> </insert>
...@@ -256,7 +260,8 @@ ...@@ -256,7 +260,8 @@
custom_style, custom_style,
custom_filter, custom_filter,
drill_fields, drill_fields,
SNAPSHOT) SNAPSHOT,
data_from)
SELECT pv_copy.chart_view_id AS id, SELECT pv_copy.chart_view_id AS id,
`name`, `name`,
title, title,
...@@ -282,7 +287,8 @@ ...@@ -282,7 +287,8 @@
custom_style, custom_style,
custom_filter, custom_filter,
drill_fields, drill_fields,
SNAPSHOT SNAPSHOT,
data_from
FROM ( FROM (
SELECT panel_id, SELECT panel_id,
copy_from_view, copy_from_view,
...@@ -389,7 +395,9 @@ ...@@ -389,7 +395,9 @@
cv.custom_filter = cve.custom_filter, cv.custom_filter = cve.custom_filter,
cv.drill_fields = cve.drill_fields, cv.drill_fields = cve.drill_fields,
cv.senior = cve.senior, 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=')'> <foreach collection="viewIds" item="viewId" open='(' separator=',' close=')'>
#{viewId} #{viewId}
</foreach> </foreach>
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
panel_group.`name` AS label, panel_group.`name` AS label,
panel_group.`source`, panel_group.`source`,
panel_group.`panel_type`, panel_group.`panel_type`,
sourcePanelGroup.`mobile_layout`,
sourcePanelGroup.`name` as source_panel_name, sourcePanelGroup.`name` as source_panel_name,
authInfo.privileges as `privileges` authInfo.privileges as `privileges`
from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'panel') cids) t,panel_group from (select GET_V_AUTH_MODEL_ID_P_USE (#{userId}, 'panel') cids) t,panel_group
...@@ -105,6 +106,7 @@ ...@@ -105,6 +106,7 @@
panel_group.panel_type, panel_group.panel_type,
panel_group.`name` AS label, panel_group.`name` AS label,
panel_group.`node_type`, panel_group.`node_type`,
panel_group.`mobile_layout`,
(case when ISNULL(defaultPanelGroup.id) then false else true end) is_default, (case when ISNULL(defaultPanelGroup.id) then false else true end) is_default,
defaultPanelGroup.id as default_panel_id, defaultPanelGroup.id as default_panel_id,
defaultPanelGroup.`name` as default_panel_name, defaultPanelGroup.`name` as default_panel_name,
......
...@@ -110,6 +110,4 @@ ...@@ -110,6 +110,4 @@
and chart_view.id is not null and chart_view.id is not null
</insert> </insert>
</mapper> </mapper>
...@@ -69,4 +69,15 @@ public class CommonConstants { ...@@ -69,4 +69,15 @@ public class CommonConstants {
public static final String CACHE = "cache"; public static final String CACHE = "cache";
} }
//视图数据读取来源
public static final class VIEW_DATA_FROM {
// 模板数据
public static final String TEMPLATE = "template";
//数据集数据
public static final String CHART = "dataset";
}
} }
...@@ -14,6 +14,7 @@ import io.dataease.controller.request.chart.ChartViewRequest; ...@@ -14,6 +14,7 @@ import io.dataease.controller.request.chart.ChartViewRequest;
import io.dataease.controller.response.ChartDetail; import io.dataease.controller.response.ChartDetail;
import io.dataease.dto.chart.ChartViewDTO; import io.dataease.dto.chart.ChartViewDTO;
import io.dataease.service.chart.ChartViewService; import io.dataease.service.chart.ChartViewService;
import io.dataease.service.panel.PanelViewService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -33,6 +34,8 @@ import java.util.List; ...@@ -33,6 +34,8 @@ import java.util.List;
public class ChartViewController { public class ChartViewController {
@Resource @Resource
private ChartViewService chartViewService; private ChartViewService chartViewService;
@Resource
private PanelViewService panelViewService;
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE) @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE)
@ApiOperation("保存") @ApiOperation("保存")
...@@ -73,7 +76,8 @@ public class ChartViewController { ...@@ -73,7 +76,8 @@ public class ChartViewController {
@ApiOperation("详细信息") @ApiOperation("详细信息")
@PostMapping("/get/{id}/{panelId}") @PostMapping("/get/{id}/{panelId}")
public ChartViewDTO get(@PathVariable String id, @PathVariable String panelId,@RequestBody ChartViewRequest viewRequest) { public ChartViewDTO get(@PathVariable String id, @PathVariable String panelId,@RequestBody ChartViewRequest viewRequest) {
return chartViewService.getOne(id,viewRequest.getQueryFrom()); ChartViewDTO result = chartViewService.getOne(id,viewRequest.getQueryFrom());
return result;
} }
@ApiIgnore @ApiIgnore
......
...@@ -30,4 +30,6 @@ public class ChartViewDTO extends ChartViewWithBLOBs { ...@@ -30,4 +30,6 @@ public class ChartViewDTO extends ChartViewWithBLOBs {
private boolean drill; private boolean drill;
@ApiModelProperty("下钻条件集合") @ApiModelProperty("下钻条件集合")
private List<ChartExtFilterRequest> drillFilters; private List<ChartExtFilterRequest> drillFilters;
@ApiModelProperty("视图存放位置")
private String position;
} }
...@@ -24,12 +24,5 @@ public class PanelViewInsertDTO extends PanelView { ...@@ -24,12 +24,5 @@ public class PanelViewInsertDTO extends PanelView {
super.setPanelId(panelGroupId); super.setPanelId(panelGroupId);
super.setPosition(position); 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);
}
} }
...@@ -7,6 +7,7 @@ import io.dataease.auth.service.AuthUserService; ...@@ -7,6 +7,7 @@ import io.dataease.auth.service.AuthUserService;
import io.dataease.base.domain.*; import io.dataease.base.domain.*;
import io.dataease.base.mapper.ChartViewCacheMapper; import io.dataease.base.mapper.ChartViewCacheMapper;
import io.dataease.base.mapper.ChartViewMapper; import io.dataease.base.mapper.ChartViewMapper;
import io.dataease.base.mapper.PanelViewMapper;
import io.dataease.base.mapper.ext.ExtChartGroupMapper; import io.dataease.base.mapper.ext.ExtChartGroupMapper;
import io.dataease.base.mapper.ext.ExtChartViewMapper; import io.dataease.base.mapper.ext.ExtChartViewMapper;
import io.dataease.commons.constants.ColumnPermissionConstants; import io.dataease.commons.constants.ColumnPermissionConstants;
...@@ -23,6 +24,7 @@ import io.dataease.dto.chart.*; ...@@ -23,6 +24,7 @@ import io.dataease.dto.chart.*;
import io.dataease.dto.dataset.DataSetTableDTO; import io.dataease.dto.dataset.DataSetTableDTO;
import io.dataease.dto.dataset.DataSetTableUnionDTO; import io.dataease.dto.dataset.DataSetTableUnionDTO;
import io.dataease.dto.dataset.DataTableInfoDTO; import io.dataease.dto.dataset.DataTableInfoDTO;
import io.dataease.exception.DataEaseException;
import io.dataease.i18n.Translator; import io.dataease.i18n.Translator;
import io.dataease.listener.util.CacheUtils; import io.dataease.listener.util.CacheUtils;
import io.dataease.provider.ProviderFactory; import io.dataease.provider.ProviderFactory;
...@@ -35,6 +37,8 @@ import io.dataease.service.dataset.DataSetTableUnionService; ...@@ -35,6 +37,8 @@ import io.dataease.service.dataset.DataSetTableUnionService;
import io.dataease.service.dataset.PermissionService; import io.dataease.service.dataset.PermissionService;
import io.dataease.service.datasource.DatasourceService; import io.dataease.service.datasource.DatasourceService;
import io.dataease.service.engine.EngineService; import io.dataease.service.engine.EngineService;
import io.dataease.service.panel.PanelGroupExtendDataService;
import io.dataease.service.panel.PanelViewService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -77,6 +81,11 @@ public class ChartViewService { ...@@ -77,6 +81,11 @@ public class ChartViewService {
private EngineService engineService; private EngineService engineService;
@Resource @Resource
private ChartViewCacheMapper chartViewCacheMapper; private ChartViewCacheMapper chartViewCacheMapper;
@Resource
private PanelViewService panelViewService;
@Resource
private PanelGroupExtendDataService extendDataService;
//默认使用非公平 //默认使用非公平
private ReentrantLock lock = new ReentrantLock(); private ReentrantLock lock = new ReentrantLock();
...@@ -223,20 +232,31 @@ public class ChartViewService { ...@@ -223,20 +232,31 @@ public class ChartViewService {
return extChartViewMapper.searchOneWithPrivileges(userId, id); return extChartViewMapper.searchOneWithPrivileges(userId, id);
} }
@Transactional @Transactional
public ChartViewDTO getOne(String id, String queryFrom) { public ChartViewDTO getOne(String id, String queryFrom) {
ChartViewDTO result; try{
//仪表板编辑页面 从缓存表中取数据 缓存表中没有数据则进行插入 ChartViewDTO result;
if (CommonConstants.VIEW_QUERY_FROM.PANEL_EDIT.equals(queryFrom)) { if(CommonConstants.VIEW_QUERY_FROM.PANEL_EDIT.equals(queryFrom)) {
result = extChartViewMapper.searchOneFromCache(id); //仪表板编辑页面 从缓存表中取数据 缓存表中没有数据则进行插入
if (result == null) {
extChartViewMapper.copyToCache(id);
result = extChartViewMapper.searchOneFromCache(id); result = extChartViewMapper.searchOneFromCache(id);
if (result == null) {
extChartViewMapper.copyToCache(id);
result = extChartViewMapper.searchOneFromCache(id);
}
} else {
result = extChartViewMapper.searchOne(id);
} }
} else { if(result==null){
result = extChartViewMapper.searchOne(id); 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) { public void delete(String id) {
...@@ -250,13 +270,26 @@ public class ChartViewService { ...@@ -250,13 +270,26 @@ public class ChartViewService {
} }
public ChartViewDTO getData(String id, ChartExtRequest request) throws Exception { public ChartViewDTO getData(String id, ChartExtRequest request) throws Exception {
ChartViewDTO view = this.getOne(id, request.getQueryFrom()); 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()); if (CommonConstants.VIEW_QUERY_FROM.PANEL.equals(request.getQueryFrom()) && CommonConstants.VIEW_RESULT_MODE.CUSTOM.equals(request.getResultMode())) {
view.setResultCount(request.getResultCount()); 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) {
e.printStackTrace();
DataEaseException.throwException(e);
} }
return calcData(view, request, request.isCache()); return null;
} }
public ChartViewDTO calcData(ChartViewDTO view, ChartExtRequest requestList, boolean cache) throws Exception { public ChartViewDTO calcData(ChartViewDTO view, ChartExtRequest requestList, boolean cache) throws Exception {
......
package io.dataease.service.panel;
import com.alibaba.fastjson.JSONObject;
import io.dataease.base.domain.PanelGroupExtendData;
import io.dataease.base.domain.PanelGroupExtendDataExample;
import io.dataease.base.mapper.PanelGroupExtendDataMapper;
import io.dataease.commons.constants.CommonConstants;
import io.dataease.dto.chart.ChartViewDTO;
import io.dataease.exception.DataEaseException;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* Author: wangjiahao
* Date: 2022/3/15
* Description:
*/
@Service
public class PanelGroupExtendDataService {
@Resource
private PanelGroupExtendDataMapper panelGroupExtendDataMapper;
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 chartViewTemplate = JSONObject.parseObject(extendDataList.get(0).getViewDetails(),ChartViewDTO.class);
view.setData(chartViewTemplate.getData());
}else{
DataEaseException.throwException("模板缓存数据中未获取指定视图数据:"+viewId);
}
return view;
}
}
package io.dataease.service.panel; package io.dataease.service.panel;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import io.dataease.auth.annotation.DeCleaner; import io.dataease.auth.annotation.DeCleaner;
import io.dataease.base.domain.*; import io.dataease.base.domain.*;
import io.dataease.base.mapper.*; import io.dataease.base.mapper.*;
import io.dataease.base.mapper.ext.*; import io.dataease.base.mapper.ext.*;
import io.dataease.commons.constants.CommonConstants;
import io.dataease.commons.constants.DePermissionType; import io.dataease.commons.constants.DePermissionType;
import io.dataease.commons.constants.PanelConstants; import io.dataease.commons.constants.PanelConstants;
import io.dataease.commons.utils.AuthUtils; import io.dataease.commons.utils.AuthUtils;
...@@ -326,17 +328,21 @@ public class PanelGroupService { ...@@ -326,17 +328,21 @@ public class PanelGroupService {
for(Map.Entry<String, String> entry : dynamicDataMap.entrySet()){ for(Map.Entry<String, String> entry : dynamicDataMap.entrySet()){
String originViewId = entry.getKey(); String originViewId = entry.getKey();
String originViewData = entry.getValue(); String originViewData = entry.getValue();
String position = JSON.parseObject(originViewData).getString("position"); ChartViewDTO chartView = JSON.parseObject(originViewData,ChartViewDTO.class);
String position = chartView.getPosition();
String newViewId = UUIDUtil.getUUIDAsString(); 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数据 //TODO 数据处理 1.替换viewId 2.加入panelView 数据(数据来源为template) 3.加入模板view data数据
templateData = templateData.replaceAll(originViewId,newViewId); 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)); viewsData.add(new PanelGroupExtendDataDTO(newPanelId,newViewId,originViewData));
chartViewMapper.insertSelective(chartView);
extChartViewMapper.copyToCache(newViewId);
} }
if(CollectionUtils.isNotEmpty(panelViews)){ if(CollectionUtils.isNotEmpty(panelViews)){
extPanelViewMapper.savePanelView(panelViews); extPanelViewMapper.savePanelView(panelViews);
}
if(CollectionUtils.isNotEmpty(viewsData)){
extPanelGroupExtendDataMapper.savePanelExtendData(viewsData); extPanelGroupExtendDataMapper.savePanelExtendData(viewsData);
} }
request.setPanelData(templateData); request.setPanelData(templateData);
......
...@@ -10,6 +10,7 @@ import io.dataease.base.mapper.PanelViewMapper; ...@@ -10,6 +10,7 @@ import io.dataease.base.mapper.PanelViewMapper;
import io.dataease.base.mapper.ext.ExtChartViewMapper; import io.dataease.base.mapper.ext.ExtChartViewMapper;
import io.dataease.base.mapper.ext.ExtPanelGroupMapper; import io.dataease.base.mapper.ext.ExtPanelGroupMapper;
import io.dataease.base.mapper.ext.ExtPanelViewMapper; import io.dataease.base.mapper.ext.ExtPanelViewMapper;
import io.dataease.commons.constants.CommonConstants;
import io.dataease.commons.utils.AuthUtils; import io.dataease.commons.utils.AuthUtils;
import io.dataease.commons.utils.BeanUtils; import io.dataease.commons.utils.BeanUtils;
import io.dataease.dto.panel.PanelViewDto; import io.dataease.dto.panel.PanelViewDto;
...@@ -130,8 +131,6 @@ public class PanelViewService { ...@@ -130,8 +131,6 @@ public class PanelViewService {
} }
} }
panelGroup.setMobileLayout(mobileLayout); panelGroup.setMobileLayout(mobileLayout);
//移除没有用到的仪表板私有视图
extPanelGroupMapper.removeUselessViews(panelId,viewIds);
return viewIds; return viewIds;
} }
...@@ -144,4 +143,15 @@ public class PanelViewService { ...@@ -144,4 +143,15 @@ public class PanelViewService {
panelViewExample.createCriteria().andCopyIdEqualTo(copyId); panelViewExample.createCriteria().andCopyIdEqualTo(copyId);
return panelViewMapper.selectByExample(panelViewExample); return panelViewMapper.selectByExample(panelViewExample);
} }
public PanelView findByViewId(String viewId){
PanelViewExample panelViewExample = new PanelViewExample();
panelViewExample.createCriteria().andChartViewIdEqualTo(viewId);
List<PanelView> result = panelViewMapper.selectByExample(panelViewExample);
if(CollectionUtils.isNotEmpty(result)){
return result.get(0);
}else{
return null;
}
}
} }
...@@ -34,8 +34,11 @@ CREATE TABLE `chart_view_cache` ( ...@@ -34,8 +34,11 @@ CREATE TABLE `chart_view_cache` (
SET FOREIGN_KEY_CHECKS = 1; SET FOREIGN_KEY_CHECKS = 1;
ALTER TABLE `panel_view` ALTER TABLE `chart_view`
ADD COLUMN `data_from` varchar(255) NULL DEFAULT 'chart' COMMENT '当前数据来源 chart 视图 template 模板' AFTER `copy_id`; 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; SET NAMES utf8mb4;
......
...@@ -60,9 +60,11 @@ ...@@ -60,9 +60,11 @@
</javaClientGenerator> </javaClientGenerator>
<!--要生成的数据库表 --> <!--要生成的数据库表 -->
<table tableName="de_engine"> <!-- <table tableName="de_engine">-->
<columnOverride column="configuration" property="configuration" javaType="java.lang.String"/> <!-- <columnOverride column="configuration" property="configuration" javaType="java.lang.String"/>-->
</table> <!-- </table>-->
<table tableName="panel_view"/>
<table tableName="chart_view"/>
<table tableName="chart_view_cache"/> <table tableName="chart_view_cache"/>
</context> </context>
</generatorConfiguration> </generatorConfiguration>
...@@ -4,7 +4,8 @@ export function save(data) { ...@@ -4,7 +4,8 @@ export function save(data) {
return request({ return request({
url: '/template/save', url: '/template/save',
data: data, data: data,
method: 'post' method: 'post',
loading: true
}) })
} }
export function templateDelete(id) { export function templateDelete(id) {
......
<svg width="1285" height="1024" xmlns="http://www.w3.org/2000/svg" p-id="2359" version="1.1" class="icon" t="1621433305409">
<defs>
<filter id="svg_4_blur">
<feGaussianBlur stdDeviation="0" in="SourceGraphic"/>
</filter>
</defs>
<g>
<title>Layer 1</title>
<path id="svg_1" p-id="2360" fill="#0069F6" d="m100.39216,70.27451a30.11765,30.11765 0 0 0 -30.11765,30.11765l0,823.21568a30.11765,30.11765 0 0 0 30.11765,30.11765l1084.23529,0a30.11765,30.11765 0 0 0 30.11765,-30.11765l0,-823.21568a30.11765,30.11765 0 0 0 -30.11765,-30.11765l-1084.23529,0zm0,-60.23529l1084.23529,0a90.35294,90.35294 0 0 1 90.35294,90.35294l0,823.21568a90.35294,90.35294 0 0 1 -90.35294,90.35294l-1084.23529,0a90.35294,90.35294 0 0 1 -90.35294,-90.35294l0,-823.21568a90.35294,90.35294 0 0 1 90.35294,-90.35294z"/>
<path id="svg_2" p-id="2361" fill="#5ED7BC" d="m261.01961,261.01961m-60.2353,0a60.23529,60.23529 0 1 0 120.47059,0a60.23529,60.23529 0 1 0 -120.47059,0z"/>
<path id="svg_3" p-id="2362" fill="#5ED7BC" d="m331.29412,839.47922a30.11765,30.11765 0 0 1 -60.2353,0a189.94196,189.94196 0 0 1 189.94196,-189.94197l186.58887,0a102.46023,102.46023 0 0 0 98.4847,-130.71058a162.69553,162.69553 0 0 1 156.37083,-207.61098l241.14196,0a30.11765,30.11765 0 0 1 0,60.23529l-241.14196,0a102.46023,102.46023 0 0 0 -98.46463,130.73067a162.69553,162.69553 0 0 1 -156.3909,207.61098l-186.58887,0a129.70667,129.70667 0 0 0 -129.70666,129.70666l0,-0.02007z"/>
<rect stroke="null" id="svg_8" height="760.00015" width="508.00008" y="187.00002" x="689.50014" fill="#000000"/>
<rect stroke="null" rx="5" filter="url(#svg_4_blur)" id="svg_4" height="669.66668" width="430.00003" y="231.99995" x="728.16665" fill="#56ffff"/>
<line stroke="null" id="svg_5" y2="392.99996" x2="754.16667" y1="392.99996" x1="559.16667" fill="none"/>
<ellipse stroke="null" ry="65.5" rx="66.33335" id="svg_6" cy="823.83325" cx="952.16662" fill="#000000"/>
<rect stroke="null" id="svg_7" height="47.66669" width="187.33336" y="242.6666" x="863.49997" fill="#000000"/>
</g>
</svg>
\ No newline at end of file
...@@ -1381,6 +1381,7 @@ export default { ...@@ -1381,6 +1381,7 @@ export default {
sure_bt: 'Confirm' sure_bt: 'Confirm'
}, },
panel: { panel: {
template_view_tips: "Template's Views. Please Change",
no_auth_role: 'Unshared roles', no_auth_role: 'Unshared roles',
auth_role: 'Shared roles', auth_role: 'Shared roles',
picture_limit: 'Only pictures can be inserted', picture_limit: 'Only pictures can be inserted',
......
...@@ -1382,6 +1382,7 @@ export default { ...@@ -1382,6 +1382,7 @@ export default {
sure_bt: '確定' sure_bt: '確定'
}, },
panel: { panel: {
template_view_tips: '当前是模板视图,请点击更换数据集',
no_auth_role: '未分享角色', no_auth_role: '未分享角色',
auth_role: '已分享角色', auth_role: '已分享角色',
picture_limit: '只能插入圖片', picture_limit: '只能插入圖片',
......
...@@ -1390,6 +1390,7 @@ export default { ...@@ -1390,6 +1390,7 @@ export default {
sure_bt: '确定' sure_bt: '确定'
}, },
panel: { panel: {
template_view_tips: '当前是模板视图,请点击更换数据集',
no_auth_role: '未分享角色', no_auth_role: '未分享角色',
auth_role: '已分享角色', auth_role: '已分享角色',
picture_limit: '只能插入图片', picture_limit: '只能插入图片',
......
...@@ -41,6 +41,20 @@ ...@@ -41,6 +41,20 @@
<el-row class="view-panel-row"> <el-row class="view-panel-row">
<el-tabs :stretch="true" class="tab-header"> <el-tabs :stretch="true" class="tab-header">
<el-tab-pane :label="$t('chart.chart_data')" class="padding-tab" style="width: 300px"> <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-row class="view-panel">
<el-col class="theme-border-class" :span="12" style="border-right: 1px solid #E6E6E6;"> <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;"> <div style="display: flex;align-items: center;justify-content: center;padding: 6px;">
...@@ -1388,6 +1402,7 @@ export default { ...@@ -1388,6 +1402,7 @@ export default {
} }
}, },
created() { created() {
debugger
// this.get(this.$store.state.chart.viewId); // this.get(this.$store.state.chart.viewId);
// this.initAreas() // this.initAreas()
}, },
...@@ -1402,6 +1417,13 @@ export default { ...@@ -1402,6 +1417,13 @@ export default {
}, },
methods: { methods: {
emptyTableData() {
this.table = {}
this.dimension = []
this.quota = []
this.dimensionData = []
this.quotaData = []
},
initFromPanel() { initFromPanel() {
this.hasEdit = (this.panelViewEditInfo[this.param.id] || false) this.hasEdit = (this.panelViewEditInfo[this.param.id] || false)
}, },
...@@ -1613,6 +1635,8 @@ export default { ...@@ -1613,6 +1635,8 @@ export default {
ele.filter = [] ele.filter = []
} }
}) })
this.view = JSON.parse(JSON.stringify(view))
// stringify json param
view.xaxis = JSON.stringify(view.xaxis) view.xaxis = JSON.stringify(view.xaxis)
view.xaxisExt = JSON.stringify(view.xaxisExt) view.xaxisExt = JSON.stringify(view.xaxisExt)
view.yaxis = JSON.stringify(view.yaxis) view.yaxis = JSON.stringify(view.yaxis)
...@@ -1787,7 +1811,11 @@ export default { ...@@ -1787,7 +1811,11 @@ export default {
getChart(id, queryFrom = 'panel_edit') { getChart(id, queryFrom = 'panel_edit') {
if (id) { if (id) {
getChartDetails(id, this.panelInfo.id, { queryFrom: queryFrom }).then(response => { getChartDetails(id, this.panelInfo.id, { queryFrom: queryFrom }).then(response => {
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 = JSON.parse(JSON.stringify(response.data))
this.view.xaxis = this.view.xaxis ? JSON.parse(this.view.xaxis) : [] this.view.xaxis = this.view.xaxis ? JSON.parse(this.view.xaxis) : []
this.view.xaxisExt = this.view.xaxisExt ? JSON.parse(this.view.xaxisExt) : [] this.view.xaxisExt = this.view.xaxisExt ? JSON.parse(this.view.xaxisExt) : []
...@@ -2145,10 +2173,12 @@ export default { ...@@ -2145,10 +2173,12 @@ export default {
this.view.extStack = [] this.view.extStack = []
this.view.extBubble = [] this.view.extBubble = []
this.view.drillFields = [] this.view.drillFields = []
this.view.dataFrom = 'dataset'
} }
// this.save(true, 'chart', false) // this.save(true, 'chart', false)
this.calcData(true, 'chart', false) this.calcData(true, 'chart', false)
this.initTableData(this.view.tableId) this.initTableData(this.view.tableId)
this.closeChangeChart()
}, },
fieldFilter(val) { fieldFilter(val) {
...@@ -2516,6 +2546,22 @@ export default { ...@@ -2516,6 +2546,22 @@ export default {
height: calc(100vh - 75px); 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 { .view-panel {
display: flex; display: flex;
height: calc(100% - 80px); height: calc(100% - 80px);
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<span v-else> <span v-else>
<svg-icon :icon-class="data.modelInnerType" style="width: 14px;height: 14px" /> <svg-icon :icon-class="data.modelInnerType" style="width: 14px;height: 14px" />
</span> </span>
<span style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">{{ data.name }}</span> <span style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" :title="data.name">{{ data.name }}</span>
</span> </span>
<span v-if="data.mode===1" class="child"> <span v-if="data.mode===1" class="child">
<span @click.stop> <span @click.stop>
......
...@@ -146,13 +146,17 @@ export default { ...@@ -146,13 +146,17 @@ export default {
return false return false
} }
this.editPanel.panelInfo['newFrom'] = this.inputType this.editPanel.panelInfo['newFrom'] = this.inputType
this.loading = true
panelSave(this.editPanel.panelInfo).then(response => { panelSave(this.editPanel.panelInfo).then(response => {
this.$message({ this.$message({
message: this.$t('commons.save_success'), message: this.$t('commons.save_success'),
type: 'success', type: 'success',
showClose: true showClose: true
}) })
this.loading = false
this.$emit('closeEditPanelDialog', response.data) this.$emit('closeEditPanelDialog', response.data)
}).catch(() => {
this.loading = false
}) })
}, },
handleFileChange(e) { handleFileChange(e) {
......
...@@ -39,9 +39,10 @@ ...@@ -39,9 +39,10 @@
<span slot-scope="{ node, data }" class="custom-tree-node father"> <span slot-scope="{ node, data }" class="custom-tree-node father">
<span style="display: flex; flex: 1 1 0%; width: 0px;"> <span style="display: flex; flex: 1 1 0%; width: 0px;">
<span> <span>
<svg-icon icon-class="panel" class="ds-icon-scene" /> <svg-icon v-if="!data.mobileLayout" icon-class="panel" class="ds-icon-scene" />
<svg-icon v-if="data.mobileLayout" icon-class="panel-mobile" class="ds-icon-scene" />
</span> </span>
<span style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">{{ data.name }}</span> <span style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" :title="data.name">{{ data.name }}</span>
</span> </span>
<span style="margin-left: 12px;" class="child" @click.stop> <span style="margin-left: 12px;" class="child" @click.stop>
<el-dropdown v-if="hasDataPermission('manage',data.privileges)" trigger="click" size="small" @command="clickMore"> <el-dropdown v-if="hasDataPermission('manage',data.privileges)" trigger="click" size="small" @command="clickMore">
...@@ -90,12 +91,13 @@ ...@@ -90,12 +91,13 @@
<span slot-scope="{ node, data }" class="custom-tree-node-list father"> <span slot-scope="{ node, data }" class="custom-tree-node-list father">
<span style="display: flex; flex: 1 1 0%; width: 0px;"> <span style="display: flex; flex: 1 1 0%; width: 0px;">
<span v-if="data.nodeType === 'panel'"> <span v-if="data.nodeType === 'panel'">
<svg-icon icon-class="panel" class="ds-icon-scene" /> <svg-icon v-if="!data.mobileLayout" icon-class="panel" class="ds-icon-scene" />
<svg-icon v-if="data.mobileLayout" icon-class="panel-mobile" class="ds-icon-scene" />
</span> </span>
<span v-if="data.nodeType === 'folder'"> <span v-if="data.nodeType === 'folder'">
<i class="el-icon-folder" /> <i class="el-icon-folder" />
</span> </span>
<span style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">{{ data.name }}</span> <span style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" :title="data.name">{{ data.name }}</span>
</span> </span>
<span v-if="hasDataPermission('manage',data.privileges)" class="child"> <span v-if="hasDataPermission('manage',data.privileges)" class="child">
<span v-if="data.nodeType ==='folder'" @click.stop> <span v-if="data.nodeType ==='folder'" @click.stop>
......
<template> <template>
<el-row> <el-row v-loading="$store.getters.loadingMap[$store.getters.currentPath]">
<el-row style="margin-top: 5px"> <el-row style="margin-top: 5px">
<el-col :span="4">{{ $t('commons.name') }}</el-col> <el-col :span="4">{{ $t('commons.name') }}</el-col>
<el-col :span="16"> <el-col :span="16">
...@@ -44,6 +44,7 @@ export default { ...@@ -44,6 +44,7 @@ export default {
name: '', name: '',
templateStyle: null, templateStyle: null,
templateData: null, templateData: null,
dynamicData: null,
snapshot: '' snapshot: ''
} }
} }
...@@ -118,6 +119,7 @@ export default { ...@@ -118,6 +119,7 @@ export default {
this.templateInfo.templateStyle = this.importTemplateInfo.panelStyle this.templateInfo.templateStyle = this.importTemplateInfo.panelStyle
this.templateInfo.templateData = this.importTemplateInfo.panelData this.templateInfo.templateData = this.importTemplateInfo.panelData
this.templateInfo.snapshot = this.importTemplateInfo.snapshot this.templateInfo.snapshot = this.importTemplateInfo.snapshot
this.templateInfo.dynamicData = this.importTemplateInfo.dynamicData
this.templateInfo.nodeType = 'template' this.templateInfo.nodeType = 'template'
} }
reader.readAsText(file) reader.readAsText(file)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论