mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
add new OnTheFly vue sub-component
This commit is contained in:
parent
543f6b20dd
commit
68059a9938
@ -0,0 +1,85 @@
|
|||||||
|
<template>
|
||||||
|
|
||||||
|
<a class="sc-button" target="_blank"
|
||||||
|
:class="classAction"
|
||||||
|
:title="$t(titleAction)"
|
||||||
|
@click="openModal">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<teleport to="body">
|
||||||
|
<modal v-if="modal.showModal"
|
||||||
|
:modalDialogClass="modal.modalDialogClass"
|
||||||
|
@close="modal.showModal = false">
|
||||||
|
|
||||||
|
<template v-slot:header>
|
||||||
|
<h3 class="modal-title">{{ $t(modalTitle) }}</h3>
|
||||||
|
</template>
|
||||||
|
<template v-slot:body>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
<template v-slot:footer>
|
||||||
|
<button class="sc-button bt-save"> <!-- @click.prevent="$emit('..', ..)" -->
|
||||||
|
{{ $t('action.save')}}
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</modal>
|
||||||
|
</teleport>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Modal from 'ChillMainAssets/vuejs/_components/Modal';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'OnTheFly',
|
||||||
|
components: {
|
||||||
|
Modal
|
||||||
|
},
|
||||||
|
props: ['type', 'id', 'action'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
modal: {
|
||||||
|
showModal: false,
|
||||||
|
modalDialogClass: "modal-dialog-scrollable modal-xl"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
classAction() {
|
||||||
|
switch (this.action) {
|
||||||
|
case 'show':
|
||||||
|
return 'bt-show';
|
||||||
|
case 'create':
|
||||||
|
return 'bt-create';
|
||||||
|
case 'edit':
|
||||||
|
return 'bt-update';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
titleAction() {
|
||||||
|
switch (this.action) {
|
||||||
|
case 'show':
|
||||||
|
return 'action.show';
|
||||||
|
case 'create':
|
||||||
|
return 'action.create';
|
||||||
|
case 'edit':
|
||||||
|
return 'action.edit';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
openModal() {
|
||||||
|
this.modal.showModal = true;
|
||||||
|
this.$nextTick(function() {
|
||||||
|
//this.$refs.search.focus();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="css" scoped>
|
||||||
|
a {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
</style>
|
@ -13,16 +13,18 @@
|
|||||||
<td>
|
<td>
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li>
|
<li>
|
||||||
<a class="sc-button bt-show" target="_blank"
|
<on-the-fly
|
||||||
:href="url.show"
|
:type="participation.person.type"
|
||||||
:title="$t('action.show')">
|
:id="participation.person.id"
|
||||||
</a>
|
action="show">
|
||||||
|
</on-the-fly>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a class="sc-button bt-update" target="_blank"
|
<on-the-fly
|
||||||
:href="url.edit"
|
:type="participation.person.type"
|
||||||
:title="$t('action.edit')">
|
:id="participation.person.id"
|
||||||
</a>
|
action="edit">
|
||||||
|
</on-the-fly>
|
||||||
</li>
|
</li>
|
||||||
<!--li>
|
<!--li>
|
||||||
<button class="sc-button bt-delete"
|
<button class="sc-button bt-delete"
|
||||||
@ -44,8 +46,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import OnTheFly from 'ChillMainAssets/vuejs/_components/OnTheFly.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'PersonItem',
|
name: 'PersonItem',
|
||||||
|
components: {
|
||||||
|
OnTheFly
|
||||||
|
},
|
||||||
props: ['participation'],
|
props: ['participation'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user