Browse Source

[Bug]Fix right-click menu function error (#9766)

* The utils configuration files are centrally managed under common

* fix Right-click menu function error
3.0.0/version-upgrade
labbomb 2 years ago committed by GitHub
parent
commit
d8c32ab5c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 41
      dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-context-menu.tsx
  2. 12
      dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/menu.module.scss

41
dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-context-menu.tsx

@ -23,6 +23,7 @@ import { useRoute } from 'vue-router'
import styles from './menu.module.scss'
import { uuid } from '@/common/common'
import { IWorkflowTaskInstance } from './types'
import { NButton } from 'naive-ui'
const props = {
startReadonly: {
@ -126,42 +127,38 @@ export default defineComponent({
class={styles['dag-context-menu']}
style={{ left: `${this.left}px`, top: `${this.top}px` }}
>
<div
class={`${styles['menu-item']} ${
this.startReadonly ? styles['disabled'] : ''
} `}
<NButton
class={`${styles['menu-item']}`}
disabled={this.startReadonly}
onClick={this.startRunning}
>
{t('project.node.start')}
</div>
<div
class={`${styles['menu-item']} ${
this.menuReadonly ? styles['disabled'] : ''
} `}
</NButton>
<NButton
class={`${styles['menu-item']}`}
disabled={this.menuReadonly}
onClick={this.handleEdit}
>
{t('project.node.edit')}
</div>
<div
class={`${styles['menu-item']} ${
this.menuReadonly ? styles['disabled'] : ''
} `}
</NButton>
<NButton
class={`${styles['menu-item']}`}
disabled={this.menuReadonly}
onClick={this.handleCopy}
>
{t('project.node.copy')}
</div>
<div
class={`${styles['menu-item']} ${
this.menuReadonly ? styles['disabled'] : ''
} `}
</NButton>
<NButton
class={`${styles['menu-item']}`}
disabled={this.menuReadonly}
onClick={this.handleDelete}
>
{t('project.node.delete')}
</div>
</NButton>
{this.taskInstance && (
<div class={`${styles['menu-item']}`} onClick={this.handleViewLog}>
<NButton class={`${styles['menu-item']}`} onClick={this.handleViewLog}>
{t('project.node.view_log')}
</div>
</NButton>
)}
</div>
)

12
dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/menu.module.scss

@ -26,18 +26,8 @@
.menu-item {
padding: 5px 10px;
border-bottom: solid 1px #f2f3f7;
cursor: pointer;
color: rgb(89, 89, 89);
font-size: 12px;
&:hover:not(.disabled) {
color: #262626;
background-color: #f5f5f5;
}
&.disabled {
cursor: not-allowed;
color: rgba(89, 89, 89, 0.4);
}
width: 100%;
}
}

Loading…
Cancel
Save