Item tags #350

Merged
alexm merged 6 commits from :feature/ItemTags into dev 2024-05-08 08:03:56 +00:00
2 changed files with 10 additions and 2 deletions
Showing only changes of commit c0dd140a3a - Show all commits

View File

@ -57,7 +57,7 @@ const $props = defineProps({
});
const { t } = useI18n();
const requiredFieldRule = (val) => !!val || t('globals.fieldRequired');
const requiredFieldRule = (val) => val ?? t('globals.fieldRequired');
const { optionLabel, optionValue, options, modelValue } = toRefs($props);
const myOptions = ref([]);
@ -167,6 +167,7 @@ watch(modelValue, (newValue) => {
hide-selected
fill-input
ref="vnSelectRef"
lazy-rules
:class="{ required: $attrs.required }"
:rules="$attrs.required ? [requiredFieldRule] : null"
virtual-scroll-slice-size="options.length"

View File

@ -105,7 +105,7 @@ const insertTag = (rows) => {
auto-load
@on-fetch="onItemTagsFetched"
>
<template #body="{ rows }">
<template #body="{ rows, validate }">
<QCard class="q-pl-lg q-py-md">
Review

Falta mostrar que los campos son requeridos antes de darle a guardar

Falta mostrar que los campos son requeridos antes de darle a guardar
<VnRow
v-for="(row, index) in rows"
@ -121,6 +121,8 @@ const insertTag = (rows) => {
@update:model-value="
($event) => handleTagSelected(rows, index, $event)
"
:required="true"
:rules="validate('itemTag.tagFk')"
/>
<VnSelect
v-if="row.tag?.isFree === false"
@ -134,6 +136,8 @@ const insertTag = (rows) => {
use-input
class="col"
:is-clearable="false"
:required="false"
:rules="validate('itemTag.tagFk')"
/>
<VnInput
v-else-if="
@ -148,6 +152,8 @@ const insertTag = (rows) => {
:label="t('itemTags.relevancy')"
type="number"
v-model="row.priority"
:required="true"
:rules="validate('itemTag.priority')"
/>
<div class="col-1 row justify-center items-center">
<QIcon
@ -167,6 +173,7 @@ const insertTag = (rows) => {
<QIcon
@click="insertTag(rows)"
class="cursor-pointer"
:disable="!validRow"
color="primary"
name="add"
size="sm"