From e6df49fc14c96ff9a02f510ca99127bc6de22bf9 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Thu, 15 Jun 2023 10:41:59 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8F=AC=EB=A7=B7=ED=8C=85=20=EC=A4=91?= =?UTF-8?q?=EB=B3=B5=20=EA=B8=B0=EB=8A=A5=20=EC=A0=9C=EA=B1=B0=20json.get?= =?UTF-8?q?=20->=20ajax.get?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/resources/js/base/base-fims.js | 6 +- .../webapp/resources/js/base/dataset-fims.js | 58 ++----------------- src/main/webapp/resources/js/base/dataset.js | 2 +- 3 files changed, 8 insertions(+), 58 deletions(-) diff --git a/src/main/webapp/resources/js/base/base-fims.js b/src/main/webapp/resources/js/base/base-fims.js index e3b8f1df..f70e6f24 100644 --- a/src/main/webapp/resources/js/base/base-fims.js +++ b/src/main/webapp/resources/js/base/base-fims.js @@ -42,16 +42,16 @@ class FimsFormFields extends FormFields { const fmtType = input.dataset.fmtType; switch (fmtType) { case 'dt' : - value = StrDateTimeFormat.format(value); + value = dateTimeFormat.format(value); break; case 'day' : - value = StrDateFormat.format(value); + value = dateFormat.format(value); break; case 'time' : value = StrTimeFormat.format(value); break; case 'number' : - value = CommaNumberFormat.format(value); + value = numberFormat.format(value); break; default: break; diff --git a/src/main/webapp/resources/js/base/dataset-fims.js b/src/main/webapp/resources/js/base/dataset-fims.js index 3b8edec6..d838a821 100644 --- a/src/main/webapp/resources/js/base/dataset-fims.js +++ b/src/main/webapp/resources/js/base/dataset-fims.js @@ -1,53 +1,3 @@ -/** - * 숫자를 콤마 포멧으로 변환 - **/ -const CommaNumberFormat = { - format(value){ - var reg = /(^[+-]?\d+)(\d{3})/; - value += ''; - while (reg.test(value)) - value = value.replace(reg, '$1' + ',' + '$2'); - - return value; - } -} - -/** - * yyyyMMddHH24miss - * yyyy-MM-ddTHH24:mi:ss.xxxxxxZ - * @param {string} srcDateStr - * @param {string} delimiter - * @returns {string|*} - */ -const StrDateTimeFormat = { - format(value){ - if(value == null || value.isBlank()) return value; - - let srcDate = value.replace(/\-|\s|\:|\.|T|Z/g,''); - if(srcDate.length == 8) { - return srcDate.substring(0, 4)+"-"+srcDate.substring(4, 6)+"-"+srcDate.substring(6, 8); - }else if(srcDate.length >= 14){ - return srcDate.substring(0, 4)+"-"+srcDate.substring(4, 6)+"-"+srcDate.substring(6, 8) - + ' ' + srcDate.substring(8, 10) + ':' + srcDate.substring(10, 12) + ':' + srcDate.substring(12, 14); - }else{ - return srcDate; - } - } - -} - -const StrDateFormat = { - format(value){ - if(value == null || value.isBlank()) return value; - - let srcDate = value.replace(/\-|\s|\:|\./g,''); - if(srcDate.length >= 8) { - return srcDate.substring(0, 4)+"-"+srcDate.substring(4, 6)+"-"+srcDate.substring(6, 8); - }else{ - return srcDate; - } - } -} const StrTimeFormat= { format(value){ @@ -105,11 +55,11 @@ class FimsDatasetControl extends DatasetControl { load(pageNum,flag) { if(this._paginationInfo.paging){ - this.query.pageNum = pageNum; - this.query.fetchSize = this._paginationInfo.fetchSize; + this.query.fetchSize = this._paginationInfo.fetchSize; + this.query.pageNum = pageNum; } else { + this.query.fetchSize = 0; this.query.pageNum = 0; - this.query.fetchSize = 0; } this._load(flag); @@ -118,7 +68,7 @@ class FimsDatasetControl extends DatasetControl { _load(flag) { if (!this.query.pageNum) this.query.pageNum = 1; - json.get({ + ajax.get({ url:this.urls.load, data:this.query, success:resp => this.setData(resp,flag) diff --git a/src/main/webapp/resources/js/base/dataset.js b/src/main/webapp/resources/js/base/dataset.js index fd760a2f..6369fc0f 100644 --- a/src/main/webapp/resources/js/base/dataset.js +++ b/src/main/webapp/resources/js/base/dataset.js @@ -1181,7 +1181,7 @@ class DatasetControl { _load() { if (!this.query.pageNum) this.query.pageNum = 1; - json.get({ + ajax.get({ url:this.urls.load, data:this.query, success:resp => this.setData(resp)