mirror of
https://github.com/dataease/dataease.git
synced 2025-02-25 20:42:55 +08:00
feat: 视图所有操作移到仪表板
This commit is contained in:
parent
0a6e55247a
commit
cf55778229
@ -0,0 +1,39 @@
|
|||||||
|
package io.dataease.base.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ChartViewCache implements Serializable {
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
private String sceneId;
|
||||||
|
|
||||||
|
private String tableId;
|
||||||
|
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
private String render;
|
||||||
|
|
||||||
|
private Integer resultCount;
|
||||||
|
|
||||||
|
private String resultMode;
|
||||||
|
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
private Long createTime;
|
||||||
|
|
||||||
|
private Long updateTime;
|
||||||
|
|
||||||
|
private String stylePriority;
|
||||||
|
|
||||||
|
private String chartType;
|
||||||
|
|
||||||
|
private Boolean isPlugin;
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,35 @@
|
|||||||
|
package io.dataease.base.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class ChartViewCacheWithBLOBs extends ChartViewCache implements Serializable {
|
||||||
|
private String xAxis;
|
||||||
|
|
||||||
|
private String xAxisExt;
|
||||||
|
|
||||||
|
private String yAxis;
|
||||||
|
|
||||||
|
private String yAxisExt;
|
||||||
|
|
||||||
|
private String extStack;
|
||||||
|
|
||||||
|
private String extBubble;
|
||||||
|
|
||||||
|
private String customAttr;
|
||||||
|
|
||||||
|
private String customStyle;
|
||||||
|
|
||||||
|
private String customFilter;
|
||||||
|
|
||||||
|
private String drillFields;
|
||||||
|
|
||||||
|
private String snapshot;
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
package io.dataease.base.mapper;
|
||||||
|
|
||||||
|
import io.dataease.base.domain.ChartViewCache;
|
||||||
|
import io.dataease.base.domain.ChartViewCacheExample;
|
||||||
|
import io.dataease.base.domain.ChartViewCacheWithBLOBs;
|
||||||
|
import java.util.List;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
public interface ChartViewCacheMapper {
|
||||||
|
long countByExample(ChartViewCacheExample example);
|
||||||
|
|
||||||
|
int deleteByExample(ChartViewCacheExample example);
|
||||||
|
|
||||||
|
int deleteByPrimaryKey(String id);
|
||||||
|
|
||||||
|
int insert(ChartViewCacheWithBLOBs record);
|
||||||
|
|
||||||
|
int insertSelective(ChartViewCacheWithBLOBs record);
|
||||||
|
|
||||||
|
List<ChartViewCacheWithBLOBs> selectByExampleWithBLOBs(ChartViewCacheExample example);
|
||||||
|
|
||||||
|
List<ChartViewCache> selectByExample(ChartViewCacheExample example);
|
||||||
|
|
||||||
|
ChartViewCacheWithBLOBs selectByPrimaryKey(String id);
|
||||||
|
|
||||||
|
int updateByExampleSelective(@Param("record") ChartViewCacheWithBLOBs record, @Param("example") ChartViewCacheExample example);
|
||||||
|
|
||||||
|
int updateByExampleWithBLOBs(@Param("record") ChartViewCacheWithBLOBs record, @Param("example") ChartViewCacheExample example);
|
||||||
|
|
||||||
|
int updateByExample(@Param("record") ChartViewCache record, @Param("example") ChartViewCacheExample example);
|
||||||
|
|
||||||
|
int updateByPrimaryKeySelective(ChartViewCacheWithBLOBs record);
|
||||||
|
|
||||||
|
int updateByPrimaryKeyWithBLOBs(ChartViewCacheWithBLOBs record);
|
||||||
|
|
||||||
|
int updateByPrimaryKey(ChartViewCache record);
|
||||||
|
}
|
@ -0,0 +1,604 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="io.dataease.base.mapper.ChartViewCacheMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="io.dataease.base.domain.ChartViewCache">
|
||||||
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||||
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||||
|
<result column="title" jdbcType="VARCHAR" property="title" />
|
||||||
|
<result column="scene_id" jdbcType="VARCHAR" property="sceneId" />
|
||||||
|
<result column="table_id" jdbcType="VARCHAR" property="tableId" />
|
||||||
|
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||||
|
<result column="render" jdbcType="VARCHAR" property="render" />
|
||||||
|
<result column="result_count" jdbcType="INTEGER" property="resultCount" />
|
||||||
|
<result column="result_mode" jdbcType="VARCHAR" property="resultMode" />
|
||||||
|
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||||
|
<result column="create_time" jdbcType="BIGINT" property="createTime" />
|
||||||
|
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
|
||||||
|
<result column="style_priority" jdbcType="VARCHAR" property="stylePriority" />
|
||||||
|
<result column="chart_type" jdbcType="VARCHAR" property="chartType" />
|
||||||
|
<result column="is_plugin" jdbcType="BIT" property="isPlugin" />
|
||||||
|
</resultMap>
|
||||||
|
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.dataease.base.domain.ChartViewCacheWithBLOBs">
|
||||||
|
<result column="x_axis" jdbcType="LONGVARCHAR" property="xAxis" />
|
||||||
|
<result column="x_axis_ext" jdbcType="LONGVARCHAR" property="xAxisExt" />
|
||||||
|
<result column="y_axis" jdbcType="LONGVARCHAR" property="yAxis" />
|
||||||
|
<result column="y_axis_ext" jdbcType="LONGVARCHAR" property="yAxisExt" />
|
||||||
|
<result column="ext_stack" jdbcType="LONGVARCHAR" property="extStack" />
|
||||||
|
<result column="ext_bubble" jdbcType="LONGVARCHAR" property="extBubble" />
|
||||||
|
<result column="custom_attr" jdbcType="LONGVARCHAR" property="customAttr" />
|
||||||
|
<result column="custom_style" jdbcType="LONGVARCHAR" property="customStyle" />
|
||||||
|
<result column="custom_filter" jdbcType="LONGVARCHAR" property="customFilter" />
|
||||||
|
<result column="drill_fields" jdbcType="LONGVARCHAR" property="drillFields" />
|
||||||
|
<result column="snapshot" jdbcType="LONGVARCHAR" property="snapshot" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Example_Where_Clause">
|
||||||
|
<where>
|
||||||
|
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||||
|
<if test="criteria.valid">
|
||||||
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||||
|
<foreach collection="criteria.criteria" item="criterion">
|
||||||
|
<choose>
|
||||||
|
<when test="criterion.noValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.singleValue">
|
||||||
|
and ${criterion.condition} #{criterion.value}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.betweenValue">
|
||||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.listValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||||
|
#{listItem}
|
||||||
|
</foreach>
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</foreach>
|
||||||
|
</trim>
|
||||||
|
</if>
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
<sql id="Update_By_Example_Where_Clause">
|
||||||
|
<where>
|
||||||
|
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||||
|
<if test="criteria.valid">
|
||||||
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||||
|
<foreach collection="criteria.criteria" item="criterion">
|
||||||
|
<choose>
|
||||||
|
<when test="criterion.noValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.singleValue">
|
||||||
|
and ${criterion.condition} #{criterion.value}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.betweenValue">
|
||||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.listValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||||
|
#{listItem}
|
||||||
|
</foreach>
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</foreach>
|
||||||
|
</trim>
|
||||||
|
</if>
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id, `name`, title, scene_id, table_id, `type`, render, result_count, result_mode,
|
||||||
|
create_by, create_time, update_time, style_priority, chart_type, is_plugin
|
||||||
|
</sql>
|
||||||
|
<sql id="Blob_Column_List">
|
||||||
|
x_axis, x_axis_ext, y_axis, y_axis_ext, ext_stack, ext_bubble, custom_attr, custom_style,
|
||||||
|
custom_filter, drill_fields, snapshot
|
||||||
|
</sql>
|
||||||
|
<select id="selectByExampleWithBLOBs" parameterType="io.dataease.base.domain.ChartViewCacheExample" resultMap="ResultMapWithBLOBs">
|
||||||
|
select
|
||||||
|
<if test="distinct">
|
||||||
|
distinct
|
||||||
|
</if>
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
,
|
||||||
|
<include refid="Blob_Column_List" />
|
||||||
|
from chart_view_cache
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
<if test="orderByClause != null">
|
||||||
|
order by ${orderByClause}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<select id="selectByExample" parameterType="io.dataease.base.domain.ChartViewCacheExample" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<if test="distinct">
|
||||||
|
distinct
|
||||||
|
</if>
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from chart_view_cache
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
<if test="orderByClause != null">
|
||||||
|
order by ${orderByClause}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
,
|
||||||
|
<include refid="Blob_Column_List" />
|
||||||
|
from chart_view_cache
|
||||||
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
|
</select>
|
||||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||||
|
delete from chart_view_cache
|
||||||
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
|
</delete>
|
||||||
|
<delete id="deleteByExample" parameterType="io.dataease.base.domain.ChartViewCacheExample">
|
||||||
|
delete from chart_view_cache
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</delete>
|
||||||
|
<insert id="insert" parameterType="io.dataease.base.domain.ChartViewCacheWithBLOBs">
|
||||||
|
insert into chart_view_cache (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,
|
||||||
|
x_axis, x_axis_ext, y_axis,
|
||||||
|
y_axis_ext, ext_stack, ext_bubble,
|
||||||
|
custom_attr, custom_style, custom_filter,
|
||||||
|
drill_fields, snapshot)
|
||||||
|
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR},
|
||||||
|
#{sceneId,jdbcType=VARCHAR}, #{tableId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
|
||||||
|
#{render,jdbcType=VARCHAR}, #{resultCount,jdbcType=INTEGER}, #{resultMode,jdbcType=VARCHAR},
|
||||||
|
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
|
||||||
|
#{stylePriority,jdbcType=VARCHAR}, #{chartType,jdbcType=VARCHAR}, #{isPlugin,jdbcType=BIT},
|
||||||
|
#{xAxis,jdbcType=LONGVARCHAR}, #{xAxisExt,jdbcType=LONGVARCHAR}, #{yAxis,jdbcType=LONGVARCHAR},
|
||||||
|
#{yAxisExt,jdbcType=LONGVARCHAR}, #{extStack,jdbcType=LONGVARCHAR}, #{extBubble,jdbcType=LONGVARCHAR},
|
||||||
|
#{customAttr,jdbcType=LONGVARCHAR}, #{customStyle,jdbcType=LONGVARCHAR}, #{customFilter,jdbcType=LONGVARCHAR},
|
||||||
|
#{drillFields,jdbcType=LONGVARCHAR}, #{snapshot,jdbcType=LONGVARCHAR})
|
||||||
|
</insert>
|
||||||
|
<insert id="insertSelective" parameterType="io.dataease.base.domain.ChartViewCacheWithBLOBs">
|
||||||
|
insert into chart_view_cache
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
id,
|
||||||
|
</if>
|
||||||
|
<if test="name != null">
|
||||||
|
`name`,
|
||||||
|
</if>
|
||||||
|
<if test="title != null">
|
||||||
|
title,
|
||||||
|
</if>
|
||||||
|
<if test="sceneId != null">
|
||||||
|
scene_id,
|
||||||
|
</if>
|
||||||
|
<if test="tableId != null">
|
||||||
|
table_id,
|
||||||
|
</if>
|
||||||
|
<if test="type != null">
|
||||||
|
`type`,
|
||||||
|
</if>
|
||||||
|
<if test="render != null">
|
||||||
|
render,
|
||||||
|
</if>
|
||||||
|
<if test="resultCount != null">
|
||||||
|
result_count,
|
||||||
|
</if>
|
||||||
|
<if test="resultMode != null">
|
||||||
|
result_mode,
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null">
|
||||||
|
create_by,
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time,
|
||||||
|
</if>
|
||||||
|
<if test="stylePriority != null">
|
||||||
|
style_priority,
|
||||||
|
</if>
|
||||||
|
<if test="chartType != null">
|
||||||
|
chart_type,
|
||||||
|
</if>
|
||||||
|
<if test="isPlugin != null">
|
||||||
|
is_plugin,
|
||||||
|
</if>
|
||||||
|
<if test="xAxis != null">
|
||||||
|
x_axis,
|
||||||
|
</if>
|
||||||
|
<if test="xAxisExt != null">
|
||||||
|
x_axis_ext,
|
||||||
|
</if>
|
||||||
|
<if test="yAxis != null">
|
||||||
|
y_axis,
|
||||||
|
</if>
|
||||||
|
<if test="yAxisExt != null">
|
||||||
|
y_axis_ext,
|
||||||
|
</if>
|
||||||
|
<if test="extStack != null">
|
||||||
|
ext_stack,
|
||||||
|
</if>
|
||||||
|
<if test="extBubble != null">
|
||||||
|
ext_bubble,
|
||||||
|
</if>
|
||||||
|
<if test="customAttr != null">
|
||||||
|
custom_attr,
|
||||||
|
</if>
|
||||||
|
<if test="customStyle != null">
|
||||||
|
custom_style,
|
||||||
|
</if>
|
||||||
|
<if test="customFilter != null">
|
||||||
|
custom_filter,
|
||||||
|
</if>
|
||||||
|
<if test="drillFields != null">
|
||||||
|
drill_fields,
|
||||||
|
</if>
|
||||||
|
<if test="snapshot != null">
|
||||||
|
snapshot,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
#{id,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="name != null">
|
||||||
|
#{name,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="title != null">
|
||||||
|
#{title,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="sceneId != null">
|
||||||
|
#{sceneId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="tableId != null">
|
||||||
|
#{tableId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="type != null">
|
||||||
|
#{type,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="render != null">
|
||||||
|
#{render,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="resultCount != null">
|
||||||
|
#{resultCount,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="resultMode != null">
|
||||||
|
#{resultMode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null">
|
||||||
|
#{createBy,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
#{createTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
#{updateTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="stylePriority != null">
|
||||||
|
#{stylePriority,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="chartType != null">
|
||||||
|
#{chartType,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="isPlugin != null">
|
||||||
|
#{isPlugin,jdbcType=BIT},
|
||||||
|
</if>
|
||||||
|
<if test="xAxis != null">
|
||||||
|
#{xAxis,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="xAxisExt != null">
|
||||||
|
#{xAxisExt,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="yAxis != null">
|
||||||
|
#{yAxis,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="yAxisExt != null">
|
||||||
|
#{yAxisExt,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="extStack != null">
|
||||||
|
#{extStack,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="extBubble != null">
|
||||||
|
#{extBubble,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="customAttr != null">
|
||||||
|
#{customAttr,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="customStyle != null">
|
||||||
|
#{customStyle,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="customFilter != null">
|
||||||
|
#{customFilter,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="drillFields != null">
|
||||||
|
#{drillFields,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="snapshot != null">
|
||||||
|
#{snapshot,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<select id="countByExample" parameterType="io.dataease.base.domain.ChartViewCacheExample" resultType="java.lang.Long">
|
||||||
|
select count(*) from chart_view_cache
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<update id="updateByExampleSelective" parameterType="map">
|
||||||
|
update chart_view_cache
|
||||||
|
<set>
|
||||||
|
<if test="record.id != null">
|
||||||
|
id = #{record.id,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.name != null">
|
||||||
|
`name` = #{record.name,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.title != null">
|
||||||
|
title = #{record.title,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.sceneId != null">
|
||||||
|
scene_id = #{record.sceneId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.tableId != null">
|
||||||
|
table_id = #{record.tableId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.type != null">
|
||||||
|
`type` = #{record.type,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.render != null">
|
||||||
|
render = #{record.render,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.resultCount != null">
|
||||||
|
result_count = #{record.resultCount,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.resultMode != null">
|
||||||
|
result_mode = #{record.resultMode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.createBy != null">
|
||||||
|
create_by = #{record.createBy,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.createTime != null">
|
||||||
|
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="record.updateTime != null">
|
||||||
|
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="record.stylePriority != null">
|
||||||
|
style_priority = #{record.stylePriority,jdbcType=VARCHAR},
|
||||||
|
</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">
|
||||||
|
x_axis = #{record.xAxis,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.xAxisExt != null">
|
||||||
|
x_axis_ext = #{record.xAxisExt,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.yAxis != null">
|
||||||
|
y_axis = #{record.yAxis,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.yAxisExt != null">
|
||||||
|
y_axis_ext = #{record.yAxisExt,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.extStack != null">
|
||||||
|
ext_stack = #{record.extStack,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.extBubble != null">
|
||||||
|
ext_bubble = #{record.extBubble,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.customAttr != null">
|
||||||
|
custom_attr = #{record.customAttr,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.customStyle != null">
|
||||||
|
custom_style = #{record.customStyle,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.customFilter != null">
|
||||||
|
custom_filter = #{record.customFilter,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.drillFields != null">
|
||||||
|
drill_fields = #{record.drillFields,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.snapshot != null">
|
||||||
|
snapshot = #{record.snapshot,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</update>
|
||||||
|
<update id="updateByExampleWithBLOBs" parameterType="map">
|
||||||
|
update chart_view_cache
|
||||||
|
set id = #{record.id,jdbcType=VARCHAR},
|
||||||
|
`name` = #{record.name,jdbcType=VARCHAR},
|
||||||
|
title = #{record.title,jdbcType=VARCHAR},
|
||||||
|
scene_id = #{record.sceneId,jdbcType=VARCHAR},
|
||||||
|
table_id = #{record.tableId,jdbcType=VARCHAR},
|
||||||
|
`type` = #{record.type,jdbcType=VARCHAR},
|
||||||
|
render = #{record.render,jdbcType=VARCHAR},
|
||||||
|
result_count = #{record.resultCount,jdbcType=INTEGER},
|
||||||
|
result_mode = #{record.resultMode,jdbcType=VARCHAR},
|
||||||
|
create_by = #{record.createBy,jdbcType=VARCHAR},
|
||||||
|
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||||
|
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||||
|
style_priority = #{record.stylePriority,jdbcType=VARCHAR},
|
||||||
|
chart_type = #{record.chartType,jdbcType=VARCHAR},
|
||||||
|
is_plugin = #{record.isPlugin,jdbcType=BIT},
|
||||||
|
x_axis = #{record.xAxis,jdbcType=LONGVARCHAR},
|
||||||
|
x_axis_ext = #{record.xAxisExt,jdbcType=LONGVARCHAR},
|
||||||
|
y_axis = #{record.yAxis,jdbcType=LONGVARCHAR},
|
||||||
|
y_axis_ext = #{record.yAxisExt,jdbcType=LONGVARCHAR},
|
||||||
|
ext_stack = #{record.extStack,jdbcType=LONGVARCHAR},
|
||||||
|
ext_bubble = #{record.extBubble,jdbcType=LONGVARCHAR},
|
||||||
|
custom_attr = #{record.customAttr,jdbcType=LONGVARCHAR},
|
||||||
|
custom_style = #{record.customStyle,jdbcType=LONGVARCHAR},
|
||||||
|
custom_filter = #{record.customFilter,jdbcType=LONGVARCHAR},
|
||||||
|
drill_fields = #{record.drillFields,jdbcType=LONGVARCHAR},
|
||||||
|
snapshot = #{record.snapshot,jdbcType=LONGVARCHAR}
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</update>
|
||||||
|
<update id="updateByExample" parameterType="map">
|
||||||
|
update chart_view_cache
|
||||||
|
set id = #{record.id,jdbcType=VARCHAR},
|
||||||
|
`name` = #{record.name,jdbcType=VARCHAR},
|
||||||
|
title = #{record.title,jdbcType=VARCHAR},
|
||||||
|
scene_id = #{record.sceneId,jdbcType=VARCHAR},
|
||||||
|
table_id = #{record.tableId,jdbcType=VARCHAR},
|
||||||
|
`type` = #{record.type,jdbcType=VARCHAR},
|
||||||
|
render = #{record.render,jdbcType=VARCHAR},
|
||||||
|
result_count = #{record.resultCount,jdbcType=INTEGER},
|
||||||
|
result_mode = #{record.resultMode,jdbcType=VARCHAR},
|
||||||
|
create_by = #{record.createBy,jdbcType=VARCHAR},
|
||||||
|
create_time = #{record.createTime,jdbcType=BIGINT},
|
||||||
|
update_time = #{record.updateTime,jdbcType=BIGINT},
|
||||||
|
style_priority = #{record.stylePriority,jdbcType=VARCHAR},
|
||||||
|
chart_type = #{record.chartType,jdbcType=VARCHAR},
|
||||||
|
is_plugin = #{record.isPlugin,jdbcType=BIT}
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</update>
|
||||||
|
<update id="updateByPrimaryKeySelective" parameterType="io.dataease.base.domain.ChartViewCacheWithBLOBs">
|
||||||
|
update chart_view_cache
|
||||||
|
<set>
|
||||||
|
<if test="name != null">
|
||||||
|
`name` = #{name,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="title != null">
|
||||||
|
title = #{title,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="sceneId != null">
|
||||||
|
scene_id = #{sceneId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="tableId != null">
|
||||||
|
table_id = #{tableId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="type != null">
|
||||||
|
`type` = #{type,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="render != null">
|
||||||
|
render = #{render,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="resultCount != null">
|
||||||
|
result_count = #{resultCount,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="resultMode != null">
|
||||||
|
result_mode = #{resultMode,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null">
|
||||||
|
create_by = #{createBy,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time = #{createTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time = #{updateTime,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="stylePriority != null">
|
||||||
|
style_priority = #{stylePriority,jdbcType=VARCHAR},
|
||||||
|
</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">
|
||||||
|
x_axis = #{xAxis,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="xAxisExt != null">
|
||||||
|
x_axis_ext = #{xAxisExt,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="yAxis != null">
|
||||||
|
y_axis = #{yAxis,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="yAxisExt != null">
|
||||||
|
y_axis_ext = #{yAxisExt,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="extStack != null">
|
||||||
|
ext_stack = #{extStack,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="extBubble != null">
|
||||||
|
ext_bubble = #{extBubble,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="customAttr != null">
|
||||||
|
custom_attr = #{customAttr,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="customStyle != null">
|
||||||
|
custom_style = #{customStyle,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="customFilter != null">
|
||||||
|
custom_filter = #{customFilter,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="drillFields != null">
|
||||||
|
drill_fields = #{drillFields,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="snapshot != null">
|
||||||
|
snapshot = #{snapshot,jdbcType=LONGVARCHAR},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
|
</update>
|
||||||
|
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.dataease.base.domain.ChartViewCacheWithBLOBs">
|
||||||
|
update chart_view_cache
|
||||||
|
set `name` = #{name,jdbcType=VARCHAR},
|
||||||
|
title = #{title,jdbcType=VARCHAR},
|
||||||
|
scene_id = #{sceneId,jdbcType=VARCHAR},
|
||||||
|
table_id = #{tableId,jdbcType=VARCHAR},
|
||||||
|
`type` = #{type,jdbcType=VARCHAR},
|
||||||
|
render = #{render,jdbcType=VARCHAR},
|
||||||
|
result_count = #{resultCount,jdbcType=INTEGER},
|
||||||
|
result_mode = #{resultMode,jdbcType=VARCHAR},
|
||||||
|
create_by = #{createBy,jdbcType=VARCHAR},
|
||||||
|
create_time = #{createTime,jdbcType=BIGINT},
|
||||||
|
update_time = #{updateTime,jdbcType=BIGINT},
|
||||||
|
style_priority = #{stylePriority,jdbcType=VARCHAR},
|
||||||
|
chart_type = #{chartType,jdbcType=VARCHAR},
|
||||||
|
is_plugin = #{isPlugin,jdbcType=BIT},
|
||||||
|
x_axis = #{xAxis,jdbcType=LONGVARCHAR},
|
||||||
|
x_axis_ext = #{xAxisExt,jdbcType=LONGVARCHAR},
|
||||||
|
y_axis = #{yAxis,jdbcType=LONGVARCHAR},
|
||||||
|
y_axis_ext = #{yAxisExt,jdbcType=LONGVARCHAR},
|
||||||
|
ext_stack = #{extStack,jdbcType=LONGVARCHAR},
|
||||||
|
ext_bubble = #{extBubble,jdbcType=LONGVARCHAR},
|
||||||
|
custom_attr = #{customAttr,jdbcType=LONGVARCHAR},
|
||||||
|
custom_style = #{customStyle,jdbcType=LONGVARCHAR},
|
||||||
|
custom_filter = #{customFilter,jdbcType=LONGVARCHAR},
|
||||||
|
drill_fields = #{drillFields,jdbcType=LONGVARCHAR},
|
||||||
|
snapshot = #{snapshot,jdbcType=LONGVARCHAR}
|
||||||
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
|
</update>
|
||||||
|
<update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.ChartViewCache">
|
||||||
|
update chart_view_cache
|
||||||
|
set `name` = #{name,jdbcType=VARCHAR},
|
||||||
|
title = #{title,jdbcType=VARCHAR},
|
||||||
|
scene_id = #{sceneId,jdbcType=VARCHAR},
|
||||||
|
table_id = #{tableId,jdbcType=VARCHAR},
|
||||||
|
`type` = #{type,jdbcType=VARCHAR},
|
||||||
|
render = #{render,jdbcType=VARCHAR},
|
||||||
|
result_count = #{resultCount,jdbcType=INTEGER},
|
||||||
|
result_mode = #{resultMode,jdbcType=VARCHAR},
|
||||||
|
create_by = #{createBy,jdbcType=VARCHAR},
|
||||||
|
create_time = #{createTime,jdbcType=BIGINT},
|
||||||
|
update_time = #{updateTime,jdbcType=BIGINT},
|
||||||
|
style_priority = #{stylePriority,jdbcType=VARCHAR},
|
||||||
|
chart_type = #{chartType,jdbcType=VARCHAR},
|
||||||
|
is_plugin = #{isPlugin,jdbcType=BIT}
|
||||||
|
where id = #{id,jdbcType=VARCHAR}
|
||||||
|
</update>
|
||||||
|
</mapper>
|
@ -12,7 +12,7 @@ import java.util.List;
|
|||||||
public interface ExtChartViewMapper {
|
public interface ExtChartViewMapper {
|
||||||
List<ChartViewDTO> search(ChartViewRequest request);
|
List<ChartViewDTO> search(ChartViewRequest request);
|
||||||
|
|
||||||
ChartViewDTO searchOne(ChartViewRequest request);
|
// ChartViewDTO searchOne(ChartViewRequest request);
|
||||||
|
|
||||||
void chartCopy(@Param("newChartId")String newChartId,@Param("oldChartId")String oldChartId,@Param("panelId")String panelId);
|
void chartCopy(@Param("newChartId")String newChartId,@Param("oldChartId")String oldChartId,@Param("panelId")String panelId);
|
||||||
|
|
||||||
@ -25,9 +25,24 @@ public interface ExtChartViewMapper {
|
|||||||
|
|
||||||
ChartViewDTO searchOneWithPrivileges(@Param("userId") String userId,@Param("id") String id );
|
ChartViewDTO searchOneWithPrivileges(@Param("userId") String userId,@Param("id") String id );
|
||||||
|
|
||||||
|
ChartViewDTO searchOne(@Param("id") String id );
|
||||||
|
|
||||||
void chartCopyWithPanel(@Param("copyId") String copyId);
|
void chartCopyWithPanel(@Param("copyId") String copyId);
|
||||||
|
|
||||||
void deleteCircleView(@Param("pid") String pid);
|
void deleteCircleView(@Param("pid") String pid);
|
||||||
|
|
||||||
void deleteCircleGroup(@Param("pid") String pid);
|
void deleteCircleGroup(@Param("pid") String pid);
|
||||||
|
|
||||||
|
List<ChartViewDTO> searchViewsWithPanelId(@Param("panelId") String panelId);
|
||||||
|
|
||||||
|
ChartViewDTO searchOneFromCache(@Param("id") String id );
|
||||||
|
|
||||||
|
void copyToCache(@Param("id") String id );
|
||||||
|
|
||||||
|
void deleteCacheWithPanel(@Param("panelId") String panelId );
|
||||||
|
|
||||||
|
void deleteViewCache(@Param("viewId") String viewId );
|
||||||
|
|
||||||
|
void copyCacheToView(@Param("viewIds") List<String> viewIds );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,22 +16,38 @@
|
|||||||
|
|
||||||
<select id="searchOne" resultMap="BaseResultMapDTO">
|
<select id="searchOne" resultMap="BaseResultMapDTO">
|
||||||
select
|
select
|
||||||
id, `name`, scene_id, table_id, `type`, title, create_by, create_time, update_time,
|
chart_view.*
|
||||||
style_priority,x_axis, y_axis, custom_attr, custom_style, custom_filter, snapshot
|
from chart_view where id = #{id}
|
||||||
from chart_view
|
|
||||||
<where>
|
|
||||||
<if test="sceneId != null">
|
|
||||||
and scene_id = #{sceneId,jdbcType=VARCHAR}
|
|
||||||
</if>
|
|
||||||
<if test="id != null">
|
|
||||||
and id = #{id,jdbcType=VARCHAR}
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
<if test="sort != null">
|
|
||||||
order by ${sort}
|
|
||||||
</if>
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="searchOneFromCache" resultMap="BaseResultMapDTO">
|
||||||
|
select
|
||||||
|
chart_view_cache.*
|
||||||
|
from chart_view_cache where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="copyToCache">
|
||||||
|
Insert into chart_view_cache select * from chart_view where chart_view.id = #{id}
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- <select id="searchOne" resultMap="BaseResultMapDTO">-->
|
||||||
|
<!-- select-->
|
||||||
|
<!-- id, `name`, scene_id, table_id, `type`, title, create_by, create_time, update_time,-->
|
||||||
|
<!-- style_priority,x_axis, y_axis, custom_attr, custom_style, custom_filter, snapshot-->
|
||||||
|
<!-- from chart_view-->
|
||||||
|
<!-- <where>-->
|
||||||
|
<!-- <if test="sceneId != null">-->
|
||||||
|
<!-- and scene_id = #{sceneId,jdbcType=VARCHAR}-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- <if test="id != null">-->
|
||||||
|
<!-- and id = #{id,jdbcType=VARCHAR}-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- </where>-->
|
||||||
|
<!-- <if test="sort != null">-->
|
||||||
|
<!-- order by ${sort}-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- </select>-->
|
||||||
|
|
||||||
<select id="search" resultMap="BaseResultMapDTO">
|
<select id="search" resultMap="BaseResultMapDTO">
|
||||||
select
|
select
|
||||||
id, `name`, scene_id, table_id, `type`, title, create_by, create_time, update_time,
|
id, `name`, scene_id, table_id, `type`, title, create_by, create_time, update_time,
|
||||||
@ -236,4 +252,64 @@
|
|||||||
<delete id="deleteCircleGroup">
|
<delete id="deleteCircleGroup">
|
||||||
delete chart_group from (select GET_CHART_GROUP_WITH_CHILDREN(#{pid}) cids) t,chart_group where FIND_IN_SET(chart_group.id,cids)
|
delete chart_group from (select GET_CHART_GROUP_WITH_CHILDREN(#{pid}) cids) t,chart_group where FIND_IN_SET(chart_group.id,cids)
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="searchViewsWithPanelId" resultMap="BaseResultMapDTO">
|
||||||
|
SELECT * FROM chart_view
|
||||||
|
WHERE
|
||||||
|
id IN (
|
||||||
|
SELECT
|
||||||
|
chart_view_id
|
||||||
|
FROM
|
||||||
|
panel_view
|
||||||
|
WHERE
|
||||||
|
panel_id = #{panelId}
|
||||||
|
)
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<delete id="deleteCacheWithPanel">
|
||||||
|
DELETE cvc,
|
||||||
|
pv
|
||||||
|
FROM
|
||||||
|
chart_view_cache cvc
|
||||||
|
INNER JOIN panel_view pv ON cvc.id = pv.chart_view_id
|
||||||
|
WHERE
|
||||||
|
pv.panel_id = #{panelId}
|
||||||
|
</delete>
|
||||||
|
<delete id="deleteViewCache">
|
||||||
|
delete from chart_view_cache where id = #{viewId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<update id="copyCacheToView">
|
||||||
|
UPDATE chart_view cv,
|
||||||
|
chart_view_cache cve
|
||||||
|
SET cv.`name` = cve.`name`,
|
||||||
|
cv.title = cve.title,
|
||||||
|
cv.scene_id = cve.scene_id,
|
||||||
|
cv.table_id = cve.table_id,
|
||||||
|
cv.`type` = cve.`type`,
|
||||||
|
cv.render = cve.render,
|
||||||
|
cv.result_count = cve.result_count,
|
||||||
|
cv.result_mode = cve.result_mode,
|
||||||
|
cv.create_by = cve.create_by,
|
||||||
|
cv.create_time = cve.create_time,
|
||||||
|
cv.update_time = cve.update_time,
|
||||||
|
cv.style_priority = cve.style_priority,
|
||||||
|
cv.chart_type = cve.chart_type,
|
||||||
|
cv.is_plugin = cve.is_plugin,
|
||||||
|
cv.x_axis = cve.x_axis,
|
||||||
|
cv.x_axis_ext = cve.x_axis_ext,
|
||||||
|
cv.y_axis = cve.y_axis,
|
||||||
|
cv.y_axis_ext = cve.y_axis_ext,
|
||||||
|
cv.ext_stack = cve.ext_stack,
|
||||||
|
cv.ext_bubble = cve.ext_bubble,
|
||||||
|
cv.custom_attr = cve.custom_attr,
|
||||||
|
cv.custom_style = cve.custom_style,
|
||||||
|
cv.custom_filter = cve.custom_filter,
|
||||||
|
cv.drill_fields = cve.drill_fields,
|
||||||
|
cv.SNAPSHOT = cve.SNAPSHOT where cve.id = cv.id and cv.id in
|
||||||
|
<foreach collection="viewIds" item="viewId" open='(' separator=',' close=')'>
|
||||||
|
#{viewId}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -2,6 +2,7 @@ package io.dataease.base.mapper.ext;
|
|||||||
|
|
||||||
import io.dataease.controller.request.dataset.DataSetTableRequest;
|
import io.dataease.controller.request.dataset.DataSetTableRequest;
|
||||||
import io.dataease.dto.dataset.DataSetTableDTO;
|
import io.dataease.dto.dataset.DataSetTableDTO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -10,4 +11,6 @@ public interface ExtDataSetTableMapper {
|
|||||||
|
|
||||||
DataSetTableDTO searchOne(DataSetTableRequest request);
|
DataSetTableDTO searchOne(DataSetTableRequest request);
|
||||||
|
|
||||||
|
List<DataSetTableDTO> searchDataSetTableWithPanelId(@Param("panelId") String panelId, @Param("userId") String userId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -100,4 +100,27 @@
|
|||||||
ORDER BY CONVERT(`name` using gbk)
|
ORDER BY CONVERT(`name` using gbk)
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="searchDataSetTableWithPanelId" resultMap="BaseResultMapDTO">
|
||||||
|
select
|
||||||
|
id, `name`, scene_id, data_source_id, `type`, `mode`,`info`, create_by, create_time,
|
||||||
|
get_auths(id,'dataset',#{userId}) as `privileges`
|
||||||
|
from dataset_table
|
||||||
|
where id in (
|
||||||
|
SELECT
|
||||||
|
table_id
|
||||||
|
FROM
|
||||||
|
chart_view
|
||||||
|
WHERE
|
||||||
|
id IN (
|
||||||
|
SELECT
|
||||||
|
chart_view_id
|
||||||
|
FROM
|
||||||
|
panel_view
|
||||||
|
WHERE
|
||||||
|
panel_id = #{panelId}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -43,6 +43,10 @@ public class CommonConstants {
|
|||||||
|
|
||||||
// 仪表板
|
// 仪表板
|
||||||
public static final String PANEL = "panel";
|
public static final String PANEL = "panel";
|
||||||
|
|
||||||
|
// 仪表板编辑
|
||||||
|
public static final String PANEL_EDIT = "panel_edit";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//视图数据查询模式
|
//视图数据查询模式
|
||||||
@ -54,4 +58,15 @@ public class CommonConstants {
|
|||||||
// 自定义
|
// 自定义
|
||||||
public static final String CUSTOM = "custom";
|
public static final String CUSTOM = "custom";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//视图数据查询来源
|
||||||
|
public static final class VIEW_EDIT_FROM {
|
||||||
|
|
||||||
|
// 仪表板
|
||||||
|
public static final String PANEL = "panel";
|
||||||
|
|
||||||
|
// 仪表板编辑
|
||||||
|
public static final String CACHE = "cache";
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package io.dataease.controller.chart;
|
|||||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||||
import io.dataease.auth.annotation.DePermission;
|
import io.dataease.auth.annotation.DePermission;
|
||||||
import io.dataease.auth.annotation.DePermissionProxy;
|
import io.dataease.auth.annotation.DePermissionProxy;
|
||||||
|
import io.dataease.base.domain.ChartViewCacheWithBLOBs;
|
||||||
import io.dataease.base.domain.ChartViewWithBLOBs;
|
import io.dataease.base.domain.ChartViewWithBLOBs;
|
||||||
import io.dataease.commons.constants.DePermissionType;
|
import io.dataease.commons.constants.DePermissionType;
|
||||||
import io.dataease.commons.constants.ResourceAuthLevel;
|
import io.dataease.commons.constants.ResourceAuthLevel;
|
||||||
@ -35,10 +36,17 @@ public class ChartViewController {
|
|||||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE)
|
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE)
|
||||||
@ApiOperation("保存")
|
@ApiOperation("保存")
|
||||||
@PostMapping("/save/{panelId}")
|
@PostMapping("/save/{panelId}")
|
||||||
public ChartViewWithBLOBs save(@PathVariable String panelId, @RequestBody ChartViewWithBLOBs chartViewWithBLOBs) {
|
public ChartViewDTO save(@PathVariable String panelId, @RequestBody ChartViewCacheWithBLOBs chartViewWithBLOBs) {
|
||||||
return chartViewService.save(chartViewWithBLOBs);
|
return chartViewService.save(chartViewWithBLOBs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE)
|
||||||
|
@ApiOperation("保存到缓存表")
|
||||||
|
@PostMapping("/save2Cache/{panelId}")
|
||||||
|
public void save2Cache(@PathVariable String panelId, @RequestBody ChartViewCacheWithBLOBs chartViewWithBLOBs) {
|
||||||
|
chartViewService.save2Cache(chartViewWithBLOBs);
|
||||||
|
}
|
||||||
|
|
||||||
@ApiIgnore
|
@ApiIgnore
|
||||||
@ApiOperation("查询")
|
@ApiOperation("查询")
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
@ -56,8 +64,8 @@ public class ChartViewController {
|
|||||||
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW, paramIndex = 1)
|
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW, paramIndex = 1)
|
||||||
@ApiOperation("详细信息")
|
@ApiOperation("详细信息")
|
||||||
@PostMapping("/get/{id}/{panelId}")
|
@PostMapping("/get/{id}/{panelId}")
|
||||||
public ChartViewWithBLOBs get(@PathVariable String id, @PathVariable String panelId) {
|
public ChartViewDTO get(@PathVariable String id, @PathVariable String panelId,@RequestBody ChartViewRequest viewRequest) {
|
||||||
return chartViewService.get(id);
|
return chartViewService.getOne(id,viewRequest.getQueryFrom());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiIgnore
|
@ApiIgnore
|
||||||
@ -117,4 +125,20 @@ public class ChartViewController {
|
|||||||
throws Exception {
|
throws Exception {
|
||||||
return chartViewService.checkSameDataSet(viewIdSource, viewIdTarget);
|
return chartViewService.checkSameDataSet(viewIdSource, viewIdTarget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW)
|
||||||
|
@ApiOperation("初始化仪表板视图缓存")
|
||||||
|
@PostMapping("/initViewCache/{panelId}")
|
||||||
|
public void initViewCache(@PathVariable String panelId) {
|
||||||
|
chartViewService.initViewCache(panelId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_VIEW, paramIndex = 1)
|
||||||
|
@ApiOperation("重置视图缓存")
|
||||||
|
@PostMapping("/resetViewCache/{id}/{panelId}")
|
||||||
|
public void resetViewCache(@PathVariable String id, @PathVariable String panelId) {
|
||||||
|
chartViewService.resetViewCache(id);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Author: wangjiahao
|
* Author: wangjiahao
|
||||||
@ -92,4 +93,11 @@ public class PanelGroupController {
|
|||||||
return panelGroupService.queryPanelViewTree();
|
return panelGroupService.queryPanelViewTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("仪表板组件信息")
|
||||||
|
@GetMapping("/queryPanelComponents/{id}")
|
||||||
|
@I18n
|
||||||
|
public Map queryPanelComponents(@PathVariable String id){
|
||||||
|
return panelGroupService.queryPanelComponents(id);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -42,4 +42,5 @@ public class ChartExtRequest {
|
|||||||
|
|
||||||
@ApiModelProperty(hidden = true)
|
@ApiModelProperty(hidden = true)
|
||||||
private PermissionProxy proxy;
|
private PermissionProxy proxy;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,4 +16,8 @@ public class ChartViewRequest extends ChartViewWithBLOBs {
|
|||||||
private String sort;
|
private String sort;
|
||||||
@ApiModelProperty("当前登陆用户ID")
|
@ApiModelProperty("当前登陆用户ID")
|
||||||
private String userId;
|
private String userId;
|
||||||
|
@ApiModelProperty("编辑来源")
|
||||||
|
private String editFrom;
|
||||||
|
@ApiModelProperty("查询来源")
|
||||||
|
private String queryFrom;
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,13 @@ package io.dataease.dto.panel;
|
|||||||
|
|
||||||
import io.dataease.base.domain.PanelGroupWithBLOBs;
|
import io.dataease.base.domain.PanelGroupWithBLOBs;
|
||||||
import io.dataease.commons.model.ITreeBase;
|
import io.dataease.commons.model.ITreeBase;
|
||||||
|
import io.dataease.dto.chart.ChartViewDTO;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Author: wangjiahao
|
* Author: wangjiahao
|
||||||
@ -31,6 +33,7 @@ public class PanelGroupDTO extends PanelGroupWithBLOBs implements ITreeBase<Pane
|
|||||||
private String sourcePanelName;
|
private String sourcePanelName;
|
||||||
@ApiModelProperty("子节点")
|
@ApiModelProperty("子节点")
|
||||||
private List<PanelGroupDTO> children;
|
private List<PanelGroupDTO> children;
|
||||||
|
@ApiModelProperty("视图信息")
|
||||||
|
private List<Map<String, ChartViewDTO>> viewsInfo;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import io.dataease.auth.api.dto.CurrentUserDto;
|
|||||||
import io.dataease.auth.entity.SysUserEntity;
|
import io.dataease.auth.entity.SysUserEntity;
|
||||||
import io.dataease.auth.service.AuthUserService;
|
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.ChartViewMapper;
|
import io.dataease.base.mapper.ChartViewMapper;
|
||||||
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;
|
||||||
@ -71,29 +72,55 @@ public class ChartViewService {
|
|||||||
private PermissionService permissionService;
|
private PermissionService permissionService;
|
||||||
@Resource
|
@Resource
|
||||||
private AuthUserService authUserService;
|
private AuthUserService authUserService;
|
||||||
|
@Resource
|
||||||
|
private ChartViewCacheMapper chartViewCacheMapper;
|
||||||
|
|
||||||
//默认使用非公平
|
//默认使用非公平
|
||||||
private ReentrantLock lock = new ReentrantLock();
|
private ReentrantLock lock = new ReentrantLock();
|
||||||
|
|
||||||
public ChartViewWithBLOBs save(ChartViewWithBLOBs chartView) {
|
// 直接保存统一到缓存表
|
||||||
checkName(chartView);
|
public ChartViewDTO save(ChartViewCacheWithBLOBs chartView) {
|
||||||
long timestamp = System.currentTimeMillis();
|
long timestamp = System.currentTimeMillis();
|
||||||
chartView.setUpdateTime(timestamp);
|
chartView.setUpdateTime(timestamp);
|
||||||
if (ObjectUtils.isEmpty(chartView.getId())) {
|
chartViewCacheMapper.updateByPrimaryKeySelective(chartView);
|
||||||
chartView.setId(UUID.randomUUID().toString());
|
|
||||||
chartView.setCreateBy(AuthUtils.getUser().getUsername());
|
|
||||||
chartView.setCreateTime(timestamp);
|
|
||||||
chartView.setUpdateTime(timestamp);
|
|
||||||
chartViewMapper.insertSelective(chartView);
|
|
||||||
} else {
|
|
||||||
chartViewMapper.updateByPrimaryKeySelective(chartView);
|
|
||||||
}
|
|
||||||
Optional.ofNullable(chartView.getId()).ifPresent(id -> {
|
Optional.ofNullable(chartView.getId()).ifPresent(id -> {
|
||||||
CacheUtils.remove(JdbcConstants.VIEW_CACHE_KEY, id);
|
CacheUtils.remove(JdbcConstants.VIEW_CACHE_KEY, id);
|
||||||
});
|
});
|
||||||
return getOneWithPermission(chartView.getId());
|
return getOne(chartView.getId(),"panel_edit");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 直接保存统一到缓存表
|
||||||
|
public void save2Cache(ChartViewCacheWithBLOBs chartView) {
|
||||||
|
long timestamp = System.currentTimeMillis();
|
||||||
|
chartView.setUpdateTime(timestamp);
|
||||||
|
chartViewCacheMapper.updateByPrimaryKeySelective(chartView);
|
||||||
|
Optional.ofNullable(chartView.getId()).ifPresent(id -> {
|
||||||
|
CacheUtils.remove(JdbcConstants.VIEW_CACHE_KEY, id);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// // 直接保存统一到缓存表
|
||||||
|
// public ChartViewWithBLOBs save(ChartViewRequest chartView) {
|
||||||
|
// checkName(chartView);
|
||||||
|
// long timestamp = System.currentTimeMillis();
|
||||||
|
// chartView.setUpdateTime(timestamp);
|
||||||
|
// if (ObjectUtils.isEmpty(chartView.getId())) {
|
||||||
|
// chartView.setId(UUID.randomUUID().toString());
|
||||||
|
// chartView.setCreateBy(AuthUtils.getUser().getUsername());
|
||||||
|
// chartView.setCreateTime(timestamp);
|
||||||
|
// chartView.setUpdateTime(timestamp);
|
||||||
|
// chartViewMapper.insertSelective(chartView);
|
||||||
|
// } else {
|
||||||
|
// chartViewMapper.updateByPrimaryKeySelective(chartView);
|
||||||
|
// }
|
||||||
|
// Optional.ofNullable(chartView.getId()).ifPresent(id -> {
|
||||||
|
// CacheUtils.remove(JdbcConstants.VIEW_CACHE_KEY, id);
|
||||||
|
// });
|
||||||
|
// return getOneWithPermission(chartView.getId());
|
||||||
|
// }
|
||||||
|
|
||||||
public List<ChartViewDTO> list(ChartViewRequest chartViewRequest) {
|
public List<ChartViewDTO> list(ChartViewRequest chartViewRequest) {
|
||||||
chartViewRequest.setUserId(String.valueOf(AuthUtils.getUser().getUserId()));
|
chartViewRequest.setUserId(String.valueOf(AuthUtils.getUser().getUserId()));
|
||||||
return extChartViewMapper.search(chartViewRequest);
|
return extChartViewMapper.search(chartViewRequest);
|
||||||
@ -178,6 +205,21 @@ public class ChartViewService {
|
|||||||
return extChartViewMapper.searchOneWithPrivileges(userId, id);
|
return extChartViewMapper.searchOneWithPrivileges(userId, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ChartViewDTO getOne(String id,String queryFrom){
|
||||||
|
ChartViewDTO result;
|
||||||
|
//仪表板编辑页面 从缓存表中取数据 缓存表中没有数据则进行插入
|
||||||
|
if(CommonConstants.VIEW_QUERY_FROM.PANEL_EDIT.equals(queryFrom)){
|
||||||
|
result= extChartViewMapper.searchOneFromCache(id);
|
||||||
|
if(result == null){
|
||||||
|
extChartViewMapper.copyToCache(id);
|
||||||
|
result = extChartViewMapper.searchOneFromCache(id);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
result = extChartViewMapper.searchOne(id);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
public void delete(String id) {
|
public void delete(String id) {
|
||||||
chartViewMapper.deleteByPrimaryKey(id);
|
chartViewMapper.deleteByPrimaryKey(id);
|
||||||
}
|
}
|
||||||
@ -189,7 +231,7 @@ public class ChartViewService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ChartViewDTO getData(String id, ChartExtRequest request) throws Exception {
|
public ChartViewDTO getData(String id, ChartExtRequest request) throws Exception {
|
||||||
ChartViewDTO view = this.getOneWithPermission(id);
|
ChartViewDTO view = this.getOne(id,request.getQueryFrom());
|
||||||
// 如果是从仪表板获取视图数据,则仪表板的查询模式,查询结果的数量,覆盖视图对应的属性
|
// 如果是从仪表板获取视图数据,则仪表板的查询模式,查询结果的数量,覆盖视图对应的属性
|
||||||
if (CommonConstants.VIEW_QUERY_FROM.PANEL.equals(request.getQueryFrom()) && CommonConstants.VIEW_RESULT_MODE.CUSTOM.equals(request.getResultMode())) {
|
if (CommonConstants.VIEW_QUERY_FROM.PANEL.equals(request.getQueryFrom()) && CommonConstants.VIEW_RESULT_MODE.CUSTOM.equals(request.getResultMode())) {
|
||||||
view.setResultMode(request.getResultMode());
|
view.setResultMode(request.getResultMode());
|
||||||
@ -1712,4 +1754,13 @@ public class ChartViewService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void initViewCache(String panelId){
|
||||||
|
extChartViewMapper.deleteCacheWithPanel(panelId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void resetViewCache (String viewId){
|
||||||
|
extChartViewMapper.deleteViewCache(viewId);
|
||||||
|
extChartViewMapper.copyToCache(viewId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,14 +14,17 @@ import io.dataease.commons.utils.AuthUtils;
|
|||||||
import io.dataease.commons.utils.LogUtil;
|
import io.dataease.commons.utils.LogUtil;
|
||||||
import io.dataease.commons.utils.TreeUtils;
|
import io.dataease.commons.utils.TreeUtils;
|
||||||
import io.dataease.controller.request.authModel.VAuthModelRequest;
|
import io.dataease.controller.request.authModel.VAuthModelRequest;
|
||||||
|
import io.dataease.controller.request.dataset.DataSetTableRequest;
|
||||||
import io.dataease.controller.request.panel.PanelGroupRequest;
|
import io.dataease.controller.request.panel.PanelGroupRequest;
|
||||||
import io.dataease.dto.authModel.VAuthModelDTO;
|
import io.dataease.dto.authModel.VAuthModelDTO;
|
||||||
import io.dataease.dto.chart.ChartViewDTO;
|
import io.dataease.dto.chart.ChartViewDTO;
|
||||||
|
import io.dataease.dto.dataset.DataSetTableDTO;
|
||||||
import io.dataease.dto.panel.PanelGroupDTO;
|
import io.dataease.dto.panel.PanelGroupDTO;
|
||||||
import io.dataease.dto.panel.linkJump.PanelLinkJumpBaseRequest;
|
import io.dataease.dto.panel.linkJump.PanelLinkJumpBaseRequest;
|
||||||
import io.dataease.exception.DataEaseException;
|
import io.dataease.exception.DataEaseException;
|
||||||
import io.dataease.i18n.Translator;
|
import io.dataease.i18n.Translator;
|
||||||
import io.dataease.service.chart.ChartViewService;
|
import io.dataease.service.chart.ChartViewService;
|
||||||
|
import io.dataease.service.dataset.DataSetTableService;
|
||||||
import io.dataease.service.sys.SysAuthService;
|
import io.dataease.service.sys.SysAuthService;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@ -33,10 +36,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -81,6 +81,11 @@ public class PanelGroupService {
|
|||||||
private ExtPanelViewLinkageMapper extPanelViewLinkageMapper;
|
private ExtPanelViewLinkageMapper extPanelViewLinkageMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private ExtChartViewMapper extChartViewMapper;
|
private ExtChartViewMapper extChartViewMapper;
|
||||||
|
@Resource
|
||||||
|
private ExtDataSetTableMapper extDataSetTableMapper;
|
||||||
|
@Resource
|
||||||
|
private DataSetTableService dataSetTableService;
|
||||||
|
|
||||||
|
|
||||||
public List<PanelGroupDTO> tree(PanelGroupRequest panelGroupRequest) {
|
public List<PanelGroupDTO> tree(PanelGroupRequest panelGroupRequest) {
|
||||||
String userId = String.valueOf(AuthUtils.getUser().getUserId());
|
String userId = String.valueOf(AuthUtils.getUser().getUserId());
|
||||||
@ -99,13 +104,8 @@ public class PanelGroupService {
|
|||||||
@DeCleaner(DePermissionType.PANEL)
|
@DeCleaner(DePermissionType.PANEL)
|
||||||
// @Transactional
|
// @Transactional
|
||||||
public PanelGroup saveOrUpdate(PanelGroupRequest request) {
|
public PanelGroup saveOrUpdate(PanelGroupRequest request) {
|
||||||
try {
|
|
||||||
Boolean mobileLayout = panelViewService.syncPanelViews(request);
|
Boolean mobileLayout = panelViewService.syncPanelViews(request);
|
||||||
request.setMobileLayout(mobileLayout);
|
request.setMobileLayout(mobileLayout);
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
LOGGER.error("更新panelView出错panelId:{}", request.getId());
|
|
||||||
}
|
|
||||||
String panelId = request.getId();
|
String panelId = request.getId();
|
||||||
if (StringUtils.isEmpty(panelId)) {
|
if (StringUtils.isEmpty(panelId)) {
|
||||||
// 新建
|
// 新建
|
||||||
@ -341,4 +341,42 @@ public class PanelGroupService {
|
|||||||
LogUtil.info("=====v1.8版本 仪表板私有化【结束】=====");
|
LogUtil.info("=====v1.8版本 仪表板私有化【结束】=====");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取仪表板的视图信息
|
||||||
|
public Map queryPanelComponents(String panelId) {
|
||||||
|
try {
|
||||||
|
Map result, tableWithFields, viewWithViewInfo, tableWithTableInfo;
|
||||||
|
//查找所有view
|
||||||
|
List<ChartViewDTO> views = extChartViewMapper.searchViewsWithPanelId(panelId);
|
||||||
|
viewWithViewInfo = views.stream().collect(Collectors.toMap(ChartViewDTO::getId, ChartViewDTO -> ChartViewDTO));
|
||||||
|
//查找所有dataset
|
||||||
|
List<DataSetTableDTO> tables = extDataSetTableMapper.searchDataSetTableWithPanelId(panelId, String.valueOf(AuthUtils.getUser().getUserId()));
|
||||||
|
tableWithTableInfo = tables.stream().collect(Collectors.toMap(DataSetTableDTO::getId, DataSetTableDTO -> DataSetTableDTO));
|
||||||
|
//查找所有datasetFields
|
||||||
|
tableWithFields = new HashMap();
|
||||||
|
if (CollectionUtils.isNotEmpty(tables)) {
|
||||||
|
for (DataSetTableDTO table : tables) {
|
||||||
|
DataSetTableRequest dataSetTableRequest = new DataSetTableRequest();
|
||||||
|
dataSetTableRequest.setId(table.getId());
|
||||||
|
Map<String, List<DatasetTableField>> tableDataSetFields = dataSetTableService.getFieldsFromDE(dataSetTableRequest);
|
||||||
|
tableWithFields.put(table.getId(), tableDataSetFields);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
result = new HashMap();
|
||||||
|
result.put("tableWithFields", tableWithFields);
|
||||||
|
result.put("viewWithViewInfo", viewWithViewInfo);
|
||||||
|
result.put("tableWithTableInfo", tableWithTableInfo);
|
||||||
|
return result;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
LogUtil.error(e);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void findPanelAttachInfo(String panelId) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import io.dataease.base.domain.PanelGroupWithBLOBs;
|
|||||||
import io.dataease.base.domain.PanelView;
|
import io.dataease.base.domain.PanelView;
|
||||||
import io.dataease.base.domain.PanelViewExample;
|
import io.dataease.base.domain.PanelViewExample;
|
||||||
import io.dataease.base.mapper.PanelViewMapper;
|
import io.dataease.base.mapper.PanelViewMapper;
|
||||||
|
import io.dataease.base.mapper.ext.ExtChartViewMapper;
|
||||||
import io.dataease.base.mapper.ext.ExtPanelViewMapper;
|
import io.dataease.base.mapper.ext.ExtPanelViewMapper;
|
||||||
import io.dataease.commons.utils.AuthUtils;
|
import io.dataease.commons.utils.AuthUtils;
|
||||||
import io.dataease.commons.utils.BeanUtils;
|
import io.dataease.commons.utils.BeanUtils;
|
||||||
@ -39,6 +40,9 @@ public class PanelViewService {
|
|||||||
@Resource
|
@Resource
|
||||||
private PanelViewMapper panelViewMapper;
|
private PanelViewMapper panelViewMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ExtChartViewMapper extChartViewMapper;
|
||||||
|
|
||||||
private final static String SCENE_TYPE = "scene";
|
private final static String SCENE_TYPE = "scene";
|
||||||
|
|
||||||
public List<PanelViewDto> groups() {
|
public List<PanelViewDto> groups() {
|
||||||
@ -115,6 +119,10 @@ public class PanelViewService {
|
|||||||
extPanelViewMapper.deleteWithPanelId(panelId);
|
extPanelViewMapper.deleteWithPanelId(panelId);
|
||||||
if (CollectionUtils.isNotEmpty(panelViewInsertDTOList)) {
|
if (CollectionUtils.isNotEmpty(panelViewInsertDTOList)) {
|
||||||
extPanelViewMapper.savePanelView(panelViewInsertDTOList);
|
extPanelViewMapper.savePanelView(panelViewInsertDTOList);
|
||||||
|
//将视图从cache表中更新到正式表中
|
||||||
|
List<String> viewIds = panelViewInsertDTOList.stream().map(panelView ->panelView.getChartViewId()).collect(Collectors.toList());
|
||||||
|
extChartViewMapper.copyCacheToView(viewIds);
|
||||||
|
extChartViewMapper.deleteCacheWithPanel(panelId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mobileLayout;
|
return mobileLayout;
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
</javaClientGenerator>
|
</javaClientGenerator>
|
||||||
|
|
||||||
<!--要生成的数据库表 -->
|
<!--要生成的数据库表 -->
|
||||||
<table tableName="dataease_code_version"/>
|
<table tableName="chart_view_cache"/>
|
||||||
<!-- <table tableName="chart_view"/>-->
|
<!-- <table tableName="chart_view"/>-->
|
||||||
<!-- <table tableName="panel_view"/>-->
|
<!-- <table tableName="panel_view"/>-->
|
||||||
<!-- <table tableName="panel_link_jump"/>-->
|
<!-- <table tableName="panel_link_jump"/>-->
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
import store from '@/store'
|
||||||
|
import { queryPanelComponents } from '@/api/panel/panel'
|
||||||
|
|
||||||
export function post(url, data) {
|
export function post(url, data) {
|
||||||
return request({
|
return request({
|
||||||
url: url,
|
url: url,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
loading: true,
|
loading: false,
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -13,7 +15,7 @@ export function getChartTree(data) {
|
|||||||
return request({
|
return request({
|
||||||
url: 'api',
|
url: 'api',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
loading: true,
|
loading: false,
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -38,7 +40,7 @@ export function searchAdviceSceneId(panelId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/chart/view/searchAdviceSceneId/' + panelId,
|
url: '/chart/view/searchAdviceSceneId/' + panelId,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
loading: true
|
loading: false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,7 +56,7 @@ export function ajaxGetDataOnly(id, panelId, data) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/chart/view/getData/' + id + '/' + panelId,
|
url: '/chart/view/getData/' + id + '/' + panelId,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
loading: true,
|
loading: false,
|
||||||
hideMsg: true,
|
hideMsg: true,
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@ -75,3 +77,34 @@ export function deleteCircle(id) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getChartDetails(id, panelId, data) {
|
||||||
|
return request({
|
||||||
|
url: '/chart/view/get/' + id + '/' + panelId,
|
||||||
|
method: 'post',
|
||||||
|
loading: false,
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function save2Cache(panelId, data) {
|
||||||
|
return request({
|
||||||
|
url: '/chart/view/save2Cache/' + panelId,
|
||||||
|
method: 'post',
|
||||||
|
loading: false,
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function resetViewCacheCallBack(viewId, panelId, callback) {
|
||||||
|
// 加载仪表板组件视图数据
|
||||||
|
resetViewCache(viewId, panelId).then(rep => {
|
||||||
|
callback(rep)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function resetViewCache(viewId, panelId) {
|
||||||
|
return request({
|
||||||
|
url: '/chart/view/resetViewCache/' + viewId + '/' + panelId,
|
||||||
|
method: 'post',
|
||||||
|
loading: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -164,3 +164,28 @@ export function queryPanelViewTree() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function initPanelComponentsData(panelId, callback) {
|
||||||
|
// 加载仪表板组件视图数据
|
||||||
|
queryPanelComponents(panelId).then(rep => {
|
||||||
|
store.commit('initPanelComponents', rep.data)
|
||||||
|
callback(rep)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function queryPanelComponents(id) {
|
||||||
|
return request({
|
||||||
|
url: 'panel/group/queryPanelComponents/' + id,
|
||||||
|
method: 'get',
|
||||||
|
loading: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function initViewCache(panelId) {
|
||||||
|
// 初始化仪表板视图缓存
|
||||||
|
return request({
|
||||||
|
url: 'chart/view/initViewCache/' + panelId,
|
||||||
|
method: 'post',
|
||||||
|
loading: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -184,22 +184,25 @@ export default {
|
|||||||
// resize
|
// resize
|
||||||
this.$emit('resizeView')
|
this.$emit('resizeView')
|
||||||
},
|
},
|
||||||
|
// edit() {
|
||||||
|
// // 编辑时临时保存 当前修改的画布
|
||||||
|
// this.$store.dispatch('panel/setComponentDataTemp', JSON.stringify(this.componentData))
|
||||||
|
// this.$store.dispatch('panel/setCanvasStyleDataTemp', JSON.stringify(this.canvasStyleData))
|
||||||
|
// if (this.curComponent.type === 'view') {
|
||||||
|
// this.$store.dispatch('chart/setViewId', null)
|
||||||
|
// this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId)
|
||||||
|
// bus.$emit('PanelSwitchComponent', { name: 'ChartEdit', param: { 'id': this.curComponent.propValue.viewId, 'optType': 'edit' }})
|
||||||
|
// }
|
||||||
|
// if (this.curComponent.type === 'custom') {
|
||||||
|
// bus.$emit('component-dialog-edit')
|
||||||
|
// }
|
||||||
|
// // 编辑样式组件
|
||||||
|
// if (this.curComponent.type === 'v-text' || this.curComponent.type === 'rect-shape') {
|
||||||
|
// bus.$emit('component-dialog-style')
|
||||||
|
// }
|
||||||
|
// },
|
||||||
edit() {
|
edit() {
|
||||||
// 编辑时临时保存 当前修改的画布
|
bus.$emit('change_panel_right_draw', true)
|
||||||
this.$store.dispatch('panel/setComponentDataTemp', JSON.stringify(this.componentData))
|
|
||||||
this.$store.dispatch('panel/setCanvasStyleDataTemp', JSON.stringify(this.canvasStyleData))
|
|
||||||
if (this.curComponent.type === 'view') {
|
|
||||||
this.$store.dispatch('chart/setViewId', null)
|
|
||||||
this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId)
|
|
||||||
bus.$emit('PanelSwitchComponent', { name: 'ChartEdit', param: { 'id': this.curComponent.propValue.viewId, 'optType': 'edit' }})
|
|
||||||
}
|
|
||||||
if (this.curComponent.type === 'custom') {
|
|
||||||
bus.$emit('component-dialog-edit')
|
|
||||||
}
|
|
||||||
// 编辑样式组件
|
|
||||||
if (this.curComponent.type === 'v-text' || this.curComponent.type === 'rect-shape') {
|
|
||||||
bus.$emit('component-dialog-style')
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
linkageEdit() {
|
linkageEdit() {
|
||||||
|
|
||||||
|
@ -46,23 +46,24 @@ export default {
|
|||||||
]),
|
]),
|
||||||
methods: {
|
methods: {
|
||||||
edit() {
|
edit() {
|
||||||
// 编辑时临时保存 当前修改的画布
|
bus.$emit('change_panel_right_draw', true)
|
||||||
this.$store.dispatch('panel/setComponentDataTemp', JSON.stringify(this.componentData))
|
// // 编辑时临时保存 当前修改的画布
|
||||||
this.$store.dispatch('panel/setCanvasStyleDataTemp', JSON.stringify(this.canvasStyleData))
|
// this.$store.dispatch('panel/setComponentDataTemp', JSON.stringify(this.componentData))
|
||||||
if (this.curComponent.type === 'view') {
|
// this.$store.dispatch('panel/setCanvasStyleDataTemp', JSON.stringify(this.canvasStyleData))
|
||||||
this.$store.dispatch('chart/setViewId', null)
|
// if (this.curComponent.type === 'view') {
|
||||||
this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId)
|
// this.$store.dispatch('chart/setViewId', null)
|
||||||
bus.$emit('PanelSwitchComponent', { name: 'ChartEdit', param: { 'id': this.curComponent.propValue.viewId, 'optType': 'edit' }})
|
// this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId)
|
||||||
}
|
// bus.$emit('PanelSwitchComponent', { name: 'ChartEdit', param: { 'id': this.curComponent.propValue.viewId, 'optType': 'edit' }})
|
||||||
if (this.curComponent.type === 'custom') {
|
// }
|
||||||
bus.$emit('component-dialog-edit')
|
// if (this.curComponent.type === 'custom') {
|
||||||
}
|
// bus.$emit('component-dialog-edit')
|
||||||
|
// }
|
||||||
// 编辑样式组件
|
//
|
||||||
|
// // 编辑样式组件
|
||||||
if (this.curComponent.type === 'v-text' || this.curComponent.type === 'rect-shape') {
|
//
|
||||||
bus.$emit('component-dialog-style')
|
// if (this.curComponent.type === 'v-text' || this.curComponent.type === 'rect-shape') {
|
||||||
}
|
// bus.$emit('component-dialog-style')
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
lock() {
|
lock() {
|
||||||
this.$store.commit('lock')
|
this.$store.commit('lock')
|
||||||
|
@ -57,6 +57,7 @@
|
|||||||
@linkJumpSet="linkJumpSet(item)"
|
@linkJumpSet="linkJumpSet(item)"
|
||||||
@boardSet="boardSet(item)"
|
@boardSet="boardSet(item)"
|
||||||
@canvasDragging="canvasDragging"
|
@canvasDragging="canvasDragging"
|
||||||
|
@editComponent="editComponent(index,item)"
|
||||||
>
|
>
|
||||||
<component
|
<component
|
||||||
:is="item.component"
|
:is="item.component"
|
||||||
@ -1286,6 +1287,11 @@ export default {
|
|||||||
this.$refs.wrapperChild[index].chartResize()
|
this.$refs.wrapperChild[index].chartResize()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
editComponent(index, item) {
|
||||||
|
if (item.type === 'view') {
|
||||||
|
this.$refs.wrapperChild[index].editChart()
|
||||||
|
}
|
||||||
|
},
|
||||||
handleDragOver(e) {
|
handleDragOver(e) {
|
||||||
this.dragComponentInfo.shadowStyle.x = e.pageX - 220
|
this.dragComponentInfo.shadowStyle.x = e.pageX - 220
|
||||||
this.dragComponentInfo.shadowStyle.y = e.pageY - 90 + this.scrollTop
|
this.dragComponentInfo.shadowStyle.y = e.pageY - 90 + this.scrollTop
|
||||||
|
@ -372,6 +372,9 @@ export default {
|
|||||||
bus.$on('plugin-add-view-track-filter', param => {
|
bus.$on('plugin-add-view-track-filter', param => {
|
||||||
param.viewId && param.viewId === this.element.propValue.viewId && this.addViewTrackFilter(param)
|
param.viewId && param.viewId === this.element.propValue.viewId && this.addViewTrackFilter(param)
|
||||||
})
|
})
|
||||||
|
bus.$on('view-in-cache', param => {
|
||||||
|
param.viewId && param.viewId === this.element.propValue.viewId && this.getDataEdit(param)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
addViewTrackFilter(linkageParam) {
|
addViewTrackFilter(linkageParam) {
|
||||||
@ -431,7 +434,8 @@ export default {
|
|||||||
}
|
}
|
||||||
const requestInfo = {
|
const requestInfo = {
|
||||||
...this.filter,
|
...this.filter,
|
||||||
cache: cache
|
cache: cache,
|
||||||
|
queryFrom: this.isEdit ? 'panel_edit' : 'panel'
|
||||||
}
|
}
|
||||||
if (this.panelInfo.proxy) {
|
if (this.panelInfo.proxy) {
|
||||||
// method = viewInfo
|
// method = viewInfo
|
||||||
@ -711,6 +715,18 @@ export default {
|
|||||||
|
|
||||||
renderComponent() {
|
renderComponent() {
|
||||||
return this.chart.render
|
return this.chart.render
|
||||||
|
},
|
||||||
|
getDataEdit(param) {
|
||||||
|
this.$store.state.styleChangeTimes++
|
||||||
|
if (param.type === 'propChange') {
|
||||||
|
this.getData(param.viewId, false)
|
||||||
|
} else if (param.type === 'styleChange') {
|
||||||
|
this.chart.customAttr = param.viewInfo.customAttr
|
||||||
|
this.chart.customStyle = param.viewInfo.customStyle
|
||||||
|
this.sourceCustomAttrStr = this.chart.customAttr
|
||||||
|
this.sourceCustomStyleStr = this.chart.customStyle
|
||||||
|
this.mergeScale()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1029,7 +1029,8 @@ export default {
|
|||||||
table_item_align: 'Body Align',
|
table_item_align: 'Body Align',
|
||||||
table_align_left: 'Left',
|
table_align_left: 'Left',
|
||||||
table_align_center: 'Center',
|
table_align_center: 'Center',
|
||||||
table_align_right: 'Right'
|
table_align_right: 'Right',
|
||||||
|
draw_back: 'Draw Back'
|
||||||
},
|
},
|
||||||
dataset: {
|
dataset: {
|
||||||
sheet_warn: 'There are multiple sheet pages, and the first one is extracted by default',
|
sheet_warn: 'There are multiple sheet pages, and the first one is extracted by default',
|
||||||
@ -1578,7 +1579,8 @@ export default {
|
|||||||
uninstall_confirm: 'Comfirm to uninstall the plugin?',
|
uninstall_confirm: 'Comfirm to uninstall the plugin?',
|
||||||
uninstall_cancel: 'Cancel uninstall plugin',
|
uninstall_cancel: 'Cancel uninstall plugin',
|
||||||
setting_background: 'BackGround',
|
setting_background: 'BackGround',
|
||||||
setting_jump: 'Jump Setting'
|
setting_jump: 'Jump Setting',
|
||||||
|
select_view: 'Select View'
|
||||||
},
|
},
|
||||||
display: {
|
display: {
|
||||||
logo: 'Head system logo',
|
logo: 'Head system logo',
|
||||||
|
@ -1029,7 +1029,8 @@ export default {
|
|||||||
table_item_align: '表格對齊方式',
|
table_item_align: '表格對齊方式',
|
||||||
table_align_left: '左對齊',
|
table_align_left: '左對齊',
|
||||||
table_align_center: '居中',
|
table_align_center: '居中',
|
||||||
table_align_right: '右對齊'
|
table_align_right: '右對齊',
|
||||||
|
draw_back: '收回'
|
||||||
},
|
},
|
||||||
dataset: {
|
dataset: {
|
||||||
sheet_warn: '有多個 Sheet 頁,默認抽取第一個',
|
sheet_warn: '有多個 Sheet 頁,默認抽取第一個',
|
||||||
@ -1564,7 +1565,8 @@ export default {
|
|||||||
choose_background: '选择组件背景',
|
choose_background: '选择组件背景',
|
||||||
choose_background_tips: '组件自有的背景设置会覆盖当前设置',
|
choose_background_tips: '组件自有的背景设置会覆盖当前设置',
|
||||||
setting_background: '设置背景',
|
setting_background: '设置背景',
|
||||||
setting_jump: '跳转设置'
|
setting_jump: '跳转设置',
|
||||||
|
select_view: '请选择视图...'
|
||||||
},
|
},
|
||||||
plugin: {
|
plugin: {
|
||||||
local_install: '本地安裝',
|
local_install: '本地安裝',
|
||||||
|
@ -1032,7 +1032,8 @@ export default {
|
|||||||
table_item_align: '表格对齐方式',
|
table_item_align: '表格对齐方式',
|
||||||
table_align_left: '左对齐',
|
table_align_left: '左对齐',
|
||||||
table_align_center: '居中',
|
table_align_center: '居中',
|
||||||
table_align_right: '右对齐'
|
table_align_right: '右对齐',
|
||||||
|
draw_back: '收回'
|
||||||
},
|
},
|
||||||
dataset: {
|
dataset: {
|
||||||
sheet_warn: '有多个 Sheet 页,默认抽取第一个',
|
sheet_warn: '有多个 Sheet 页,默认抽取第一个',
|
||||||
@ -1573,7 +1574,8 @@ export default {
|
|||||||
choose_background: '选择组件背景',
|
choose_background: '选择组件背景',
|
||||||
choose_background_tips: '组件自有的背景设置会覆盖当前设置',
|
choose_background_tips: '组件自有的背景设置会覆盖当前设置',
|
||||||
setting_background: '设置背景',
|
setting_background: '设置背景',
|
||||||
setting_jump: '跳转设置'
|
setting_jump: '跳转设置',
|
||||||
|
select_view: '请选择视图...'
|
||||||
},
|
},
|
||||||
plugin: {
|
plugin: {
|
||||||
local_install: '本地安装',
|
local_install: '本地安装',
|
||||||
|
@ -99,7 +99,9 @@ const data = {
|
|||||||
x: 300,
|
x: 300,
|
||||||
y: 600
|
y: 600
|
||||||
},
|
},
|
||||||
scrollAutoMove: 0
|
scrollAutoMove: 0,
|
||||||
|
// 视图是否编辑记录
|
||||||
|
panelViewEditInfo: {}
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
...animation.mutations,
|
...animation.mutations,
|
||||||
@ -392,6 +394,17 @@ const data = {
|
|||||||
},
|
},
|
||||||
setScrollAutoMove(state, offset) {
|
setScrollAutoMove(state, offset) {
|
||||||
state.scrollAutoMove = offset
|
state.scrollAutoMove = offset
|
||||||
|
},
|
||||||
|
initPanelComponents(state, panelComponents) {
|
||||||
|
if (panelComponents) {
|
||||||
|
state.canvasStyleData['panelComponents'] = panelComponents
|
||||||
|
}
|
||||||
|
},
|
||||||
|
recordViewEdit(state, viewInfo) {
|
||||||
|
state.panelViewEditInfo[viewInfo.viewId] = viewInfo.hasEdit
|
||||||
|
},
|
||||||
|
resetViewEditInfo(state) {
|
||||||
|
state.panelViewEditInfo = {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
modules: {
|
modules: {
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-row v-loading="loading" style="height: 100%;overflow-y: hidden;width: 100%;">
|
<el-row v-loading="loading" style="height: 100%;overflow-y: hidden;width: 100%;">
|
||||||
|
<el-tooltip :content="$t('chart.draw_back')">
|
||||||
|
<el-button class="el-icon-d-arrow-right" style="position:absolute;left: 4px;top: 5px;z-index: 1000" size="mini" circle @click="closePanelEdit" />
|
||||||
|
</el-tooltip>
|
||||||
|
<!-- <i class="el-icon-d-arrow-right" style="position:absolute;left: 4px;top: 11px"></i>-->
|
||||||
<el-row style="height: 40px;" class="padding-lr">
|
<el-row style="height: 40px;" class="padding-lr">
|
||||||
<span class="title-text" style="line-height: 40px;">{{ view.name }}</span>
|
|
||||||
<el-popover
|
<el-popover
|
||||||
placement="right-start"
|
placement="right-start"
|
||||||
width="400"
|
width="400"
|
||||||
@ -10,25 +13,30 @@
|
|||||||
@hide="hideTab"
|
@hide="hideTab"
|
||||||
>
|
>
|
||||||
<dataset-chart-detail type="chart" :data="view" :tab-status="tabStatus" />
|
<dataset-chart-detail type="chart" :data="view" :tab-status="tabStatus" />
|
||||||
<i slot="reference" class="el-icon-warning icon-class" style="margin-left: 4px;cursor: pointer;" />
|
<i
|
||||||
|
slot="reference"
|
||||||
|
class="el-icon-warning icon-class"
|
||||||
|
style="position:absolute; margin-left: 30px; top:14px;cursor: pointer;"
|
||||||
|
/>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
|
<span class="title-text view-title-name" style="line-height: 40px;">{{ view.name }}</span>
|
||||||
<span style="float: right;line-height: 40px;">
|
<span style="float: right;line-height: 40px;">
|
||||||
<el-button size="mini" @click="close">
|
<!-- <el-button size="mini" @click="closePanelEdit">-->
|
||||||
{{ $t('chart.close') }}
|
<!-- {{ $t('chart.draw_back') }}-->
|
||||||
</el-button>
|
<!-- </el-button>-->
|
||||||
<el-button size="mini" :disabled="!hasEdit" @click="reset">
|
<el-button type="warning" round size="mini" :disabled="!hasEdit" @click="reset">
|
||||||
{{ $t('chart.recover') }}
|
{{ $t('chart.recover') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button size="mini" type="primary" @click="closeEdit">
|
<!-- <el-button size="mini" type="primary" @click="closeEdit">-->
|
||||||
{{ $t('commons.save') }}
|
<!-- {{ $t('commons.save') }}-->
|
||||||
</el-button>
|
<!-- </el-button>-->
|
||||||
</span>
|
</span>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row class="view-panel">
|
<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: 360px">
|
<el-tab-pane :label="$t('chart.chart_data')" class="padding-tab" style="width: 300px">
|
||||||
<el-row class="view-panel">
|
<el-row class="view-panel">
|
||||||
<el-col class="theme-border-class" style="width: 180px;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;">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="searchField"
|
v-model="searchField"
|
||||||
@ -117,7 +125,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col
|
<el-col
|
||||||
style="height: 100%;width: 180px;border-right: 1px solid #E6E6E6;"
|
:span="12"
|
||||||
|
style="height: 100%;border-right: 1px solid #E6E6E6;"
|
||||||
class="theme-border-class"
|
class="theme-border-class"
|
||||||
>
|
>
|
||||||
<div style="height: 60px;overflow:auto" class="padding-lr theme-border-class">
|
<div style="height: 60px;overflow:auto" class="padding-lr theme-border-class">
|
||||||
@ -218,7 +227,11 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<plugin-com v-if="view.isPlugin" :component-name="view.type + '-data'" :obj="{view, param, chart, dimensionData, quotaData}" />
|
<plugin-com
|
||||||
|
v-if="view.isPlugin"
|
||||||
|
:component-name="view.type + '-data'"
|
||||||
|
:obj="{view, param, chart, dimensionData, quotaData}"
|
||||||
|
/>
|
||||||
<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">
|
||||||
@ -352,7 +365,9 @@
|
|||||||
<span v-else-if="view.type && view.type === 'map'">{{ $t('chart.chart_data') }}</span>
|
<span v-else-if="view.type && view.type === 'map'">{{ $t('chart.chart_data') }}</span>
|
||||||
<span v-else-if="view.type && view.type.includes('tree')">{{ $t('chart.drag_block_treemap_size') }}</span>
|
<span v-else-if="view.type && view.type.includes('tree')">{{ $t('chart.drag_block_treemap_size') }}</span>
|
||||||
<span v-else-if="view.type && view.type === 'chart-mix'">{{ $t('chart.drag_block_value_axis_main') }}</span>
|
<span v-else-if="view.type && view.type === 'chart-mix'">{{ $t('chart.drag_block_value_axis_main') }}</span>
|
||||||
<span v-else-if="view.type && view.type === 'liquid'">{{ $t('chart.drag_block_progress') }}</span>
|
<span
|
||||||
|
v-else-if="view.type && view.type === 'liquid'"
|
||||||
|
>{{ $t('chart.drag_block_progress') }}</span>
|
||||||
<span v-else-if="view.type && view.type === 'word-cloud'">{{ $t('chart.drag_block_word_cloud_size') }}</span>
|
<span v-else-if="view.type && view.type === 'word-cloud'">{{ $t('chart.drag_block_word_cloud_size') }}</span>
|
||||||
/
|
/
|
||||||
<span>{{ $t('chart.quota') }}</span>
|
<span>{{ $t('chart.quota') }}</span>
|
||||||
@ -462,7 +477,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-row>
|
</el-row>
|
||||||
<!--extBubble-->
|
<!--extBubble-->
|
||||||
<el-row v-if="view.type && view.type.includes('scatter')" class="padding-lr" style="margin-top: 6px;">
|
<el-row
|
||||||
|
v-if="view.type && view.type.includes('scatter')"
|
||||||
|
class="padding-lr"
|
||||||
|
style="margin-top: 6px;"
|
||||||
|
>
|
||||||
<span style="width: 80px;text-align: right;">
|
<span style="width: 80px;text-align: right;">
|
||||||
<span>{{ $t('chart.bubble_size') }}</span>
|
<span>{{ $t('chart.bubble_size') }}</span>
|
||||||
/
|
/
|
||||||
@ -578,7 +597,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane :label="$t('chart.chart_style')" class="padding-tab" style="width: 360px;">
|
<el-tab-pane :label="$t('chart.chart_style')" class="padding-tab" style="width: 300px">
|
||||||
<el-row class="view-panel">
|
<el-row class="view-panel">
|
||||||
<plugin-com
|
<plugin-com
|
||||||
v-if="view.isPlugin"
|
v-if="view.isPlugin"
|
||||||
@ -812,7 +831,7 @@
|
|||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
|
||||||
<el-col style="height: 100%;min-width: 500px;border-top: 1px solid #E6E6E6;">
|
<el-col v-if="editFrom==='view'" style="height: 100%;min-width: 500px;border-top: 1px solid #E6E6E6;">
|
||||||
<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
|
||||||
@ -991,7 +1010,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ajaxGetDataOnly, post } from '@/api/chart/chart'
|
import {
|
||||||
|
ajaxGetDataOnly,
|
||||||
|
post,
|
||||||
|
getChartDetails,
|
||||||
|
save2Cache,
|
||||||
|
resetViewCache,
|
||||||
|
resetViewCacheCallBack
|
||||||
|
} from '@/api/chart/chart'
|
||||||
import DimensionItem from '../components/drag-item/DimensionItem'
|
import DimensionItem from '../components/drag-item/DimensionItem'
|
||||||
import QuotaItem from '../components/drag-item/QuotaItem'
|
import QuotaItem from '../components/drag-item/QuotaItem'
|
||||||
import FilterItem from '../components/drag-item/FilterItem'
|
import FilterItem from '../components/drag-item/FilterItem'
|
||||||
@ -1052,6 +1078,8 @@ 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 { mapState } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ChartEdit',
|
name: 'ChartEdit',
|
||||||
components: {
|
components: {
|
||||||
@ -1102,6 +1130,11 @@ export default {
|
|||||||
param: {
|
param: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
|
},
|
||||||
|
editFrom: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: 'view'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@ -1197,7 +1230,10 @@ export default {
|
|||||||
},
|
},
|
||||||
panelInfo() {
|
panelInfo() {
|
||||||
return this.$store.state.panel.panelInfo
|
return this.$store.state.panel.panelInfo
|
||||||
}
|
},
|
||||||
|
...mapState([
|
||||||
|
'panelViewEditInfo'
|
||||||
|
])
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'param': function() {
|
'param': function() {
|
||||||
@ -1205,7 +1241,9 @@ export default {
|
|||||||
//
|
//
|
||||||
} else {
|
} else {
|
||||||
this.resetDrill()
|
this.resetDrill()
|
||||||
this.getData(this.param.id)
|
this.initFromPanel()
|
||||||
|
// this.getData(this.param.id)
|
||||||
|
this.getChart(this.param.id)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
searchField(val) {
|
searchField(val) {
|
||||||
@ -1226,13 +1264,18 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
this.bindPluginEvent()
|
this.bindPluginEvent()
|
||||||
// this.get(this.$store.state.chart.viewId);
|
// this.get(this.$store.state.chart.viewId);
|
||||||
this.getData(this.param.id)
|
// this.getData(this.param.id)
|
||||||
|
// this.getChart(this.param.id)
|
||||||
// this.myEcharts();
|
// this.myEcharts();
|
||||||
|
this.initFromPanel()
|
||||||
},
|
},
|
||||||
activated() {
|
activated() {
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
initFromPanel() {
|
||||||
|
this.hasEdit = (this.panelViewEditInfo[this.param.id] || false)
|
||||||
|
},
|
||||||
bindPluginEvent() {
|
bindPluginEvent() {
|
||||||
bus.$on('show-dimension-edit-filter', this.showDimensionEditFilter)
|
bus.$on('show-dimension-edit-filter', this.showDimensionEditFilter)
|
||||||
bus.$on('show-rename', this.showRename)
|
bus.$on('show-rename', this.showRename)
|
||||||
@ -1449,50 +1492,57 @@ export default {
|
|||||||
delete view.data
|
delete view.data
|
||||||
return view
|
return view
|
||||||
},
|
},
|
||||||
calcData(getData, trigger, needRefreshGroup = false, switchType = false) {
|
// calcData(getData, trigger, needRefreshGroup = false, switchType = false) {
|
||||||
this.hasEdit = true
|
// this.hasEdit = true
|
||||||
const view = this.buildParam(getData, trigger, needRefreshGroup, switchType)
|
// const view = this.buildParam(getData, trigger, needRefreshGroup, switchType)
|
||||||
|
// if (!view) return
|
||||||
|
// post('/chart/view/calcData/' + this.panelInfo.id, {
|
||||||
|
// view: view,
|
||||||
|
// requestList: {
|
||||||
|
// filter: [],
|
||||||
|
// drill: this.drillClickDimensionList
|
||||||
|
// }
|
||||||
|
// }).then(response => {
|
||||||
|
// const view = JSON.parse(JSON.stringify(response.data))
|
||||||
|
// this.view.xaxis = view.xaxis ? JSON.parse(view.xaxis) : []
|
||||||
|
// this.view.xaxisExt = view.xaxisExt ? JSON.parse(view.xaxisExt) : []
|
||||||
|
// this.view.yaxis = view.yaxis ? JSON.parse(view.yaxis) : []
|
||||||
|
// this.view.yaxisExt = view.yaxisExt ? JSON.parse(view.yaxisExt) : []
|
||||||
|
// this.view.extStack = view.extStack ? JSON.parse(view.extStack) : []
|
||||||
|
// this.view.drillFields = view.drillFields ? JSON.parse(view.drillFields) : []
|
||||||
|
// this.view.extBubble = view.extBubble ? JSON.parse(view.extBubble) : []
|
||||||
|
// this.view.customAttr = view.customAttr ? JSON.parse(view.customAttr) : {}
|
||||||
|
// this.view.customStyle = view.customStyle ? JSON.parse(view.customStyle) : {}
|
||||||
|
// this.view.customFilter = view.customFilter ? JSON.parse(view.customFilter) : {}
|
||||||
|
// // 将视图传入echart组件
|
||||||
|
// this.chart = response.data
|
||||||
|
// this.data = response.data.data
|
||||||
|
// // console.log(JSON.stringify(this.chart))
|
||||||
|
// this.httpRequest.status = true
|
||||||
|
// if (this.chart.privileges) {
|
||||||
|
// this.param.privileges = this.chart.privileges
|
||||||
|
// }
|
||||||
|
// if (!response.data.drill) {
|
||||||
|
// this.drillClickDimensionList.splice(this.drillClickDimensionList.length - 1, 1)
|
||||||
|
//
|
||||||
|
// this.resetDrill()
|
||||||
|
// }
|
||||||
|
// this.drill = response.data.drill
|
||||||
|
// this.drillFilters = JSON.parse(JSON.stringify(response.data.drillFilters ? response.data.drillFilters : []))
|
||||||
|
//
|
||||||
|
// this.closeChangeChart()
|
||||||
|
// })
|
||||||
|
// },
|
||||||
|
calcData() {
|
||||||
|
this.changeEditStatus(true)
|
||||||
|
const view = this.buildParam(true, 'chart', false, false)
|
||||||
if (!view) return
|
if (!view) return
|
||||||
post('/chart/view/calcData/' + this.panelInfo.id, {
|
save2Cache(this.panelInfo.id, view).then(() => {
|
||||||
view: view,
|
bus.$emit('view-in-cache', { type: 'propChange', viewId: this.param.id })
|
||||||
requestList: {
|
|
||||||
filter: [],
|
|
||||||
drill: this.drillClickDimensionList
|
|
||||||
}
|
|
||||||
}).then(response => {
|
|
||||||
const view = JSON.parse(JSON.stringify(response.data))
|
|
||||||
this.view.xaxis = view.xaxis ? JSON.parse(view.xaxis) : []
|
|
||||||
this.view.xaxisExt = view.xaxisExt ? JSON.parse(view.xaxisExt) : []
|
|
||||||
this.view.yaxis = view.yaxis ? JSON.parse(view.yaxis) : []
|
|
||||||
this.view.yaxisExt = view.yaxisExt ? JSON.parse(view.yaxisExt) : []
|
|
||||||
this.view.extStack = view.extStack ? JSON.parse(view.extStack) : []
|
|
||||||
this.view.drillFields = view.drillFields ? JSON.parse(view.drillFields) : []
|
|
||||||
this.view.extBubble = view.extBubble ? JSON.parse(view.extBubble) : []
|
|
||||||
this.view.customAttr = view.customAttr ? JSON.parse(view.customAttr) : {}
|
|
||||||
this.view.customStyle = view.customStyle ? JSON.parse(view.customStyle) : {}
|
|
||||||
this.view.customFilter = view.customFilter ? JSON.parse(view.customFilter) : {}
|
|
||||||
// 将视图传入echart组件
|
|
||||||
this.chart = response.data
|
|
||||||
this.data = response.data.data
|
|
||||||
// console.log(JSON.stringify(this.chart))
|
|
||||||
this.httpRequest.status = true
|
|
||||||
if (this.chart.privileges) {
|
|
||||||
this.param.privileges = this.chart.privileges
|
|
||||||
}
|
|
||||||
if (!response.data.drill) {
|
|
||||||
this.drillClickDimensionList.splice(this.drillClickDimensionList.length - 1, 1)
|
|
||||||
|
|
||||||
this.resetDrill()
|
|
||||||
}
|
|
||||||
this.drill = response.data.drill
|
|
||||||
this.drillFilters = JSON.parse(JSON.stringify(response.data.drillFilters ? response.data.drillFilters : []))
|
|
||||||
|
|
||||||
this.closeChangeChart()
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
calcStyle() {
|
calcStyle() {
|
||||||
this.hasEdit = true
|
this.changeEditStatus(true)
|
||||||
// 将视图传入echart...组件
|
// 将视图传入echart...组件
|
||||||
const view = JSON.parse(JSON.stringify(this.view))
|
const view = JSON.parse(JSON.stringify(this.view))
|
||||||
view.xaxis = JSON.stringify(this.view.xaxis)
|
view.xaxis = JSON.stringify(this.view.xaxis)
|
||||||
@ -1505,8 +1555,15 @@ export default {
|
|||||||
view.customAttr = JSON.stringify(this.view.customAttr)
|
view.customAttr = JSON.stringify(this.view.customAttr)
|
||||||
view.customStyle = JSON.stringify(this.view.customStyle)
|
view.customStyle = JSON.stringify(this.view.customStyle)
|
||||||
view.customFilter = JSON.stringify(this.view.customFilter)
|
view.customFilter = JSON.stringify(this.view.customFilter)
|
||||||
view.data = this.data
|
// view.data = this.data
|
||||||
this.chart = view
|
this.chart = view
|
||||||
|
|
||||||
|
// 保存到缓存表
|
||||||
|
const viewSave = this.buildParam(true, 'chart', false, false)
|
||||||
|
if (!viewSave) return
|
||||||
|
save2Cache(this.panelInfo.id, viewSave)
|
||||||
|
|
||||||
|
bus.$emit('view-in-cache', { type: 'styleChange', viewId: this.param.id, viewInfo: view })
|
||||||
},
|
},
|
||||||
|
|
||||||
closeEdit() {
|
closeEdit() {
|
||||||
@ -1529,6 +1586,9 @@ export default {
|
|||||||
this.$success(this.$t('commons.save_success'))
|
this.$success(this.$t('commons.save_success'))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
closePanelEdit() {
|
||||||
|
bus.$emit('change_panel_right_draw', false)
|
||||||
|
},
|
||||||
close() {
|
close() {
|
||||||
this.closeChangeChart()
|
this.closeChangeChart()
|
||||||
// 从仪表板入口关闭
|
// 从仪表板入口关闭
|
||||||
@ -1542,7 +1602,8 @@ export default {
|
|||||||
if (id) {
|
if (id) {
|
||||||
ajaxGetDataOnly(id, this.panelInfo.id, {
|
ajaxGetDataOnly(id, this.panelInfo.id, {
|
||||||
filter: [],
|
filter: [],
|
||||||
drill: this.drillClickDimensionList
|
drill: this.drillClickDimensionList,
|
||||||
|
queryFrom: 'panelEdit'
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
this.initTableData(response.data.tableId)
|
this.initTableData(response.data.tableId)
|
||||||
this.view = JSON.parse(JSON.stringify(response.data))
|
this.view = JSON.parse(JSON.stringify(response.data))
|
||||||
@ -1585,9 +1646,9 @@ export default {
|
|||||||
this.view = {}
|
this.view = {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getChart(id) {
|
getChart(id, queryFrom = 'panel_edit') {
|
||||||
if (id) {
|
if (id) {
|
||||||
post('/chart/view/get/' + id + '/' + this.panelInfo.id, {}).then(response => {
|
getChartDetails(id, this.panelInfo.id, { queryFrom: queryFrom }).then(response => {
|
||||||
this.initTableData(response.data.tableId)
|
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) : []
|
||||||
@ -2166,7 +2227,10 @@ export default {
|
|||||||
// this.$refs.dynamicChart && this.$refs.dynamicChart.registerDynamicMap && this.$refs.dynamicChart.registerDynamicMap(this.currentAcreaNode.code)
|
// this.$refs.dynamicChart && this.$refs.dynamicChart.registerDynamicMap && this.$refs.dynamicChart.registerDynamicMap(this.currentAcreaNode.code)
|
||||||
const current = this.$refs.dynamicChart
|
const current = this.$refs.dynamicChart
|
||||||
if (this.view.isPlugin) {
|
if (this.view.isPlugin) {
|
||||||
current && current.callPluginInner({ methodName: 'registerDynamicMap', methodParam: this.currentAcreaNode.code })
|
current && current.callPluginInner({
|
||||||
|
methodName: 'registerDynamicMap',
|
||||||
|
methodParam: this.currentAcreaNode.code
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
current && current.registerDynamicMap && current.registerDynamicMap(this.currentAcreaNode.code)
|
current && current.registerDynamicMap && current.registerDynamicMap(this.currentAcreaNode.code)
|
||||||
}
|
}
|
||||||
@ -2190,7 +2254,10 @@ export default {
|
|||||||
// this.$refs.dynamicChart && this.$refs.dynamicChart.registerDynamicMap && this.$refs.dynamicChart.registerDynamicMap(nextNode.code)
|
// this.$refs.dynamicChart && this.$refs.dynamicChart.registerDynamicMap && this.$refs.dynamicChart.registerDynamicMap(nextNode.code)
|
||||||
const current = this.$refs.dynamicChart
|
const current = this.$refs.dynamicChart
|
||||||
if (this.view.isPlugin) {
|
if (this.view.isPlugin) {
|
||||||
nextNode && current && current.callPluginInner({ methodName: 'registerDynamicMap', methodParam: nextNode.code })
|
nextNode && current && current.callPluginInner({
|
||||||
|
methodName: 'registerDynamicMap',
|
||||||
|
methodParam: nextNode.code
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
nextNode && current && current.registerDynamicMap && current.registerDynamicMap(nextNode.code)
|
nextNode && current && current.registerDynamicMap && current.registerDynamicMap(nextNode.code)
|
||||||
}
|
}
|
||||||
@ -2215,9 +2282,17 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
reset() {
|
reset() {
|
||||||
this.getData(this.param.id)
|
this.changeEditStatus(false)
|
||||||
|
this.getChart(this.param.id, 'panel')
|
||||||
|
const _this = this
|
||||||
|
resetViewCacheCallBack(this.param.id, this.panelInfo.id, function(rsp) {
|
||||||
|
bus.$emit('view-in-cache', { type: 'propChange', viewId: _this.param.id })
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeEditStatus(status) {
|
||||||
|
this.hasEdit = status
|
||||||
|
this.$store.commit('recordViewEdit', { viewId: this.param.id, hasEdit: status })
|
||||||
},
|
},
|
||||||
|
|
||||||
changeChartType() {
|
changeChartType() {
|
||||||
this.setChartDefaultOptions()
|
this.setChartDefaultOptions()
|
||||||
this.calcData(true, 'chart', true, true)
|
this.calcData(true, 'chart', true, true)
|
||||||
@ -2274,9 +2349,17 @@ export default {
|
|||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.view-panel-row {
|
||||||
|
display: flex;
|
||||||
|
background-color: #f7f8fa;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
height: calc(100vh - 75px);
|
||||||
|
}
|
||||||
|
|
||||||
.view-panel {
|
.view-panel {
|
||||||
display: flex;
|
display: flex;
|
||||||
height: calc(100% - 40px);
|
height: calc(100% - 80px);
|
||||||
background-color: #f7f8fa;
|
background-color: #f7f8fa;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2395,7 +2478,6 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tab-header > > > .el-tabs__content {
|
.tab-header > > > .el-tabs__content {
|
||||||
height: 100%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.draggable-group {
|
.draggable-group {
|
||||||
@ -2569,11 +2651,33 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.result-count {
|
.result-count {
|
||||||
width: 80px;
|
width: 60px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.radio-span > > > .el-radio__label {
|
.radio-span > > > .el-radio__label {
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.view-title-name {
|
||||||
|
display: -moz-inline-box;
|
||||||
|
display: inline-block;
|
||||||
|
width: 130px;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
margin-left: 45px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .item-axis {
|
||||||
|
width: 128px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-slider__input {
|
||||||
|
width: 80px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-input-number--mini {
|
||||||
|
width: 80px !important;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -145,12 +145,12 @@ export default {
|
|||||||
init() {
|
init() {
|
||||||
if (this.data.id) {
|
if (this.data.id) {
|
||||||
if (this.type === 'dataset') {
|
if (this.type === 'dataset') {
|
||||||
post('/dataset/table/datasetDetail/' + this.data.id, null).then(res => {
|
post('/dataset/table/datasetDetail/' + this.data.id, null,false).then(res => {
|
||||||
this.detail = res.data
|
this.detail = res.data
|
||||||
this.info = JSON.parse(res.data.table.info)
|
this.info = JSON.parse(res.data.table.info)
|
||||||
})
|
})
|
||||||
} else if (this.type === 'chart') {
|
} else if (this.type === 'chart') {
|
||||||
post('/chart/view/chartDetail/' + this.data.id + '/' + this.panelInfo.id, null).then(res => {
|
post('/chart/view/chartDetail/' + this.data.id + '/' + this.panelInfo.id, null,false).then(res => {
|
||||||
this.detail = res.data
|
this.detail = res.data
|
||||||
this.info = JSON.parse(res.data.table.info)
|
this.info = JSON.parse(res.data.table.info)
|
||||||
})
|
})
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<el-col v-loading="loading">
|
<el-col v-loading="loading">
|
||||||
<el-row style="margin-top: 5px">
|
<el-row style="margin-top: 5px">
|
||||||
<el-row style="margin-left: 5px;margin-right: 5px">
|
<el-row style="margin-left: 5px;margin-right: 5px">
|
||||||
<el-col :span="23">
|
<el-col :span="17">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="templateFilterText"
|
v-model="templateFilterText"
|
||||||
:placeholder="$t('panel.filter_keywords')"
|
:placeholder="$t('panel.filter_keywords')"
|
||||||
@ -11,9 +11,9 @@
|
|||||||
prefix-icon="el-icon-search"
|
prefix-icon="el-icon-search"
|
||||||
/>
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- <el-col v-if="!selectModel" :span="7">-->
|
<el-col v-if="!selectModel" :span="7">
|
||||||
<!-- <el-button type="primary" size="mini" style="float: right" @click="newChart">新建 </el-button>-->
|
<el-button type="primary" size="mini" style="float: right" @click="newChart">新建 </el-button>
|
||||||
<!-- </el-col>-->
|
</el-col>
|
||||||
|
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row style="margin-top: 5px">
|
<el-row style="margin-top: 5px">
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-header class="de-header">
|
<el-header class="de-header">
|
||||||
<el-col :span="8" style="text-overflow:ellipsis;overflow: hidden;white-space: nowrap;color: #606266;font-size: 16px">
|
<el-col
|
||||||
|
:span="8"
|
||||||
|
style="text-overflow:ellipsis;overflow: hidden;white-space: nowrap;color: #606266;font-size: 16px"
|
||||||
|
>
|
||||||
<span style="line-height: 35px;">
|
<span style="line-height: 35px;">
|
||||||
{{ $t('commons.name') }} :{{ panelInfo.name || '测试仪表板' }}
|
{{ $t('commons.name') }} :{{ panelInfo.name || '测试仪表板' }}
|
||||||
</span>
|
</span>
|
||||||
@ -19,66 +22,113 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-header>
|
</el-header>
|
||||||
<de-container>
|
<de-container>
|
||||||
<!--左侧导航栏-->
|
|
||||||
<de-aside-container class="ms-aside-container">
|
<de-aside-container class="ms-aside-container">
|
||||||
<div v-if="showAside" style="width: 60px; left: 0px; top: 0px; bottom: 0px; position: absolute">
|
<div v-if="showAside" style="width: 60px; left: 0px; top: 0px; bottom: 0px; position: absolute">
|
||||||
<div style="width: 60px;height: 100%;overflow: hidden auto;position: relative;margin: 0px auto; font-size: 14px">
|
<div
|
||||||
|
style="width: 60px;height: 100%;overflow: hidden auto;position: relative;margin: 0px auto; font-size: 14px"
|
||||||
|
>
|
||||||
<!-- 视图图表 start -->
|
<!-- 视图图表 start -->
|
||||||
<div class="button-div-class" style=" width: 24px;height: 24px;text-align: center;line-height: 1;position: relative;margin: 16px auto 0px;">
|
<div
|
||||||
|
class="button-div-class"
|
||||||
|
style=" width: 24px;height: 24px;text-align: center;line-height: 1;position: relative;margin: 16px auto 0px;"
|
||||||
|
>
|
||||||
<el-button circle class="el-icon-circle-plus-outline" size="mini" @click="newChart()" />
|
<el-button circle class="el-icon-circle-plus-outline" size="mini" @click="newChart()" />
|
||||||
</div>
|
</div>
|
||||||
<div class="button-text" style="position: relative; margin: 18px auto 16px;">
|
<div class="button-text" style="position: relative; margin: 18px auto 16px;">
|
||||||
<div style="max-width: 100%;text-align: center;white-space: nowrap;text-overflow: ellipsis;position: relative;flex-shrink: 0;">
|
<div
|
||||||
|
style="max-width: 100%;text-align: center;white-space: nowrap;text-overflow: ellipsis;position: relative;flex-shrink: 0;"
|
||||||
|
>
|
||||||
{{ $t('panel.view') }}
|
{{ $t('panel.view') }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="height: 1px; position: relative; margin: 0px auto;background-color:#E6E6E6;">
|
<div style="height: 1px; position: relative; margin: 0px auto;background-color:#E6E6E6;">
|
||||||
<div style="width: 60px;height: 1px;line-height: 1px;text-align: center;white-space: pre;text-overflow: ellipsis;position: relative;flex-shrink: 0;" />
|
<div
|
||||||
|
style="width: 60px;height: 1px;line-height: 1px;text-align: center;white-space: pre;text-overflow: ellipsis;position: relative;flex-shrink: 0;"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<!-- 视图图表 end -->
|
<!-- 视图图表 end -->
|
||||||
<!-- 过滤组件 start -->
|
<!-- 过滤组件 start -->
|
||||||
|
|
||||||
<div class="button-div-class" style=" width: 24px;height: 24px;text-align: center;line-height: 1;position: relative;margin: 16px auto 0px; ">
|
<div
|
||||||
<el-button circle :class="show&&showIndex===1? 'button-show':'button-closed'" class="el-icon-s-tools" size="mini" @click="showPanel(1)" />
|
class="button-div-class"
|
||||||
|
style=" width: 24px;height: 24px;text-align: center;line-height: 1;position: relative;margin: 16px auto 0px; "
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
circle
|
||||||
|
:class="show&&showIndex===1? 'button-show':'button-closed'"
|
||||||
|
class="el-icon-s-tools"
|
||||||
|
size="mini"
|
||||||
|
@click="showPanel(1)"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="button-text" style=" position: relative; margin: 18px auto 16px;">
|
<div class="button-text" style=" position: relative; margin: 18px auto 16px;">
|
||||||
<div style=" max-width: 100%;text-align: center;white-space: nowrap;text-overflow: ellipsis;position: relative;flex-shrink: 0;">
|
<div
|
||||||
|
style=" max-width: 100%;text-align: center;white-space: nowrap;text-overflow: ellipsis;position: relative;flex-shrink: 0;"
|
||||||
|
>
|
||||||
{{ $t('panel.module') }}
|
{{ $t('panel.module') }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="height: 1px; position: relative; margin: 0px auto;background-color:#E6E6E6;">
|
<div style="height: 1px; position: relative; margin: 0px auto;background-color:#E6E6E6;">
|
||||||
<div style="width: 60px;height: 1px;line-height: 1px;text-align: center;white-space: pre;text-overflow: ellipsis;position: relative;flex-shrink: 0;" />
|
<div
|
||||||
|
style="width: 60px;height: 1px;line-height: 1px;text-align: center;white-space: pre;text-overflow: ellipsis;position: relative;flex-shrink: 0;"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<!-- 过滤组件 end -->
|
<!-- 过滤组件 end -->
|
||||||
<!-- 其他组件 start -->
|
<!-- 其他组件 start -->
|
||||||
|
|
||||||
<div class="button-div-class" style=" width: 24px;height: 24px;text-align: center;line-height: 1;position: relative;margin: 16px auto 0px; ">
|
<div
|
||||||
<el-button circle :class="show&&showIndex===3? 'button-show':'button-closed'" class="el-icon-brush" size="mini" @click="showPanel(3)" />
|
class="button-div-class"
|
||||||
|
style=" width: 24px;height: 24px;text-align: center;line-height: 1;position: relative;margin: 16px auto 0px; "
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
circle
|
||||||
|
:class="show&&showIndex===3? 'button-show':'button-closed'"
|
||||||
|
class="el-icon-brush"
|
||||||
|
size="mini"
|
||||||
|
@click="showPanel(3)"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="button-text" style=" position: relative; margin: 18px auto 16px;">
|
<div class="button-text" style=" position: relative; margin: 18px auto 16px;">
|
||||||
<div style=" max-width: 100%;text-align: center;white-space: nowrap;text-overflow: ellipsis;position: relative;flex-shrink: 0;">
|
<div
|
||||||
|
style=" max-width: 100%;text-align: center;white-space: nowrap;text-overflow: ellipsis;position: relative;flex-shrink: 0;"
|
||||||
|
>
|
||||||
{{ $t('panel.other_module') }}
|
{{ $t('panel.other_module') }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="height: 1px; position: relative; margin: 0px auto;background-color:#E6E6E6;">
|
<div style="height: 1px; position: relative; margin: 0px auto;background-color:#E6E6E6;">
|
||||||
<div style="width: 60px;height: 1px;line-height: 1px;text-align: center;white-space: pre;text-overflow: ellipsis;position: relative;flex-shrink: 0;" />
|
<div
|
||||||
|
style="width: 60px;height: 1px;line-height: 1px;text-align: center;white-space: pre;text-overflow: ellipsis;position: relative;flex-shrink: 0;"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<!-- 其他组件 end -->
|
<!-- 其他组件 end -->
|
||||||
|
|
||||||
<!-- 视图复用 start -->
|
<!-- 视图复用 start -->
|
||||||
<div class="button-div-class" style=" width: 24px;height: 24px;text-align: center;line-height: 1;position: relative;margin: 16px auto 0px;">
|
<div
|
||||||
<el-button :class="show&&showIndex===0? 'button-show':'button-closed'" circle class="el-icon-copy-document" size="mini" @click="showPanel(0)" />
|
class="button-div-class"
|
||||||
|
style=" width: 24px;height: 24px;text-align: center;line-height: 1;position: relative;margin: 16px auto 0px;"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
:class="show&&showIndex===0? 'button-show':'button-closed'"
|
||||||
|
circle
|
||||||
|
class="el-icon-copy-document"
|
||||||
|
size="mini"
|
||||||
|
@click="showPanel(0)"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="button-text" style="position: relative; margin: 18px auto 16px;">
|
<div class="button-text" style="position: relative; margin: 18px auto 16px;">
|
||||||
<div style="max-width: 100%;text-align: center;white-space: nowrap;text-overflow: ellipsis;position: relative;flex-shrink: 0;">
|
<div
|
||||||
|
style="max-width: 100%;text-align: center;white-space: nowrap;text-overflow: ellipsis;position: relative;flex-shrink: 0;"
|
||||||
|
>
|
||||||
<!-- {{ $t('panel.view') }}-->
|
<!-- {{ $t('panel.view') }}-->
|
||||||
复用
|
复用
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="height: 1px; position: relative; margin: 0px auto;background-color:#E6E6E6;">
|
<div style="height: 1px; position: relative; margin: 0px auto;background-color:#E6E6E6;">
|
||||||
<div style="width: 60px;height: 1px;line-height: 1px;text-align: center;white-space: pre;text-overflow: ellipsis;position: relative;flex-shrink: 0;" />
|
<div
|
||||||
|
style="width: 60px;height: 1px;line-height: 1px;text-align: center;white-space: pre;text-overflow: ellipsis;position: relative;flex-shrink: 0;"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<!-- 视图复用 end -->
|
<!-- 视图复用 end -->
|
||||||
</div>
|
</div>
|
||||||
@ -141,12 +191,26 @@
|
|||||||
class="this_mobile_canvas_main"
|
class="this_mobile_canvas_main"
|
||||||
:style="mobileCanvasStyle"
|
:style="mobileCanvasStyle"
|
||||||
>
|
>
|
||||||
<Editor v-if="mobileEditorShow" id="editorMobile" ref="editorMobile" :matrix-count="mobileMatrixCount" :out-style="outStyle" :scroll-top="scrollTop" @canvasDragging="canvasDragging" />
|
<Editor
|
||||||
|
v-if="mobileEditorShow"
|
||||||
|
id="editorMobile"
|
||||||
|
ref="editorMobile"
|
||||||
|
:matrix-count="mobileMatrixCount"
|
||||||
|
:out-style="outStyle"
|
||||||
|
:scroll-top="scrollTop"
|
||||||
|
@canvasDragging="canvasDragging"
|
||||||
|
/>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row class="this_mobile_canvas_inner_bottom">
|
<el-row class="this_mobile_canvas_inner_bottom">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<i v-if="!hasStar" class="el-icon-star-off" size="mini" @click="star" />
|
<i v-if="!hasStar" class="el-icon-star-off" size="mini" @click="star" />
|
||||||
<i v-if="hasStar" class="el-icon-star-on" style="color: #0a7be0;font-size: 18px" size="mini" @click="unstar" />
|
<i
|
||||||
|
v-if="hasStar"
|
||||||
|
class="el-icon-star-on"
|
||||||
|
style="color: #0a7be0;font-size: 18px"
|
||||||
|
size="mini"
|
||||||
|
@click="unstar"
|
||||||
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12" style="float: right">
|
<el-col :span="12" style="float: right">
|
||||||
<i class="el-icon-refresh-right" size="mini" @click="mobileRefresh" />
|
<i class="el-icon-refresh-right" size="mini" @click="mobileRefresh" />
|
||||||
@ -160,6 +224,24 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</de-main-container>
|
</de-main-container>
|
||||||
|
|
||||||
|
<div v-show="!this.mobileLayoutStatus&&this.rightDrawOpen" class="tools-window-main">
|
||||||
|
<div v-show="showViewToolsAside">
|
||||||
|
<chart-edit v-if="this.curComponent" ref="chartEditRef" :edit-from="'panel'" :param="chartEditParam" />
|
||||||
|
</div>
|
||||||
|
<div v-if="!showViewToolsAside">
|
||||||
|
<el-row style="height: 40px">
|
||||||
|
<el-tooltip :content="$t('chart.draw_back')">
|
||||||
|
<el-button class="el-icon-d-arrow-right" style="position:absolute;left: 4px;top: 5px;" size="mini" circle @click="changeRightDrawOpen(false)" />
|
||||||
|
</el-tooltip>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<div class="view-selected-message-class">
|
||||||
|
<span style="font-size: 14px;margin-left: 10px;font-weight: bold;line-height: 20px">{{$t('panel.select_view')}}</span>
|
||||||
|
</div>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</de-container>
|
</de-container>
|
||||||
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
@ -202,9 +284,21 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<fullscreen style="height: 100%;background: #f7f8fa;overflow-y: auto" :fullscreen.sync="previewVisible">
|
<fullscreen style="height: 100%;background: #f7f8fa;overflow-y: auto" :fullscreen.sync="previewVisible">
|
||||||
<Preview v-if="previewVisible" :in-screen="!previewVisible" :show-type="canvasStyleData.selfAdaption?'full':'width'" />
|
<Preview
|
||||||
|
v-if="previewVisible"
|
||||||
|
:in-screen="!previewVisible"
|
||||||
|
:show-type="canvasStyleData.selfAdaption?'full':'width'"
|
||||||
|
/>
|
||||||
</fullscreen>
|
</fullscreen>
|
||||||
<input id="input" ref="files" type="file" accept="image/*" hidden @click="e => {e.target.value = '';}" @change="handleFileChange">
|
<input
|
||||||
|
id="input"
|
||||||
|
ref="files"
|
||||||
|
type="file"
|
||||||
|
accept="image/*"
|
||||||
|
hidden
|
||||||
|
@click="e => {e.target.value = '';}"
|
||||||
|
@change="handleFileChange"
|
||||||
|
>
|
||||||
|
|
||||||
<!--矩形样式组件-->
|
<!--矩形样式组件-->
|
||||||
<TextAttr v-if="showAttr" :scroll-left="scrollLeft" :scroll-top="scrollTop" />
|
<TextAttr v-if="showAttr" :scroll-left="scrollLeft" :scroll-top="scrollTop" />
|
||||||
@ -240,7 +334,7 @@ import componentList, {
|
|||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
import { uuid } from 'vue-uuid'
|
import { uuid } from 'vue-uuid'
|
||||||
import Toolbar from '@/components/canvas/components/Toolbar'
|
import Toolbar from '@/components/canvas/components/Toolbar'
|
||||||
import { initPanelData } from '@/api/panel/panel'
|
import { initPanelComponentsData, initPanelData, initViewCache } from '@/api/panel/panel'
|
||||||
import Preview from '@/components/canvas/components/Editor/Preview'
|
import Preview from '@/components/canvas/components/Editor/Preview'
|
||||||
import AttrListExtend from '@/components/canvas/components/AttrListExtend'
|
import AttrListExtend from '@/components/canvas/components/AttrListExtend'
|
||||||
import elementResizeDetectorMaker from 'element-resize-detector'
|
import elementResizeDetectorMaker from 'element-resize-detector'
|
||||||
@ -259,6 +353,7 @@ import generateID from '@/components/canvas/utils/generateID'
|
|||||||
import TextAttr from '@/components/canvas/components/TextAttr'
|
import TextAttr from '@/components/canvas/components/TextAttr'
|
||||||
import ComponentWait from '@/views/panel/edit/ComponentWait'
|
import ComponentWait from '@/views/panel/edit/ComponentWait'
|
||||||
import { deleteEnshrine, saveEnshrine, starStatus } from '@/api/panel/enshrine'
|
import { deleteEnshrine, saveEnshrine, starStatus } from '@/api/panel/enshrine'
|
||||||
|
import ChartEdit from '@/views/chart/view/ChartEdit'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'PanelEdit',
|
name: 'PanelEdit',
|
||||||
@ -278,7 +373,8 @@ export default {
|
|||||||
AssistComponent,
|
AssistComponent,
|
||||||
PanelTextEditor,
|
PanelTextEditor,
|
||||||
TextAttr,
|
TextAttr,
|
||||||
ChartGroup
|
ChartGroup,
|
||||||
|
ChartEdit
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -332,15 +428,29 @@ export default {
|
|||||||
'de-video'
|
'de-video'
|
||||||
],
|
],
|
||||||
enableSureButton: false,
|
enableSureButton: false,
|
||||||
filterFromDrag: false
|
filterFromDrag: false,
|
||||||
|
activeToolsName: 'view',
|
||||||
|
rightDrawOpen: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
// 侧边显示控制
|
||||||
|
chartEditParam() {
|
||||||
|
return this.curComponent ? { 'id': this.curComponent.propValue.viewId, 'optType': 'edit' } : {}
|
||||||
|
},
|
||||||
// 侧边显示控制
|
// 侧边显示控制
|
||||||
showAside() {
|
showAside() {
|
||||||
return !this.linkageSettingStatus && !this.mobileLayoutStatus
|
return !this.linkageSettingStatus && !this.mobileLayoutStatus
|
||||||
},
|
},
|
||||||
|
// 显示仪表板工具栏
|
||||||
|
showPanelToolsAside() {
|
||||||
|
return !this.curComponent
|
||||||
|
},
|
||||||
|
// 显示视图工具栏
|
||||||
|
showViewToolsAside() {
|
||||||
|
return this.curComponent && this.curComponent.type === 'view'
|
||||||
|
},
|
||||||
showAttr() {
|
showAttr() {
|
||||||
if (this.mobileLayoutStatus) {
|
if (this.mobileLayoutStatus) {
|
||||||
return false
|
return false
|
||||||
@ -449,6 +559,7 @@ export default {
|
|||||||
|
|
||||||
this.$store.commit('setCurComponent', { component: null, index: null })
|
this.$store.commit('setCurComponent', { component: null, index: null })
|
||||||
this.$store.commit('clearLinkageSettingInfo', false)
|
this.$store.commit('clearLinkageSettingInfo', false)
|
||||||
|
this.$store.commit('resetViewEditInfo')
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// this.insertToBody()
|
// this.insertToBody()
|
||||||
@ -466,6 +577,10 @@ export default {
|
|||||||
bus.$on('previewFullScreenClose', () => {
|
bus.$on('previewFullScreenClose', () => {
|
||||||
this.previewVisible = false
|
this.previewVisible = false
|
||||||
})
|
})
|
||||||
|
|
||||||
|
bus.$on('change_panel_right_draw', (param) => {
|
||||||
|
this.changeRightDrawOpen(param)
|
||||||
|
})
|
||||||
const _this = this
|
const _this = this
|
||||||
const erd = elementResizeDetectorMaker()
|
const erd = elementResizeDetectorMaker()
|
||||||
// 监听div变动事件
|
// 监听div变动事件
|
||||||
@ -480,6 +595,14 @@ export default {
|
|||||||
elx && elx.remove()
|
elx && elx.remove()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
changeRightDrawOpen(param) {
|
||||||
|
this.rightDrawOpen = param
|
||||||
|
if (this.rightDrawOpen) {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.outStyle.width = this.outStyle.width + 0.000001
|
||||||
|
}, 0)
|
||||||
|
}
|
||||||
|
},
|
||||||
init(panelId) {
|
init(panelId) {
|
||||||
const _this = this
|
const _this = this
|
||||||
_this.initHasStar()
|
_this.initHasStar()
|
||||||
@ -493,7 +616,12 @@ export default {
|
|||||||
_this.$store.dispatch('panel/setCanvasStyleDataTemp', null)
|
_this.$store.dispatch('panel/setCanvasStyleDataTemp', null)
|
||||||
} else if (panelId) {
|
} else if (panelId) {
|
||||||
initPanelData(panelId, function() {
|
initPanelData(panelId, function() {
|
||||||
_this.$store.commit('recordSnapshot', 'init')// 记录快照
|
// 初始化视图缓存
|
||||||
|
initViewCache(panelId)
|
||||||
|
// initPanelComponentsData(panelId, function(rsp) {
|
||||||
|
// _this.$store.commit('initPanelComponents', rsp)// 初始化仪表板组件视图数据
|
||||||
|
// _this.$store.commit('recordSnapshot', 'init')// 记录快照
|
||||||
|
// })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -854,7 +982,10 @@ export default {
|
|||||||
if (this.curComponent.type === 'view') {
|
if (this.curComponent.type === 'view') {
|
||||||
this.$store.dispatch('chart/setViewId', null)
|
this.$store.dispatch('chart/setViewId', null)
|
||||||
this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId)
|
this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId)
|
||||||
bus.$emit('PanelSwitchComponent', { name: 'ChartEdit', param: { 'id': this.curComponent.propValue.viewId, 'optType': 'edit' }})
|
bus.$emit('PanelSwitchComponent', {
|
||||||
|
name: 'ChartEdit',
|
||||||
|
param: { 'id': this.curComponent.propValue.viewId, 'optType': 'edit' }
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
canvasScroll(event) {
|
canvasScroll(event) {
|
||||||
@ -934,6 +1065,7 @@ export default {
|
|||||||
border-bottom: 1px solid #E6E6E6;
|
border-bottom: 1px solid #E6E6E6;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.blackTheme .de-header {
|
.blackTheme .de-header {
|
||||||
background-color: var(--SiderBG) !important;
|
background-color: var(--SiderBG) !important;
|
||||||
color: var(--TextActive);
|
color: var(--TextActive);
|
||||||
@ -1048,6 +1180,7 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.this_mobile_canvas_wait_cell {
|
.this_mobile_canvas_wait_cell {
|
||||||
background-size: 100% 100% !important;
|
background-size: 100% 100% !important;
|
||||||
border: 2px solid #9ea6b2
|
border: 2px solid #9ea6b2
|
||||||
@ -1060,6 +1193,7 @@ export default {
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
background-size: 100% 100% !important;
|
background-size: 100% 100% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-main {
|
.el-main {
|
||||||
height: calc(100vh - 35px);
|
height: calc(100vh - 35px);
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
@ -1070,9 +1204,11 @@ export default {
|
|||||||
.el-main ::v-deep .el-drawer__wrapper {
|
.el-main ::v-deep .el-drawer__wrapper {
|
||||||
width: 310px !important;
|
width: 310px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-main ::v-deep .el-drawer__body {
|
.el-main ::v-deep .el-drawer__body {
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-show {
|
.button-show {
|
||||||
background-color: var(--ContentBG, #ebf2fe) !important;
|
background-color: var(--ContentBG, #ebf2fe) !important;
|
||||||
}
|
}
|
||||||
@ -1080,6 +1216,7 @@ export default {
|
|||||||
.button-closed {
|
.button-closed {
|
||||||
background-color: var(--SiderBG, #ffffff) !important;
|
background-color: var(--SiderBG, #ffffff) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.style-aside {
|
.style-aside {
|
||||||
width: 250px;
|
width: 250px;
|
||||||
max-width: 250px !important;
|
max-width: 250px !important;
|
||||||
@ -1088,10 +1225,12 @@ export default {
|
|||||||
transition: all 0.3s;
|
transition: all 0.3s;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.placeholder {
|
.placeholder {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: gray;
|
color: gray;
|
||||||
}
|
}
|
||||||
|
|
||||||
.show {
|
.show {
|
||||||
transform: translateX(0);
|
transform: translateX(0);
|
||||||
}
|
}
|
||||||
@ -1111,16 +1250,20 @@ export default {
|
|||||||
top: 15px !important;
|
top: 15px !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-dialog__body {
|
.el-dialog__body {
|
||||||
padding: 1px 15px !important;
|
padding: 1px 15px !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.style-hidden {
|
.style-hidden {
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-text {
|
.button-text {
|
||||||
color: var(--TextActive);
|
color: var(--TextActive);
|
||||||
}
|
}
|
||||||
|
|
||||||
.mobile-canvas {
|
.mobile-canvas {
|
||||||
width: 300px;
|
width: 300px;
|
||||||
height: 600px;
|
height: 600px;
|
||||||
@ -1142,4 +1285,30 @@ export default {
|
|||||||
height: 2px !important;
|
height: 2px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tools-window-main {
|
||||||
|
width: 300px;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
transition: 1s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tools-window-tabs {
|
||||||
|
height: calc(100vh - 100px);
|
||||||
|
overflow: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
> > > .el-tabs__item {
|
||||||
|
padding: 0 15px;
|
||||||
|
}
|
||||||
|
.view-selected-message-class {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #9ea6b2;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: calc(100vh - 100px);
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user