From 5cbf3a5b71fa91b6649b4b4b0ee5c2c4f0491231 Mon Sep 17 00:00:00 2001 From: JUNGEUNJUNG Date: Fri, 27 Sep 2024 14:27:40 +0900 Subject: [PATCH 1/2] Add software Catalog registration --- .../components/softwareCatalogForm.vue | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/applicationFE/src/views/softwareCatalog/components/softwareCatalogForm.vue b/applicationFE/src/views/softwareCatalog/components/softwareCatalogForm.vue index bbe2ecc..1b46b5c 100644 --- a/applicationFE/src/views/softwareCatalog/components/softwareCatalogForm.vue +++ b/applicationFE/src/views/softwareCatalog/components/softwareCatalogForm.vue @@ -96,16 +96,18 @@ import type { Repository } from '../../type/type'; import { ref } from 'vue'; import { useToast } from 'vue-toastification'; -import { createCatalog} from '@/api/softwareCatalog'; +import { createCatalog } from '@/api/softwareCatalog'; import { onMounted } from 'vue'; -import { computed } from 'vue'; -import { watch } from 'vue'; +import axios from 'axios' const toast = useToast() const catalogDto = ref({} as any); const refData = ref([] as any) const files = ref([] as any) +const splitUrl = window.location.host.split(':'); +const baseUrl = window.location.protocol + '//' + splitUrl[0] + ':18084' +// const baseUrl = "http://210.217.178.130:18084"; const emit = defineEmits(['get-list']) onMounted(async () => { @@ -127,7 +129,7 @@ const setInit = async () => { { "catalogRefIdx": null, "catalogIdx": null, - "referncetIdx": null, + "referncetIdx": 0, "referenceValue": "", "referenceDescription": "", "referenceType": "url" @@ -140,7 +142,7 @@ const addRef = () => { refData.value.push({ "catalogRefIdx": null, "catalogIdx": null, - "referncetIdx": null, + "referncetIdx": 0, "referenceValue": "", "referenceDescription": "", "referenceType": "url" @@ -160,14 +162,25 @@ const handleFileChange = (event: any) => { const createSoftwareCatalog = async () => { const formData = new FormData(); formData.append('iconFile', files.value); - formData.append('catalogDto', catalogDto.value); - const { data } = await createCatalog(formData); - if (data) + catalogDto.value.catalogRefData = refData.value; + formData.append('catalogDto', new Blob([JSON.stringify(catalogDto.value)], { + type: 'application/json' + })); + + const response = await axios.post(baseUrl + '/catalog/software/', formData, { + headers: { + 'Content-Type': 'multipart/form-data' + } + }); + + if(response.data) { toast.success('등록되었습니다.') - else - toast.error('등록 할 수 없습니다.') emit('get-list') + } else { + toast.error('등록 할 수 없습니다.') + } + } From abe89ce9ede1875bd9afb63dae31806edef3503e Mon Sep 17 00:00:00 2001 From: JUNGEUNJUNG Date: Mon, 30 Sep 2024 09:02:38 +0900 Subject: [PATCH 2/2] software catalog add update modal --- .../softwareCatalog/SoftwareCatalogList.vue | 24 ++- .../components/softwareCatalogForm.vue | 139 +++++++++++------- 2 files changed, 104 insertions(+), 59 deletions(-) diff --git a/applicationFE/src/views/softwareCatalog/SoftwareCatalogList.vue b/applicationFE/src/views/softwareCatalog/SoftwareCatalogList.vue index a8ca077..57a4100 100644 --- a/applicationFE/src/views/softwareCatalog/SoftwareCatalogList.vue +++ b/applicationFE/src/views/softwareCatalog/SoftwareCatalogList.vue @@ -11,7 +11,7 @@ @@ -190,7 +190,7 @@ - + diff --git a/applicationFE/src/views/softwareCatalog/components/softwareCatalogForm.vue b/applicationFE/src/views/softwareCatalog/components/softwareCatalogForm.vue index 1b46b5c..b02ee71 100644 --- a/applicationFE/src/views/softwareCatalog/components/softwareCatalogForm.vue +++ b/applicationFE/src/views/softwareCatalog/components/softwareCatalogForm.vue @@ -6,7 +6,7 @@ -