From 43154084529399c6e0c21132fbfb97213396dbd6 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 13 Feb 2024 15:01:24 +0100 Subject: [PATCH] refs #5509 feat: VnDms description --- src/components/common/VnDms.vue | 26 +++-- src/components/common/VnDmsList.vue | 99 +++++++++++-------- src/pages/Entry/Card/EntryDms.vue | 9 -- .../integration/entry/entryDms.spec.js | 13 +++ 4 files changed, 88 insertions(+), 59 deletions(-) create mode 100644 test/cypress/integration/entry/entryDms.spec.js diff --git a/src/components/common/VnDms.vue b/src/components/common/VnDms.vue index 6cdca22c5..99056556d 100644 --- a/src/components/common/VnDms.vue +++ b/src/components/common/VnDms.vue @@ -27,19 +27,20 @@ const $props = defineProps({ type: Object, default: null, }, - description: { - type: Function, - default: null, - }, }); const warehouses = ref(); const companies = ref(); const dmsTypes = ref(); const allowedContentTypes = ref(); +const inputFileRef = ref(); const dms = ref({}); -onMounted(() => defaultData()); +onMounted(() => { + defaultData(); + if (!$props.formInitialData) + dms.value.description = t($props.model + 'Description', dms.value); +}); function onFileChange(files) { dms.value.hasFileAttached = !!files; dms.value.file = files?.name; @@ -78,7 +79,6 @@ function defaultData() { if ($props.formInitialData) return (dms.value = $props.formInitialData); return addDefaultData({ reference: route.params.id, - description: $props.description && $props.description(dms.value), }); } @@ -151,6 +151,7 @@ function addDefaultData(data) { type="textarea" /> -