mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-07 05:12:34 +09:00
공지사항 삭제 기능 추가
This commit is contained in:
@@ -45,6 +45,7 @@
|
||||
</div>
|
||||
<div class="button_group">
|
||||
<button type="button" class="button blue admin add" @click="ModalOpen()">공지사항 등록</button>
|
||||
<button type="button" class="button white del" @click="deleteNotice()">삭제</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table">
|
||||
@@ -65,13 +66,16 @@
|
||||
</div>
|
||||
<NoticePop ref="NoticePop" />
|
||||
<NoticeUpdatePop ref="NoticeUpdatePop" />
|
||||
<common-modal ref="commmonModal"></common-modal>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import httpClient from '../../../common/http-client';
|
||||
import customGrid from '@/components/CustomGrid';
|
||||
import commonModal from '@/components/modal/commonModal';
|
||||
import NoticePop from '../components/NoticePop.vue';
|
||||
import NoticeUpdatePop from '../components/NoticeUpdatePop.vue';
|
||||
import homeMgtApi from '../service/homeMgtApi';
|
||||
|
||||
class CustomATagRenderer {
|
||||
constructor(props) {
|
||||
@@ -98,9 +102,10 @@ class CustomATagRenderer {
|
||||
|
||||
export default {
|
||||
name: 'notice',
|
||||
components: { customGrid, NoticePop, NoticeUpdatePop },
|
||||
components: { customGrid, NoticePop, NoticeUpdatePop, commonModal },
|
||||
data() {
|
||||
return {
|
||||
row: {},
|
||||
totalItems: 0,
|
||||
perPageCnt: 50,
|
||||
searchType1: '',
|
||||
@@ -214,6 +219,48 @@ export default {
|
||||
this.grid.pagePerRows = this.perPageCnt;
|
||||
this.search(true);
|
||||
},
|
||||
deleteNotice() {
|
||||
var chkList = this.$refs.table.checkedElementDatas();
|
||||
if (chkList.length == 0) {
|
||||
this.row.title = '공지사항 관리';
|
||||
this.row.msg1 = '삭제 대상을 체크를 해주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
//const param = chkList.map((row)=>({regReqNo:row.regReqNo} ));
|
||||
const param = chkList.map((row) => ({ ntNo: row.ntNo }));
|
||||
this.row.list = param;
|
||||
|
||||
this.row.title = '공지사항 관리';
|
||||
this.row.msg1 = '삭제 하시겠습니까?';
|
||||
this.$refs.commmonModal.confirmModalOpen2(this.row);
|
||||
|
||||
console.log(typeof this.row.list[0].ntNo);
|
||||
//this.$refs.commmonModal.confirmModalOpen2(this.row);
|
||||
},
|
||||
confirmCalbackFnc(props) {
|
||||
if (props.result) {
|
||||
this.noticeDelete();
|
||||
}
|
||||
},
|
||||
async noticeDelete() {
|
||||
try {
|
||||
let response = await homeMgtApi.deleteNotice(this.row);
|
||||
const result = response.data;
|
||||
if (result != null && result.retCode == '0000') {
|
||||
this.$refs.table.reloadData();
|
||||
return;
|
||||
} else {
|
||||
this.row.title = '공지사항 관리';
|
||||
this.row.msg1 = '실패 하였습니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
}
|
||||
} catch (err) {
|
||||
this.row.title = '공지사항 관리';
|
||||
this.row.msg1 = '실패 하였습니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user