diff --git a/core/core-backend/src/main/java/io/dataease/template/dao/ext/ExtVisualizationTemplateMapper.java b/core/core-backend/src/main/java/io/dataease/template/dao/ext/ExtVisualizationTemplateMapper.java index d7f73f1e30..46e9fe37f1 100644 --- a/core/core-backend/src/main/java/io/dataease/template/dao/ext/ExtVisualizationTemplateMapper.java +++ b/core/core-backend/src/main/java/io/dataease/template/dao/ext/ExtVisualizationTemplateMapper.java @@ -25,6 +25,8 @@ public interface ExtVisualizationTemplateMapper{ Long checkCategoryTemplateName(@Param("templateName") String templateName,@Param("categories") List categories); + Long checkCategoryTemplateBatchNames(@Param("templateNames") List templateNames,@Param("categories") List categories,@Param("templateArray") List templateArray); + List findTemplateCategories(@Param("templateId") String templateId); List findTemplateArrayCategories(@Param("templateArray") List templateArray); diff --git a/core/core-backend/src/main/java/io/dataease/template/service/TemplateManageService.java b/core/core-backend/src/main/java/io/dataease/template/service/TemplateManageService.java index 6969a32f96..b8de15c4b3 100644 --- a/core/core-backend/src/main/java/io/dataease/template/service/TemplateManageService.java +++ b/core/core-backend/src/main/java/io/dataease/template/service/TemplateManageService.java @@ -183,6 +183,16 @@ public class TemplateManageService implements TemplateManageApi { } } + @Override + public String checkCategoryTemplateBatchNames(TemplateManageRequest request) { + Long result = extTemplateMapper.checkCategoryTemplateBatchNames(request.getTemplateNames(),request.getCategories(),request.getTemplateArray()); + if (result == 0) { + return CommonConstants.CHECK_RESULT.NONE; + } else { + return CommonConstants.CHECK_RESULT.EXIST_ALL; + } + } + //分类名称检查 public String categoryNameCheck(String optType, String name, String id) { QueryWrapper wrapper = new QueryWrapper<>(); diff --git a/core/core-backend/src/main/resources/mybatis/ExtVisualizationTemplateMapper.xml b/core/core-backend/src/main/resources/mybatis/ExtVisualizationTemplateMapper.xml index 89873f9728..77fda85d80 100644 --- a/core/core-backend/src/main/resources/mybatis/ExtVisualizationTemplateMapper.xml +++ b/core/core-backend/src/main/resources/mybatis/ExtVisualizationTemplateMapper.xml @@ -118,6 +118,27 @@ + + delete from visualization_template_category_map tcm diff --git a/core/core-frontend/src/api/template.ts b/core/core-frontend/src/api/template.ts index 75302e7d32..657591d6ee 100644 --- a/core/core-frontend/src/api/template.ts +++ b/core/core-frontend/src/api/template.ts @@ -62,6 +62,13 @@ export function categoryTemplateNameCheck(data) { }) } +export function checkCategoryTemplateBatchNames(data) { + return request.post({ + url: '/templateManage/categoryTemplateNameCheck', + data: data + }) +} + export function batchDelete(data) { return request.post({ url: '/templateManage/batchDelete', diff --git a/core/core-frontend/src/components/dashboard/DbToolbar.vue b/core/core-frontend/src/components/dashboard/DbToolbar.vue index 5033410eeb..40a7d2f7de 100644 --- a/core/core-frontend/src/components/dashboard/DbToolbar.vue +++ b/core/core-frontend/src/components/dashboard/DbToolbar.vue @@ -197,6 +197,10 @@ const openDataBoardSetting = () => { } const openMobileSetting = () => { + if (!dvInfo.value.id) { + ElMessage.warning('请先保存当前页面') + return + } useEmitt().emitter.emit('mobileConfig') } diff --git a/core/core-frontend/src/views/common/DeResourceTree.vue b/core/core-frontend/src/views/common/DeResourceTree.vue index 7c1362a378..4d3c000724 100644 --- a/core/core-frontend/src/views/common/DeResourceTree.vue +++ b/core/core-frontend/src/views/common/DeResourceTree.vue @@ -558,9 +558,7 @@ defineExpose({ - {{ data.extraFlag }}{{ node.label }} + {{ node.label }}
{ const editTemplate = () => { const nameCheckRequest = { pid: state.templateInfo.pid, + id: state.templateInfo.id, name: state.templateInfo.name, categories: state.templateInfo.categories, optType: props.optType } // 全局名称校验 - nameCheck(nameCheckRequest).then(() => { - save(state.templateInfo).then(() => { - ElMessage.success(t('编辑成功')) - emits('refresh', getRefreshPInfo()) - emits('closeEditTemplateDialog') - }) + nameCheck(nameCheckRequest).then(response => { + if (response.data.indexOf('exist') > -1) { + ElMessage.warning('当前名称已在模版管理中存在,请修改') + } else { + save(state.templateInfo).then(response => { + ElMessage.success(t('编辑成功')) + emits('refresh', getRefreshPInfo()) + emits('closeEditTemplateDialog') + }) + } }) } @@ -231,12 +237,16 @@ const importTemplate = () => { }) } else { // 全局名称校验 - nameCheck(nameCheckRequest).then(() => { - save(state.templateInfo).then(() => { - ElMessage.success(t('导入成功')) - emits('refresh', getRefreshPInfo()) - emits('closeEditTemplateDialog') - }) + nameCheck(nameCheckRequest).then(response => { + if (response.data.indexOf('exist') > -1) { + ElMessage.warning('当前名称已在模版管理中存在,请修改') + } else { + save(state.templateInfo).then(response => { + ElMessage.success(t('导入成功')) + emits('refresh', getRefreshPInfo()) + emits('closeEditTemplateDialog') + }) + } }) } }) diff --git a/core/core-frontend/src/views/template/index.vue b/core/core-frontend/src/views/template/index.vue index 4a26ce46ec..2f9ad8beca 100644 --- a/core/core-frontend/src/views/template/index.vue +++ b/core/core-frontend/src/views/template/index.vue @@ -360,7 +360,7 @@ const templateDeleteConfirm = template => { const importRefresh = params => { if (params.optType === 'refresh') { - templateListRef.value.nodeClick({ id: params.refreshPid, name: params.refreshPid }) + templateListRef.value.nodeClick({ id: params.refreshPid, name: params.refreshPName }) } else { showTemplateEditDialog('new', null) } diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/template/TemplateManageApi.java b/sdk/api/api-base/src/main/java/io/dataease/api/template/TemplateManageApi.java index eb9ec491a8..d5b45f763c 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/template/TemplateManageApi.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/template/TemplateManageApi.java @@ -53,6 +53,10 @@ public interface TemplateManageApi { @Operation(summary = "分类名称校验") String categoryTemplateNameCheck(@RequestBody TemplateManageRequest request); + @PostMapping("/checkCategoryTemplateBatchNames") + @Operation(summary = "分类名称批量校验") + String checkCategoryTemplateBatchNames(@RequestBody TemplateManageRequest request); + @PostMapping("/batchUpdate") @Operation(summary = "批量更新") void batchUpdate(@RequestBody TemplateManageBatchRequest request); diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/template/request/TemplateManageRequest.java b/sdk/api/api-base/src/main/java/io/dataease/api/template/request/TemplateManageRequest.java index 8bf98f3135..9040090a9e 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/template/request/TemplateManageRequest.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/template/request/TemplateManageRequest.java @@ -26,6 +26,8 @@ public class TemplateManageRequest extends VisualizationTemplateVO { private String categoryId; private List categories; + + private List templateNames; private List templateArray; diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/visualization/DataVisualizationApi.java b/sdk/api/api-base/src/main/java/io/dataease/api/visualization/DataVisualizationApi.java index 33212ccf0a..fa10e6ea15 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/visualization/DataVisualizationApi.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/visualization/DataVisualizationApi.java @@ -66,7 +66,7 @@ public interface DataVisualizationApi { @PostMapping("/move") @DePermit(value = {"#p0.id+':manage'", "#p0.pid+':manage'"}, busiFlag = "#p0.type") - @Operation(summary = "移动可视化资") + @Operation(summary = "移动可视化资源") void move(@RequestBody DataVisualizationBaseRequest request); @PostMapping("/nameCheck")