231801 test to master #56

Merged
alexm merged 56 commits from test into master 2023-05-12 06:35:16 +00:00
4 changed files with 113 additions and 114 deletions
Showing only changes of commit 554c09155f - Show all commits

View File

@ -70,7 +70,7 @@ async function saveDarkMode(value) {
} }
async function saveLanguage(value) { async function saveLanguage(value) {
const query = `/Accounts/${user.value.id}`; const query = `/VnUsers/${user.value.id}`;
await axios.patch(query, { await axios.patch(query, {
lang: value, lang: value,
}); });

View File

@ -5,7 +5,7 @@ export function useRole() {
const state = useState(); const state = useState();
async function fetch() { async function fetch() {
const { data } = await axios.get('Accounts/acl'); const { data } = await axios.get('VnUsers/acl');
const roles = data.roles.map((userRoles) => userRoles.role.name); const roles = data.roles.map((userRoles) => userRoles.role.name);
const userData = { const userData = {

View File

@ -27,6 +27,7 @@ const time = ref({
}); });
async function fetch() { async function fetch() {
try {
const filter = { const filter = {
where: { where: {
ticketFk: entityId.value, ticketFk: entityId.value,
@ -37,6 +38,9 @@ async function fetch() {
}); });
if (data) expeditions.value = data; if (data) expeditions.value = data;
} catch (e) {
//
}
} }
async function getVideoList(expeditionId, timed) { async function getVideoList(expeditionId, timed) {
@ -46,15 +50,25 @@ async function getVideoList(expeditionId, timed) {
}; };
if (timed) { if (timed) {
if (timed.max == timed.min) {
if (timed.max != 24) timed.max += 1;
else timed.min -= 1;
}
Object.assign(params, { from: timed.min, to: timed.max }); Object.assign(params, { from: timed.min, to: timed.max });
} }
const { data } = await axios.get(`/Boxings/getVideoList`, { params: params }); await axios.get(`/Boxings/getVideoList`, { params: params }).then((res) => {
const data = res.data;
if (!data.length) {
return quasar.notify({
message: t('ticket.boxing.notFound'),
type: 'negative',
});
}
const list = []; const list = [];
for (const video of data) { for (const video of data) {
const videName = video.split('.')[0].split('T')[1].replaceAll('-', ':'); const videoName = video.split('.')[0].split('T')[1].replace(/-/g, ':');
list.push({ list.push({
label: videName, label: videoName,
value: video, value: video,
url: `api/Boxings/getVideo?id=${expeditionId}&filename=${video}`, url: `api/Boxings/getVideo?id=${expeditionId}&filename=${video}`,
}); });
@ -65,21 +79,14 @@ async function getVideoList(expeditionId, timed) {
slide.value = list[0].value; slide.value = list[0].value;
time.value = { time.value = {
min: parseInt(list[0].label.split(':')[0]), min: parseInt(list[0].label.split(':')[0]),
max: parseInt(list[list.length - 1].label.split(':')[0]), max: parseInt(list[list.length - 1].label.split(':')[0]) + 1,
}; };
} }
if (!data.length) {
return quasar.notify({
message: t('ticket.boxing.notFound'),
type: 'negative',
}); });
}
} }
</script> </script>
<template> <template>
<teleport to=".q-layout">
<QDrawer show-if-above side="right"> <QDrawer show-if-above side="right">
<QScrollArea class="fit"> <QScrollArea class="fit">
<QList bordered separator style="max-width: 318px"> <QList bordered separator style="max-width: 318px">
@ -132,29 +139,21 @@ async function getVideoList(expeditionId, timed) {
<QItemLabel class="text-h6">#{{ expedition.id }}</QItemLabel> <QItemLabel class="text-h6">#{{ expedition.id }}</QItemLabel>
</QItemSection> </QItemSection>
<QItemSection> <QItemSection>
<QItemLabel caption>{{ <QItemLabel caption>{{ t('ticket.boxing.created') }}</QItemLabel>
t('ticket.boxing.created')
}}</QItemLabel>
<QItemLabel> <QItemLabel>
{{ {{
date.formatDate( date.formatDate(expedition.created, 'YYYY-MM-DD HH:mm:ss')
expedition.created,
'YYYY-MM-DD HH:mm:ss'
)
}} }}
</QItemLabel> </QItemLabel>
<QItemLabel caption>{{ t('ticket.boxing.item') }}</QItemLabel> <QItemLabel caption>{{ t('ticket.boxing.item') }}</QItemLabel>
<QItemLabel>{{ expedition.packagingItemFk }}</QItemLabel> <QItemLabel>{{ expedition.packagingItemFk }}</QItemLabel>
<QItemLabel caption>{{ <QItemLabel caption>{{ t('ticket.boxing.worker') }}</QItemLabel>
t('ticket.boxing.worker')
}}</QItemLabel>
<QItemLabel>{{ expedition.userName }}</QItemLabel> <QItemLabel>{{ expedition.userName }}</QItemLabel>
</QItemSection> </QItemSection>
</QItem> </QItem>
</QList> </QList>
</QScrollArea> </QScrollArea>
</QDrawer> </QDrawer>
</teleport>
<QCard> <QCard>
<QCarousel animated v-model="slide" height="max-content"> <QCarousel animated v-model="slide" height="max-content">

View File

@ -4,7 +4,7 @@ import TicketBoxing from 'pages/Ticket/Card/TicketBoxing.vue';
// #4836 - Investigate how to test q-drawer outside // #4836 - Investigate how to test q-drawer outside
// q-layout or how to teleport q-drawer inside // q-layout or how to teleport q-drawer inside
describe.skip('TicketBoxing', () => { describe('TicketBoxing', () => {
let vm; let vm;
beforeAll(() => { beforeAll(() => {
vm = createWrapper(TicketBoxing).vm; vm = createWrapper(TicketBoxing).vm;