fix: 이미지 관련 fix

dev
Jonguk. Lim 5 months ago
parent 44f5175a94
commit 8d1f13fd70

@ -81,8 +81,8 @@ propertyService:
app: app:
api: api:
host: http://211.119.124.9:9076 #host: http://211.119.124.9:9076
#host: http://localhost:9076 host: 'http://localhost:9076'
--- ---
spring: spring:

@ -13,11 +13,11 @@
<!-- 입력 영역 --> <!-- 입력 영역 -->
<form id="frmEdit--${pageName}" name="frmEdit"> <form id="frmEdit--${pageName}" name="frmEdit">
<!-- hidden --> <!-- hidden -->
<input type="hidden" name="dscdmngId" data-map="dscdmngId" /> <input type="hidden" id="usrRptIdNo--${pageName}" name="usrRptIdNo" data-map="usrRptIdNo">
<%-- <label for="bssh--${pageName}">업체 정보</label>--%> <%-- <label for="bssh--${pageName}">업체 정보</label>--%>
<div class="row my-1 mx-4 g-1 border-card rounded-3"> <div class="row my-1 mx-4 g-1 border-card rounded-3">
<input type="hidden" id="usrRptIdNo--${pageName}" name="usrRptIdNo" data-map="usrRptIdNo">
<div class="col-md-4"> <div class="col-md-4">
<label for="dscdmngId--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기관리번호</label> <label for="dscdmngId--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기관리번호</label>
<input type="text" class="form-control w-60" id="dscdmngId--${pageName}" name="dscdmngId" data-map="dscdmngId" readonly> <input type="text" class="form-control w-60" id="dscdmngId--${pageName}" name="dscdmngId" data-map="dscdmngId" readonly>
@ -121,6 +121,7 @@
</li> </li>
</template> </template>
<script src="<c:url value="/webjars/applib/js/cmmnDateUtil.js?${ver}"/>"></script>
<script> <script>
/************************************************************************** /**************************************************************************
* Global Variable * Global Variable
@ -154,8 +155,7 @@
, appendData: true , appendData: true
, infoSize: "xl" , infoSize: "xl"
, formats: { , formats: {
rptDe: dateFormat hdrDe: dateFormat
, hdrDe: dateFormat
, dsuseDe: dateFormat , dsuseDe: dateFormat
} }
}); });
@ -226,7 +226,6 @@
prgrsSttsCd: "06", prgrsSttsCd: "06",
userId: "${currentUser.account}" userId: "${currentUser.account}"
} }
let create = (info.dscdmngId == "");
//파일정보 변경 여부 체크 //파일정보 변경 여부 체크
let fileChangeYn = "N"; let fileChangeYn = "N";
@ -300,15 +299,10 @@
// //
let replacer = (str, dataItem) => str; let replacer = (str, dataItem) => str;
// .replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("USR_RPT_ID_NO") + "');")
// .replace(/{ondblclick}/gi, "pageObject['${pageName}'].getTotalInfo('" + dataItem.getValue("USR_RPT_ID_NO") + "');");
let trs = empty ? [document.getElementById("${infoPrefix}NotFound--${pageName}").content.outerHTML] let trs = empty ? [document.getElementById("${infoPrefix}NotFound--${pageName}").content.outerHTML]
: ${infoPrefix}List.inStrings(foundTr.outerHTML, replacer); : ${infoPrefix}List.inStrings(foundTr.outerHTML, replacer);
let noMore = (totalSize == ${infoPrefix}List.length);
let initScroll = ($P.control.query.pageNum < 2) && ($P.control.untilPageNum == 0);
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), true, true); $("#table-responsive--${pageName}")[0].changeContent(trs.join(), true, true);
if ($P.control.untilPageNum != 0) { if ($P.control.untilPageNum != 0) {
@ -453,12 +447,6 @@
} }
}); });
console.log("#${usrRptIdNo}");
// input, select 초기화 // input, select 초기화
let searchForm = $("#frmSearch--${pageName}"); let searchForm = $("#frmSearch--${pageName}");
searchForm.find("input[type='checkbox']").prop("checked", false); searchForm.find("input[type='checkbox']").prop("checked", false);
@ -466,10 +454,10 @@
searchForm.find("input[type='hidden']").val(""); searchForm.find("input[type='hidden']").val("");
searchForm.find("select").each(function() { $(this).find("option:eq(0)").prop("selected", true); }); searchForm.find("select").each(function() { $(this).find("option:eq(0)").prop("selected", true); });
// 기본 데이터 설정
initDatepicker("frmEdit--${pageName}"); // 달력 초기화 initDatepicker("frmEdit--${pageName}"); // 달력 초기화
$("#schDateFrom--${pageName}").datepicker("setDate", DateUtil.getDateDay(-7).date); // 부과 제외 일자 시작 $("#hdrDe--${pageName}").datepicker("setDate", DateUtil.getDateDay(-7).date); // 부과 제외 일자 시작
$("#schDateTo--${pageName}").datepicker("setDate", new Date()); // 부과 제외 일자 종료 $("#dsuseDe--${pageName}").datepicker("setDate", new Date()); // 부과 제외 일자 종료
} }
@ -489,7 +477,13 @@
if($P.fileInfos.length > 0){ if($P.fileInfos.length > 0){
let promiseArr = []; let promiseArr = [];
$P.fileInfos.forEach(f => promiseArr.push(fnCreateFileFromFileInfo(f))); // URL에 c: d: 제거
$P.fileInfos.forEach(f => {
// FIXME: URL에 c: d: 제거 ???
f.URL = f.URL.replace(/c:/g, "");
f.URL = f.URL.replace(/d:/g, "");
promiseArr.push(fnCreateFileFromFileInfo(f));
});
Promise.all(promiseArr).then((values) => { Promise.all(promiseArr).then((values) => {
$P.fileArr = $P.fileArr.concat(values); $P.fileArr = $P.fileArr.concat(values);

@ -280,7 +280,7 @@
$P.control.getInfo = (isDtl) => { $P.control.getInfo = (isDtl) => {
let dialogTitle = "폐기 결과[통보] 등록"; let dialogTitle = "폐기 결과[통보] 등록";
if(isDtl) dialogTitle = "폐기 결과[통보] 상세"; if(isDtl) dialogTitle = "폐기 결과[통보] 상세";
let row = $P.control.dataset.getCurrent(); const row = $P.control.dataset.getCurrent();
if (typeof row == "undefined" || row == null || row == "") return; if (typeof row == "undefined" || row == null || row == "") return;
let params = { let params = {
dscdmngId: row.DSCDMNG_ID, dscdmngId: row.DSCDMNG_ID,
@ -295,8 +295,8 @@
if (isDtl) { if (isDtl) {
params = { params = {
...params, ...params,
hdrDe: row.HDR_DE, hdrDe: row.HDR_DE.substring(0, 4) + "-" + row.HDR_DE.substring(4, 6) + "-" + row.HDR_DE.substring(6),
dsuseDe: row.DSUSE_DE, dsuseDe: row.DSUSE_DE.substring(0, 4) + "-" + row.DSUSE_DE.substring(4, 6) + "-" + row.DSUSE_DE.substring(6),
dsuseSeCd: row.DSUSE_SE_CD, dsuseSeCd: row.DSUSE_SE_CD,
dsuseMthCd: row.DSUSE_MTH_CD, dsuseMthCd: row.DSUSE_MTH_CD,
dsuseLoc: row.DSUSE_LOC dsuseLoc: row.DSUSE_LOC

@ -1,10 +1,23 @@
/************************************************************************** /**************************************************************************
* 서버의 파일 정보로 javascript File 객체 생성 * 서버의 파일 정보로 javascript File 객체 생성
**************************************************************************/ **************************************************************************/
async function fnCreateFileFromFileInfo(fileInfo){ async function fnCreateFileFromFileInfo(fileInfo) {
try {
let response = await fetch(fileInfo.URL); let response = await fetch(fileInfo.URL);
if (!response.ok) {
//throw new Error(`HTTP error! status: ${response.status}`);
let file = new File([], fileInfo.FILE_NM, metadata);
file.id = fileInfo.FILE_ID;
file.url = fileInfo.URL;
return new Promise(resolve => {
resolve(file);
});
}
let data = await response.blob(); let data = await response.blob();
let metadata = { let metadata = {
type: fileInfo.MIME_TYPE type: fileInfo.MIME_TYPE
}; };
@ -12,5 +25,14 @@ async function fnCreateFileFromFileInfo(fileInfo){
file.id = fileInfo.FILE_ID; file.id = fileInfo.FILE_ID;
file.url = fileInfo.URL; file.url = fileInfo.URL;
return new Promise(resolve => { resolve(file); }); return new Promise(resolve => {
resolve(file);
});
} catch (error) {
console.error('Fetch error:', error);
// Handle the error appropriately, e.g., return a default value or rethrow
// Here, we'll return null to indicate failure
return null;
}
} }
Loading…
Cancel
Save