Unverified 提交 173d8083 authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw 提交者: GitHub

Merge pull request #1783 from dataease/pr@dev@refactor_plugins_view_compatible

refactor: 仪表板兼容插件视图
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 sceneId;
@ApiModelProperty("数据集ID")
private String tableId; private String tableId;
@ApiModelProperty("图表类型")
private String type; private String type;
@ApiModelProperty("chart渲染方式")
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("创建人")
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;
private String chartType;
private Boolean isPlugin;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -244,6 +244,76 @@ public class ChartViewExample { ...@@ -244,6 +244,76 @@ public class ChartViewExample {
return (Criteria) this; 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() { public Criteria andSceneIdIsNull() {
addCriterion("scene_id is null"); addCriterion("scene_id is null");
return (Criteria) this; return (Criteria) this;
...@@ -654,76 +724,6 @@ public class ChartViewExample { ...@@ -654,76 +724,6 @@ public class ChartViewExample {
return (Criteria) this; 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 andCreateByIsNull() { public Criteria andCreateByIsNull() {
addCriterion("create_by is null"); addCriterion("create_by is null");
return (Criteria) this; return (Criteria) this;
...@@ -983,6 +983,136 @@ public class ChartViewExample { ...@@ -983,6 +983,136 @@ public class ChartViewExample {
addCriterion("style_priority not between", value1, value2, "stylePriority"); addCriterion("style_priority not between", value1, value2, "stylePriority");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andChartTypeIsNull() {
addCriterion("chart_type is null");
return (Criteria) this;
}
public Criteria andChartTypeIsNotNull() {
addCriterion("chart_type is not null");
return (Criteria) this;
}
public Criteria andChartTypeEqualTo(String value) {
addCriterion("chart_type =", value, "chartType");
return (Criteria) this;
}
public Criteria andChartTypeNotEqualTo(String value) {
addCriterion("chart_type <>", value, "chartType");
return (Criteria) this;
}
public Criteria andChartTypeGreaterThan(String value) {
addCriterion("chart_type >", value, "chartType");
return (Criteria) this;
}
public Criteria andChartTypeGreaterThanOrEqualTo(String value) {
addCriterion("chart_type >=", value, "chartType");
return (Criteria) this;
}
public Criteria andChartTypeLessThan(String value) {
addCriterion("chart_type <", value, "chartType");
return (Criteria) this;
}
public Criteria andChartTypeLessThanOrEqualTo(String value) {
addCriterion("chart_type <=", value, "chartType");
return (Criteria) this;
}
public Criteria andChartTypeLike(String value) {
addCriterion("chart_type like", value, "chartType");
return (Criteria) this;
}
public Criteria andChartTypeNotLike(String value) {
addCriterion("chart_type not like", value, "chartType");
return (Criteria) this;
}
public Criteria andChartTypeIn(List<String> values) {
addCriterion("chart_type in", values, "chartType");
return (Criteria) this;
}
public Criteria andChartTypeNotIn(List<String> values) {
addCriterion("chart_type not in", values, "chartType");
return (Criteria) this;
}
public Criteria andChartTypeBetween(String value1, String value2) {
addCriterion("chart_type between", value1, value2, "chartType");
return (Criteria) this;
}
public Criteria andChartTypeNotBetween(String value1, String value2) {
addCriterion("chart_type not between", value1, value2, "chartType");
return (Criteria) this;
}
public Criteria andIsPluginIsNull() {
addCriterion("is_plugin is null");
return (Criteria) this;
}
public Criteria andIsPluginIsNotNull() {
addCriterion("is_plugin is not null");
return (Criteria) this;
}
public Criteria andIsPluginEqualTo(Boolean value) {
addCriterion("is_plugin =", value, "isPlugin");
return (Criteria) this;
}
public Criteria andIsPluginNotEqualTo(Boolean value) {
addCriterion("is_plugin <>", value, "isPlugin");
return (Criteria) this;
}
public Criteria andIsPluginGreaterThan(Boolean value) {
addCriterion("is_plugin >", value, "isPlugin");
return (Criteria) this;
}
public Criteria andIsPluginGreaterThanOrEqualTo(Boolean value) {
addCriterion("is_plugin >=", value, "isPlugin");
return (Criteria) this;
}
public Criteria andIsPluginLessThan(Boolean value) {
addCriterion("is_plugin <", value, "isPlugin");
return (Criteria) this;
}
public Criteria andIsPluginLessThanOrEqualTo(Boolean value) {
addCriterion("is_plugin <=", value, "isPlugin");
return (Criteria) this;
}
public Criteria andIsPluginIn(List<Boolean> values) {
addCriterion("is_plugin in", values, "isPlugin");
return (Criteria) this;
}
public Criteria andIsPluginNotIn(List<Boolean> values) {
addCriterion("is_plugin not in", values, "isPlugin");
return (Criteria) this;
}
public Criteria andIsPluginBetween(Boolean value1, Boolean value2) {
addCriterion("is_plugin between", value1, value2, "isPlugin");
return (Criteria) this;
}
public Criteria andIsPluginNotBetween(Boolean value1, Boolean value2) {
addCriterion("is_plugin not between", value1, value2, "isPlugin");
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,27 +9,26 @@ import lombok.ToString; ...@@ -11,27 +9,26 @@ 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轴(Row)")
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 snapshot; private String snapshot;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -4,17 +4,19 @@ ...@@ -4,17 +4,19 @@
<resultMap id="BaseResultMap" type="io.dataease.base.domain.ChartView"> <resultMap id="BaseResultMap" type="io.dataease.base.domain.ChartView">
<id column="id" jdbcType="VARCHAR" property="id" /> <id column="id" jdbcType="VARCHAR" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" /> <result column="name" jdbcType="VARCHAR" property="name" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="scene_id" jdbcType="VARCHAR" property="sceneId" /> <result column="scene_id" jdbcType="VARCHAR" property="sceneId" />
<result column="table_id" jdbcType="VARCHAR" property="tableId" /> <result column="table_id" jdbcType="VARCHAR" property="tableId" />
<result column="type" jdbcType="VARCHAR" property="type" /> <result column="type" jdbcType="VARCHAR" property="type" />
<result column="render" jdbcType="VARCHAR" property="render" /> <result column="render" jdbcType="VARCHAR" property="render" />
<result column="result_count" jdbcType="INTEGER" property="resultCount" /> <result column="result_count" jdbcType="INTEGER" property="resultCount" />
<result column="result_mode" jdbcType="VARCHAR" property="resultMode" /> <result column="result_mode" jdbcType="VARCHAR" property="resultMode" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" /> <result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="BIGINT" property="createTime" /> <result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" /> <result column="update_time" jdbcType="BIGINT" property="updateTime" />
<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="is_plugin" jdbcType="BIT" property="isPlugin" />
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.dataease.base.domain.ChartViewWithBLOBs"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.dataease.base.domain.ChartViewWithBLOBs">
<result column="x_axis" jdbcType="LONGVARCHAR" property="xAxis" /> <result column="x_axis" jdbcType="LONGVARCHAR" property="xAxis" />
...@@ -88,8 +90,8 @@ ...@@ -88,8 +90,8 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, `name`, scene_id, table_id, `type`, render, result_count, result_mode, title, id, `name`, title, scene_id, table_id, `type`, render, result_count, result_mode,
create_by, create_time, update_time, style_priority create_by, create_time, update_time, style_priority, chart_type, is_plugin
</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,
...@@ -144,24 +146,24 @@ ...@@ -144,24 +146,24 @@
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="io.dataease.base.domain.ChartViewWithBLOBs"> <insert id="insert" parameterType="io.dataease.base.domain.ChartViewWithBLOBs">
insert into chart_view (id, `name`, scene_id, insert into chart_view (id, `name`, title,
table_id, `type`, render, scene_id, table_id, `type`,
result_count, result_mode, title, render, result_count, result_mode,
create_by, create_time, update_time, create_by, create_time, update_time,
style_priority, x_axis, x_axis_ext, style_priority, chart_type, is_plugin,
y_axis, y_axis_ext, ext_stack, x_axis, x_axis_ext, y_axis,
ext_bubble, custom_attr, custom_style, y_axis_ext, ext_stack, ext_bubble,
custom_filter, drill_fields, snapshot custom_attr, custom_style, custom_filter,
) drill_fields, snapshot)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{sceneId,jdbcType=VARCHAR}, values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR},
#{tableId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{render,jdbcType=VARCHAR}, #{sceneId,jdbcType=VARCHAR}, #{tableId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{resultCount,jdbcType=INTEGER}, #{resultMode,jdbcType=VARCHAR}, #{title,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}, #{xAxis,jdbcType=LONGVARCHAR}, #{xAxisExt,jdbcType=LONGVARCHAR}, #{stylePriority,jdbcType=VARCHAR}, #{chartType,jdbcType=VARCHAR}, #{isPlugin,jdbcType=BIT},
#{yAxis,jdbcType=LONGVARCHAR}, #{yAxisExt,jdbcType=LONGVARCHAR}, #{extStack,jdbcType=LONGVARCHAR}, #{xAxis,jdbcType=LONGVARCHAR}, #{xAxisExt,jdbcType=LONGVARCHAR}, #{yAxis,jdbcType=LONGVARCHAR},
#{extBubble,jdbcType=LONGVARCHAR}, #{customAttr,jdbcType=LONGVARCHAR}, #{customStyle,jdbcType=LONGVARCHAR}, #{yAxisExt,jdbcType=LONGVARCHAR}, #{extStack,jdbcType=LONGVARCHAR}, #{extBubble,jdbcType=LONGVARCHAR},
#{customFilter,jdbcType=LONGVARCHAR}, #{drillFields,jdbcType=LONGVARCHAR}, #{snapshot,jdbcType=LONGVARCHAR} #{customAttr,jdbcType=LONGVARCHAR}, #{customStyle,jdbcType=LONGVARCHAR}, #{customFilter,jdbcType=LONGVARCHAR},
) #{drillFields,jdbcType=LONGVARCHAR}, #{snapshot,jdbcType=LONGVARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.ChartViewWithBLOBs"> <insert id="insertSelective" parameterType="io.dataease.base.domain.ChartViewWithBLOBs">
insert into chart_view insert into chart_view
...@@ -172,6 +174,9 @@ ...@@ -172,6 +174,9 @@
<if test="name != null"> <if test="name != null">
`name`, `name`,
</if> </if>
<if test="title != null">
title,
</if>
<if test="sceneId != null"> <if test="sceneId != null">
scene_id, scene_id,
</if> </if>
...@@ -190,9 +195,6 @@ ...@@ -190,9 +195,6 @@
<if test="resultMode != null"> <if test="resultMode != null">
result_mode, result_mode,
</if> </if>
<if test="title != null">
title,
</if>
<if test="createBy != null"> <if test="createBy != null">
create_by, create_by,
</if> </if>
...@@ -205,6 +207,12 @@ ...@@ -205,6 +207,12 @@
<if test="stylePriority != null"> <if test="stylePriority != null">
style_priority, style_priority,
</if> </if>
<if test="chartType != null">
chart_type,
</if>
<if test="isPlugin != null">
is_plugin,
</if>
<if test="xAxis != null"> <if test="xAxis != null">
x_axis, x_axis,
</if> </if>
...@@ -246,6 +254,9 @@ ...@@ -246,6 +254,9 @@
<if test="name != null"> <if test="name != null">
#{name,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
</if> </if>
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="sceneId != null"> <if test="sceneId != null">
#{sceneId,jdbcType=VARCHAR}, #{sceneId,jdbcType=VARCHAR},
</if> </if>
...@@ -264,9 +275,6 @@ ...@@ -264,9 +275,6 @@
<if test="resultMode != null"> <if test="resultMode != null">
#{resultMode,jdbcType=VARCHAR}, #{resultMode,jdbcType=VARCHAR},
</if> </if>
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="createBy != null"> <if test="createBy != null">
#{createBy,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
</if> </if>
...@@ -279,6 +287,12 @@ ...@@ -279,6 +287,12 @@
<if test="stylePriority != null"> <if test="stylePriority != null">
#{stylePriority,jdbcType=VARCHAR}, #{stylePriority,jdbcType=VARCHAR},
</if> </if>
<if test="chartType != null">
#{chartType,jdbcType=VARCHAR},
</if>
<if test="isPlugin != null">
#{isPlugin,jdbcType=BIT},
</if>
<if test="xAxis != null"> <if test="xAxis != null">
#{xAxis,jdbcType=LONGVARCHAR}, #{xAxis,jdbcType=LONGVARCHAR},
</if> </if>
...@@ -329,6 +343,9 @@ ...@@ -329,6 +343,9 @@
<if test="record.name != null"> <if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR}, `name` = #{record.name,jdbcType=VARCHAR},
</if> </if>
<if test="record.title != null">
title = #{record.title,jdbcType=VARCHAR},
</if>
<if test="record.sceneId != null"> <if test="record.sceneId != null">
scene_id = #{record.sceneId,jdbcType=VARCHAR}, scene_id = #{record.sceneId,jdbcType=VARCHAR},
</if> </if>
...@@ -347,9 +364,6 @@ ...@@ -347,9 +364,6 @@
<if test="record.resultMode != null"> <if test="record.resultMode != null">
result_mode = #{record.resultMode,jdbcType=VARCHAR}, result_mode = #{record.resultMode,jdbcType=VARCHAR},
</if> </if>
<if test="record.title != null">
title = #{record.title,jdbcType=VARCHAR},
</if>
<if test="record.createBy != null"> <if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR}, create_by = #{record.createBy,jdbcType=VARCHAR},
</if> </if>
...@@ -362,6 +376,12 @@ ...@@ -362,6 +376,12 @@
<if test="record.stylePriority != null"> <if test="record.stylePriority != null">
style_priority = #{record.stylePriority,jdbcType=VARCHAR}, style_priority = #{record.stylePriority,jdbcType=VARCHAR},
</if> </if>
<if test="record.chartType != null">
chart_type = #{record.chartType,jdbcType=VARCHAR},
</if>
<if test="record.isPlugin != null">
is_plugin = #{record.isPlugin,jdbcType=BIT},
</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>
...@@ -404,17 +424,19 @@ ...@@ -404,17 +424,19 @@
update chart_view update chart_view
set id = #{record.id,jdbcType=VARCHAR}, set id = #{record.id,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR}, `name` = #{record.name,jdbcType=VARCHAR},
title = #{record.title,jdbcType=VARCHAR},
scene_id = #{record.sceneId,jdbcType=VARCHAR}, scene_id = #{record.sceneId,jdbcType=VARCHAR},
table_id = #{record.tableId,jdbcType=VARCHAR}, table_id = #{record.tableId,jdbcType=VARCHAR},
`type` = #{record.type,jdbcType=VARCHAR}, `type` = #{record.type,jdbcType=VARCHAR},
render = #{record.render,jdbcType=VARCHAR}, render = #{record.render,jdbcType=VARCHAR},
result_count = #{record.resultCount,jdbcType=INTEGER}, result_count = #{record.resultCount,jdbcType=INTEGER},
result_mode = #{record.resultMode,jdbcType=VARCHAR}, result_mode = #{record.resultMode,jdbcType=VARCHAR},
title = #{record.title,jdbcType=VARCHAR},
create_by = #{record.createBy,jdbcType=VARCHAR}, create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
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},
is_plugin = #{record.isPlugin,jdbcType=BIT},
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},
...@@ -434,17 +456,19 @@ ...@@ -434,17 +456,19 @@
update chart_view update chart_view
set id = #{record.id,jdbcType=VARCHAR}, set id = #{record.id,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR}, `name` = #{record.name,jdbcType=VARCHAR},
title = #{record.title,jdbcType=VARCHAR},
scene_id = #{record.sceneId,jdbcType=VARCHAR}, scene_id = #{record.sceneId,jdbcType=VARCHAR},
table_id = #{record.tableId,jdbcType=VARCHAR}, table_id = #{record.tableId,jdbcType=VARCHAR},
`type` = #{record.type,jdbcType=VARCHAR}, `type` = #{record.type,jdbcType=VARCHAR},
render = #{record.render,jdbcType=VARCHAR}, render = #{record.render,jdbcType=VARCHAR},
result_count = #{record.resultCount,jdbcType=INTEGER}, result_count = #{record.resultCount,jdbcType=INTEGER},
result_mode = #{record.resultMode,jdbcType=VARCHAR}, result_mode = #{record.resultMode,jdbcType=VARCHAR},
title = #{record.title,jdbcType=VARCHAR},
create_by = #{record.createBy,jdbcType=VARCHAR}, create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
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},
is_plugin = #{record.isPlugin,jdbcType=BIT}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
...@@ -455,6 +479,9 @@ ...@@ -455,6 +479,9 @@
<if test="name != null"> <if test="name != null">
`name` = #{name,jdbcType=VARCHAR}, `name` = #{name,jdbcType=VARCHAR},
</if> </if>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="sceneId != null"> <if test="sceneId != null">
scene_id = #{sceneId,jdbcType=VARCHAR}, scene_id = #{sceneId,jdbcType=VARCHAR},
</if> </if>
...@@ -473,9 +500,6 @@ ...@@ -473,9 +500,6 @@
<if test="resultMode != null"> <if test="resultMode != null">
result_mode = #{resultMode,jdbcType=VARCHAR}, result_mode = #{resultMode,jdbcType=VARCHAR},
</if> </if>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="createBy != null"> <if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR}, create_by = #{createBy,jdbcType=VARCHAR},
</if> </if>
...@@ -488,6 +512,12 @@ ...@@ -488,6 +512,12 @@
<if test="stylePriority != null"> <if test="stylePriority != null">
style_priority = #{stylePriority,jdbcType=VARCHAR}, style_priority = #{stylePriority,jdbcType=VARCHAR},
</if> </if>
<if test="chartType != null">
chart_type = #{chartType,jdbcType=VARCHAR},
</if>
<if test="isPlugin != null">
is_plugin = #{isPlugin,jdbcType=BIT},
</if>
<if test="xAxis != null"> <if test="xAxis != null">
x_axis = #{xAxis,jdbcType=LONGVARCHAR}, x_axis = #{xAxis,jdbcType=LONGVARCHAR},
</if> </if>
...@@ -527,17 +557,19 @@ ...@@ -527,17 +557,19 @@
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.dataease.base.domain.ChartViewWithBLOBs"> <update id="updateByPrimaryKeyWithBLOBs" parameterType="io.dataease.base.domain.ChartViewWithBLOBs">
update chart_view update chart_view
set `name` = #{name,jdbcType=VARCHAR}, set `name` = #{name,jdbcType=VARCHAR},
title = #{title,jdbcType=VARCHAR},
scene_id = #{sceneId,jdbcType=VARCHAR}, scene_id = #{sceneId,jdbcType=VARCHAR},
table_id = #{tableId,jdbcType=VARCHAR}, table_id = #{tableId,jdbcType=VARCHAR},
`type` = #{type,jdbcType=VARCHAR}, `type` = #{type,jdbcType=VARCHAR},
render = #{render,jdbcType=VARCHAR}, render = #{render,jdbcType=VARCHAR},
result_count = #{resultCount,jdbcType=INTEGER}, result_count = #{resultCount,jdbcType=INTEGER},
result_mode = #{resultMode,jdbcType=VARCHAR}, result_mode = #{resultMode,jdbcType=VARCHAR},
title = #{title,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR}, create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
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},
is_plugin = #{isPlugin,jdbcType=BIT},
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},
...@@ -554,17 +586,19 @@ ...@@ -554,17 +586,19 @@
<update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.ChartView"> <update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.ChartView">
update chart_view update chart_view
set `name` = #{name,jdbcType=VARCHAR}, set `name` = #{name,jdbcType=VARCHAR},
title = #{title,jdbcType=VARCHAR},
scene_id = #{sceneId,jdbcType=VARCHAR}, scene_id = #{sceneId,jdbcType=VARCHAR},
table_id = #{tableId,jdbcType=VARCHAR}, table_id = #{tableId,jdbcType=VARCHAR},
`type` = #{type,jdbcType=VARCHAR}, `type` = #{type,jdbcType=VARCHAR},
render = #{render,jdbcType=VARCHAR}, render = #{render,jdbcType=VARCHAR},
result_count = #{resultCount,jdbcType=INTEGER}, result_count = #{resultCount,jdbcType=INTEGER},
result_mode = #{resultMode,jdbcType=VARCHAR}, result_mode = #{resultMode,jdbcType=VARCHAR},
title = #{title,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR}, create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
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},
is_plugin = #{isPlugin,jdbcType=BIT}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
</mapper> </mapper>
\ No newline at end of file
...@@ -310,3 +310,6 @@ delete from chart_group where id in ( ...@@ -310,3 +310,6 @@ delete from chart_group where id in (
ALTER TABLE `panel_link_mapping` ALTER TABLE `panel_link_mapping`
ADD COLUMN `uuid` varchar(8) NULL COMMENT 'uuid' AFTER `user_id`; ADD COLUMN `uuid` varchar(8) NULL COMMENT 'uuid' AFTER `user_id`;
ALTER TABLE `chart_view`
ADD COLUMN `is_plugin` bit(1) NULL COMMENT '是否插件' AFTER `chart_type`;
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</div> </div>
</div> </div>
<plugin-com <plugin-com
v-if="isPlugin" v-if="chart.isPlugin"
:ref="element.propValue.id" :ref="element.propValue.id"
:component-name="chart.type + '-view'" :component-name="chart.type + '-view'"
:obj="{chart, trackMenu, searchCount, terminalType: scaleCoefficientType}" :obj="{chart, trackMenu, searchCount, terminalType: scaleCoefficientType}"
...@@ -89,7 +89,6 @@ import ChartComponentG2 from '@/views/chart/components/ChartComponentG2' ...@@ -89,7 +89,6 @@ import ChartComponentG2 from '@/views/chart/components/ChartComponentG2'
import EditBarView from '@/components/canvas/components/Editor/EditBarView' import EditBarView from '@/components/canvas/components/Editor/EditBarView'
import { customAttrTrans, customStyleTrans, recursionTransObj } from '@/components/canvas/utils/style' import { customAttrTrans, customStyleTrans, recursionTransObj } from '@/components/canvas/utils/style'
import ChartComponentS2 from '@/views/chart/components/ChartComponentS2' import ChartComponentS2 from '@/views/chart/components/ChartComponentS2'
import { pluginTypes } from '@/api/chart/chart'
import PluginCom from '@/views/system/plugin/PluginCom' import PluginCom from '@/views/system/plugin/PluginCom'
export default { export default {
name: 'UserView', name: 'UserView',
...@@ -162,9 +161,7 @@ export default { ...@@ -162,9 +161,7 @@ export default {
pre: null, pre: null,
preCanvasPanel: null, preCanvasPanel: null,
sourceCustomAttrStr: null, sourceCustomAttrStr: null,
sourceCustomStyleStr: null, sourceCustomStyleStr: null
isPlugin: false,
plugins: []
} }
}, },
computed: { computed: {
...@@ -332,7 +329,7 @@ export default { ...@@ -332,7 +329,7 @@ export default {
} }
}, },
'chartType': function(newVal, oldVal) { 'chartType': function(newVal, oldVal) {
this.isPlugin = this.plugins.some(plugin => plugin.value === this.chart.type) // this.isPlugin = this.plugins.some(plugin => plugin.value === this.chart.type)
if (newVal === 'map' && newVal !== oldVal) { if (newVal === 'map' && newVal !== oldVal) {
this.initAreas() this.initAreas()
} }
...@@ -347,12 +344,7 @@ export default { ...@@ -347,12 +344,7 @@ export default {
deep: true deep: true
} }
}, },
beforeCreate() {
pluginTypes().then(res => {
this.plugins = res.data
this.isPlugin = this.plugins.some(plugin => plugin.value === this.chart.type)
})
},
created() { created() {
this.refId = uuid.v1 this.refId = uuid.v1
if (this.element && this.element.propValue && this.element.propValue.viewId) { if (this.element && this.element.propValue && this.element.propValue.viewId) {
......
...@@ -218,7 +218,7 @@ ...@@ -218,7 +218,7 @@
v-model="view.type" v-model="view.type"
style="width: 100%" style="width: 100%"
> >
<chart-type :chart="view" style="height: 350px;" /> <chart-type ref="cu-chart-type" :chart="view" style="height: 350px;" />
</el-radio-group> </el-radio-group>
</div> </div>
</el-row> </el-row>
...@@ -420,6 +420,11 @@ export default { ...@@ -420,6 +420,11 @@ export default {
currentKey: null currentKey: null
} }
}, },
computed: {
chartType() {
return this.view.type
}
},
watch: { watch: {
saveStatus() { saveStatus() {
}, },
...@@ -436,6 +441,9 @@ export default { ...@@ -436,6 +441,9 @@ export default {
searchType(val) { searchType(val) {
this.searchPids = [] this.searchPids = []
this.$refs.chartTreeRef.filter(this.filterText) this.$refs.chartTreeRef.filter(this.filterText)
},
chartType(val) {
this.view.isPlugin = val && this.$refs['cu-chart-type'] && this.$refs['cu-chart-type'].currentIsPlugin(val)
} }
}, },
...@@ -733,6 +741,7 @@ export default { ...@@ -733,6 +741,7 @@ export default {
view.sceneId = this.currGroup.id view.sceneId = this.currGroup.id
view.tableId = this.table.id view.tableId = this.table.id
view.type = this.view.type view.type = this.view.type
view.isPlugin = this.view.isPlugin
view.render = this.view.render view.render = this.view.render
view.resultMode = 'custom' view.resultMode = 'custom'
view.resultCount = 1000 view.resultCount = 1000
......
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
:disabled="!hasDataPermission('manage',param.privileges)" :disabled="!hasDataPermission('manage',param.privileges)"
@change="changeChartType()" @change="changeChartType()"
> >
<chart-type :chart="view" style="height: 480px" /> <chart-type ref="cu-chart-type" :chart="view" style="height: 480px" />
</el-radio-group> </el-radio-group>
</div> </div>
</el-row> </el-row>
...@@ -220,7 +220,7 @@ ...@@ -220,7 +220,7 @@
</el-row> </el-row>
</el-row> </el-row>
<plugin-com v-if="isPlugin" :component-name="view.type + '-data'" :obj="{view, param, chart}" /> <plugin-com v-if="view.isPlugin" :component-name="view.type + '-data'" :obj="{view, param, chart}" />
<div v-else> <div v-else>
<el-row v-if="view.type ==='map'" class="padding-lr"> <el-row v-if="view.type ==='map'" class="padding-lr">
...@@ -820,7 +820,7 @@ ...@@ -820,7 +820,7 @@
<el-row style="width: 100%;height: 100%;" class="padding-lr"> <el-row style="width: 100%;height: 100%;" class="padding-lr">
<div ref="imageWrapper" style="height: 100%"> <div ref="imageWrapper" style="height: 100%">
<plugin-com <plugin-com
v-if="httpRequest.status && chart.type && isPlugin" v-if="httpRequest.status && chart.type && view.isPlugin"
:component-name="chart.type + '-view'" :component-name="chart.type + '-view'"
:obj="{chart}" :obj="{chart}"
class="chart-class" class="chart-class"
...@@ -1055,7 +1055,6 @@ import { compareItem } from '@/views/chart/chart/compare' ...@@ -1055,7 +1055,6 @@ import { compareItem } from '@/views/chart/chart/compare'
import ChartComponentS2 from '@/views/chart/components/ChartComponentS2' import ChartComponentS2 from '@/views/chart/components/ChartComponentS2'
import DimensionExtItem from '@/views/chart/components/drag-item/DimensionExtItem' import DimensionExtItem from '@/views/chart/components/drag-item/DimensionExtItem'
import PluginCom from '@/views/system/plugin/PluginCom' import PluginCom from '@/views/system/plugin/PluginCom'
import { pluginTypes } from '@/api/chart/chart'
export default { export default {
name: 'ChartEdit', name: 'ChartEdit',
components: { components: {
...@@ -1143,7 +1142,8 @@ export default { ...@@ -1143,7 +1142,8 @@ export default {
split: DEFAULT_SPLIT split: DEFAULT_SPLIT
}, },
customFilter: [], customFilter: [],
render: 'antv' render: 'antv',
isPlugin: false
}, },
moveId: -1, moveId: -1,
chart: { chart: {
...@@ -1190,9 +1190,8 @@ export default { ...@@ -1190,9 +1190,8 @@ export default {
drill: false, drill: false,
hasEdit: false, hasEdit: false,
quotaItemCompare: {}, quotaItemCompare: {},
showEditQuotaCompare: false, showEditQuotaCompare: false
plugins: [],
isPlugin: false
} }
}, },
computed: { computed: {
...@@ -1213,7 +1212,7 @@ export default { ...@@ -1213,7 +1212,7 @@ export default {
this.fieldFilter(val) this.fieldFilter(val)
}, },
'chartType': function(newVal, oldVal) { 'chartType': function(newVal, oldVal) {
this.isPlugin = this.plugins.some(plugin => plugin.value === this.chart.type) this.view.isPlugin = this.$refs['cu-chart-type'] && this.$refs['cu-chart-type'].currentIsPlugin(newVal)
if (newVal === 'map' && newVal !== oldVal) { if (newVal === 'map' && newVal !== oldVal) {
this.initAreas() this.initAreas()
} }
...@@ -1232,12 +1231,7 @@ export default { ...@@ -1232,12 +1231,7 @@ export default {
}, },
activated() { activated() {
}, },
beforeCreate() {
pluginTypes().then(res => {
this.plugins = res.data
this.isPlugin = this.plugins.some(plugin => plugin.value === this.chart.type)
})
},
methods: { methods: {
bindPluginEvent() { bindPluginEvent() {
bus.$on('show-dimension-edit-filter', this.showDimensionEditFilter) bus.$on('show-dimension-edit-filter', this.showDimensionEditFilter)
......
<template> <template>
<div class="chart-type"> <div v-if="loadFinish" class="chart-type">
<div v-for="(renderItem, category) in renderMap[chart.render]" :key="category"> <div v-for="(renderItem, category) in renderMap[chart.render]" :key="category">
<el-divider class="chart-type-divider">{{ $t(category) }}</el-divider> <el-divider class="chart-type-divider">{{ $t(category) }}</el-divider>
...@@ -38,21 +38,38 @@ export default { ...@@ -38,21 +38,38 @@ export default {
data() { data() {
return { return {
defaultTypes: TYPE_CONFIGS, defaultTypes: TYPE_CONFIGS,
allTypes: [], renderMap: {},
renderMap: {} loadFinish: false
} }
}, },
beforeCreate() { created() {
const plugins = localStorage.getItem('plugin-views') && JSON.parse(localStorage.getItem('plugin-views'))
if (plugins) {
this.initTypes(plugins)
} else {
pluginTypes().then(res => { pluginTypes().then(res => {
const plugins = res.data const plugins = res.data
localStorage.setItem('plugin-views', JSON.stringify(plugins))
this.initTypes(plugins)
}).catch(e => {
localStorage.setItem('plugin-views', null)
this.initTypes([])
})
}
},
methods: {
currentIsPlugin(type) {
const plugins = localStorage.getItem('plugin-views') && JSON.parse(localStorage.getItem('plugin-views')) || []
return plugins.some(plugin => plugin.value === type)
},
initTypes(plugins) {
plugins.forEach(plugin => { plugins.forEach(plugin => {
plugin.isPlugin = true plugin.isPlugin = true
}) })
this.pluginTypes = [...this.defaultTypes, ...plugins] this.pluginTypes = [...this.defaultTypes, ...plugins]
this.formatTypes() this.formatTypes()
}) this.loadFinish = true
}, },
methods: {
formatTypes() { formatTypes() {
this.pluginTypes.forEach(item => { this.pluginTypes.forEach(item => {
const { render, category } = item const { render, category } = item
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论