fix(VnNotes) refs #7226 use v-bind
gitea/salix-front/pipeline/head This commit looks good Details
gitea/salix-front/pipeline/pr-master This commit looks good Details

This commit is contained in:
Alex Moreno 2024-04-18 10:13:36 +02:00
parent 84dfd6d474
commit 69850d65e7
1 changed files with 79 additions and 85 deletions

View File

@ -27,93 +27,87 @@ async function insert() {
} }
</script> </script>
<template> <template>
<div class="column items-center full-height full-width"> <VnPaginate
<VnPaginate :data-key="$props.url"
:data-key="$props.url" :url="$props.url"
:url="$props.url" order="created DESC"
order="created DESC" :limit="20"
:limit="20" :filter="$props.filter"
:filter="$props.filter" auto-load
auto-load ref="vnPaginateRef"
ref="vnPaginateRef" v-bind="$attrs"
> >
<template #body="{ rows }"> <template #body="{ rows }">
<div class="column items-center full-width"> <div class="column items-center full-width">
<QCard <QCard
class="q-pa-xs q-mb-sm full-width" class="q-pa-xs q-mb-sm full-width"
v-for="(note, index) in rows" v-for="(note, index) in rows"
:key="index" :key="index"
> >
<QCardSection horizontal> <QCardSection horizontal>
<slot name="picture"> <slot name="picture">
<VnAvatar <VnAvatar
:descriptor="false" :descriptor="false"
:worker-id="note.workerFk" :worker-id="note.workerFk"
size="md" size="md"
/> />
</slot> </slot>
<div class="full-width row justify-between q-pa-xs"> <div class="full-width row justify-between q-pa-xs">
<VnUserLink <VnUserLink
:name="`${note.worker.user.nickname}`" :name="`${note.worker.user.nickname}`"
:worker-id="note.worker.id" :worker-id="note.worker.id"
/> />
<slot name="actions"> <slot name="actions">
{{ toDateHour(note.created) }} {{ toDateHour(note.created) }}
</slot>
</div>
</QCardSection>
<QCardSection class="q-pa-xs q-my-none q-py-none">
<slot name="text">
{{ note.text }}
</slot> </slot>
</QCardSection> </div>
</QCard> </QCardSection>
</div> <QCardSection class="q-pa-xs q-my-none q-py-none">
</template> <slot name="text">
</VnPaginate> {{ note.text }}
<QPageSticky position="bottom-right" :offset="[25, 25]" v-if="addNote"> </slot>
<QBtn color="primary" icon="add" size="lg" round @click="noteModal = true" /> </QCardSection>
</QPageSticky> </QCard>
<QDialog v-model="noteModal" @hide="newNote = ''"> </div>
<QCard> </template>
<QCardSection> </VnPaginate>
<QItem class="q-px-none"> <QPageSticky position="bottom-right" :offset="[25, 25]" v-if="addNote">
<span class="text-primary text-h6 full-width"> <QBtn color="primary" icon="add" size="lg" round @click="noteModal = true" />
<QIcon name="draft" class="q-mr-xs" /> </QPageSticky>
{{ t('Add note') }} <QDialog v-model="noteModal" @hide="newNote = ''">
</span> <QCard>
<QBtn icon="close" flat round dense v-close-popup /> <QCardSection>
</QItem> <QItem class="q-px-none">
</QCardSection> <span class="text-primary text-h6 full-width">
<QCardSection> <QIcon name="draft" class="q-mr-xs" />
<QInput {{ t('Add note') }}
autofocus </span>
type="textarea" <QBtn icon="close" flat round dense v-close-popup />
:label="t('Add note here...')" </QItem>
filled </QCardSection>
size="lg" <QCardSection>
autogrow <QInput
v-model="newNote" autofocus
></QInput> type="textarea"
</QCardSection> :label="t('Add note here...')"
<QCardActions class="justify-end q-mr-sm"> filled
<QBtn size="lg"
flat autogrow
:label="t('globals.close')" v-model="newNote"
color="primary" ></QInput>
v-close-popup </QCardSection>
/> <QCardActions class="justify-end q-mr-sm">
<QBtn <QBtn flat :label="t('globals.close')" color="primary" v-close-popup />
:label="t('globals.save')" <QBtn
color="primary" :label="t('globals.save')"
v-close-popup color="primary"
@click="insert" v-close-popup
/> @click="insert"
</QCardActions> />
</QCard> </QCardActions>
</QDialog> </QCard>
</div> </QDialog>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.q-card { .q-card {