forked from github/dataease
Merge pull request #8691 from dataease/pr@dev-v2@refactor_panel
Pr@dev v2@refactor panel
This commit is contained in:
commit
96be94e3b3
@ -25,6 +25,8 @@ public interface ExtVisualizationTemplateMapper{
|
|||||||
|
|
||||||
Long checkCategoryTemplateName(@Param("templateName") String templateName,@Param("categories") List<String> categories);
|
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> findTemplateCategories(@Param("templateId") String templateId);
|
||||||
List<String> findTemplateArrayCategories(@Param("templateArray") List<String> templateArray);
|
List<String> findTemplateArrayCategories(@Param("templateArray") List<String> templateArray);
|
||||||
|
|
||||||
|
@ -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) {
|
public String categoryNameCheck(String optType, String name, String id) {
|
||||||
QueryWrapper<VisualizationTemplateCategory> wrapper = new QueryWrapper<>();
|
QueryWrapper<VisualizationTemplateCategory> wrapper = new QueryWrapper<>();
|
||||||
|
@ -118,6 +118,27 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</select>
|
</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 id="deleteCategoryMapByTemplate">
|
||||||
delete from visualization_template_category_map tcm
|
delete from visualization_template_category_map tcm
|
||||||
<where>
|
<where>
|
||||||
|
@ -62,6 +62,13 @@ export function categoryTemplateNameCheck(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function checkCategoryTemplateBatchNames(data) {
|
||||||
|
return request.post({
|
||||||
|
url: '/templateManage/categoryTemplateNameCheck',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export function batchDelete(data) {
|
export function batchDelete(data) {
|
||||||
return request.post({
|
return request.post({
|
||||||
url: '/templateManage/batchDelete',
|
url: '/templateManage/batchDelete',
|
||||||
|
@ -197,6 +197,10 @@ const openDataBoardSetting = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const openMobileSetting = () => {
|
const openMobileSetting = () => {
|
||||||
|
if (!dvInfo.value.id) {
|
||||||
|
ElMessage.warning('请先保存当前页面')
|
||||||
|
return
|
||||||
|
}
|
||||||
useEmitt().emitter.emit('mobileConfig')
|
useEmitt().emitter.emit('mobileConfig')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -558,9 +558,7 @@ defineExpose({
|
|||||||
<el-icon class="icon-screen-new color-dataV" style="font-size: 18px" v-else>
|
<el-icon class="icon-screen-new color-dataV" style="font-size: 18px" v-else>
|
||||||
<Icon name="icon_operation-analysis_outlined"></Icon>
|
<Icon name="icon_operation-analysis_outlined"></Icon>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<span :title="node.label" class="label-tooltip"
|
<span :title="node.label" class="label-tooltip">{{ node.label }}</span>
|
||||||
>{{ data.extraFlag }}{{ node.label }}</span
|
|
||||||
>
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="icon-more flex-align-center"
|
class="icon-more flex-align-center"
|
||||||
|
@ -122,6 +122,7 @@ const state = reactive({
|
|||||||
},
|
},
|
||||||
recover: false,
|
recover: false,
|
||||||
templateInfo: {
|
templateInfo: {
|
||||||
|
id: null,
|
||||||
level: '1',
|
level: '1',
|
||||||
pid: props.pid,
|
pid: props.pid,
|
||||||
categories: [],
|
categories: [],
|
||||||
@ -178,17 +179,22 @@ const saveTemplate = () => {
|
|||||||
const editTemplate = () => {
|
const editTemplate = () => {
|
||||||
const nameCheckRequest = {
|
const nameCheckRequest = {
|
||||||
pid: state.templateInfo.pid,
|
pid: state.templateInfo.pid,
|
||||||
|
id: state.templateInfo.id,
|
||||||
name: state.templateInfo.name,
|
name: state.templateInfo.name,
|
||||||
categories: state.templateInfo.categories,
|
categories: state.templateInfo.categories,
|
||||||
optType: props.optType
|
optType: props.optType
|
||||||
}
|
}
|
||||||
// 全局名称校验
|
// 全局名称校验
|
||||||
nameCheck(nameCheckRequest).then(() => {
|
nameCheck(nameCheckRequest).then(response => {
|
||||||
save(state.templateInfo).then(() => {
|
if (response.data.indexOf('exist') > -1) {
|
||||||
|
ElMessage.warning('当前名称已在模版管理中存在,请修改')
|
||||||
|
} else {
|
||||||
|
save(state.templateInfo).then(response => {
|
||||||
ElMessage.success(t('编辑成功'))
|
ElMessage.success(t('编辑成功'))
|
||||||
emits('refresh', getRefreshPInfo())
|
emits('refresh', getRefreshPInfo())
|
||||||
emits('closeEditTemplateDialog')
|
emits('closeEditTemplateDialog')
|
||||||
})
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,12 +237,16 @@ const importTemplate = () => {
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// 全局名称校验
|
// 全局名称校验
|
||||||
nameCheck(nameCheckRequest).then(() => {
|
nameCheck(nameCheckRequest).then(response => {
|
||||||
save(state.templateInfo).then(() => {
|
if (response.data.indexOf('exist') > -1) {
|
||||||
|
ElMessage.warning('当前名称已在模版管理中存在,请修改')
|
||||||
|
} else {
|
||||||
|
save(state.templateInfo).then(response => {
|
||||||
ElMessage.success(t('导入成功'))
|
ElMessage.success(t('导入成功'))
|
||||||
emits('refresh', getRefreshPInfo())
|
emits('refresh', getRefreshPInfo())
|
||||||
emits('closeEditTemplateDialog')
|
emits('closeEditTemplateDialog')
|
||||||
})
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -360,7 +360,7 @@ const templateDeleteConfirm = template => {
|
|||||||
|
|
||||||
const importRefresh = params => {
|
const importRefresh = params => {
|
||||||
if (params.optType === 'refresh') {
|
if (params.optType === 'refresh') {
|
||||||
templateListRef.value.nodeClick({ id: params.refreshPid, name: params.refreshPid })
|
templateListRef.value.nodeClick({ id: params.refreshPid, name: params.refreshPName })
|
||||||
} else {
|
} else {
|
||||||
showTemplateEditDialog('new', null)
|
showTemplateEditDialog('new', null)
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,10 @@ public interface TemplateManageApi {
|
|||||||
@Operation(summary = "分类名称校验")
|
@Operation(summary = "分类名称校验")
|
||||||
String categoryTemplateNameCheck(@RequestBody TemplateManageRequest request);
|
String categoryTemplateNameCheck(@RequestBody TemplateManageRequest request);
|
||||||
|
|
||||||
|
@PostMapping("/checkCategoryTemplateBatchNames")
|
||||||
|
@Operation(summary = "分类名称批量校验")
|
||||||
|
String checkCategoryTemplateBatchNames(@RequestBody TemplateManageRequest request);
|
||||||
|
|
||||||
@PostMapping("/batchUpdate")
|
@PostMapping("/batchUpdate")
|
||||||
@Operation(summary = "批量更新")
|
@Operation(summary = "批量更新")
|
||||||
void batchUpdate(@RequestBody TemplateManageBatchRequest request);
|
void batchUpdate(@RequestBody TemplateManageBatchRequest request);
|
||||||
|
@ -27,6 +27,8 @@ public class TemplateManageRequest extends VisualizationTemplateVO {
|
|||||||
|
|
||||||
private List<String> categories;
|
private List<String> categories;
|
||||||
|
|
||||||
|
private List<String> templateNames;
|
||||||
|
|
||||||
private List<String> templateArray;
|
private List<String> templateArray;
|
||||||
|
|
||||||
public TemplateManageRequest() {
|
public TemplateManageRequest() {
|
||||||
|
@ -66,7 +66,7 @@ public interface DataVisualizationApi {
|
|||||||
|
|
||||||
@PostMapping("/move")
|
@PostMapping("/move")
|
||||||
@DePermit(value = {"#p0.id+':manage'", "#p0.pid+':manage'"}, busiFlag = "#p0.type")
|
@DePermit(value = {"#p0.id+':manage'", "#p0.pid+':manage'"}, busiFlag = "#p0.type")
|
||||||
@Operation(summary = "移动可视化资")
|
@Operation(summary = "移动可视化资源")
|
||||||
void move(@RequestBody DataVisualizationBaseRequest request);
|
void move(@RequestBody DataVisualizationBaseRequest request);
|
||||||
|
|
||||||
@PostMapping("/nameCheck")
|
@PostMapping("/nameCheck")
|
||||||
|
Loading…
Reference in New Issue
Block a user