Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
junjun 2022-11-02 14:07:17 +08:00
commit 85cb2fe7cc
2 changed files with 17 additions and 9 deletions

View File

@ -11,6 +11,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* Author: wangjiahao
@ -20,19 +21,26 @@ import java.util.List;
@Service
public class PanelGroupExtendDataService {
private final static String transDataKey = "data" + "s";
@Resource
private PanelGroupExtendDataMapper panelGroupExtendDataMapper;
public ChartViewDTO getChartDataInfo(String viewId,ChartViewDTO view){
public ChartViewDTO getChartDataInfo(String viewId, ChartViewDTO view) {
Gson gson = new Gson();
PanelGroupExtendDataExample extendDataExample = new PanelGroupExtendDataExample();
extendDataExample.createCriteria().andViewIdEqualTo(viewId);
List<PanelGroupExtendData> extendDataList = panelGroupExtendDataMapper.selectByExampleWithBLOBs(extendDataExample);
if(CollectionUtils.isNotEmpty(extendDataList)){
ChartViewDTO chartViewTemplate = gson.fromJson(extendDataList.get(0).getViewDetails(),ChartViewDTO.class);
List<PanelGroupExtendData> extendDataList = panelGroupExtendDataMapper.selectByExampleWithBLOBs(extendDataExample);
if (CollectionUtils.isNotEmpty(extendDataList)) {
ChartViewDTO chartViewTemplate = gson.fromJson(extendDataList.get(0).getViewDetails(), ChartViewDTO.class);
Map<String, Object> dataInfo = chartViewTemplate.getData();
if (dataInfo.get(transDataKey) != null) {
dataInfo.put("data", dataInfo.get(transDataKey));
dataInfo.remove(transDataKey);
}
view.setData(chartViewTemplate.getData());
}else{
DataEaseException.throwException("模板缓存数据中未获取指定视图数据:"+viewId);
} else {
DataEaseException.throwException("模板缓存数据中未获取指定视图数据:" + viewId);
}
return view;
}

View File

@ -13,7 +13,7 @@
class="market-main"
>
<el-row>
<el-col span="12">
<el-col :span="12">
<span class="title-left">{{ $t('panel.template_market') }}</span>
</el-col>
<el-col span="12">
@ -23,7 +23,7 @@
size="small"
class="title-right"
:placeholder="$t('panel.enter_template_name_tips')"
clearable="true"
:clearable="true"
/>
</el-col>
</el-row>
@ -88,7 +88,7 @@
:visible.sync="folderSelectShow"
width="600px"
class="market-dialog-css"
append-to-body="true"
:append-to-body="true"
:destroy-on-close="true"
>
<el-form