
--- client/resources/api/main.js
+++ client/resources/api/main.js
... | ... | @@ -14,3 +14,10 @@ |
14 | 14 |
export const updateStatsByMenuId = (menuId) => { |
15 | 15 |
return apiClient.put(`/stats/${menuId}/updateStatsByMenuId.json`); |
16 | 16 |
} |
17 |
+ |
|
18 |
+export const excelDownloadAll = (searchReqDTO) => { |
|
19 |
+ return apiClient.get(`/excel/excelDownloadAll.json`, { |
|
20 |
+ params: searchReqDTO, |
|
21 |
+ responseType: 'blob' // 엑셀 파일을 Blob 형태로 받기 위해 설정 |
|
22 |
+ }); |
|
23 |
+} |
--- client/views/pages/bbsDcryPhoto/PicHistorySearch.vue
+++ client/views/pages/bbsDcryPhoto/PicHistorySearch.vue
... | ... | @@ -23,9 +23,14 @@ |
23 | 23 |
<p>총 <b>{{ searchReqDTO.totalRecordCount }}개</b>의 사진 기록물이 검색되었습니다. </p> |
24 | 24 |
</div> |
25 | 25 |
<div class="flex"> |
26 |
+ <div v-if="searchResult.length > 0"> |
|
27 |
+ <button type="button" @click="fnDownload">다운로드</button> |
|
28 |
+ </div> |
|
26 | 29 |
<ul class="tab-box mb-20"> |
27 |
- <li v-for="(tab, idx) in tabs" :key="idx" class="tab-title" :class="{ active: selectedTabId === tab.id }" @click="selectTab(tab.id)"> |
|
28 |
- <img :src="selectedTabId === tab.id ? tab.activeImage : tab.inactiveImage" :alt="tab.title" class="tab-icon" /> |
|
30 |
+ <li v-for="(tab, idx) in tabs" :key="idx" class="tab-title" :class="{ active: selectedTabId === tab.id }" |
|
31 |
+ @click="selectTab(tab.id)"> |
|
32 |
+ <img :src="selectedTabId === tab.id ? tab.activeImage : tab.inactiveImage" :alt="tab.title" |
|
33 |
+ class="tab-icon" /> |
|
29 | 34 |
<p><b>{{ tab.title }}</b></p> |
30 | 35 |
</li> |
31 | 36 |
</ul> |
... | ... | @@ -46,11 +51,13 @@ |
46 | 51 |
<div v-else class="no-results"> |
47 | 52 |
<img :src="nosearch" alt=""> |
48 | 53 |
<p>검색 결과가 없습니다.</p> |
49 |
- <p>단어의 철자가 정확한지 확인해 주시기 바랍니다.<br> 검색어의 단어 수를 줄이거나, 다른 검색어(유사어)로 검색해 보시기 바랍니다.<br> 일반적으로 많이 사용하는 검색어로 다시 검색해 주시기 바랍니다.</p> |
|
54 |
+ <p>단어의 철자가 정확한지 확인해 주시기 바랍니다.<br> 검색어의 단어 수를 줄이거나, 다른 검색어(유사어)로 검색해 보시기 바랍니다.<br> 일반적으로 많이 사용하는 검색어로 다시 검색해 |
|
55 |
+ 주시기 바랍니다.</p> |
|
50 | 56 |
</div> |
51 | 57 |
</div> |
52 | 58 |
</div> |
53 |
- <div class="btn-group flex-end mt-40"><button type="button" class="register" @click="fnMoveTo('edit')">등록</button></div> |
|
59 |
+ <div class="btn-group flex-end mt-40"><button type="button" class="register" @click="fnMoveTo('edit')">등록</button> |
|
60 |
+ </div> |
|
54 | 61 |
<DefaultPagination class="mt-40" :search="searchReqDTO" @onChange="fnChangeCurrentPage" /> |
55 | 62 |
</div> |
56 | 63 |
</div> |
... | ... | @@ -70,6 +77,7 @@ |
70 | 77 |
import DefaultPagination from '@/views/component/DefaultPagination.vue'; |
71 | 78 |
// API |
72 | 79 |
import { findDcrysProc } from "@/resources/api/dcry"; |
80 |
+import { excelDownloadAll } from "../../../resources/api/main"; |
|
73 | 81 |
|
74 | 82 |
export default { |
75 | 83 |
components: { |
... | ... | @@ -266,6 +274,53 @@ |
266 | 274 |
this.$router.push(routes['list']); |
267 | 275 |
} |
268 | 276 |
}, |
277 |
+ |
|
278 |
+ // 사진 기록물 엑셀 다운로드 |
|
279 |
+ async fnDownload() { |
|
280 |
+ this.loading = true; // 로딩 시작 |
|
281 |
+ try { |
|
282 |
+ const params = JSON.parse(JSON.stringify(this.searchReqDTO)); |
|
283 |
+ if (this.searchReqDTO.searchCtgries && this.searchReqDTO.searchCtgries.length > 0) { |
|
284 |
+ params.searchCtgries = this.searchReqDTO.searchCtgries.join(','); |
|
285 |
+ } else { |
|
286 |
+ delete params.searchCtgries; |
|
287 |
+ } |
|
288 |
+ |
|
289 |
+ params.usePhoto = true; |
|
290 |
+ const response = await excelDownloadAll(params); |
|
291 |
+ |
|
292 |
+ const url = window.URL.createObjectURL( |
|
293 |
+ new Blob([response.data], { |
|
294 |
+ type: response.headers["content-type"], |
|
295 |
+ }) |
|
296 |
+ ); |
|
297 |
+ |
|
298 |
+ let today = new Date().toISOString().substring(2, 10); |
|
299 |
+ today = today.replace(/[^0-9]/g, ""); |
|
300 |
+ const fileName = `[사진기록물]기록물_${today}.xlsx`; |
|
301 |
+ |
|
302 |
+ const link = document.createElement("a"); |
|
303 |
+ link.href = url; |
|
304 |
+ link.setAttribute("download", fileName); |
|
305 |
+ document.body.appendChild(link); |
|
306 |
+ link.click(); |
|
307 |
+ |
|
308 |
+ document.body.removeChild(link); |
|
309 |
+ window.URL.revokeObjectURL(url); |
|
310 |
+ |
|
311 |
+ } catch (error) { |
|
312 |
+ console.error("엑셀 다운로드 에러:", error); |
|
313 |
+ if (error.response) { |
|
314 |
+ // Blob 응답이 아닐 경우 에러 메시지 처리가 다를 수 있음. |
|
315 |
+ // 여기서는 간단히 HTTP 상태 코드만 표시. |
|
316 |
+ alert(`엑셀 다운로드 중 에러 발생: ${error.response.status} ${error.response.statusText}`); |
|
317 |
+ } else { |
|
318 |
+ alert("엑셀 다운로드 중 네트워크 에러가 발생했습니다.\n관리자에게 문의해주세요."); |
|
319 |
+ } |
|
320 |
+ } finally { |
|
321 |
+ this.loading = false; |
|
322 |
+ } |
|
323 |
+ }, |
|
269 | 324 |
}, |
270 | 325 |
}; |
271 | 326 |
</script>(파일 끝에 줄바꿈 문자 없음) |
--- client/views/pages/bbsDcryVideo/VideoHistorySearch.vue
+++ client/views/pages/bbsDcryVideo/VideoHistorySearch.vue
... | ... | @@ -23,9 +23,14 @@ |
23 | 23 |
<p>총 <b>{{ searchReqDTO.totalRecordCount }}개</b>의 영상 기록물이 검색되었습니다. </p> |
24 | 24 |
</div> |
25 | 25 |
<div class="flex"> |
26 |
+ <div v-if="searchResult.length > 0"> |
|
27 |
+ <button type="button" @click="fnDownload">다운로드</button> |
|
28 |
+ </div> |
|
26 | 29 |
<ul class="tab-box mb-20"> |
27 |
- <li v-for="(tab, idx) in tabs" :key="idx" class="tab-title" :class="{ active: selectedTabId === tab.id }" @click="selectTab(tab.id)"> |
|
28 |
- <img :src="selectedTabId === tab.id ? tab.activeImage : tab.inactiveImage" :alt="tab.title" class="tab-icon" /> |
|
30 |
+ <li v-for="(tab, idx) in tabs" :key="idx" class="tab-title" :class="{ active: selectedTabId === tab.id }" |
|
31 |
+ @click="selectTab(tab.id)"> |
|
32 |
+ <img :src="selectedTabId === tab.id ? tab.activeImage : tab.inactiveImage" :alt="tab.title" |
|
33 |
+ class="tab-icon" /> |
|
29 | 34 |
<p><b>{{ tab.title }}</b></p> |
30 | 35 |
</li> |
31 | 36 |
</ul> |
... | ... | @@ -46,11 +51,13 @@ |
46 | 51 |
<div v-else class="no-results"> |
47 | 52 |
<img :src="nosearch" alt=""> |
48 | 53 |
<p>검색 결과가 없습니다.</p> |
49 |
- <p>단어의 철자가 정확한지 확인해 주시기 바랍니다.<br> 검색어의 단어 수를 줄이거나, 다른 검색어(유사어)로 검색해 보시기 바랍니다.<br> 일반적으로 많이 사용하는 검색어로 다시 검색해 주시기 바랍니다.</p> |
|
54 |
+ <p>단어의 철자가 정확한지 확인해 주시기 바랍니다.<br> 검색어의 단어 수를 줄이거나, 다른 검색어(유사어)로 검색해 보시기 바랍니다.<br> 일반적으로 많이 사용하는 검색어로 다시 검색해 |
|
55 |
+ 주시기 바랍니다.</p> |
|
50 | 56 |
</div> |
51 | 57 |
</div> |
52 | 58 |
</div> |
53 |
- <div class="btn-group flex-end mt-40"><button type="button" class="register" @click="fnMoveTo('edit')">등록</button></div> |
|
59 |
+ <div class="btn-group flex-end mt-40"><button type="button" class="register" @click="fnMoveTo('edit')">등록</button> |
|
60 |
+ </div> |
|
54 | 61 |
<DefaultPagination class="mt-40" :search="searchReqDTO" @onChange="fnChangeCurrentPage" /> |
55 | 62 |
</div> |
56 | 63 |
</div> |
... | ... | @@ -70,7 +77,7 @@ |
70 | 77 |
import DefaultPagination from '@/views/component/DefaultPagination.vue'; |
71 | 78 |
// API |
72 | 79 |
import { findDcrysProc } from "@/resources/api/dcry"; |
73 |
- |
|
80 |
+import { excelDownloadAll } from "../../../resources/api/main" |
|
74 | 81 |
export default { |
75 | 82 |
components: { |
76 | 83 |
SearchFormComponent, |
... | ... | @@ -266,6 +273,52 @@ |
266 | 273 |
this.$router.push(routes['list']); |
267 | 274 |
} |
268 | 275 |
}, |
276 |
+ // 영상상 기록물 엑셀 다운로드 |
|
277 |
+ async fnDownload() { |
|
278 |
+ this.loading = true; // 로딩 시작 |
|
279 |
+ try { |
|
280 |
+ const params = JSON.parse(JSON.stringify(this.searchReqDTO)); |
|
281 |
+ if (this.searchReqDTO.searchCtgries && this.searchReqDTO.searchCtgries.length > 0) { |
|
282 |
+ params.searchCtgries = this.searchReqDTO.searchCtgries.join(','); |
|
283 |
+ } else { |
|
284 |
+ delete params.searchCtgries; |
|
285 |
+ } |
|
286 |
+ |
|
287 |
+ params.useVideo = true; |
|
288 |
+ const response = await excelDownloadAll(params); |
|
289 |
+ |
|
290 |
+ const url = window.URL.createObjectURL( |
|
291 |
+ new Blob([response.data], { |
|
292 |
+ type: response.headers["content-type"], |
|
293 |
+ }) |
|
294 |
+ ); |
|
295 |
+ |
|
296 |
+ let today = new Date().toISOString().substring(2, 10); |
|
297 |
+ today = today.replace(/[^0-9]/g, ""); |
|
298 |
+ const fileName = `[영상기록물]기록물_${today}.xlsx`; |
|
299 |
+ |
|
300 |
+ const link = document.createElement("a"); |
|
301 |
+ link.href = url; |
|
302 |
+ link.setAttribute("download", fileName); |
|
303 |
+ document.body.appendChild(link); |
|
304 |
+ link.click(); |
|
305 |
+ |
|
306 |
+ document.body.removeChild(link); |
|
307 |
+ window.URL.revokeObjectURL(url); |
|
308 |
+ |
|
309 |
+ } catch (error) { |
|
310 |
+ console.error("엑셀 다운로드 에러:", error); |
|
311 |
+ if (error.response) { |
|
312 |
+ // Blob 응답이 아닐 경우 에러 메시지 처리가 다를 수 있음. |
|
313 |
+ // 여기서는 간단히 HTTP 상태 코드만 표시. |
|
314 |
+ alert(`엑셀 다운로드 중 에러 발생: ${error.response.status} ${error.response.statusText}`); |
|
315 |
+ } else { |
|
316 |
+ alert("엑셀 다운로드 중 네트워크 에러가 발생했습니다.\n관리자에게 문의해주세요."); |
|
317 |
+ } |
|
318 |
+ } finally { |
|
319 |
+ this.loading = false; |
|
320 |
+ } |
|
321 |
+ }, |
|
269 | 322 |
}, |
270 | 323 |
}; |
271 | 324 |
</script>(파일 끝에 줄바꿈 문자 없음) |
--- client/views/pages/bbsMediaVido/MediaVideoSearch.vue
+++ client/views/pages/bbsMediaVido/MediaVideoSearch.vue
... | ... | @@ -22,6 +22,9 @@ |
22 | 22 |
<p>총 <b>{{ searchReqDTO.totalRecordCount }}개</b>의 미디어 영상이 검색되었습니다. </p> |
23 | 23 |
</div> |
24 | 24 |
<div class="flex"> |
25 |
+ <div v-if="searchResult.length > 0"> |
|
26 |
+ <button type="button" @click="fnDownload">다운로드</button> |
|
27 |
+ </div> |
|
25 | 28 |
<ul class="tab-box mb-20"> |
26 | 29 |
<li v-for="(tab, idx) in tabs" :key="idx" class="tab-title" :class="{ active: selectedTabId === tab.id }" @click="selectTab(tab.id)"> |
27 | 30 |
<img :src="selectedTabId === tab.id ? tab.activeImage : tab.inactiveImage" :alt="tab.title" class="tab-icon" /> |
... | ... | @@ -69,6 +72,7 @@ |
69 | 72 |
import DefaultPagination from '@/views/component/DefaultPagination.vue'; |
70 | 73 |
// API |
71 | 74 |
import { findAllMediaVidosProc } from "@/resources/api/mediaVido"; |
75 |
+import { excelDownloadAll } from "../../../resources/api/main"; |
|
72 | 76 |
|
73 | 77 |
export default { |
74 | 78 |
components: { |
... | ... | @@ -263,6 +267,53 @@ |
263 | 267 |
this.$router.push(routes['list']); |
264 | 268 |
} |
265 | 269 |
}, |
270 |
+ |
|
271 |
+ // 미디어 영상 엑셀 다운로드 |
|
272 |
+ async fnDownload() { |
|
273 |
+ this.loading = true; // 로딩 시작 |
|
274 |
+ try { |
|
275 |
+ const params = JSON.parse(JSON.stringify(this.searchReqDTO)); |
|
276 |
+ if (this.searchReqDTO.searchCtgries && this.searchReqDTO.searchCtgries.length > 0) { |
|
277 |
+ params.searchCtgries = this.searchReqDTO.searchCtgries.join(','); |
|
278 |
+ } else { |
|
279 |
+ delete params.searchCtgries; |
|
280 |
+ } |
|
281 |
+ |
|
282 |
+ params.useMedia =true; |
|
283 |
+ const response = await excelDownloadAll(params); |
|
284 |
+ |
|
285 |
+ const url = window.URL.createObjectURL( |
|
286 |
+ new Blob([response.data], { |
|
287 |
+ type: response.headers["content-type"], |
|
288 |
+ }) |
|
289 |
+ ); |
|
290 |
+ |
|
291 |
+ let today = new Date().toISOString().substring(2, 10); |
|
292 |
+ today = today.replace(/[^0-9]/g, ""); |
|
293 |
+ const fileName = `[미디어영상]언론에서 바라보는 구미시시_${today}.xlsx`; |
|
294 |
+ |
|
295 |
+ const link = document.createElement("a"); |
|
296 |
+ link.href = url; |
|
297 |
+ link.setAttribute("download", fileName); |
|
298 |
+ document.body.appendChild(link); |
|
299 |
+ link.click(); |
|
300 |
+ |
|
301 |
+ document.body.removeChild(link); |
|
302 |
+ window.URL.revokeObjectURL(url); |
|
303 |
+ |
|
304 |
+ } catch (error) { |
|
305 |
+ console.error("엑셀 다운로드 에러:", error); |
|
306 |
+ if (error.response) { |
|
307 |
+ // Blob 응답이 아닐 경우 에러 메시지 처리가 다를 수 있음. |
|
308 |
+ // 여기서는 간단히 HTTP 상태 코드만 표시. |
|
309 |
+ alert(`엑셀 다운로드 중 에러 발생: ${error.response.status} ${error.response.statusText}`); |
|
310 |
+ } else { |
|
311 |
+ alert("엑셀 다운로드 중 네트워크 에러가 발생했습니다.\n관리자에게 문의해주세요."); |
|
312 |
+ } |
|
313 |
+ } finally { |
|
314 |
+ this.loading = false; |
|
315 |
+ } |
|
316 |
+ }, |
|
266 | 317 |
}, |
267 | 318 |
}; |
268 | 319 |
</script>(파일 끝에 줄바꿈 문자 없음) |
--- client/views/pages/bbsNesDta/NewsReleaseSearch.vue
+++ client/views/pages/bbsNesDta/NewsReleaseSearch.vue
... | ... | @@ -23,6 +23,9 @@ |
23 | 23 |
<p>총 <b>{{ searchReqDTO.totalRecordCount }}개</b>의 스크랩 자료가 검색되었습니다. </p> |
24 | 24 |
</div> |
25 | 25 |
<div class="flex"> |
26 |
+ <div v-if="searchResult.length > 0"> |
|
27 |
+ <button type="button" @click="fnDownload">다운로드</button> |
|
28 |
+ </div> |
|
26 | 29 |
<ul class="tab-box mb-20"> |
27 | 30 |
<li v-for="(tab, idx) in tabs" :key="idx" class="tab-title" :class="{ active: selectedTabId === tab.id }" @click="selectTab(tab.id)"> |
28 | 31 |
<img :src="selectedTabId === tab.id ? tab.activeImage : tab.inactiveImage" :alt="tab.title" class="tab-icon" /> |
... | ... | @@ -70,6 +73,7 @@ |
70 | 73 |
import DefaultPagination from '@/views/component/DefaultPagination.vue'; |
71 | 74 |
// API |
72 | 75 |
import { findAllNesDtasProc } from "@/resources/api/nesDta"; |
76 |
+import { excelDownloadAll } from "../../../resources/api/main"; |
|
73 | 77 |
|
74 | 78 |
export default { |
75 | 79 |
components: { |
... | ... | @@ -264,6 +268,53 @@ |
264 | 268 |
this.$router.push(routes['list']); |
265 | 269 |
} |
266 | 270 |
}, |
271 |
+ |
|
272 |
+ // 스크랩 자료 엑셀 다운로드 |
|
273 |
+ async fnDownload() { |
|
274 |
+ this.loading = true; // 로딩 시작 |
|
275 |
+ try { |
|
276 |
+ const params = JSON.parse(JSON.stringify(this.searchReqDTO)); |
|
277 |
+ if (this.searchReqDTO.searchCtgries && this.searchReqDTO.searchCtgries.length > 0) { |
|
278 |
+ params.searchCtgries = this.searchReqDTO.searchCtgries.join(','); |
|
279 |
+ } else { |
|
280 |
+ delete params.searchCtgries; |
|
281 |
+ } |
|
282 |
+ |
|
283 |
+ params.useNews =true; |
|
284 |
+ const response = await excelDownloadAll(params); |
|
285 |
+ |
|
286 |
+ const url = window.URL.createObjectURL( |
|
287 |
+ new Blob([response.data], { |
|
288 |
+ type: response.headers["content-type"], |
|
289 |
+ }) |
|
290 |
+ ); |
|
291 |
+ |
|
292 |
+ let today = new Date().toISOString().substring(2, 10); |
|
293 |
+ today = today.replace(/[^0-9]/g, ""); |
|
294 |
+ const fileName = `[스크랩자료]언론에서 바라보는 구미시_${today}.xlsx`; |
|
295 |
+ |
|
296 |
+ const link = document.createElement("a"); |
|
297 |
+ link.href = url; |
|
298 |
+ link.setAttribute("download", fileName); |
|
299 |
+ document.body.appendChild(link); |
|
300 |
+ link.click(); |
|
301 |
+ |
|
302 |
+ document.body.removeChild(link); |
|
303 |
+ window.URL.revokeObjectURL(url); |
|
304 |
+ |
|
305 |
+ } catch (error) { |
|
306 |
+ console.error("엑셀 다운로드 에러:", error); |
|
307 |
+ if (error.response) { |
|
308 |
+ // Blob 응답이 아닐 경우 에러 메시지 처리가 다를 수 있음. |
|
309 |
+ // 여기서는 간단히 HTTP 상태 코드만 표시. |
|
310 |
+ alert(`엑셀 다운로드 중 에러 발생: ${error.response.status} ${error.response.statusText}`); |
|
311 |
+ } else { |
|
312 |
+ alert("엑셀 다운로드 중 네트워크 에러가 발생했습니다.\n관리자에게 문의해주세요."); |
|
313 |
+ } |
|
314 |
+ } finally { |
|
315 |
+ this.loading = false; |
|
316 |
+ } |
|
317 |
+ }, |
|
267 | 318 |
}, |
268 | 319 |
}; |
269 | 320 |
</script>(파일 끝에 줄바꿈 문자 없음) |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?