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

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

@@ -38,7 +38,7 @@ export default [
meta: { public: false } meta: { public: false }
}, },
{ {
path: '/sysMgt/batchDetail', path: '/sysMgt/batchDetail/:batchId',
component: BatchDetail, component: BatchDetail,
name: 'batchDetail', name: 'batchDetail',
meta: { public: false } meta: { public: false }

View File

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

View File

@@ -69,9 +69,9 @@ export default {
{name: 'batchId', header:'배치ID', align:'center', width:'8%'}, {name: 'batchId', header:'배치ID', align:'center', width:'8%'},
{name: 'batchCycle', header:'실행일자',align:'center', width:'8%'}, {name: 'batchCycle', header:'실행일자',align:'center', width:'8%'},
{name: 'batchTime', header:'실행시간',align:'center', width:'7%'}, {name: 'batchTime', header:'실행시간',align:'center', width:'7%'},
{name: 'regDt', header:'배치 수행시간',align:'center', width:'20%'}, {name: 'regDt', header:'배치 수행시간',align:'center', width:'14%'},
{name: 'sttusCd', header:'상태',align:'center', width:'5%'}, {name: 'sttusCd', header:'상태',align:'center', width:'10%'},
{name: 'errMsg', header:'메시지',align:'left', width:'30%'} {name: 'errMsg', header:'메시지',align:'left', width:'36%'}
] ]
} }
}; };
@@ -81,7 +81,17 @@ export default {
}, },
created(){ created(){
const getCondition = this.$store.getters['searchcondition/getSearchCondition']; 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(){ mounted(){
let page = 1; let page = 1;
@@ -103,7 +113,7 @@ export default {
}, },
batchDetail(props){ batchDetail(props){
this.row.batchId = props.batchId; 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 () { sendStoreData: function () {
const getP = this.$refs.table.getPagination(); const getP = this.$refs.table.getPagination();

View File

@@ -176,7 +176,7 @@ router.beforeEach((to, from, next) => {
nextUrl == '/sysMgt/authAdd' || nextUrl == '/sysMgt/authAdd' ||
nextUrl == '/sysMgt/authModify' || nextUrl == '/sysMgt/authModify' ||
nextUrl == '/sysMgt/authModify' || nextUrl == '/sysMgt/authModify' ||
nextUrl == '/sysMgt/batchDetail' nextUrl.indexOf('/sysMgt/batchDetail') > -1
) { ) {
for (var i = 0; i < menuUrls.length; i++) { for (var i = 0; i < menuUrls.length; i++) {
if (menuUrls[i] == '/sysMgt/authList') { if (menuUrls[i] == '/sysMgt/authList') {