forked from github/dataease
refactor(工作台): 模板增加资源版本号等基础信息
This commit is contained in:
parent
5088de7a95
commit
0f1b93d53d
@ -9,7 +9,7 @@ import java.io.Serializable;
|
|||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author fit2cloud
|
* @author fit2cloud
|
||||||
* @since 2024-01-16
|
* @since 2024-04-11
|
||||||
*/
|
*/
|
||||||
@TableName("visualization_template")
|
@TableName("visualization_template")
|
||||||
public class VisualizationTemplate implements Serializable {
|
public class VisualizationTemplate implements Serializable {
|
||||||
@ -86,6 +86,11 @@ public class VisualizationTemplate implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Integer useCount;
|
private Integer useCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用仪表板的版本
|
||||||
|
*/
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@ -198,6 +203,14 @@ public class VisualizationTemplate implements Serializable {
|
|||||||
this.useCount = useCount;
|
this.useCount = useCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getVersion() {
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVersion(Integer version) {
|
||||||
|
this.version = version;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "VisualizationTemplate{" +
|
return "VisualizationTemplate{" +
|
||||||
@ -215,6 +228,7 @@ public class VisualizationTemplate implements Serializable {
|
|||||||
", templateData = " + templateData +
|
", templateData = " + templateData +
|
||||||
", dynamicData = " + dynamicData +
|
", dynamicData = " + dynamicData +
|
||||||
", useCount = " + useCount +
|
", useCount = " + useCount +
|
||||||
|
", version = " + version +
|
||||||
"}";
|
"}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author fit2cloud
|
* @author fit2cloud
|
||||||
* @since 2024-01-16
|
* @since 2024-04-11
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface VisualizationTemplateMapper extends BaseMapper<VisualizationTemplate> {
|
public interface VisualizationTemplateMapper extends BaseMapper<VisualizationTemplate> {
|
||||||
|
@ -282,6 +282,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
|||||||
String staticResource = null;
|
String staticResource = null;
|
||||||
String name = null;
|
String name = null;
|
||||||
String dvType = null;
|
String dvType = null;
|
||||||
|
Integer version = null;
|
||||||
//内部模板新建
|
//内部模板新建
|
||||||
if (DataVisualizationConstants.NEW_PANEL_FROM.NEW_INNER_TEMPLATE.equals(newFrom)) {
|
if (DataVisualizationConstants.NEW_PANEL_FROM.NEW_INNER_TEMPLATE.equals(newFrom)) {
|
||||||
VisualizationTemplate visualizationTemplate = templateMapper.selectById(request.getTemplateId());
|
VisualizationTemplate visualizationTemplate = templateMapper.selectById(request.getTemplateId());
|
||||||
@ -290,6 +291,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
|||||||
dynamicData = visualizationTemplate.getDynamicData();
|
dynamicData = visualizationTemplate.getDynamicData();
|
||||||
name = visualizationTemplate.getName();
|
name = visualizationTemplate.getName();
|
||||||
dvType = visualizationTemplate.getDvType();
|
dvType = visualizationTemplate.getDvType();
|
||||||
|
version = visualizationTemplate.getVersion();
|
||||||
// 模板市场记录
|
// 模板市场记录
|
||||||
coreOptRecentManage.saveOpt(request.getTemplateId(), OptConstants.OPT_RESOURCE_TYPE.TEMPLATE, OptConstants.OPT_TYPE.NEW);
|
coreOptRecentManage.saveOpt(request.getTemplateId(), OptConstants.OPT_RESOURCE_TYPE.TEMPLATE, OptConstants.OPT_TYPE.NEW);
|
||||||
VisualizationTemplate visualizationTemplateUpdate = new VisualizationTemplate();
|
VisualizationTemplate visualizationTemplateUpdate = new VisualizationTemplate();
|
||||||
@ -314,6 +316,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
|||||||
staticResource = templateFileInfo.getStaticResource();
|
staticResource = templateFileInfo.getStaticResource();
|
||||||
name = templateFileInfo.getName();
|
name = templateFileInfo.getName();
|
||||||
dvType = templateFileInfo.getDvType();
|
dvType = templateFileInfo.getDvType();
|
||||||
|
version = templateFileInfo.getVersion();
|
||||||
// 模板市场记录
|
// 模板市场记录
|
||||||
coreOptRecentManage.saveOpt(request.getResourceName(), OptConstants.OPT_RESOURCE_TYPE.TEMPLATE, OptConstants.OPT_TYPE.NEW);
|
coreOptRecentManage.saveOpt(request.getResourceName(), OptConstants.OPT_RESOURCE_TYPE.TEMPLATE, OptConstants.OPT_TYPE.NEW);
|
||||||
}
|
}
|
||||||
@ -347,7 +350,7 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
|||||||
request.setCanvasStyleData(templateStyle);
|
request.setCanvasStyleData(templateStyle);
|
||||||
//Store static resource into the server
|
//Store static resource into the server
|
||||||
staticResourceServer.saveFilesToServe(staticResource);
|
staticResourceServer.saveFilesToServe(staticResource);
|
||||||
return new DataVisualizationVO(newDvId, name, dvType, templateStyle, templateData, canvasViewInfo, null);
|
return new DataVisualizationVO(newDvId, name, dvType,version, templateStyle, templateData, canvasViewInfo, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -3,4 +3,8 @@ ALTER TABLE `xpack_share`
|
|||||||
|
|
||||||
ALTER TABLE `data_visualization_info`
|
ALTER TABLE `data_visualization_info`
|
||||||
ADD COLUMN `version` int NULL DEFAULT 3 COMMENT '可视化资源版本';
|
ADD COLUMN `version` int NULL DEFAULT 3 COMMENT '可视化资源版本';
|
||||||
update data_visualization_info set version = 2;
|
update data_visualization_info set version = 2;
|
||||||
|
|
||||||
|
ALTER TABLE `visualization_template`
|
||||||
|
ADD COLUMN `version` int NULL DEFAULT 3 COMMENT '使用资源的版本';
|
||||||
|
update visualization_template set version = 2;
|
||||||
|
@ -3,4 +3,8 @@ ALTER TABLE `xpack_share`
|
|||||||
|
|
||||||
ALTER TABLE `data_visualization_info`
|
ALTER TABLE `data_visualization_info`
|
||||||
ADD COLUMN `version` int NULL DEFAULT 3 COMMENT '可视化资源版本';
|
ADD COLUMN `version` int NULL DEFAULT 3 COMMENT '可视化资源版本';
|
||||||
update data_visualization_info set version = 2;
|
update data_visualization_info set version = 2;
|
||||||
|
|
||||||
|
ALTER TABLE `visualization_template`
|
||||||
|
ADD COLUMN `version` int NULL DEFAULT 3 COMMENT '使用资源的版本';
|
||||||
|
update visualization_template set version = 2;
|
@ -49,6 +49,7 @@ export function download2AppTemplate(downloadType, canvasDom, name, callBack?) {
|
|||||||
templateType: 'self',
|
templateType: 'self',
|
||||||
snapshot: snapshot,
|
snapshot: snapshot,
|
||||||
dvType: dvInfo.value.type,
|
dvType: dvInfo.value.type,
|
||||||
|
version: 3,
|
||||||
canvasStyleData: JSON.stringify(canvasStyleData.value),
|
canvasStyleData: JSON.stringify(canvasStyleData.value),
|
||||||
componentData: JSON.stringify(componentData.value),
|
componentData: JSON.stringify(componentData.value),
|
||||||
dynamicData: JSON.stringify(canvasViewDataTemplate),
|
dynamicData: JSON.stringify(canvasViewDataTemplate),
|
||||||
|
@ -81,6 +81,11 @@ public class VisualizationTemplateVO {
|
|||||||
*/
|
*/
|
||||||
private Integer useCount;
|
private Integer useCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 版本号
|
||||||
|
*/
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分类
|
* 分类
|
||||||
*/
|
*/
|
||||||
|
@ -158,7 +158,8 @@ public class DataVisualizationVO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private VisualizationWatermarkVO watermarkInfo;
|
private VisualizationWatermarkVO watermarkInfo;
|
||||||
|
|
||||||
public DataVisualizationVO(Long id, String name, String type, String canvasStyleData, String componentData, Map<Long, ChartViewDTO> canvasViewInfo, Map<Long, VisualizationTemplateExtendDataDTO> extendDataInfo) {
|
|
||||||
|
public DataVisualizationVO(Long id, String name, String type,Integer version, String canvasStyleData, String componentData, Map<Long, ChartViewDTO> canvasViewInfo, Map<Long, VisualizationTemplateExtendDataDTO> extendDataInfo) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
@ -166,5 +167,6 @@ public class DataVisualizationVO implements Serializable {
|
|||||||
this.componentData = componentData;
|
this.componentData = componentData;
|
||||||
this.canvasViewInfo = canvasViewInfo;
|
this.canvasViewInfo = canvasViewInfo;
|
||||||
this.extendDataInfo = extendDataInfo;
|
this.extendDataInfo = extendDataInfo;
|
||||||
|
this.version = version;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user