fix: 이미지 관련 fix

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

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

@ -13,11 +13,11 @@
<!-- 입력 영역 -->
<form id="frmEdit--${pageName}" name="frmEdit">
<!-- 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>--%>
<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">
<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>
@ -121,6 +121,7 @@
</li>
</template>
<script src="<c:url value="/webjars/applib/js/cmmnDateUtil.js?${ver}"/>"></script>
<script>
/**************************************************************************
* Global Variable
@ -136,7 +137,7 @@
$P.fileInfos = ${fileInfos};
$P.fileArr = [];
// FormFields
$P.formFields = new AddsFormFields("#frmEdit--${pageName}");
@ -154,8 +155,7 @@
, appendData: true
, infoSize: "xl"
, formats: {
rptDe: dateFormat
, hdrDe: dateFormat
hdrDe: dateFormat
, dsuseDe: dateFormat
}
});
@ -226,7 +226,6 @@
prgrsSttsCd: "06",
userId: "${currentUser.account}"
}
let create = (info.dscdmngId == "");
//파일정보 변경 여부 체크
let fileChangeYn = "N";
@ -300,14 +299,9 @@
//
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]
: ${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);
@ -452,12 +446,6 @@
}
}
});
console.log("#${usrRptIdNo}");
// input, select 초기화
let searchForm = $("#frmSearch--${pageName}");
@ -466,10 +454,10 @@
searchForm.find("input[type='hidden']").val("");
searchForm.find("select").each(function() { $(this).find("option:eq(0)").prop("selected", true); });
// 기본 데이터 설정
initDatepicker("frmEdit--${pageName}"); // 달력 초기화
$("#schDateFrom--${pageName}").datepicker("setDate", DateUtil.getDateDay(-7).date); // 부과 제외 일자 시작
$("#schDateTo--${pageName}").datepicker("setDate", new Date()); // 부과 제외 일자 종료
$("#hdrDe--${pageName}").datepicker("setDate", DateUtil.getDateDay(-7).date); // 부과 제외 일자 시작
$("#dsuseDe--${pageName}").datepicker("setDate", new Date()); // 부과 제외 일자 종료
}
@ -489,7 +477,13 @@
if($P.fileInfos.length > 0){
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) => {
$P.fileArr = $P.fileArr.concat(values);

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

@ -9,7 +9,7 @@
<div class="row my-1 mx-4 g-1" style="align-items: baseline">
<div class="col-md-4">
<label for="ProductNm--${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="productNm--${pageName}" name="schProductNm" >
<input type="text" class="form-control w-60" id="productNm--${pageName}" name="schProductNm" >
</div>
<div class="col-md-4">
<label for="ProductCd--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">제품코드</label>

@ -1,16 +1,38 @@
/**************************************************************************
* 서버의 파일 정보로 javascript File 객체 생성
**************************************************************************/
async function fnCreateFileFromFileInfo(fileInfo){
* 서버의 파일 정보로 javascript File 객체 생성
**************************************************************************/
async function fnCreateFileFromFileInfo(fileInfo) {
let response = await fetch(fileInfo.URL);
let data = await response.blob();
let metadata = {
type: fileInfo.MIME_TYPE
};
let file = new File([data], fileInfo.FILE_NM, metadata);
file.id = fileInfo.FILE_ID;
file.url = fileInfo.URL;
try {
let response = await fetch(fileInfo.URL);
return new Promise(resolve => { resolve(file); });
}
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 metadata = {
type: fileInfo.MIME_TYPE
};
let file = new File([data], fileInfo.FILE_NM, metadata);
file.id = fileInfo.FILE_ID;
file.url = fileInfo.URL;
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