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="content admin-style">
<div class="flex mb30">
<div class="gd-6 pl0">
<div class="admin-sec-title point-font2">
<p class="mb10">팝업관리</p>
</div>
<ListTable
:colgroup="colgroup"
:thead="thead"
:tbody="tbody"
:className="'admin-list'"
@listClick="fnPopupViewDetail"
/>
</div>
<div class="gd-6 pr0">
<div class="admin-sec-title point-font2">
<p class="mb10">최근 등록 글</p>
</div>
<ListTable
:colgroup="colgroup2"
:thead="thead2"
:tbody="tbody2"
:className="'admin-list'"
@listClick="fnBbsCnViewDetail"
/>
</div>
</div>
<div class="flex mb15">
<div class="gd-3 pl0">
<div class="box">
<p class="box-title point-font2 mb10">신규회원</p>
<p class="box-content text-rg">{{ cntnStats.newCnt }}</p>
</div>
</div>
<div class="gd-3">
<div class="box">
<p class="box-title point-font2 mb10">오늘 방문자 수</p>
<p class="box-content text-rg">{{ cntnStats.dayCnt }}</p>
</div>
</div>
<div class="gd-3">
<div class="box">
<p class="box-title point-font2 mb10">이번달 방문자 수</p>
<p class="box-content text-rg">{{ cntnStats.mmCnt }}</p>
</div>
</div>
<div class="gd-3 pr0">
<div class="box">
<p class="box-title point-font2 2mb10">총 방문자 수</p>
<p class="box-content text-rg">{{ cntnStats.totalCnt }}</p>
</div>
</div>
</div>
<div class="chart-zone">
<div class="admin-sec-title point-font2">
<p class="mb10">방문자 접속 통계</p>
</div>
<div class="box" style="height: 320px">
<div class="chart-wrap" ref="chartdiv">
<ClusteredColumnChart :chartData="chartData" columnX="date" />
</div>
</div>
</div>
</div>
</template>
<script>
import ListTable from "../../../component/table/ListTable.vue";
import ClusteredColumnChart from "../../../component/chart/ClusteredColumnChart.vue";
import { defaultSearchParams } from "../../../../resources/js/defaultSearchParams";
import queryParams from "../../../../resources/js/queryParams";
import cntnStatsSave from "../../../../resources/js/cntnStatsSave";
// API
import { adminMainProc } from "../../../../resources/api/main";
import { findBySysMenu } from "../../../../resources/api/menu";
const App = {
mixins: [queryParams, cntnStatsSave],
components: {
ListTable: ListTable,
ClusteredColumnChart: ClusteredColumnChart,
},
data: () => {
return {
menuList: [],
resetSearch: { ...defaultSearchParams },
// 팝업관리
colgroup: ["5%", "45%", "12%", "12%", "12%", "12%"],
thead: ["NO", "제목", "사용여부", "시작일", "종료일", "작성자"],
tbody: [],
popupList: [],
// 게시판
colgroup2: ["5%", "75%", "10%", "10%"],
thead2: ["NO", "제목", "작성자", "작성일"],
tbody2: [],
bbsCnList: [],
// 통계
cntnStats: {
newCnt: 0, // 신규회원
dayCnt: 0, // 오늘 방문자 수
mmCnt: 0, // 이번달 방문자 수
totalCnt: 0, // 총 방문자 수
},
chartData: [],
};
},
created() {
this.reSetMenu();
this.fnAdminMain();
this.fnMenuList();
},
methods: {
// 메뉴 초기화
reSetMenu() {
this.$store.commit("setMenu", null);
},
// 전체 조회
async fnAdminMain() {
try {
const response = await adminMainProc();
this.popupList = response.data.data.popupMng;
this.bbsCnList = response.data.data.bbsCnNew;
this.cntnStats["newCnt"] = response.data.data.cntnNewCnt;
this.cntnStats["dayCnt"] = response.data.data.cntnDayCnt;
this.cntnStats["mmCnt"] = response.data.data.cntnMmCnt;
this.cntnStats["totalCnt"] = response.data.data.cntnTotalCnt;
let datas = [];
for (let data of response.data.data.monthCntnStats) {
let newData = {};
newData["date"] = data["dates"];
for (let i = 0; i < data["authrt_nm"].length; i++) {
newData[data["authrt_nm"][i]] = data["cntn_nope"][i];
}
datas.push(newData);
}
this.chartData = datas;
if (response.data.data.popupMng.length > 0) {
this.tbody = [];
this.tbody = this.popupList.map((popup, idx) => ({
id: 5 - idx,
popupTtl: popup.popupTtl,
useYn:
popup.popupUseYn == "Y"
? "사용"
: popup.popupUseYn == "N"
? "미사용"
: null,
bgngDt: popup.bgngDt,
endDt: popup.endDt,
mbrNm: popup.mbrNm,
}));
}
if (response.data.data.bbsCnNew.length > 0) {
this.tbody2 = [];
this.tbody2 = this.bbsCnList.map((bbsCn, idx) => ({
id: 5 - idx,
bbsNm: bbsCn.bbsNm,
rgtrNm: bbsCn.rgtrNm,
regDt: bbsCn.regDt,
}));
}
} catch (error) {
// alert("에러가 발생했습니다.\n시스템관리자에게 문의하세요.");
}
},
// 메뉴 조회
async fnMenuList() {
try {
const params = {
roles: this.$store.state.roles.map((auth) => auth.authority),
menuType: this.$store.state.userType,
};
const response = await findBySysMenu(params);
if (response.status == 200) {
this.menuList = response.data.data.menuList;
}
} catch (error) {
// alert("에러가 발생했습니다.\n시스템관리자에게 문의하세요.");
alert(this.$getCmmnMessage('err005'));
}
},
// 팝업 최신글 상세 보기
async fnPopupViewDetail(idx) {
this.saveQueryParams("queryParams", this.resetSearch);
this.$store.commit(
"setMenu",
this.findMenu(this.menuList, "MENU_000000000000012")
);
await this.cntnStatsSave("MENU_000000000000034");
this.$router.push({
name: "admPopupManagementSelectOne",
query: {
pageId: this.popupList[idx]["popupId"],
},
});
},
// 게시판 최신글 상세 보기
async fnBbsCnViewDetail(idx) {
this.saveQueryParams("queryParams", this.resetSearch);
this.$store.commit(
"setMenu",
this.findMenu(this.menuList, "MENU_000000000000058")
);
for (let menu of depth1.childList) {
if (menu.menuTypeCtgry == this.bbsCnList[idx]["bbsMngId"]) {
await this.cntnStatsSave(menu.menuId);
}
}
this.$router.push({
path: "/kdm/" + this.bbsCnList[idx]["bbsMngId"] + "/view.page",
query: {
pageId: this.bbsCnList[idx]["bbsId"],
},
});
},
// 메뉴 정보 찾기
findMenu(menuList, menuId) {
for (let menu of menuList) {
if (menu.menuId == menuId) {
return menu;
}
}
},
},
};
export default App;
</script>./Test.vue