forked from github/dataease
Merge branch 'dev-v2' into pr@dev-v2@fix_flyway
This commit is contained in:
commit
2158db4f41
@ -21,11 +21,11 @@ public class MybatisPlusGenerator {
|
||||
/**
|
||||
* 业务模块例如datasource,dataset,panel等
|
||||
*/
|
||||
private static final String busi = "visualization";
|
||||
private static final String busi = "template";
|
||||
/**
|
||||
* 这是要生成代码的表名称
|
||||
*/
|
||||
private static final String TABLE_NAME = "visualization_watermark";
|
||||
private static final String TABLE_NAME = "visualization_template";
|
||||
|
||||
/**
|
||||
* 下面两个配置基本上不用动
|
||||
|
@ -5,11 +5,11 @@ import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仪表板模板表
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author fit2cloud
|
||||
* @since 2023-11-06
|
||||
* @since 2024-01-16
|
||||
*/
|
||||
@TableName("visualization_template")
|
||||
public class VisualizationTemplate implements Serializable {
|
||||
@ -37,7 +37,7 @@ public class VisualizationTemplate implements Serializable {
|
||||
private Integer level;
|
||||
|
||||
/**
|
||||
* 模板种类 dataV or dashboard 目录或者文件夹
|
||||
* 模版种类 dataV or dashboard 目录或者文件夹
|
||||
*/
|
||||
private String dvType;
|
||||
|
||||
@ -62,7 +62,7 @@ public class VisualizationTemplate implements Serializable {
|
||||
private String snapshot;
|
||||
|
||||
/**
|
||||
* 模板类型 system 系统内置 self 用户自建
|
||||
* 模版类型 system 系统内置 self 用户自建
|
||||
*/
|
||||
private String templateType;
|
||||
|
||||
@ -81,6 +81,11 @@ public class VisualizationTemplate implements Serializable {
|
||||
*/
|
||||
private String dynamicData;
|
||||
|
||||
/**
|
||||
* 使用次数
|
||||
*/
|
||||
private Integer useCount;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
@ -185,6 +190,14 @@ public class VisualizationTemplate implements Serializable {
|
||||
this.dynamicData = dynamicData;
|
||||
}
|
||||
|
||||
public Integer getUseCount() {
|
||||
return useCount;
|
||||
}
|
||||
|
||||
public void setUseCount(Integer useCount) {
|
||||
this.useCount = useCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "VisualizationTemplate{" +
|
||||
@ -201,6 +214,7 @@ public class VisualizationTemplate implements Serializable {
|
||||
", templateStyle = " + templateStyle +
|
||||
", templateData = " + templateData +
|
||||
", dynamicData = " + dynamicData +
|
||||
", useCount = " + useCount +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
|
@ -6,11 +6,11 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仪表板模板表 Mapper 接口
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author fit2cloud
|
||||
* @since 2023-11-06
|
||||
* @since 2024-01-16
|
||||
*/
|
||||
@Mapper
|
||||
public interface VisualizationTemplateMapper extends BaseMapper<VisualizationTemplate> {
|
||||
|
@ -121,13 +121,17 @@ public class TemplateCenterManage {
|
||||
|
||||
|
||||
public MarketBaseResponse searchTemplateRecommend() {
|
||||
try {
|
||||
MarketTemplateV2BaseResponse v2BaseResponse = null;
|
||||
Map<String, String> templateParams = sysParameterManage.groupVal("template.");
|
||||
return baseResponseV2TransRecommend(templateQuery(templateParams), templateParams.get("template.url"));
|
||||
// 模版市场推荐
|
||||
try {
|
||||
v2BaseResponse = templateQuery(templateParams);
|
||||
} catch (Exception e) {
|
||||
DEException.throwException(e);
|
||||
}
|
||||
return null;
|
||||
// 模版管理使用次数推荐
|
||||
List<TemplateMarketDTO> manage = searchTemplateFromManage();
|
||||
return baseResponseV2TransRecommend(v2BaseResponse, templateParams.get("template.url"));
|
||||
}
|
||||
|
||||
public MarketPreviewBaseResponse searchTemplatePreview() {
|
||||
|
@ -272,6 +272,10 @@ public class DataVisualizationServer implements DataVisualizationApi {
|
||||
dvType = visualizationTemplate.getDvType();
|
||||
// 模板市场记录
|
||||
coreOptRecentManage.saveOpt(request.getTemplateId(), OptConstants.OPT_RESOURCE_TYPE.TEMPLATE, OptConstants.OPT_TYPE.NEW);
|
||||
VisualizationTemplate visualizationTemplateUpdate = new VisualizationTemplate();
|
||||
visualizationTemplateUpdate.setId(visualizationTemplate.getId());
|
||||
visualizationTemplateUpdate.setUseCount(visualizationTemplate.getUseCount() == null ? 0 : visualizationTemplate.getUseCount() + 1);
|
||||
templateMapper.updateById(visualizationTemplateUpdate);
|
||||
} else if (DataVisualizationConstants.NEW_PANEL_FROM.NEW_OUTER_TEMPLATE.equals(newFrom)) {
|
||||
templateStyle = request.getCanvasStyleData();
|
||||
templateData = request.getComponentData();
|
||||
|
@ -14,5 +14,12 @@ VALUES ('system_default', '1.0',
|
||||
'{\"enable\":false,\"enablePanelCustom\":true,\"type\":\"custom\",\"content\":\"水印\",\"watermark_color\":\"#DD1010\",\"watermark_x_space\":12,\"watermark_y_space\":36,\"watermark_fontsize\":15}',
|
||||
'admin', NULL);
|
||||
|
||||
|
||||
INSERT INTO `core_sys_setting` (`id`, `pkey`, `pval`, `type`, `sort`)
|
||||
VALUES (9, 'basic.frontTimeOut', '60', 'text', 1);
|
||||
|
||||
ALTER TABLE `visualization_template`
|
||||
ADD COLUMN `use_count` int NULL DEFAULT 0 COMMENT '使用次数';
|
||||
|
||||
update visualization_template set use_count = 0;
|
||||
INSERT INTO `core_sys_setting` (`id`, `pkey`, `pval`, `type`, `sort`) VALUES (9, 'basic.frontTimeOut', '60', 'text', 1);
|
||||
|
@ -11,4 +11,8 @@ CREATE TABLE `visualization_watermark` (
|
||||
|
||||
INSERT INTO `visualization_watermark` (`id`, `version`, `setting_content`, `create_by`, `create_time`) VALUES ('system_default', '1.0', '{\"enable\":false,\"enablePanelCustom\":true,\"type\":\"custom\",\"content\":\"水印\",\"watermark_color\":\"#DD1010\",\"watermark_x_space\":12,\"watermark_y_space\":36,\"watermark_fontsize\":15}', 'admin', NULL);
|
||||
|
||||
ALTER TABLE `visualization_template`
|
||||
ADD COLUMN `use_count` int NULL DEFAULT 0 COMMENT '使用次数' AFTER `dynamic_data`;
|
||||
|
||||
update visualization_template set use_count = 0;
|
||||
INSERT INTO `core_sys_setting` (`id`, `pkey`, `pval`, `type`, `sort`) VALUES (9, 'basic.frontTimeOut', '60', 'text', 1);
|
@ -53,12 +53,13 @@
|
||||
vt.create_time,
|
||||
vt.template_type,
|
||||
vt.SNAPSHOT,
|
||||
vt.use_count,
|
||||
vtcm.category_id,
|
||||
cor.time as 'recent_use_time'
|
||||
FROM visualization_template vt
|
||||
LEFT JOIN visualization_template_category_map vtcm ON vt.id = vtcm.template_id
|
||||
left JOIN core_opt_recent cor on cor.resource_type = 6 and vt.id = cor.resource_name
|
||||
ORDER BY vt.create_time DESC
|
||||
ORDER BY vt.use_count ,vt.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="findCategories" resultMap="BaseResultMapDTO">
|
||||
|
@ -468,6 +468,14 @@ const categoryClick = params => {
|
||||
}
|
||||
|
||||
const saveTemplateEdit = templateEditForm => {
|
||||
if (templateEditForm.name === '最近使用') {
|
||||
ElMessage({
|
||||
message: '不合法命名,请更换!',
|
||||
type: 'error',
|
||||
showClose: true
|
||||
})
|
||||
return
|
||||
}
|
||||
templateEditFormRef.value.validate(valid => {
|
||||
if (valid) {
|
||||
save({ ...templateEditForm }).then(response => {
|
||||
|
@ -76,6 +76,11 @@ public class VisualizationTemplateVO {
|
||||
*/
|
||||
private String dynamicData;
|
||||
|
||||
/**
|
||||
* 使用次数
|
||||
*/
|
||||
private Integer useCount;
|
||||
|
||||
/**
|
||||
* 分类
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user