From 934db329733c81741074a22cdb39ea37446350d6 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Wed, 24 Apr 2024 10:31:33 -0300 Subject: [PATCH 1/3] WIP --- src/components/CrudModel.vue | 1 + src/css/app.scss | 5 + src/pages/Item/Card/ItemTags.vue | 176 ++++++++++++++++++++++++++++++- src/router/modules/item.js | 4 +- 4 files changed, 183 insertions(+), 3 deletions(-) diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index fb3ac10c3..deec0e4fe 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -81,6 +81,7 @@ defineExpose({ hasChanges, saveChanges, getChanges, + formData, }); async function fetch(data) { diff --git a/src/css/app.scss b/src/css/app.scss index 25b484649..9037802ad 100644 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -119,6 +119,11 @@ select:-webkit-autofill { font-variation-settings: 'FILL' 1; } +.fill-icon-on-hover:hover { + font-variation-settings: 'FILL' 1; + cursor: pointer; +} + .vn-table-separation-row { height: 16px !important; background-color: var(--vn-section-color) !important; diff --git a/src/pages/Item/Card/ItemTags.vue b/src/pages/Item/Card/ItemTags.vue index 95f4380e4..bf18c682c 100644 --- a/src/pages/Item/Card/ItemTags.vue +++ b/src/pages/Item/Card/ItemTags.vue @@ -1 +1,175 @@ - + + + + + +es: + Remove tag: Quitar etiqueta + Add tag: Añadir etiqueta + Tag: Etiqueta + Value: Valor + Relevancy: Relevancia + diff --git a/src/router/modules/item.js b/src/router/modules/item.js index 70d49c56c..1b582d8e4 100644 --- a/src/router/modules/item.js +++ b/src/router/modules/item.js @@ -12,7 +12,7 @@ export default { redirect: { name: 'ItemMain' }, menus: { main: ['ItemList', 'WasteBreakdown', 'ItemTypeList'], - card: ['ItemBasicData'], + card: ['ItemBasicData', 'ItemTags'], }, children: [ { @@ -98,7 +98,7 @@ export default { path: 'tags', name: 'ItemTags', meta: { - title: 'Tags', + title: 'tags', icon: 'vn:tags', }, component: () => import('src/pages/Item/Card/ItemTags.vue'), From f3b1de1ee41777981e0bc7e6cbc654f075745693 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Fri, 3 May 2024 17:19:13 -0300 Subject: [PATCH 2/3] Item tags --- src/pages/Item/Card/ItemTags.vue | 119 +++++++++++++++---------------- src/pages/Item/locale/en.yml | 6 ++ src/pages/Item/locale/es.yml | 6 ++ 3 files changed, 69 insertions(+), 62 deletions(-) diff --git a/src/pages/Item/Card/ItemTags.vue b/src/pages/Item/Card/ItemTags.vue index 3067c9768..01df1009b 100644 --- a/src/pages/Item/Card/ItemTags.vue +++ b/src/pages/Item/Card/ItemTags.vue @@ -1,5 +1,5 @@ - - -es: - Remove tag: Quitar etiqueta - Add tag: Añadir etiqueta - Tag: Etiqueta - Value: Valor - Relevancy: Relevancia - diff --git a/src/pages/Item/locale/en.yml b/src/pages/Item/locale/en.yml index 9acd1de4d..2ffcd3661 100644 --- a/src/pages/Item/locale/en.yml +++ b/src/pages/Item/locale/en.yml @@ -34,3 +34,9 @@ lastEntries: package: Package freight: Freight comission: Comission +itemTags: + removeTag: Remove tag + addTag: Add tag + tag: Tag + value: Value + relevancy: Relevancy diff --git a/src/pages/Item/locale/es.yml b/src/pages/Item/locale/es.yml index 46e0d9eb7..3047239f2 100644 --- a/src/pages/Item/locale/es.yml +++ b/src/pages/Item/locale/es.yml @@ -34,3 +34,9 @@ lastEntries: package: Embalaje freight: Porte comission: Comisión +itemTags: + removeTag: Quitar etiqueta + addTag: Añadir etiqueta + tag: Etiqueta + value: Valor + relevancy: Relevancia From c0dd140a3ab0a22d475be5216421e50186721128 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 7 May 2024 11:38:12 +0200 Subject: [PATCH 3/3] fix: validTag --- src/components/common/VnSelect.vue | 3 ++- src/pages/Item/Card/ItemTags.vue | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index 05c74f00a..e8083dec2 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -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" diff --git a/src/pages/Item/Card/ItemTags.vue b/src/pages/Item/Card/ItemTags.vue index 01df1009b..b3cdfffb1 100644 --- a/src/pages/Item/Card/ItemTags.vue +++ b/src/pages/Item/Card/ItemTags.vue @@ -105,7 +105,7 @@ const insertTag = (rows) => { auto-load @on-fetch="onItemTagsFetched" > -