refs #4834 @1h add workerDescriptorPopover
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Pau 2022-11-23 07:50:35 +01:00
parent cd5bd180af
commit 0084b354d6
2 changed files with 39 additions and 12 deletions

View File

@ -0,0 +1,21 @@
<script setup>
import { useDialogPluginComponent } from 'quasar';
import workerDescriptor from './WorkerDescriptor.vue';
const $props = defineProps({
id: {
type: Number,
required: true,
},
});
defineEmits([...useDialogPluginComponent.emits]);
const { dialogRef, onDialogHide } = useDialogPluginComponent();
</script>
<template>
<q-dialog ref="dialogRef" @hide="onDialogHide">
<worker-descriptor v-if="$props.id" :id="$props.id" />
</q-dialog>
</template>

View File

@ -2,12 +2,15 @@
import { ref, onMounted, computed } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar';
import axios from 'axios';
import workerDescriptorDialog from './WorkerDescriptorDialog.vue';
onMounted(() => fetch());
const route = useRoute();
const { t } = useI18n();
const quasar = useQuasar();
t == t;
@ -70,6 +73,15 @@ function sipExtension() {
if (worker.value.sip) return worker.value.sip.extension;
return '-';
}
function openDescriptorDialog(id) {
quasar.dialog({
component: workerDescriptorDialog,
componentProps: {
id,
},
});
}
</script>
<template>
@ -120,22 +132,16 @@ function sipExtension() {
<q-item-label>{{ worker.user.email }}</q-item-label>
</q-item-section>
</q-item>
<q-item>
<q-item-section side>
<q-item class="items-start cursor-pointer q-hoverable" v-if="worker.boss">
<q-item-section side @click="openDescriptorDialog(worker.bossFk)">
<q-icon name="person" />
</q-item-section>
<q-item-section>
<q-item-section @click="openDescriptorDialog(worker.bossFk)">
<q-item-label caption>{{ t('worker.summary.boss') }} </q-item-label>
<q-item-label>
<router-link
v-if="worker.boss"
:to="{ name: 'WorkerSummary', params: { id: worker.boss.id } }"
target="_blank"
>
{{ worker.boss.name == '' ? t('worker.summary.noBoss') : worker.boss.name }}
<q-icon name="open_in_new" />
</router-link>
<a>
{{ worker.boss.name }}
</a>
</q-item-label>
</q-item-section>
</q-item>