Merge branch 'dev' into 6363_lilium_darkMode_login
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Javier Segarra 2023-12-22 11:25:07 +00:00
commit e6f4bea466
1 changed files with 17 additions and 11 deletions

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { onMounted, ref, computed } from 'vue'; import { onMounted, ref, computed, watch } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { toDate, toCurrency } from 'src/filters'; import { toDate, toCurrency } from 'src/filters';
@ -26,12 +26,26 @@ const entityId = computed(() => $props.id || route.params.id);
const claimUrl = ref(); const claimUrl = ref();
const salixUrl = ref(); const salixUrl = ref();
const claimDmsRef = ref();
const claimDmsFilter = ref({
include: [
{
relation: 'dms',
},
],
where: { claimFk: entityId.value },
});
onMounted(async () => { onMounted(async () => {
salixUrl.value = await getUrl(''); salixUrl.value = await getUrl('');
claimUrl.value = salixUrl.value + `claim/${entityId.value}/`; claimUrl.value = salixUrl.value + `claim/${entityId.value}/`;
}); });
watch(entityId, async (id) => {
claimDmsFilter.value.where = { claimFk: id };
await claimDmsRef.value.fetch();
});
const detailsColumns = ref([ const detailsColumns = ref([
{ {
name: 'item', name: 'item',
@ -131,18 +145,9 @@ const developmentColumns = ref([
const claimDms = ref([]); const claimDms = ref([]);
const multimediaDialog = ref(); const multimediaDialog = ref();
const multimediaSlide = ref(); const multimediaSlide = ref();
const claimDmsFilter = ref({
include: [
{
relation: 'dms',
},
],
where: { claimFk: entityId.value },
});
function setClaimDms(data) { function setClaimDms(data) {
if (!data) return; claimDms.value = [];
data.forEach((media) => { data.forEach((media) => {
claimDms.value.push({ claimDms.value.push({
isVideo: media.dms.contentType == 'video/mp4', isVideo: media.dms.contentType == 'video/mp4',
@ -165,6 +170,7 @@ function openDialog(dmsId) {
@on-fetch="(data) => setClaimDms(data)" @on-fetch="(data) => setClaimDms(data)"
limit="20" limit="20"
auto-load auto-load
ref="claimDmsRef"
/> />
<CardSummary ref="summary" :url="`Claims/${entityId}/getSummary`"> <CardSummary ref="summary" :url="`Claims/${entityId}/getSummary`">
<template #header="{ entity: { claim } }"> <template #header="{ entity: { claim } }">