
File name
Commit message
Commit date
05-22
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
<template>
<div class="search-wrap">
<div></div>
<div class="search-bar border">
<select class="form-select sm border-none" v-model="search['searchType']">
<option value="">전체</option>
<option value="popup_ttl">제목</option>
<option value="mbr_nm">작성자</option>
</select>
<input
type="text"
class="form-control sm border-none"
v-model="search['searchText']"
v-on:keyup.enter="fnViewList"
placeholder="검색어를 입력하세요."
/>
<button class="btn-ico xsm ico-sch" @click="fnViewList">
<span class="sr-only">검색</span>
</button>
</div>
</div>
<div class="content-zone">
<div class="content">
<div class="scroll">
<div class="tbl-wrap">
<ListTable
:className="'data cursor'"
:colgroup="colgroup"
:thead="thead"
:tbody="tbody"
@listClick="fnViewDetail"
/>
</div>
</div>
</div>
</div>
<div class="btn-wrap list">
<div></div>
<PaginationButton
:className="'admin-pagination'"
v-model:currentPage="search['currentPage']"
:pagination="search"
:click="fnViewList"
/>
<button
class="btn sm main"
@click="fnInsert"
v-if="pageAuth.regAuthrt == 'Y'"
>
등록
</button>
</div>
</template>
<script>
import ListTable from "../../../component/table/ListTable.vue";
import PaginationButton from "../../../component/pagination/PaginationButton.vue";
import { toRaw } from "vue";
import queryParams from "../../../../resources/js/queryParams";
import { defaultSearchParams } from "../../../../resources/js/defaultSearchParams";
// API
import { listProc } from "../../../../resources/api/popup";
export default {
mixins: [queryParams],
components: {
ListTable: ListTable,
PaginationButton: PaginationButton,
},
data() {
return {
// 페이지 권한 객체
pageAuth: JSON.parse(localStorage.getItem("vuex")).pageAuth,
colgroup: ["5%", "40%", "10%", "15%", "15%", "15%"],
thead: ["NO", "제목", "사용여부", "시작일", "종료일", "작성자"],
tbody: [],
search: { ...defaultSearchParams },
list: [],
};
},
created() {
this.resotreQueryParams("queryParams");
this.fnViewList();
},
methods: {
// 등록
fnInsert() {
this.$router.push({ name: "admPopupManagementInsert" });
},
// 조회(목록)
fnViewList() {
let data = this.search;
this.axiosViewList(data);
},
// 조회(상세)
fnViewDetail(idx) {
this.saveQueryParams("queryParams", this.search); // 검색조건 저장
this.$router.push({
name: "admPopupManagementSelectOne",
query: {
pageId: this.list[idx]["popupId"],
},
});
},
// tbody 생성
makeTbody() {
this.tbody = [];
this.tbody = this.list.map((popup, idx) => ({
id:
this.search.totalRecordCount -
idx -
(this.search.currentPage - 1) * this.search.recordSize,
popupTtl: popup.popupTtl,
useYn:
popup.popupUseYn == "Y"
? "사용"
: popup.popupUseYn == "N"
? "미사용"
: null,
bgngDt: popup.bgngDt,
endDt: popup.endDt,
mbrNm: popup.mbrNm,
}));
},
//─────axios─────┐
// 목록 조회
async axiosViewList(data) {
try {
const response = await listProc(toRaw(data));
this.list = response.data.data.list;
this.search = response.data.data.pagination;
this.makeTbody();
} catch (error) {
const errorData = error.response.data;
if (errorData.message != null && errorData.message != "") {
alert(error.response.data.message);
} else {
alert("에러가 발생했습니다.\n관리자에게 문의해주세요.");
}
}
},
//─────axios─────┘
},
watch: {},
computed: {},
mounted() {},
};
</script>