Merge branch 'v1.9' of github.com:dataease/dataease into v1.9

This commit is contained in:
taojinlong 2022-04-02 16:43:25 +08:00
commit 77a5ba4baf
21 changed files with 303 additions and 159 deletions

View File

@ -45,4 +45,7 @@ public interface ExtChartViewMapper {
void copyCacheToView(@Param("viewIds") List<String> viewIds ); void copyCacheToView(@Param("viewIds") List<String> viewIds );
int updateToCache(@Param("viewId") String viewId );
void copyCache(@Param("sourceViewId") String sourceViewId,@Param("newViewId") String newViewId);
} }

View File

@ -89,6 +89,69 @@
chart_view.id = #{id} chart_view.id = #{id}
</insert> </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>
<!-- <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,--> <!-- id, `name`, scene_id, table_id, `type`, title, create_by, create_time, update_time,-->
@ -200,8 +263,8 @@
`custom_filter`, `custom_filter`,
`drill_fields`, `drill_fields`,
`create_by`, `create_by`,
`create_time`, unix_timestamp()*1000 as `create_time`,
`update_time`, unix_timestamp()*1000 as `update_time`,
`snapshot`, `snapshot`,
`style_priority`, `style_priority`,
`ext_stack`, `ext_stack`,
@ -404,4 +467,37 @@
#{viewId} #{viewId}
</foreach> </foreach>
</update> </update>
<update id="updateToCache">
UPDATE chart_view_cache cv,
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}
</update>
</mapper> </mapper>

View File

@ -5,8 +5,8 @@ import org.apache.ibatis.annotations.Param;
public interface ExtSysAuthMapper { public interface ExtSysAuthMapper {
Boolean checkTreeNoManageCount(@Param("userId") Long userId , @Param("modelType") String modelType, @Param("nodeId") String nodeId); Boolean checkTreeNoManageCount(@Param("userId") Long userId, @Param("modelType") String modelType, @Param("nodeId") String nodeId);
String copyAuth(@Param("authSource") String authSource, @Param("authSourceType") String authSourceType, @Param("authUser") String authUser);
} }

View File

@ -14,4 +14,8 @@
select if(CHECK_TREE_NO_MANAGE_PRIVILEGE(#{userId},#{modelType},#{nodeId})>0,1,0) select if(CHECK_TREE_NO_MANAGE_PRIVILEGE(#{userId},#{modelType},#{nodeId})>0,1,0)
</select> </select>
<select id="copyAuth" resultType="String">
select copy_auth(#{authSource},#{authSourceType},#{authUser})
</select>
</mapper> </mapper>

View File

@ -0,0 +1,16 @@
package io.dataease.commons.constants;
/**
* Author: wangjiahao
* Date: 2022/4/2
* Description:
*/
public class SysAuthConstants {
public final static String AUTH_SOURCE_TYPE_PANEL = "panel";
public final static String AUTH_SOURCE_TYPE_DATASET = "dataset";
public final static String AUTH_SOURCE_TYPE_DATASOURCE = "link";
}

View File

@ -13,6 +13,7 @@ import io.dataease.controller.request.chart.ChartViewCacheRequest;
import io.dataease.controller.request.chart.ChartViewRequest; import io.dataease.controller.request.chart.ChartViewRequest;
import io.dataease.controller.response.ChartDetail; import io.dataease.controller.response.ChartDetail;
import io.dataease.dto.chart.ChartViewDTO; import io.dataease.dto.chart.ChartViewDTO;
import io.dataease.service.chart.ChartViewCacheService;
import io.dataease.service.chart.ChartViewService; import io.dataease.service.chart.ChartViewService;
import io.dataease.service.panel.PanelViewService; import io.dataease.service.panel.PanelViewService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -34,8 +35,9 @@ import java.util.List;
public class ChartViewController { public class ChartViewController {
@Resource @Resource
private ChartViewService chartViewService; private ChartViewService chartViewService;
@Resource @Resource
private PanelViewService panelViewService; private ChartViewCacheService chartViewCacheService;
@DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE) @DePermission(type = DePermissionType.PANEL, level = ResourceAuthLevel.PANNEL_LEVEL_MANAGE)
@ApiOperation("保存") @ApiOperation("保存")
@ -150,7 +152,7 @@ public class ChartViewController {
@ApiOperation("重置视图缓存") @ApiOperation("重置视图缓存")
@PostMapping("/resetViewCache/{id}/{panelId}") @PostMapping("/resetViewCache/{id}/{panelId}")
public void resetViewCache(@PathVariable String id, @PathVariable String panelId) { public void resetViewCache(@PathVariable String id, @PathVariable String panelId) {
chartViewService.resetViewCache(id); chartViewCacheService.refreshCache(id);
} }
} }

View File

@ -0,0 +1,28 @@
package io.dataease.service.chart;
import io.dataease.base.mapper.ChartViewCacheMapper;
import io.dataease.base.mapper.ext.ExtChartViewMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
/**
* Author: wangjiahao
* Date: 2022/4/2
* Description:
*/
@Service
public class ChartViewCacheService {
@Resource
private ExtChartViewMapper extChartViewMapper;
@Transactional
public void refreshCache(String viewId){
if(extChartViewMapper.updateToCache(viewId)==0){
extChartViewMapper.copyToCache(viewId);
}
}
}

View File

@ -97,6 +97,8 @@ public class ChartViewService {
private PanelGroupExtendDataService extendDataService; private PanelGroupExtendDataService extendDataService;
@Resource @Resource
private ExtPanelGroupExtendDataMapper extPanelGroupExtendDataMapper; private ExtPanelGroupExtendDataMapper extPanelGroupExtendDataMapper;
@Resource
private ChartViewCacheService chartViewCacheService;
//默认使用非公平 //默认使用非公平
@ -130,7 +132,7 @@ public class ChartViewService {
chartView.setUpdateTime(timestamp); chartView.setUpdateTime(timestamp);
chartViewMapper.insertSelective(chartView); chartViewMapper.insertSelective(chartView);
// 新建的视图也存入缓存表中 // 新建的视图也存入缓存表中
extChartViewMapper.copyToCache(chartView.getId()); chartViewCacheService.refreshCache(chartView.getId());
PanelView newPanelView = new PanelView(); PanelView newPanelView = new PanelView();
newPanelView.setId(UUIDUtil.getUUIDAsString()); newPanelView.setId(UUIDUtil.getUUIDAsString());
@ -154,27 +156,6 @@ public class ChartViewService {
}); });
} }
// // 直接保存统一到缓存表
// 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);
@ -268,7 +249,7 @@ public class ChartViewService {
//仪表板编辑页面 从缓存表中取数据 缓存表中没有数据则进行插入 //仪表板编辑页面 从缓存表中取数据 缓存表中没有数据则进行插入
result = extChartViewMapper.searchOneFromCache(id); result = extChartViewMapper.searchOneFromCache(id);
if (result == null) { if (result == null) {
extChartViewMapper.copyToCache(id); chartViewCacheService.refreshCache(id);
result = extChartViewMapper.searchOneFromCache(id); result = extChartViewMapper.searchOneFromCache(id);
} }
} else { } else {
@ -1047,8 +1028,9 @@ public class ChartViewService {
public String chartCopy(String id, String panelId) { public String chartCopy(String id, String panelId) {
String newChartId = UUID.randomUUID().toString(); String newChartId = UUID.randomUUID().toString();
extChartViewMapper.chartCopy(newChartId, id, panelId); extChartViewMapper.chartCopy(newChartId, id, panelId);
extChartViewMapper.copyCache(id,newChartId);
extPanelGroupExtendDataMapper.copyExtendData(id,newChartId,panelId); extPanelGroupExtendDataMapper.copyExtendData(id,newChartId,panelId);
extChartViewMapper.copyToCache(newChartId); chartViewCacheService.refreshCache(id);
return newChartId; return newChartId;
} }
@ -1082,9 +1064,4 @@ public class ChartViewService {
extChartViewMapper.deleteCacheWithPanel(panelId); extChartViewMapper.deleteCacheWithPanel(panelId);
} }
public void resetViewCache(String viewId) {
extChartViewMapper.deleteViewCache(viewId);
extChartViewMapper.copyToCache(viewId);
}
} }

View File

@ -7,6 +7,7 @@ import io.dataease.base.mapper.DatasetGroupMapper;
import io.dataease.base.mapper.ext.ExtDataSetGroupMapper; import io.dataease.base.mapper.ext.ExtDataSetGroupMapper;
import io.dataease.commons.constants.AuthConstants; import io.dataease.commons.constants.AuthConstants;
import io.dataease.commons.constants.DePermissionType; import io.dataease.commons.constants.DePermissionType;
import io.dataease.commons.constants.SysAuthConstants;
import io.dataease.commons.utils.AuthUtils; import io.dataease.commons.utils.AuthUtils;
import io.dataease.commons.utils.BeanUtils; import io.dataease.commons.utils.BeanUtils;
import io.dataease.commons.utils.TreeUtils; import io.dataease.commons.utils.TreeUtils;
@ -54,8 +55,10 @@ public class DataSetGroupService {
datasetGroup.setCreateBy(AuthUtils.getUser().getUsername()); datasetGroup.setCreateBy(AuthUtils.getUser().getUsername());
datasetGroup.setCreateTime(System.currentTimeMillis()); datasetGroup.setCreateTime(System.currentTimeMillis());
datasetGroupMapper.insert(datasetGroup); datasetGroupMapper.insert(datasetGroup);
String userName = AuthUtils.getUser().getUsername();
// 清理权限缓存 // 清理权限缓存
CacheUtils.removeAll(AuthConstants.USER_PERMISSION_CACHE_NAME); CacheUtils.removeAll(AuthConstants.USER_PERMISSION_CACHE_NAME);
sysAuthService.copyAuth(datasetGroup.getId(), SysAuthConstants.AUTH_SOURCE_TYPE_DATASET);
} else { } else {
datasetGroupMapper.updateByPrimaryKeySelective(datasetGroup); datasetGroupMapper.updateByPrimaryKeySelective(datasetGroup);
} }

View File

@ -33,6 +33,7 @@ import io.dataease.provider.datasource.JdbcProvider;
import io.dataease.provider.DDLProvider; import io.dataease.provider.DDLProvider;
import io.dataease.provider.QueryProvider; import io.dataease.provider.QueryProvider;
import io.dataease.service.engine.EngineService; import io.dataease.service.engine.EngineService;
import io.dataease.service.sys.SysAuthService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -102,6 +103,8 @@ public class DataSetTableService {
private PermissionService permissionService; private PermissionService permissionService;
@Resource @Resource
private EngineService engineService; private EngineService engineService;
@Resource
private SysAuthService sysAuthService;
private static boolean isUpdatingDatasetTableStatus = false; private static boolean isUpdatingDatasetTableStatus = false;
private static final String lastUpdateTime = "${__last_update_time__}"; private static final String lastUpdateTime = "${__last_update_time__}";
@ -261,6 +264,10 @@ public class DataSetTableService {
datasetTable.setCreateBy(AuthUtils.getUser().getUsername()); datasetTable.setCreateBy(AuthUtils.getUser().getUsername());
datasetTable.setCreateTime(System.currentTimeMillis()); datasetTable.setCreateTime(System.currentTimeMillis());
int insert = datasetTableMapper.insert(datasetTable); int insert = datasetTableMapper.insert(datasetTable);
// 清理权限缓存
CacheUtils.removeAll(AuthConstants.USER_PERMISSION_CACHE_NAME);
sysAuthService.copyAuth(datasetTable.getId(), SysAuthConstants.AUTH_SOURCE_TYPE_DATASET);
// 添加表成功后获取当前表字段和类型抽象到dataease数据库 // 添加表成功后获取当前表字段和类型抽象到dataease数据库
if (insert == 1) { if (insert == 1) {
saveTableField(datasetTable); saveTableField(datasetTable);

View File

@ -11,6 +11,7 @@ import io.dataease.base.mapper.DatasourceMapper;
import io.dataease.base.mapper.ext.ExtDataSourceMapper; import io.dataease.base.mapper.ext.ExtDataSourceMapper;
import io.dataease.base.mapper.ext.query.GridExample; import io.dataease.base.mapper.ext.query.GridExample;
import io.dataease.commons.constants.DePermissionType; import io.dataease.commons.constants.DePermissionType;
import io.dataease.commons.constants.SysAuthConstants;
import io.dataease.commons.exception.DEException; import io.dataease.commons.exception.DEException;
import io.dataease.commons.model.AuthURD; import io.dataease.commons.model.AuthURD;
import io.dataease.commons.utils.AuthUtils; import io.dataease.commons.utils.AuthUtils;
@ -34,6 +35,7 @@ import io.dataease.provider.datasource.ApiProvider;
import io.dataease.provider.datasource.DatasourceProvider; import io.dataease.provider.datasource.DatasourceProvider;
import io.dataease.service.dataset.DataSetGroupService; import io.dataease.service.dataset.DataSetGroupService;
import io.dataease.service.message.DeMsgutil; import io.dataease.service.message.DeMsgutil;
import io.dataease.service.sys.SysAuthService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -57,6 +59,8 @@ public class DatasourceService {
private DataSetGroupService dataSetGroupService; private DataSetGroupService dataSetGroupService;
@Resource @Resource
private CommonThreadPool commonThreadPool; private CommonThreadPool commonThreadPool;
@Resource
private SysAuthService sysAuthService;
private static List<String> dsTypes = Arrays.asList("TiDB", "StarRocks", "excel", "mysql", "hive", "impala", "mariadb", "ds_doris", "pg", "sqlServer", "oracle", "mongo", "ck", "db2", "es", "redshift", "api"); private static List<String> dsTypes = Arrays.asList("TiDB", "StarRocks", "excel", "mysql", "hive", "impala", "mariadb", "ds_doris", "pg", "sqlServer", "oracle", "mongo", "ck", "db2", "es", "redshift", "api");
@DeCleaner(DePermissionType.DATASOURCE) @DeCleaner(DePermissionType.DATASOURCE)
@ -73,6 +77,7 @@ public class DatasourceService {
checkAndUpdateDatasourceStatus(datasource); checkAndUpdateDatasourceStatus(datasource);
datasourceMapper.insertSelective(datasource); datasourceMapper.insertSelective(datasource);
handleConnectionPool(datasource, "add"); handleConnectionPool(datasource, "add");
sysAuthService.copyAuth(datasource.getId(), SysAuthConstants.AUTH_SOURCE_TYPE_DATASOURCE);
return datasource; return datasource;
} }

View File

@ -6,10 +6,7 @@ import io.dataease.auth.annotation.DeCleaner;
import io.dataease.base.domain.*; import io.dataease.base.domain.*;
import io.dataease.base.mapper.*; import io.dataease.base.mapper.*;
import io.dataease.base.mapper.ext.*; import io.dataease.base.mapper.ext.*;
import io.dataease.commons.constants.AuthConstants; import io.dataease.commons.constants.*;
import io.dataease.commons.constants.CommonConstants;
import io.dataease.commons.constants.DePermissionType;
import io.dataease.commons.constants.PanelConstants;
import io.dataease.commons.utils.AuthUtils; 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;
@ -31,6 +28,7 @@ import io.dataease.service.dataset.DataSetTableService;
import io.dataease.service.sys.SysAuthService; import io.dataease.service.sys.SysAuthService;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.pentaho.di.core.util.UUIDUtil; import org.pentaho.di.core.util.UUIDUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -94,7 +92,6 @@ public class PanelGroupService {
@Resource @Resource
private ExtPanelGroupExtendDataMapper extPanelGroupExtendDataMapper; private ExtPanelGroupExtendDataMapper extPanelGroupExtendDataMapper;
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());
panelGroupRequest.setUserId(userId); panelGroupRequest.setUserId(userId);
@ -110,22 +107,21 @@ public class PanelGroupService {
} }
@DeCleaner(DePermissionType.PANEL) @DeCleaner(DePermissionType.PANEL)
// @Transactional
public PanelGroup saveOrUpdate(PanelGroupRequest request) { public PanelGroup saveOrUpdate(PanelGroupRequest request) {
String userName = AuthUtils.getUser().getUsername();
String panelId = request.getId(); String panelId = request.getId();
if(StringUtils.isNotEmpty(panelId)){ if(StringUtils.isNotEmpty(panelId)){
panelViewService.syncPanelViews(request); panelViewService.syncPanelViews(request);
} }
if (StringUtils.isEmpty(panelId)) { if (StringUtils.isEmpty(panelId)) { // 新建
// 新建
checkPanelName(request.getName(), request.getPid(), PanelConstants.OPT_TYPE_INSERT, null, request.getNodeType()); checkPanelName(request.getName(), request.getPid(), PanelConstants.OPT_TYPE_INSERT, null, request.getNodeType());
panelId = newPanel(request); panelId = newPanel(request);
panelGroupMapper.insert(request); panelGroupMapper.insert(request);
// 清理权限缓存 // 清理权限缓存
clearPermissionCache(); clearPermissionCache();
} else if ("toDefaultPanel".equals(request.getOptType())) { sysAuthService.copyAuth(panelId, SysAuthConstants.AUTH_SOURCE_TYPE_PANEL);
} else if ("toDefaultPanel".equals(request.getOptType())) { // 转存为默认仪表板
panelId = UUID.randomUUID().toString(); panelId = UUID.randomUUID().toString();
// 转存为默认仪表板
PanelGroupWithBLOBs newDefaultPanel = panelGroupMapper.selectByPrimaryKey(request.getId()); PanelGroupWithBLOBs newDefaultPanel = panelGroupMapper.selectByPrimaryKey(request.getId());
newDefaultPanel.setPanelType(PanelConstants.PANEL_TYPE_SYSTEM); newDefaultPanel.setPanelType(PanelConstants.PANEL_TYPE_SYSTEM);
newDefaultPanel.setNodeType(PanelConstants.PANEL_NODE_TYPE_PANEL); newDefaultPanel.setNodeType(PanelConstants.PANEL_NODE_TYPE_PANEL);
@ -139,10 +135,12 @@ public class PanelGroupService {
panelGroupMapper.insertSelective(newDefaultPanel); panelGroupMapper.insertSelective(newDefaultPanel);
// 清理权限缓存 // 清理权限缓存
clearPermissionCache(); clearPermissionCache();
sysAuthService.copyAuth(panelId, SysAuthConstants.AUTH_SOURCE_TYPE_PANEL);
} else if ("copy".equals(request.getOptType())) { } else if ("copy".equals(request.getOptType())) {
panelId = this.panelGroupCopy(request, null, true); panelId = this.panelGroupCopy(request, null, true);
// 清理权限缓存 // 清理权限缓存
clearPermissionCache(); clearPermissionCache();
sysAuthService.copyAuth(panelId, SysAuthConstants.AUTH_SOURCE_TYPE_PANEL);
} else if ("move".equals(request.getOptType())) { } else if ("move".equals(request.getOptType())) {
PanelGroupWithBLOBs panelInfo = panelGroupMapper.selectByPrimaryKey(request.getId()); PanelGroupWithBLOBs panelInfo = panelGroupMapper.selectByPrimaryKey(request.getId());
if (panelInfo.getPid().equalsIgnoreCase(request.getPid())) { if (panelInfo.getPid().equalsIgnoreCase(request.getPid())) {
@ -447,5 +445,4 @@ public class PanelGroupService {
CacheUtils.removeAll(AuthConstants.DEPT_PANEL_NAME); CacheUtils.removeAll(AuthConstants.DEPT_PANEL_NAME);
} }
} }

View File

@ -20,4 +20,9 @@ public class SysAuthService {
} }
} }
public void copyAuth(String authSource,String authSourceType){
String userName = AuthUtils.getUser().getUsername();
extSysAuthMapper.copyAuth(authSource,authSourceType,userName);
}
} }

View File

@ -101,9 +101,7 @@ ADD COLUMN `copy_from` varchar(255) NULL COMMENT '复制来源' AFTER `update_ti
ADD COLUMN `copy_id` varchar(255) NULL COMMENT '复制ID' AFTER `copy_from`; ADD COLUMN `copy_id` varchar(255) NULL COMMENT '复制ID' AFTER `copy_from`;
-- ----------------------------
-- Function structure for copy_auth
-- ----------------------------
DROP FUNCTION IF EXISTS `copy_auth`; DROP FUNCTION IF EXISTS `copy_auth`;
delimiter ;; delimiter ;;
CREATE FUNCTION `copy_auth`(authSource varchar(255),authSourceType varchar(255),authUser varchar(255)) CREATE FUNCTION `copy_auth`(authSource varchar(255),authSourceType varchar(255),authUser varchar(255))
@ -130,25 +128,25 @@ select id from sys_auth where sys_auth.auth_source=authSource and sys_auth.auth
delete from sys_auth where sys_auth.auth_source=authSource and sys_auth.auth_source_type=authSourceType; delete from sys_auth where sys_auth.auth_source=authSource and sys_auth.auth_source_type=authSourceType;
INSERT INTO sys_auth ( INSERT INTO sys_auth (
id, id,
auth_source, auth_source,
auth_source_type, auth_source_type,
auth_target, auth_target,
auth_target_type, auth_target_type,
auth_time, auth_time,
auth_user auth_user
) )
VALUES VALUES
( (
authId, authId,
authSource, authSource,
authSourceType, authSourceType,
userId, userId,
'user', 'user',
unix_timestamp( unix_timestamp(
now())* 1000,'auto'); now())* 1000,'auto');
INSERT INTO sys_auth_detail ( INSERT INTO sys_auth_detail (
id, id,
auth_id, auth_id,
privilege_name, privilege_name,
@ -175,50 +173,52 @@ VALUES
insert into sys_auth( insert into sys_auth(
id, id,
auth_source, auth_source,
auth_source_type, auth_source_type,
auth_target, auth_target,
auth_target_type, auth_target_type,
auth_time, auth_time,
auth_user, auth_user,
copy_from, copy_from,
copy_id copy_id
) )
SELECT SELECT
uuid() as id, uuid() as id,
authSource as auth_source, authSource as auth_source,
authSourceType as auth_source_type, authSourceType as auth_source_type,
auth_target, auth_target,
auth_target_type, auth_target_type,
NOW()* 1000 as auth_time, NOW()* 1000 as auth_time,
'auto' as auth_user, 'auto' as auth_user,
id as copy_from, id as copy_from,
copyId as copy_id copyId as copy_id
FROM FROM
sys_auth sys_auth
WHERE WHERE
auth_source IN ( auth_source = (
SELECT SELECT
pid pid
FROM FROM
v_auth_model v_auth_model
WHERE WHERE
id = authSource id = authSource
AND model_type = authSourceType AND model_type = authSourceType
) )
AND auth_source_type = authSourceType; AND auth_source_type = authSourceType
and concat(auth_target,'-',auth_target_type) !=CONCAT(userId,'-','user');
INSERT INTO sys_auth_detail ( INSERT INTO sys_auth_detail (
id, id,
auth_id, auth_id,
privilege_name, privilege_name,
privilege_type, privilege_type,
privilege_value, privilege_value,
privilege_extend, privilege_extend,
remark, remark,
create_user, create_user,
create_time, create_time,
copy_from, copy_from,
copy_id copy_id
) SELECT ) SELECT
uuid() AS id, uuid() AS id,
sa_copy.t_id AS auth_id, sa_copy.t_id AS auth_id,
@ -233,16 +233,38 @@ now())* 1000 AS create_time,
id AS copy_from, id AS copy_from,
copyId AS copy_id copyId AS copy_id
FROM FROM
sys_auth_detail sys_auth_detail
INNER JOIN ( INNER JOIN (
SELECT SELECT
id AS t_id, id AS t_id,
copy_from AS s_id copy_from AS s_id
FROM FROM
sys_auth sys_auth
WHERE WHERE
copy_id = copyId copy_id = copyId
) sa_copy ON sys_auth_detail.auth_id = sa_copy.s_id; ) sa_copy ON sys_auth_detail.auth_id = sa_copy.s_id;
RETURN 'success';
END
;;
delimiter ;
-- ----------------------------
-- Function structure for delete_auth_source
-- ----------------------------
DROP FUNCTION IF EXISTS `delete_auth_source`;
delimiter ;;
CREATE FUNCTION `delete_auth_source`(authSource varchar(255),authSourceType varchar(255))
RETURNS varchar(255) CHARSET utf8mb4
READS SQL DATA
BEGIN
delete from sys_auth_detail where auth_id in (
select id from sys_auth where sys_auth.auth_source=authSource and sys_auth.auth_source_type=authSourceType
);
delete from sys_auth where sys_auth.auth_source=authSource and sys_auth.auth_source_type=authSourceType;
RETURN 'success'; RETURN 'success';
@ -336,3 +358,8 @@ CREATE TABLE `panel_outer_params_target_view_info` (
SET FOREIGN_KEY_CHECKS = 1; SET FOREIGN_KEY_CHECKS = 1;
update `my_plugin` set `name` = 'X-Pack默认插件' where `plugin_id` = 1; update `my_plugin` set `name` = 'X-Pack默认插件' where `plugin_id` = 1;
update `my_plugin` set `module_name` = 'view-bubblemap-backend' where `plugin_id` = 2; update `my_plugin` set `module_name` = 'view-bubblemap-backend' where `plugin_id` = 2;
DROP TRIGGER `new_auth_panel`;
DROP TRIGGER `new_auth_dataset_group`;
DROP TRIGGER `new_auth_dataset_table`;
DROP TRIGGER `new_auth_link`;

View File

@ -244,8 +244,6 @@ export default {
'picture-add': [ 'picture-add': [
'borderStyle', 'borderStyle',
'borderWidth', 'borderWidth',
'borderRadius',
'opacity',
'borderColor', 'borderColor',
'hyperlinks' 'hyperlinks'
], ],
@ -254,15 +252,12 @@ export default {
'fontSize', 'fontSize',
'fontWeight', 'fontWeight',
'letterSpacing', 'letterSpacing',
'color', 'color'
'backgroundColor'
], ],
// tab // tab
'de-tabs': [ 'de-tabs': [
'borderStyle', 'borderStyle',
'borderWidth', 'borderWidth',
'borderRadius',
'opacity',
'borderColor', 'borderColor',
'deTabStyle' 'deTabStyle'
], ],
@ -270,20 +265,14 @@ export default {
'rect-shape': [ 'rect-shape': [
'borderStyle', 'borderStyle',
'borderWidth', 'borderWidth',
'borderRadius', 'borderColor'
'opacity',
'borderColor',
'backgroundColor'
], ],
// //
'de-show-date': [ 'de-show-date': [
'textAlign', 'textAlign',
'fontSize', 'fontSize',
'fontWeight', 'fontWeight',
'opacity',
'borderRadius',
'color', 'color',
'backgroundColor',
'date-format', 'date-format',
'time_margin', 'time_margin',
'padding' 'padding'
@ -295,10 +284,7 @@ export default {
'fontSize', 'fontSize',
'fontWeight', 'fontWeight',
'letterSpacing', 'letterSpacing',
'opacity',
'borderRadius',
'color', 'color',
'backgroundColor',
'hyperlinks' 'hyperlinks'
], ],
'de-video': [ 'de-video': [
@ -405,9 +391,9 @@ export default {
this.innerOpacity = this.styleInfo['opacity'] * 100 this.innerOpacity = this.styleInfo['opacity'] * 100
} }
if (this.curComponent.type === 'v-text') { if (this.curComponent.type === 'v-text') {
this.mainWidthOffset = 600 this.mainWidthOffset = 400
} else if (this.curComponent.type === 'de-show-date') { } else if (this.curComponent.type === 'de-show-date') {
this.mainWidthOffset = 600 this.mainWidthOffset = 350
} else { } else {
this.mainWidthOffset = document.getElementById('main-attr').offsetWidth - 50 this.mainWidthOffset = document.getElementById('main-attr').offsetWidth - 50
} }

View File

@ -264,7 +264,7 @@ export default {
return this.canvasStyleData.panel.resultCount return this.canvasStyleData.panel.resultCount
}, },
innerPadding() { innerPadding() {
return this.element.commonBackground.innerPadding || 0 return this.element.commonBackground && this.element.commonBackground.innerPadding || 0
}, },
...mapState([ ...mapState([
'canvasStyleData', 'canvasStyleData',
@ -758,9 +758,11 @@ export default {
this.chart.customStyle = param.viewInfo.customStyle this.chart.customStyle = param.viewInfo.customStyle
this.chart.senior = param.viewInfo.senior this.chart.senior = param.viewInfo.senior
this.chart.title = param.viewInfo.title this.chart.title = param.viewInfo.title
this.chart.stylePriority = param.viewInfo.stylePriority
this.sourceCustomAttrStr = this.chart.customAttr this.sourceCustomAttrStr = this.chart.customAttr
this.sourceCustomStyleStr = this.chart.customStyle this.sourceCustomStyleStr = this.chart.customStyle
this.mergeScale() this.mergeScale()
this.mergeStyle()
} }
} }
} }

View File

@ -208,9 +208,7 @@ const list = [
letterSpacing: 0, letterSpacing: 0,
textAlign: 'center', textAlign: 'center',
color: '#000000', color: '#000000',
verticalAlign: 'middle', verticalAlign: 'middle'
backgroundColor: '#ffffff',
borderRadius: 0
}, },
hyperlinks: HYPERLINKS, hyperlinks: HYPERLINKS,
x: 1, x: 1,
@ -255,8 +253,7 @@ const list = [
mobileStyle: BASE_MOBILE_STYLE, mobileStyle: BASE_MOBILE_STYLE,
style: { style: {
width: 300, width: 300,
height: 200, height: 200
borderRadius: ''
}, },
x: 1, x: 1,
y: 1, y: 1,
@ -296,9 +293,7 @@ const list = [
height: 200, height: 200,
borderStyle: 'solid', borderStyle: 'solid',
borderWidth: 0, borderWidth: 0,
borderColor: '#000000', borderColor: '#000000'
backgroundColor: '#ffffff',
borderRadius: 0
}, },
x: 1, x: 1,
y: 1, y: 1,
@ -317,8 +312,7 @@ const list = [
mobileStyle: BASE_MOBILE_STYLE, mobileStyle: BASE_MOBILE_STYLE,
style: { style: {
width: 300, width: 300,
height: 200, height: 200
borderRadius: ''
}, },
x: 1, x: 1,
y: 36, y: 36,
@ -341,9 +335,7 @@ const list = [
height: 200, height: 200,
borderStyle: 'solid', borderStyle: 'solid',
borderWidth: 0, borderWidth: 0,
borderColor: '#000000', borderColor: '#000000'
backgroundColor: '#ffffff',
borderRadius: 0
}, },
options: { options: {
tabList: [{ tabList: [{
@ -377,10 +369,8 @@ const list = [
textAlign: 'center', textAlign: 'center',
color: '#000000', color: '#000000',
verticalAlign: 'middle', verticalAlign: 'middle',
backgroundColor: '#ffffff',
borderStyle: 'solid', borderStyle: 'solid',
borderColor: '#000000', borderColor: '#000000',
borderRadius: 0,
time_margin: 0, time_margin: 0,
padding: 10 padding: 10
}, },
@ -408,8 +398,7 @@ const list = [
mobileStyle: BASE_MOBILE_STYLE, mobileStyle: BASE_MOBILE_STYLE,
style: { style: {
width: 400, width: 400,
height: 200, height: 200
borderRadius: ''
}, },
frameLinks: FRAMELINKS, frameLinks: FRAMELINKS,
x: 1, x: 1,
@ -430,8 +419,7 @@ const list = [
hyperlinks: HYPERLINKS, hyperlinks: HYPERLINKS,
style: { style: {
width: 400, width: 400,
height: 200, height: 200
borderRadius: ''
}, },
x: 1, x: 1,
y: 1, y: 1,
@ -450,8 +438,7 @@ const list = [
mobileStyle: BASE_MOBILE_STYLE, mobileStyle: BASE_MOBILE_STYLE,
style: { style: {
width: 400, width: 400,
height: 200, height: 200
borderRadius: ''
}, },
videoLinks: VIDEOLINKS, videoLinks: VIDEOLINKS,
x: 1, x: 1,
@ -471,8 +458,7 @@ const list = [
mobileStyle: BASE_MOBILE_STYLE, mobileStyle: BASE_MOBILE_STYLE,
style: { style: {
width: 400, width: 400,
height: 200, height: 200
borderRadius: ''
}, },
streamMediaLinks: STREAMMEDIALINKS, streamMediaLinks: STREAMMEDIALINKS,
x: 1, x: 1,

View File

@ -142,7 +142,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-show="chart.type" :label="$t('chart.space_split')" class="form-item"> <el-form-item v-show="chart.type" :label="$t('chart.space_split')" class="form-item">
<el-input-number v-model="sizeForm.spaceSplit" min="0" size="mini" @change="changeBarSizeCase" /> <el-input-number v-model="sizeForm.spaceSplit" :min="0" size="mini" @change="changeBarSizeCase" />
</el-form-item> </el-form-item>
</el-form> </el-form>

View File

@ -168,7 +168,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-show="chart.type" :label="$t('chart.space_split')" class="form-item"> <el-form-item v-show="chart.type" :label="$t('chart.space_split')" class="form-item">
<el-input-number v-model="sizeForm.spaceSplit" min="0" size="mini" @change="changeBarSizeCase" /> <el-input-number v-model="sizeForm.spaceSplit" :min="0" size="mini" @change="changeBarSizeCase" />
</el-form-item> </el-form-item>
</el-form> </el-form>

View File

@ -1749,6 +1749,7 @@ export default {
view.customFilter = JSON.stringify(this.view.customFilter) view.customFilter = JSON.stringify(this.view.customFilter)
view.senior = JSON.stringify(this.view.senior) view.senior = JSON.stringify(this.view.senior)
view.title = this.view.title view.title = this.view.title
view.stylePriority = this.view.stylePriority
// view.data = this.data // view.data = this.data
this.chart = view this.chart = view

View File

@ -46,7 +46,6 @@
<svg-icon icon-class="panel" class="ds-icon-scene" /> <svg-icon icon-class="panel" class="ds-icon-scene" />
</span> </span>
<span v-else> <span v-else>
<svg-icon :icon-class="data.modelInnerType" style="width: 14px;height: 14px" />
<svg-icon :icon-class="data.isPlugin ? ('/api/pluginCommon/staticInfo/' + data.modelInnerType + '/svg') : data.modelInnerType" style="width: 14px;height: 14px" /> <svg-icon :icon-class="data.isPlugin ? ('/api/pluginCommon/staticInfo/' + data.modelInnerType + '/svg') : data.modelInnerType" style="width: 14px;height: 14px" />
</span> </span>
<span style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" :title="data.name">{{ data.name }}</span> <span style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" :title="data.name">{{ data.name }}</span>