mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-08 21:44:25 +09:00
로그인 및 메인 화면 수정 변경
This commit is contained in:
103
frontend/src/modules/stats/service/mock/bsnmDayExcelHeader.json
Normal file
103
frontend/src/modules/stats/service/mock/bsnmDayExcelHeader.json
Normal file
@@ -0,0 +1,103 @@
|
||||
{
|
||||
"header": [
|
||||
[
|
||||
{
|
||||
"key": "sumYmd",
|
||||
"name": "날짜",
|
||||
"rowspan": 2
|
||||
},
|
||||
{
|
||||
"key": "custNm",
|
||||
"name": "고객사명",
|
||||
"rowspan": 2
|
||||
},
|
||||
{
|
||||
"key": "bizrno",
|
||||
"name": "사업자번호",
|
||||
"rowspan": 2
|
||||
},
|
||||
{
|
||||
"name": "전체",
|
||||
"colspan": 3
|
||||
},
|
||||
{
|
||||
"name": "SMS",
|
||||
"colspan": 3
|
||||
},
|
||||
{
|
||||
"name": "LMS",
|
||||
"colspan": 3
|
||||
},
|
||||
{
|
||||
"name": "MMS",
|
||||
"colspan": 3
|
||||
},
|
||||
{
|
||||
"name": "알림톡",
|
||||
"colspan": 3
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"key": "sndCnt",
|
||||
"name": "발송건수"
|
||||
},
|
||||
{
|
||||
"key": "succCnt",
|
||||
"name": "성공건수"
|
||||
},
|
||||
{
|
||||
"key": "succRt",
|
||||
"name": "성공률(%)"
|
||||
},
|
||||
{
|
||||
"key": "sndCntS",
|
||||
"name": "발송건수"
|
||||
},
|
||||
{
|
||||
"key": "succCntS",
|
||||
"name": "성공건수"
|
||||
},
|
||||
{
|
||||
"key": "succRtS",
|
||||
"name": "성공률(%)"
|
||||
},
|
||||
{
|
||||
"key": "sndCntL",
|
||||
"name": "발송건수"
|
||||
},
|
||||
{
|
||||
"key": "succCntL",
|
||||
"name": "성공건수"
|
||||
},
|
||||
{
|
||||
"key": "succRtL",
|
||||
"name": "성공률(%)"
|
||||
},
|
||||
{
|
||||
"key": "sndCntM",
|
||||
"name": "발송건수"
|
||||
},
|
||||
{
|
||||
"key": "succCntM",
|
||||
"name": "성공건수"
|
||||
},
|
||||
{
|
||||
"key": "succRtM",
|
||||
"name": "성공률(%)"
|
||||
},
|
||||
{
|
||||
"key": "sndCntR",
|
||||
"name": "발송건수"
|
||||
},
|
||||
{
|
||||
"key": "succCntR",
|
||||
"name": "성공건수"
|
||||
},
|
||||
{
|
||||
"key": "succRtR",
|
||||
"name": "성공률(%)"
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
{
|
||||
"header": [
|
||||
[
|
||||
{
|
||||
"key": "sumYm",
|
||||
"name": "날짜",
|
||||
"rowspan": 2
|
||||
},
|
||||
{
|
||||
"key": "custNm",
|
||||
"name": "고객사명",
|
||||
"rowspan": 2
|
||||
},
|
||||
{
|
||||
"key": "bizrno",
|
||||
"name": "사업자번호",
|
||||
"rowspan": 2
|
||||
},
|
||||
{
|
||||
"name": "전체",
|
||||
"colspan": 3
|
||||
},
|
||||
{
|
||||
"name": "SMS",
|
||||
"colspan": 3
|
||||
},
|
||||
{
|
||||
"name": "LMS",
|
||||
"colspan": 3
|
||||
},
|
||||
{
|
||||
"name": "MMS",
|
||||
"colspan": 3
|
||||
},
|
||||
{
|
||||
"name": "알림톡",
|
||||
"colspan": 3
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"key": "sndCnt",
|
||||
"name": "발송건수"
|
||||
},
|
||||
{
|
||||
"key": "succCnt",
|
||||
"name": "성공건수"
|
||||
},
|
||||
{
|
||||
"key": "succRt",
|
||||
"name": "성공률(%)"
|
||||
},
|
||||
{
|
||||
"key": "sndCntS",
|
||||
"name": "발송건수"
|
||||
},
|
||||
{
|
||||
"key": "succCntS",
|
||||
"name": "성공건수"
|
||||
},
|
||||
{
|
||||
"key": "succRtS",
|
||||
"name": "성공률(%)"
|
||||
},
|
||||
{
|
||||
"key": "sndCntL",
|
||||
"name": "발송건수"
|
||||
},
|
||||
{
|
||||
"key": "succCntL",
|
||||
"name": "성공건수"
|
||||
},
|
||||
{
|
||||
"key": "succRtL",
|
||||
"name": "성공률(%)"
|
||||
},
|
||||
{
|
||||
"key": "sndCntM",
|
||||
"name": "발송건수"
|
||||
},
|
||||
{
|
||||
"key": "succCntM",
|
||||
"name": "성공건수"
|
||||
},
|
||||
{
|
||||
"key": "succRtM",
|
||||
"name": "성공률(%)"
|
||||
},
|
||||
{
|
||||
"key": "sndCntR",
|
||||
"name": "발송건수"
|
||||
},
|
||||
{
|
||||
"key": "succCntR",
|
||||
"name": "성공건수"
|
||||
},
|
||||
{
|
||||
"key": "succRtR",
|
||||
"name": "성공률(%)"
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
93
frontend/src/modules/stats/service/mock/dayExcelHeader.json
Normal file
93
frontend/src/modules/stats/service/mock/dayExcelHeader.json
Normal file
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"header": [
|
||||
[
|
||||
{
|
||||
"key": "sumYmd",
|
||||
"name": "날짜",
|
||||
"rowspan": 2
|
||||
},
|
||||
{
|
||||
"name": "전체",
|
||||
"colspan": 3
|
||||
},
|
||||
{
|
||||
"name": "SMS",
|
||||
"colspan": 3
|
||||
},
|
||||
{
|
||||
"name": "LMS",
|
||||
"colspan": 3
|
||||
},
|
||||
{
|
||||
"name": "MMS",
|
||||
"colspan": 3
|
||||
},
|
||||
{
|
||||
"name": "알림톡",
|
||||
"colspan": 3
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"key": "sndCnt",
|
||||
"name": "발송건수"
|
||||
},
|
||||
{
|
||||
"key": "succCnt",
|
||||
"name": "성공건수"
|
||||
},
|
||||
{
|
||||
"key": "succRt",
|
||||
"name": "성공률(%)"
|
||||
},
|
||||
{
|
||||
"key": "sndCntS",
|
||||
"name": "발송건수"
|
||||
},
|
||||
{
|
||||
"key": "succCntS",
|
||||
"name": "성공건수"
|
||||
},
|
||||
{
|
||||
"key": "succRtS",
|
||||
"name": "성공률(%)"
|
||||
},
|
||||
{
|
||||
"key": "sndCntL",
|
||||
"name": "발송건수"
|
||||
},
|
||||
{
|
||||
"key": "succCntL",
|
||||
"name": "성공건수"
|
||||
},
|
||||
{
|
||||
"key": "succRtL",
|
||||
"name": "성공률(%)"
|
||||
},
|
||||
{
|
||||
"key": "sndCntM",
|
||||
"name": "발송건수"
|
||||
},
|
||||
{
|
||||
"key": "succCntM",
|
||||
"name": "성공건수"
|
||||
},
|
||||
{
|
||||
"key": "succRtM",
|
||||
"name": "성공률(%)"
|
||||
},
|
||||
{
|
||||
"key": "sndCntR",
|
||||
"name": "발송건수"
|
||||
},
|
||||
{
|
||||
"key": "succCntR",
|
||||
"name": "성공건수"
|
||||
},
|
||||
{
|
||||
"key": "succRtR",
|
||||
"name": "성공률(%)"
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"header": [
|
||||
[
|
||||
{
|
||||
"key": "sumYm",
|
||||
"name": "날짜",
|
||||
"rowspan": 2
|
||||
},
|
||||
{
|
||||
"name": "전체",
|
||||
"colspan": 3
|
||||
},
|
||||
{
|
||||
"name": "SMS",
|
||||
"colspan": 3
|
||||
},
|
||||
{
|
||||
"name": "LMS",
|
||||
"colspan": 3
|
||||
},
|
||||
{
|
||||
"name": "MMS",
|
||||
"colspan": 3
|
||||
},
|
||||
{
|
||||
"name": "알림톡",
|
||||
"colspan": 3
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"key": "sndCnt",
|
||||
"name": "발송건수"
|
||||
},
|
||||
{
|
||||
"key": "succCnt",
|
||||
"name": "성공건수"
|
||||
},
|
||||
{
|
||||
"key": "succRt",
|
||||
"name": "성공률(%)"
|
||||
},
|
||||
{
|
||||
"key": "sndCntS",
|
||||
"name": "발송건수"
|
||||
},
|
||||
{
|
||||
"key": "succCntS",
|
||||
"name": "성공건수"
|
||||
},
|
||||
{
|
||||
"key": "succRtS",
|
||||
"name": "성공률(%)"
|
||||
},
|
||||
{
|
||||
"key": "sndCntL",
|
||||
"name": "발송건수"
|
||||
},
|
||||
{
|
||||
"key": "succCntL",
|
||||
"name": "성공건수"
|
||||
},
|
||||
{
|
||||
"key": "succRtL",
|
||||
"name": "성공률(%)"
|
||||
},
|
||||
{
|
||||
"key": "sndCntM",
|
||||
"name": "발송건수"
|
||||
},
|
||||
{
|
||||
"key": "succCntM",
|
||||
"name": "성공건수"
|
||||
},
|
||||
{
|
||||
"key": "succRtM",
|
||||
"name": "성공률(%)"
|
||||
},
|
||||
{
|
||||
"key": "sndCntR",
|
||||
"name": "발송건수"
|
||||
},
|
||||
{
|
||||
"key": "succCntR",
|
||||
"name": "성공건수"
|
||||
},
|
||||
{
|
||||
"key": "succRtR",
|
||||
"name": "성공률(%)"
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
@@ -1,4 +1,8 @@
|
||||
import httpClient from '@/common/http-client';
|
||||
import dayExcelHeader from './mock/dayExcelHeader.json';
|
||||
import monthExcelHeader from './mock/monthExcelHeader.json'
|
||||
import bsnmDayExcelHeader from './mock/bsnmDayExcelHeader.json'
|
||||
import bsnmMonthExcelHeader from './mock/bsnmMonthExcelHeader.json'
|
||||
|
||||
// HUBEZ_BO_API - 일별 통계 목록 조회.
|
||||
const dayList = (params) => {
|
||||
@@ -20,10 +24,46 @@ const bsnmMonthList = (params) => {
|
||||
return httpClient.post('/api/v1/bo/stats/bsnmMonthList', params, { withCredentials: false });
|
||||
}
|
||||
|
||||
const bsnmMonthListExcel = (params) => {
|
||||
return httpClient.post('/api/v1/bo/stats/bsnmMonthListExcel', params);
|
||||
}
|
||||
|
||||
const bsnmDayListExcel = (params) => {
|
||||
return httpClient.post('/api/v1/bo/stats/bsnmDayListExcel', params);
|
||||
}
|
||||
|
||||
const getExcelHeader = category => {
|
||||
// 엑셀에 출력할 Header 정보를 Mockup 데이터로 관리한다.
|
||||
return new Promise(function(resolve, reject) {
|
||||
let header = [];
|
||||
switch (category) {
|
||||
case 'DAY':
|
||||
header = dayExcelHeader.header;
|
||||
break;
|
||||
case 'MONTH':
|
||||
header = monthExcelHeader.header;
|
||||
break;
|
||||
case 'BSNM_DAY':
|
||||
header = bsnmDayExcelHeader.header;
|
||||
break;
|
||||
case 'BSNM_MONTH':
|
||||
header = bsnmMonthExcelHeader.header;
|
||||
break;
|
||||
default:
|
||||
header = '';
|
||||
break;
|
||||
}
|
||||
resolve(header);
|
||||
});
|
||||
};
|
||||
|
||||
export default {
|
||||
dayList,
|
||||
monthList,
|
||||
bsnmDayList,
|
||||
bsnmMonthList,
|
||||
getExcelHeader,
|
||||
bsnmMonthListExcel,
|
||||
bsnmDayListExcel,
|
||||
|
||||
}
|
||||
@@ -17,7 +17,7 @@
|
||||
<div class="search_wrap">
|
||||
<div class="input_box cal">
|
||||
<label for="right" class="label txt">날짜</label>
|
||||
<p> 최대 3개월까지 조회 가능합니다.</p>
|
||||
<p> 최대 1개월까지 조회 가능합니다.</p>
|
||||
<div class="term">
|
||||
<!--
|
||||
<input class="date" type="text" id="" placeholder="2022-10-12"/>
|
||||
@@ -63,7 +63,7 @@
|
||||
<div class="info">
|
||||
<div class="count">집계결과</div>
|
||||
<div class="button_group">
|
||||
<button type="button" class="button blue download">엑셀 다운로드</button>
|
||||
<button type="button" class="button blue download" @click="excelDown();">엑셀 다운로드</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -116,7 +116,7 @@ export default {
|
||||
list:[],
|
||||
totalCnt: '',
|
||||
|
||||
pageType: 'SUBS',
|
||||
pageType: 'BSNM_DAY',
|
||||
|
||||
// 테이블 리스트 데이터
|
||||
perPageCnt: 50,
|
||||
@@ -243,7 +243,9 @@ export default {
|
||||
|
||||
},
|
||||
destroyed() {
|
||||
|
||||
this.grid.params.custNm='';
|
||||
this.grid.params.bizrno='';
|
||||
|
||||
},
|
||||
mounted() {
|
||||
let page = 1;
|
||||
@@ -360,6 +362,53 @@ export default {
|
||||
const getCondition = this.$store.getters['searchcondition/getSearchCondition'];
|
||||
console.log("getCondition : "+ getCondition.perPage);
|
||||
},
|
||||
initSetStartDate(){
|
||||
let initStartDate = new Date();
|
||||
initStartDate.setMonth(Number(moment(initStartDate).format('MM')) -2);
|
||||
this.startDate = initStartDate;
|
||||
console.log(moment(this.startDate).format('YYYY-MM-DD'));
|
||||
},
|
||||
async getExcelDataDown() {
|
||||
try {
|
||||
let response;
|
||||
|
||||
response = await statsApi.bsnmDayListExcel(this.grid.params);
|
||||
|
||||
const result = response.data;
|
||||
if (result != null && result.retCode == "0000") {
|
||||
return result.data;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
}, // end of getExcelDataDown
|
||||
async excelDown() {
|
||||
if (this.$refs.table.getData().length <= 0) {
|
||||
this.row.title = '사업자별 일별통계';
|
||||
this.row.msg1 = '조회된 데이터가 없습니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
|
||||
let today = moment().format('YYYYMMDDHHmmss');
|
||||
const saveFileName = `사업자별 일별통계_${today}.xlsx`;
|
||||
|
||||
const data = await this.getExcelDataDown();
|
||||
let options = {
|
||||
header: this.excelHeader,
|
||||
dataOrder: 'header'
|
||||
};
|
||||
// console.log(data);
|
||||
xlsx.export(data.list, saveFileName, options).then(() => {});
|
||||
},
|
||||
getExcelHeader() {
|
||||
// 헤더를 mockup으로 관리한다.
|
||||
custMgtApi.getExcelHeader(this.pageType).then(res => {
|
||||
this.excelHeader = res;
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -67,7 +67,7 @@
|
||||
<div class="info">
|
||||
<div class="count">집계결과</div>
|
||||
<div class="button_group">
|
||||
<button type="button" class="button blue download">엑셀 다운로드</button>
|
||||
<button type="button" class="button blue download" @click="monthExcelDown();">엑셀 다운로드</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -119,7 +119,7 @@ export default {
|
||||
list:[],
|
||||
totalCnt: '',
|
||||
|
||||
pageType: 'SUBS',
|
||||
pageType: 'BSNM_MONTH',
|
||||
|
||||
// 테이블 리스트 데이터
|
||||
perPageCnt: 50,
|
||||
@@ -248,10 +248,13 @@ export default {
|
||||
},
|
||||
created(){
|
||||
this.setPeriodDay(0);
|
||||
this.getExcelHeader();
|
||||
|
||||
},
|
||||
destroyed() {
|
||||
|
||||
this.grid.params.custNm='';
|
||||
this.grid.params.bizrno='';
|
||||
|
||||
},
|
||||
mounted() {
|
||||
let page = 1;
|
||||
@@ -310,9 +313,10 @@ export default {
|
||||
setPeriodDay(day) {
|
||||
this.periodDay = day;
|
||||
this.endDate = new Date();
|
||||
this.startDate = moment(this.endDate)
|
||||
.subtract(day, 'day')
|
||||
.toDate();
|
||||
// this.startDate = moment(this.endDate)
|
||||
// .subtract(day, 'day')
|
||||
// .toDate();
|
||||
this.initSetStartDate();
|
||||
|
||||
this.closeDate('start');
|
||||
this.closeDate('end');
|
||||
@@ -368,6 +372,54 @@ export default {
|
||||
const getCondition = this.$store.getters['searchcondition/getSearchCondition'];
|
||||
console.log("getCondition : "+ getCondition.perPage);
|
||||
},
|
||||
initSetStartDate(){
|
||||
let initStartDate = new Date();
|
||||
initStartDate.setMonth(Number(moment(initStartDate).format('MM')) -3);
|
||||
this.startDate = initStartDate;
|
||||
console.log(moment(this.startDate).format('YYYY-MM-DD'));
|
||||
},
|
||||
getExcelHeader() {
|
||||
// 헤더를 mockup으로 관리한다.
|
||||
custMgtApi.getExcelHeader(this.pageType).then(res => {
|
||||
this.excelHeader = res;
|
||||
});
|
||||
},
|
||||
async getExcelDataDown() {
|
||||
try {
|
||||
let response;
|
||||
|
||||
response = await statsApi.bsnmMonthListExcel(this.grid.params);
|
||||
|
||||
const result = response.data;
|
||||
console.log(result)
|
||||
if (result != null && result.retCode == "0000") {
|
||||
return result.data;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
}, // end of getExcelDataDown
|
||||
async monthExcelDown() {
|
||||
if (this.$refs.table.getData().length <= 0) {
|
||||
this.row.title = '사업자별 월별통계';
|
||||
this.row.msg1 = '조회된 데이터가 없습니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
|
||||
let today = moment().format('YYYYMMDDHHmmss');
|
||||
const saveFileName = `사업자별 월별통계_${today}.xlsx`;
|
||||
|
||||
const data = await this.getExcelDataDown();
|
||||
let options = {
|
||||
header: this.excelHeader,
|
||||
dataOrder: 'header'
|
||||
};
|
||||
console.log(data);
|
||||
xlsx.export(data.list, saveFileName, options).then(() => {});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -46,7 +46,7 @@
|
||||
<div class="info">
|
||||
<div class="count">집계결과</div>
|
||||
<div class="button_group">
|
||||
<button type="button" class="button blue download">엑셀 다운로드</button>
|
||||
<button type="button" class="button blue download" @click="excelDown();">엑셀 다운로드</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -92,13 +92,13 @@
|
||||
<td>{{ option.sumYmd }}</td>
|
||||
<td>{{ option.sndCnt.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
|
||||
<td>{{ option.succCnt.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}<br>({{ option.succRt }}%)</td>
|
||||
<td>{{ option.sndCntS.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
|
||||
<td>{{ option.sndCntS.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
|
||||
<td>{{ option.succCntS.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}<br>({{ option.succRtS }}%)</td>
|
||||
<td>{{ option.sndCntL.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
|
||||
<td>{{ option.sndCntL.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
|
||||
<td>{{ option.succCntL.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}<br>({{ option.succRtL }}%)</td>
|
||||
<td>{{ option.sndCntM.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
|
||||
<td>{{ option.sndCntM.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
|
||||
<td>{{ option.succCntM.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}<br>({{ option.succRtM }}%)</td>
|
||||
<td>{{ option.sndCntR.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
|
||||
<td>{{ option.sndCntR.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
|
||||
<td>{{ option.succCntR.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}<br>({{ option.succRtR }}%)</td>
|
||||
</tr>
|
||||
|
||||
@@ -132,7 +132,9 @@ export default {
|
||||
startDt:'',
|
||||
endDt:'',
|
||||
|
||||
row: {},
|
||||
pageType:'DAY',
|
||||
|
||||
row: {},
|
||||
list:[],
|
||||
totalCnt: '',
|
||||
};
|
||||
@@ -146,6 +148,7 @@ export default {
|
||||
// this.endDt = moment().format('YYYY-MM-DD');
|
||||
this.setPeriodDay(0);
|
||||
this.getDayList();
|
||||
this.getExcelHeader();
|
||||
},
|
||||
destroyed() {
|
||||
|
||||
@@ -223,9 +226,10 @@ export default {
|
||||
setPeriodDay(day) {
|
||||
this.periodDay = day;
|
||||
this.endDate = new Date();
|
||||
this.startDate = moment(this.endDate)
|
||||
.subtract(day, 'day')
|
||||
.toDate();
|
||||
// this.startDate = moment(this.endDate)
|
||||
// .subtract(day, 'day')
|
||||
// .toDate();
|
||||
this.initSetStartDate();
|
||||
|
||||
this.closeDate('start');
|
||||
this.closeDate('end');
|
||||
@@ -265,7 +269,38 @@ export default {
|
||||
return moment(date).format('YYYY-MM-DD');
|
||||
}
|
||||
},
|
||||
|
||||
initSetStartDate(){
|
||||
let initStartDate = new Date();
|
||||
initStartDate.setMonth(Number(moment(initStartDate).format('MM')) -2);
|
||||
this.startDate = initStartDate;
|
||||
console.log(moment(this.startDate).format('YYYY-MM-DD'));
|
||||
},
|
||||
|
||||
excelDown() {
|
||||
if (this.list.length <= 0) {
|
||||
this.row.title = '일별통계';
|
||||
this.row.msg1 = '조회된 데이터가 없습니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
let today = moment().format('YYYYMMDDHHmmss');
|
||||
const saveFileName = `일별통계_${today}.xlsx`;
|
||||
|
||||
let options = {
|
||||
header: this.excelHeader,
|
||||
dataOrder: 'header'
|
||||
};
|
||||
// console.log(data);
|
||||
xlsx.export(this.list, saveFileName, options).then(() => {});
|
||||
},
|
||||
getExcelHeader() {
|
||||
// 헤더를 mockup으로 관리한다.
|
||||
statsApi.getExcelHeader(this.pageType).then(res => {
|
||||
this.excelHeader = res;
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -52,7 +52,7 @@
|
||||
<div class="info">
|
||||
<div class="count">집계결과</div>
|
||||
<div class="button_group">
|
||||
<button type="button" class="button blue download">엑셀 다운로드</button>
|
||||
<button type="button" class="button blue download" @click="excelDown();">엑셀 다운로드</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -199,9 +199,10 @@ export default {
|
||||
setPeriodDay(day) {
|
||||
this.periodDay = day;
|
||||
this.endDate = new Date();
|
||||
this.startDate = moment(this.endDate)
|
||||
.subtract(day, 'day')
|
||||
.toDate();
|
||||
// this.startDate = moment(this.endDate)
|
||||
// .subtract(day, 'day')
|
||||
// .toDate();
|
||||
this.initSetStartDate();
|
||||
|
||||
this.closeDate('start');
|
||||
this.closeDate('end');
|
||||
@@ -240,6 +241,37 @@ export default {
|
||||
} else {
|
||||
return moment(date).format('YYYY-MM-DD');
|
||||
}
|
||||
},
|
||||
initSetStartDate(){
|
||||
let initStartDate = new Date();
|
||||
initStartDate.setMonth(Number(moment(initStartDate).format('MM')) -3);
|
||||
this.startDate = initStartDate;
|
||||
console.log(moment(this.startDate).format('YYYY-MM-DD'));
|
||||
},
|
||||
excelDown() {
|
||||
if (this.list.length <= 0) {
|
||||
this.row.title = '월별통계';
|
||||
this.row.msg1 = '조회된 데이터가 없습니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
let today = moment().format('YYYYMMDDHHmmss');
|
||||
const saveFileName = `월별통계_${today}.xlsx`;
|
||||
|
||||
let options = {
|
||||
header: this.excelHeader,
|
||||
dataOrder: 'header'
|
||||
};
|
||||
// console.log(data);
|
||||
xlsx.export(this.list, saveFileName, options).then(() => {});
|
||||
},
|
||||
getExcelHeader() {
|
||||
// 헤더를 mockup으로 관리한다.
|
||||
statsApi.getExcelHeader(this.pageType).then(res => {
|
||||
this.excelHeader = res;
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user