add InterlocutorItem subcomponent

This commit is contained in:
Mathieu Jaumotte 2021-05-11 13:49:43 +02:00
parent ed17f78da5
commit 569679238c
3 changed files with 70 additions and 5 deletions

View File

@ -0,0 +1,54 @@
<template>
<tr>
<td>{{ interlocutor.key }}</td>
<td>{{ interlocutor.result.text }}</td>
<td><span >
</span>
</td>
<td><span >
</span>
</td>
<td>
<ul class="record_actions">
<li>
<a class="sc-button bt-show" target="_blank"
:href="url.show"
:title="$t('action.show')">
</a>
</li>
<li>
<a class="sc-button bt-update" target="_blank"
:href="url.edit"
:title="$t('action.edit')">
</a>
</li>
<li>
<button
class="sc-button bt-remove"
:title="$t('action.remove')"
@click.prevent="$emit('remove', interlocutor)">
</button>
</li>
</ul>
</td>
</tr>
</template>
<script>
export default {
name: 'InterlocutorItem',
props: ['interlocutor'],
data() {
return {
url: {
show: 'show', //'/fr/person/' + this.interlocutor.person.id + '/general',
edit: 'edit' //'/fr/person/' + this.interlocutor.person.id + '/general/edit'
}
}
},
emits: ['remove']
}
</script>

View File

@ -9,22 +9,24 @@
<tr>
<th class="chill-orange">{{ $t('interlocutors.firstname') }}</th>
<th class="chill-orange">{{ $t('interlocutors.lastname') }}</th>
<th>3</th>
<th>4</th>
<th class="chill-orange">{{ $t('action.actions') }}</th>
</tr>
</thead>
<tbody>
<!--person-item
<interlocutor-item
v-for="interlocutor in interlocutors"
v-bind:interlocutor="interlocutor"
v-bind:key="interlocutor.id"
@remove="removeInterlocutor"
</person-item-->
@remove="removeInterlocutor">
</interlocutor-item>
</tbody>
</table>
<add-persons
buttonTitle="interlocutor.add_interlocutor"
modalTitle="interlocutor.add_interlocutor"
buttonTitle="interlocutors.add_interlocutors"
modalTitle="interlocutors.add_interlocutors"
v-bind:key="addPersons.key"
v-bind:options="addPersons.options"
@addNewPersons="addNewPersons"
@ -36,11 +38,13 @@
<script>
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue'
import InterlocutorItem from './InterlocutorItem.vue'
export default {
name: 'Interlocutors',
components: {
AddPersons,
InterlocutorItem
},
data() {
return {

View File

@ -46,6 +46,13 @@ const appMessages = {
address: "Adresse",
location: "Localité",
},
interlocutors: {
title: "Interlocuteurs privilégiés",
counter: "Pas d'interlocuteur | 1 interlocuteur | {count} interlocuteurs",
firstname: "Prénom",
lastname: "Nom",
add_interlocutors: "Ajouter des interlocuteurs",
}
}
};