|
|
@ -17,28 +17,30 @@ |
|
|
|
|
|
|
|
|
|
|
|
import { genTaskCodeList } from '@/service/modules/task-definition' |
|
|
|
import { genTaskCodeList } from '@/service/modules/task-definition' |
|
|
|
import type { Cell } from '@antv/x6' |
|
|
|
import type { Cell } from '@antv/x6' |
|
|
|
import { |
|
|
|
import { defineComponent, onMounted, PropType, inject, ref } from 'vue' |
|
|
|
defineComponent, |
|
|
|
|
|
|
|
onMounted, |
|
|
|
|
|
|
|
PropType, |
|
|
|
|
|
|
|
inject, |
|
|
|
|
|
|
|
ref, |
|
|
|
|
|
|
|
computed |
|
|
|
|
|
|
|
} from 'vue' |
|
|
|
|
|
|
|
import { useI18n } from 'vue-i18n' |
|
|
|
import { useI18n } from 'vue-i18n' |
|
|
|
import { useRoute } from 'vue-router' |
|
|
|
import { useRoute } from 'vue-router' |
|
|
|
import styles from './menu.module.scss' |
|
|
|
import styles from './menu.module.scss' |
|
|
|
import { uuid } from '@/utils/common' |
|
|
|
import { uuid } from '@/utils/common' |
|
|
|
|
|
|
|
import { IWorkflowTaskInstance } from './types' |
|
|
|
|
|
|
|
|
|
|
|
const props = { |
|
|
|
const props = { |
|
|
|
|
|
|
|
startReadonly: { |
|
|
|
|
|
|
|
type: Boolean as PropType<boolean>, |
|
|
|
|
|
|
|
default: false |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
menuReadonly: { |
|
|
|
|
|
|
|
type: Boolean as PropType<boolean>, |
|
|
|
|
|
|
|
default: false |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
taskInstance: { |
|
|
|
|
|
|
|
type: Object as PropType<IWorkflowTaskInstance>, |
|
|
|
|
|
|
|
require: true |
|
|
|
|
|
|
|
}, |
|
|
|
cell: { |
|
|
|
cell: { |
|
|
|
type: Object as PropType<Cell>, |
|
|
|
type: Object as PropType<Cell>, |
|
|
|
require: true |
|
|
|
require: true |
|
|
|
}, |
|
|
|
}, |
|
|
|
taskList: { |
|
|
|
|
|
|
|
type: Array as PropType<Array<any>>, |
|
|
|
|
|
|
|
default: [] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
visible: { |
|
|
|
visible: { |
|
|
|
type: Boolean as PropType<boolean>, |
|
|
|
type: Boolean as PropType<boolean>, |
|
|
|
default: true |
|
|
|
default: true |
|
|
@ -50,10 +52,6 @@ const props = { |
|
|
|
top: { |
|
|
|
top: { |
|
|
|
type: Number as PropType<number>, |
|
|
|
type: Number as PropType<number>, |
|
|
|
default: 0 |
|
|
|
default: 0 |
|
|
|
}, |
|
|
|
|
|
|
|
releaseState: { |
|
|
|
|
|
|
|
type: String as PropType<string>, |
|
|
|
|
|
|
|
default: 'OFFLINE' |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -66,12 +64,6 @@ export default defineComponent({ |
|
|
|
const route = useRoute() |
|
|
|
const route = useRoute() |
|
|
|
const projectCode = Number(route.params.projectCode) |
|
|
|
const projectCode = Number(route.params.projectCode) |
|
|
|
|
|
|
|
|
|
|
|
const startAvailable = computed( |
|
|
|
|
|
|
|
() => |
|
|
|
|
|
|
|
route.name === 'workflow-definition-detail' && |
|
|
|
|
|
|
|
props.releaseState !== 'NOT_RELEASE' |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const hide = () => { |
|
|
|
const hide = () => { |
|
|
|
ctx.emit('hide', false) |
|
|
|
ctx.emit('hide', false) |
|
|
|
} |
|
|
|
} |
|
|
@ -85,12 +77,8 @@ export default defineComponent({ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const handleViewLog = () => { |
|
|
|
const handleViewLog = () => { |
|
|
|
const taskCode = Number(props.cell?.id) |
|
|
|
if (props.taskInstance) { |
|
|
|
const taskInstance = props.taskList.find( |
|
|
|
ctx.emit('viewLog', props.taskInstance.id, props.taskInstance.taskType) |
|
|
|
(task: any) => task.taskCode === taskCode |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
if (taskInstance) { |
|
|
|
|
|
|
|
ctx.emit('viewLog', taskInstance.id, taskInstance.taskType) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -122,7 +110,6 @@ export default defineComponent({ |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
startAvailable, |
|
|
|
|
|
|
|
startRunning, |
|
|
|
startRunning, |
|
|
|
handleEdit, |
|
|
|
handleEdit, |
|
|
|
handleCopy, |
|
|
|
handleCopy, |
|
|
@ -141,7 +128,7 @@ export default defineComponent({ |
|
|
|
> |
|
|
|
> |
|
|
|
<div |
|
|
|
<div |
|
|
|
class={`${styles['menu-item']} ${ |
|
|
|
class={`${styles['menu-item']} ${ |
|
|
|
!this.startAvailable ? styles['disabled'] : '' |
|
|
|
this.startReadonly ? styles['disabled'] : '' |
|
|
|
} `}
|
|
|
|
} `}
|
|
|
|
onClick={this.startRunning} |
|
|
|
onClick={this.startRunning} |
|
|
|
> |
|
|
|
> |
|
|
@ -149,7 +136,7 @@ export default defineComponent({ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div |
|
|
|
<div |
|
|
|
class={`${styles['menu-item']} ${ |
|
|
|
class={`${styles['menu-item']} ${ |
|
|
|
this.releaseState === 'ONLINE' ? styles['disabled'] : '' |
|
|
|
this.menuReadonly ? styles['disabled'] : '' |
|
|
|
} `}
|
|
|
|
} `}
|
|
|
|
onClick={this.handleEdit} |
|
|
|
onClick={this.handleEdit} |
|
|
|
> |
|
|
|
> |
|
|
@ -157,7 +144,7 @@ export default defineComponent({ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div |
|
|
|
<div |
|
|
|
class={`${styles['menu-item']} ${ |
|
|
|
class={`${styles['menu-item']} ${ |
|
|
|
this.releaseState === 'ONLINE' ? styles['disabled'] : '' |
|
|
|
this.menuReadonly ? styles['disabled'] : '' |
|
|
|
} `}
|
|
|
|
} `}
|
|
|
|
onClick={this.handleCopy} |
|
|
|
onClick={this.handleCopy} |
|
|
|
> |
|
|
|
> |
|
|
@ -165,13 +152,13 @@ export default defineComponent({ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div |
|
|
|
<div |
|
|
|
class={`${styles['menu-item']} ${ |
|
|
|
class={`${styles['menu-item']} ${ |
|
|
|
this.releaseState === 'ONLINE' ? styles['disabled'] : '' |
|
|
|
this.menuReadonly ? styles['disabled'] : '' |
|
|
|
} `}
|
|
|
|
} `}
|
|
|
|
onClick={this.handleDelete} |
|
|
|
onClick={this.handleDelete} |
|
|
|
> |
|
|
|
> |
|
|
|
{t('project.node.delete')} |
|
|
|
{t('project.node.delete')} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{this.taskList.length > 0 && ( |
|
|
|
{this.taskInstance && ( |
|
|
|
<div class={`${styles['menu-item']}`} onClick={this.handleViewLog}> |
|
|
|
<div class={`${styles['menu-item']}`} onClick={this.handleViewLog}> |
|
|
|
{t('project.node.view_log')} |
|
|
|
{t('project.node.view_log')} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|