forked from github/dataease
Merge pull request #9056 from dataease/pr@dev-v2@refactor_matrix
refactor(仪表板): 调整仪表板矩阵密度,组件可以更精细化调整位置大小
This commit is contained in:
commit
ef7c2d9a5b
@ -25,7 +25,7 @@ public class MybatisPlusGenerator {
|
|||||||
/**
|
/**
|
||||||
* 这是要生成代码的表名称
|
* 这是要生成代码的表名称
|
||||||
*/
|
*/
|
||||||
private static final String TABLE_NAME = "visualization_outer_params_target_view_info";
|
private static final String TABLE_NAME = "data_visualization_info";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下面两个配置基本上不用动
|
* 下面两个配置基本上不用动
|
||||||
|
@ -9,7 +9,7 @@ import java.io.Serializable;
|
|||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author fit2cloud
|
* @author fit2cloud
|
||||||
* @since 2023-05-11
|
* @since 2024-04-11
|
||||||
*/
|
*/
|
||||||
@TableName("data_visualization_info")
|
@TableName("data_visualization_info")
|
||||||
public class DataVisualizationInfo implements Serializable {
|
public class DataVisualizationInfo implements Serializable {
|
||||||
@ -123,6 +123,11 @@ public class DataVisualizationInfo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String deleteBy;
|
private String deleteBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 可视化资源版本
|
||||||
|
*/
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -299,6 +304,14 @@ public class DataVisualizationInfo implements Serializable {
|
|||||||
this.deleteBy = deleteBy;
|
this.deleteBy = deleteBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getVersion() {
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVersion(Integer version) {
|
||||||
|
this.version = version;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "DataVisualizationInfo{" +
|
return "DataVisualizationInfo{" +
|
||||||
@ -324,6 +337,7 @@ public class DataVisualizationInfo implements Serializable {
|
|||||||
", deleteFlag = " + deleteFlag +
|
", deleteFlag = " + deleteFlag +
|
||||||
", deleteTime = " + deleteTime +
|
", deleteTime = " + deleteTime +
|
||||||
", deleteBy = " + deleteBy +
|
", deleteBy = " + deleteBy +
|
||||||
|
", version = " + version +
|
||||||
"}";
|
"}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author fit2cloud
|
* @author fit2cloud
|
||||||
* @since 2023-05-11
|
* @since 2024-04-11
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface DataVisualizationInfoMapper extends BaseMapper<DataVisualizationInfo> {
|
public interface DataVisualizationInfoMapper extends BaseMapper<DataVisualizationInfo> {
|
||||||
|
@ -123,6 +123,7 @@ public class CoreVisualizationManage {
|
|||||||
visualizationInfo.setCreateTime(System.currentTimeMillis());
|
visualizationInfo.setCreateTime(System.currentTimeMillis());
|
||||||
visualizationInfo.setUpdateTime(System.currentTimeMillis());
|
visualizationInfo.setUpdateTime(System.currentTimeMillis());
|
||||||
visualizationInfo.setOrgId(AuthUtils.getUser().getDefaultOid());
|
visualizationInfo.setOrgId(AuthUtils.getUser().getDefaultOid());
|
||||||
|
visualizationInfo.setVersion(3);
|
||||||
mapper.insert(visualizationInfo);
|
mapper.insert(visualizationInfo);
|
||||||
coreOptRecentManage.saveOpt(visualizationInfo.getId(), OptConstants.OPT_RESOURCE_TYPE.VISUALIZATION, OptConstants.OPT_TYPE.NEW);
|
coreOptRecentManage.saveOpt(visualizationInfo.getId(), OptConstants.OPT_RESOURCE_TYPE.VISUALIZATION, OptConstants.OPT_TYPE.NEW);
|
||||||
return visualizationInfo.getId();
|
return visualizationInfo.getId();
|
||||||
@ -132,6 +133,7 @@ public class CoreVisualizationManage {
|
|||||||
public void innerEdit(DataVisualizationInfo visualizationInfo) {
|
public void innerEdit(DataVisualizationInfo visualizationInfo) {
|
||||||
visualizationInfo.setUpdateTime(System.currentTimeMillis());
|
visualizationInfo.setUpdateTime(System.currentTimeMillis());
|
||||||
visualizationInfo.setUpdateBy(AuthUtils.getUser().getUserId().toString());
|
visualizationInfo.setUpdateBy(AuthUtils.getUser().getUserId().toString());
|
||||||
|
visualizationInfo.setVersion(3);
|
||||||
mapper.updateById(visualizationInfo);
|
mapper.updateById(visualizationInfo);
|
||||||
coreOptRecentManage.saveOpt(visualizationInfo.getId(), OptConstants.OPT_RESOURCE_TYPE.VISUALIZATION, OptConstants.OPT_TYPE.UPDATE);
|
coreOptRecentManage.saveOpt(visualizationInfo.getId(), OptConstants.OPT_RESOURCE_TYPE.VISUALIZATION, OptConstants.OPT_TYPE.UPDATE);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
ALTER TABLE `xpack_share`
|
||||||
|
ADD COLUMN `auto_pwd` tinyint(1) NOT NULL DEFAULT 1 COMMENT '自动生成密码';
|
||||||
|
|
||||||
|
ALTER TABLE `data_visualization_info`
|
||||||
|
ADD COLUMN `version` int NULL DEFAULT 3 COMMENT '可视化资源版本';
|
||||||
|
update data_visualization_info set version = 2;
|
@ -1,2 +1,6 @@
|
|||||||
ALTER TABLE `xpack_share`
|
ALTER TABLE `xpack_share`
|
||||||
ADD COLUMN `auto_pwd` tinyint(1) NOT NULL DEFAULT 1 COMMENT '自动生成密码' AFTER `type`;
|
ADD COLUMN `auto_pwd` tinyint(1) NOT NULL DEFAULT 1 COMMENT '自动生成密码' AFTER `type`;
|
||||||
|
|
||||||
|
ALTER TABLE `data_visualization_info`
|
||||||
|
ADD COLUMN `version` int NULL DEFAULT 3 COMMENT '可视化资源版本';
|
||||||
|
update data_visualization_info set version = 2;
|
@ -155,7 +155,8 @@
|
|||||||
`source`,
|
`source`,
|
||||||
`delete_flag`,
|
`delete_flag`,
|
||||||
`delete_time`,
|
`delete_time`,
|
||||||
`delete_by`
|
`delete_by`,
|
||||||
|
`version`
|
||||||
FROM data_visualization_info
|
FROM data_visualization_info
|
||||||
where data_visualization_info.delete_flag = 0
|
where data_visualization_info.delete_flag = 0
|
||||||
and data_visualization_info.id = #{dvId}
|
and data_visualization_info.id = #{dvId}
|
||||||
|
@ -116,8 +116,8 @@ const list = [
|
|||||||
innerType: 'VQuery',
|
innerType: 'VQuery',
|
||||||
x: 1,
|
x: 1,
|
||||||
y: 1,
|
y: 1,
|
||||||
sizeX: 36,
|
sizeX: 72,
|
||||||
sizeY: 2,
|
sizeY: 4,
|
||||||
request: {
|
request: {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
data: [],
|
data: [],
|
||||||
@ -141,8 +141,8 @@ const list = [
|
|||||||
actionSelection: ACTION_SELECTION,
|
actionSelection: ACTION_SELECTION,
|
||||||
x: 1,
|
x: 1,
|
||||||
y: 1,
|
y: 1,
|
||||||
sizeX: 18,
|
sizeX: 36,
|
||||||
sizeY: 7,
|
sizeY: 14,
|
||||||
style: {
|
style: {
|
||||||
width: 600,
|
width: 600,
|
||||||
height: 300
|
height: 300
|
||||||
@ -161,8 +161,8 @@ const list = [
|
|||||||
frameLinks: FRAMELINKS,
|
frameLinks: FRAMELINKS,
|
||||||
x: 1,
|
x: 1,
|
||||||
y: 1,
|
y: 1,
|
||||||
sizeX: 18,
|
sizeX: 36,
|
||||||
sizeY: 7,
|
sizeY: 14,
|
||||||
style: {
|
style: {
|
||||||
width: 600,
|
width: 600,
|
||||||
height: 300
|
height: 300
|
||||||
@ -179,8 +179,8 @@ const list = [
|
|||||||
canvasActive: false,
|
canvasActive: false,
|
||||||
x: 1,
|
x: 1,
|
||||||
y: 1,
|
y: 1,
|
||||||
sizeX: 18,
|
sizeX: 36,
|
||||||
sizeY: 6,
|
sizeY: 12,
|
||||||
propValue: {},
|
propValue: {},
|
||||||
style: {
|
style: {
|
||||||
width: 300,
|
width: 300,
|
||||||
@ -210,8 +210,8 @@ const list = [
|
|||||||
canvasActive: false,
|
canvasActive: false,
|
||||||
x: 1,
|
x: 1,
|
||||||
y: 1,
|
y: 1,
|
||||||
sizeX: 18,
|
sizeX: 36,
|
||||||
sizeY: 7,
|
sizeY: 14,
|
||||||
propValue: {
|
propValue: {
|
||||||
url: '',
|
url: '',
|
||||||
flip: {
|
flip: {
|
||||||
@ -236,8 +236,8 @@ const list = [
|
|||||||
canvasActive: false,
|
canvasActive: false,
|
||||||
x: 1,
|
x: 1,
|
||||||
y: 1,
|
y: 1,
|
||||||
sizeX: 5,
|
sizeX: 10,
|
||||||
sizeY: 5,
|
sizeY: 10,
|
||||||
style: {
|
style: {
|
||||||
width: 40,
|
width: 40,
|
||||||
height: 40,
|
height: 40,
|
||||||
@ -255,8 +255,8 @@ const list = [
|
|||||||
canvasActive: false,
|
canvasActive: false,
|
||||||
x: 1,
|
x: 1,
|
||||||
y: 1,
|
y: 1,
|
||||||
sizeX: 15,
|
sizeX: 30,
|
||||||
sizeY: 15,
|
sizeY: 30,
|
||||||
style: {
|
style: {
|
||||||
width: 600,
|
width: 600,
|
||||||
height: 300,
|
height: 300,
|
||||||
@ -326,8 +326,8 @@ const list = [
|
|||||||
canvasActive: false,
|
canvasActive: false,
|
||||||
x: 1,
|
x: 1,
|
||||||
y: 1,
|
y: 1,
|
||||||
sizeX: 18,
|
sizeX: 36,
|
||||||
sizeY: 7,
|
sizeY: 14,
|
||||||
style: {
|
style: {
|
||||||
width: 600,
|
width: 600,
|
||||||
height: 300,
|
height: 300,
|
||||||
|
@ -52,7 +52,7 @@ export const copyStore = defineStore('copy', {
|
|||||||
const xPositionOffset = index % 2
|
const xPositionOffset = index % 2
|
||||||
const yPositionOffset = index % 2
|
const yPositionOffset = index % 2
|
||||||
newComponent.sizeX = pcMatrixCount.value.x / 2
|
newComponent.sizeX = pcMatrixCount.value.x / 2
|
||||||
newComponent.sizeY = 7
|
newComponent.sizeY = 14
|
||||||
newComponent.x = newComponent.sizeX * xPositionOffset + 1
|
newComponent.x = newComponent.sizeX * xPositionOffset + 1
|
||||||
newComponent.y = 200
|
newComponent.y = 200
|
||||||
// dataV 数据大屏
|
// dataV 数据大屏
|
||||||
|
@ -108,8 +108,8 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
height: 1080
|
height: 1080
|
||||||
},
|
},
|
||||||
pcMatrixCount: {
|
pcMatrixCount: {
|
||||||
x: 36,
|
x: 72,
|
||||||
y: 18
|
y: 36
|
||||||
},
|
},
|
||||||
mobileMatrixCount: {
|
mobileMatrixCount: {
|
||||||
x: 6,
|
x: 6,
|
||||||
|
@ -109,6 +109,7 @@ export function initCanvasDataPrepare(dvId, busiFlag, callBack) {
|
|||||||
watermarkInfo: watermarkInfo,
|
watermarkInfo: watermarkInfo,
|
||||||
mobileLayout: canvasInfo.mobileLayout || false
|
mobileLayout: canvasInfo.mobileLayout || false
|
||||||
}
|
}
|
||||||
|
const canvasVersion = canvasInfo.version
|
||||||
|
|
||||||
const canvasDataResult = JSON.parse(canvasInfo.componentData)
|
const canvasDataResult = JSON.parse(canvasInfo.componentData)
|
||||||
const canvasStyleResult = JSON.parse(canvasInfo.canvasStyleData)
|
const canvasStyleResult = JSON.parse(canvasInfo.canvasStyleData)
|
||||||
@ -123,6 +124,13 @@ export function initCanvasDataPrepare(dvId, busiFlag, callBack) {
|
|||||||
if (componentItem.component === 'UserView') {
|
if (componentItem.component === 'UserView') {
|
||||||
componentItem.actionSelection = componentItem.actionSelection || deepCopy(ACTION_SELECTION)
|
componentItem.actionSelection = componentItem.actionSelection || deepCopy(ACTION_SELECTION)
|
||||||
}
|
}
|
||||||
|
// 2 为基础版本 此处需要增加仪表板矩阵密度
|
||||||
|
if ((!canvasVersion || canvasVersion === 2) && canvasInfo.type === 'dashboard') {
|
||||||
|
componentItem.x = 1 + (componentItem.x - 1) * 2
|
||||||
|
componentItem.y = 1 + (componentItem.y - 1) * 2
|
||||||
|
componentItem.sizeX = componentItem.sizeX * 2
|
||||||
|
componentItem.sizeY = componentItem.sizeY * 2
|
||||||
|
}
|
||||||
})
|
})
|
||||||
const curPreviewGap =
|
const curPreviewGap =
|
||||||
dvInfo.type === 'dashboard' && canvasStyleResult['dashboard'].gap === 'yes'
|
dvInfo.type === 'dashboard' && canvasStyleResult['dashboard'].gap === 'yes'
|
||||||
|
@ -123,6 +123,26 @@ public class DataVisualizationVO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String source;
|
private String source;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除标志
|
||||||
|
*/
|
||||||
|
private Boolean deleteFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除时间
|
||||||
|
*/
|
||||||
|
private Long deleteTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除人
|
||||||
|
*/
|
||||||
|
private String deleteBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 可视化资源版本
|
||||||
|
*/
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图表基本信息
|
* 图表基本信息
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user