mirror of
https://github.com/dataease/dataease.git
synced 2025-02-25 03:52:59 +08:00
fix: 仪表盘列表中的仪表盘可转为默认仪表盘
This commit is contained in:
parent
04abe0c182
commit
872067ce97
@ -10,6 +10,10 @@ public interface ExtPanelGroupMapper {
|
||||
|
||||
List<PanelGroupDTO> panelGroupList(PanelGroupRequest request);
|
||||
|
||||
List<PanelGroupDTO> panelGroupListDefault(PanelGroupRequest request);
|
||||
|
||||
|
||||
|
||||
//会级联删除pid 下的所有数据
|
||||
int deleteCircle(@Param("pid") String pid);
|
||||
|
||||
|
@ -12,6 +12,21 @@
|
||||
select panel_group.*,panel_group.name as label from panel_group where id =#{id}
|
||||
</select>
|
||||
|
||||
<select id="panelGroupListDefault" resultMap="BaseResultMapDTO">
|
||||
SELECT
|
||||
id,
|
||||
`name`,
|
||||
pid,
|
||||
`level`,
|
||||
node_type,
|
||||
create_by,
|
||||
create_time,
|
||||
panel_type,
|
||||
`name` AS label
|
||||
from panel_group
|
||||
where panel_group.panel_type=#{panelType}
|
||||
</select>
|
||||
|
||||
<select id="panelGroupList" resultMap="BaseResultMapDTO">
|
||||
SELECT
|
||||
id,
|
||||
|
@ -16,5 +16,13 @@ public class PanelConstants {
|
||||
|
||||
public final static String TEMPLATE_TYPE_SELF = "self";
|
||||
|
||||
public final static String PANEL_TYPE_SYSTEM = "system";
|
||||
|
||||
public final static String PANEL_TYPE_SELF = "self";
|
||||
|
||||
public final static String PANEL_NODE_TYPE_FOlDER = "folder";
|
||||
|
||||
public final static String PANEL_NODE_TYPE_PANEL = "panel";
|
||||
|
||||
|
||||
}
|
||||
|
@ -15,6 +15,8 @@ public class PanelGroupRequest extends PanelGroupDTO {
|
||||
|
||||
private String userId;
|
||||
|
||||
private String optType;
|
||||
|
||||
public PanelGroupRequest() {
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ public class PanelGroupService {
|
||||
}
|
||||
|
||||
public List<PanelGroupDTO> getDefaultTree(PanelGroupRequest panelGroupRequest) {
|
||||
return extPanelGroupMapper.panelGroupList(panelGroupRequest);
|
||||
return extPanelGroupMapper.panelGroupListDefault(panelGroupRequest);
|
||||
}
|
||||
|
||||
|
||||
@ -83,7 +83,19 @@ public class PanelGroupService {
|
||||
request.setCreateBy(AuthUtils.getUser().getUsername());
|
||||
panelGroupMapper.insert(request);
|
||||
} else {
|
||||
panelGroupMapper.updateByPrimaryKeySelective(request);
|
||||
// 复制为默认仪表盘
|
||||
if("toDefaultPanel".equals(request.getOptType())){
|
||||
PanelGroupWithBLOBs newDefaultPanel = panelGroupMapper.selectByPrimaryKey(request.getId());
|
||||
newDefaultPanel.setPanelType(PanelConstants.PANEL_TYPE_SYSTEM);
|
||||
newDefaultPanel.setNodeType(PanelConstants.PANEL_NODE_TYPE_PANEL);
|
||||
newDefaultPanel.setName(request.getName());
|
||||
newDefaultPanel.setId(UUID.randomUUID().toString());
|
||||
newDefaultPanel.setPid(null);
|
||||
newDefaultPanel.setLevel(0);
|
||||
panelGroupMapper.insertSelective(newDefaultPanel);
|
||||
}else{
|
||||
panelGroupMapper.updateByPrimaryKeySelective(request);
|
||||
}
|
||||
}
|
||||
PanelGroupDTO panelGroupDTO = new PanelGroupDTO();
|
||||
BeanUtils.copyBean(panelGroupDTO, request);
|
||||
|
@ -158,7 +158,7 @@ export default {
|
||||
value: rotate !== 0 ? this.translatecurComponentShift(key, condition, curComponentStyle) : condition.dragShift
|
||||
})
|
||||
|
||||
condition.lineNode && (condition.lineNode.style[key] = `${condition.lineShift}px`)
|
||||
condition.lineNode.style[key] = `${condition.lineShift}px`
|
||||
needToShow.push(condition.line)
|
||||
})
|
||||
})
|
||||
@ -230,20 +230,20 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.mark-line {
|
||||
.mark-line {
|
||||
height: 100%;
|
||||
}
|
||||
.line {
|
||||
}
|
||||
.line {
|
||||
background: #59c7f9;
|
||||
position: absolute;
|
||||
z-index: 1000;
|
||||
}
|
||||
.xline {
|
||||
}
|
||||
.xline {
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
}
|
||||
.yline {
|
||||
}
|
||||
.yline {
|
||||
width: 1px;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -838,7 +838,7 @@ export default {
|
||||
back: 'Back',
|
||||
view: 'Chart',
|
||||
edit: 'Edit',
|
||||
panel_list: 'Panel',
|
||||
panel_list: 'Panel List',
|
||||
module: 'Component',
|
||||
filter_module: 'Filter Component',
|
||||
select_by_module: 'Select by Component',
|
||||
@ -854,6 +854,8 @@ export default {
|
||||
photo: 'Photo',
|
||||
default_panel: 'Default Panel',
|
||||
create_public_links: 'Create public links',
|
||||
to_default: 'Save To Default',
|
||||
to_default_panel: 'Save To Default Panel',
|
||||
store: 'Store',
|
||||
save_to_panel: 'Save to template',
|
||||
export_to_panel: 'Export to template',
|
||||
|
@ -822,7 +822,7 @@ export default {
|
||||
datalist: '視圖列表',
|
||||
group: '目錄',
|
||||
panel: '儀表盤',
|
||||
panel_list: '儀表盤',
|
||||
panel_list: '儀表盤列表',
|
||||
groupAdd: '新建目錄',
|
||||
panelAdd: '新建儀表盤',
|
||||
delete: '刪除',
|
||||
@ -853,6 +853,8 @@ export default {
|
||||
photo: '圖片',
|
||||
default_panel: '默認儀表盤',
|
||||
create_public_links: '創建公共鏈接',
|
||||
to_default: '另存为默认',
|
||||
to_default_panel: '另存为默认儀表盤',
|
||||
store: '收藏',
|
||||
save_to_panel: '保存為模板',
|
||||
export_to_panel: '導出為模板',
|
||||
|
@ -824,7 +824,7 @@ export default {
|
||||
datalist: '视图列表',
|
||||
group: '目录',
|
||||
panel: '仪表盘',
|
||||
panel_list: '仪表盘',
|
||||
panel_list: '仪表盘列表',
|
||||
groupAdd: '新建目录',
|
||||
panelAdd: '新建仪表盘',
|
||||
delete: '删除',
|
||||
@ -855,6 +855,8 @@ export default {
|
||||
photo: '图片',
|
||||
default_panel: '默认仪表盘',
|
||||
create_public_links: '创建公共链接',
|
||||
to_default: '另存为默认',
|
||||
to_default_panel: '另存为默认仪表盘',
|
||||
store: '收藏',
|
||||
save_to_panel: '保存为模板',
|
||||
export_to_panel: '导出为模板',
|
||||
|
@ -2,7 +2,7 @@
|
||||
<el-row>
|
||||
<el-row v-loading="$store.getters.loadingMap[$store.getters.currentPath]">
|
||||
<el-col :span="2">
|
||||
<span> </span>
|
||||
<span> </span>
|
||||
<ul class="direction">
|
||||
<li class="left" @click="move(sliderWidth, 1, speed)">
|
||||
<svg class="icon" width="15px" height="15.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#ffffff" d="M481.233 904c8.189 0 16.379-3.124 22.628-9.372 12.496-12.497 12.496-32.759 0-45.256L166.488 512l337.373-337.373c12.496-12.497 12.496-32.758 0-45.255-12.498-12.497-32.758-12.497-45.256 0l-360 360c-12.496 12.497-12.496 32.758 0 45.255l360 360c6.249 6.249 14.439 9.373 22.628 9.373z" /></svg>
|
||||
@ -48,7 +48,7 @@
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<span> </span>
|
||||
<span> </span>
|
||||
<ul class="direction">
|
||||
<li class="right" @click="move(sliderWidth, -1, speed)">
|
||||
<svg class="icon" width="15px" height="15.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#ffffff" d="M557.179 904c-8.189 0-16.379-3.124-22.628-9.372-12.496-12.497-12.496-32.759 0-45.256L871.924 512 534.551 174.627c-12.496-12.497-12.496-32.758 0-45.255 12.498-12.497 32.758-12.497 45.256 0l360 360c12.496 12.497 12.496 32.758 0 45.255l-360 360c-6.249 6.249-14.439 9.373-22.628 9.373z" /></svg>
|
||||
|
@ -12,7 +12,7 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 5px">
|
||||
<el-col :span="4">{{ editPanel.titleSuf }} {{ $t('commons.name') }}</el-col>
|
||||
<el-col :span="4">{{ editPanel.titleSuf }}{{ $t('commons.name') }}</el-col>
|
||||
<el-col :span="20">
|
||||
<el-input v-model="editPanel.panelInfo.name" clearable size="mini" />
|
||||
</el-col>
|
||||
|
@ -1,6 +1,5 @@
|
||||
<template xmlns:el-col="http://www.w3.org/1999/html">
|
||||
<el-col style="padding: 0 10px 0 10px;">
|
||||
<!-- panel list -->
|
||||
<el-col>
|
||||
<el-row>
|
||||
<span class="header-title">{{ $t('panel.default_panel') }}</span>
|
||||
@ -12,13 +11,32 @@
|
||||
:expand-on-click-node="true"
|
||||
@node-click="nodeClick"
|
||||
>
|
||||
<span slot-scope="{ data }" class="custom-tree-node">
|
||||
<span slot-scope="{ node, data }" class="custom-tree-node">
|
||||
<span style="display: flex; flex: 1 1 0%; width: 0px;">
|
||||
<span>
|
||||
<svg-icon icon-class="scene" class="ds-icon-scene" />
|
||||
<svg-icon icon-class="panel" class="ds-icon-scene" />
|
||||
</span>
|
||||
<span style="margin-left: 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">{{ data.name }}</span>
|
||||
</span>
|
||||
<span style="margin-left: 12px;" @click.stop>
|
||||
<el-dropdown trigger="click" size="small" @command="clickMore">
|
||||
<span class="el-dropdown-link">
|
||||
<el-button
|
||||
icon="el-icon-more"
|
||||
type="text"
|
||||
size="small"
|
||||
/>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item icon="el-icon-edit-outline" :command="beforeClickMore('rename',data,node)">
|
||||
{{ $t('panel.rename') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-delete" :command="beforeClickMore('delete',data,node)">
|
||||
{{ $t('panel.delete') }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
@ -26,7 +44,7 @@
|
||||
|
||||
<el-row>
|
||||
<span class="header-title">
|
||||
{{ $t('panel.panel') }}
|
||||
{{ $t('panel.panel_list') }}
|
||||
<el-button style="float: right;padding-right: 7px;" icon="el-icon-plus" type="text" @click="showEditPanel(newFolder)" />
|
||||
<!-- <el-button style="float: right;" type="primary" size="mini" @click="showEditPanel(newFolder)">-->
|
||||
<!-- {{ $t('panel.groupAdd') }}-->
|
||||
@ -64,10 +82,10 @@
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="beforeClickEdit('folder','new',data,node)">
|
||||
<i class="el-icon-folder" />   <span>{{ $t('panel.groupAdd') }}</span>
|
||||
<i class="el-icon-folder" /> <span>{{ $t('panel.groupAdd') }}</span>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="beforeClickEdit('panel','new',data,node)">
|
||||
<svg-icon icon-class="panel" class="ds-icon-scene" />   <span>{{ $t('panel.panelAdd') }}</span>
|
||||
<svg-icon icon-class="panel" class="ds-icon-scene" /> <span>{{ $t('panel.panelAdd') }}</span>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
@ -91,6 +109,9 @@
|
||||
<el-dropdown-item v-if="data.nodeType==='panel'" icon="el-icon-share" :command="beforeClickMore('share',data,node)">
|
||||
{{ $t('panel.share') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="data.nodeType==='panel'" icon="el-icon-paperclip" :command="beforeClickMore('toDefaultPanel',data,node)">
|
||||
{{ $t('panel.to_default_panel') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="data.nodeType==='panel'" icon="el-icon-edit" :command="beforeClickMore('edit',data,node)">
|
||||
{{ $t('panel.edit') }}
|
||||
</el-dropdown-item>
|
||||
@ -318,6 +339,7 @@ export default {
|
||||
methods: {
|
||||
closeEditPanelDialog() {
|
||||
this.editPanel.visible = false
|
||||
this.defaultTree()
|
||||
this.tree(this.groupForm)
|
||||
},
|
||||
showEditPanel(param) {
|
||||
@ -351,6 +373,17 @@ export default {
|
||||
}
|
||||
}
|
||||
break
|
||||
case 'toDefaultPanel':
|
||||
this.editPanel = {
|
||||
visible: true,
|
||||
titlePre: this.$t('panel.to_default'),
|
||||
panelInfo: {
|
||||
id: param.data.id,
|
||||
name: param.data.name,
|
||||
optType: 'toDefaultPanel'
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
switch (param.type) {
|
||||
case 'folder':
|
||||
@ -372,6 +405,7 @@ export default {
|
||||
|
||||
clickMore(param) {
|
||||
switch (param.optType) {
|
||||
case 'toDefaultPanel':
|
||||
case 'rename':
|
||||
this.showEditPanel(param)
|
||||
break
|
||||
@ -426,6 +460,7 @@ export default {
|
||||
showClose: true
|
||||
})
|
||||
this.tree(this.groupForm)
|
||||
this.defaultTree()
|
||||
})
|
||||
} else {
|
||||
this.$message({
|
||||
@ -451,6 +486,7 @@ export default {
|
||||
showClose: true
|
||||
})
|
||||
this.tree(this.groupForm)
|
||||
this.defaultTree()
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
@ -539,7 +575,6 @@ export default {
|
||||
item.type !== 'custom' && (item.id = uuid.v1())
|
||||
})
|
||||
}
|
||||
|
||||
return data
|
||||
}
|
||||
}
|
||||
@ -557,14 +592,6 @@ export default {
|
||||
/*line-height: 36px;*/
|
||||
}
|
||||
|
||||
.el-divider--horizontal {
|
||||
margin: 12px 0
|
||||
}
|
||||
|
||||
.search-input {
|
||||
padding: 12px 0;
|
||||
}
|
||||
|
||||
.custom-tree-node {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
@ -583,24 +610,4 @@ export default {
|
||||
padding:0 8px;
|
||||
}
|
||||
|
||||
.custom-position {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
flex-flow: row nowrap;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.title-css {
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
.title-text {
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user