Merge branch 'dev' of github.com:dataease/dataease into dev

This commit is contained in:
taojinlong 2022-12-21 20:01:28 +08:00
commit dd05399e47
47 changed files with 1357 additions and 652 deletions

View File

@ -1,6 +1,5 @@
package io.dataease.auth.filter;
import cn.hutool.core.util.URLUtil;
import com.auth0.jwt.algorithms.Algorithm;
import io.dataease.auth.entity.ASKToken;
import io.dataease.auth.entity.JWTToken;
@ -24,10 +23,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.nio.charset.Charset;
public class JWTFilter extends BasicHttpAuthenticationFilter {
@ -161,18 +158,4 @@ public class JWTFilter extends BasicHttpAuthenticationFilter {
httpServletResponse.setHeader("authentication-status", "login_expire");
}
@Override
protected boolean onAccessDenied(ServletRequest req, ServletResponse res, Object mappedValue) throws Exception {
HttpServletResponse response = (HttpServletResponse) res;
HttpServletRequest request = (HttpServletRequest) req;
String requestURI = request.getRequestURI();
String msg = requestURI + " has been denied";
String encode = URLUtil.encode(msg, Charset.forName("UTF-8"));
Cookie cookie_error = new Cookie("onAccessDeniedMsg", encode);
cookie_error.setPath("/");
response.addCookie(cookie_error);
response.sendRedirect("/");
return false;
}
}

View File

@ -14,6 +14,7 @@ import io.dataease.dto.PermissionProxy;
import io.dataease.dto.authModel.VAuthModelDTO;
import io.dataease.dto.panel.PanelExport2App;
import io.dataease.dto.panel.PanelGroupDTO;
import io.dataease.plugins.common.base.domain.PanelGroup;
import io.dataease.service.panel.PanelGroupService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -50,6 +51,12 @@ public class PanelGroupController {
return panelGroupService.tree(request);
}
@ApiOperation("查询当前用户仪表板")
@GetMapping("/list")
public List<PanelGroup> list() {
return panelGroupService.list();
}
@ApiOperation("默认树")
@PostMapping("/defaultTree")
public List<PanelGroupDTO> defaultTree(@RequestBody PanelGroupRequest request) {

View File

@ -0,0 +1,53 @@
package io.dataease.controller.sys;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.dataease.auth.annotation.DePermission;
import io.dataease.commons.constants.DePermissionType;
import io.dataease.commons.constants.ResourceAuthLevel;
import io.dataease.commons.utils.AuthUtils;
import io.dataease.dto.RelationDTO;
import io.dataease.service.sys.RelationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* @author WiSoniC
* @date 2022年12月8日15:01:05
*/
@Api(tags = "系统:血缘关系")
@ApiSupport(order = 230)
@RequestMapping("/api/relation")
@RestController
public class RelationController {
@Resource
private RelationService relationService;
@DePermission(type = DePermissionType.DATASOURCE, level = ResourceAuthLevel.DATASOURCE_LEVEL_USE,value = "datasourceId")
@ApiOperation("获取指定数据库的血源关系")
@GetMapping("/datasource/{datasourceId}")
public List<RelationDTO> getRelationForDatasource(@PathVariable String datasourceId) {
Long userId = AuthUtils.getUser().getUserId();
return relationService.getRelationForDatasource(datasourceId, userId);
}
@DePermission(type = DePermissionType.DATASET, level = ResourceAuthLevel.DATASET_LEVEL_USE,value = "datasetId")
@ApiOperation("获取指定数据集的血缘关系")
@GetMapping("/dataset/{datasetId}")
public RelationDTO getRelationForDataset(@PathVariable String datasetId) {
Long userId = AuthUtils.getUser().getUserId();
return relationService.getRelationForDataset(datasetId, userId);
}
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANEL_LEVEL_VIEW,value = "panelId")
@ApiOperation("获取指定仪表板的血源关系")
@GetMapping("/panel/{panelId}")
public List<RelationDTO> getRelationForPanel(@PathVariable String panelId) {
Long userId = AuthUtils.getUser().getUserId();
return relationService.getRelationForPanel(panelId, userId);
}
}

View File

@ -0,0 +1,26 @@
package io.dataease.dto;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author WiSoniC
* @date 2022年12月8日18:53:10
*/
@Data
public class RelationDTO {
@ApiModelProperty("ID")
private String id;
@ApiModelProperty("名称")
private String name;
@ApiModelProperty("权限信息")
private String auths;
@ApiModelProperty("类型")
private String type;
@ApiModelProperty("被引用信息")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<RelationDTO> subRelation;
}

View File

@ -8,14 +8,11 @@
<result column="privileges" property="privileges"/>
</resultMap>
<select id ="findByPanelId" resultMap="BaseResultMapDTO">
SELECT
chart_view.*
FROM
chart_view
LEFT JOIN panel_view ON chart_view.id = panel_view.chart_view_id
WHERE
panel_view.panel_id = #{panelId}
<select id="findByPanelId" resultMap="BaseResultMapDTO">
SELECT chart_view.*
FROM chart_view
LEFT JOIN panel_view ON chart_view.id = panel_view.chart_view_id
WHERE panel_view.panel_id = #{panelId}
</select>
<select id="searchOneWithPrivileges" resultMap="BaseResultMapDTO">
@ -25,198 +22,210 @@
</select>
<select id="searchOne" resultMap="BaseResultMapDTO">
select
chart_view.*
from chart_view where id = #{id}
select chart_view.*
from chart_view
where id = #{id}
</select>
<insert id="copyToCache">
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,
senior,
SNAPSHOT,
data_from
) SELECT
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,
senior,
SNAPSHOT,
data_from from chart_view
WHERE
chart_view.id = #{id}
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,
senior,
SNAPSHOT,
data_from,
refresh_view_enable,
refresh_unit,
refresh_time)
SELECT 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,
senior,
SNAPSHOT,
data_from,
refresh_view_enable,
refresh_unit,
refresh_time
from chart_view
WHERE chart_view.id = #{id}
</insert>
<insert id="copyCache">
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,
senior,
SNAPSHOT,
data_from
) SELECT
#{newViewId} as 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,
senior,
SNAPSHOT,
data_from from chart_view_cache
WHERE
chart_view_cache.id = #{sourceViewId}
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,
senior,
SNAPSHOT,
data_from,
refresh_view_enable,
refresh_unit,
refresh_time)
SELECT #{newViewId} as 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,
senior,
SNAPSHOT,
data_from,
refresh_view_enable,
refresh_unit,
refresh_time
from chart_view_cache
WHERE chart_view_cache.id = #{sourceViewId}
</insert>
<insert id="initPanelChartViewCache">
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,
senior,
SNAPSHOT,
data_from
) SELECT
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,
senior,
SNAPSHOT,
data_from from chart_view
WHERE
chart_view.scene_id = #{panelId}
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,
senior,
SNAPSHOT,
data_from,
refresh_view_enable,
refresh_unit,
refresh_time)
SELECT 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,
senior,
SNAPSHOT,
data_from,
refresh_view_enable,
refresh_unit,
refresh_time
from chart_view
WHERE chart_view.scene_id = #{panelId}
</insert>
<select id="search" resultMap="BaseResultMapDTO">
@ -299,11 +308,11 @@
`senior`,
`data_from`)
SELECT #{newChartId},
GET_CHART_VIEW_COPY_NAME(#{oldChartId},#{panelId}) as `name`,
GET_CHART_VIEW_COPY_NAME(#{oldChartId}, #{panelId}) as `name`,
#{panelId},
`table_id`,
`type`,
GET_CHART_VIEW_COPY_NAME(#{oldChartId},#{panelId}) as `title`,
GET_CHART_VIEW_COPY_NAME(#{oldChartId}, #{panelId}) as `title`,
`x_axis`,
`x_axis_ext`,
`y_axis`,
@ -312,8 +321,8 @@
`custom_filter`,
`drill_fields`,
`create_by`,
unix_timestamp()*1000 as `create_time`,
unix_timestamp()*1000 as `update_time`,
unix_timestamp() * 1000 as `create_time`,
unix_timestamp() * 1000 as `update_time`,
`snapshot`,
`style_priority`,
`ext_stack`,
@ -405,13 +414,11 @@
SNAPSHOT,
senior,
data_from
FROM (
SELECT panel_id,
copy_from_view,
chart_view_id
FROM panel_view
WHERE copy_id = #{copyId}
) pv_copy
FROM (SELECT panel_id,
copy_from_view,
chart_view_id
FROM panel_view
WHERE copy_id = #{copyId}) pv_copy
INNER JOIN chart_view ON chart_view.id = pv_copy.copy_from_view
</insert>
@ -459,16 +466,11 @@
<select id="searchViewsWithPanelId" resultMap="BaseResultMapDTO">
SELECT * FROM chart_view
WHERE
id IN (
SELECT
chart_view_id
FROM
panel_view
WHERE
panel_id = #{panelId}
)
SELECT *
FROM chart_view
WHERE id IN (SELECT chart_view_id
FROM panel_view
WHERE panel_id = #{panelId})
</select>
<delete id="deleteCacheWithPanel">
@ -480,10 +482,12 @@
#{viewId}
</foreach>
</if>
</delete>
</delete>
<delete id="deleteViewCache">
delete from chart_view_cache where id = #{viewId}
</delete>
delete
from chart_view_cache
where id = #{viewId}
</delete>
<update id="copyCacheToView">
UPDATE chart_view cv,
@ -514,7 +518,10 @@
cv.drill_fields = cve.drill_fields,
cv.senior = cve.senior,
cv.SNAPSHOT = cve.SNAPSHOT,
cv.data_from = cve.data_from
cv.data_from = cve.data_from,
cv.refresh_view_enable = cve.refresh_view_enable,
cv.refresh_unit = cve.refresh_unit,
cv.refresh_time = cve.refresh_time
where cve.id = cv.id and cv.id in
<foreach collection="viewIds" item="viewId" open='(' separator=',' close=')'>
#{viewId}
@ -523,69 +530,75 @@
<update id="updateToCache">
UPDATE chart_view_cache cv,
chart_view cve
chart_view 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.senior = cve.senior,
cv.SNAPSHOT = cve.SNAPSHOT,
cv.data_from = cve.data_from
where cve.id = cv.id and cv.id =#{viewId}
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.senior = cve.senior,
cv.SNAPSHOT = cve.SNAPSHOT,
cv.data_from = cve.data_from,
cv.refresh_view_enable = cve.refresh_view_enable,
cv.refresh_unit = cve.refresh_unit,
cv.refresh_time = cve.refresh_time
where cve.id = cv.id and cv.id =#{viewId}
</update>
<update id="updateToViewFromCache">
UPDATE chart_view_cache cve,
chart_view cv
chart_view cv
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.senior = cve.senior,
cv.SNAPSHOT = cve.SNAPSHOT,
cv.data_from = cve.data_from
where cve.id = cv.id and cv.id =#{viewId}
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.senior = cve.senior,
cv.SNAPSHOT = cve.SNAPSHOT,
cv.data_from = cve.data_from,
cv.refresh_view_enable = cve.refresh_view_enable,
cv.refresh_unit = cve.refresh_unit,
cv.refresh_time = cve.refresh_time
where cve.id = cv.id and cv.id =#{viewId}
</update>
<delete id="deleteNoUseView">
@ -600,55 +613,49 @@
</delete>
<select id="chartOptions" resultType="io.dataease.dto.chart.ViewOption">
select id, title as name from chart_view where scene_id = #{panelId}
select id, title as name
from chart_view
where scene_id = #{panelId}
</select>
<insert id='chartFiledCopyWithPanel'>
INSERT INTO chart_view_field (
id,
table_id,
chart_id,
origin_name,
`name`,
dataease_name,
group_type,
`type`,
`size`,
de_type,
de_type_format,
de_extract_type,
ext_field,
`checked`,
column_index,
last_sync_time
) SELECT
uuid() AS id,
chart_view_field.table_id,
chart_view_field.pv_copy.chart_view_id AS chart_id,
chart_view_field.origin_name,
chart_view_field.`name`,
chart_view_field.dataease_name,
chart_view_field.group_type,
chart_view_field.`type`,
chart_view_field.`size`,
chart_view_field.de_type,
chart_view_field.de_type_format,
chart_view_field.de_extract_type,
chart_view_field.ext_field,
chart_view_field.`checked`,
chart_view_field.column_index,
chart_view_field.last_sync_time
FROM
(
SELECT
panel_id,
copy_from_view,
chart_view_id
FROM
panel_view
WHERE
copy_id = #{copyId}
) pv_copy
INNER JOIN chart_view_field ON chart_view_field.chart_id = pv_copy.copy_from_view
INSERT INTO chart_view_field (id,
table_id,
chart_id,
origin_name,
`name`,
dataease_name,
group_type,
`type`,
`size`,
de_type,
de_type_format,
de_extract_type,
ext_field,
`checked`,
column_index,
last_sync_time)
SELECT uuid() AS id,
chart_view_field.table_id,
chart_view_field.pv_copy.chart_view_id AS chart_id,
chart_view_field.origin_name,
chart_view_field.`name`,
chart_view_field.dataease_name,
chart_view_field.group_type,
chart_view_field.`type`,
chart_view_field.`size`,
chart_view_field.de_type,
chart_view_field.de_type_format,
chart_view_field.de_extract_type,
chart_view_field.ext_field,
chart_view_field.`checked`,
chart_view_field.column_index,
chart_view_field.last_sync_time
FROM (SELECT panel_id,
copy_from_view,
chart_view_id
FROM panel_view
WHERE copy_id = #{copyId}) pv_copy
INNER JOIN chart_view_field ON chart_view_field.chart_id = pv_copy.copy_from_view
</insert>
</mapper>

View File

@ -1,6 +1,7 @@
package io.dataease.ext;
import io.dataease.controller.request.dataset.DataSetTableRequest;
import io.dataease.dto.RelationDTO;
import io.dataease.dto.dataset.DataSetTableDTO;
import io.dataease.plugins.common.base.domain.DatasetTable;
import org.apache.ibatis.annotations.Param;
@ -20,4 +21,6 @@ public interface ExtDataSetTableMapper {
List<DatasetTable> findByTableIds(@Param("tableIds") List<String> tableIds);
RelationDTO queryDatasetRelation(@Param("datasetId") String datasetId, @Param("userId")Long userId);
}

View File

@ -156,4 +156,84 @@
#{item}
</foreach>
</select>
<select id="queryDatasetRelation" resultType="io.dataease.dto.RelationDTO" resultMap="io.dataease.ext.ExtDataSourceMapper.RelationResultMap">
select
dt.id,
dt.name,
dt_auth.auths,
'dataset' `type`,
pg.id panel_id,
pg.name panel_name,
pg_auth.auths panel_auths,
if(pg.id is not null,'panel',null) pg_type
from
dataset_table dt
left join
(
select
t_dt.id,group_concat(distinct sad.privilege_type) auths
from
dataset_table t_dt
left join sys_auth sa on sa.auth_source = t_dt.id
left join sys_auth_detail sad on sa.id = sad.auth_id
where
sa.auth_source = #{datasetId,jdbcType=VARCHAR}
and
sad.privilege_value = 1
and
(
(
sa.auth_target_type = 'dept'
AND sa.auth_target in ( SELECT dept_id FROM sys_user WHERE user_id = #{userId,jdbcType=BIGINT} )
)
or
(
sa.auth_target_type = 'user'
AND sa.auth_target = #{userId,jdbcType=BIGINT}
)
or
(
sa.auth_target_type = 'role'
AND sa.auth_target in ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId,jdbcType=BIGINT} )
)
)
group by sa.auth_source
) dt_auth on dt.id = dt_auth.id
left join chart_view cv on cv.table_id = dt.id
left join panel_group pg on cv.scene_id = pg.id
left join
(
select
t_pg.id,group_concat(distinct sad.privilege_type) auths
from
panel_group t_pg
left join sys_auth sa on sa.auth_source = t_pg.id
left join sys_auth_detail sad on sa.id = sad.auth_id
where
sa.auth_source_type = 'panel'
and
sad.privilege_value = 1
and
(
(
sa.auth_target_type = 'dept'
AND sa.auth_target in ( SELECT dept_id FROM sys_user WHERE user_id = #{userId,jdbcType=BIGINT} )
)
OR
(
sa.auth_target_type = 'user'
AND sa.auth_target = #{userId,jdbcType=BIGINT}
)
OR
(
sa.auth_target_type = 'role'
AND sa.auth_target in ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId,jdbcType=BIGINT} )
)
)
group by sa.auth_source
) pg_auth on pg_auth.id = pg.id
where dt.id=#{datasetId,jdbcType=VARCHAR}
order by id
</select>
</mapper>

View File

@ -1,6 +1,7 @@
package io.dataease.ext;
import io.dataease.controller.request.DatasourceUnionRequest;
import io.dataease.dto.RelationDTO;
import io.dataease.dto.DatasourceDTO;
import io.dataease.ext.query.GridExample;
import org.apache.ibatis.annotations.Param;
@ -19,5 +20,5 @@ public interface ExtDataSourceMapper {
DatasourceDTO queryDetails(@Param("datasourceId") String datasourceId, @Param("userId") String userId);
List<RelationDTO> queryDatasourceRelation(@Param("datasourceId") String datasourceId, @Param("userId")Long userId);
}

View File

@ -6,6 +6,17 @@
extends="io.dataease.plugins.common.base.mapper.DatasourceMapper.ResultMapWithBLOBs">
<result column="privileges" property="privileges"/>
</resultMap>
<resultMap id="RelationResultMap" type="io.dataease.dto.RelationDTO">
<id column="id" property="id"/>
<result column="name" property="name"/>
<result column="auths" property="auths"/>
<collection property="subRelation" ofType="io.dataease.dto.RelationDTO">
<id column="panel_id" property="id"/>
<result column="panel_name" property="name"/>
<result column="panel_auths" property="auths"/>
<result column="pg_type" property="type"/>
</collection>
</resultMap>
<select id="query" parameterType="io.dataease.ext.query.GridExample" resultMap="BaseResultMapDTO">
select datasource.*,
@ -150,5 +161,84 @@
where id = #{datasourceId}
</select>
<select id="queryDatasourceRelation" resultType="io.dataease.dto.RelationDTO" resultMap="RelationResultMap">
select
dt.id,
dt.name,
dt_auth.auths,
'dataset' `type`,
pg.id panel_id,
pg.name panel_name,
pg_auth.auths panel_auths,
if(pg.id is not null,'panel',null) pg_type
from
datasource ds
join dataset_table dt on dt.data_source_id = ds.id
left join
(
select
t_dt.id,group_concat(distinct sad.privilege_type) auths
from
dataset_table t_dt
left join sys_auth sa on sa.auth_source = t_dt.id
left join sys_auth_detail sad on sa.id = sad.auth_id
where
sa.auth_source_type = 'dataset'
and
sad.privilege_value = 1
and
(
(
sa.auth_target_type = 'dept'
AND sa.auth_target in ( SELECT dept_id FROM sys_user WHERE user_id = #{userId,jdbcType=BIGINT} )
)
or
(
sa.auth_target_type = 'user'
AND sa.auth_target = #{userId,jdbcType=BIGINT}
)
or
(
sa.auth_target_type = 'role'
AND sa.auth_target in ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId,jdbcType=BIGINT} )
)
)
group by sa.auth_source
) dt_auth on dt.id = dt_auth.id
left join chart_view cv on cv.table_id = dt.id
left join panel_group pg on cv.scene_id = pg.id
left join
(
select
t_pg.id,group_concat(distinct sad.privilege_type) auths
from
panel_group t_pg
left join sys_auth sa on sa.auth_source = t_pg.id
left join sys_auth_detail sad on sa.id = sad.auth_id
where
sa.auth_source_type = 'panel'
and
sad.privilege_value = 1
and
(
(
sa.auth_target_type = 'dept'
AND sa.auth_target in ( SELECT dept_id FROM sys_user WHERE user_id = #{userId,jdbcType=BIGINT} )
)
OR
(
sa.auth_target_type = 'user'
AND sa.auth_target = #{userId,jdbcType=BIGINT}
)
OR
(
sa.auth_target_type = 'role'
AND sa.auth_target in ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId,jdbcType=BIGINT} )
)
)
group by sa.auth_source
) pg_auth on pg_auth.id = pg.id
where ds.id=#{datasourceId,jdbcType=VARCHAR}
order by id
</select>
</mapper>

View File

@ -1,7 +1,9 @@
package io.dataease.ext;
import io.dataease.controller.request.panel.PanelGroupRequest;
import io.dataease.dto.RelationDTO;
import io.dataease.dto.panel.PanelGroupDTO;
import io.dataease.plugins.common.base.domain.PanelGroup;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -28,6 +30,7 @@ public interface ExtPanelGroupMapper {
List<PanelGroupDTO> panelGroupInit();
List<RelationDTO> queryPanelRelation(@Param("panelId") String panelId, @Param("userId") Long userId);
List<PanelGroup> listPanelByUser(@Param("userId") long userId);
}

View File

@ -14,6 +14,18 @@
<result column="is_default" property="isDefault"/>
</resultMap>
<resultMap id="RelationResultMap" type="io.dataease.dto.RelationDTO">
<id column="id" property="id"/>
<result column="name" property="name"/>
<result column="auths" property="auths"/>
<collection property="subRelation" ofType="io.dataease.dto.RelationDTO">
<id column="dt_id" property="id"/>
<result column="dt_name" property="name"/>
<result column="dt_auths" property="auths"/>
<result column="dt_type" property="type"/>
</collection>
</resultMap>
<select id="findOneWithPrivileges" resultMap="BaseResultMapDTO">
select panel_group.*,
panel_group.name as label,
@ -226,4 +238,120 @@
</delete>
<select id="queryPanelRelation" resultType="io.dataease.dto.RelationDTO" resultMap="RelationResultMap">
select
ds.id,
ds.name,
ds_auth.auths,
'link' `type`,
dt.id dt_id,
dt.name dt_name,
dt_auth.auths dt_auths,
if(dt.id is not null,'dataset',null) dt_type
from
panel_group pg
join
chart_view cv on cv.scene_id = pg.id
join
dataset_table dt on cv.table_id = dt.id
left join
(
select
t_dt.id,group_concat(distinct sad.privilege_type) auths
from
dataset_table t_dt
left join sys_auth sa on sa.auth_source = t_dt.id
left join sys_auth_detail sad on sa.id = sad.auth_id
where
sa.auth_source_type = 'dataset'
and
sad.privilege_value = 1
and
(
(
sa.auth_target_type = 'dept'
AND sa.auth_target in ( SELECT dept_id FROM sys_user WHERE user_id = #{userId,jdbcType=BIGINT} )
)
or
(
sa.auth_target_type = 'user'
AND sa.auth_target = #{userId,jdbcType=BIGINT}
)
or
(
sa.auth_target_type = 'role'
AND sa.auth_target in ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId,jdbcType=BIGINT} )
)
)
group by sa.auth_source
) dt_auth on dt.id = dt_auth.id
join datasource ds on dt.data_source_id = ds.id
left join
(
select
t_pg.id,group_concat(distinct sad.privilege_type) auths
from
panel_group t_pg
left join sys_auth sa on sa.auth_source = t_pg.id
left join sys_auth_detail sad on sa.id = sad.auth_id
where
sa.auth_source_type = 'link'
and
sad.privilege_value = 1
and
(
(
sa.auth_target_type = 'dept'
AND sa.auth_target in ( SELECT dept_id FROM sys_user WHERE user_id = #{userId,jdbcType=BIGINT} )
)
OR
(
sa.auth_target_type = 'user'
AND sa.auth_target = #{userId,jdbcType=BIGINT}
)
OR
(
sa.auth_target_type = 'role'
AND sa.auth_target in ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId,jdbcType=BIGINT} )
)
)
group by sa.auth_source
) ds_auth on ds_auth.id = ds.id
where pg.id=#{panelId,jdbcType=VARCHAR}
group by dt.id
</select>
<select id="listPanelByUser" resultType="io.dataease.plugins.common.base.domain.PanelGroup"
resultMap="io.dataease.plugins.common.base.mapper.PanelGroupMapper.BaseResultMap">
select
pg.*
from
panel_group pg
join sys_auth sa on sa.auth_source = pg.id
join sys_auth_detail sad on sa.id = sad.auth_id
where
pg.node_type = 'panel'
and
sa.auth_source_type = 'panel'
and
sad.privilege_value = 1
and
(
(
sa.auth_target_type = 'dept'
AND sa.auth_target in ( SELECT dept_id FROM sys_user WHERE user_id = #{userId,jdbcType=BIGINT} )
)
OR
(
sa.auth_target_type = 'user'
AND sa.auth_target = #{userId,jdbcType=BIGINT}
)
OR
(
sa.auth_target_type = 'role'
AND sa.auth_target in ( SELECT role_id FROM sys_users_roles WHERE user_id = #{userId,jdbcType=BIGINT} )
)
)
group by pg.id
</select>
</mapper>

View File

@ -279,6 +279,12 @@ public class ChartViewService {
if (result == null) {
DataEaseException.throwException(Translator.get("i18n_chart_delete"));
}
DatasetTable datasetTable = dataSetTableService.get(result.getTableId());
if (ObjectUtils.isNotEmpty(datasetTable)) {
result.setDatasetMode(datasetTable.getMode());
Datasource datasource = datasourceService.get(datasetTable.getDataSourceId());
result.setDatasourceType(datasource != null ? datasource.getType() : null);
}
return result;
} catch (Exception e) {
e.printStackTrace();
@ -645,13 +651,23 @@ public class ChartViewService {
// 直连明细表分页
Map<String, Object> mapAttr = gson.fromJson(view.getCustomAttr(), Map.class);
Map<String, Object> mapSize = (Map<String, Object>) mapAttr.get("size");
if (StringUtils.equalsIgnoreCase(view.getType(), "table-info") && table.getMode() == 0 && StringUtils.equalsIgnoreCase((String) mapSize.get("tablePageMode"), "page")) {
if (chartExtRequest.getGoPage() == null) {
chartExtRequest.setGoPage(1L);
}
if (chartExtRequest.getPageSize() == null) {
String pageSize = (String) mapSize.get("tablePageSize");
chartExtRequest.setPageSize(Long.parseLong(pageSize));
if (StringUtils.equalsIgnoreCase(view.getType(), "table-info") && table.getMode() == 0) {
if (StringUtils.equalsIgnoreCase((String) mapSize.get("tablePageMode"), "page")) {
if (chartExtRequest.getGoPage() == null) {
chartExtRequest.setGoPage(1L);
}
if (chartExtRequest.getPageSize() == null) {
String pageSize = (String) mapSize.get("tablePageSize");
chartExtRequest.setPageSize(Math.min(Long.parseLong(pageSize), view.getResultCount().longValue()));
}
} else {
if (StringUtils.equalsIgnoreCase(view.getResultMode(), "custom")) {
chartExtRequest.setGoPage(1L);
chartExtRequest.setPageSize(view.getResultCount().longValue());
} else {
chartExtRequest.setGoPage(null);
chartExtRequest.setPageSize(null);
}
}
} else {
chartExtRequest.setGoPage(null);
@ -910,7 +926,13 @@ public class ChartViewService {
String totalPageSql = null;
PageInfo pageInfo = new PageInfo();
pageInfo.setGoPage(chartExtRequest.getGoPage());
pageInfo.setPageSize(chartExtRequest.getPageSize());
if (StringUtils.equalsIgnoreCase(view.getResultMode(), "custom")) {
if (StringUtils.equalsIgnoreCase(view.getType(), "table-info") && table.getMode() == 0) {
pageInfo.setPageSize(Math.min(view.getResultCount() - (chartExtRequest.getGoPage() - 1) * chartExtRequest.getPageSize(), chartExtRequest.getPageSize()));
}
} else {
pageInfo.setPageSize(chartExtRequest.getPageSize());
}
List<ChartViewFieldDTO> detailFieldList = new ArrayList<>();
String detailFieldSql = null;

View File

@ -15,6 +15,9 @@ import java.util.*;
import java.util.stream.Collectors;
public class ChartDataBuild {
private final static String format = "(%s)";
// AntV
public static Map<String, Object> transChartDataAntV(List<ChartViewFieldDTO> xAxis, List<ChartViewFieldDTO> yAxis, ChartViewWithBLOBs view, List<String[]> data, boolean isDrill) {
Map<String, Object> map = new HashMap<>();
@ -969,7 +972,7 @@ public class ChartDataBuild {
Map<String, List<String[]>> groupDataList = detailData.stream().collect(Collectors.groupingBy(item -> ArrayUtil.join(ArrayUtil.sub(item, 0, xEndIndex), "-de-", "(", ")")));
tableRow.forEach(row -> {
String key = xAxis.stream().map(x -> row.get(x.getDataeaseName()).toString()).collect(Collectors.joining("-de-", "(", ")"));
String key = xAxis.stream().map(x -> String.format(format, row.get(x.getDataeaseName()).toString())).collect(Collectors.joining("-de-"));
List<String[]> detailFieldValueList = groupDataList.get(key);
List<Map<String, Object>> detailValueMapList = detailFieldValueList.stream().map((detailArr -> {
Map<String, Object> temp = new HashMap<>();

View File

@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import io.dataease.auth.annotation.DeCleaner;
import io.dataease.auth.api.dto.CurrentUserDto;
import io.dataease.commons.constants.*;
import io.dataease.commons.utils.*;
import io.dataease.controller.request.authModel.VAuthModelRequest;
@ -151,6 +152,17 @@ public class PanelGroupService {
return TreeUtils.mergeTree(panelGroupDTOList, "default_panel");
}
public List<PanelGroup> list() {
CurrentUserDto user = AuthUtils.getUser();
if (user.getIsAdmin()) {
PanelGroupExample example = new PanelGroupExample();
example.setOrderByClause("name");
example.createCriteria().andNodeTypeEqualTo("panel");
return panelGroupMapper.selectByExample(example);
}
return extPanelGroupMapper.listPanelByUser(user.getUserId());
}
@DeCleaner(value = DePermissionType.PANEL, key = "pid")
public String save(PanelGroupRequest request) {
checkPanelName(request.getName(), request.getPid(), PanelConstants.OPT_TYPE_INSERT, null, request.getNodeType());

View File

@ -0,0 +1,40 @@
package io.dataease.service.sys;
import io.dataease.dto.RelationDTO;
import io.dataease.ext.ExtDataSetTableMapper;
import io.dataease.ext.ExtDataSourceMapper;
import io.dataease.ext.ExtPanelGroupMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* @author WiSoniC
* @date 2022年12月8日15:17:17
*/
@Service
public class RelationService {
@Resource
private ExtDataSourceMapper extDataSourceMapper;
@Resource
private ExtDataSetTableMapper extDataSetTableMapper;
@Resource
private ExtPanelGroupMapper extPanelGroupMapper;
public List<RelationDTO> getRelationForDatasource(String datasourceId, Long userId) {
return extDataSourceMapper.queryDatasourceRelation(datasourceId, userId);
}
public RelationDTO getRelationForDataset(String datasetId, Long userId) {
return extDataSetTableMapper.queryDatasetRelation(datasetId, userId);
}
public List<RelationDTO> getRelationForPanel(String panelId, Long userId) {
return extPanelGroupMapper.queryPanelRelation(panelId, userId);
}
}

View File

@ -29,56 +29,56 @@ import java.util.stream.Collectors;
@Service
public class TemplateMarketService {
private final static String POSTS_API="/api/content/posts?page=0&size=2000";
private final static String CATEGORIES_API="/api/content/categories";
private final static String POSTS_API = "/api/content/posts?page=0&size=2000";
private final static String CATEGORIES_API = "/api/content/categories";
@Resource
private SystemParameterService systemParameterService;
/**
* @Description Get template file from template market
* @param templateUrl template url
* @Description Get template file from template market
*/
public PanelTemplateFileDTO getTemplateFromMarket(String templateUrl){
if(StringUtils.isNotEmpty(templateUrl)){
public PanelTemplateFileDTO getTemplateFromMarket(String templateUrl) {
if (StringUtils.isNotEmpty(templateUrl)) {
String sufUrl = systemParameterService.templateMarketInfo().getTemplateMarketUlr();
Gson gson = new Gson();
String templateInfo = HttpClientUtil.get(sufUrl+templateUrl,null);
String templateInfo = HttpClientUtil.get(sufUrl + templateUrl, null);
return gson.fromJson(templateInfo, PanelTemplateFileDTO.class);
}else{
} else {
return null;
}
}
/**
* @Description Get info from template market content api
* @param url content api url
* @Description Get info from template market content api
*/
public String marketGet(String url,String accessKey){
public String marketGet(String url, String accessKey) {
HttpClientConfig config = new HttpClientConfig();
config.addHeader("API-Authorization",accessKey);
return HttpClientUtil.get(url,config);
config.addHeader("API-Authorization", accessKey);
return HttpClientUtil.get(url, config);
}
public MarketBaseResponse searchTemplate(TemplateMarketSearchRequest request){
try{
public MarketBaseResponse searchTemplate(TemplateMarketSearchRequest request) {
try {
BasicInfo basicInfo = systemParameterService.templateMarketInfo();
String result = marketGet(basicInfo.getTemplateMarketUlr()+POSTS_API,basicInfo.getTemplateAccessKey());
List<TemplateMarketDTO> postsResult = JSONObject.parseObject(result).getJSONObject("data").getJSONArray("content").toJavaList(TemplateMarketDTO.class);
return new MarketBaseResponse(basicInfo.getTemplateMarketUlr(),postsResult);
}catch (Exception e){
String result = marketGet(basicInfo.getTemplateMarketUlr() + POSTS_API, basicInfo.getTemplateAccessKey());
List<TemplateMarketDTO> postsResult = JSONObject.parseObject(result).getJSONObject("data").getJSONArray("content").toJavaList(TemplateMarketDTO.class);
return new MarketBaseResponse(basicInfo.getTemplateMarketUlr(), postsResult);
} catch (Exception e) {
DataEaseException.throwException(e);
}
return null;
}
public List<String> getCategories(){
public List<String> getCategories() {
BasicInfo basicInfo = systemParameterService.templateMarketInfo();
String resultStr = marketGet(basicInfo.getTemplateMarketUlr()+CATEGORIES_API,basicInfo.getTemplateAccessKey());
String resultStr = marketGet(basicInfo.getTemplateMarketUlr() + CATEGORIES_API, basicInfo.getTemplateAccessKey());
List<TemplateCategory> categories = JSONObject.parseObject(resultStr).getJSONArray("data").toJavaList(TemplateCategory.class);
if(CollectionUtils.isNotEmpty(categories)){
return categories.stream().sorted(Comparator.comparing(TemplateCategory::getPriority)).map(TemplateCategory :: getName).collect(Collectors.toList());
}else{
if (CollectionUtils.isNotEmpty(categories)) {
return categories.stream().filter(item -> !"应用系列".equals(item.getName())).sorted(Comparator.comparing(TemplateCategory::getPriority)).map(TemplateCategory::getName).collect(Collectors.toList());
} else {
return null;
}

View File

@ -10,8 +10,25 @@ ALTER TABLE `sys_task`
ADD COLUMN `status` tinyint(1) NULL DEFAULT 1 COMMENT '运行状态' AFTER `create_time`;
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`) VALUES (1100, 1, 0, 1, '血缘关系', 'sys-relationship', 'system/relationship/index', 1002, 'sys-relationship', 'relationship', 0, 0, 0, 'relationship:read');
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`,
`path`, `i_frame`, `cache`, `hidden`, `permission`)
VALUES (1100, 1, 0, 1, '血缘关系', 'sys-relationship', 'system/relationship/index', 1002, 'sys-relationship',
'relationship', 0, 0, 0, 'relationship:read');
UPDATE `sys_menu` SET `menu_sort` = 1003 WHERE (`menu_id` = 101);
UPDATE `sys_menu`
SET `menu_sort` = 1003
WHERE (`menu_id` = 101);
UPDATE `my_plugin` SET `version` = '1.18.0' where `plugin_id` > 0;
UPDATE `my_plugin`
SET `version` = '1.18.0'
where `plugin_id` > 0;
ALTER TABLE `chart_view`
ADD COLUMN `refresh_view_enable` tinyint(1) NULL DEFAULT 0 COMMENT '是否开启刷新' AFTER `view_fields`,
ADD COLUMN `refresh_unit` varchar(255) NULL DEFAULT 'minute' COMMENT '刷新时间单位' AFTER `refresh_view_enable`,
ADD COLUMN `refresh_time` int(13) NULL DEFAULT 5 COMMENT '刷新时间' AFTER `refresh_unit`;
ALTER TABLE `chart_view_cache`
ADD COLUMN `refresh_view_enable` tinyint(1) NULL DEFAULT 0 COMMENT '是否开启刷新' AFTER `view_fields`,
ADD COLUMN `refresh_unit` varchar(255) NULL DEFAULT 'minute' COMMENT '刷新时间单位' AFTER `refresh_view_enable`,
ADD COLUMN `refresh_time` int(13) NULL DEFAULT 5 COMMENT '刷新时间' AFTER `refresh_unit`;

View File

@ -279,7 +279,7 @@ export default {
} else {
return {
...
getStyle(style, ['top', 'left', 'width', 'height', 'rotate']),
getStyle(style, ['top', 'left', 'width', 'height', 'rotate']),
position: 'relative'
}
}

View File

@ -137,7 +137,7 @@
:target="curComponent.hyperlinks.openMode "
:href="curComponent.hyperlinks.content "
>
<i class="icon iconfont icon-com-jump" />
<i class="icon iconfont icon-com-jump"/>
</a>
</span>
@ -496,19 +496,7 @@ export default {
},
// sourceViewId
clearLinkage() {
this.componentData.forEach(item => {
if (item.linkageFilters && item.linkageFilters.length > 0) {
const newList = item.linkageFilters.filter(linkage => linkage.sourceViewId !== this.element.propValue.viewId)
item.linkageFilters.splice(0, item.linkageFilters.length)
// push watch
if (newList.length > 0) {
newList.forEach(newLinkage => {
item.linkageFilters.push(newLinkage)
})
}
}
})
bus.$emit('clear_panel_linkage', { viewId: this.element.propValue.viewId })
this.$store.commit('clearViewLinkage', this.element.propValue.viewId)
},
goFile() {
this.$refs.files.click()

View File

@ -305,6 +305,7 @@ export default {
},
data() {
return {
innerRefreshTimer: null,
mobileChartDetailsVisible: false,
chartDetailsVisible: false,
showChartInfo: {},
@ -350,7 +351,7 @@ export default {
},
computed: {
//使filter
// 使filter
initLoad() {
return !(this.isEdit && this.currentCanvasNewId.includes(this.element.id)) && this.isFirstLoad
},
@ -393,7 +394,7 @@ export default {
return this.httpRequest.status && this.chart.type && this.chart.type === 'label'
},
loadingFlag() {
return (this.canvasStyleData.refreshViewLoading || this.searchCount === 0) && this.requestStatus === 'waiting'
return (this.canvasStyleData.refreshViewLoading || (!this.innerRefreshTimer && this.searchCount === 0)) && this.requestStatus === 'waiting'
},
panelInfo() {
return this.$store.state.panel.panelInfo
@ -520,7 +521,8 @@ export default {
},
//
searchCount: function(val1) {
if (val1 > 0 && this.requestStatus !== 'waiting') {
//
if (val1 > 0 && this.requestStatus !== 'waiting' && !this.innerRefreshTimer) {
this.getData(this.element.propValue.viewId)
}
},
@ -547,6 +549,7 @@ export default {
},
beforeDestroy() {
this.innerRefreshTimer && clearInterval(this.innerRefreshTimer)
bus.$off('plugin-chart-click', this.pluginChartClick)
bus.$off('plugin-jump-click', this.pluginJumpClick)
bus.$off('plugin-add-view-track-filter', this.pluginAddViewTrackFilter)
@ -566,6 +569,20 @@ export default {
}
},
methods: {
//
buildInnerRefreshTimer(refreshViewEnable = false, refreshUnit = 'minute', refreshTime = 5) {
if (this.editMode === 'preview' && !this.innerRefreshTimer && refreshViewEnable) {
this.innerRefreshTimer && clearInterval(this.innerRefreshTimer)
const timerRefreshTime = refreshUnit === 'second' ? refreshTime * 1000 : refreshTime * 60000
this.innerRefreshTimer = setInterval(() => {
this.clearViewLinkage()
this.getData(this.element.propValue.viewId)
}, timerRefreshTime)
}
},
clearViewLinkage() {
this.$store.commit('clearViewLinkage', this.element.propValue.viewId)
},
responseResetButton() {
if (!this.cfilters?.length) {
this.getData(this.element.propValue.viewId, false)
@ -741,6 +758,7 @@ export default {
if (response.success) {
this.chart = response.data
this.view = response.data
this.buildInnerRefreshTimer(this.chart.refreshViewEnable, this.chart.refreshUnit, this.chart.refreshTime)
this.$emit('fill-chart-2-parent', this.chart)
this.getDataOnly(response.data, dataBroadcast)
this.chart['position'] = this.inTab ? 'tab' : 'panel'
@ -1269,7 +1287,6 @@ export default {
display: block !important;
}
.mobile-dialog-css ::v-deep .el-dialog__headerbtn {
top: 7px
}

View File

@ -66,7 +66,7 @@
@mousedown.stop.prevent="handleDown(handlei, $event)"
@touchstart.stop.prevent="handleTouchDown(handlei, $event)"
>
<slot :name="handlei" />
<slot :name="handlei"/>
</div>
<div
:id="componentCanvasId"
@ -95,7 +95,7 @@
class="svg-background"
:icon-class="mainSlotSvgInner"
/>
<slot />
<slot/>
</div>
</div>
</div>
@ -2170,31 +2170,31 @@ export default {
}
.de-drag-top {
left: 0;
top: 0;
left: 1px;
top: 1px;
height: 12px;
width: 100%;
width: calc(100% - 2px);
}
.de-drag-right {
right: 0;
top: 0;
right: 1px;
top: 1px;
width: 16px;
height: 100%;
height: calc(100% - 30px);
}
.de-drag-bottom {
left: 0;
bottom: 0;
left: 1px;
bottom: 1px;
height: 12px;
width: 100%;
width: calc(100% - 2px);
}
.de-drag-left {
left: 0;
top: 0;
left: 1px;
top: 1px;
width: 16px;
height: 100%;
height: calc(100% - 2px);
}
</style>

View File

@ -217,7 +217,10 @@ export default {
return ''
}
},
options: {},
options: {
type: Object,
default: () => {}
},
width: {
type: Number,
default() {

View File

@ -180,7 +180,10 @@ export default {
return ''
}
},
options: {},
options: {
type: Object,
default: () => {}
},
width: {
type: Number,
default() {

View File

@ -640,7 +640,7 @@ export default {
while (len--) {
if (this.element.options.tabList[len].name === param.name) {
this.element.options.tabList.splice(len, 1)
this.$store.commit('deleteComponentsWithCanvasId', this.element.id + '-' + param.name)
const activeIndex = (len - 1 + this.element.options.tabList.length) % this.element.options.tabList.length
this.activeTabName = this.element.options.tabList[activeIndex].name
}

View File

@ -931,6 +931,7 @@ export default {
password_input_error: 'Original password input error'
},
chart: {
chart_refresh_tips: 'View refresh setting takes precedence over panel refresh setting',
'1-trend': 'trend',
'2-state': 'State',
'3-rank': 'Rank',
@ -1480,9 +1481,9 @@ export default {
total_sort_desc: 'DESC',
total_sort_field: 'Sort Field',
empty_data_strategy: 'Empty Data Strategy',
break_line: 'Disconnection',
break_line: 'Keep',
set_zero: 'Set Zero',
ignore_data: 'Ignore Data',
ignore_data: 'Hide Data',
sub_dimension_tip: 'This field is required, and cannot be included in the type axis, you should choose non-group chart if you don\'t need it, or you will get unexpected chart.',
drill_dimension_tip: 'Only fields in the dataset can be drilled',
table_scroll_tip: 'The detail table is only effective when the pagination mode is "Drop-down".',
@ -1924,6 +1925,7 @@ export default {
field_description: 'Field description',
table_description: 'Table description',
relational_database: 'Relational database',
data_warehouse_lake: 'Data Warehouse/Data Lake',
non_relational_database: 'Non relational database',
all: 'All',
other: 'other',

View File

@ -930,6 +930,7 @@ export default {
password_input_error: '原始密碼輸入錯誤'
},
chart: {
chart_refresh_tips: '視圖刷新設置優先於儀表板刷新設置',
'1-trend': '趨勢',
'2-state': '狀態',
'3-rank': '排名',
@ -1479,9 +1480,9 @@ export default {
total_sort_desc: '降序',
total_sort_field: '排序字段',
empty_data_strategy: '空值處理',
break_line: '線條斷開',
set_zero: '置為0,線條不斷開',
ignore_data: '跳過空值,不展示',
break_line: '保持為空',
set_zero: '置為0',
ignore_data: '隱藏空值',
sub_dimension_tip: '該字段為必填項,且不應使用類別軸中的字段,若無需該字段,請選擇基礎圖表進行展示,否則展示效果不理想',
drill_dimension_tip: '鑽取字段僅支持數據集中的字段',
table_scroll_tip: '明細表僅在分頁模式為"下拉"時生效。',
@ -1918,6 +1919,7 @@ export default {
field_description: '欄位描述',
table_description: '表描述',
relational_database: '關係型數據庫',
data_warehouse_lake: '數倉/數據湖',
non_relational_database: '非關係型數據庫',
all: '所有',
other: '其他',

View File

@ -929,6 +929,7 @@ export default {
password_input_error: '原始密码输入错误'
},
chart: {
chart_refresh_tips: '视图刷新设置优先于仪表板刷新设置',
'1-trend': '趋势',
'2-state': '状态',
'3-rank': '排名',
@ -1478,9 +1479,9 @@ export default {
total_sort_desc: '降序',
total_sort_field: '排序字段',
empty_data_strategy: '空值处理',
break_line: '线条断开',
set_zero: '置为0,线条不断开',
ignore_data: '跳过空值,不展示',
break_line: '保持为空',
set_zero: '置为0',
ignore_data: '隐藏空值',
sub_dimension_tip: '该字段为必填项,且不应使用类别轴中的字段,若无需该字段,请选择基础图表进行展示,否则展示效果不理想。',
drill_dimension_tip: '钻取字段仅支持数据集中的字段',
table_scroll_tip: '明细表仅在分页模式为"下拉"时生效。',
@ -1917,6 +1918,7 @@ export default {
field_description: '字段描述',
table_description: '表描述',
relational_database: '关系型数据库',
data_warehouse_lake: '数仓/数据湖',
non_relational_database: '非关系型数据库',
all: '所有',
other: '其他',

View File

@ -503,6 +503,9 @@ const data = {
const element = state.componentData[index]
if (element.id && element.id === id) {
state.componentData.splice(index, 1)
if (element.type === 'de-tabs') {
this.commit('deleteComponentsWithCanvasId', element.id)
}
break
}
}
@ -811,6 +814,33 @@ const data = {
state.mousePointShadowMap.mouseY = mousePoint.mouseY
state.mousePointShadowMap.width = mousePoint.width
state.mousePointShadowMap.height = mousePoint.height
},
deleteComponentsWithCanvasId(state, canvasId) {
if (canvasId && canvasId.length > 10) {
for (let index = 0; index < state.componentData.length; index++) {
const element = state.componentData[index]
if (element.canvasId && element.canvasId.includes(canvasId)) {
state.componentData.splice(index, 1)
}
}
}
},
// 清除相同sourceViewId 的 联动条件
clearViewLinkage(state, viewId) {
state.componentData.forEach(item => {
if (item.linkageFilters && item.linkageFilters.length > 0) {
const newList = item.linkageFilters.filter(linkage => linkage.sourceViewId !== viewId)
item.linkageFilters.splice(0, item.linkageFilters.length)
// 重新push 可保证数组指针不变 可以watch到
if (newList.length > 0) {
newList.forEach(newLinkage => {
item.linkageFilters.push(newLinkage)
})
}
}
})
bus.$emit('clear_panel_linkage', { viewId: viewId })
}
},
modules: {

View File

@ -36,7 +36,10 @@
:span="6"
style="padding-top: 5px"
>
<el-checkbox v-model="commonBackground.backgroundColorSelect" @change="themeChange('backgroundColorSelect')">
<el-checkbox
v-model="commonBackground.backgroundColorSelect"
@change="themeChange('backgroundColorSelect')"
>
{{
$t('chart.color')
}}
@ -75,9 +78,12 @@
:span="4"
style="padding-top: 5px"
>
<el-checkbox v-model="commonBackground.enable" @change="themeChange('enable')">{{
$t('panel.background')
}}
<el-checkbox
v-model="commonBackground.enable"
@change="themeChange('enable')"
>{{
$t('panel.background')
}}
</el-checkbox>
</el-col>
<el-col :span="20">
@ -113,7 +119,7 @@
:http-request="upload"
:file-list="fileList"
>
<i class="el-icon-plus"/>
<i class="el-icon-plus" />
</el-upload>
<el-dialog
top="25vh"
@ -189,6 +195,7 @@ import BackgroundItemOverall from '@/views/background/BackgroundItemOverall'
export default {
name: 'BackgroundOverall',
// eslint-disable-next-line
components: { BackgroundItemOverall, BackgroundItem },
props: {
position: {

View File

@ -11,7 +11,8 @@ import {
getAnalyse,
setGradientColor
} from '@/views/chart/chart/common/common_antv'
import { antVCustomColor } from '@/views/chart/chart/util'
import { antVCustomColor, handleEmptyDataStrategy } from '@/views/chart/chart/util'
import _ from 'lodash'
export function baseBarOptionAntV(plot, container, chart, action, isGroup, isStack) {
// theme
@ -24,7 +25,7 @@ export function baseBarOptionAntV(plot, container, chart, action, isGroup, isSta
const xAxis = getXAxis(chart)
const yAxis = getYAxis(chart)
// data
const data = chart.data.data
const data = _.cloneDeep(chart.data.data)
// config
const slider = getSlider(chart)
const analyse = getAnalyse(chart)
@ -109,6 +110,14 @@ export function baseBarOptionAntV(plot, container, chart, action, isGroup, isSta
return setGradientColor(ele, customAttr.color.gradient, 270)
})
}
// 处理空值
if (chart.senior) {
let emptyDataStrategy = JSON.parse(chart.senior)?.functionCfg?.emptyDataStrategy
if (!emptyDataStrategy) {
emptyDataStrategy = 'breakLine'
}
handleEmptyDataStrategy(emptyDataStrategy, chart, data, options)
}
// 开始渲染
if (plot) {
@ -133,7 +142,7 @@ export function hBaseBarOptionAntV(plot, container, chart, action, isGroup, isSt
const xAxis = getXAxis(chart)
const yAxis = getYAxis(chart)
// data
const data = chart.data.data
const data = _.cloneDeep(chart.data.data)
// config
const slider = getSlider(chart)
const analyse = getAnalyse(chart)
@ -211,6 +220,14 @@ export function hBaseBarOptionAntV(plot, container, chart, action, isGroup, isSt
return setGradientColor(ele, customAttr.color.gradient)
})
}
// 处理空值
if (chart.senior) {
let emptyDataStrategy = JSON.parse(chart.senior)?.functionCfg?.emptyDataStrategy
if (!emptyDataStrategy) {
emptyDataStrategy = 'breakLine'
}
handleEmptyDataStrategy(emptyDataStrategy, chart, data, options)
}
// 开始渲染
if (plot) {

View File

@ -153,7 +153,7 @@ export function getLabel(chart) {
// label value formatter
if (chart.type && chart.type !== 'waterfall') {
label.formatter = function(param) {
let yAxis, extStack
let yAxis, extStack, xaxisExt
let res = param.value
try {
yAxis = JSON.parse(chart.yaxis)
@ -165,11 +165,16 @@ export function getLabel(chart) {
} catch (e) {
extStack = JSON.parse(JSON.stringify(chart.extStack))
}
try {
xaxisExt = JSON.parse(chart.xaxisExt)
} catch (e) {
xaxisExt = JSON.parse(JSON.stringify(chart.xaxisExt))
}
if (equalsAny(chart.type, 'bar-stack', 'line-stack',
if (equalsAny(chart.type, 'line', 'bar-stack', 'line-stack',
'bar-stack-horizontal', 'percentage-bar-stack', 'percentage-bar-stack-horizontal')) {
let f
if (extStack && extStack.length > 0) {
if (extStack?.length > 0 || xaxisExt?.length > 0) {
f = yAxis[0]
} else {
for (let i = 0; i < yAxis.length; i++) {
@ -371,7 +376,7 @@ export function getTooltip(chart) {
} else {
res = param.value
}
obj.value = res
obj.value = res === null ? '' : res
return obj
}
}

View File

@ -23,6 +23,9 @@ export const formatterType = [
]
export function valueFormatter(value, formatter) {
if (value === null || value === undefined) {
return null
}
// 1.unit 2.decimal 3.thousand separator and suffix
let result
if (formatter.type === 'auto') {

View File

@ -89,6 +89,7 @@ export function baseLineOptionAntV(plot, container, chart, action) {
}
// custom color
options.color = antVCustomColor(chart)
// 处理空值
if (chart.senior) {
let emptyDataStrategy = JSON.parse(chart.senior)?.functionCfg?.emptyDataStrategy
if (!emptyDataStrategy) {
@ -119,7 +120,7 @@ export function baseAreaOptionAntV(plot, container, chart, action, isStack) {
const xAxis = getXAxis(chart)
const yAxis = getYAxis(chart)
// data
const data = chart.data.data
const data = _.cloneDeep(chart.data.data)
// config
const slider = getSlider(chart)
const analyse = getAnalyse(chart)
@ -197,6 +198,14 @@ export function baseAreaOptionAntV(plot, container, chart, action, isStack) {
}
}
}
// 处理空值
if (chart.senior) {
let emptyDataStrategy = JSON.parse(chart.senior)?.functionCfg?.emptyDataStrategy
if (!emptyDataStrategy) {
emptyDataStrategy = 'breakLine'
}
handleEmptyDataStrategy(emptyDataStrategy, chart, data, options)
}
// 开始渲染
if (plot) {

View File

@ -332,6 +332,13 @@ export default {
})
return
}
if (this.canvasStyleData.panel.themeColor === 'dark') {
chart_option.legend['pageIconColor'] = '#ffffff'
chart_option.legend['pageIconInactiveColor'] = '#8c8c8c'
} else {
chart_option.legend['pageIconColor'] = '#000000'
chart_option.legend['pageIconInactiveColor'] = '#8c8c8c'
}
this.myEcharts(chart_option)
this.$nextTick(() => (this.linkageActive()))
},

View File

@ -58,6 +58,7 @@ import { DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart'
import { baseMixOptionAntV } from '@/views/chart/chart/mix/mix_antv'
import ChartTitleUpdate from './ChartTitleUpdate.vue'
import { equalsAny } from '@/utils/StringUtils'
import { mapState } from 'vuex'
export default {
name: 'ChartComponentG2',
@ -140,7 +141,10 @@ export default {
chartInfo() {
const { id, title } = this.chart
return { id, title }
}
},
...mapState([
'canvasStyleData'
])
},
watch: {
chart: {
@ -280,6 +284,24 @@ export default {
if (this.myChart && chart.type !== 'liquid' && this.searchCount > 0) {
this.myChart.options.animation = false
}
if (this.myChart.options.legend) {
let pageNavigatorInactiveFill, pageNavigatorFill
if (this.canvasStyleData.panel.themeColor === 'dark') {
pageNavigatorFill = '#ffffff'
pageNavigatorInactiveFill = '#8c8c8c'
} else {
pageNavigatorFill = '#000000'
pageNavigatorInactiveFill = '#8c8c8c'
}
this.myChart.options.legend['pageNavigator'] = {
marker: {
style: {
inactiveFill: pageNavigatorInactiveFill, //
fill: pageNavigatorFill //
}
}
}
}
if (this.antVRenderStatus) {
this.myChart.render()

View File

@ -68,7 +68,7 @@
/>
</el-form-item>
<el-form-item
v-show="chart.render === 'antv' && chart.type === 'line'"
v-show="chart.render === 'antv' && (chart.type.includes('line') || chart.type.includes('bar') || chart.type.includes('area'))"
:label="$t('chart.empty_data_strategy')"
class="form-item"
>
@ -174,7 +174,7 @@ span{
}
.form-item ::v-deep .el-radio-group{
display: flex;
flex-direction: row;
flex-direction: column;
flex-wrap: wrap;
label {
line-height: 28px;

View File

@ -13,7 +13,7 @@
@click="add('group')"
/>
</el-row>
<el-divider />
<el-divider/>
<el-row style="margin-bottom: 10px">
<el-col :span="16">
<el-input
@ -31,7 +31,7 @@
size="mini"
type="primary"
>
{{ searchMap[searchType] }}<i class="el-icon-arrow-down el-icon--right" />
{{ searchMap[searchType] }}<i class="el-icon-arrow-down el-icon--right"/>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="searchTypeClick('all')">{{ $t('commons.all') }}</el-dropdown-item>
@ -63,7 +63,7 @@
>
<span style="display: flex;flex: 1;width: 0;">
<span>
<i class="el-icon-folder" />
<i class="el-icon-folder"/>
</span>
<span
style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"
@ -152,7 +152,7 @@
class="custom-tree-node-list father"
>
<span style="display: flex;flex: 1;width: 0;">
<span><svg-icon :icon-class="data.modelInnerType" /></span>
<span><svg-icon :icon-class="data.modelInnerType"/></span>
<span
style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"
:title="data.name"
@ -225,7 +225,7 @@
:label="$t('commons.name')"
prop="name"
>
<el-input v-model="groupForm.name" />
<el-input v-model="groupForm.name"/>
</el-form-item>
</el-form>
<div
@ -235,12 +235,14 @@
<el-button
size="mini"
@click="close()"
>{{ $t('chart.cancel') }}</el-button>
>{{ $t('chart.cancel') }}
</el-button>
<el-button
type="primary"
size="mini"
@click="saveGroup(groupForm)"
>{{ $t('chart.confirm') }}</el-button>
>{{ $t('chart.confirm') }}
</el-button>
</div>
</el-dialog>
</el-col>
@ -264,7 +266,7 @@
:label="$t('commons.name')"
prop="name"
>
<el-input v-model="tableForm.name" />
<el-input v-model="tableForm.name"/>
</el-form-item>
</el-form>
<div
@ -274,12 +276,14 @@
<el-button
size="mini"
@click="closeTable()"
>{{ $t('chart.cancel') }}</el-button>
>{{ $t('chart.cancel') }}
</el-button>
<el-button
type="primary"
size="mini"
@click="saveTable(tableForm)"
>{{ $t('chart.confirm') }}</el-button>
>{{ $t('chart.confirm') }}
</el-button>
</div>
</el-dialog>
@ -318,8 +322,8 @@
:active="createActive"
align-center
>
<el-step :title="$t('chart.select_dataset')" />
<el-step :title="$t('chart.select_chart_type')" />
<el-step :title="$t('chart.select_dataset')"/>
<el-step :title="$t('chart.select_chart_type')"/>
</el-steps>
<table-selector
@ -385,14 +389,16 @@
<el-button
size="mini"
@click="closeCreateChart"
>{{ $t('chart.cancel') }}</el-button>
>{{ $t('chart.cancel') }}
</el-button>
<el-button
v-if="createActive === 2"
type="primary"
size="mini"
@click="createPreview"
>{{ $t('chart.preview')
}}
>{{
$t('chart.preview')
}}
</el-button>
<el-button
v-if="createActive === 1"
@ -433,14 +439,16 @@
<el-button
size="mini"
@click="closeMoveGroup()"
>{{ $t('dataset.cancel') }}</el-button>
>{{ $t('dataset.cancel') }}
</el-button>
<el-button
:disabled="groupMoveConfirmDisabled"
type="primary"
size="mini"
@click="saveMoveGroup(tGroup)"
>{{
$t('dataset.confirm') }}
$t('dataset.confirm')
}}
</el-button>
</div>
</el-dialog>
@ -465,14 +473,16 @@
<el-button
size="mini"
@click="closeMoveDs()"
>{{ $t('dataset.cancel') }}</el-button>
>{{ $t('dataset.cancel') }}
</el-button>
<el-button
:disabled="dsMoveConfirmDisabled"
type="primary"
size="mini"
@click="saveMoveDs(tDs)"
>{{
$t('dataset.confirm') }}
$t('dataset.confirm')
}}
</el-button>
</div>
</el-dialog>
@ -480,27 +490,26 @@
</template>
<script>
import { post, chartGroupTree } from '@/api/chart/chart'
import { chartGroupTree, pluginTypes, post } from '@/api/chart/chart'
import { queryAuthModel } from '@/api/authModel/authModel'
import TableSelector from '../view/TableSelector'
import GroupMoveSelector from '../components/treeSelector/GroupMoveSelector'
import ChartMoveSelector from '../components/treeSelector/ChartMoveSelector'
import ChartType from '@/views/chart/view/ChartType'
import { pluginTypes } from '@/api/chart/chart'
import {
DEFAULT_COLOR_CASE,
DEFAULT_FUNCTION_CFG,
DEFAULT_LABEL,
DEFAULT_LEGEND_STYLE,
DEFAULT_SIZE,
DEFAULT_SPLIT,
DEFAULT_THRESHOLD,
DEFAULT_TITLE_STYLE,
DEFAULT_TOOLTIP,
DEFAULT_TOTAL,
DEFAULT_XAXIS_STYLE,
DEFAULT_YAXIS_STYLE,
DEFAULT_YAXIS_EXT_STYLE,
DEFAULT_SPLIT,
DEFAULT_FUNCTION_CFG,
DEFAULT_THRESHOLD,
DEFAULT_TOTAL
DEFAULT_YAXIS_STYLE
} from '../chart/chart'
import { checkViewTitle } from '@/components/canvas/utils/utils'
import { adaptCurTheme } from '@/components/canvas/utils/style'
@ -977,6 +986,9 @@ export default {
view.render = this.view.render
view.resultMode = 'custom'
view.resultCount = 1000
view.refreshViewEnable = false
view.refreshUnit = 'minute'
view.refreshTime = 5
const customAttr = {
color: DEFAULT_COLOR_CASE,
tableColor: DEFAULT_COLOR_CASE,
@ -1226,135 +1238,135 @@ export default {
</script>
<style scoped>
.el-divider--horizontal {
margin: 12px 0
}
.el-divider--horizontal {
margin: 12px 0
}
.search-input {
padding: 12px 0;
}
.search-input {
padding: 12px 0;
}
.custom-tree-container {
margin-top: 10px;
}
.custom-tree-container {
margin-top: 10px;
}
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
.custom-tree-node-list {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding: 0 8px;
}
.custom-tree-node-list {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding: 0 8px;
}
.tree-list ::v-deep .el-tree-node__expand-icon.is-leaf {
display: none;
}
.tree-list ::v-deep .el-tree-node__expand-icon.is-leaf {
display: none;
}
.custom-position {
flex: 1;
display: flex;
align-items: center;
font-size: 14px;
flex-flow: row nowrap;
}
.custom-position {
flex: 1;
display: flex;
align-items: center;
font-size: 14px;
flex-flow: row nowrap;
}
.form-item {
margin-bottom: 0;
}
.form-item {
margin-bottom: 0;
}
.title-css {
height: 26px;
}
.title-css {
height: 26px;
}
.title-text {
line-height: 26px;
}
.title-text {
line-height: 26px;
}
.dialog-css ::v-deep .el-dialog__header {
padding: 20px 20px 0;
}
.dialog-css ::v-deep .el-dialog__header {
padding: 20px 20px 0;
}
.dialog-css ::v-deep .el-dialog__body {
padding: 10px 20px 20px;
}
.dialog-css ::v-deep .el-dialog__body {
padding: 10px 20px 20px;
}
.form-item ::v-deep .el-form-item__label {
font-size: 12px;
}
.form-item ::v-deep .el-form-item__label {
font-size: 12px;
}
.scene-title {
width: 100%;
display: flex;
}
.scene-title {
width: 100%;
display: flex;
}
.scene-title-name {
width: 100%;
overflow: hidden;
display: inline-block;
white-space: nowrap;
text-overflow: ellipsis;
}
.scene-title-name {
width: 100%;
overflow: hidden;
display: inline-block;
white-space: nowrap;
text-overflow: ellipsis;
}
.father .child {
/*display: none;*/
visibility: hidden;
}
.father .child {
/*display: none;*/
visibility: hidden;
}
.father:hover .child {
/*display: inline;*/
visibility: visible;
}
.father:hover .child {
/*display: inline;*/
visibility: visible;
}
.tree-style {
padding: 10px 15px;
height: 100%;
overflow-y: auto;
}
.tree-style {
padding: 10px 15px;
height: 100%;
overflow-y: auto;
}
/deep/ .vue-treeselect__control {
height: 28px;
}
/deep/ .vue-treeselect__control {
height: 28px;
}
/deep/ .vue-treeselect__single-value {
color: #606266;
line-height: 28px !important;
}
/deep/ .vue-treeselect__single-value {
color: #606266;
line-height: 28px !important;
}
.render-select ::v-deep .el-input__suffix {
width: 20px;
}
.render-select ::v-deep .el-input__suffix {
width: 20px;
}
.render-select ::v-deep .el-input__inner {
padding-right: 10px;
padding-left: 6px;
}
.render-select ::v-deep .el-input__inner {
padding-right: 10px;
padding-left: 6px;
}
.dialog-css ::v-deep .el-step__title {
font-weight: 400;
font-size: 12px;
}
.dialog-css ::v-deep .el-step__title {
font-weight: 400;
font-size: 12px;
}
.chart-icon {
width: 200px;
height: 200px;
}
.chart-icon {
width: 200px;
height: 200px;
}
.chart-box {
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
width: 50%;
float: left;
height: 380px;
}
.chart-box {
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
width: 50%;
float: left;
height: 380px;
}
</style>

View File

@ -192,7 +192,7 @@
@command="chartFieldEdit"
>
<span class="el-dropdown-link">
<i class="el-icon-s-tools" />
<i class="el-icon-s-tools"/>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
@ -267,7 +267,7 @@
@command="chartFieldEdit"
>
<span class="el-dropdown-link">
<i class="el-icon-s-tools" />
<i class="el-icon-s-tools"/>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
@ -362,7 +362,7 @@
style="padding: 6px;"
>
{{ $t('chart.change_chart_type') }}
<i class="el-icon-caret-bottom" />
<i class="el-icon-caret-bottom"/>
</el-button>
</el-popover>
</span>
@ -406,6 +406,68 @@
</el-radio-group>
</el-row>
</el-row>
<el-row class="padding-lr">
<!-- <span-->
<!-- style="color: #909399; font-size: 8px;width: 80px;text-align: right;"-->
<!-- >-->
<!-- Tips:{{ $t('chart.rich_text_view_result_tips') }}-->
<!-- </span>-->
<span
style="width: 80px;text-align: right;"
>
{{ $t('panel.refresh_frequency') }}
</span>
<el-tooltip
class="item"
effect="dark"
placement="bottom"
>
<div slot="content">
{{ $t('chart.chart_refresh_tips') }}
</div>
<i
class="el-icon-info"
style="cursor: pointer;color: #606266;font-size: 12px"
/>
</el-tooltip>
<span class="padding-lr">
<el-checkbox
v-model="view.refreshViewEnable"
class="el-input-refresh-loading"
@change="refreshAttrChange"
></el-checkbox>
{{ $t('panel.enable_refresh_view') }}
</span>
<el-row>
<el-input
v-model="view.refreshTime"
class="el-input-refresh-time"
type="number"
size="mini"
controls-position="right"
:min="1"
:max="3600"
:disabled="!view.refreshViewEnable"
@change="refreshAttrChange"
/>
<el-select
v-model="view.refreshUnit"
class="el-input-refresh-unit margin-left8"
size="mini"
:disabled="!view.refreshViewEnable"
@change="refreshAttrChange"
>
<el-option
:label="$t('panel.minute')"
:value="'minute'"
/>
<el-option
:label="$t('panel.second')"
:value="'second'"
/>
</el-select>
</el-row>
</el-row>
<plugin-com
v-if="view.isPlugin"
@ -490,8 +552,8 @@
>
<span class="data-area-label">
<span v-if="view.type && view.type.includes('table')">{{
$t('chart.drag_block_table_data_column')
}}</span>
$t('chart.drag_block_table_data_column')
}}</span>
<span
v-else-if="view.type && (view.type.includes('bar') || view.type.includes('line') || view.type.includes('scatter') || view.type === 'chart-mix' || view.type === 'waterfall' || view.type === 'area')"
>{{ $t('chart.drag_block_type_axis') }}</span>
@ -499,18 +561,18 @@
v-else-if="view.type && view.type.includes('pie')"
>{{ $t('chart.drag_block_pie_label') }}</span>
<span v-else-if="view.type && view.type.includes('funnel')">{{
$t('chart.drag_block_funnel_split')
}}</span>
$t('chart.drag_block_funnel_split')
}}</span>
<span v-else-if="view.type && view.type.includes('radar')">{{
$t('chart.drag_block_radar_label')
}}</span>
$t('chart.drag_block_radar_label')
}}</span>
<span v-else-if="view.type && view.type === 'map'">{{ $t('chart.area') }}</span>
<span v-else-if="view.type && view.type.includes('treemap')">{{
$t('chart.drag_block_treemap_label')
}}</span>
$t('chart.drag_block_treemap_label')
}}</span>
<span v-else-if="view.type && view.type === 'word-cloud'">{{
$t('chart.drag_block_word_cloud_label')
}}</span>
$t('chart.drag_block_word_cloud_label')
}}</span>
<span v-else-if="view.type && view.type === 'label'">{{ $t('chart.drag_block_label') }}</span>
<span v-show="view.type !== 'richTextView'"> / </span>
<span v-if="view.type && view.type !== 'table-info'">{{ $t('chart.dimension') }}</span>
@ -633,8 +695,8 @@
>
<span class="data-area-label">
<span v-if="view.type && view.type.includes('table')">{{
$t('chart.drag_block_table_data_column')
}}</span>
$t('chart.drag_block_table_data_column')
}}</span>
<span
v-else-if="view.type && (view.type.includes('bar') || view.type.includes('line') || view.type.includes('scatter') || view.type === 'waterfall' || view.type === 'area')"
>{{ $t('chart.drag_block_value_axis') }}</span>
@ -642,30 +704,30 @@
v-else-if="view.type && view.type.includes('pie')"
>{{ $t('chart.drag_block_pie_angel') }}</span>
<span v-else-if="view.type && view.type.includes('funnel')">{{
$t('chart.drag_block_funnel_width')
}}</span>
$t('chart.drag_block_funnel_width')
}}</span>
<span v-else-if="view.type && view.type.includes('radar')">{{
$t('chart.drag_block_radar_length')
}}</span>
$t('chart.drag_block_radar_length')
}}</span>
<span v-else-if="view.type && view.type.includes('gauge')">{{
$t('chart.drag_block_gauge_angel')
}}</span>
$t('chart.drag_block_gauge_angel')
}}</span>
<span
v-else-if="view.type && view.type.includes('text')"
>{{ $t('chart.drag_block_label_value') }}</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>
$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>
$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 === 'word-cloud'">{{
$t('chart.drag_block_word_cloud_size')
}}</span>
$t('chart.drag_block_word_cloud_size')
}}</span>
<span v-show="view.type !== 'richTextView'"> / </span>
<span>{{ $t('chart.quota') }}</span>
<i
@ -1137,7 +1199,7 @@
:title="$t('panel.position_adjust_component')"
:name="'positionAdjust'"
>
<position-adjust />
<position-adjust/>
</el-collapse-item>
</el-collapse>
</div>
@ -1293,7 +1355,7 @@
width="800px"
class="dialog-css"
>
<quota-filter-editor :item="quotaItem" />
<quota-filter-editor :item="quotaItem"/>
<div
slot="footer"
class="dialog-footer"
@ -1320,7 +1382,7 @@
width="800px"
class="dialog-css"
>
<dimension-filter-editor :item="dimensionItem" />
<dimension-filter-editor :item="dimensionItem"/>
<div
slot="footer"
class="dialog-footer"
@ -1622,8 +1684,8 @@ import {
pluginTypes,
post,
resetViewCacheCallBack,
viewEditSave,
tableField
tableField,
viewEditSave
} from '@/api/chart/chart'
import DimensionItem from '../components/dragItem/DimensionItem'
import QuotaItem from '../components/dragItem/QuotaItem'
@ -1683,6 +1745,7 @@ import CalcChartFieldEdit from '@/views/chart/view/CalcChartFieldEdit'
import { equalsAny } from '@/utils/StringUtils'
import PositionAdjust from '@/views/chart/view/PositionAdjust'
import MarkMapDataEditor from '@/views/chart/components/map/MarkMapDataEditor'
export default {
name: 'ChartEdit',
components: {
@ -1759,6 +1822,9 @@ export default {
show: true,
type: 'bar',
title: '',
refreshViewEnable: false,
refreshUnit: 'minute',
refreshTime: 5,
customAttr: {
color: DEFAULT_COLOR_CASE,
size: DEFAULT_SIZE,
@ -2291,6 +2357,12 @@ export default {
delete view.data
return view
},
refreshAttrChange(switchType = false, switchRender = false) {
this.changeEditStatus(true)
const view = this.buildParam(true, 'chart', false, switchType, switchRender)
if (!view) return
viewEditSave(this.panelInfo.id, view)
},
calcData(getData, trigger, needRefreshGroup = false, switchType = false, switchRender = false) {
this.changeEditStatus(true)
const view = this.buildParam(true, 'chart', false, switchType, switchRender)
@ -3834,4 +3906,19 @@ span {
cursor: pointer;
z-index: 1;
}
.el-input-refresh-time {
width: calc(50% - 4px) !important;
}
.el-input-refresh-unit {
margin-left: 8px;
width: calc(50% - 4px) !important;
}
.el-input-refresh-loading {
margin-left: 4px;
font-size: 12px !important;
}
</style>

View File

@ -127,9 +127,9 @@
value="0"
/>
<el-option
v-if="engineMode !== 'simple'"
:label="$t('dataset.sync_data')"
value="1"
v-if="engineMode !== 'simple'"
:disabled="disabledSync"
/>
</el-select>

View File

@ -49,8 +49,8 @@
size="small"
>
<el-option
:label="$t('dataset.sync_now')"
v-if="engineMode !== 'simple'"
:label="$t('dataset.sync_now')"
value="sync_now"
:disabled="engineMode === 'simple'"
/>

View File

@ -279,7 +279,7 @@ export default {
},
datasetParams: {
type: Array,
default: []
default: () => []
}
},
data() {
@ -360,9 +360,12 @@ export default {
changeDynamicParams(val, name) {
const start = this.attrs.startParameters ? JSON.parse(JSON.stringify(this.attrs.startParameters)) : []
const end = this.attrs.endParameters ? JSON.parse(JSON.stringify(this.attrs.endParameters)) : []
let end = this.attrs.endParameters ? JSON.parse(JSON.stringify(this.attrs.endParameters)) : []
if (end?.length) {
end[0] += '_START_END_SPLIT'
end = end.map(item => {
item = item + '_START_END_SPLIT'
return item
})
}
this.attrs.parameters = [...new Set([...start, ...end])]
},
@ -393,6 +396,12 @@ export default {
enableParametersChange(value) {
if (!value) {
this.attrs.parameters = []
if (this.attrs.startParameters?.length) {
this.attrs.startParameters = []
}
if (this.attrs.endParameters?.length) {
this.attrs.endParameters = []
}
}
this.fillAttrs2Filter()
},

View File

@ -17,7 +17,7 @@
style="border-bottom: 1px solid;border-bottom-color:#E6E6E6;"
>
<div style="height: 100%;">
<share-head/>
<share-head />
</div>
</el-row>
<el-row
@ -76,7 +76,7 @@
width="400"
trigger="click"
>
<panel-detail-info/>
<panel-detail-info />
<i
slot="reference"
class="el-icon-warning-outline icon-class"
@ -489,7 +489,6 @@ export default {
} else {
return true
}
},
downLoadApp(appAttachInfo) {
this.downLoadToApp(appAttachInfo)

View File

@ -3,7 +3,7 @@
<div class="theme-slider-main">
{{ $t('panel.dashboard_theme') }}
</div>
<div class="theme-slider-position"/>
<div class="theme-slider-position" />
<div>
<slider
v-if="sliderShow"
@ -25,38 +25,38 @@
name="panel"
>
<el-row class="selector-div">
<overall-setting/>
<overall-setting />
</el-row>
</el-collapse-item>
<el-collapse-item
:title="$t('panel.panel_background')"
name="panelBackground"
>
<background-selector/>
<background-selector />
</el-collapse-item>
<el-collapse-item
:title="$t('panel.view_style')"
name="componentStyle"
>
<background-overall></background-overall>
<background-overall />
</el-collapse-item>
<el-collapse-item
:title="$t('panel.view_color_setting')"
name="graphical"
>
<panel-color-selector @onColorChange="onColorChange"/>
<panel-color-selector @onColorChange="onColorChange" />
</el-collapse-item>
<el-collapse-item
:title="$t('panel.chart_title')"
name="table"
>
<view-title @onTextChange="onTextChange"/>
<view-title @onTextChange="onTextChange" />
</el-collapse-item>
<el-collapse-item
:title="$t('panel.filter_component')"
name="filterComponent"
>
<FilterStyleSelector/>
<FilterStyleSelector />
</el-collapse-item>
</el-collapse>
</div>
@ -81,8 +81,10 @@ import BackgroundOverall from '@/views/background/BackgroundOverall'
export default {
components: {
BackgroundOverall,
// eslint-disable-next-line
Background,
FilterStyleSelector,
// eslint-disable-next-line
ComponentStyle,
ViewTitle,
slider,

View File

@ -49,7 +49,6 @@
<el-checkbox
v-model="overallSettingForm.refreshViewLoading"
class="el-input-refresh-loading"
:disabled="!overallSettingForm.refreshViewEnable"
@change="themeChange"
>{{ $t('panel.enable_view_loading') }}</el-checkbox>
</span>

View File

@ -71,8 +71,8 @@
</el-form>
<div class="de-row-rules">
<span>{{
positionCheck('appMarket') ? $t('app_template.datasource_info') : $t('datasource.basic_info')
}}</span>
positionCheck('appMarket') ? $t('app_template.datasource_info') : $t('datasource.basic_info')
}}</span>
</div>
<el-form
ref="historyDsForm"
@ -805,16 +805,16 @@ export default {
},
saveAppMarketHistory() {
this.$refs.historyDsForm.validate(valid => {
if (!valid) {
return false
}
const appApplyForm = {
...this.attachForm,
...this.historyDsForm
}
const method = this.formType === 'add' ? appApply : appEdit
this.appApplyMethod(method, appApplyForm)
if (!valid) {
return false
}
const appApplyForm = {
...this.attachForm,
...this.historyDsForm
}
const method = this.formType === 'add' ? appApply : appEdit
this.appApplyMethod(method, appApplyForm)
}
)
},
save() {
@ -960,10 +960,10 @@ export default {
}
if (this.positionCheck('appMarket')) {
this.$refs.attachParamsForm.validate(valid => {
if (!valid) {
return false
}
if (!valid) {
return false
}
}
)
}
this.$refs.dsForm.validate((valid) => {
@ -1108,10 +1108,10 @@ export default {
}
if (this.positionCheck('appMarket')) {
this.$refs.attachParamsForm.validate(valid => {
if (!valid) {
return false
}
if (!valid) {
return false
}
}
)
}
this.$refs.dsForm.validate((valid) => {

View File

@ -269,12 +269,16 @@
@tab-click="handleClick"
>
<el-tab-pane
:label="$t('datasource.relational_database')"
name="RDBMS"
label="OLTP"
name="OLTP"
/>
<el-tab-pane
:label="$t('datasource.non_relational_database')"
name="NORDBMS"
label="OLAP"
name="OLAP"
/>
<el-tab-pane
:label="$t('datasource.data_warehouse_lake')"
name="dataWarehouseLake"
/>
<el-tab-pane
:label="$t('datasource.other')"
@ -285,9 +289,9 @@
<template v-for="(list, idx) in databaseList">
<div
:key="nameMap[idx]"
:class="typeList[idx]"
:class="nameMap[idx]"
class="name"
>{{ $t(`datasource.${nameMap[idx]}`) }}</div>
>{{ nameClassMap[idx] }}</div>
<div
:key="nameMap[idx] + 'cont'"
class="item-container"
@ -346,14 +350,15 @@ export default {
},
data() {
return {
tabActive: 'RDBMS',
tabActive: 'OLTP',
databaseList: [],
currentNodeId: '',
dsTypeRelate: false,
expandedArray: [],
tData: [],
nameMap: ['relational_database', 'non_relational_database', 'other'],
typeList: ['RDBMS', 'NORDBMS', 'OTHER'],
nameMap: ['OLTP', 'OLAP', 'dataWarehouseLake', 'OTHER'],
nameClassMap: ['OLTP', 'OLAP', this.$t(`datasource.data_warehouse_lake`), this.$t(`datasource.other`)],
typeList: [['Db2', 'DM', 'KingBase', 'MariaDB', 'MongoDB', 'Mongodb-BI', 'MySQL', 'Oracle', 'PostgreSQL', 'SQL Server', 'TiDB'], ['Doris', 'Apache Impala', 'ClickHouse', 'Elasticsearch', 'Presto', 'StarRocks'], ['Apache Hive', 'Kylin', 'AWS Redshift', 'Maxcompute'], ['API']],
treeLoading: false,
dsTypes: [],
dsTypesForDriver: [],
@ -493,9 +498,9 @@ export default {
datasourceTypes() {
listDatasourceType().then((res) => {
this.dsTypes = res.data
const databaseList = [[], [], []]
const databaseList = [[], [], [], []]
this.dsTypes.forEach((item) => {
const index = this.typeList.findIndex(ele => ele === item.databaseClassification)
const index = this.typeList.findIndex(ele => ele.includes(item.name))
if (index !== -1) {
databaseList[index].push(item)
}

View File

@ -30,12 +30,12 @@
/>
</el-row>
<el-row class="top_banner_card">
<wizard-card :details="cardList[0]"/>
<wizard-card :details="cardList[0]" />
<wizard-card
:details="cardList[1]"
style="margin:0 24px 0 24px"
/>
<wizard-card-enterprise :details="cardList[2]"/>
<wizard-card-enterprise :details="cardList[2]" />
</el-row>
<el-row class="content_middle">
<div class="content_middle_left">
@ -44,15 +44,15 @@
<div class="content_middle_more"><a
target="_blank"
href="https://space.bilibili.com/510493147/channel/collectiondetail?sid=262774"
>{{ $t('wizard.more') }}<i class="el-icon-arrow-right"/></a></div>
>{{ $t('wizard.more') }}<i class="el-icon-arrow-right" /></a></div>
</el-row>
<el-row style="margin-top: 12px">
<video-card :details="videoList[0]"/>
<video-card :details="videoList[0]" />
<video-card
style="margin:0 12px 0 12px"
:details="videoList[1]"
/>
<video-card :details="videoList[2]"/>
<video-card :details="videoList[2]" />
</el-row>
</div>
<div class="content_middle_right">
@ -61,7 +61,7 @@
<div class="content_middle_more"><a
target="_blank"
href="https://blog.fit2cloud.com/?cat=321"
>{{ $t('wizard.more') }}<i class="el-icon-arrow-right"/></a></div>
>{{ $t('wizard.more') }}<i class="el-icon-arrow-right" /></a></div>
</el-row>
<el-row>
<ul class="ul-custom">
@ -93,10 +93,10 @@
</el-row>
<el-row class="contact_content">
{{ $t('wizard.web') }}<a
style="text-decoration:underline;"
target="_blank"
href="https://www.dataease.io"
>www.dataease.io</a>
style="text-decoration:underline;"
target="_blank"
href="https://www.dataease.io"
>www.dataease.io</a>
</el-row>
</div>