배치 상세조회 시 이전 데이터 가져오는 부분 수정

This commit is contained in:
Leeminha
2022-11-08 18:40:30 +09:00
parent ebfc6d85d0
commit 49a9f9e90b
4 changed files with 48 additions and 30 deletions

View File

@@ -9,7 +9,7 @@
<div class="search_wrap">
<div class="group">
<h3>
<label for="right" class="label">배치 ID | {{ this.batchId}} </label>
<label for="right" class="label">배치 ID | {{ this.batchId }} </label>
</h3>
</div>
<div class="group">
@@ -121,6 +121,7 @@ export default {
pageType: 'CALC',
batchId : this.$route.params.batchId,
batchNm : this.$route.params.batchNm,
//상태조회
sttusCd: '',
@@ -167,21 +168,30 @@ export default {
created(){
this.setPeriodDay(0);
this.setCodeData();
if(this.$route.params.batchId != null){
console.log("스토어저장")
this.$store.commit('dataStore/updateDataStore', this.$route.params.batchId);
} else {
var batchId2 = this.$store.getters['dataStore/getDataStore'];
this.batchId = batchId2;
}
// if(this.$route.params.batchId != null){
// this.$store.commit('dataStore/updateDataStore', this.$route.params.batchId);
// } else {
// var batchId2 = this.$store.getters['dataStore/getDataStore'];
// this.batchId = batchId2;
// }
},
destroyed() {
this.$store.commit('dataStore/updateDataStore', '');
// this.$store.commit('dataStore/updateDataStore', '');
this.$store.commit('searchcondition/updateSearchCondition', {
page: 1,
perPage: 50,
params: {
startDt: '',
endDt: ''
}
});
},
mounted(){
let page = 1;
// 페이지 정보 및 검색 조건
const getCondition = this.$store.getters['searchcondition/getSearchCondition'];
// store에 저장된 페이지 정보 및 검색 조건을 불러오기
let isKeep = false;
if (getCondition) {
this.grid.pagePerRows = getCondition.perPage;
@@ -191,31 +201,29 @@ export default {
}
this.search(isKeep);
},
beforeRouteLeave(to, from, next) {
// beforeRouteLeave(to, from, next) {
const getP = this.$refs.table.getPagination();
this.$store.commit('searchcondition/updateSearchCondition', {
page: getP._currentPage,
perPage: this.perPageCnt,
params: this.grid.params
});
// 라우트 하기전 실행
next();
},
// const getP = this.$refs.table.getPagination();
// this.$store.commit('searchcondition/updateSearchCondition', {
// page: getP._currentPage,
// perPage: this.perPageCnt,
// params: this.grid.params
// });
// // 라우트 하기전 실행
// next();
// },
methods: {
search: function (isKeep) {
this.$refs.table.search(this.grid.params, isKeep);
this.grid.params = {
startDt: moment(this.startDate).format('YYYYMMDD'),
endDt: moment(this.endDate).format('YYYYMMDD'),
batchId: this.batchId,
sttusCd: this.sttusCd
}
this.$refs.table.search(this.grid.params, isKeep);
this.sendStoreData();
//this.sendStoreData();
},
changePerPage: function () { // 페이지당 조회할 개수
this.grid.pagePerRows = this.perPageCnt;

View File

@@ -69,9 +69,9 @@ export default {
{name: 'batchId', header:'배치ID', align:'center', width:'8%'},
{name: 'batchCycle', header:'실행일자',align:'center', width:'8%'},
{name: 'batchTime', header:'실행시간',align:'center', width:'7%'},
{name: 'regDt', header:'배치 수행시간',align:'center', width:'20%'},
{name: 'sttusCd', header:'상태',align:'center', width:'5%'},
{name: 'errMsg', header:'메시지',align:'left', width:'30%'}
{name: 'regDt', header:'배치 수행시간',align:'center', width:'14%'},
{name: 'sttusCd', header:'상태',align:'center', width:'10%'},
{name: 'errMsg', header:'메시지',align:'left', width:'36%'}
]
}
};
@@ -81,7 +81,17 @@ export default {
},
created(){
const getCondition = this.$store.getters['searchcondition/getSearchCondition'];
},
destroyed() {
// this.$store.commit('dataStore/updateDataStore', '');
this.$store.commit('searchcondition/updateSearchCondition', {
page: 1,
perPage: 50,
params: {
startDt: '',
endDt: ''
}
});
},
mounted(){
let page = 1;
@@ -103,7 +113,7 @@ export default {
},
batchDetail(props){
this.row.batchId = props.batchId;
this.$router.push({name: 'batchDetail', params: this.row});
this.$router.push({path: `/sysMgt/batchDetail/${props.batchId}`, params: this.row});
},
sendStoreData: function () {
const getP = this.$refs.table.getPagination();