Merge pull request #4414 from dataease/pr@dev@refactor_custom-check

refactor(仪表板): 从模板新建的过滤组件在没有重新关联数据集前忽略权限检查,防止报无权限问题
This commit is contained in:
王嘉豪 2023-01-30 15:35:25 +08:00 committed by GitHub
commit 3831c40d12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -509,6 +509,9 @@ public class PanelGroupService {
if (dynamicDataMap == null) {
DataEaseException.throwException("Please use the template after v1.9");
}
//custom组件替换.tableId parentFieldId 追加识别标识
templateData = templateData.replaceAll("\"tableId\":\"", "\"tableId\":\"no_auth");
templateData = templateData.replaceAll("\"fieldsParent\":\\{\"id\":\"", "\"fieldsParent\":\\{\"id\":\"no_auth");
List<PanelViewInsertDTO> panelViews = new ArrayList<>();
List<PanelGroupExtendDataDTO> viewsData = new ArrayList<>();

View File

@ -138,6 +138,14 @@ export function fieldList(id, showLoading = true) {
}
export function fieldListWithPermission(id, showLoading = true) {
//初始模板中的过滤组件无需走后台
if (id.indexOf('no_auth') > -1) {
return new Promise(function(resolve) {
resolve({
data: []
})
})
}
return request({
url: '/dataset/field/listWithPermission/' + id,
loading: showLoading,