Updated WorkerDescriptorProxy
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2023-03-08 09:40:44 +01:00
parent 06333af38c
commit e7f182bbb6
9 changed files with 116 additions and 76 deletions

View File

@ -9,7 +9,7 @@
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js
const { configure } = require('quasar/wrappers');
const VueI18nPlugin = require('@intlify/unplugin-vue-i18n/vite')
const VueI18nPlugin = require('@intlify/unplugin-vue-i18n/vite');
const path = require('path');
module.exports = configure(function (/* ctx */) {
@ -140,6 +140,8 @@ module.exports = configure(function (/* ctx */) {
// Quasar plugins
plugins: ['Notify', 'Dialog'],
//all: 'auto',
//autoImportComponentCase: 'pascal',
},
// animations: 'all', // --- includes all animations

View File

@ -67,6 +67,7 @@ async function search() {
dense
standout
autofocus
hide-bottom-space
>
<template #prepend>
<q-icon name="search" />
@ -87,6 +88,24 @@ async function search() {
</q-form>
</template>
<style lang="scss">
@media screen and (max-width: $breakpoint-xs-max) {
.q-field {
width: 250px;
}
}
@media screen and (min-width: $breakpoint-xs-max) {
.q-field {
width: 400px;
}
}
.q-field {
transition: width 0.36s;
}
</style>
<style lang="scss">
.cursor-info {
cursor: help;

View File

@ -3,7 +3,6 @@ import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import { useSession } from 'src/composables/useSession';
import { useStateStore } from 'stores/useStateStore';
import TeleportSlot from 'components/ui/TeleportSlot.vue';
import Paginate from 'src/components/PaginateData.vue';
import ClaimLogFilter from './ClaimLogFilter.vue';
@ -114,7 +113,7 @@ function actionColor(action) {
</Paginate>
</q-timeline>
</div>
<TeleportSlot to="#actions-append">
<Teleport v-if="stateStore.isHeaderMounted()" to="#actions-append">
<div class="row q-gutter-x-sm">
<q-btn flat @click="stateStore.toggleRightDrawer()" round dense icon="menu">
<q-tooltip bottom anchor="bottom right">
@ -122,7 +121,7 @@ function actionColor(action) {
</q-tooltip>
</q-btn>
</div>
</TeleportSlot>
</Teleport>
<q-drawer v-model="stateStore.rightDrawer" show-if-above side="right" :width="300">
<q-scroll-area class="fit text-grey-8">
<ClaimLogFilter data-key="ClaimLogs" />

View File

@ -4,6 +4,7 @@ import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { toCurrency } from 'src/filters';
import CardDescriptor from 'components/ui/CardDescriptor.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
const $props = defineProps({
id: {
@ -30,7 +31,10 @@ const entityId = computed(() => {
{{ t('customer.card.salesPerson') }}
</q-item-label>
<q-item-label class="col q-ma-none">
{{ entity.salesPersonUser.name }}
<span class="link">
{{ entity.salesPersonUser.name }}
<WorkerDescriptorProxy :id="entity.salesPersonFk" />
</span>
</q-item-label>
</q-item>
<q-item class="row">

View File

@ -61,7 +61,7 @@ function getWorkerAvatar() {
@on-fetch="(data) => (worker = data)"
>
<template #before>
<q-img :src="getWorkerAvatar()">
<q-img :src="getWorkerAvatar()" class="photo">
<template #error>
<div
class="absolute-full bg-grey-10 text-center q-pa-md flex flex-center"
@ -130,3 +130,9 @@ function getWorkerAvatar() {
</template>
</card-descriptor>
</template>
<style lang="scss" scoped>
.photo {
height: 256px;
}
</style>

View File

@ -1,21 +0,0 @@
<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

@ -8,8 +8,9 @@ const $props = defineProps({
},
});
</script>
<template>
<q-card>
<worker-descriptor v-if="$props.id" :id="$props.id" />
</q-card>
<q-popup-proxy>
<WorkerDescriptor v-if="$props.id" :id="$props.id" />
</q-popup-proxy>
</template>

View File

@ -1,20 +1,16 @@
<script setup>
import axios from 'axios';
import { ref, onMounted, computed, onUpdated } 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';
import SkeletonSummary from 'components/ui/SkeletonSummary.vue';
import WorkerDescriptorProxy from './WorkerDescriptorProxy.vue';
onMounted(() => fetch());
onUpdated(() => fetch());
const route = useRoute();
const { t } = useI18n();
const quasar = useQuasar();
t == t;
const $props = defineProps({
id: {
@ -75,21 +71,12 @@ function sipExtension() {
if (worker.value.sip) return worker.value.sip.extension;
return '-';
}
function openDescriptorDialog(id) {
quasar.dialog({
component: workerDescriptorDialog,
componentProps: {
id,
},
});
}
</script>
<template>
<div class="summary container">
<q-card>
<skeleton-summary v-if="!worker" />
<SkeletonSummary v-if="!worker" />
<template v-if="worker">
<div class="header bg-primary q-pa-sm q-mb-md">
{{ worker.id }} - {{ worker.firstName }} {{ worker.lastName }}
@ -108,49 +95,81 @@ function openDescriptorDialog(id) {
</q-item>
<q-item>
<q-item-section>
<q-item-label caption>{{ t('worker.card.name') }} </q-item-label>
<q-item-label>{{ worker.user.nickname }}</q-item-label>
<q-item-label caption
>{{ t('worker.card.name') }}
</q-item-label>
<q-item-label>
{{ worker.user.nickname }}
</q-item-label>
</q-item-section>
</q-item>
<q-item>
<q-item-section>
<q-item-label caption>{{ t('worker.list.department') }} </q-item-label>
<q-item-label>{{ worker.department.department.name }}</q-item-label>
<q-item-label caption
>{{ t('worker.list.department') }}
</q-item-label>
<q-item-label>{{
worker.department.department.name
}}</q-item-label>
</q-item-section>
</q-item>
<q-item>
<q-item-section>
<q-item-label caption>{{ t('worker.list.email') }} </q-item-label>
<q-item-label caption
>{{ t('worker.list.email') }}
</q-item-label>
<q-item-label>{{ worker.user.email }}</q-item-label>
</q-item-section>
</q-item>
<q-item class="items-start cursor-pointer q-hoverable" v-if="worker.boss">
<q-item-section @click="openDescriptorDialog(worker.bossFk)">
<q-item-label caption>{{ t('worker.summary.boss') }} </q-item-label>
<q-item
class="items-start cursor-pointer q-hoverable"
v-if="worker.boss"
>
<q-item-section>
<q-item-label caption>
{{ t('worker.summary.boss') }}
</q-item-label>
<q-item-label>
{{ worker.boss.name }}
<span class="link">
{{ worker.boss.name }}
<WorkerDescriptorProxy :id="worker.bossFk" />
</span>
</q-item-label>
</q-item-section>
</q-item>
<q-item>
<q-item-section>
<q-item-label caption>{{ t('worker.summary.phoneExtension') }} </q-item-label>
<q-item-label caption
>{{ t('worker.summary.phoneExtension') }}
</q-item-label>
<q-item-label>
{{ worker.mobileExtension == '' ? worker.mobileExtension : '-' }}
{{
worker.mobileExtension == ''
? worker.mobileExtension
: '-'
}}
</q-item-label>
</q-item-section>
</q-item>
<q-item>
<q-item-section>
<q-item-label caption>{{ t('worker.summary.entPhone') }} </q-item-label>
<q-item-label>{{ worker.phone == '' ? worker.phone : '-' }}</q-item-label>
</q-item-section>
</q-item>
<q-item>
<q-item-section>
<q-item-label caption>{{ t('worker.summary.personalPhone') }} </q-item-label>
<q-item-label caption
>{{ t('worker.summary.entPhone') }}
</q-item-label>
<q-item-label>{{
worker.client.phone == '' ? worker.client.phone : '-'
worker.phone == '' ? worker.phone : '-'
}}</q-item-label>
</q-item-section>
</q-item>
<q-item>
<q-item-section>
<q-item-label caption
>{{ t('worker.summary.personalPhone') }}
</q-item-label>
<q-item-label>{{
worker.client.phone == ''
? worker.client.phone
: '-'
}}</q-item-label>
</q-item-section>
</q-item>
@ -163,25 +182,37 @@ function openDescriptorDialog(id) {
</q-item-label>
<q-item>
<q-item-section>
<q-item-label caption> {{ t('worker.summary.userId') }} </q-item-label>
<q-item-label caption>
{{ t('worker.summary.userId') }}
</q-item-label>
<q-item-label>{{ worker.user.id }}</q-item-label>
</q-item-section>
</q-item>
<q-item>
<q-item-section>
<q-item-label caption>{{ t('worker.card.name') }} </q-item-label>
<q-item-label>{{ worker.user.nickname }}</q-item-label>
<q-item-label caption
>{{ t('worker.card.name') }}
</q-item-label>
<q-item-label>{{
worker.user.nickname
}}</q-item-label>
</q-item-section>
</q-item>
<q-item>
<q-item-section>
<q-item-label caption>{{ t('worker.summary.role') }} </q-item-label>
<q-item-label>{{ worker.user.role.name }}</q-item-label>
<q-item-label caption
>{{ t('worker.summary.role') }}
</q-item-label>
<q-item-label>{{
worker.user.role.name
}}</q-item-label>
</q-item-section>
</q-item>
<q-item>
<q-item-section>
<q-item-label caption>{{ t('worker.summary.sipExtension') }} </q-item-label>
<q-item-label caption
>{{ t('worker.summary.sipExtension') }}
</q-item-label>
<q-item-label>{{ sipExtension() }}</q-item-label>
</q-item-section>
</q-item>

View File

@ -5,7 +5,6 @@ import { useQuasar } from 'quasar';
import { useStateStore } from 'stores/useStateStore';
import Paginate from 'src/components/PaginateData.vue';
import WorkerSummaryDialog from './Card/WorkerSummaryDialog.vue';
import TeleportSlot from 'components/ui/TeleportSlot.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import WorkerFilter from './WorkerFilter.vue';
@ -129,9 +128,9 @@ function viewSummary(id) {
icon="preview"
@click="viewSummary(row.id)"
>
<q-tooltip>{{
t('components.smartCard.openSummary')
}}</q-tooltip>
<q-tooltip>
{{ t('components.smartCard.openSummary') }}
</q-tooltip>
</q-btn>
</q-card-actions>
</q-item>