mirror of https://github.com/certd/certd
refactor: delete task
parent
560519894c
commit
b9d5d33aaa
|
@ -1,6 +1,5 @@
|
|||
<template>
|
||||
<a-drawer
|
||||
title="编辑任务"
|
||||
placement="right"
|
||||
:closable="true"
|
||||
width="600px"
|
||||
|
@ -8,6 +7,12 @@
|
|||
:after-visible-change="taskDrawerOnAfterVisibleChange"
|
||||
>
|
||||
|
||||
<template #title>
|
||||
编辑任务
|
||||
<a-button @click="taskDelete()">
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
</a-button>
|
||||
</template>
|
||||
<template v-if="currentTask">
|
||||
<d-container v-if="currentTask._isAdd" class="task-edit-form">
|
||||
<a-row :gutter="10">
|
||||
|
@ -169,6 +174,13 @@ function useTaskForm (context) {
|
|||
taskDrawerClose()
|
||||
}
|
||||
|
||||
const taskDelete = () => {
|
||||
if (currentTaskIndex.value != null) {
|
||||
currentDeploy.value.tasks.splice(currentTaskIndex.value)
|
||||
}
|
||||
taskDrawerClose()
|
||||
}
|
||||
|
||||
return {
|
||||
taskTypeSelected,
|
||||
taskTypeSave,
|
||||
|
@ -183,6 +195,7 @@ function useTaskForm (context) {
|
|||
currentTaskIndex,
|
||||
currentPlugin,
|
||||
taskSave,
|
||||
taskDelete,
|
||||
rules
|
||||
}
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@
|
|||
|
||||
</template>
|
||||
<template #extra>
|
||||
<a-button type="danger">
|
||||
<a-button type="danger" @click="deployDelete(deploy,index)">
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
</a-button>
|
||||
</template>
|
||||
|
@ -203,8 +203,13 @@ function useDeploy (options) {
|
|||
const deployOpenEditMode = (deploy) => {
|
||||
deploy._isEdit = true
|
||||
}
|
||||
|
||||
const deployDelete = (deploy, index) => {
|
||||
options.deploy.splice(index, 1)
|
||||
}
|
||||
|
||||
return {
|
||||
deployAdd, deployCloseEditMode, deployOpenEditMode
|
||||
deployAdd, deployCloseEditMode, deployOpenEditMode, deployDelete
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue