Merge pull request #8691 from dataease/pr@dev-v2@refactor_panel

Pr@dev v2@refactor panel
This commit is contained in:
王嘉豪 2024-03-26 00:01:25 +08:00 committed by GitHub
commit 96be94e3b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 75 additions and 17 deletions

View File

@ -25,6 +25,8 @@ public interface ExtVisualizationTemplateMapper{
Long checkCategoryTemplateName(@Param("templateName") String templateName,@Param("categories") List<String> categories);
Long checkCategoryTemplateBatchNames(@Param("templateNames") List<String> templateNames,@Param("categories") List<String> categories,@Param("templateArray") List<String> templateArray);
List<String> findTemplateCategories(@Param("templateId") String templateId);
List<String> findTemplateArrayCategories(@Param("templateArray") List<String> templateArray);

View File

@ -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<VisualizationTemplateCategory> wrapper = new QueryWrapper<>();

View File

@ -118,6 +118,27 @@
</foreach>
</select>
<select id="checkCategoryTemplateBatchNames" resultType="Long">
SELECT
count(1)
FROM
visualization_template vt
LEFT JOIN visualization_template_category_map vtcm ON vt.id = vtcm.template_id
WHERE
vt.NAME in
<foreach collection="templateNames" item="templateName" index="index" open="(" close=")" separator=",">
#{templateName}
</foreach>
AND vtcm.category_id IN
<foreach collection="categories" item="categoryId" index="index" open="(" close=")" separator=",">
#{categoryId}
</foreach>
and vt.id not in
<foreach collection="templateArray" item="templateId" index="index" open="(" close=")" separator=",">
#{templateId}
</foreach>
</select>
<delete id="deleteCategoryMapByTemplate">
delete from visualization_template_category_map tcm
<where>

View File

@ -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',

View File

@ -197,6 +197,10 @@ const openDataBoardSetting = () => {
}
const openMobileSetting = () => {
if (!dvInfo.value.id) {
ElMessage.warning('请先保存当前页面')
return
}
useEmitt().emitter.emit('mobileConfig')
}

View File

@ -558,9 +558,7 @@ defineExpose({
<el-icon class="icon-screen-new color-dataV" style="font-size: 18px" v-else>
<Icon name="icon_operation-analysis_outlined"></Icon>
</el-icon>
<span :title="node.label" class="label-tooltip"
>{{ data.extraFlag }}{{ node.label }}</span
>
<span :title="node.label" class="label-tooltip">{{ node.label }}</span>
<div
class="icon-more flex-align-center"

View File

@ -122,6 +122,7 @@ const state = reactive({
},
recover: false,
templateInfo: {
id: null,
level: '1',
pid: props.pid,
categories: [],
@ -178,17 +179,22 @@ const saveTemplate = () => {
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')
})
}
})
}
})

View File

@ -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)
}

View File

@ -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);

View File

@ -26,6 +26,8 @@ public class TemplateManageRequest extends VisualizationTemplateVO {
private String categoryId;
private List<String> categories;
private List<String> templateNames;
private List<String> templateArray;

View File

@ -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")