refactor(仪表板、数据大屏): 优化发布权限

This commit is contained in:
wangjiahao
2025-03-27 13:58:14 +08:00
committed by 王嘉豪
parent 09f4e25438
commit f0ed6cb603
9 changed files with 57 additions and 4 deletions

View File

@@ -135,6 +135,21 @@
<artifactId>flexmark-all</artifactId>
<version>${flexmark.version}</version>
</dependency>
<dependency>
<groupId>io.dataease</groupId>
<artifactId>xpack-base</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.dataease</groupId>
<artifactId>xpack-permissions</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.dataease</groupId>
<artifactId>xpack-sync</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>

View File

@@ -130,8 +130,11 @@ public class CoreVisualizationManage {
DEException.throwException("resource not exist");
}
visualizationInfo.setUpdateTime(System.currentTimeMillis());
SnapshotDataVisualizationInfo snapshotVisualizationInfo = new SnapshotDataVisualizationInfo();
BeanUtils.copyBean(snapshotVisualizationInfo, visualizationInfo);
coreOptRecentManage.saveOpt(visualizationInfo.getId(), OptConstants.OPT_RESOURCE_TYPE.VISUALIZATION, OptConstants.OPT_TYPE.UPDATE);
mapper.updateById(visualizationInfo);
snapshotMapper.updateById(snapshotVisualizationInfo);
}
}

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1743046434070" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5630" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M657.8 696.3l39.1-39.1 262.5 262.5-44.7 39.1-256.9-262.5z" p-id="5631"></path><path d="M691.3 958.7l-39.1-39.1 262.5-262.5 39.1 39.1-262.5 262.5zM510.7 321.7L678.6 516H588v223.4H437.6V516h-92.1l165.2-194.3m-0.4-98.3L207.1 580h166.5v223.4H652V580h166.5L510.3 223.4z" p-id="5632"></path><path d="M512.8 896.2H129.3V129.3h766.9v383.5h64V110.3c0-24.9-20.1-45-45-45H110.3c-24.9 0-45 20.1-45 45v804.9c0 24.9 20.1 45 45 45h402.5v-64z" p-id="5633"></path></svg>

After

Width:  |  Height:  |  Size: 786 B

View File

@@ -88,7 +88,7 @@ const emit = defineEmits(['handleCommand'])
:command="ele.command"
v-for="ele in menus"
:key="ele.label"
:disabled="ele.disabled"
:disabled="ele.disabled || (ele.command === 'cancelPublish' && node.extraFlag1 === 0)"
:class="{ 'de-hidden-drop-item': ele.hidden }"
>
<el-icon class="handle-icon" color="#646a73" size="16" v-if="ele.svgName">

View File

@@ -2874,6 +2874,7 @@ export default {
column_name: 'Field name'
},
visualization: {
cancel_publish_tips: 'Successfully unpublished',
resource_not_published: 'Resource not published',
re_publish: 'Republish',
published_success: 'Published successfully',

View File

@@ -2795,6 +2795,7 @@ export default {
column_name: '欄位名稱'
},
visualization: {
cancel_publish_tips: '取消發佈成功',
resource_not_published: '資源未發佈',
re_publish: '重新發佈',
published_success: '發佈成功',

View File

@@ -2801,6 +2801,7 @@ export default {
column_name: '字段名称'
},
visualization: {
cancel_publish_tips: '取消发布成功',
resource_not_published: '资源未发布',
re_publish: '重新发布',
published_success: '发布成功',

View File

@@ -4,6 +4,7 @@ import icon_add_outlined from '@/assets/svg/icon_add_outlined.svg'
import dvCopyDark from '@/assets/svg/dv-copy-dark.svg'
import dvDelete from '@/assets/svg/dv-delete.svg'
import dvMove from '@/assets/svg/dv-move.svg'
import dvCancelPublish from '@/assets/svg/dv-cancel-publish.svg'
import { treeDraggbleChart } from '@/utils/treeDraggbleChart'
import { debounce } from 'lodash-es'
import dvRename from '@/assets/svg/dv-rename.svg'
@@ -23,7 +24,8 @@ import {
copyResource,
deleteLogic,
ResourceOrFolder,
queryShareBaseApi
queryShareBaseApi,
updateBase
} from '@/api/visualization/dataVisualization'
import { ElIcon, ElMessage, ElMessageBox, ElScrollbar } from 'element-plus-secondary'
import { Icon } from '@/components/icon-custom'
@@ -170,10 +172,16 @@ const menuListWeight = id => {
return pWeight < 7 ? menuList : menuListWithCopy
}
const menuListWithCopy = [
{
label: t('visualization.cancel_publish'), //取消发布
command: 'cancelPublish',
svgName: dvCancelPublish
},
{
label: t('visualization.copy'), //'复制',
command: 'copy',
svgName: dvCopyDark
svgName: dvCopyDark,
divided: true
},
{
label: t('visualization.move_to'), //'移动到',
@@ -193,10 +201,16 @@ const menuListWithCopy = [
}
]
const menuList = [
{
label: t('visualization.cancel_publish'), //取消发布
command: 'cancelPublish',
svgName: dvCancelPublish
},
{
label: t('visualization.move_to'), //'移动到',
command: 'move',
svgName: dvMove
svgName: dvMove,
divided: true
},
{
label: t('visualization.rename'), //'重命名',
@@ -331,6 +345,22 @@ const operation = (cmd: string, data: BusiTreeNode, nodeType: string) => {
getTree()
})
})
} else if (cmd === 'cancelPublish') {
const params = {
id: data.id,
nodeType: 'leaf',
name: data.name,
type: curCanvasType.value,
mobileLayout: data?.extraFlag,
status: 0
}
updateBase(params).then(() => {
data['extraFlag1'] = 0
if (dvInfo.value.id === data.id) {
dvMainStore.updateDvInfoCall(0)
}
ElMessage.warning(t('visualization.cancel_publish_tips'))
})
} else if (cmd === 'edit') {
resourceEdit(data.id)
} else if (cmd === 'copy') {

View File

@@ -14,4 +14,5 @@ public class BusiResourceEditor implements Serializable {
private String name;
private String flag;
private int extraFlag;
private int extraFlag1 = 0;
}