mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
add basic on-the-fly sub-components, to show/edit/create person/thirdparty
This commit is contained in:
parent
158b572879
commit
718d6c2375
@ -23,7 +23,7 @@
|
|||||||
// @import "bootstrap/scss/button-group";
|
// @import "bootstrap/scss/button-group";
|
||||||
// @import "bootstrap/scss/input-group";
|
// @import "bootstrap/scss/input-group";
|
||||||
// @import "bootstrap/scss/custom-forms";
|
// @import "bootstrap/scss/custom-forms";
|
||||||
// @import "bootstrap/scss/nav";
|
@import "bootstrap/scss/nav";
|
||||||
// @import "bootstrap/scss/navbar";
|
// @import "bootstrap/scss/navbar";
|
||||||
// @import "bootstrap/scss/card";
|
// @import "bootstrap/scss/card";
|
||||||
// @import "bootstrap/scss/breadcrumb";
|
// @import "bootstrap/scss/breadcrumb";
|
||||||
|
@ -15,11 +15,29 @@
|
|||||||
<template v-slot:header>
|
<template v-slot:header>
|
||||||
<h3 class="modal-title">{{ $t(titleModal) }}</h3>
|
<h3 class="modal-title">{{ $t(titleModal) }}</h3>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body>
|
|
||||||
{{ action }}
|
<template v-slot:body v-if="type === 'person'">
|
||||||
{{ type }}
|
<on-the-fly-person
|
||||||
{{ id }}
|
v-bind:id="id"
|
||||||
|
v-bind:type="type"
|
||||||
|
v-bind:action="action">
|
||||||
|
</on-the-fly-person>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template v-slot:body v-else-if="type === 'thirdparty'">
|
||||||
|
<on-the-fly-thirdparty
|
||||||
|
v-bind:id="id"
|
||||||
|
v-bind:type="type"
|
||||||
|
v-bind:action="action">
|
||||||
|
</on-the-fly-thirdparty>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-slot:body v-else>
|
||||||
|
<on-the-fly-create
|
||||||
|
v-bind:action="action">
|
||||||
|
</on-the-fly-create>
|
||||||
|
</template>
|
||||||
|
|
||||||
<template v-slot:footer>
|
<template v-slot:footer>
|
||||||
<button class="sc-button bt-save"> <!-- @click.prevent="$emit('..', ..)" -->
|
<button class="sc-button bt-save"> <!-- @click.prevent="$emit('..', ..)" -->
|
||||||
{{ $t('action.save')}}
|
{{ $t('action.save')}}
|
||||||
@ -33,11 +51,17 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Modal from 'ChillMainAssets/vuejs/_components/Modal';
|
import Modal from 'ChillMainAssets/vuejs/_components/Modal';
|
||||||
|
import OnTheFlyPerson from './OnTheFly/Person.vue';
|
||||||
|
import OnTheFlyThirdparty from './OnTheFly/ThirdParty.vue';
|
||||||
|
import OnTheFlyCreate from './OnTheFly/Create.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'OnTheFly',
|
name: 'OnTheFly',
|
||||||
components: {
|
components: {
|
||||||
Modal
|
Modal,
|
||||||
|
OnTheFlyPerson,
|
||||||
|
OnTheFlyThirdparty,
|
||||||
|
OnTheFlyCreate
|
||||||
},
|
},
|
||||||
props: ['type', 'id', 'action', 'buttonText'],
|
props: ['type', 'id', 'action', 'buttonText'],
|
||||||
data() {
|
data() {
|
||||||
|
@ -0,0 +1,73 @@
|
|||||||
|
<template>
|
||||||
|
<ul class="nav nav-tabs">
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" :class="{ active: isActive('person') }">
|
||||||
|
<label for="person">
|
||||||
|
<input type="radio" name="person" v-model="radioType" value="person">
|
||||||
|
{{ $t('onthefly.create.person') }}
|
||||||
|
</label>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" :class="{ active: isActive('thirdparty') }">
|
||||||
|
<label for="thirdparty">
|
||||||
|
<input type="radio" name="thirdparty" v-model="radioType" value="thirdparty">
|
||||||
|
{{ $t('onthefly.create.thirdparty') }}
|
||||||
|
</label>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="my-4">
|
||||||
|
<on-the-fly-person
|
||||||
|
v-if="type === 'person'"
|
||||||
|
v-bind:action="action">
|
||||||
|
</on-the-fly-person>
|
||||||
|
|
||||||
|
<on-the-fly-thirdparty
|
||||||
|
v-if="type === 'thirdparty'"
|
||||||
|
v-bind:action="action">
|
||||||
|
</on-the-fly-thirdparty>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import OnTheFlyPerson from './Person.vue';
|
||||||
|
import OnTheFlyThirdparty from './ThirdParty.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "OnTheFlyCreate",
|
||||||
|
props: ['action'],
|
||||||
|
components: {
|
||||||
|
OnTheFlyPerson,
|
||||||
|
OnTheFlyThirdparty
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
type: 'person'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
radioType: {
|
||||||
|
set(type) {
|
||||||
|
this.type = type;
|
||||||
|
},
|
||||||
|
get() {
|
||||||
|
return this.type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
isActive(tab) {
|
||||||
|
return (this.type === tab) ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="css" scoped>
|
||||||
|
label {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,22 @@
|
|||||||
|
<template>
|
||||||
|
<div v-if="action === 'show'">
|
||||||
|
show
|
||||||
|
person
|
||||||
|
{{ id }}
|
||||||
|
</div>
|
||||||
|
<div v-else-if="action === 'edit' || action === 'create'">
|
||||||
|
{{ action }}
|
||||||
|
person
|
||||||
|
{{ id }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "OnTheFlyPerson",
|
||||||
|
props: ['id', 'type', 'action']
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="css" scoped>
|
||||||
|
</style>
|
@ -0,0 +1,22 @@
|
|||||||
|
<template>
|
||||||
|
<div v-if="action === 'show'">
|
||||||
|
show
|
||||||
|
thirdparty
|
||||||
|
{{ id }}
|
||||||
|
</div>
|
||||||
|
<div v-else-if="action === 'edit' || action === 'create'">
|
||||||
|
{{ action }}
|
||||||
|
thirdparty
|
||||||
|
{{ id }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "OnTheFlyThirdParty",
|
||||||
|
props: ['id', 'type', 'action']
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="css" scoped>
|
||||||
|
</style>
|
@ -58,7 +58,9 @@ const messages = {
|
|||||||
},
|
},
|
||||||
create: {
|
create: {
|
||||||
button: "Créer \"{q}\"",
|
button: "Créer \"{q}\"",
|
||||||
title: "Saisir une nouvelle personne à la volée",
|
title: "Saisir à la volée…",
|
||||||
|
person: "un nouvel usager",
|
||||||
|
thirdparty: "un nouveau tiers"
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ const appMessages = {
|
|||||||
comment: {
|
comment: {
|
||||||
title: "Observations",
|
title: "Observations",
|
||||||
label: "Ajout d'une note",
|
label: "Ajout d'une note",
|
||||||
content: "Rédigez une première note...",
|
content: "Rédigez une première note…",
|
||||||
created_by: "créé par {0}, le {1}"
|
created_by: "créé par {0}, le {1}"
|
||||||
},
|
},
|
||||||
confirm: {
|
confirm: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user