refactor: 优化发布问题

This commit is contained in:
wangjiahao
2025-04-01 22:09:01 +08:00
committed by 王嘉豪
parent 676f5569ea
commit a6647dd0e2
7 changed files with 36 additions and 12 deletions

View File

@@ -7,6 +7,7 @@ export interface ResourceOrFolder {
nodeType: 'folder' | 'leaf'
type: string
mobileLayout: boolean
status: boolean
}
export interface Panel {

View File

@@ -726,6 +726,7 @@ const initOpenHandler = newWindow => {
<el-dropdown popper-class="menu-outer-dv_popper" trigger="hover">
<el-button
@click="publishStatusChange(1)"
:disabled="dvInfo.status === 1"
style="float: right; margin: 0 12px 0 0"
type="primary"
>

View File

@@ -476,6 +476,7 @@ const fullScreenPreview = () => {
<el-dropdown effect="dark" popper-class="menu-outer-dv_popper" trigger="hover">
<el-button
@click="publishStatusChange(1)"
:disabled="dvInfo.status === 1"
style="float: right; margin: 0 12px 0 0"
type="primary"
>

View File

@@ -430,11 +430,11 @@ em {
}
.color-screen {
background: rgb(0, 214, 185);
background: rgba(51, 112, 255, 1);
}
.color-dataV {
background: rgb(0, 214, 185) !important;
background: rgba(51, 112, 255, 1);
}
.color-dataset {

View File

@@ -256,7 +256,8 @@ const saveResource = () => {
nodeType: nodeType.value as 'folder' | 'leaf',
name: resourceForm.name,
type: curCanvasType.value,
mobileLayout: state.targetInfo?.extraFlag
mobileLayout: state.targetInfo?.extraFlag,
status: state.targetInfo?.extraFlag1
}
switch (cmd.value) {

View File

@@ -75,7 +75,7 @@ const props = defineProps({
const defaultProps = {
children: 'children',
label: 'name',
disabled: 'leaf'
disabled: (data: any) => data.extraFlag1 === 0
}
const mounted = ref(false)
const rootManage = ref(false)
@@ -259,13 +259,24 @@ const cancelPreRequest = () => {
cancelRequestBatch('/linkJump/queryVisualizationJumpInfo/**')
}
const nodeClick = (data: BusiTreeNode) => {
cancelPreRequest()
selectedNodeKey.value = data.id
if (data.leaf) {
emit('nodeClick', data)
const nodeClick = (data: BusiTreeNode, node) => {
if (node.disabled) {
nextTick(() => {
// 找到当前高亮的节点,移除高亮样式
const currentNode = resourceListTree.value.$el.querySelector('.is-current')
if (currentNode) {
currentNode.classList.remove('is-current')
}
return // 阻止后续逻辑
})
} else {
resourceListTree.value.setCurrentKey(null)
cancelPreRequest()
selectedNodeKey.value = data.id
if (data.leaf) {
emit('nodeClick', data)
} else {
resourceListTree.value.setCurrentKey(null)
}
}
}
@@ -745,7 +756,12 @@ defineExpose({
></component
></Icon>
</el-icon>
<el-icon class="icon-screen-new color-dataV" style="font-size: 18px" v-else>
<el-icon
class="icon-screen-new color-dataV"
:class="{ 'color-dataV': data.extraFlag1, 'color-dataV-disabled': !data.extraFlag1 }"
style="font-size: 18px"
v-else
>
<Icon name="icon_operation-analysis_outlined"
><icon_operationAnalysis_outlined class="svg-icon"
/></Icon>
@@ -968,4 +984,8 @@ defineExpose({
color: rgba(187, 191, 196, 1);
cursor: not-allowed;
}
.color-dataV-disabled {
background: #bbbfc4 !important;
}
</style>

View File

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