mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-06 19:09:49 +09:00
vue 수정완료
This commit is contained in:
@@ -14,7 +14,9 @@
|
|||||||
<vuejs-datepicker
|
<vuejs-datepicker
|
||||||
:language="ko"
|
:language="ko"
|
||||||
:format="customFormatter"
|
:format="customFormatter"
|
||||||
|
:disabled-dates="disabledSDate"
|
||||||
v-model="startDate"
|
v-model="startDate"
|
||||||
|
@closed="closeDate('start')"
|
||||||
></vuejs-datepicker>
|
></vuejs-datepicker>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -71,7 +73,6 @@ import moment from 'moment';
|
|||||||
import VueTimepicker from 'vue2-timepicker';
|
import VueTimepicker from 'vue2-timepicker';
|
||||||
import 'vue2-timepicker/dist/VueTimepicker.css'
|
import 'vue2-timepicker/dist/VueTimepicker.css'
|
||||||
import sysMgtApi from '../service/sysMgtApi'
|
import sysMgtApi from '../service/sysMgtApi'
|
||||||
// import CommonModal from '../components/modal/commonModal';
|
|
||||||
import CommonModal from '../components/commonModal.vue';
|
import CommonModal from '../components/commonModal.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -81,8 +82,11 @@ export default {
|
|||||||
isFocused: false,
|
isFocused: false,
|
||||||
//날짜 조회
|
//날짜 조회
|
||||||
ko: vdp_translation_ko.js,
|
ko: vdp_translation_ko.js,
|
||||||
|
periodDay: 7,
|
||||||
sDateDiv: 'day',
|
sDateDiv: 'day',
|
||||||
startDate: new Date(),
|
startDate: new Date(),
|
||||||
|
disabledSDate: '',
|
||||||
|
startDateOptions: {disabledDate: this.disabledStDate},
|
||||||
totalItems: 0,
|
totalItems: 0,
|
||||||
row: {},
|
row: {},
|
||||||
grid: {
|
grid: {
|
||||||
@@ -110,8 +114,12 @@ export default {
|
|||||||
},
|
},
|
||||||
startTime : '',
|
startTime : '',
|
||||||
endTime : '',
|
endTime : '',
|
||||||
state: '',
|
state: 'USE',
|
||||||
|
startDate2 :'',
|
||||||
|
startTimeT2: '',
|
||||||
|
startTimeM2: '',
|
||||||
|
endTimeT2 : '',
|
||||||
|
endTimeM2: '',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -122,6 +130,7 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.setPeriodDay(0);
|
||||||
},
|
},
|
||||||
destroyed() {
|
destroyed() {
|
||||||
this.$store.commit('searchcondition/updateSearchCondition', {
|
this.$store.commit('searchcondition/updateSearchCondition', {
|
||||||
@@ -148,11 +157,6 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
fnSaveTxt(){
|
fnSaveTxt(){
|
||||||
if (this.state == 'NOTUSE') {
|
|
||||||
this.row.title = '서비스 점검 설정';
|
|
||||||
this.row.msg1 = '저장 하시겠습니까?';
|
|
||||||
this.$refs.commonModal.confirmModalOpen(this.row);
|
|
||||||
}
|
|
||||||
let params = {
|
let params = {
|
||||||
startDate : moment(this.startDate).format('YYYY-MM-DD'),
|
startDate : moment(this.startDate).format('YYYY-MM-DD'),
|
||||||
startTimeT : '',
|
startTimeT : '',
|
||||||
@@ -161,6 +165,13 @@ export default {
|
|||||||
endTimeM : '',
|
endTimeM : '',
|
||||||
state : this.state,
|
state : this.state,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.startDate2 = moment(this.startDate).format('YYYY-MM-DD');
|
||||||
|
this.startTimeT2 = moment(this.startTime, 'HH:mm').format('HH');
|
||||||
|
this.startTimeM2 = moment(this.startTime, 'HH:mm').format('mm');
|
||||||
|
this.endTimeT2 = moment(this.endTime, 'HH:mm').format('HH');
|
||||||
|
this.endTimeM2 = moment(this.endTime, 'HH:mm').format('mm');
|
||||||
|
|
||||||
if (this.startTime) {
|
if (this.startTime) {
|
||||||
params.startTimeT = moment(this.startTime, 'HH:mm').format('HH');
|
params.startTimeT = moment(this.startTime, 'HH:mm').format('HH');
|
||||||
params.startTimeM = moment(this.startTime, 'HH:mm').format('mm');
|
params.startTimeM = moment(this.startTime, 'HH:mm').format('mm');
|
||||||
@@ -169,19 +180,77 @@ export default {
|
|||||||
params.endTimeT = moment(this.endTime, 'HH:mm').format('HH');
|
params.endTimeT = moment(this.endTime, 'HH:mm').format('HH');
|
||||||
params.endTimeM = moment(this.endTime, 'HH:mm').format('mm');
|
params.endTimeM = moment(this.endTime, 'HH:mm').format('mm');
|
||||||
}
|
}
|
||||||
sysMgtApi.setWorkState(params).then((respose) => {
|
if(params.startTimeT == ''){
|
||||||
var result = respose.data;
|
this.row.title = '서비스 점검 설정';
|
||||||
if (result != null && result.retCode == "0000"){
|
this.row.msg1 = '시작시간을 설정해 주세요 ';
|
||||||
// 저장이 완료된 후에 테이블 다시 로드
|
this.$refs.commonModal.alertSysModalOpen(this.row);
|
||||||
this.toComplete();
|
return false;
|
||||||
}
|
}
|
||||||
});
|
if(params.startTimeM== ''){
|
||||||
|
this.row.title = '서비스 점검 설정';
|
||||||
|
this.row.msg1 = '시작시간을 설정해 주세요 ';
|
||||||
|
this.$refs.commonModal.alertSysModalOpen(this.row);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(params.endTimeT== ''){
|
||||||
|
this.row.title = '서비스 점검 설정';
|
||||||
|
this.row.msg1 = '종료시간을 설정해 주세요 ';
|
||||||
|
this.$refs.commonModal.alertSysModalOpen(this.row);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(params.endTimeM== ''){
|
||||||
|
this.row.title = '서비스 점검 설정';
|
||||||
|
this.row.msg1 = '종료시간을 설정해 주세요 ';
|
||||||
|
this.$refs.commonModal.alertSysModalOpen(this.row);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 사용 && 점검중 선택
|
||||||
|
if (this.state == 'NOTUSE') {
|
||||||
|
this.row.title = '서비스 점검 설정';
|
||||||
|
this.row.msg1 = '저장 하시겠습니까?';
|
||||||
|
this.$refs.commonModal.confirmModalOpen(this.row);
|
||||||
|
}else{
|
||||||
|
this.setState(params);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
toComplete(){
|
|
||||||
this.$refs.table.reloadData();
|
async setState(){
|
||||||
// this.confirmCalbackFnc();
|
let params = {
|
||||||
},
|
startDate : this.startDate2,
|
||||||
|
startTimeT : this.startTimeT2,
|
||||||
|
startTimeM : this.startTimeM2,
|
||||||
|
endTimeT : this.endTimeT2,
|
||||||
|
endTimeM : this.endTimeM2,
|
||||||
|
state : this.state,
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
let response = await sysMgtApi.setWorkState(params);
|
||||||
|
const result = response.data;
|
||||||
|
if (result != null && result.retCode == "0000"){
|
||||||
|
// 저장이 완료된 후에 테이블 다시 로드
|
||||||
|
this.$refs.table.reloadData();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
this.row.title = '서비스 점검 설정';
|
||||||
|
this.row.msg1 = '실패 하였습니다.';
|
||||||
|
this.$refs.commonModal.alertSysModalOpen(this.row);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
this.row.title = '서비스 점검 설정';
|
||||||
|
this.row.msg1 = '실패 하였습니다.';
|
||||||
|
this.$refs.commonModal.alertSysModalOpen(this.row);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
confirmCalbackFnc(props) {
|
||||||
|
if (props.result) {
|
||||||
|
this.setState();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
search: function (isKeep) {
|
search: function (isKeep) {
|
||||||
this.$refs.table.search(this.grid.params, isKeep);
|
this.$refs.table.search(this.grid.params, isKeep);
|
||||||
const getP = this.$refs.table.getPagination();
|
const getP = this.$refs.table.getPagination();
|
||||||
@@ -209,7 +278,12 @@ export default {
|
|||||||
|
|
||||||
const getCondition = this.$store.getters['searchcondition/getSearchCondition'];
|
const getCondition = this.$store.getters['searchcondition/getSearchCondition'];
|
||||||
},
|
},
|
||||||
|
setPeriodDay(day) {
|
||||||
|
this.periodDay = day;
|
||||||
|
this.initSetStartDate();
|
||||||
|
this.initSetEndDate();
|
||||||
|
this.closeDate('start');
|
||||||
|
},
|
||||||
customFormatter: function (date) {
|
customFormatter: function (date) {
|
||||||
if (this.sDateDiv == 'month') {
|
if (this.sDateDiv == 'month') {
|
||||||
return moment(date).format('YYYY-MM');
|
return moment(date).format('YYYY-MM');
|
||||||
@@ -219,6 +293,31 @@ export default {
|
|||||||
return moment(date).format('YYYY-MM-DD');
|
return moment(date).format('YYYY-MM-DD');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
closeDate(type){
|
||||||
|
if (type != undefined && type != null){
|
||||||
|
let initStartDate = new Date();
|
||||||
|
let initEndDate = new Date();
|
||||||
|
initStartDate.setDate(Number(moment(initStartDate).format('DD'))+365 );
|
||||||
|
initEndDate.setDate(Number(moment(initEndDate).format('DD')) -1)
|
||||||
|
|
||||||
|
this.disabledSDate = {to: initEndDate, from: initStartDate};
|
||||||
|
if (this.startDate !== initStartDate) {
|
||||||
|
this.disabledSDate = {to: initEndDate, from: initStartDate};
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
initSetStartDate() {
|
||||||
|
let initStartDate = new Date();
|
||||||
|
initStartDate.setDate(Number(moment(initStartDate).format('DD'))+365 );
|
||||||
|
this.startDate = initStartDate;
|
||||||
|
},
|
||||||
|
initSetEndDate(){
|
||||||
|
let initEndDate = new Date();
|
||||||
|
initEndDate.setDate(Number(moment(initEndDate).format('DD')) )
|
||||||
|
this.startDate = initEndDate;
|
||||||
|
},
|
||||||
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', {
|
||||||
@@ -227,10 +326,7 @@ export default {
|
|||||||
// 라우트 하기전 실행
|
// 라우트 하기전 실행
|
||||||
next();
|
next();
|
||||||
},
|
},
|
||||||
confirmCalbackFnc(props) {
|
|
||||||
// if (props.result) {
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -648,21 +648,17 @@ public class SysMgtService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public SvcCheckListResDto svcCheckLists(@Valid SvcCheckListReqDto svcCheckListReqDto) {
|
public SvcCheckListResDto svcCheckLists(@Valid SvcCheckListReqDto svcCheckListReqDto) {
|
||||||
SysMgtMapper sysmgtmapper = sqlSessionSlave.getMapper(SysMgtMapper.class);
|
|
||||||
|
|
||||||
String workStateData = "";
|
String workStateData = "";
|
||||||
// log.debug("1번 ={}",workStateData);
|
|
||||||
String [] workStateDataArr = new String[7];
|
String [] workStateDataArr = new String[7];
|
||||||
log.info("getWorkStateCheck START ==========================================");
|
log.info("getWorkStateCheck START ==========================================");
|
||||||
|
|
||||||
//CheckList >= svcCheckList
|
|
||||||
SvcCheckListRes svcCheckListRes = new SvcCheckListRes();
|
SvcCheckListRes svcCheckListRes = new SvcCheckListRes();
|
||||||
List<SvcCheckList> CheckList = new ArrayList<SvcCheckList>();
|
List<SvcCheckList> CheckList = new ArrayList<SvcCheckList>();
|
||||||
SvcCheckList svcCheckList = new SvcCheckList();
|
SvcCheckList svcCheckList = new SvcCheckList();
|
||||||
|
|
||||||
String nowPage = String.valueOf(svcCheckListReqDto.getPage());
|
String nowPage = String.valueOf(svcCheckListReqDto.getPage());
|
||||||
int totalCnt = 0;
|
int totalCnt = 0;
|
||||||
// sysmgtmapper.svcCheckListSelectCnt(svcCheckListReqDto);
|
|
||||||
File fileList = new File("C:\\efs\\admin\\workState\\workStatefile.txt");
|
File fileList = new File("C:\\efs\\admin\\workState\\workStatefile.txt");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -699,14 +695,11 @@ public class SysMgtService {
|
|||||||
svcCheckList.setStrHd(StrHd);
|
svcCheckList.setStrHd(StrHd);
|
||||||
String EndHd = svcCheckList.getEndHour()+" : "+ svcCheckList.getEndMin();
|
String EndHd = svcCheckList.getEndHour()+" : "+ svcCheckList.getEndMin();
|
||||||
svcCheckList.setEndHd(EndHd);
|
svcCheckList.setEndHd(EndHd);
|
||||||
// log.debug("2번 ={}",svcCheckList);
|
|
||||||
// 리스트에 항목 추가
|
// 리스트에 항목 추가
|
||||||
CheckList.add(svcCheckList);
|
CheckList.add(svcCheckList);
|
||||||
// log.debug("3번 ={}",CheckList.get(i));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
svcCheckListRes.setList(CheckList);
|
svcCheckListRes.setList(CheckList);
|
||||||
// log.debug("4번 ={}",svcCheckListRes.getList());
|
|
||||||
totalCnt = CheckList.size();
|
totalCnt = CheckList.size();
|
||||||
int page = svcCheckListReqDto.getPage();
|
int page = svcCheckListReqDto.getPage();
|
||||||
int pagePerRows = svcCheckListReqDto.getPagePerRows();
|
int pagePerRows = svcCheckListReqDto.getPagePerRows();
|
||||||
@@ -720,7 +713,6 @@ public class SysMgtService {
|
|||||||
// 파일 읽기 실패 시 "USE"로 설정하고 결과 반환
|
// 파일 읽기 실패 시 "USE"로 설정하고 결과 반환
|
||||||
log.error("WORK STATE READ FAIL : {}",e.getMessage(), e);
|
log.error("WORK STATE READ FAIL : {}",e.getMessage(), e);
|
||||||
svcCheckList.setWorkState("USE");
|
svcCheckList.setWorkState("USE");
|
||||||
// log.debug("5번 ={}",svcCheckList.getWorkState());
|
|
||||||
|
|
||||||
String[] Data = workStateData.split(",");
|
String[] Data = workStateData.split(",");
|
||||||
totalCnt = CheckList.size();
|
totalCnt = CheckList.size();
|
||||||
@@ -743,7 +735,6 @@ public class SysMgtService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// CheckList = sysmgtmapper.svcCheckListSelect(svcCheckListReqDto);
|
|
||||||
svcCheckListRes.setList(CheckList);
|
svcCheckListRes.setList(CheckList);
|
||||||
Paging paging = new Paging();
|
Paging paging = new Paging();
|
||||||
paging.setPage(nowPage);
|
paging.setPage(nowPage);
|
||||||
|
|||||||
Reference in New Issue
Block a user