forked from github/dataease
fix(应用): 修复仪表板应用导出时,携带单独数据集定义的组件导入新环境组件会报错问题 #4620
This commit is contained in:
parent
66f46ff7d5
commit
d27d7e91d7
@ -932,6 +932,28 @@ public class PanelGroupService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 兼容过滤组件使用独立的数据集情况
|
||||
PanelGroupDTO panelGroupInfo = this.findOne(panelId);
|
||||
String panelData = panelGroupInfo.getPanelData();
|
||||
try {
|
||||
if (StringUtils.isNotEmpty(panelData)) {
|
||||
JSONArray panelDataArray = JSONObject.parseArray(panelData);
|
||||
for (int i = 0; i < panelDataArray.size(); i++) {
|
||||
JSONObject element = panelDataArray.getJSONObject(i);
|
||||
if ("custom".equals(element.getString("type"))) {
|
||||
JSONObject fieldsParent = element.getJSONObject("options").getJSONObject("attrs").getJSONObject("fieldsParent");
|
||||
if (ObjectUtils.isNotEmpty(fieldsParent)) {
|
||||
allTableIds.add(fieldsParent.getString("id"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
//ignore
|
||||
LogUtil.warn("custom component dataset id get error");
|
||||
}
|
||||
|
||||
}
|
||||
datasetTablesInfo = extDataSetTableMapper.findByTableIds(allTableIds);
|
||||
//4.获取所有数据集字段信息
|
||||
|
Loading…
Reference in New Issue
Block a user