forked from github/dataease
Merge branch 'dev-v2' into pr@dev-v2_dzz
This commit is contained in:
commit
1cd3b6f068
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
<resultMap id="BaseResultMapDTO" type="io.dataease.api.template.dto.TemplateManageDTO"
|
<resultMap id="BaseResultMapDTO" type="io.dataease.api.template.dto.TemplateManageDTO"
|
||||||
extends="BaseResultMap">
|
extends="BaseResultMap">
|
||||||
|
<result column="recent_use_time" jdbcType="BIGINT" property="recentUseTime" />
|
||||||
<result column="label" jdbcType="VARCHAR" property="label"/>
|
<result column="label" jdbcType="VARCHAR" property="label"/>
|
||||||
<result column="childrenCount" jdbcType="VARCHAR" property="childrenCount"/>
|
<result column="childrenCount" jdbcType="VARCHAR" property="childrenCount"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
@ -50,10 +51,12 @@
|
|||||||
vt.create_time,
|
vt.create_time,
|
||||||
vt.template_type,
|
vt.template_type,
|
||||||
vt.SNAPSHOT,
|
vt.SNAPSHOT,
|
||||||
vtcm.category_id
|
vtcm.category_id,
|
||||||
|
cor.time as 'recent_use_time'
|
||||||
FROM
|
FROM
|
||||||
visualization_template vt
|
visualization_template vt
|
||||||
LEFT JOIN visualization_template_category_map vtcm ON vt.id = vtcm.template_id
|
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
|
ORDER BY
|
||||||
vt.create_time DESC
|
vt.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
@ -71,6 +71,7 @@ onMounted(() => {
|
|||||||
if (createType === 'template') {
|
if (createType === 'template') {
|
||||||
const deTemplateDataStr = wsCache.get(`de-template-data`)
|
const deTemplateDataStr = wsCache.get(`de-template-data`)
|
||||||
const deTemplateData = JSON.parse(deTemplateDataStr)
|
const deTemplateData = JSON.parse(deTemplateDataStr)
|
||||||
|
wsCache.delete('de-template-data')
|
||||||
dvMainStore.setComponentData(JSON.parse(deTemplateData['componentData']))
|
dvMainStore.setComponentData(JSON.parse(deTemplateData['componentData']))
|
||||||
dvMainStore.setCanvasStyle(JSON.parse(deTemplateData['canvasStyleData']))
|
dvMainStore.setCanvasStyle(JSON.parse(deTemplateData['canvasStyleData']))
|
||||||
dvMainStore.setCanvasViewInfo(deTemplateData['canvasViewInfo'])
|
dvMainStore.setCanvasViewInfo(deTemplateData['canvasViewInfo'])
|
||||||
|
@ -201,6 +201,7 @@ onMounted(() => {
|
|||||||
// 从模板新建
|
// 从模板新建
|
||||||
if (createType === 'template') {
|
if (createType === 'template') {
|
||||||
const deTemplateDataStr = wsCache.get(`de-template-data`)
|
const deTemplateDataStr = wsCache.get(`de-template-data`)
|
||||||
|
wsCache.delete('de-template-data')
|
||||||
const deTemplateData = JSON.parse(deTemplateDataStr)
|
const deTemplateData = JSON.parse(deTemplateDataStr)
|
||||||
dvMainStore.setComponentData(JSON.parse(deTemplateData['componentData']))
|
dvMainStore.setComponentData(JSON.parse(deTemplateData['componentData']))
|
||||||
dvMainStore.setCanvasStyle(JSON.parse(deTemplateData['canvasStyleData']))
|
dvMainStore.setCanvasStyle(JSON.parse(deTemplateData['canvasStyleData']))
|
||||||
|
@ -405,6 +405,7 @@ const apply = () => {
|
|||||||
decompression(state.dvCreateForm)
|
decompression(state.dvCreateForm)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
state.curApplyTemplate.recentUseTime = Date.now()
|
state.curApplyTemplate.recentUseTime = Date.now()
|
||||||
|
state.curApplyTemplate.categoryNames.push('最近使用')
|
||||||
state.loading = false
|
state.loading = false
|
||||||
const templateData = response.data
|
const templateData = response.data
|
||||||
// do create
|
// do create
|
||||||
|
@ -46,11 +46,13 @@ public class TemplateMarketDTO implements Comparable<TemplateMarketDTO> {
|
|||||||
this.categories = manageDTO.getCategoryNames().stream().map(category->new MarketCategoryVO(category)).collect(Collectors.toList());
|
this.categories = manageDTO.getCategoryNames().stream().map(category->new MarketCategoryVO(category)).collect(Collectors.toList());
|
||||||
this.categoryNames = manageDTO.getCategoryNames();
|
this.categoryNames = manageDTO.getCategoryNames();
|
||||||
this.metas = new MarketMetasVO(manageDTO.getSnapshot());
|
this.metas = new MarketMetasVO(manageDTO.getSnapshot());
|
||||||
this.templateType = "dataV".equalsIgnoreCase(manageDTO.getTemplateType()) ? "SCREEN" : "PANEL";
|
this.templateType = "dataV".equalsIgnoreCase(manageDTO.getDvType()) ? "SCREEN" : "PANEL";
|
||||||
this.thumbnail = manageDTO.getSnapshot();
|
this.thumbnail = manageDTO.getSnapshot();
|
||||||
this.source = "manage";
|
this.source = "manage";
|
||||||
if (manageDTO.getRecentUseTime() != null) {
|
if (manageDTO.getRecentUseTime() != null) {
|
||||||
this.recentUseTime = manageDTO.getRecentUseTime();
|
this.recentUseTime = manageDTO.getRecentUseTime();
|
||||||
|
this.categories.add(new MarketCategoryVO("最近使用"));
|
||||||
|
this.categoryNames.add("最近使用");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user