-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(fe): run task from template page
- Loading branch information
Showing
3 changed files
with
108 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<template> | ||
<EditDialog | ||
v-model="dialog" | ||
:save-button-text="TEMPLATE_TYPE_ACTION_TITLES[templateType]" | ||
title="New Task" | ||
@save="close" | ||
@close="close" | ||
> | ||
<template v-slot:title={}> | ||
<v-icon small class="mr-4">{{ TEMPLATE_TYPE_ICONS[templateType] }}</v-icon> | ||
<span class="breadcrumbs__item">{{ templateAlias }}</span> | ||
<v-icon>mdi-chevron-right</v-icon> | ||
<span class="breadcrumbs__item">New Task</span> | ||
</template> | ||
|
||
<template v-slot:form="{ onSave, onError, needSave, needReset }"> | ||
<TaskForm | ||
:project-id="projectId" | ||
item-id="new" | ||
:template-id="templateId" | ||
@save="onSave" | ||
@error="onError" | ||
:need-save="needSave" | ||
:need-reset="needReset" | ||
/> | ||
</template> | ||
</EditDialog> | ||
</template> | ||
<script> | ||
import TaskForm from './TaskForm.vue'; | ||
import EditDialog from './EditDialog.vue'; | ||
import { TEMPLATE_TYPE_ACTION_TITLES, TEMPLATE_TYPE_ICONS } from '../lib/constants'; | ||
import EventBus from '../event-bus'; | ||
export default { | ||
components: { | ||
TaskForm, | ||
EditDialog, | ||
}, | ||
props: { | ||
value: Boolean, | ||
projectId: Number, | ||
templateId: Number, | ||
templateType: String, | ||
templateAlias: String, | ||
}, | ||
data() { | ||
return { | ||
dialog: false, | ||
TEMPLATE_TYPE_ACTION_TITLES, | ||
TEMPLATE_TYPE_ICONS, | ||
}; | ||
}, | ||
watch: { | ||
async dialog(val) { | ||
this.$emit('input', val); | ||
}, | ||
async value(val) { | ||
this.dialog = val; | ||
}, | ||
close(e) { | ||
this.dialog = false; | ||
if (e) { | ||
EventBus.$emit('i-show-task', { | ||
taskId: e.item.id, | ||
}); | ||
this.$emit('save', e); | ||
} | ||
this.$emit('close'); | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters