forked from github/dataease
fix(应用市场): 应用市场格式化等问题修复
This commit is contained in:
parent
d634950272
commit
9da3990f25
@ -2,15 +2,12 @@ package io.dataease.controller.panel;
|
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
import io.dataease.controller.handler.annotation.I18n;
|
||||
import io.dataease.controller.request.panel.PanelAppTemplateApplyRequest;
|
||||
import io.dataease.controller.request.panel.PanelAppTemplateRequest;
|
||||
import io.dataease.plugins.common.base.domain.PanelAppTemplate;
|
||||
import io.dataease.plugins.common.base.domain.PanelAppTemplateWithBLOBs;
|
||||
import io.dataease.service.panel.PanelAppTemplateService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@ -63,12 +60,4 @@ public class PanelAppTemplateController {
|
||||
return panelAppTemplateService.nameCheck(request);
|
||||
}
|
||||
|
||||
@ApiOperation("应用模板")
|
||||
@PostMapping("/appApply")
|
||||
@I18n
|
||||
public String appApply(@RequestBody PanelAppTemplateApplyRequest request) throws Exception{
|
||||
// return panelAppTemplateService.appApply(request);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,34 +1,11 @@
|
||||
package io.dataease.service.panel;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.google.gson.Gson;
|
||||
import io.dataease.commons.constants.CommonConstants;
|
||||
import io.dataease.commons.utils.AuthUtils;
|
||||
import io.dataease.commons.utils.BeanUtils;
|
||||
import io.dataease.controller.request.dataset.DataSetTableRequest;
|
||||
import io.dataease.controller.request.panel.PanelAppTemplateApplyRequest;
|
||||
import io.dataease.controller.request.panel.PanelAppTemplateRequest;
|
||||
import io.dataease.controller.request.panel.PanelGroupRequest;
|
||||
import io.dataease.dto.dataset.DataSetTaskDTO;
|
||||
import io.dataease.plugins.common.base.domain.*;
|
||||
import io.dataease.plugins.common.base.mapper.PanelAppTemplateLogMapper;
|
||||
import io.dataease.plugins.common.base.mapper.PanelAppTemplateMapper;
|
||||
import io.dataease.plugins.common.constants.DatasetType;
|
||||
import io.dataease.service.chart.ChartViewFieldService;
|
||||
import io.dataease.service.chart.ChartViewService;
|
||||
import io.dataease.service.dataset.DataSetTableFieldsService;
|
||||
import io.dataease.service.dataset.DataSetTableService;
|
||||
import io.dataease.service.datasource.DatasourceService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.pentaho.di.core.util.UUIDUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Author: wangjiahao
|
||||
|
@ -21,7 +21,6 @@ import io.dataease.service.datasource.DatasourceService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.pentaho.di.core.util.UUIDUtil;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@ -118,6 +117,7 @@ public class PanelAppTemplateService {
|
||||
return CommonConstants.CHECK_RESULT.EXIST_ALL;
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, String> applyDatasource(List<Datasource> oldDatasourceList, List<Datasource> newDatasourceList) throws Exception {
|
||||
Map<String, String> datasourceRelaMap = new HashMap<>();
|
||||
@ -129,6 +129,7 @@ public class PanelAppTemplateService {
|
||||
}
|
||||
return datasourceRelaMap;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void applyPanelView(List<PanelView> panelViewsInfo, Map<String, String> chartViewsRelaMap, String panelId) {
|
||||
Long time = System.currentTimeMillis();
|
||||
@ -142,6 +143,7 @@ public class PanelAppTemplateService {
|
||||
panelViewService.save(panelView);
|
||||
});
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String applyPanel(PanelGroupRequest panelInfo, Map<String, String> chartViewsRelaMap, String newPanelId, String panelName, String pid) {
|
||||
panelInfo.setId(newPanelId);
|
||||
@ -171,6 +173,7 @@ public class PanelAppTemplateService {
|
||||
}
|
||||
return datasetsRelaMap;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, String> applyDatasetField(List<DatasetTableField> datasetTableFieldsInfo, Map<String, String> datasetsRelaMap) {
|
||||
Map<String, String> datasetFieldsRelaMap = new HashMap<>();
|
||||
@ -182,6 +185,7 @@ public class PanelAppTemplateService {
|
||||
}
|
||||
return datasetFieldsRelaMap;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void resetCustomAndUnionDataset(List<DatasetTable> datasetTablesInfo, Map<String, String> datasetRelaMap, Map<String, String> datasetFieldsRelaMap) throws Exception {
|
||||
for (DatasetTable datasetTable : datasetTablesInfo) {
|
||||
@ -202,6 +206,7 @@ public class PanelAppTemplateService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, String> applyViews(List<ChartViewWithBLOBs> chartViewsInfo, Map<String, String> datasetsRelaMap, Map<String, String> datasetFieldsRelaMap, String sceneId) throws Exception {
|
||||
Map<String, String> chartViewsRelaMap = new HashMap<>();
|
||||
@ -241,6 +246,7 @@ public class PanelAppTemplateService {
|
||||
}
|
||||
return chartViewsRelaMap;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Map<String, String> applyViewsField(List<ChartViewField> chartViewFieldsInfo, Map<String, String> chartViewsRelaMap, Map<String, String> datasetsRelaMap, Map<String, String> datasetFieldsRelaMap) {
|
||||
Map<String, String> chartViewFieldsRelaMap = new HashMap<>();
|
||||
@ -264,7 +270,7 @@ public class PanelAppTemplateService {
|
||||
}
|
||||
|
||||
public void nameCheck(PanelAppTemplateApplyRequest request) {
|
||||
panelGroupService.checkPanelName(request.getPanelName(),request.getPanelId(), PanelConstants.OPT_TYPE_UPDATE,null,null);
|
||||
panelGroupService.checkPanelName(request.getPanelName(), request.getPanelId(), PanelConstants.OPT_TYPE_INSERT, null, "panel");
|
||||
DatasetGroup datasetGroup = new DatasetGroup();
|
||||
datasetGroup.setPid(request.getDatasetGroupId());
|
||||
datasetGroup.setName(request.getDatasetGroupName());
|
||||
|
@ -1,9 +1,9 @@
|
||||
package io.dataease.service.panel;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import io.dataease.auth.annotation.DeCleaner;
|
||||
import io.dataease.commons.constants.*;
|
||||
import io.dataease.commons.utils.*;
|
||||
@ -33,6 +33,7 @@ import io.dataease.listener.util.CacheUtils;
|
||||
import io.dataease.plugins.common.base.domain.*;
|
||||
import io.dataease.plugins.common.base.mapper.*;
|
||||
import io.dataease.plugins.common.constants.DeTypeConstants;
|
||||
import io.dataease.plugins.common.dto.dataset.SqlVariableDetails;
|
||||
import io.dataease.service.chart.ChartGroupService;
|
||||
import io.dataease.service.chart.ChartViewService;
|
||||
import io.dataease.service.dataset.DataSetGroupService;
|
||||
@ -829,21 +830,21 @@ public class PanelGroupService {
|
||||
//查询应用信息
|
||||
PanelAppTemplateWithBLOBs appInfo = panelAppTemplateMapper.selectByPrimaryKey(request.getAppTemplateId());
|
||||
//1.获取所有视图信息
|
||||
List<ChartViewWithBLOBs> chartViewsInfo = JSON.parseArray(appInfo.getChartViewsInfo(),ChartViewWithBLOBs.class);
|
||||
List<ChartViewWithBLOBs> chartViewsInfo = gson.fromJson(appInfo.getChartViewsInfo(), new TypeToken<List<ChartViewWithBLOBs>>(){}.getType());
|
||||
//2.获取视图扩展字段信息
|
||||
List<ChartViewField> chartViewFieldsInfo = JSON.parseArray(appInfo.getChartViewFieldsInfo(),ChartViewField.class);
|
||||
List<ChartViewField> chartViewFieldsInfo = gson.fromJson(appInfo.getChartViewFieldsInfo(), new TypeToken<List<ChartViewField>>(){}.getType());
|
||||
//3.获取所有数据集信息
|
||||
List<DatasetTable> datasetTablesInfo = JSON.parseArray(appInfo.getDatasetTablesInfo(),DatasetTable.class);
|
||||
List<DatasetTable> datasetTablesInfo = gson.fromJson(appInfo.getDatasetTablesInfo(), new TypeToken<List<DatasetTable>>(){}.getType());
|
||||
//4.获取所有数据集字段信息
|
||||
List<DatasetTableField> datasetTableFieldsInfo = JSON.parseArray(appInfo.getDatasetTableFieldsInfo(),DatasetTableField.class);
|
||||
List<DatasetTableField> datasetTableFieldsInfo = gson.fromJson(appInfo.getDatasetTableFieldsInfo(), new TypeToken<List<DatasetTableField>>(){}.getType());
|
||||
//5.获取所有任务信息
|
||||
List<DataSetTaskDTO> dataSetTasksInfo = JSON.parseArray(appInfo.getDatasetTasksInfo(),DataSetTaskDTO.class);
|
||||
List<DataSetTaskDTO> dataSetTasksInfo = gson.fromJson(appInfo.getDatasetTasksInfo(), new TypeToken<List<DataSetTaskDTO>>(){}.getType());
|
||||
//6.获取所有数据源信息
|
||||
List<Datasource> oldDatasourceInfo = JSON.parseArray(appInfo.getDatasourceInfo(),Datasource.class);
|
||||
List<Datasource> oldDatasourceInfo = gson.fromJson(appInfo.getDatasourceInfo(), new TypeToken<List<Datasource>>(){}.getType());
|
||||
//获取仪表板信息
|
||||
PanelGroupRequest panelInfo = JSON.parseObject(appInfo.getPanelInfo(),PanelGroupRequest.class);
|
||||
PanelGroupRequest panelInfo = gson.fromJson(appInfo.getPanelInfo(),PanelGroupRequest.class);
|
||||
//获取仪表板视图信息
|
||||
List<PanelView> panelViewsInfo = JSON.parseArray(appInfo.getPanelViewsInfo(),PanelView.class);
|
||||
List<PanelView> panelViewsInfo = gson.fromJson(appInfo.getPanelViewsInfo(), new TypeToken<List<PanelView>>(){}.getType());
|
||||
|
||||
Map<String,String> datasourceRelaMap = panelAppTemplateService.applyDatasource(oldDatasourceInfo,request.getDatasourceList());
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
\u4E2A\u4EBA\u4FE1\u606F=\u4E2A\u4EBA\u4FE1\u606F
|
||||
\u4EEA\u8868\u677F=\u4EEA\u8868\u677F
|
||||
\u6A21\u677F\u5E02\u573A=\u6A21\u677F\u5E02\u573A
|
||||
\u5E94\u7528\u5E02\u573A=\u5E94\u7528\u5E02\u5834
|
||||
\u5E94\u7528\u5E02\u573A=\u5E94\u7528\u5E02\u573A
|
||||
\u5E94\u7528\u7BA1\u7406=\u5E94\u7528\u7BA1\u7406
|
||||
\u4FEE\u6539\u5BC6\u7801=\u4FEE\u6539\u5BC6\u7801
|
||||
\u521B\u5EFA\u7528\u6237=\u521B\u5EFA\u7528\u6237
|
||||
|
@ -2487,6 +2487,8 @@ export default {
|
||||
app_group_icon: 'Cover icon',
|
||||
app_name: 'Application name',
|
||||
search_by_keyword:'Search by keyword',
|
||||
apply_logs:'Apply logs'
|
||||
apply_logs:'Apply logs',
|
||||
app_group_delete_tips: 'Are you sure to delete this application category?',
|
||||
app_group_delete_content: 'After deletion, all application templates in this category will also be deleted.'
|
||||
}
|
||||
}
|
||||
|
@ -2487,6 +2487,9 @@ export default {
|
||||
no_apps: '暫無應用',
|
||||
app_group_icon: '封面圖標',
|
||||
app_name: '應用名稱',
|
||||
search_by_keyword:'通過關鍵字搜索'
|
||||
search_by_keyword:'通過關鍵字搜索',
|
||||
apply_logs:'應用記錄',
|
||||
app_group_delete_tips: '確定刪除該應用分類嗎?',
|
||||
app_group_delete_content: '刪除後,該分類中所有的應用模闆也將被刪除。'
|
||||
}
|
||||
}
|
||||
|
@ -2487,6 +2487,9 @@ export default {
|
||||
no_apps: '暂无应用',
|
||||
app_group_icon: '封面图标',
|
||||
app_name: '应用名称',
|
||||
search_by_keyword:'通过关键字搜索'
|
||||
search_by_keyword:'通过关键字搜索',
|
||||
apply_logs:'应用记录',
|
||||
app_group_delete_tips: '确定删除该应用分类吗?',
|
||||
app_group_delete_content: '删除后,该分类中所有的应用模板也将被删除。'
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,8 @@ export default {
|
||||
props: {
|
||||
model: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
default: () => {
|
||||
},
|
||||
},
|
||||
width: {
|
||||
type: Number
|
||||
@ -52,9 +53,7 @@ export default {
|
||||
classImg() {
|
||||
return {
|
||||
width: (this.width - 2) + 'px',
|
||||
height: this.width * 0.576 + 'px',
|
||||
// background: `url(${this.model.snapshot}) no-repeat`,
|
||||
// 'background-size': `100% 100%`
|
||||
height: this.width * 0.576 + 'px'
|
||||
}
|
||||
},
|
||||
},
|
||||
@ -73,6 +72,7 @@ export default {
|
||||
border: 1px solid var(--deCardStrokeColor, #dee0e3);
|
||||
border-radius: 4px;
|
||||
margin: 0 24px 25px 0;
|
||||
|
||||
.card-img-model {
|
||||
border-bottom: 1px solid var(--deCardStrokeColor, #dee0e3);
|
||||
height: 144px;
|
||||
@ -138,6 +138,7 @@ export default {
|
||||
|
||||
.de-card-dropdown {
|
||||
margin-top: 0 !important;
|
||||
|
||||
.popper__arrow {
|
||||
display: none !important;
|
||||
}
|
||||
|
@ -129,8 +129,8 @@ export default {
|
||||
},
|
||||
templateDelete(template) {
|
||||
const options = {
|
||||
title: "确定删除该应用分类吗?",
|
||||
content: "删除后,该分类中所有的应用模版也将被删除。",
|
||||
title: this.$('app_template.app_group_delete_tips'),
|
||||
content: this.$('app_template.app_group_delete_content'),
|
||||
type: "primary",
|
||||
cb: () => this.$emit("templateDelete", template.id),
|
||||
};
|
||||
|
@ -442,10 +442,6 @@ export default {
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
//.open-button:hover{
|
||||
// transition: 0.5s;
|
||||
// width: 50px;
|
||||
//}
|
||||
.open-button:hover{
|
||||
color: #3a8ee6;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user