Compare commits
46 Commits
065c081a85
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| b801552839 | |||
| 3169055646 | |||
| 5d2e1918d1 | |||
| 4407fdc6b6 | |||
| b01c5cd410 | |||
| 63b3704e89 | |||
| f78a4912a6 | |||
| e25bcdc86e | |||
| 5143b45610 | |||
| f4b629df52 | |||
| 2ba8594e6b | |||
| d3470e3d03 | |||
| 99943c0b19 | |||
| 26114c9a9b | |||
| 952701f68b | |||
| 7041d4a649 | |||
| 7fa9abcad4 | |||
| 943b146496 | |||
| 88585c1b24 | |||
| 991462c0d7 | |||
| bab594918e | |||
| c4099c0cf0 | |||
| 0d8fb7b327 | |||
| d4db33bcf0 | |||
| 38dac99278 | |||
| 28094e1c48 | |||
| 67c048a11d | |||
| f6a0319701 | |||
| 0368bf77e7 | |||
| b2b579ead1 | |||
| 495243a1a3 | |||
| 7993f37e26 | |||
| 93a7c087e1 | |||
| 38fa323db6 | |||
| 6f9f0307ac | |||
| dc7934d906 | |||
| 9d06246aba | |||
| 1532793cc1 | |||
| 64bf449de7 | |||
| 9be5bb388a | |||
| d219a128bc | |||
| ce2f3db35c | |||
| b5efab7755 | |||
| 1cc20b65e2 | |||
| 0b85232969 | |||
| 4291d7976c |
@@ -3,6 +3,10 @@ server {
|
|||||||
listen [::]:8080;
|
listen [::]:8080;
|
||||||
server_name localhost;
|
server_name localhost;
|
||||||
|
|
||||||
|
client_max_body_size 100M;
|
||||||
|
client_body_timeout 300s;
|
||||||
|
client_header_timeout 300s;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
root /usr/share/nginx/admintool;
|
root /usr/share/nginx/admintool;
|
||||||
index index.html index.htm;
|
index index.html index.htm;
|
||||||
@@ -16,6 +20,11 @@ server {
|
|||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
|
||||||
|
proxy_connect_timeout 300s;
|
||||||
|
proxy_send_timeout 300s;
|
||||||
|
proxy_read_timeout 300s;
|
||||||
|
proxy_request_buffering off;
|
||||||
}
|
}
|
||||||
|
|
||||||
error_page 500 502 503 504 /50x.html;
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
|||||||
@@ -3,6 +3,10 @@ server {
|
|||||||
listen [::]:8080;
|
listen [::]:8080;
|
||||||
server_name localhost;
|
server_name localhost;
|
||||||
|
|
||||||
|
client_max_body_size 100M;
|
||||||
|
client_body_timeout 300s;
|
||||||
|
client_header_timeout 300s;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
root /usr/share/nginx/admintool;
|
root /usr/share/nginx/admintool;
|
||||||
index index.html index.htm;
|
index index.html index.htm;
|
||||||
@@ -16,6 +20,11 @@ server {
|
|||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
|
||||||
|
proxy_connect_timeout 300s;
|
||||||
|
proxy_send_timeout 300s;
|
||||||
|
proxy_read_timeout 300s;
|
||||||
|
proxy_request_buffering off;
|
||||||
}
|
}
|
||||||
|
|
||||||
error_page 500 502 503 504 /50x.html;
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
|||||||
@@ -3,6 +3,10 @@ server {
|
|||||||
listen [::]:8080;
|
listen [::]:8080;
|
||||||
server_name localhost;
|
server_name localhost;
|
||||||
|
|
||||||
|
client_max_body_size 100M;
|
||||||
|
client_body_timeout 300s;
|
||||||
|
client_header_timeout 300s;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
root /usr/share/nginx/admintool;
|
root /usr/share/nginx/admintool;
|
||||||
index index.html index.htm;
|
index index.html index.htm;
|
||||||
@@ -11,11 +15,16 @@ server {
|
|||||||
|
|
||||||
# api reverse proxy
|
# api reverse proxy
|
||||||
location /api/ {
|
location /api/ {
|
||||||
proxy_pass http://172.40.129.180:23450;
|
proxy_pass http://172.24.128.231:23450;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
|
||||||
|
proxy_connect_timeout 300s;
|
||||||
|
proxy_send_timeout 300s;
|
||||||
|
proxy_read_timeout 300s;
|
||||||
|
proxy_request_buffering off;
|
||||||
}
|
}
|
||||||
|
|
||||||
error_page 500 502 503 504 /50x.html;
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
|||||||
@@ -3,6 +3,10 @@ server {
|
|||||||
listen [::]:8080;
|
listen [::]:8080;
|
||||||
server_name localhost;
|
server_name localhost;
|
||||||
|
|
||||||
|
client_max_body_size 100M;
|
||||||
|
client_body_timeout 300s;
|
||||||
|
client_header_timeout 300s;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
root /usr/share/nginx/admintool;
|
root /usr/share/nginx/admintool;
|
||||||
index index.html index.htm;
|
index index.html index.htm;
|
||||||
@@ -16,6 +20,11 @@ server {
|
|||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
|
||||||
|
proxy_connect_timeout 300s;
|
||||||
|
proxy_send_timeout 300s;
|
||||||
|
proxy_read_timeout 300s;
|
||||||
|
proxy_request_buffering off;
|
||||||
}
|
}
|
||||||
|
|
||||||
error_page 500 502 503 504 /50x.html;
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
|||||||
1744
package-lock.json
generated
1744
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -3,13 +3,17 @@
|
|||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@ant-design/icons": "^5.6.1",
|
||||||
"@hookform/resolvers": "^3.2.0",
|
"@hookform/resolvers": "^3.2.0",
|
||||||
"@testing-library/jest-dom": "^5.14.1",
|
"@testing-library/jest-dom": "^5.14.1",
|
||||||
"@testing-library/react": "^13.0.0",
|
"@testing-library/react": "^13.0.0",
|
||||||
"@testing-library/user-event": "^13.2.1",
|
"@testing-library/user-event": "^13.2.1",
|
||||||
|
"antd": "^5.26.1",
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
"date-fns": "^2.30.0",
|
"date-fns": "^2.30.0",
|
||||||
|
"dayjs": "^1.11.13",
|
||||||
"dotenv-cli": "^7.4.2",
|
"dotenv-cli": "^7.4.2",
|
||||||
|
"framer-motion": "^12.19.1",
|
||||||
"i18next": "^23.15.1",
|
"i18next": "^23.15.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
|
|||||||
@@ -13,11 +13,19 @@ import {
|
|||||||
LogView,
|
LogView,
|
||||||
} from './pages/UserManage';
|
} from './pages/UserManage';
|
||||||
import { EconomicIndex, UserIndex } from './pages/IndexManage';
|
import { EconomicIndex, UserIndex } from './pages/IndexManage';
|
||||||
import { LandInfoView, CryptView, GameLogView, UserView, BusinessLogView, } from './pages/DataManage';
|
import {
|
||||||
|
LandInfoView,
|
||||||
|
GameLogView,
|
||||||
|
UserView,
|
||||||
|
BusinessLogView,
|
||||||
|
MetaItemView,
|
||||||
|
RankManage,
|
||||||
|
MetaCraftingView,
|
||||||
|
} from './pages/DataManage';
|
||||||
import {
|
import {
|
||||||
Board,
|
Board,
|
||||||
Event,
|
RewardEvent,
|
||||||
EventRegist,
|
RewardEventRegist,
|
||||||
Items,
|
Items,
|
||||||
Mail,
|
Mail,
|
||||||
MailRegist,
|
MailRegist,
|
||||||
@@ -26,7 +34,8 @@ import {
|
|||||||
UserBlockRegist,
|
UserBlockRegist,
|
||||||
LandAuction,
|
LandAuction,
|
||||||
BattleEvent,
|
BattleEvent,
|
||||||
MenuBanner, MenuBannerRegist,
|
MenuBanner, MenuBannerRegist, Ranking,
|
||||||
|
Event
|
||||||
} from './pages/ServiceManage';
|
} from './pages/ServiceManage';
|
||||||
|
|
||||||
const RouteInfo = () => {
|
const RouteInfo = () => {
|
||||||
@@ -59,8 +68,10 @@ const RouteInfo = () => {
|
|||||||
<Route path="userview" element={<UserView />} />
|
<Route path="userview" element={<UserView />} />
|
||||||
<Route path="landview" element={<LandInfoView />} />
|
<Route path="landview" element={<LandInfoView />} />
|
||||||
<Route path="gamelogview" element={<GameLogView />} />
|
<Route path="gamelogview" element={<GameLogView />} />
|
||||||
<Route path="cryptview" element={<CryptView />} />
|
|
||||||
<Route path="businesslogview" element={<BusinessLogView />} />
|
<Route path="businesslogview" element={<BusinessLogView />} />
|
||||||
|
<Route path="itemdictionary" element={<MetaItemView />} />
|
||||||
|
<Route path="craftdictionary" element={<MetaCraftingView />} />
|
||||||
|
<Route path="rankmanage" element={<RankManage />} />
|
||||||
</Route>
|
</Route>
|
||||||
<Route path="/servicemanage">
|
<Route path="/servicemanage">
|
||||||
<Route path="board" element={<Board />} />
|
<Route path="board" element={<Board />} />
|
||||||
@@ -70,12 +81,14 @@ const RouteInfo = () => {
|
|||||||
<Route path="userblock/userblockregist" element={<UserBlockRegist />} />
|
<Route path="userblock/userblockregist" element={<UserBlockRegist />} />
|
||||||
<Route path="reportlist" element={<ReportList />} />
|
<Route path="reportlist" element={<ReportList />} />
|
||||||
<Route path="items" element={<Items />} />
|
<Route path="items" element={<Items />} />
|
||||||
<Route path="event" element={<Event />} />
|
<Route path="rewardevent" element={<RewardEvent />} />
|
||||||
<Route path="event/eventregist" element={<EventRegist />} />
|
<Route path="rewardevent/eventregist" element={<RewardEventRegist />} />
|
||||||
<Route path="landauction" element={<LandAuction />} />
|
<Route path="landauction" element={<LandAuction />} />
|
||||||
<Route path="battleevent" element={<BattleEvent />} />
|
<Route path="battleevent" element={<BattleEvent />} />
|
||||||
<Route path="menubanner" element={<MenuBanner />} />
|
<Route path="menubanner" element={<MenuBanner />} />
|
||||||
<Route path="menubanner/menubannerregist" element={<MenuBannerRegist />} />
|
<Route path="menubanner/menubannerregist" element={<MenuBannerRegist />} />
|
||||||
|
<Route path="ranking" element={<Ranking />} />
|
||||||
|
<Route path="event" element={<Event />} />
|
||||||
</Route>
|
</Route>
|
||||||
</Route>
|
</Route>
|
||||||
</Routes>
|
</Routes>
|
||||||
|
|||||||
@@ -129,4 +129,21 @@ export const BattleRewardView = async (token) => {
|
|||||||
throw new Error('BattleRewardView Error', e);
|
throw new Error('BattleRewardView Error', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const GameModeView = async (token) => {
|
||||||
|
try {
|
||||||
|
const res = await Axios.get(
|
||||||
|
`/api/v1/battle/game-mode/list`,
|
||||||
|
{
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
return res.data.data.game_mode_list;
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('GameModeView Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
@@ -52,7 +52,7 @@ export const BlackListDelete = async (token, params) => {
|
|||||||
data: { list: params },
|
data: { list: params },
|
||||||
});
|
});
|
||||||
|
|
||||||
return res;
|
return res.data;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof Error) {
|
if (e instanceof Error) {
|
||||||
throw new Error('BlackListDelete', e);
|
throw new Error('BlackListDelete', e);
|
||||||
|
|||||||
95
src/apis/Dictionary.js
Normal file
95
src/apis/Dictionary.js
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
//운영 정보 관리 - 백과사전 api 연결
|
||||||
|
|
||||||
|
import { Axios, responseFileDownload } from '../utils';
|
||||||
|
|
||||||
|
// 아이템 백과사전 조회
|
||||||
|
export const getItemDictionaryList = async (token, searchType, searchData, largeType, smallType, brand, gender, order, size, currentPage) => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`/api/v1/dictionary/item/list?search_type=${searchType}&search_data=${searchData}
|
||||||
|
&large_type=${largeType}&small_type=${smallType}&brand=${brand}&gender=${gender}
|
||||||
|
&orderby=${order}&page_no=${currentPage}&page_size=${size}`, {
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${token}`,
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('getItemDictionaryList API error:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const ItemDictionaryExport = async (token, params) => {
|
||||||
|
try {
|
||||||
|
await Axios.get(`/api/v1/dictionary/item/excel-export?search_type=${params.search_type}&search_data=${params.search_data}
|
||||||
|
&large_type=${params.large_type}&small_type=${params.small_type}&brand=${params.brand}&gender=${params.gender}
|
||||||
|
&lang=${params.lang}&task_id=${params.taskId}`, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
responseType: 'blob'
|
||||||
|
}).then(response => {
|
||||||
|
responseFileDownload(response, {
|
||||||
|
defaultFileName: 'itemDictionary'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('ItemDictionaryExport Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getCraftingDictionaryList = async (token, searchType, searchData, smallType, recipeType, order, size, currentPage) => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`/api/v1/dictionary/craft/list?search_type=${searchType}&search_data=${searchData}
|
||||||
|
&small_type=${smallType}&recipe_type=${recipeType}
|
||||||
|
&orderby=${order}&page_no=${currentPage}&page_size=${size}`, {
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${token}`,
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('getCraftingDictionaryList API error:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const CraftingDictionaryExport = async (token, params) => {
|
||||||
|
try {
|
||||||
|
await Axios.get(`/api/v1/dictionary/craft/excel-export?search_type=${params.search_type}&search_data=${params.search_data}
|
||||||
|
&small_type=${params.small_type}&recipe_type=${params.recipe_type}
|
||||||
|
&lang=${params.lang}&task_id=${params.taskId}`, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
responseType: 'blob'
|
||||||
|
}).then(response => {
|
||||||
|
responseFileDownload(response, {
|
||||||
|
defaultFileName: 'craftingDictionary'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('CraftingDictionaryExport Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const BrandView = async (token) => {
|
||||||
|
try {
|
||||||
|
const res = await Axios.get(
|
||||||
|
`/api/v1/dictionary/brand/list`,
|
||||||
|
{
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
return res.data.data.brand_list;
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('BrandView Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
//운영서비스 관리 - 이벤트 api 연결
|
//운영서비스 관리 - 통합 이벤트 api 연결
|
||||||
|
|
||||||
import { Axios } from '../utils';
|
import { Axios } from '../utils';
|
||||||
|
|
||||||
// 이벤트 리스트 조회
|
// 이벤트 리스트 조회
|
||||||
export const EventView = async (token, title, content, status, startDate, endDate, order, size, currentPage) => {
|
export const EventView = async (token, searchData, status, startDate, endDate, order, size, currentPage) => {
|
||||||
try {
|
try {
|
||||||
const res = await Axios.get(
|
const res = await Axios.get(
|
||||||
`/api/v1/event/list?title=${title}&content=${content}&status=${status}&start_dt=${startDate}&end_dt=${endDate}&orderby=${order}&page_no=${currentPage}
|
`/api/v1/world-event/list?search_data=${searchData}&status=${status}&start_dt=${startDate}&end_dt=${endDate}
|
||||||
&page_size=${size}`,
|
&orderby=${order}&page_no=${currentPage}&page_size=${size}`,
|
||||||
{
|
{
|
||||||
headers: { Authorization: `Bearer ${token}` },
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
},
|
},
|
||||||
@@ -24,11 +24,11 @@ export const EventView = async (token, title, content, status, startDate, endDat
|
|||||||
// 이벤트 상세보기
|
// 이벤트 상세보기
|
||||||
export const EventDetailView = async (token, id) => {
|
export const EventDetailView = async (token, id) => {
|
||||||
try {
|
try {
|
||||||
const res = await Axios.get(`/api/v1/event/detail/${id}`, {
|
const res = await Axios.get(`/api/v1/world-event/detail/${id}`, {
|
||||||
headers: { Authorization: `Bearer ${token}` },
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
});
|
});
|
||||||
|
|
||||||
return res.data.data.detail;
|
return res.data.data;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof Error) {
|
if (e instanceof Error) {
|
||||||
throw new Error('EventDetailView Error', e);
|
throw new Error('EventDetailView Error', e);
|
||||||
@@ -39,11 +39,11 @@ export const EventDetailView = async (token, id) => {
|
|||||||
// 이벤트 등록
|
// 이벤트 등록
|
||||||
export const EventSingleRegist = async (token, params) => {
|
export const EventSingleRegist = async (token, params) => {
|
||||||
try {
|
try {
|
||||||
const res = await Axios.post(`/api/v1/event`, params, {
|
const res = await Axios.post(`/api/v1/world-event`, params, {
|
||||||
headers: { Authorization: `Bearer ${token}` },
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
});
|
});
|
||||||
|
|
||||||
return res;
|
return res.data;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof Error) {
|
if (e instanceof Error) {
|
||||||
throw new Error('EventSingleRegist Error', e);
|
throw new Error('EventSingleRegist Error', e);
|
||||||
@@ -51,14 +51,14 @@ export const EventSingleRegist = async (token, params) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 우편 수정
|
// 이벤트 수정
|
||||||
export const EventModify = async (token, id, params) => {
|
export const EventModify = async (token, id, params) => {
|
||||||
try {
|
try {
|
||||||
const res = await Axios.put(`/api/v1/event/${id}`, params, {
|
const res = await Axios.put(`/api/v1/world-event/${id}`, params, {
|
||||||
headers: { Authorization: `Bearer ${token}` },
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
});
|
});
|
||||||
|
|
||||||
return res.data.data.list;
|
return res.data;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof Error) {
|
if (e instanceof Error) {
|
||||||
throw new Error('EventModify Error', e);
|
throw new Error('EventModify Error', e);
|
||||||
@@ -66,15 +66,14 @@ export const EventModify = async (token, id, params) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 우편 삭제
|
// 이벤트 삭제
|
||||||
export const EventDelete = async (token, params, id) => {
|
export const EventDelete = async (token, id) => {
|
||||||
try {
|
try {
|
||||||
const res = await Axios.delete(`/api/v1/event/delete`, {
|
const res = await Axios.delete(`/api/v1/world-event/delete?id=${id}`, {
|
||||||
headers: { Authorization: `Bearer ${token}` },
|
headers: { Authorization: `Bearer ${token}` }
|
||||||
data: { list: params },
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return res.data.data.list;
|
return res.data;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof Error) {
|
if (e instanceof Error) {
|
||||||
throw new Error('EventDelete Error', e);
|
throw new Error('EventDelete Error', e);
|
||||||
@@ -82,17 +81,20 @@ export const EventDelete = async (token, params, id) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 이벤트 우편 아이템 확인
|
// 이벤트 메타데이터 조회
|
||||||
export const EventIsItem = async (token, params) => {
|
export const EventActionView = async (token) => {
|
||||||
try {
|
try {
|
||||||
const res = await Axios.post(`/api/v1/event/item`, params, {
|
const res = await Axios.get(
|
||||||
headers: { Authorization: `Bearer ${token}` },
|
`/api/v1/dictionary/event-action/list`,
|
||||||
});
|
{
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
return res;
|
return res.data.data.event_action_list;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof Error) {
|
if (e instanceof Error) {
|
||||||
throw new Error('EventIsItem Error', e);
|
throw new Error('EventActionView Error', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
//사용자 관리 - 로그조회 api 연결
|
//사용자 관리 - 로그조회 api 연결
|
||||||
|
|
||||||
import { Axios } from '../utils';
|
import { Axios } from '../utils';
|
||||||
|
|
||||||
export const LogViewList = async (token, searchType, searchKey, historyType, startDt, endDt, orderBy, size, currentPage) => {
|
export const LogViewList = async (token, searchType, searchKey, historyType, startDt, endDt, orderBy, size, currentPage) => {
|
||||||
@@ -13,7 +12,7 @@ export const LogViewList = async (token, searchType, searchKey, historyType, sta
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
return res.data.data;
|
return res.data;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof Error) {
|
if (e instanceof Error) {
|
||||||
throw new Error('LogViewList Error', e);
|
throw new Error('LogViewList Error', e);
|
||||||
@@ -34,3 +33,21 @@ export const LogviewDetail = async (token, id) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const LogHistory = async (token, params) => {
|
||||||
|
try {
|
||||||
|
const res = await Axios.post(`/api/v1/history/change-list`, params, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
});
|
||||||
|
|
||||||
|
if(res.data.result === 'ERROR'){
|
||||||
|
throw new Error('LogHistory Error', res.data.data.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
return res.data.data.list;
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('LogHistory Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -36,6 +36,19 @@ export const userTotalIndex = async token => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const dashboardCaliumIndex = async token => {
|
||||||
|
try {
|
||||||
|
const res = await Axios.get(`/api/v1/indicators/dashboard/calium/converter`, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
});
|
||||||
|
return res.data.data;
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('dashboardCaliumIndex', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// 유저 지표 다운로드
|
// 유저 지표 다운로드
|
||||||
export const userIndexExport = async (token, filename, sendDate, endDate) => {
|
export const userIndexExport = async (token, filename, sendDate, endDate) => {
|
||||||
try {
|
try {
|
||||||
@@ -62,10 +75,14 @@ export const userIndexExport = async (token, filename, sendDate, endDate) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Retention
|
// Retention
|
||||||
export const RetentionIndexView = async (token, start_dt, end_dt) => {
|
export const RetentionIndexView = async (token, startDate, endDate, order, size, currentPage) => {
|
||||||
try {
|
try {
|
||||||
const res = await Axios.get(`/api/v1/indicators/retention/list?start_dt=${start_dt}&end_dt=${end_dt}`, {
|
const res = await Axios.get(`/api/v1/indicators/retention/list?start_dt=${startDate}&end_dt=${endDate}
|
||||||
headers: { Authorization: `Bearer ${token}` },
|
&orderby=${order}&page_no=${currentPage}&page_size=${size}`, {
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${token}`,
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
return res.data.data;
|
return res.data.data;
|
||||||
@@ -183,10 +200,10 @@ export const PlaytimeIndexExport = async (token, filename, sendDate, endDate) =>
|
|||||||
|
|
||||||
// 2. 경제 지표
|
// 2. 경제 지표
|
||||||
|
|
||||||
// 재화 조회 (currency)
|
// 재화 획득 조회
|
||||||
export const CurrencyIndexView = async (token, start_dt, end_dt, currency_type) => {
|
export const CurrencyAcquireIndexView = async (token, start_dt, end_dt, currencyType, deltaType) => {
|
||||||
try {
|
try {
|
||||||
const res = await Axios.get(`/api/v1/indicators/currency/use?start_dt=${start_dt}&end_dt=${end_dt}¤cy_type=${currency_type}`, {
|
const res = await Axios.get(`/api/v1/indicators/currency/list?start_dt=${start_dt}&end_dt=${end_dt}¤cy_type=${currencyType}&delta_type=${deltaType}`, {
|
||||||
headers: { Authorization: `Bearer ${token}` },
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -198,75 +215,10 @@ export const CurrencyIndexView = async (token, start_dt, end_dt, currency_type)
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 재화 지표 다운로드
|
|
||||||
export const CurrencyIndexExport = async (token, filename, sendDate, endDate, currencyType) => {
|
|
||||||
try {
|
|
||||||
await Axios.get(`/api/v1/indicators/currency/excel-down?file=${filename}&start_dt=${sendDate}&end_dt=${endDate}¤cy_type=${currencyType}`, {
|
|
||||||
headers: { Authorization: `Bearer ${token}` },
|
|
||||||
responseType: 'blob',
|
|
||||||
}).then(response => {
|
|
||||||
const href = URL.createObjectURL(response.data);
|
|
||||||
|
|
||||||
const link = document.createElement('a');
|
|
||||||
link.href = href;
|
|
||||||
link.setAttribute('download', `${filename}`);
|
|
||||||
document.body.appendChild(link);
|
|
||||||
link.click();
|
|
||||||
|
|
||||||
document.body.removeChild(link);
|
|
||||||
URL.revokeObjectURL(href);
|
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
if (e instanceof Error) {
|
|
||||||
throw new Error('CurrencyIndexExport Error', e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// VBP
|
|
||||||
export const VbpIndexView = async (token, start_dt, end_dt) => {
|
|
||||||
try {
|
|
||||||
const res = await Axios.get(`/api/v1/indicators/currency/vbp?start_dt=${start_dt}&end_dt=${end_dt}`, {
|
|
||||||
headers: { Authorization: `Bearer ${token}` },
|
|
||||||
});
|
|
||||||
|
|
||||||
return res.data.data;
|
|
||||||
} catch (e) {
|
|
||||||
if (e instanceof Error) {
|
|
||||||
throw new Error('VbpIndexView Error', e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// VBP 다운로드
|
|
||||||
export const VBPIndexExport = async (token, filename, sendDate, endDate) => {
|
|
||||||
try {
|
|
||||||
await Axios.get(`/api/v1/indicators/currency/excel-down?file=${filename}&start_dt=${sendDate}&end_dt=${endDate}`, {
|
|
||||||
headers: { Authorization: `Bearer ${token}` },
|
|
||||||
responseType: 'blob',
|
|
||||||
}).then(response => {
|
|
||||||
const href = URL.createObjectURL(response.data);
|
|
||||||
|
|
||||||
const link = document.createElement('a');
|
|
||||||
link.href = href;
|
|
||||||
link.setAttribute('download', `${filename}`);
|
|
||||||
document.body.appendChild(link);
|
|
||||||
link.click();
|
|
||||||
|
|
||||||
document.body.removeChild(link);
|
|
||||||
URL.revokeObjectURL(href);
|
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
if (e instanceof Error) {
|
|
||||||
throw new Error('VBPIndexExport Error', e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Item
|
// Item
|
||||||
export const ItemIndexView = async (token, start_dt, end_dt) => {
|
export const ItemIndexView = async (token, start_dt, end_dt, itemId, deltaType) => {
|
||||||
try {
|
try {
|
||||||
const res = await Axios.get(`/api/v1/indicators/currency/item?start_dt=${start_dt}&end_dt=${end_dt}`, {
|
const res = await Axios.get(`/api/v1/indicators/item/list?start_dt=${start_dt}&end_dt=${end_dt}&item_id=${itemId}&delta_type=${deltaType}`, {
|
||||||
headers: { Authorization: `Bearer ${token}` },
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -278,27 +230,17 @@ export const ItemIndexView = async (token, start_dt, end_dt) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Item 다운로드
|
// Assets
|
||||||
export const ItemIndexExport = async (token, filename, sendDate, endDate) => {
|
export const AssetsIndexView = async (token, start_dt, end_dt, itemId, deltaType) => {
|
||||||
try {
|
try {
|
||||||
await Axios.get(`/api/v1/indicators/currency/excel-down?file=${filename}&start_dt=${sendDate}&end_dt=${endDate}`, {
|
const res = await Axios.get(`/api/v1/indicators/assets/list?start_dt=${start_dt}&end_dt=${end_dt}`, {
|
||||||
headers: { Authorization: `Bearer ${token}` },
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
responseType: 'blob',
|
|
||||||
}).then(response => {
|
|
||||||
const href = URL.createObjectURL(response.data);
|
|
||||||
|
|
||||||
const link = document.createElement('a');
|
|
||||||
link.href = href;
|
|
||||||
link.setAttribute('download', `${filename}`);
|
|
||||||
document.body.appendChild(link);
|
|
||||||
link.click();
|
|
||||||
|
|
||||||
document.body.removeChild(link);
|
|
||||||
URL.revokeObjectURL(href);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return res.data.data;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof Error) {
|
if (e instanceof Error) {
|
||||||
throw new Error('ItemIndexExport Error', e);
|
throw new Error('AssetsIndexView Error', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -320,137 +262,4 @@ export const InstanceIndexView = async (token, data, start_dt, end_dt) => {
|
|||||||
throw new Error('InstanceIndexView Error', e);
|
throw new Error('InstanceIndexView Error', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
// Instance 다운로드
|
|
||||||
export const InstanceIndexExport = async (token, filename, data, sendDate, endDate) => {
|
|
||||||
try {
|
|
||||||
await Axios.get(
|
|
||||||
`/api/v1/indicators/currency/excel-down?file=${filename}&search_key=${data ? data : ''}
|
|
||||||
&start_dt=${sendDate}&end_dt=${endDate}`,
|
|
||||||
{
|
|
||||||
headers: { Authorization: `Bearer ${token}` },
|
|
||||||
responseType: 'blob',
|
|
||||||
},
|
|
||||||
).then(response => {
|
|
||||||
const href = URL.createObjectURL(response.data);
|
|
||||||
|
|
||||||
const link = document.createElement('a');
|
|
||||||
link.href = href;
|
|
||||||
link.setAttribute('download', `${filename}`);
|
|
||||||
document.body.appendChild(link);
|
|
||||||
link.click();
|
|
||||||
|
|
||||||
document.body.removeChild(link);
|
|
||||||
URL.revokeObjectURL(href);
|
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
if (e instanceof Error) {
|
|
||||||
throw new Error('InstanceIndexExport Error', e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Clothes
|
|
||||||
export const ClothesIndexView = async (token, data, start_dt, end_dt) => {
|
|
||||||
try {
|
|
||||||
const res = await Axios.get(`/api/v1/indicators/currency/clothes?search_key=${data ? data : ''}&start_dt=${start_dt}&end_dt=${end_dt}`, {
|
|
||||||
headers: { Authorization: `Bearer ${token}` },
|
|
||||||
});
|
|
||||||
|
|
||||||
return res.data.data;
|
|
||||||
} catch (e) {
|
|
||||||
if (e instanceof Error) {
|
|
||||||
throw new Error('ClothesIndexView Error', e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Clothes 다운로드
|
|
||||||
export const ClothesIndexExport = async (token, filename, data, sendDate, endDate) => {
|
|
||||||
try {
|
|
||||||
await Axios.get(
|
|
||||||
`/api/v1/indicators/currency/excel-down?file=${filename}&search_key=${data ? data : ''}
|
|
||||||
&start_dt=${sendDate}&end_dt=${endDate}`,
|
|
||||||
{
|
|
||||||
headers: { Authorization: `Bearer ${token}` },
|
|
||||||
responseType: 'blob',
|
|
||||||
},
|
|
||||||
).then(response => {
|
|
||||||
const href = URL.createObjectURL(response.data);
|
|
||||||
|
|
||||||
const link = document.createElement('a');
|
|
||||||
link.href = href;
|
|
||||||
link.setAttribute('download', `${filename}`);
|
|
||||||
document.body.appendChild(link);
|
|
||||||
link.click();
|
|
||||||
|
|
||||||
document.body.removeChild(link);
|
|
||||||
URL.revokeObjectURL(href);
|
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
if (e instanceof Error) {
|
|
||||||
throw new Error('ClothesIndexExport Error', e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// DAU
|
|
||||||
export const DailyActiveUserView = async (token, start_dt, end_dt) => {
|
|
||||||
try {
|
|
||||||
const res = await Axios.get(`/api/v1/indicators/dau/list?start_dt=${start_dt}&end_dt=${end_dt}`, {
|
|
||||||
headers: { Authorization: `Bearer ${token}` },
|
|
||||||
});
|
|
||||||
|
|
||||||
return res.data.data.dau_list;
|
|
||||||
} catch (e) {
|
|
||||||
if (e instanceof Error) {
|
|
||||||
throw new Error('DailyActiveUserView Error', e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// DAU 다운로드
|
|
||||||
export const DailyActiveUserExport = async (token, filename, sendDate, endDate) => {
|
|
||||||
try {
|
|
||||||
await Axios.get(`/api/v1/indicators/dau/excel-down?file=${filename}&start_dt=${sendDate}&end_dt=${endDate}`, {
|
|
||||||
headers: { Authorization: `Bearer ${token}` },
|
|
||||||
responseType: 'blob',
|
|
||||||
}).then(response => {
|
|
||||||
const href = URL.createObjectURL(response.data);
|
|
||||||
|
|
||||||
const link = document.createElement('a');
|
|
||||||
link.href = href;
|
|
||||||
link.setAttribute('download', `${filename}`);
|
|
||||||
document.body.appendChild(link);
|
|
||||||
link.click();
|
|
||||||
|
|
||||||
document.body.removeChild(link);
|
|
||||||
URL.revokeObjectURL(href);
|
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
if (e instanceof Error) {
|
|
||||||
throw new Error('PlaytimeIndexExport Error', e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Daily Medal
|
|
||||||
export const DailyMedalView = async (token, start_dt, end_dt) => {
|
|
||||||
try {
|
|
||||||
const res = await Axios.get(`/api/v1/indicators/daily-medal/list?start_dt=${start_dt}&end_dt=${end_dt}`, {
|
|
||||||
headers: { Authorization: `Bearer ${token}` },
|
|
||||||
});
|
|
||||||
|
|
||||||
return res.data.data.daily_medal_list;
|
|
||||||
} catch (e) {
|
|
||||||
if (e instanceof Error) {
|
|
||||||
throw new Error('DailyMedalView Error', e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
297
src/apis/Log.js
297
src/apis/Log.js
@@ -1,12 +1,13 @@
|
|||||||
//운영 정보 관리 - 로그 api 연결
|
//운영 정보 관리 - 로그 api 연결
|
||||||
|
|
||||||
import { Axios } from '../utils';
|
import { Axios, responseFileDownload } from '../utils';
|
||||||
|
|
||||||
// 비즈니스 로그 조회
|
// 비즈니스 로그 조회
|
||||||
export const BusinessLogList = async (token, params) => {
|
export const BusinessLogList = async (token, params) => {
|
||||||
try {
|
try {
|
||||||
const res = await Axios.post(`/api/v1/log/generic/list`, params, {
|
const res = await Axios.post(`/api/v1/log/generic/list`, params, {
|
||||||
headers: { Authorization: `Bearer ${token}` },
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
timeout: 600000
|
||||||
});
|
});
|
||||||
|
|
||||||
return res.data;
|
return res.data;
|
||||||
@@ -15,4 +16,298 @@ export const BusinessLogList = async (token, params) => {
|
|||||||
throw new Error('BusinessLogList Error', e);
|
throw new Error('BusinessLogList Error', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const BusinessLogExport = async (token, params) => {
|
||||||
|
try {
|
||||||
|
await Axios.post(`/api/v1/log/generic/excel-export`, params, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
responseType: 'blob'
|
||||||
|
}).then(response => {
|
||||||
|
responseFileDownload(response, {
|
||||||
|
defaultFileName: 'businessLog'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('BusinessLogExport Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getExcelProgress = async (token, taskId) => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`/api/v1/log/progress/${taskId}`, {
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${token}`,
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.data) {
|
||||||
|
throw new Error(`HTTP error! status: ${response.status}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Progress API error:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getCurrencyList = async (token, startDate, endDate, order, size, currentPage) => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`/api/v1/log/currency/list?start_dt=${startDate}&end_dt=${endDate}
|
||||||
|
&orderby=${order}&page_no=${currentPage}&page_size=${size}`, {
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${token}`,
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('getCurrencyList API error:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const GameCurrencyLogExport = async (token, params, fileName) => {
|
||||||
|
try {
|
||||||
|
await Axios.post(`/api/v1/log/currency/excel-export`, params, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
responseType: 'blob',
|
||||||
|
timeout: 300000
|
||||||
|
}).then(response => {
|
||||||
|
|
||||||
|
responseFileDownload(response, {
|
||||||
|
defaultFileName: fileName
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('GameCurrencyLogExport Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getCurrencyDetailList = async (token, searchType, searchData, tranId, logAction, currencyType, amountDeltaType, startDate, endDate, order, size, currentPage) => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`/api/v1/log/currency/detail/list?search_type=${searchType}&search_data=${searchData}&tran_id=${tranId}
|
||||||
|
&log_action=${logAction}¤cy_type=${currencyType}&amount_delta_type=${amountDeltaType}&start_dt=${startDate}&end_dt=${endDate}
|
||||||
|
&orderby=${order}&page_no=${currentPage}&page_size=${size}`, {
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${token}`,
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('getCurrencyDetailList API error:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const GameCurrencyDetailLogExport = async (token, params, fileName) => {
|
||||||
|
try {
|
||||||
|
await Axios.post(`/api/v1/log/currency/detail/excel-export`, params, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
responseType: 'blob',
|
||||||
|
timeout: 300000
|
||||||
|
}).then(response => {
|
||||||
|
|
||||||
|
responseFileDownload(response, {
|
||||||
|
defaultFileName: fileName
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('GameCurrencyDetailLogExport Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getItemDetailList = async (token, searchType, searchData, itemId, tranId, logAction, itemLargeType, itemSmallType, countDeltaType, startDate, endDate, order, size, currentPage) => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`/api/v1/log/item/detail/list?search_type=${searchType}&search_data=${searchData}&tran_id=${tranId}&item_id=${itemId}
|
||||||
|
&log_action=${logAction}&item_large_type=${itemLargeType}&item_small_type=${itemSmallType}&count_delta_type=${countDeltaType}&start_dt=${startDate}&end_dt=${endDate}
|
||||||
|
&orderby=${order}&page_no=${currentPage}&page_size=${size}`, {
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${token}`,
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('getItemDetailList API error:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const GameItemDetailLogExport = async (token, params, fileName) => {
|
||||||
|
try {
|
||||||
|
await Axios.post(`/api/v1/log/item/detail/excel-export`, params, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
responseType: 'blob',
|
||||||
|
timeout: 300000
|
||||||
|
}).then(response => {
|
||||||
|
|
||||||
|
responseFileDownload(response, {
|
||||||
|
defaultFileName: fileName
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('GameItemDetailLogExport Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getCurrencyItemList = async (token, searchType, searchData, tranId, logAction, currencyType, amountDeltaType, startDate, endDate, order, size, currentPage) => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`/api/v1/log/currency-item/list?search_type=${searchType}&search_data=${searchData}&tran_id=${tranId}
|
||||||
|
&log_action=${logAction}¤cy_type=${currencyType}&amount_delta_type=${amountDeltaType}&start_dt=${startDate}&end_dt=${endDate}
|
||||||
|
&orderby=${order}&page_no=${currentPage}&page_size=${size}`, {
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${token}`,
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('getItemDetailList API error:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const GameCurrencyItemLogExport = async (token, params, fileName) => {
|
||||||
|
try {
|
||||||
|
|
||||||
|
await Axios.post(`/api/v1/log/currency-item/excel-export`, params, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
responseType: 'blob',
|
||||||
|
timeout: 300000
|
||||||
|
}).then(response => {
|
||||||
|
|
||||||
|
responseFileDownload(response, {
|
||||||
|
defaultFileName: fileName
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('GameCurrencyItemLogExport Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getUserCreateList = async (token, searchType, searchData, startDate, endDate, order, size, currentPage) => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`/api/v1/log/user/create/list?search_type=${searchType}&search_data=${searchData}&start_dt=${startDate}&end_dt=${endDate}
|
||||||
|
&orderby=${order}&page_no=${currentPage}&page_size=${size}`, {
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${token}`,
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('getUserCreateList API error:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getUserLoginDetailList = async (token, searchType, searchData, tranId, startDate, endDate, order, size, currentPage) => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`/api/v1/log/user/login/list?search_type=${searchType}&search_data=${searchData}&tran_id=${tranId}
|
||||||
|
&start_dt=${startDate}&end_dt=${endDate}
|
||||||
|
&orderby=${order}&page_no=${currentPage}&page_size=${size}`, {
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${token}`,
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('getUserLoginDetailList API error:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const GameUserCreateLogExport = async (token, params, fileName) => {
|
||||||
|
try {
|
||||||
|
await Axios.post(`/api/v1/log/user/create/excel-export`, params, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
responseType: 'blob',
|
||||||
|
timeout: 300000
|
||||||
|
}).then(response => {
|
||||||
|
|
||||||
|
responseFileDownload(response, {
|
||||||
|
defaultFileName: fileName
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('GameUserCreateLogExport Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const GameUserLoginLogExport = async (token, params, fileName) => {
|
||||||
|
try {
|
||||||
|
await Axios.post(`/api/v1/log/user/login/excel-export`, params, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
responseType: 'blob',
|
||||||
|
timeout: 300000
|
||||||
|
}).then(response => {
|
||||||
|
|
||||||
|
responseFileDownload(response, {
|
||||||
|
defaultFileName: fileName
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('GameUserLoginLogExport Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getUserSnapshotList = async (token, searchType, searchData, startDate, endDate, order, size, currentPage) => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`/api/v1/log/user/snapshot/list?search_type=${searchType}&search_data=${searchData}&start_dt=${startDate}&end_dt=${endDate}
|
||||||
|
&orderby=${order}&page_no=${currentPage}&page_size=${size}`, {
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${token}`,
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('getUserSnapshotList API error:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const GameUserSnapshotLogExport = async (token, params, fileName) => {
|
||||||
|
try {
|
||||||
|
await Axios.post(`/api/v1/log/user/snapshot/excel-export`, params, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
responseType: 'blob',
|
||||||
|
timeout: 300000
|
||||||
|
}).then(response => {
|
||||||
|
|
||||||
|
responseFileDownload(response, {
|
||||||
|
defaultFileName: fileName
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('GameUserSnapshotLogExport Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
@@ -72,7 +72,7 @@ export const MailModify = async (token, id, params) => {
|
|||||||
headers: { Authorization: `Bearer ${token}` },
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
});
|
});
|
||||||
|
|
||||||
return res.data.data.list;
|
return res.data;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof Error) {
|
if (e instanceof Error) {
|
||||||
throw new Error('MailModify Error', e);
|
throw new Error('MailModify Error', e);
|
||||||
@@ -88,7 +88,7 @@ export const MailDelete = async (token, params, id) => {
|
|||||||
data: { list: params },
|
data: { list: params },
|
||||||
});
|
});
|
||||||
|
|
||||||
return res.data.data.list;
|
return res.data;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof Error) {
|
if (e instanceof Error) {
|
||||||
throw new Error('MailDelete Error', e);
|
throw new Error('MailDelete Error', e);
|
||||||
@@ -147,7 +147,7 @@ export const MailIsItem = async (token, params) => {
|
|||||||
headers: { Authorization: `Bearer ${token}` },
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
});
|
});
|
||||||
|
|
||||||
return res;
|
return res.data;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof Error) {
|
if (e instanceof Error) {
|
||||||
throw new Error('MailItemCheck Error', e);
|
throw new Error('MailItemCheck Error', e);
|
||||||
|
|||||||
@@ -67,11 +67,10 @@ export const MenuBannerModify = async (token, id, params) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 삭제
|
// 삭제
|
||||||
export const MenuBannerDelete = async (token, params) => {
|
export const MenuBannerDelete = async (token, id) => {
|
||||||
try {
|
try {
|
||||||
const res = await Axios.delete(`/api/v1/menu/banner/delete`, {
|
const res = await Axios.delete(`/api/v1/menu/banner/delete?id=${id}`, {
|
||||||
headers: { Authorization: `Bearer ${token}` },
|
headers: { Authorization: `Bearer ${token}` }
|
||||||
data: { list: params },
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return res.data;
|
return res.data;
|
||||||
|
|||||||
99
src/apis/Rank.js
Normal file
99
src/apis/Rank.js
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
//운영서비스 관리 - 랭킹 스케줄 api 연결
|
||||||
|
|
||||||
|
import { Axios } from '../utils';
|
||||||
|
|
||||||
|
// 리스트 조회
|
||||||
|
export const RankingScheduleView = async (token, title, content, status, startDate, endDate, order, size, currentPage) => {
|
||||||
|
try {
|
||||||
|
const res = await Axios.get(
|
||||||
|
`/api/v1/rank/schedule/list?title=${title}&content=${content}&status=${status}&start_dt=${startDate}&end_dt=${endDate}
|
||||||
|
&orderby=${order}&page_no=${currentPage}&page_size=${size}`,
|
||||||
|
{
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
return res.data.data;
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('RankingScheduleView Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 전투시스템 상세보기
|
||||||
|
export const RankingScheduleDetailView = async (token, id) => {
|
||||||
|
try {
|
||||||
|
const res = await Axios.get(`/api/v1/rank/schedule/detail/${id}`, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
});
|
||||||
|
|
||||||
|
return res.data.data;
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('RankingScheduleDetailView Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 랭킹스케줄 등록
|
||||||
|
export const RankingScheduleSingleRegist = async (token, params) => {
|
||||||
|
try {
|
||||||
|
const res = await Axios.post(`/api/v1/rank/schedule`, params, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
});
|
||||||
|
|
||||||
|
return res.data;
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('RankingScheduleSingleRegist Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 랭킹스케줄 수정
|
||||||
|
export const RankingScheduleModify = async (token, id, params) => {
|
||||||
|
try {
|
||||||
|
const res = await Axios.put(`/api/v1/rank/schedule/${id}`, params, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
});
|
||||||
|
|
||||||
|
return res.data;
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('RankingScheduleModify Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 랭킹스케줄 삭제
|
||||||
|
export const RankingScheduleDelete = async (token, id) => {
|
||||||
|
try {
|
||||||
|
const res = await Axios.delete(`/api/v1/rank/schedule/delete?id=${id}`, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
});
|
||||||
|
|
||||||
|
return res.data;
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('RankingScheduleDelete Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const RankingDataView = async (token) => {
|
||||||
|
try {
|
||||||
|
const res = await Axios.get(
|
||||||
|
`/api/v1/dictionary/ranking/list`,
|
||||||
|
{
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
return res.data.data.ranking_list;
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('RankingDataView Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
98
src/apis/RewardEvent.js
Normal file
98
src/apis/RewardEvent.js
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
//운영서비스 관리 - 이벤트 api 연결
|
||||||
|
|
||||||
|
import { Axios } from '../utils';
|
||||||
|
|
||||||
|
// 이벤트 리스트 조회
|
||||||
|
export const RewardEventView = async (token, title, content, status, startDate, endDate, order, size, currentPage) => {
|
||||||
|
try {
|
||||||
|
const res = await Axios.get(
|
||||||
|
`/api/v1/event/list?title=${title}&content=${content}&status=${status}&start_dt=${startDate}&end_dt=${endDate}
|
||||||
|
&orderby=${order}&page_no=${currentPage}&page_size=${size}`,
|
||||||
|
{
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
return res.data.data;
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('RewardEventView Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 이벤트 상세보기
|
||||||
|
export const RewardEventDetailView = async (token, id) => {
|
||||||
|
try {
|
||||||
|
const res = await Axios.get(`/api/v1/event/detail/${id}`, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
});
|
||||||
|
|
||||||
|
return res.data.data.detail;
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('RewardEventDetailView Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 이벤트 등록
|
||||||
|
export const RewardEventSingleRegist = async (token, params) => {
|
||||||
|
try {
|
||||||
|
const res = await Axios.post(`/api/v1/event`, params, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
});
|
||||||
|
|
||||||
|
return res;
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('RewardEventSingleRegist Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 우편 수정
|
||||||
|
export const RewardEventModify = async (token, id, params) => {
|
||||||
|
try {
|
||||||
|
const res = await Axios.put(`/api/v1/event/${id}`, params, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
});
|
||||||
|
|
||||||
|
return res.data;
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('RewardEventModify Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 우편 삭제
|
||||||
|
export const RewardEventDelete = async (token, params, id) => {
|
||||||
|
try {
|
||||||
|
const res = await Axios.delete(`/api/v1/event/delete`, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
data: { list: params },
|
||||||
|
});
|
||||||
|
|
||||||
|
return res.data.data.list;
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('RewardEventDelete Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 이벤트 우편 아이템 확인
|
||||||
|
export const EventIsItem = async (token, params) => {
|
||||||
|
try {
|
||||||
|
const res = await Axios.post(`/api/v1/event/item`, params, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
});
|
||||||
|
|
||||||
|
return res;
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('EventIsItem Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -12,7 +12,7 @@ export const UserView = async (token, searchType, searchKey) => {
|
|||||||
{ headers: { Authorization: `Bearer ${token}` } },
|
{ headers: { Authorization: `Bearer ${token}` } },
|
||||||
);
|
);
|
||||||
|
|
||||||
return res.data.data.result;
|
return res.data;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof Error) {
|
if (e instanceof Error) {
|
||||||
throw new Error('UserView Error', e);
|
throw new Error('UserView Error', e);
|
||||||
@@ -42,7 +42,7 @@ export const UserChangeNickName = async (token, params) => {
|
|||||||
headers: { Authorization: `Bearer ${token}` },
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
});
|
});
|
||||||
|
|
||||||
return res;
|
return res.data;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof Error) {
|
if (e instanceof Error) {
|
||||||
throw new Error('UserChangeNickName Error', e);
|
throw new Error('UserChangeNickName Error', e);
|
||||||
@@ -185,6 +185,21 @@ export const UserQuestView = async (token, guid) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//퀘스트 테스크 완료
|
||||||
|
export const UserQuestTaskComplete = async (token, params) => {
|
||||||
|
try {
|
||||||
|
const res = await Axios.post(`/api/v1/users/quest/task`, params, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
});
|
||||||
|
|
||||||
|
return res.data;
|
||||||
|
} catch (e) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
throw new Error('UserQuestTaskComplete Error', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// 친구목록 조회
|
// 친구목록 조회
|
||||||
export const UserFriendListView = async (token, guid) => {
|
export const UserFriendListView = async (token, guid) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -12,11 +12,16 @@ export * from './BlackList';
|
|||||||
export * from './Users';
|
export * from './Users';
|
||||||
export * from './Indicators';
|
export * from './Indicators';
|
||||||
export * from './Item';
|
export * from './Item';
|
||||||
export * from './Event';
|
export * from './RewardEvent';
|
||||||
export * from './Calium';
|
export * from './Calium';
|
||||||
export * from './Land';
|
export * from './Land';
|
||||||
export * from './Menu';
|
export * from './Menu';
|
||||||
export * from './OpenAI';
|
// export * from './OpenAI';
|
||||||
|
export * from './Log';
|
||||||
|
export * from './Data';
|
||||||
|
export * from './Dictionary';
|
||||||
|
export * from './Rank';
|
||||||
|
export * from './Event';
|
||||||
|
|
||||||
const apiModules = {};
|
const apiModules = {};
|
||||||
const allApis = {};
|
const allApis = {};
|
||||||
|
|||||||
@@ -8,5 +8,13 @@ export const ONE_MINUTE_MS = 60000;
|
|||||||
export const ONE_MINUTE_SECOND = 60;
|
export const ONE_MINUTE_SECOND = 60;
|
||||||
export const AUCTION_MIN_MINUTE_TIME = 15; // 15분
|
export const AUCTION_MIN_MINUTE_TIME = 15; // 15분
|
||||||
export const IMAGE_MAX_SIZE = 5242880;
|
export const IMAGE_MAX_SIZE = 5242880;
|
||||||
|
export const STORAGE_MAIL_COPY = 'copyMailData';
|
||||||
|
export const STORAGE_BUSINESS_LOG_SEARCH = 'businessLogSearchParam';
|
||||||
|
export const STORAGE_GAME_LOG_CURRENCY_SEARCH = 'gameLogCurrencySearchParam';
|
||||||
|
export const STORAGE_GAME_LOG_ITEM_SEARCH = 'gameLogItemSearchParam';
|
||||||
|
export const STORAGE_GAME_LOG_USER_CREATE_SEARCH = 'gameLogUserCreateSearchParam';
|
||||||
|
export const STORAGE_GAME_LOG_USER_LOGIN_SEARCH = 'gameLogUserLoginSearchParam';
|
||||||
|
export const LOG_ACTION_FAIL_CALIUM_ECHO = 'FailCaliumEchoSystem';
|
||||||
|
export const BATTLE_EVENT_OPERATION_TIME_WAIT_SECONDS = 300;
|
||||||
|
|
||||||
export { INITIAL_PAGE_SIZE, INITIAL_CURRENT_PAGE, INITIAL_PAGE_LIMIT };
|
export { INITIAL_PAGE_SIZE, INITIAL_CURRENT_PAGE, INITIAL_PAGE_LIMIT };
|
||||||
|
|||||||
18
src/assets/data/apis/eventAPI.json
Normal file
18
src/assets/data/apis/eventAPI.json
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"baseUrl": "/api/v1/world-event",
|
||||||
|
"endpoints": {
|
||||||
|
"EventView": {
|
||||||
|
"method": "GET",
|
||||||
|
"url": "/list",
|
||||||
|
"dataPath": "data",
|
||||||
|
"paramFormat": "query"
|
||||||
|
},
|
||||||
|
"EventDetailView": {
|
||||||
|
"method": "GET",
|
||||||
|
"url": "/detail/:id",
|
||||||
|
"dataPath": "data.data",
|
||||||
|
"paramFormat": "query",
|
||||||
|
"paramMapping": ["id"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
18
src/assets/data/apis/historyAPI.json
Normal file
18
src/assets/data/apis/historyAPI.json
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"baseUrl": "/api/v1/history",
|
||||||
|
"endpoints": {
|
||||||
|
"LogViewList": {
|
||||||
|
"method": "GET",
|
||||||
|
"url": "/list",
|
||||||
|
"dataPath": "data",
|
||||||
|
"paramFormat": "query"
|
||||||
|
},
|
||||||
|
"LogviewDetail": {
|
||||||
|
"method": "GET",
|
||||||
|
"url": "/detail/:id",
|
||||||
|
"dataPath": "data.data",
|
||||||
|
"paramFormat": "query",
|
||||||
|
"paramMapping": ["id"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,15 @@
|
|||||||
import itemAPI from './itemAPI.json';
|
import itemAPI from './itemAPI.json';
|
||||||
import menuBannerAPI from './menuBannerAPI.json';
|
import menuBannerAPI from './menuBannerAPI.json';
|
||||||
|
import historyAPI from './historyAPI.json';
|
||||||
|
import eventAPI from './eventAPI.json';
|
||||||
|
import rankingAPI from './rankingAPI.json';
|
||||||
|
import metaCraftingAPI from './metaCraftingAPI.json';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
itemAPI,
|
itemAPI,
|
||||||
menuBannerAPI
|
menuBannerAPI,
|
||||||
|
historyAPI,
|
||||||
|
eventAPI,
|
||||||
|
rankingAPI,
|
||||||
|
metaCraftingAPI
|
||||||
};
|
};
|
||||||
11
src/assets/data/apis/metaCraftingAPI.json
Normal file
11
src/assets/data/apis/metaCraftingAPI.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"baseUrl": "/api/v1/dictionary/craft",
|
||||||
|
"endpoints": {
|
||||||
|
"getCraftingDictionaryList": {
|
||||||
|
"method": "GET",
|
||||||
|
"url": "/list",
|
||||||
|
"dataPath": "data",
|
||||||
|
"paramFormat": "query"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
18
src/assets/data/apis/rankingAPI.json
Normal file
18
src/assets/data/apis/rankingAPI.json
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"baseUrl": "/api/v1/rank/schedule",
|
||||||
|
"endpoints": {
|
||||||
|
"RankingScheduleView": {
|
||||||
|
"method": "GET",
|
||||||
|
"url": "/list",
|
||||||
|
"dataPath": "data",
|
||||||
|
"paramFormat": "query"
|
||||||
|
},
|
||||||
|
"RankingScheduleDetailView": {
|
||||||
|
"method": "GET",
|
||||||
|
"url": "/detail/:id",
|
||||||
|
"dataPath": "data.data",
|
||||||
|
"paramFormat": "query",
|
||||||
|
"paramMapping": ["id"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,131 +0,0 @@
|
|||||||
{
|
|
||||||
"baseUrl": "/api/v1/users",
|
|
||||||
"endpoints": {
|
|
||||||
"UserView": {
|
|
||||||
"method": "GET",
|
|
||||||
"url": "/api/v1/users/find-users",
|
|
||||||
"dataPath": "data.data.result",
|
|
||||||
"paramFormat": "query",
|
|
||||||
"paramMapping": ["search_type", "search_key"]
|
|
||||||
},
|
|
||||||
"UserInfoView": {
|
|
||||||
"method": "GET",
|
|
||||||
"url": "/api/v1/users/basicinfo",
|
|
||||||
"dataPath": "data.data",
|
|
||||||
"paramFormat": "query",
|
|
||||||
"paramMapping": ["guid"]
|
|
||||||
},
|
|
||||||
"UserChangeNickName": {
|
|
||||||
"method": "PUT",
|
|
||||||
"url": "/api/v1/users/change-nickname",
|
|
||||||
"dataPath": null,
|
|
||||||
"paramFormat": "body",
|
|
||||||
"paramMapping": ["guid", "nickname"]
|
|
||||||
},
|
|
||||||
"UserChangeAdminLevel": {
|
|
||||||
"method": "PUT",
|
|
||||||
"url": "/api/v1/users/change-level",
|
|
||||||
"dataPath": null,
|
|
||||||
"paramFormat": "body",
|
|
||||||
"paramMapping": ["guid", "level"]
|
|
||||||
},
|
|
||||||
"UserKick": {
|
|
||||||
"method": "PUT",
|
|
||||||
"url": "/api/v1/users/user-kick",
|
|
||||||
"dataPath": "data",
|
|
||||||
"paramFormat": "body",
|
|
||||||
"paramMapping": ["guid"]
|
|
||||||
},
|
|
||||||
"UserAvatarView": {
|
|
||||||
"method": "GET",
|
|
||||||
"url": "/api/v1/users/avatarinfo",
|
|
||||||
"dataPath": "data.data",
|
|
||||||
"paramFormat": "query",
|
|
||||||
"paramMapping": ["guid"]
|
|
||||||
},
|
|
||||||
"UserClothView": {
|
|
||||||
"method": "GET",
|
|
||||||
"url": "/api/v1/users/clothinfo",
|
|
||||||
"dataPath": "data.data",
|
|
||||||
"paramFormat": "query",
|
|
||||||
"paramMapping": ["guid"]
|
|
||||||
},
|
|
||||||
"UserToolView": {
|
|
||||||
"method": "GET",
|
|
||||||
"url": "/api/v1/users/toolslot",
|
|
||||||
"dataPath": "data.data",
|
|
||||||
"paramFormat": "query",
|
|
||||||
"paramMapping": ["guid"]
|
|
||||||
},
|
|
||||||
"UserInventoryView": {
|
|
||||||
"method": "GET",
|
|
||||||
"url": "/api/v1/users/inventory",
|
|
||||||
"dataPath": "data.data",
|
|
||||||
"paramFormat": "query",
|
|
||||||
"paramMapping": ["guid"]
|
|
||||||
},
|
|
||||||
"UserInventoryItemDelete": {
|
|
||||||
"method": "DELETE",
|
|
||||||
"url": "/api/v1/users/inventory/delete/item",
|
|
||||||
"dataPath": "data",
|
|
||||||
"paramFormat": "body",
|
|
||||||
"paramMapping": ["guid", "inventory_id"]
|
|
||||||
},
|
|
||||||
"UserTattooView": {
|
|
||||||
"method": "GET",
|
|
||||||
"url": "/api/v1/users/tattoo",
|
|
||||||
"dataPath": "data.data",
|
|
||||||
"paramFormat": "query",
|
|
||||||
"paramMapping": ["guid"]
|
|
||||||
},
|
|
||||||
"UserQuestView": {
|
|
||||||
"method": "GET",
|
|
||||||
"url": "/api/v1/users/quest",
|
|
||||||
"dataPath": "data.data",
|
|
||||||
"paramFormat": "query",
|
|
||||||
"paramMapping": ["guid"]
|
|
||||||
},
|
|
||||||
"UserFriendListView": {
|
|
||||||
"method": "GET",
|
|
||||||
"url": "/api/v1/users/friendlist",
|
|
||||||
"dataPath": "data.data",
|
|
||||||
"paramFormat": "query",
|
|
||||||
"paramMapping": ["guid"]
|
|
||||||
},
|
|
||||||
"UserMailView": {
|
|
||||||
"method": "POST",
|
|
||||||
"url": "/api/v1/users/mail",
|
|
||||||
"dataPath": "data.data",
|
|
||||||
"paramFormat": "body",
|
|
||||||
"paramMapping": ["guid", "page", "limit"]
|
|
||||||
},
|
|
||||||
"UserMailDelete": {
|
|
||||||
"method": "DELETE",
|
|
||||||
"url": "/api/v1/users/mail/delete",
|
|
||||||
"dataPath": "data",
|
|
||||||
"paramFormat": "body",
|
|
||||||
"paramMapping": ["mail_id"]
|
|
||||||
},
|
|
||||||
"UserMailItemDelete": {
|
|
||||||
"method": "DELETE",
|
|
||||||
"url": "/api/v1/users/mail/delete/item",
|
|
||||||
"dataPath": "data",
|
|
||||||
"paramFormat": "body",
|
|
||||||
"paramMapping": ["mail_id", "item_id"]
|
|
||||||
},
|
|
||||||
"UserMailDetailView": {
|
|
||||||
"method": "GET",
|
|
||||||
"url": "/api/v1/users/mail/:id",
|
|
||||||
"dataPath": "data.data",
|
|
||||||
"paramFormat": "path",
|
|
||||||
"paramMapping": ["id"]
|
|
||||||
},
|
|
||||||
"UserMyhomeView": {
|
|
||||||
"method": "GET",
|
|
||||||
"url": "/api/v1/users/myhome",
|
|
||||||
"dataPath": "data.data",
|
|
||||||
"paramFormat": "query",
|
|
||||||
"paramMapping": ["guid"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,6 +5,14 @@ export const benItems = [
|
|||||||
"19010005"
|
"19010005"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const historyBenField = [
|
||||||
|
"create_by",
|
||||||
|
"create_dt",
|
||||||
|
"update_by",
|
||||||
|
"update_dt",
|
||||||
|
"id"
|
||||||
|
]
|
||||||
|
|
||||||
export const HourList = ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23'];
|
export const HourList = ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23'];
|
||||||
|
|
||||||
export const MinuteList = [
|
export const MinuteList = [
|
||||||
@@ -58,11 +66,11 @@ export const STATUS_STYLES = {
|
|||||||
color: 'white'
|
color: 'white'
|
||||||
},
|
},
|
||||||
WAIT: {
|
WAIT: {
|
||||||
background: '#DEBB46',
|
background: '#FAAD14',
|
||||||
color: 'black'
|
color: 'black'
|
||||||
},
|
},
|
||||||
FAIL: {
|
FAIL: {
|
||||||
background: '#D33B27',
|
background: '#ff4d4f',
|
||||||
color: 'white'
|
color: 'white'
|
||||||
},
|
},
|
||||||
FINISH: {
|
FINISH: {
|
||||||
@@ -70,11 +78,11 @@ export const STATUS_STYLES = {
|
|||||||
color: 'black'
|
color: 'black'
|
||||||
},
|
},
|
||||||
REJECT: {
|
REJECT: {
|
||||||
background: '#D33B27',
|
background: '#ff4d4f',
|
||||||
color: 'white'
|
color: 'white'
|
||||||
},
|
},
|
||||||
CANCEL: {
|
CANCEL: {
|
||||||
background: '#D33B27',
|
background: '#ff4d4f',
|
||||||
color: 'white'
|
color: 'white'
|
||||||
},
|
},
|
||||||
RESV_START: {
|
RESV_START: {
|
||||||
@@ -98,7 +106,7 @@ export const STATUS_STYLES = {
|
|||||||
color: 'white'
|
color: 'white'
|
||||||
},
|
},
|
||||||
REGISTER: {
|
REGISTER: {
|
||||||
background: '#DEBB46',
|
background: '#FAAD14',
|
||||||
color: 'black'
|
color: 'black'
|
||||||
},
|
},
|
||||||
STOP: {
|
STOP: {
|
||||||
@@ -113,4 +121,100 @@ export const STATUS_STYLES = {
|
|||||||
background: '#4287f5',
|
background: '#4287f5',
|
||||||
color: 'white'
|
color: 'white'
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const FieldLabels = {
|
||||||
|
// DynamoDB 필드
|
||||||
|
'attribFieldName': '속성 명',
|
||||||
|
'pk': '파티션 키',
|
||||||
|
'sk': '정렬 키',
|
||||||
|
'DocType': '문서 타입',
|
||||||
|
'CreatedDateTime': '생성 일시',
|
||||||
|
'UpdatedDateTime': '수정 일시',
|
||||||
|
'DeletedDateTime': '삭제 일시',
|
||||||
|
'RestoredDateTime': '복원 일시',
|
||||||
|
'INSERT': '등록',
|
||||||
|
'UPDATE': '수정',
|
||||||
|
'DELETE': '삭제',
|
||||||
|
|
||||||
|
//기본
|
||||||
|
'id': 'ID',
|
||||||
|
'userId': '사용자 ID',
|
||||||
|
'userIP': '사용자 IP',
|
||||||
|
'timestamp': '타임스탬프',
|
||||||
|
'message': '메시지',
|
||||||
|
'tranId': '트랜잭션 ID',
|
||||||
|
'group_id': '그룹 ID',
|
||||||
|
'update_dt': '수정 일시',
|
||||||
|
'updateDt': '수정 일시',
|
||||||
|
'update_by': '수정자',
|
||||||
|
'create_dt': '생성 일시',
|
||||||
|
'createDt': '생성 일시',
|
||||||
|
'create_by': '생성자',
|
||||||
|
'status': '상태',
|
||||||
|
'deleted': '삭제 여부',
|
||||||
|
|
||||||
|
// 이벤트 필드 관련
|
||||||
|
'eventId': '이벤트 ID',
|
||||||
|
'eventName': '이벤트 명',
|
||||||
|
'repeatType': '반복 타입',
|
||||||
|
'eventOperationTime': '운영 시간(초)',
|
||||||
|
'eventStartDt': '시작 시간',
|
||||||
|
'eventEndDt': '종료 시간',
|
||||||
|
'roundTime': '라운드 시간(초)',
|
||||||
|
'roundCount': '라운드 수',
|
||||||
|
'hotTime': '핫타임',
|
||||||
|
'configId': '설정 ID',
|
||||||
|
'rewardGroupId': '보상 그룹 ID',
|
||||||
|
'attrib_type': '속성 타입',
|
||||||
|
'event_id': '이벤트 ID',
|
||||||
|
'is_active': '활성화 여부',
|
||||||
|
'start_day': '시작일',
|
||||||
|
'start_hour': '시작 시간',
|
||||||
|
'start_min': '시작 분',
|
||||||
|
'end_date': '종료 일시',
|
||||||
|
'instance_id': '인스턴스 ID',
|
||||||
|
'once_period_type': '주기 타입',
|
||||||
|
'day_of_week_type': '요일 타입',
|
||||||
|
'ffa_config_data_id': 'FFA 설정 ID',
|
||||||
|
'ffa_reward_group_id': 'FFA 보상 그룹 ID',
|
||||||
|
'ffa_hot_time': 'FFA 핫타임',
|
||||||
|
'round_count': '라운드 수',
|
||||||
|
|
||||||
|
//dictionary
|
||||||
|
'max_count': '최대 보유 가능 수량',
|
||||||
|
'stack_max_count': '최대 스택 가능 수량',
|
||||||
|
'expire_type': '아이템 만료 타입',
|
||||||
|
'expire_start_dt': '만료 시작 시간',
|
||||||
|
'expire_end_dt': '만료 종료 시간',
|
||||||
|
'expire_time_sec': '만료 시간 연장 여부',
|
||||||
|
'user_tradable': '유저 간 거래 가능 여부',
|
||||||
|
'system_tradable': '상점에서 판매 가능 여부',
|
||||||
|
'throwable': '버리기 가능 여부',
|
||||||
|
'cart_buy': '상점에서 구매 가능 여부',
|
||||||
|
'rarity': '희귀도',
|
||||||
|
'default_attrib': '기본 속성',
|
||||||
|
'attrib_random_group': '랜덤 그룹',
|
||||||
|
'item_set': '아이템 세트',
|
||||||
|
'buff': '아이템 사용 시 획득 버프',
|
||||||
|
'dress_slot_type': '착용 부위',
|
||||||
|
'product_link': '제품 URL',
|
||||||
|
'prop_small_type': '제작 아이템 그룹',
|
||||||
|
'gacha_group_id': '랜덤박스 그룹 ID',
|
||||||
|
'ugq_action': 'UGQ 사용 가능 여부',
|
||||||
|
'linked_land': '연결된 랜드 ID',
|
||||||
|
};
|
||||||
|
|
||||||
|
export const historyTables = {
|
||||||
|
userBlock: 'black_list',
|
||||||
|
landAuction: 'land_auction',
|
||||||
|
landOwnerChange: 'land_ownership_changes',
|
||||||
|
rewardEvent: 'event',
|
||||||
|
mail: 'mail',
|
||||||
|
notice: 'notice',
|
||||||
|
battleEvent: 'battle_event',
|
||||||
|
caliumRequest: 'calium_request',
|
||||||
|
menuBanner: 'menu_banner',
|
||||||
|
event: 'world_event',
|
||||||
|
rankingSchedule: 'ranking_schedule',
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
export {authType, ivenTabType, modalTypes, TabList, tattooSlot, commonStatus, ViewTitleCountType, landAuctionStatusType} from './types'
|
export {authType, ivenTabType, modalTypes, tattooSlot, commonStatus, ViewTitleCountType, landAuctionStatusType} from './types'
|
||||||
export {
|
export {
|
||||||
mailSendType,
|
mailSendType,
|
||||||
mailType,
|
mailType,
|
||||||
@@ -7,14 +7,14 @@ export {
|
|||||||
adminLevelType,
|
adminLevelType,
|
||||||
logOption,
|
logOption,
|
||||||
eventStatus,
|
eventStatus,
|
||||||
wellType,
|
currencyItemCode,
|
||||||
blockStatus,
|
blockStatus,
|
||||||
blockSanctions,
|
blockSanctions,
|
||||||
blockPeriod,
|
blockPeriod,
|
||||||
blockType,
|
blockType,
|
||||||
caliumStatus,
|
caliumStatus,
|
||||||
landSize,
|
landSize,
|
||||||
userSearchType,
|
userType,
|
||||||
landAuctionStatus,
|
landAuctionStatus,
|
||||||
landSearchType,
|
landSearchType,
|
||||||
CurrencyType,
|
CurrencyType,
|
||||||
@@ -27,5 +27,7 @@ export {
|
|||||||
opYNType,
|
opYNType,
|
||||||
opUserSessionType,
|
opUserSessionType,
|
||||||
opMailType,
|
opMailType,
|
||||||
|
amountDeltaType,
|
||||||
|
TabUserList
|
||||||
} from './options'
|
} from './options'
|
||||||
export {benItems, MinuteList, HourList, caliumRequestInitData, STATUS_STYLES, months, PAGE_SIZE_OPTIONS, ORDER_OPTIONS} from './data'
|
export {benItems, MinuteList, HourList, caliumRequestInitData, STATUS_STYLES, months, PAGE_SIZE_OPTIONS, ORDER_OPTIONS} from './data'
|
||||||
@@ -100,15 +100,7 @@ export const menuConfig = {
|
|||||||
permissions: {
|
permissions: {
|
||||||
read: authType.gameLogRead
|
read: authType.gameLogRead
|
||||||
},
|
},
|
||||||
view: true,
|
view: false,
|
||||||
authLevel: adminAuthLevel.NONE
|
|
||||||
},
|
|
||||||
cryptview: {
|
|
||||||
title: '크립토 조회',
|
|
||||||
permissions: {
|
|
||||||
read: authType.cryptoRead
|
|
||||||
},
|
|
||||||
view: true,
|
|
||||||
authLevel: adminAuthLevel.NONE
|
authLevel: adminAuthLevel.NONE
|
||||||
},
|
},
|
||||||
businesslogview: {
|
businesslogview: {
|
||||||
@@ -118,6 +110,30 @@ export const menuConfig = {
|
|||||||
},
|
},
|
||||||
view: true,
|
view: true,
|
||||||
authLevel: adminAuthLevel.NONE
|
authLevel: adminAuthLevel.NONE
|
||||||
|
},
|
||||||
|
itemdictionary: {
|
||||||
|
title: '아이템 백과사전 조회',
|
||||||
|
permissions: {
|
||||||
|
read: authType.itemDictionaryRead
|
||||||
|
},
|
||||||
|
view: true,
|
||||||
|
authLevel: adminAuthLevel.NONE
|
||||||
|
},
|
||||||
|
craftdictionary: {
|
||||||
|
title: '제작 아이템 조회',
|
||||||
|
permissions: {
|
||||||
|
read: authType.craftingDictionaryRead
|
||||||
|
},
|
||||||
|
view: true,
|
||||||
|
authLevel: adminAuthLevel.NONE
|
||||||
|
},
|
||||||
|
rankmanage: {
|
||||||
|
title: '랭킹 점수 관리',
|
||||||
|
permissions: {
|
||||||
|
read: authType.rankManagerRead
|
||||||
|
},
|
||||||
|
view: true,
|
||||||
|
authLevel: adminAuthLevel.NONE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -154,17 +170,17 @@ export const menuConfig = {
|
|||||||
view: true,
|
view: true,
|
||||||
authLevel: adminAuthLevel.NONE
|
authLevel: adminAuthLevel.NONE
|
||||||
},
|
},
|
||||||
reportlist: {
|
// reportlist: {
|
||||||
title: '신고내역',
|
// title: '신고내역',
|
||||||
permissions: {
|
// permissions: {
|
||||||
read: authType.reportRead,
|
// read: authType.reportRead,
|
||||||
update: authType.reportUpdate,
|
// update: authType.reportUpdate,
|
||||||
delete: authType.reportDelete
|
// delete: authType.reportDelete
|
||||||
},
|
// },
|
||||||
view: true,
|
// view: true,
|
||||||
authLevel: adminAuthLevel.NONE
|
// authLevel: adminAuthLevel.NONE
|
||||||
},
|
// },
|
||||||
event: {
|
rewardevent: {
|
||||||
title: '보상 이벤트 관리',
|
title: '보상 이벤트 관리',
|
||||||
permissions: {
|
permissions: {
|
||||||
read: authType.eventRead,
|
read: authType.eventRead,
|
||||||
@@ -204,16 +220,36 @@ export const menuConfig = {
|
|||||||
view: true,
|
view: true,
|
||||||
authLevel: adminAuthLevel.NONE
|
authLevel: adminAuthLevel.NONE
|
||||||
},
|
},
|
||||||
// menubanner: {
|
menubanner: {
|
||||||
// title: '메뉴 배너 관리',
|
title: '메뉴 배너 관리',
|
||||||
// permissions: {
|
permissions: {
|
||||||
// read: authType.menuBannerRead,
|
read: authType.menuBannerRead,
|
||||||
// update: authType.menuBannerUpdate,
|
update: authType.menuBannerUpdate,
|
||||||
// delete: authType.menuBannerDelete
|
delete: authType.menuBannerDelete
|
||||||
// },
|
},
|
||||||
// view: true,
|
view: true,
|
||||||
// authLevel: adminAuthLevel.NONE
|
authLevel: adminAuthLevel.NONE
|
||||||
// },
|
},
|
||||||
|
ranking: {
|
||||||
|
title: '랭킹 스케줄러',
|
||||||
|
permissions: {
|
||||||
|
read: authType.rankingRead,
|
||||||
|
update: authType.rankingUpdate,
|
||||||
|
delete: authType.rankingDelete
|
||||||
|
},
|
||||||
|
view: true,
|
||||||
|
authLevel: adminAuthLevel.NONE
|
||||||
|
},
|
||||||
|
event: {
|
||||||
|
title: '통합 이벤트 관리',
|
||||||
|
permissions: {
|
||||||
|
read: authType.worldEventRead,
|
||||||
|
update: authType.worldEventUpdate,
|
||||||
|
delete: authType.worldEventDelete
|
||||||
|
},
|
||||||
|
view: true,
|
||||||
|
authLevel: adminAuthLevel.NONE
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -4,6 +4,52 @@ export const languageType = [
|
|||||||
{ value: 'JA', name: '일본어' },
|
{ value: 'JA', name: '일본어' },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const TabUserList = [
|
||||||
|
{ value: 'BASIC', name: '기본정보' },
|
||||||
|
{ value: 'AVATAR', name: '아바타' },
|
||||||
|
{ value: 'CLOTH', name: '의상' },
|
||||||
|
{ value: 'TOOL', name: '도구' },
|
||||||
|
{ value: 'INVENTORY', name: '인벤토리' },
|
||||||
|
{ value: 'MAIL', name: '우편' },
|
||||||
|
{ value: 'MYHOME', name: '마이홈' },
|
||||||
|
{ value: 'FRIEND', name: '친구목록' },
|
||||||
|
{ value: 'TATTOO', name: '타투' },
|
||||||
|
{ value: 'QUEST', name: '퀘스트' }
|
||||||
|
// { value: 'CLAIM', name: '클레임' }
|
||||||
|
];
|
||||||
|
|
||||||
|
export const TabGameLogList = [
|
||||||
|
{ value: 'CURRENCY', name: '재화 로그' },
|
||||||
|
{ value: 'ITEM', name: '아이템 로그' },
|
||||||
|
{ value: 'CURRENCYITEM', name: '재화(아이템) 로그' },
|
||||||
|
{ value: 'USERCREATE', name: '유저생성 로그' },
|
||||||
|
{ value: 'USERLOGIN', name: '유저로그인 로그' },
|
||||||
|
{ value: 'SNAPSHOT', name: '스냅샷 로그' },
|
||||||
|
];
|
||||||
|
|
||||||
|
export const TabEconomicIndexList = [
|
||||||
|
{ value: 'CURRENCY_ACQUIRE', name: '재화 획득' },
|
||||||
|
{ value: 'CURRENCY_CONSUME', name: '재화 소모' },
|
||||||
|
{ value: 'ITEM_ACQUIRE', name: '아이템 획득' },
|
||||||
|
{ value: 'ITEM_CONSUME', name: '아이템 소모' },
|
||||||
|
{ value: 'CURRENCY_ASSETS', name: '재화 보유' },
|
||||||
|
{ value: 'ITEM_ASSETS', name: '아이템 보유' },
|
||||||
|
];
|
||||||
|
|
||||||
|
export const TabUserIndexList = [
|
||||||
|
{ value: 'USER', name: '이용자 지표' },
|
||||||
|
{ value: 'RETENTION', name: '잔존율' },
|
||||||
|
{ value: 'CURRENCY', name: '재화' },
|
||||||
|
// { value: 'SEGMENT', name: 'Segment' },
|
||||||
|
// { value: 'PLAYTIME', name: '플레이타임' },
|
||||||
|
];
|
||||||
|
|
||||||
|
export const TabRankManageList = [
|
||||||
|
{ value: 'PIONEER', name: '개척자 랭킹 보드' },
|
||||||
|
{ value: 'RUN_RACE', name: '점프 러너 랭킹 보드' },
|
||||||
|
{ value: 'BATTLE_OBJECT', name: '컴뱃 존 랭킹 보드' }
|
||||||
|
];
|
||||||
|
|
||||||
export const mailSendType = [
|
export const mailSendType = [
|
||||||
{ value: 'ALL', name: '전체' },
|
{ value: 'ALL', name: '전체' },
|
||||||
{ value: 'RESERVE_SEND', name: '예약 발송' },
|
{ value: 'RESERVE_SEND', name: '예약 발송' },
|
||||||
@@ -81,7 +127,18 @@ export const landAuctionStatus = [
|
|||||||
{ value: 'FAIL', name: '실패' },
|
{ value: 'FAIL', name: '실패' },
|
||||||
];
|
];
|
||||||
|
|
||||||
export const wellType = [
|
export const questStatus = [
|
||||||
|
{ value: 'WAIT', name: '미완료' },
|
||||||
|
{ value: 'COMPLETE', name: '완료' },
|
||||||
|
{ value: 'RUNNING', name: '진행중' },
|
||||||
|
];
|
||||||
|
|
||||||
|
export const questCompleteStatusType = [
|
||||||
|
{ value: 0, name: '미완료' },
|
||||||
|
{ value: 1, name: '완료' }
|
||||||
|
]
|
||||||
|
|
||||||
|
export const currencyItemCode = [
|
||||||
{ value: '19010001', name: '골드' },
|
{ value: '19010001', name: '골드' },
|
||||||
{ value: '19010002', name: '사파이어' },
|
{ value: '19010002', name: '사파이어' },
|
||||||
{ value: '19010005', name: '루비' },
|
{ value: '19010005', name: '루비' },
|
||||||
@@ -129,6 +186,7 @@ export const blockStatus = [
|
|||||||
{ value: 'EXPIRATION', name: '기간만료' },
|
{ value: 'EXPIRATION', name: '기간만료' },
|
||||||
{ value: 'WAIT', name: '대기 중' },
|
{ value: 'WAIT', name: '대기 중' },
|
||||||
{ value: 'FAIL', name: '실패' },
|
{ value: 'FAIL', name: '실패' },
|
||||||
|
{ value: 'CANCEL', name: '해지' },
|
||||||
];
|
];
|
||||||
|
|
||||||
export const blockSanctions = [
|
export const blockSanctions = [
|
||||||
@@ -156,11 +214,21 @@ export const blockPeriod = [
|
|||||||
{ value: 'PERMANENT', name: '영구정지' },
|
{ value: 'PERMANENT', name: '영구정지' },
|
||||||
];
|
];
|
||||||
|
|
||||||
export const userSearchType = [
|
export const userType = [
|
||||||
{ value: 'GUID', name: 'GUID' },
|
{ value: 'GUID', name: 'GUID' },
|
||||||
{ value: 'NAME', name: '닉네임' },
|
{ value: 'NAME', name: '닉네임' },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const userType2 = [
|
||||||
|
{ value: 'GUID', name: 'GUID' },
|
||||||
|
{ value: 'NICKNAME', name: '닉네임' },
|
||||||
|
];
|
||||||
|
|
||||||
|
export const adminUserType = [
|
||||||
|
{ value: 'ID', name: 'ID(이메일)' },
|
||||||
|
{ value: 'NAME', name: '이름' },
|
||||||
|
];
|
||||||
|
|
||||||
export const userSearchType2 = [
|
export const userSearchType2 = [
|
||||||
{ value: 'GUID', name: 'GUID' },
|
{ value: 'GUID', name: 'GUID' },
|
||||||
{ value: 'NICKNAME', name: '닉네임' },
|
{ value: 'NICKNAME', name: '닉네임' },
|
||||||
@@ -172,6 +240,11 @@ export const landSearchType = [
|
|||||||
{ value: 'NAME', name: '랜드명' },
|
{ value: 'NAME', name: '랜드명' },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const itemSearchType = [
|
||||||
|
{ value: 'ID', name: '아이템ID' },
|
||||||
|
{ value: 'NAME', name: '아이템명' },
|
||||||
|
];
|
||||||
|
|
||||||
export const blockType = [
|
export const blockType = [
|
||||||
{ value: '', name: '선택' },
|
{ value: '', name: '선택' },
|
||||||
{ value: 'Access_Restrictions', name: '접근 제한' },
|
{ value: 'Access_Restrictions', name: '접근 제한' },
|
||||||
@@ -194,6 +267,30 @@ export const CurrencyType = [
|
|||||||
{value: 'Ruby', name: '루비' }
|
{value: 'Ruby', name: '루비' }
|
||||||
]
|
]
|
||||||
|
|
||||||
|
export const amountDeltaType = [
|
||||||
|
{value: 'Acquire', name: '획득' },
|
||||||
|
{value: 'Consume', name: '소모' },
|
||||||
|
{value: 'None', name: '' },
|
||||||
|
]
|
||||||
|
|
||||||
|
export const countDeltaType = [
|
||||||
|
{value: 'Acquire', name: '획득' },
|
||||||
|
{value: 'Consume', name: '소모' }
|
||||||
|
]
|
||||||
|
|
||||||
|
export const itemTypeLarge = [
|
||||||
|
{value: 'TOOL', name: '도구' },
|
||||||
|
{value: 'EXPENDABLE', name: '소모품' },
|
||||||
|
{value: 'TICKET', name: '티켓' },
|
||||||
|
{value: 'RAND_BOX', name: '랜덤 박스' },
|
||||||
|
{value: 'CLOTH', name: '의상' },
|
||||||
|
{value: 'AVATAR', name: '아바타' },
|
||||||
|
{value: 'PROP', name: '프랍(오브젝트)' },
|
||||||
|
{value: 'TATTOO', name: '타투' },
|
||||||
|
{value: 'CURRENCY', name: '재화' },
|
||||||
|
{value: 'SET_BOX', name: '세트 박스' }
|
||||||
|
]
|
||||||
|
|
||||||
export const battleEventStatus = [
|
export const battleEventStatus = [
|
||||||
{ value: 'ALL', name: '전체' },
|
{ value: 'ALL', name: '전체' },
|
||||||
{ value: 'WAIT', name: '대기' },
|
{ value: 'WAIT', name: '대기' },
|
||||||
@@ -309,6 +406,19 @@ export const opItemRestore = [
|
|||||||
{ value: 'IMPOSSIBLE', name: '불가능' },
|
{ value: 'IMPOSSIBLE', name: '불가능' },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const opPropSmallType = [
|
||||||
|
{ value: 'ALL', name: '전체' },
|
||||||
|
{ value: 'FURNITURE', name: 'FURNITURE' },
|
||||||
|
{ value: 'COOKING', name: 'COOKING' },
|
||||||
|
{ value: 'CLOTHES', name: 'CLOTHES' },
|
||||||
|
];
|
||||||
|
|
||||||
|
export const opPropRecipeType = [
|
||||||
|
{ value: 'ALL', name: '전체' },
|
||||||
|
{ value: 'Basic', name: '기본' },
|
||||||
|
{ value: 'Add', name: '등록 필요' },
|
||||||
|
];
|
||||||
|
|
||||||
export const opEquipType = [
|
export const opEquipType = [
|
||||||
{ value: 0, name: '미장착' },
|
{ value: 0, name: '미장착' },
|
||||||
{ value: 1, name: '의상장착' },
|
{ value: 1, name: '의상장착' },
|
||||||
@@ -316,7 +426,7 @@ export const opEquipType = [
|
|||||||
{ value: 3, name: '타투장착' },
|
{ value: 3, name: '타투장착' },
|
||||||
]
|
]
|
||||||
|
|
||||||
export const opItemType = [
|
export const opItemLargeType = [
|
||||||
{ value: 'TOOL', name: '도구' },
|
{ value: 'TOOL', name: '도구' },
|
||||||
{ value: 'EXPENDABLE', name: '소모품' },
|
{ value: 'EXPENDABLE', name: '소모품' },
|
||||||
{ value: 'TICKET', name: '티켓' },
|
{ value: 'TICKET', name: '티켓' },
|
||||||
@@ -328,6 +438,220 @@ export const opItemType = [
|
|||||||
{ value: 'CURRENCY', name: '재화' },
|
{ value: 'CURRENCY', name: '재화' },
|
||||||
{ value: 'PRODUCT', name: '제품' },
|
{ value: 'PRODUCT', name: '제품' },
|
||||||
{ value: 'BEAUTY', name: '뷰티' },
|
{ value: 'BEAUTY', name: '뷰티' },
|
||||||
|
{ value: 'SET_BOX', name: '세트 박스' },
|
||||||
|
]
|
||||||
|
|
||||||
|
export const opItemSmallType = [
|
||||||
|
{ value: 'HANDMIRROR', name: '손거울' },
|
||||||
|
{ value: 'LIGHTSTICK', name: '응원봉' },
|
||||||
|
{ value: 'FIRECRACKER', name: '폭죽총' },
|
||||||
|
{ value: 'LIGHTSABER', name: '광선검' },
|
||||||
|
{ value: 'REGISTER_ITEM_SOCIAL_ACTION', name: '소셜액션 등록형 아이템' },
|
||||||
|
{ value: 'REGISTER_ITEM_INTERIOR', name: '인테리어 등록형 아이템' },
|
||||||
|
{ value: 'SAIYAN_AURA', name: '초사이어인 오라' },
|
||||||
|
{ value: 'TICKET', name: '소모형 티켓' },
|
||||||
|
{ value: 'RANDOMBOX', name: '골드(재화) 가챠 랜덤 박스' },
|
||||||
|
{ value: 'SHIRT', name: '상의' },
|
||||||
|
{ value: 'DRESS', name: '드레스' },
|
||||||
|
{ value: 'OUTER', name: '겉옷' },
|
||||||
|
{ value: 'PANTS', name: '하의' },
|
||||||
|
{ value: 'GLOVES', name: '장갑' },
|
||||||
|
{ value: 'RING', name: '반지' },
|
||||||
|
{ value: 'BRACELET', name: '팔찌' },
|
||||||
|
{ value: 'BAG', name: '가방(크로스백)' },
|
||||||
|
{ value: 'BACKPACK', name: '가방(백팩)' },
|
||||||
|
{ value: 'CAP', name: '모자' },
|
||||||
|
{ value: 'MASK', name: '가면' },
|
||||||
|
{ value: 'GLASSES', name: '안경' },
|
||||||
|
{ value: 'EARRING', name: '귀걸이' },
|
||||||
|
{ value: 'NECKLACE', name: '목걸이' },
|
||||||
|
{ value: 'SHOES', name: '신발' },
|
||||||
|
{ value: 'SOCKS', name: '양말' },
|
||||||
|
{ value: 'ANKLET', name: '발찌' },
|
||||||
|
{ value: 'OFFICECHAIR', name: '의자' },
|
||||||
|
{ value: 'WALLMOUNTTV', name: '벽걸이TV' },
|
||||||
|
{ value: 'OUTDOORCHAIR', name: '야외용의자' },
|
||||||
|
{ value: 'TV', name: 'TV' },
|
||||||
|
{ value: 'VIGNETTE', name: '소품' },
|
||||||
|
{ value: 'COOKWARE', name: '조리도구' },
|
||||||
|
{ value: 'KITCHEN_TOOL', name: '부엌도구' },
|
||||||
|
{ value: 'LAPTOP', name: '노트북' },
|
||||||
|
{ value: 'OUTDOOR_GOODS', name: '캠핑도구' },
|
||||||
|
{ value: 'BED', name: '침대' },
|
||||||
|
{ value: 'DECO', name: '소형장식품' },
|
||||||
|
{ value: 'FURNITURE', name: '(러그)가구' },
|
||||||
|
{ value: 'MUSIC', name: '악기/음향' },
|
||||||
|
{ value: 'SHELF_S', name: '소형 선반(TV다이)' },
|
||||||
|
{ value: 'SHELF_L', name: '대형 선반(금고,책장)' },
|
||||||
|
{ value: 'SOFA_SINGLE', name: '1인용 소파' },
|
||||||
|
{ value: 'SOFA_COUCH', name: '카우치 소파' },
|
||||||
|
{ value: 'LIGHT_CEILING', name: '천정 조명' },
|
||||||
|
{ value: 'LIGHT_FLOOR', name: '스탠드 조명' },
|
||||||
|
{ value: 'LIGHT_TABLE', name: '탁상 조명' },
|
||||||
|
{ value: 'LIGHT_PENDENT', name: '팬던트 조명' },
|
||||||
|
{ value: 'TABLE_S', name: '소형 테이블' },
|
||||||
|
{ value: 'TABLE_L', name: '대형 테이블' },
|
||||||
|
{ value: 'TABLE_LIVINGROOM', name: '거실 테이블' },
|
||||||
|
{ value: 'TABLE_OFFICE', name: '사무용 테이블' },
|
||||||
|
{ value: 'LEISURE_APPLIANCE', name: '스포츠/여가' },
|
||||||
|
{ value: 'INDUCTION', name: '인덕션' },
|
||||||
|
{ value: 'MICROWAVE', name: '전자레인지' },
|
||||||
|
{ value: 'LARGE_APPLIANCE', name: '대형가전' },
|
||||||
|
{ value: 'COSMETIC', name: '화장품' },
|
||||||
|
{ value: 'CHEST', name: '앞면' },
|
||||||
|
{ value: 'LEFT_ARM', name: '왼팔' },
|
||||||
|
{ value: 'RIGHT_ARM', name: '오른팔' },
|
||||||
|
{ value: 'BACK', name: '후면' },
|
||||||
|
{ value: 'LEFT_LEG', name: '왼다리' },
|
||||||
|
{ value: 'RIGHT_LEG', name: '오른다리' },
|
||||||
|
{ value: 'CARTRIDGE', name: '속성 카트리지' },
|
||||||
|
{ value: 'BUFF_DRINK', name: '드링크(물약) 아이템' },
|
||||||
|
{ value: 'INTERPHONE', name: '인터폰' },
|
||||||
|
{ value: 'MEGAPHONE', name: '확성기' },
|
||||||
|
{ value: 'CURRENCY', name: 'CURRENCY' },
|
||||||
|
{ value: 'NFTLAND', name: 'NFTLAND' },
|
||||||
|
{ value: 'SUMMONSTONE', name: '소환석' },
|
||||||
|
{ value: 'GOLD', name: '골드' },
|
||||||
|
{ value: 'SAPPHIRE', name: '사파이어' },
|
||||||
|
{ value: 'CALIUM', name: '칼리움' },
|
||||||
|
{ value: 'BEAM', name: '빔' },
|
||||||
|
{ value: 'RUBY', name: '루비' },
|
||||||
|
{ value: 'LIGHT_LIMITED', name: '언리얼 라이트 사용 조명' },
|
||||||
|
{ value: 'SPEAKER', name: '재생 기능성 스피커' },
|
||||||
|
{ value: 'SETBOX', name: '세트박스' },
|
||||||
|
{ value: 'DRESS_SHOES', name: '드레스+신발' },
|
||||||
|
{ value: 'SHOULDERBAG', name: '숄더백' },
|
||||||
|
{ value: 'RECIPE', name: '레시피' }
|
||||||
|
]
|
||||||
|
|
||||||
|
export const opGender = [
|
||||||
|
{ value: 'MALE', name: '남성' },
|
||||||
|
{ value: 'FEMALE', name: '여성' },
|
||||||
|
]
|
||||||
|
|
||||||
|
export const opHistoryType = [
|
||||||
|
{ value: '', name: '전체' },
|
||||||
|
{ value: 'LOGIN_PERMITTED', name: '로그인 승인' },
|
||||||
|
{ value: 'ADMIN_INFO_UPDATE', name: '운영자 정보 수정' },
|
||||||
|
{ value: 'ADMIN_INFO_DELETE', name: '운영자 정보 삭제' },
|
||||||
|
{ value: 'PASSWORD_INIT', name: '비밀번호 초기화' },
|
||||||
|
{ value: 'USER_INFO_UPDATE', name: '유저 정보 변경' },
|
||||||
|
{ value: 'GROUP_AUTH_UPDATE', name: '그룹 권한 수정' },
|
||||||
|
{ value: 'GROUP_DELETE', name: '그룹 삭제' },
|
||||||
|
{ value: 'NOTICE_DELETE', name: '공지사항 삭제' },
|
||||||
|
{ value: 'NOTICE_ADD', name: '공지사항 등록' },
|
||||||
|
{ value: 'NOTICE_UPDATE', name: '공지사항 수정' },
|
||||||
|
{ value: 'NOTICE_SEND_FAIL', name: '공지사항 전송 실패' },
|
||||||
|
{ value: 'MAIL_DELETE', name: '우편 삭제' },
|
||||||
|
{ value: 'MAIL_ADD', name: '우편 등록' },
|
||||||
|
{ value: 'MAIL_UPDATE', name: '우편 수정' },
|
||||||
|
{ value: 'MAIL_SEND', name: '우편 전송' },
|
||||||
|
{ value: 'MAIL_SEND_FAIL', name: '우편 전송 실패' },
|
||||||
|
{ value: 'MAIL_ITEM_DELETE', name: '우편 아이템 삭제' },
|
||||||
|
{ value: 'MAIL_ITEM_UPDATE', name: '우편 아이템 수정' },
|
||||||
|
{ value: 'BLACKLIST_ADD', name: '유저 제재 등록' },
|
||||||
|
{ value: 'BLACKLIST_UPDATE', name: '유저 제재 수정' },
|
||||||
|
{ value: 'BLACKLIST_DELETE', name: '유저 제재 삭제' },
|
||||||
|
{ value: 'REPORT_DELETE', name: '신고내역 삭제' },
|
||||||
|
{ value: 'USER_ITEM_DELETE', name: '유저 아이템 삭제' },
|
||||||
|
{ value: 'SCHEDULE_MAIL_FAIL', name: '메일 스케줄 실패' },
|
||||||
|
{ value: 'SCHEDULE_NOTICE_FAIL', name: '공지 스케줄 실패' },
|
||||||
|
{ value: 'SCHEDULE_EVENT_FAIL', name: '이벤트 스케줄 실패' },
|
||||||
|
{ value: 'USER_MAIL_DELETE', name: '유저 메일 삭제' },
|
||||||
|
{ value: 'INVENTORY_ITEM_DELETE', name: '인벤토리 아이템 삭제' },
|
||||||
|
{ value: 'INVENTORY_ITEM_UPDATE', name: '인벤토리 아이템 수정' },
|
||||||
|
{ value: 'EVENT_ADD', name: '이벤트 등록' },
|
||||||
|
{ value: 'EVENT_UPDATE', name: '이벤트 수정' },
|
||||||
|
{ value: 'EVENT_DELETE', name: '이벤트 삭제' },
|
||||||
|
{ value: 'CALIUM_ADD', name: '칼리움 요청 등록' },
|
||||||
|
{ value: 'CALIUM_SAVE', name: '칼리움 저장' },
|
||||||
|
{ value: 'CALIUM_TRANSFER', name: '칼리움 전송' },
|
||||||
|
{ value: 'CALIUM_TOTAL_UPDATE', name: '칼리움 충전' },
|
||||||
|
{ value: 'LAND_AUCTION_ADD', name: '랜드경매 등록' },
|
||||||
|
{ value: 'LAND_AUCTION_UPDATE', name: '랜드경매 수정' },
|
||||||
|
{ value: 'LAND_AUCTION_DELETE', name: '랜드경매 삭제' },
|
||||||
|
{ value: 'BATTLE_EVENT_ADD', name: '전투시스템 이벤트 등록' },
|
||||||
|
{ value: 'BATTLE_EVENT_UPDATE', name: '전투시스템 이벤트 수정' },
|
||||||
|
{ value: 'BATTLE_EVENT_DELETE', name: '전투시스템 이벤트 삭제' },
|
||||||
|
{ value: 'LAND_OWNER_CHANGE_ADD', name: '랜드 소유권 변경 등록' },
|
||||||
|
{ value: 'LAND_OWNER_CHANGE_UPDATE', name: '랜드 소유권 변경 수정' },
|
||||||
|
{ value: 'LAND_OWNER_CHANGE_DELETE', name: '랜드 소유권 변경 예약 취소' },
|
||||||
|
{ value: 'LAND_OWNER_CHANGE_MAIL', name: '랜드 소유권 변경 우편' },
|
||||||
|
{ value: 'LAND_OWNED_INITIALIZE', name: '랜드 소유권 정보 초기화' },
|
||||||
|
{ value: 'LAND_DESC_INITIALIZE', name: '랜드 정보 초기화' },
|
||||||
|
{ value: 'LAND_AUCTION_INITIALIZE', name: '랜드 경매 초기화' },
|
||||||
|
{ value: 'MENU_BANNER_ADD', name: '메뉴 배너 등록' },
|
||||||
|
{ value: 'MENU_BANNER_UPDATE', name: '메뉴 배너 수정' },
|
||||||
|
{ value: 'MENU_BANNER_DELETE', name: '메뉴 배너 삭제' },
|
||||||
|
{ value: 'ITEM_UPDATE', name: '아이템 수정' },
|
||||||
|
{ value: 'ITEM_DELETE', name: '아이템 삭제' },
|
||||||
|
{ value: 'USER_ADMIN_AUTH_UPDATE', name: '유저 관리자 권한 수정' },
|
||||||
|
{ value: 'NICKNAME_REGISTRY_DELETE', name: '닉네임 레지스트리 삭제' },
|
||||||
|
{ value: 'NICKNAME_REGISTRY_ADD', name: '닉네임 레지스트리 등록' },
|
||||||
|
{ value: 'NICKNAME_UPDATE', name: '닉네임 수정' },
|
||||||
|
{ value: 'DATA_INIT_ADD', name: '데이터 초기화 등록' },
|
||||||
|
];
|
||||||
|
|
||||||
|
export const opDBType = [
|
||||||
|
{ value: '', name: '전체'},
|
||||||
|
{ value: 'dynamoDB', name: 'dynamoDB'},
|
||||||
|
{ value: 'MySql', name: 'MySql'},
|
||||||
|
]
|
||||||
|
|
||||||
|
export const opLogCategory = [
|
||||||
|
{ value: 'SCHEDULER', name: '스케줄러'},
|
||||||
|
{ value: 'DYNAMODB', name: 'DynamoDB'},
|
||||||
|
{ value: 'MARIADB', name: 'MariaDB'},
|
||||||
|
{ value: 'MESSAGE_QUEUE', name: '메시지큐'},
|
||||||
|
{ value: 'REDIS', name: 'Redis'},
|
||||||
|
{ value: 'S3', name: 'S3'},
|
||||||
|
{ value: 'BATCH_JOB', name: '배치잡'},
|
||||||
|
]
|
||||||
|
|
||||||
|
export const opLogAction = [
|
||||||
|
{ value: 'KICK_USER', name: '유저킥' },
|
||||||
|
{ value: 'ADMIN_LEVEL', name: 'GM 레벨' },
|
||||||
|
{ value: 'NICKNAME_CHANGE', name: '아바타명 변경' },
|
||||||
|
{ value: 'MAIL_ITEM', name: '메일 아이템' },
|
||||||
|
{ value: 'QUEST_TASK', name: '퀘스트 Task' },
|
||||||
|
{ value: 'SCHEDULE_CLEANUP', name: '스케줄 캐시정리' },
|
||||||
|
{ value: 'SCHEDULE_DATA_INIT', name: '스케줄 데이터 초기화' },
|
||||||
|
{ value: 'SCHEDULE_LAND_OWNER_CHANGE', name: '스케줄 랜드 소유자 변경' },
|
||||||
|
{ value: 'SCHEDULE_BLACK_LIST', name: '스케줄 이용자 제재' },
|
||||||
|
{ value: 'SCHEDULE_NOTICE', name: '스케줄 인게임메시지' },
|
||||||
|
{ value: 'SCHEDULE_MAIL', name: '스케줄 우편' },
|
||||||
|
{ value: 'SCHEDULE_EVENT', name: '스케줄 이벤트' },
|
||||||
|
{ value: 'SCHEDULE_BATTLE_EVENT', name: '스케줄 전투 이벤트' },
|
||||||
|
{ value: 'SCHEDULE_LAND_AUCTION', name: '스케줄 랜드 경매' },
|
||||||
|
{ value: 'BANNER', name: '메뉴 배너' },
|
||||||
|
{ value: 'BATTLE_EVENT', name: '전투 이벤트' },
|
||||||
|
{ value: 'BUILDING', name: '빌딩' },
|
||||||
|
{ value: 'LAND_OWNER_CHANGE', name: '랜드 소유자 변경' },
|
||||||
|
{ value: 'LAND_AUCTION', name: '랜드 경매' },
|
||||||
|
{ value: 'GROUP', name: '그룹' },
|
||||||
|
{ value: 'ADMIN', name: '운영자' },
|
||||||
|
{ value: 'ADMIN_GROUP', name: '운영자 그룹' },
|
||||||
|
{ value: 'ADMIN_DELETE', name: '운영자 삭제' },
|
||||||
|
{ value: 'AUTH_ADMIN', name: '운영자 권한' },
|
||||||
|
{ value: 'PASSWORD_INIT', name: '비밀번호 초기화' },
|
||||||
|
{ value: 'PASSWORD_CHANGE', name: '비밀번호 변경' },
|
||||||
|
{ value: 'BLACK_LIST', name: '이용자 제재' },
|
||||||
|
{ value: 'CALIUM_REQUEST', name: '칼리움 요청' },
|
||||||
|
{ value: 'EVENT', name: '이벤트' },
|
||||||
|
{ value: 'MAIL', name: '우편' },
|
||||||
|
{ value: 'NOTICE', name: '인게임메시지' },
|
||||||
|
{ value: 'DATA_INIT', name: '데이터 초기화' },
|
||||||
|
{ value: 'DATA', name: '데이터' },
|
||||||
|
{ value: 'USER', name: '사용자' },
|
||||||
|
{ value: 'ITEM', name: '아이템' }
|
||||||
|
]
|
||||||
|
|
||||||
|
export const opCommonStatus = [
|
||||||
|
{ value: 'SUCCESS', name: '성공' },
|
||||||
|
{ value: 'FAIL', name: '실패' },
|
||||||
|
{ value: 'WAIT', name: '대기' },
|
||||||
|
{ value: 'END', name: '종료' },
|
||||||
|
{ value: 'RUNNING', name: '진행중' },
|
||||||
]
|
]
|
||||||
|
|
||||||
// export const logAction = [
|
// export const logAction = [
|
||||||
@@ -626,6 +950,7 @@ export const opItemType = [
|
|||||||
|
|
||||||
export const logAction = [
|
export const logAction = [
|
||||||
{ value: "None", name: "전체" },
|
{ value: "None", name: "전체" },
|
||||||
|
{ value: "AdminToolQuestTaskForceComplete", name: "AdminToolQuestTaskForceComplete" },
|
||||||
{ value: "AIChatDeleteCharacter", name: "AIChatDeleteCharacter" },
|
{ value: "AIChatDeleteCharacter", name: "AIChatDeleteCharacter" },
|
||||||
{ value: "AIChatDeleteUser", name: "AIChatDeleteUser" },
|
{ value: "AIChatDeleteUser", name: "AIChatDeleteUser" },
|
||||||
{ value: "AIChatGetCharacter", name: "AIChatGetCharacter" },
|
{ value: "AIChatGetCharacter", name: "AIChatGetCharacter" },
|
||||||
@@ -652,12 +977,20 @@ export const logAction = [
|
|||||||
{ value: "BeaconCreate", name: "BeaconCreate" },
|
{ value: "BeaconCreate", name: "BeaconCreate" },
|
||||||
{ value: "BeaconEdit", name: "BeaconEdit" },
|
{ value: "BeaconEdit", name: "BeaconEdit" },
|
||||||
{ value: "BeaconSell", name: "BeaconSell" },
|
{ value: "BeaconSell", name: "BeaconSell" },
|
||||||
{ value: "BrokerApiAdmin", name: "BrokerApiAdmin" },
|
{ value: "BeaconShopRegisterItem", name: "BeaconShopRegisterItem" },
|
||||||
|
{ value: "BeaconShopReturnItem", name: "BeaconShopReturnItem" },
|
||||||
|
{ value: "BeaconShopPurchaseItem", name: "BeaconShopPurchaseItem" },
|
||||||
|
{ value: "BeaconShopReceivePaymentForSales", name: "BeaconShopReceivePaymentForSales" },
|
||||||
|
{ value: "BeaconShopSearchItem", name: "BeaconShopSearchItem" },
|
||||||
|
{ value: "BeaconShopUpdateDailyCount", name: "BeaconShopUpdateDailyCount" },
|
||||||
|
{ value: "BeaconShopDeleteRecord", name: "BeaconShopDeleteRecord" },
|
||||||
|
{ value: "BeaconShopDeactiveItems", name: "BeaconShopDeactiveItems" },
|
||||||
|
// { value: "BrokerApiAdmin", name: "BrokerApiAdmin" },
|
||||||
{ value: "BrokerApiPlanetAuth", name: "BrokerApiPlanetAuth" },
|
{ value: "BrokerApiPlanetAuth", name: "BrokerApiPlanetAuth" },
|
||||||
{ value: "BrokerApiUserExchangeOrderCompleted", name: "BrokerApiUserExchangeOrderCompleted" },
|
{ value: "BrokerApiUserExchangeOrderCompleted", name: "BrokerApiUserExchangeOrderCompleted" },
|
||||||
{ value: "BrokerApiUserExchangeOrderCreated", name: "BrokerApiUserExchangeOrderCreated" },
|
{ value: "BrokerApiUserExchangeOrderCreated", name: "BrokerApiUserExchangeOrderCreated" },
|
||||||
{ value: "BrokerApiUserSystemMailSend", name: "BrokerApiUserSystemMailSend" },
|
// { value: "BrokerApiUserSystemMailSend", name: "BrokerApiUserSystemMailSend" },
|
||||||
{ value: "BrokerApiUserEchoSystemRequest", name: "BrokerApiUserEchoSystemRequest" },
|
// { value: "BrokerApiUserEchoSystemRequest", name: "BrokerApiUserEchoSystemRequest" },
|
||||||
{ value: "BrokerApiUserLogin", name: "BrokerApiUserLogin" },
|
{ value: "BrokerApiUserLogin", name: "BrokerApiUserLogin" },
|
||||||
{ value: "BuffAdd", name: "BuffAdd" },
|
{ value: "BuffAdd", name: "BuffAdd" },
|
||||||
{ value: "BuffDelete", name: "BuffDelete" },
|
{ value: "BuffDelete", name: "BuffDelete" },
|
||||||
@@ -702,9 +1035,12 @@ export const logAction = [
|
|||||||
{ value: "CheatCommandSendMail", name: "CheatCommandSendMail" },
|
{ value: "CheatCommandSendMail", name: "CheatCommandSendMail" },
|
||||||
{ value: "CheatCommandShopProductInit", name: "CheatCommandShopProductInit" },
|
{ value: "CheatCommandShopProductInit", name: "CheatCommandShopProductInit" },
|
||||||
{ value: "CheatCommandShopProductRenewal", name: "CheatCommandShopProductRenewal" },
|
{ value: "CheatCommandShopProductRenewal", name: "CheatCommandShopProductRenewal" },
|
||||||
|
{ value: "CheatCommandBeaconShopItemTimeChange", name: "CheatCommandBeaconShopItemTimeChange" },
|
||||||
|
{ value: "CheatCommandDailyLimitInit", name: "CheatCommandDailyLimitInit" },
|
||||||
{ value: "ClaimReward", name: "ClaimReward" },
|
{ value: "ClaimReward", name: "ClaimReward" },
|
||||||
{ value: "ConvertCalium", name: "ConvertCalium" },
|
{ value: "ConvertCalium", name: "ConvertCalium" },
|
||||||
{ value: "ConvertExchangeCalium", name: "ConvertExchangeCalium" },
|
{ value: "ConvertExchangeCalium", name: "ConvertExchangeCalium" },
|
||||||
|
{ value: "ContentsMove", name: "ContentsMove" },
|
||||||
{ value: "CraftFinish", name: "CraftFinish" },
|
{ value: "CraftFinish", name: "CraftFinish" },
|
||||||
{ value: "CraftHelp", name: "CraftHelp" },
|
{ value: "CraftHelp", name: "CraftHelp" },
|
||||||
{ value: "CraftRecipeRegister", name: "CraftRecipeRegister" },
|
{ value: "CraftRecipeRegister", name: "CraftRecipeRegister" },
|
||||||
@@ -731,6 +1067,12 @@ export const logAction = [
|
|||||||
{ value: "FriendAdd", name: "FriendAdd" },
|
{ value: "FriendAdd", name: "FriendAdd" },
|
||||||
{ value: "FriendDelete", name: "FriendDelete" },
|
{ value: "FriendDelete", name: "FriendDelete" },
|
||||||
{ value: "GainLandProfit", name: "GainLandProfit" },
|
{ value: "GainLandProfit", name: "GainLandProfit" },
|
||||||
|
{ value: "GameModeObjectInteraction", name: "GameModeObjectInteraction" },
|
||||||
|
{ value: "GameModeObjectStateUpdate", name: "GameModeObjectStateUpdate" },
|
||||||
|
{ value: "GameModeUserDead", name: "GameModeUserDead" },
|
||||||
|
{ value: "GameModeUserRespawn", name: "GameModeUserRespawn" },
|
||||||
|
{ value: "GameModePenalty", name: "GameModePenalty" },
|
||||||
|
{ value: "GameModeAddMatchCount", name: "GameModeAddMatchCount" },
|
||||||
{ value: "InviteParty", name: "InviteParty" },
|
{ value: "InviteParty", name: "InviteParty" },
|
||||||
{ value: "ItemBuy", name: "ItemBuy" },
|
{ value: "ItemBuy", name: "ItemBuy" },
|
||||||
{ value: "ItemDestroy", name: "ItemDestroy" },
|
{ value: "ItemDestroy", name: "ItemDestroy" },
|
||||||
@@ -738,6 +1080,8 @@ export const logAction = [
|
|||||||
{ value: "ItemTattooChangeAttribute", name: "ItemTattooChangeAttribute" },
|
{ value: "ItemTattooChangeAttribute", name: "ItemTattooChangeAttribute" },
|
||||||
{ value: "ItemTattooLevelUp", name: "ItemTattooLevelUp" },
|
{ value: "ItemTattooLevelUp", name: "ItemTattooLevelUp" },
|
||||||
{ value: "ItemUse", name: "ItemUse" },
|
{ value: "ItemUse", name: "ItemUse" },
|
||||||
|
{ value: "ItemDestroyByUser", name: "ItemDestroyByUser" },
|
||||||
|
{ value: "ItemDestoryByExpiration", name: "ItemDestoryByExpiration" },
|
||||||
{ value: "JoinInstance", name: "JoinInstance" },
|
{ value: "JoinInstance", name: "JoinInstance" },
|
||||||
{ value: "JoinParty", name: "JoinParty" },
|
{ value: "JoinParty", name: "JoinParty" },
|
||||||
{ value: "JoinPartyInstance", name: "JoinPartyInstance" },
|
{ value: "JoinPartyInstance", name: "JoinPartyInstance" },
|
||||||
@@ -759,12 +1103,21 @@ export const logAction = [
|
|||||||
{ value: "MailRead", name: "MailRead" },
|
{ value: "MailRead", name: "MailRead" },
|
||||||
{ value: "MailSend", name: "MailSend" },
|
{ value: "MailSend", name: "MailSend" },
|
||||||
{ value: "MailTaken", name: "MailTaken" },
|
{ value: "MailTaken", name: "MailTaken" },
|
||||||
|
{ value: "MatchReserve", name: "MatchReserve" },
|
||||||
|
{ value: "MatchCancel", name: "MatchCancel" },
|
||||||
|
{ value: "MatchResult", name: "MatchResult" },
|
||||||
|
{ value: "MatchRoomUserJoin", name: "MatchRoomUserJoin" },
|
||||||
|
{ value: "MatchRoomUserQuit", name: "MatchRoomUserQuit" },
|
||||||
|
{ value: "MatchRoomCreate", name: "MatchRoomCreate" },
|
||||||
|
{ value: "MatchRoomUpdate", name: "MatchRoomUpdate" },
|
||||||
|
{ value: "MatchRoomDestroy", name: "MatchRoomDestroy" },
|
||||||
{ value: "ModifyLandInfo", name: "ModifyLandInfo" },
|
{ value: "ModifyLandInfo", name: "ModifyLandInfo" },
|
||||||
{ value: "MoneyChange", name: "MoneyChange" },
|
{ value: "MoneyChange", name: "MoneyChange" },
|
||||||
|
{ value: "MoveToBeacon", name: "MoveToBeacon" },
|
||||||
{ value: "ProductGive", name: "ProductGive" },
|
{ value: "ProductGive", name: "ProductGive" },
|
||||||
{ value: "ProductOpenFailed", name: "ProductOpenFailed" },
|
{ value: "ProductOpenFailed", name: "ProductOpenFailed" },
|
||||||
{ value: "ProductOpenSuccess", name: "ProductOpenSuccess" },
|
{ value: "ProductOpenSuccess", name: "ProductOpenSuccess" },
|
||||||
{ value: "QuestMailSend", name: "QuestMailSend" },
|
{ value: "QuestMainAssign", name: "QuestMainAssign" },
|
||||||
{ value: "QuestMainAbort", name: "QuestMainAbort" },
|
{ value: "QuestMainAbort", name: "QuestMainAbort" },
|
||||||
{ value: "QuestMainAssignByDialogue", name: "QuestMainAssignByDialogue" },
|
{ value: "QuestMainAssignByDialogue", name: "QuestMainAssignByDialogue" },
|
||||||
{ value: "QuestMainAssignForce", name: "QuestMainAssignForce" },
|
{ value: "QuestMainAssignForce", name: "QuestMainAssignForce" },
|
||||||
@@ -772,6 +1125,7 @@ export const logAction = [
|
|||||||
{ value: "QuestMainRepeatTimeInit", name: "QuestMainRepeatTimeInit" },
|
{ value: "QuestMainRepeatTimeInit", name: "QuestMainRepeatTimeInit" },
|
||||||
{ value: "QuestMainRepeatTimeRefresh", name: "QuestMainRepeatTimeRefresh" },
|
{ value: "QuestMainRepeatTimeRefresh", name: "QuestMainRepeatTimeRefresh" },
|
||||||
{ value: "QuestMainReward", name: "QuestMainReward" },
|
{ value: "QuestMainReward", name: "QuestMainReward" },
|
||||||
|
{ value: "QuestMailSend", name: "QuestMailSend" },
|
||||||
{ value: "QuestMainTask", name: "QuestMainTask" },
|
{ value: "QuestMainTask", name: "QuestMainTask" },
|
||||||
{ value: "QuestTaskUpdate", name: "QuestTaskUpdate" },
|
{ value: "QuestTaskUpdate", name: "QuestTaskUpdate" },
|
||||||
{ value: "RefuseFriendRequest", name: "RefuseFriendRequest" },
|
{ value: "RefuseFriendRequest", name: "RefuseFriendRequest" },
|
||||||
@@ -783,6 +1137,11 @@ export const logAction = [
|
|||||||
{ value: "ReplySummonParty", name: "ReplySummonParty" },
|
{ value: "ReplySummonParty", name: "ReplySummonParty" },
|
||||||
{ value: "ReservationEnterToServer", name: "ReservationEnterToServer" },
|
{ value: "ReservationEnterToServer", name: "ReservationEnterToServer" },
|
||||||
{ value: "RewardProp", name: "RewardProp" },
|
{ value: "RewardProp", name: "RewardProp" },
|
||||||
|
{ value: "RunRaceFinishReward", name: "RunRaceFinishReward" },
|
||||||
|
{ value: "RunRaceRespawnReward", name: "RunRaceRespawnReward" },
|
||||||
|
{ value: "RunRaceUnFinishReward", name: "RunRaceUnFinishReward" },
|
||||||
|
{ value: "RunRaceCheckPointAbusing", name: "RunRaceCheckPointAbusing" },
|
||||||
|
{ value: "RunRaceResultSummary", name: "RunRaceResultSummary" },
|
||||||
{ value: "SaveMyhome", name: "SaveMyhome" },
|
{ value: "SaveMyhome", name: "SaveMyhome" },
|
||||||
{ value: "SeasonPassBuyCharged", name: "SeasonPassBuyCharged" },
|
{ value: "SeasonPassBuyCharged", name: "SeasonPassBuyCharged" },
|
||||||
{ value: "SeasonPassStartNew", name: "SeasonPassStartNew" },
|
{ value: "SeasonPassStartNew", name: "SeasonPassStartNew" },
|
||||||
@@ -832,6 +1191,7 @@ export const logAction = [
|
|||||||
{ value: "UpdateGameOption", name: "UpdateGameOption" },
|
{ value: "UpdateGameOption", name: "UpdateGameOption" },
|
||||||
{ value: "UpdateLanguage", name: "UpdateLanguage" },
|
{ value: "UpdateLanguage", name: "UpdateLanguage" },
|
||||||
{ value: "UpdateUgcNpcLike", name: "UpdateUgcNpcLike" },
|
{ value: "UpdateUgcNpcLike", name: "UpdateUgcNpcLike" },
|
||||||
|
{ value: "UpdateGameModePlayerRegulation", name: "UpdateGameModePlayerRegulation" },
|
||||||
{ value: "UserBlock", name: "UserBlock" },
|
{ value: "UserBlock", name: "UserBlock" },
|
||||||
{ value: "UserBlockCancel", name: "UserBlockCancel" },
|
{ value: "UserBlockCancel", name: "UserBlockCancel" },
|
||||||
{ value: "UserCreate", name: "UserCreate" },
|
{ value: "UserCreate", name: "UserCreate" },
|
||||||
@@ -859,6 +1219,9 @@ export const logDomain = [
|
|||||||
{ value: "BattleSnapshot", name: "BattleSnapshot" },
|
{ value: "BattleSnapshot", name: "BattleSnapshot" },
|
||||||
{ value: "BeaconCreate", name: "BeaconCreate" },
|
{ value: "BeaconCreate", name: "BeaconCreate" },
|
||||||
{ value: "Beacon", name: "Beacon" },
|
{ value: "Beacon", name: "Beacon" },
|
||||||
|
{ value: "BeaconShop", name: "BeaconShop" },
|
||||||
|
{ value: "BeaconShopSoldRecord", name: "BeaconShopSoldRecord" },
|
||||||
|
{ value: "BeaconShopSoldPrice", name: "BeaconShopSoldPrice" },
|
||||||
{ value: "BrokerApi", name: "BrokerApi" },
|
{ value: "BrokerApi", name: "BrokerApi" },
|
||||||
{ value: "Buff", name: "Buff" },
|
{ value: "Buff", name: "Buff" },
|
||||||
{ value: "Building", name: "Building" },
|
{ value: "Building", name: "Building" },
|
||||||
@@ -881,7 +1244,11 @@ export const logDomain = [
|
|||||||
{ value: "Farming", name: "Farming" },
|
{ value: "Farming", name: "Farming" },
|
||||||
{ value: "FarmingReward", name: "FarmingReward" },
|
{ value: "FarmingReward", name: "FarmingReward" },
|
||||||
{ value: "GameLogInOut", name: "GameLogInOut" },
|
{ value: "GameLogInOut", name: "GameLogInOut" },
|
||||||
|
{ value: "GameObjectInteraction", name: "GameObjectInteraction" },
|
||||||
|
{ value: "GameModePenalty", name: "GameModePenalty" },
|
||||||
|
{ value: "GameModePlayRegulation", name: "GameModePlayRegulation" },
|
||||||
{ value: "Item", name: "Item" },
|
{ value: "Item", name: "Item" },
|
||||||
|
{ value: "IgmApi", name: "IgmApi" },
|
||||||
{ value: "MyHome", name: "MyHome" },
|
{ value: "MyHome", name: "MyHome" },
|
||||||
{ value: "Land", name: "Land" },
|
{ value: "Land", name: "Land" },
|
||||||
{ value: "LandAuction", name: "LandAuction" },
|
{ value: "LandAuction", name: "LandAuction" },
|
||||||
@@ -891,6 +1258,9 @@ export const logDomain = [
|
|||||||
{ value: "Mail", name: "Mail" },
|
{ value: "Mail", name: "Mail" },
|
||||||
{ value: "MailStoragePeriodExpired", name: "MailStoragePeriodExpired" },
|
{ value: "MailStoragePeriodExpired", name: "MailStoragePeriodExpired" },
|
||||||
{ value: "MailProfile", name: "MailProfile" },
|
{ value: "MailProfile", name: "MailProfile" },
|
||||||
|
{ value: "MatchUser", name: "MatchUser" },
|
||||||
|
{ value: "MatchServerUser", name: "MatchServerUser" },
|
||||||
|
{ value: "MatchRoom", name: "MatchRoom" },
|
||||||
{ value: "Party", name: "Party" },
|
{ value: "Party", name: "Party" },
|
||||||
{ value: "PartyMember", name: "PartyMember" },
|
{ value: "PartyMember", name: "PartyMember" },
|
||||||
{ value: "PartyVote", name: "PartyVote" },
|
{ value: "PartyVote", name: "PartyVote" },
|
||||||
@@ -899,12 +1269,20 @@ export const logDomain = [
|
|||||||
{ value: "PackageLastOrderRecode", name: "PackageLastOrderRecode" },
|
{ value: "PackageLastOrderRecode", name: "PackageLastOrderRecode" },
|
||||||
{ value: "PackageRepeat", name: "PackageRepeat" },
|
{ value: "PackageRepeat", name: "PackageRepeat" },
|
||||||
{ value: "PackageState", name: "PackageState" },
|
{ value: "PackageState", name: "PackageState" },
|
||||||
|
{ value: "PlanetProviderAuth", name: "PlanetProviderAuth" },
|
||||||
|
{ value: "PlanetUserAuth", name: "PlanetUserAuth" },
|
||||||
|
{ value: "PlanetItemExchange", name: "PlanetItemExchange" },
|
||||||
{ value: "QuestMain", name: "QuestMain" },
|
{ value: "QuestMain", name: "QuestMain" },
|
||||||
{ value: "QuestUgq", name: "QuestUgq" },
|
{ value: "QuestUgq", name: "QuestUgq" },
|
||||||
{ value: "QuestMail", name: "QuestMail" },
|
{ value: "QuestMail", name: "QuestMail" },
|
||||||
{ value: "RenewalShopProducts", name: "RenewalShopProducts" },
|
{ value: "RenewalShopProducts", name: "RenewalShopProducts" },
|
||||||
{ value: "Rental", name: "Rental" },
|
{ value: "Rental", name: "Rental" },
|
||||||
{ value: "RewardProp", name: "RewardProp" },
|
{ value: "RewardProp", name: "RewardProp" },
|
||||||
|
{ value: "RunRaceFinishReward", name: "RunRaceFinishReward" },
|
||||||
|
{ value: "RunRaceRespawnReward", name: "RunRaceRespawnReward" },
|
||||||
|
{ value: "RunRaceUnFinishReward", name: "RunRaceUnFinishReward" },
|
||||||
|
{ value: "RunRaceCheckPointAbusing", name: "RunRaceCheckPointAbusing" },
|
||||||
|
{ value: "RunRaceRewardSummary", name: "RunRaceRewardSummary" },
|
||||||
{ value: "Stage", name: "Stage" },
|
{ value: "Stage", name: "Stage" },
|
||||||
{ value: "SocialAction", name: "SocialAction" },
|
{ value: "SocialAction", name: "SocialAction" },
|
||||||
{ value: "SeasonPass", name: "SeasonPass" },
|
{ value: "SeasonPass", name: "SeasonPass" },
|
||||||
|
|||||||
96
src/assets/data/pages/businessLogSearch.json
Normal file
96
src/assets/data/pages/businessLogSearch.json
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
{
|
||||||
|
"initialSearchParams": {
|
||||||
|
"searchType": "GUID",
|
||||||
|
"searchData": "",
|
||||||
|
"logAction": "None",
|
||||||
|
"logDomain": "BASE",
|
||||||
|
"tran_id": "",
|
||||||
|
"startDate": "",
|
||||||
|
"endDate": "",
|
||||||
|
"orderBy": "DESC",
|
||||||
|
"pageSize": 500,
|
||||||
|
"currentPage": 1
|
||||||
|
},
|
||||||
|
|
||||||
|
"searchFields": [
|
||||||
|
{
|
||||||
|
"type": "select",
|
||||||
|
"id": "searchType",
|
||||||
|
"optionsRef": "userSearchType2",
|
||||||
|
"col": 1,
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"id": "searchData",
|
||||||
|
"placeholder": "대상 입력",
|
||||||
|
"width": "300px",
|
||||||
|
"col": 1,
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "period",
|
||||||
|
"startDateId": "startDate",
|
||||||
|
"endDateId": "endDate",
|
||||||
|
"label": "조회 일자",
|
||||||
|
"col": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"id": "searchContent",
|
||||||
|
"label": "우편 내용",
|
||||||
|
"placeholder": "우편 내용(공백으로 구분)",
|
||||||
|
"width": "300px",
|
||||||
|
"col": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "select",
|
||||||
|
"id": "sendType",
|
||||||
|
"label": "발송 방식",
|
||||||
|
"optionsRef": "mailSendType",
|
||||||
|
"col": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "select",
|
||||||
|
"id": "status",
|
||||||
|
"label": "발송 상태",
|
||||||
|
"optionsRef": "mailSendStatus",
|
||||||
|
"col": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "select",
|
||||||
|
"id": "mailType",
|
||||||
|
"label": "우편 타입",
|
||||||
|
"optionsRef": "mailType",
|
||||||
|
"col": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "select",
|
||||||
|
"id": "receiveType",
|
||||||
|
"label": "수신 대상",
|
||||||
|
"optionsRef": "mailReceiveType",
|
||||||
|
"col": 2
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
"apiInfo": {
|
||||||
|
"functionName": "MailView",
|
||||||
|
"loadOnMount": true,
|
||||||
|
"paramsMapping": [
|
||||||
|
"searchTitle",
|
||||||
|
"searchContent",
|
||||||
|
"sendType",
|
||||||
|
"status",
|
||||||
|
"mailType",
|
||||||
|
"receiveType",
|
||||||
|
{"param": "startDate", "transform": "toISOString"},
|
||||||
|
{"param": "endDate", "transform": "toISOString"},
|
||||||
|
"orderBy",
|
||||||
|
"pageSize",
|
||||||
|
"currentPage"
|
||||||
|
],
|
||||||
|
"pageField": "currentPage",
|
||||||
|
"pageSizeField": "pageSize",
|
||||||
|
"orderField": "orderBy"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"initialSearchParams": {
|
"initialSearchParams": {
|
||||||
"searchTitle": "",
|
"searchData": "",
|
||||||
"searchContent": "",
|
|
||||||
"status": "ALL",
|
"status": "ALL",
|
||||||
"startDate": "",
|
"startDate": "",
|
||||||
"endDate": "",
|
"endDate": "",
|
||||||
@@ -13,51 +12,37 @@
|
|||||||
"searchFields": [
|
"searchFields": [
|
||||||
{
|
{
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"id": "searchTitle",
|
"id": "searchData",
|
||||||
"label": "우편 제목",
|
"label": "제목",
|
||||||
"placeholder": "제목 입력",
|
"placeholder": "제목 입력",
|
||||||
"width": "300px",
|
"width": "300px",
|
||||||
"col": 1
|
"col": 1
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "period",
|
|
||||||
"startDateId": "startDate",
|
|
||||||
"endDateId": "endDate",
|
|
||||||
"label": "조회 일자",
|
|
||||||
"col": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "text",
|
|
||||||
"id": "searchContent",
|
|
||||||
"label": "우편 내용",
|
|
||||||
"placeholder": "우편 내용(공백으로 구분)",
|
|
||||||
"width": "300px",
|
|
||||||
"col": 1
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "select",
|
"type": "select",
|
||||||
"id": "status",
|
"id": "status",
|
||||||
"label": "이벤트 상태",
|
"label": "상태",
|
||||||
"optionsRef": "eventStatus",
|
"optionsRef": "opMenuBannerStatus",
|
||||||
"col": 2
|
"col": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "period",
|
||||||
|
"startDateId": "startDate",
|
||||||
|
"endDateId": "endDate",
|
||||||
|
"label": "기간",
|
||||||
|
"col": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
"apiInfo": {
|
"apiInfo": {
|
||||||
"functionName": "EventView",
|
"endpointName": "EventView",
|
||||||
"loadOnMount": true,
|
"loadOnMount": true,
|
||||||
"paramsMapping": [
|
"paramTransforms": [
|
||||||
"searchTitle",
|
|
||||||
"searchContent",
|
|
||||||
"status",
|
|
||||||
{"param": "startDate", "transform": "toISOString"},
|
{"param": "startDate", "transform": "toISOString"},
|
||||||
{"param": "endDate", "transform": "toISOString"},
|
{"param": "endDate", "transform": "toISOString"}
|
||||||
"orderBy",
|
|
||||||
"pageSize",
|
|
||||||
"currentPage"
|
|
||||||
],
|
],
|
||||||
"pageField": "currentPage",
|
"pageField": "page_no",
|
||||||
"pageSizeField": "pageSize",
|
"pageSizeField": "page_size",
|
||||||
"orderField": "orderBy"
|
"orderField": "orderBy"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
119
src/assets/data/pages/eventTable.json
Normal file
119
src/assets/data/pages/eventTable.json
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
{
|
||||||
|
"id": "eventTable",
|
||||||
|
"selection": {
|
||||||
|
"type": "single",
|
||||||
|
"idField": "id"
|
||||||
|
},
|
||||||
|
"header": {
|
||||||
|
"countType": "total",
|
||||||
|
"orderType": "desc",
|
||||||
|
"pageType": "default",
|
||||||
|
"buttons": [
|
||||||
|
{
|
||||||
|
"id": "delete",
|
||||||
|
"text": "선택 삭제",
|
||||||
|
"theme": "line",
|
||||||
|
"disableWhen": "noSelection",
|
||||||
|
"requiredAuth": "worldEventDelete",
|
||||||
|
"action": "delete"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "register",
|
||||||
|
"text": "통합 이벤트 등록",
|
||||||
|
"theme": "primary",
|
||||||
|
"requiredAuth": "worldEventUpdate",
|
||||||
|
"action": "regist"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"id": "checkbox",
|
||||||
|
"type": "checkbox",
|
||||||
|
"width": "40px",
|
||||||
|
"title": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "row_num",
|
||||||
|
"type": "text",
|
||||||
|
"width": "70px",
|
||||||
|
"title": "번호"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "status",
|
||||||
|
"type": "status",
|
||||||
|
"width": "120px",
|
||||||
|
"title": "상태",
|
||||||
|
"option_name": "opCommonStatus"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "title",
|
||||||
|
"type": "text",
|
||||||
|
"title": "제목",
|
||||||
|
"width": "150px"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "personal_event_action_id",
|
||||||
|
"type": "text",
|
||||||
|
"width": "150px",
|
||||||
|
"title": "개인제작 이벤트 모드"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "global_event_action_id",
|
||||||
|
"type": "text",
|
||||||
|
"width": "150px",
|
||||||
|
"title": "기여도 이벤트 모드"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "max_point",
|
||||||
|
"type": "text",
|
||||||
|
"width": "150px",
|
||||||
|
"title": "기여도 목표점수"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "start_dt",
|
||||||
|
"type": "date",
|
||||||
|
"width": "220px",
|
||||||
|
"title": "시작일(KST)",
|
||||||
|
"format": {
|
||||||
|
"type": "function",
|
||||||
|
"name": "convertKTC"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "end_dt",
|
||||||
|
"type": "date",
|
||||||
|
"width": "220px",
|
||||||
|
"title": "종료일(KST)",
|
||||||
|
"format": {
|
||||||
|
"type": "function",
|
||||||
|
"name": "convertKTC"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "detail",
|
||||||
|
"type": "button",
|
||||||
|
"width": "120px",
|
||||||
|
"title": "상세보기",
|
||||||
|
"text": "상세보기",
|
||||||
|
"action": {
|
||||||
|
"type": "modal",
|
||||||
|
"target": "detailModal",
|
||||||
|
"dataParam": {
|
||||||
|
"id": "id"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "history",
|
||||||
|
"type": "button",
|
||||||
|
"width": "120px",
|
||||||
|
"title": "히스토리",
|
||||||
|
"text": "히스토리"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"sort": {
|
||||||
|
"defaultColumn": "row_num",
|
||||||
|
"defaultDirection": "desc"
|
||||||
|
}
|
||||||
|
}
|
||||||
59
src/assets/data/pages/historySearch.json
Normal file
59
src/assets/data/pages/historySearch.json
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
{
|
||||||
|
"initialSearchParams": {
|
||||||
|
"searchType": "ID",
|
||||||
|
"searchData": "",
|
||||||
|
"historyType": "",
|
||||||
|
"startDate": "today",
|
||||||
|
"endDate": "today",
|
||||||
|
"orderBy": "DESC",
|
||||||
|
"pageSize": 50,
|
||||||
|
"currentPage": 1
|
||||||
|
},
|
||||||
|
|
||||||
|
"searchFields": [
|
||||||
|
{
|
||||||
|
"type": "select",
|
||||||
|
"id": "searchType",
|
||||||
|
"label": "대상",
|
||||||
|
"optionsRef": "adminUserType",
|
||||||
|
"col": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"id": "searchData",
|
||||||
|
"placeholder": "대상 입력",
|
||||||
|
"width": "300px",
|
||||||
|
"col": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "select",
|
||||||
|
"id": "historyType",
|
||||||
|
"label": "이력종류",
|
||||||
|
"optionsRef": "opHistoryType",
|
||||||
|
"col": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "period",
|
||||||
|
"startDateId": "startDate",
|
||||||
|
"endDateId": "endDate",
|
||||||
|
"label": "기간",
|
||||||
|
"col": 2,
|
||||||
|
"width": "500px",
|
||||||
|
"format": "YYYY-MM-DD HH:mm:ss",
|
||||||
|
"showTime": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
"apiInfo": {
|
||||||
|
"endpointName": "LogViewList",
|
||||||
|
"loadOnMount": true,
|
||||||
|
"paramTransforms": [
|
||||||
|
{"param": "startDate", "transform": "toISOString"},
|
||||||
|
{"param": "endDate", "transform": "toISOString"}
|
||||||
|
],
|
||||||
|
"pageField": "page_no",
|
||||||
|
"pageSizeField": "page_size",
|
||||||
|
"orderField": "orderBy"
|
||||||
|
},
|
||||||
|
"paginationType": "front"
|
||||||
|
}
|
||||||
69
src/assets/data/pages/historyTable.json
Normal file
69
src/assets/data/pages/historyTable.json
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
{
|
||||||
|
"id": "historyTable",
|
||||||
|
"selection": {
|
||||||
|
"type": "single",
|
||||||
|
"idField": "id"
|
||||||
|
},
|
||||||
|
"header": {
|
||||||
|
"countType": "total",
|
||||||
|
"orderType": "desc",
|
||||||
|
"pageType": "default",
|
||||||
|
"buttons": []
|
||||||
|
},
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"id": "logTime",
|
||||||
|
"type": "date",
|
||||||
|
"width": "200px",
|
||||||
|
"title": "일시(KST)",
|
||||||
|
"format": {
|
||||||
|
"type": "function",
|
||||||
|
"name": "convertKTC"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "category",
|
||||||
|
"type": "option",
|
||||||
|
"width": "100px",
|
||||||
|
"title": "로그종류",
|
||||||
|
"option_name": "opLogCategory"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "action",
|
||||||
|
"type": "option",
|
||||||
|
"width": "150px",
|
||||||
|
"title": "로그액션",
|
||||||
|
"option_name": "opLogAction"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "status",
|
||||||
|
"type": "option",
|
||||||
|
"width": "100px",
|
||||||
|
"title": "상태",
|
||||||
|
"option_name": "opCommonStatus"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "worker",
|
||||||
|
"type": "text",
|
||||||
|
"width": "100px",
|
||||||
|
"title": "작업자"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "message",
|
||||||
|
"type": "text",
|
||||||
|
"width": "100px",
|
||||||
|
"title": "비고"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "detail",
|
||||||
|
"type": "button",
|
||||||
|
"width": "120px",
|
||||||
|
"title": "상세보기",
|
||||||
|
"text": "상세보기"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"sort": {
|
||||||
|
"defaultColumn": "timestamp",
|
||||||
|
"defaultDirection": "desc"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
"type": "select",
|
"type": "select",
|
||||||
"id": "searchType",
|
"id": "searchType",
|
||||||
"label": "대상",
|
"label": "대상",
|
||||||
"optionsRef": "userSearchType",
|
"optionsRef": "userType",
|
||||||
"col": 1,
|
"col": 1,
|
||||||
"required": true
|
"required": true
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -14,14 +14,14 @@
|
|||||||
"text": "선택 삭제",
|
"text": "선택 삭제",
|
||||||
"theme": "line",
|
"theme": "line",
|
||||||
"disableWhen": "noSelection",
|
"disableWhen": "noSelection",
|
||||||
"requiredAuth": "battleEventDelete",
|
"requiredAuth": "menuBannerDelete",
|
||||||
"action": "delete"
|
"action": "delete"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "register",
|
"id": "register",
|
||||||
"text": "이미지 등록",
|
"text": "이미지 등록",
|
||||||
"theme": "primary",
|
"theme": "primary",
|
||||||
"requiredAuth": "battleEventUpdate",
|
"requiredAuth": "menuBannerUpdate",
|
||||||
"action": "navigate",
|
"action": "navigate",
|
||||||
"navigateTo": "/servicemanage/menubanner/menubannerregist"
|
"navigateTo": "/servicemanage/menubanner/menubannerregist"
|
||||||
}
|
}
|
||||||
@@ -40,6 +40,12 @@
|
|||||||
"width": "70px",
|
"width": "70px",
|
||||||
"title": "번호"
|
"title": "번호"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "order_id",
|
||||||
|
"type": "text",
|
||||||
|
"width": "70px",
|
||||||
|
"title": "순서"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "status",
|
"id": "status",
|
||||||
"type": "status",
|
"type": "status",
|
||||||
@@ -94,10 +100,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "update_by",
|
"id": "history",
|
||||||
"type": "text",
|
"type": "button",
|
||||||
"width": "150px",
|
"width": "120px",
|
||||||
"title": "히스토리"
|
"title": "히스토리",
|
||||||
|
"text": "히스토리"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"sort": {
|
"sort": {
|
||||||
|
|||||||
49
src/assets/data/pages/metaCraftingSearch.json
Normal file
49
src/assets/data/pages/metaCraftingSearch.json
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
{
|
||||||
|
"initialSearchParams": {
|
||||||
|
"search_type": "ID",
|
||||||
|
"search_data": "",
|
||||||
|
"small_type": "ALL",
|
||||||
|
"recipe_type": "ALL",
|
||||||
|
"orderBy": "DESC",
|
||||||
|
"pageSize": 50,
|
||||||
|
"currentPage": 1
|
||||||
|
},
|
||||||
|
|
||||||
|
"searchFields": [
|
||||||
|
{
|
||||||
|
"type": "select",
|
||||||
|
"id": "search_type",
|
||||||
|
"optionsRef": "itemSearchType",
|
||||||
|
"col": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"id": "search_data",
|
||||||
|
"placeholder": "아이템 입력",
|
||||||
|
"width": "300px",
|
||||||
|
"col": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "select",
|
||||||
|
"id": "small_type",
|
||||||
|
"label": "제작 분류",
|
||||||
|
"optionsRef": "opPropSmallType",
|
||||||
|
"col": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "select",
|
||||||
|
"id": "recipe_type",
|
||||||
|
"label": "레시피 필요 여부",
|
||||||
|
"optionsRef": "opPropRecipeType",
|
||||||
|
"col": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
"apiInfo": {
|
||||||
|
"endpointName": "getCraftingDictionaryList",
|
||||||
|
"loadOnMount": true,
|
||||||
|
"pageField": "page_no",
|
||||||
|
"pageSizeField": "page_size",
|
||||||
|
"orderField": "orderBy"
|
||||||
|
}
|
||||||
|
}
|
||||||
48
src/assets/data/pages/rankingSearch.json
Normal file
48
src/assets/data/pages/rankingSearch.json
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
"initialSearchParams": {
|
||||||
|
"searchData": "",
|
||||||
|
"status": "ALL",
|
||||||
|
"startDate": "",
|
||||||
|
"endDate": "",
|
||||||
|
"orderBy": "DESC",
|
||||||
|
"pageSize": 50,
|
||||||
|
"currentPage": 1
|
||||||
|
},
|
||||||
|
|
||||||
|
"searchFields": [
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"id": "searchData",
|
||||||
|
"label": "제목",
|
||||||
|
"placeholder": "제목 입력",
|
||||||
|
"width": "300px",
|
||||||
|
"col": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "select",
|
||||||
|
"id": "status",
|
||||||
|
"label": "상태",
|
||||||
|
"optionsRef": "opMenuBannerStatus",
|
||||||
|
"col": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "period",
|
||||||
|
"startDateId": "startDate",
|
||||||
|
"endDateId": "endDate",
|
||||||
|
"label": "기간",
|
||||||
|
"col": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
"apiInfo": {
|
||||||
|
"endpointName": "RankingScheduleView",
|
||||||
|
"loadOnMount": true,
|
||||||
|
"paramTransforms": [
|
||||||
|
{"param": "startDate", "transform": "toISOString"},
|
||||||
|
{"param": "endDate", "transform": "toISOString"}
|
||||||
|
],
|
||||||
|
"pageField": "page_no",
|
||||||
|
"pageSizeField": "page_size",
|
||||||
|
"orderField": "orderBy"
|
||||||
|
}
|
||||||
|
}
|
||||||
140
src/assets/data/pages/rankingTable.json
Normal file
140
src/assets/data/pages/rankingTable.json
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
{
|
||||||
|
"id": "rankingTable",
|
||||||
|
"selection": {
|
||||||
|
"type": "single",
|
||||||
|
"idField": "id"
|
||||||
|
},
|
||||||
|
"header": {
|
||||||
|
"countType": "total",
|
||||||
|
"orderType": "desc",
|
||||||
|
"pageType": "default",
|
||||||
|
"buttons": [
|
||||||
|
{
|
||||||
|
"id": "delete",
|
||||||
|
"text": "선택 삭제",
|
||||||
|
"theme": "line",
|
||||||
|
"disableWhen": "noSelection",
|
||||||
|
"requiredAuth": "rankingDelete",
|
||||||
|
"action": "delete"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "register",
|
||||||
|
"text": "랭킹 스케줄 등록",
|
||||||
|
"theme": "primary",
|
||||||
|
"requiredAuth": "rankingUpdate",
|
||||||
|
"action": "regist"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"id": "checkbox",
|
||||||
|
"type": "checkbox",
|
||||||
|
"width": "40px",
|
||||||
|
"title": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "row_num",
|
||||||
|
"type": "text",
|
||||||
|
"width": "70px",
|
||||||
|
"title": "번호"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "status",
|
||||||
|
"type": "status",
|
||||||
|
"width": "100px",
|
||||||
|
"title": "상태",
|
||||||
|
"option_name": "opCommonStatus"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "title",
|
||||||
|
"type": "text",
|
||||||
|
"title": "제목"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "meta_id",
|
||||||
|
"type": "text",
|
||||||
|
"title": "랭킹모드",
|
||||||
|
"width": "100px"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "event_action_id",
|
||||||
|
"type": "text",
|
||||||
|
"title": "이벤트 액션 그룹",
|
||||||
|
"width": "150px"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "start_dt",
|
||||||
|
"type": "date",
|
||||||
|
"width": "200px",
|
||||||
|
"title": "시작일(KST)",
|
||||||
|
"format": {
|
||||||
|
"type": "function",
|
||||||
|
"name": "convertKTC"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "end_dt",
|
||||||
|
"type": "date",
|
||||||
|
"width": "200px",
|
||||||
|
"title": "종료일(KST)",
|
||||||
|
"format": {
|
||||||
|
"type": "function",
|
||||||
|
"name": "convertKTC"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "base_dt",
|
||||||
|
"type": "date",
|
||||||
|
"width": "200px",
|
||||||
|
"title": "기준일(KST)",
|
||||||
|
"format": {
|
||||||
|
"type": "function",
|
||||||
|
"name": "convertKTC"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "refresh_interval",
|
||||||
|
"type": "text",
|
||||||
|
"width": "120px",
|
||||||
|
"title": "새로고침 주기"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "initialization_interval",
|
||||||
|
"type": "text",
|
||||||
|
"width": "120px",
|
||||||
|
"title": "초기화 주기"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "snapshot_interval",
|
||||||
|
"type": "text",
|
||||||
|
"width": "120px",
|
||||||
|
"title": "스냅샷 주기"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "detail",
|
||||||
|
"type": "button",
|
||||||
|
"width": "120px",
|
||||||
|
"title": "상세보기",
|
||||||
|
"text": "상세보기",
|
||||||
|
"action": {
|
||||||
|
"type": "modal",
|
||||||
|
"target": "detailModal",
|
||||||
|
"dataParam": {
|
||||||
|
"id": "id"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "history",
|
||||||
|
"type": "button",
|
||||||
|
"width": "120px",
|
||||||
|
"title": "히스토리",
|
||||||
|
"text": "히스토리"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"sort": {
|
||||||
|
"defaultColumn": "row_num",
|
||||||
|
"defaultDirection": "desc"
|
||||||
|
}
|
||||||
|
}
|
||||||
63
src/assets/data/pages/rewardEventSearch.json
Normal file
63
src/assets/data/pages/rewardEventSearch.json
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
{
|
||||||
|
"initialSearchParams": {
|
||||||
|
"searchTitle": "",
|
||||||
|
"searchContent": "",
|
||||||
|
"status": "ALL",
|
||||||
|
"startDate": "",
|
||||||
|
"endDate": "",
|
||||||
|
"orderBy": "DESC",
|
||||||
|
"pageSize": 50,
|
||||||
|
"currentPage": 1
|
||||||
|
},
|
||||||
|
|
||||||
|
"searchFields": [
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"id": "searchTitle",
|
||||||
|
"label": "우편 제목",
|
||||||
|
"placeholder": "제목 입력",
|
||||||
|
"width": "300px",
|
||||||
|
"col": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "period",
|
||||||
|
"startDateId": "startDate",
|
||||||
|
"endDateId": "endDate",
|
||||||
|
"label": "조회 일자",
|
||||||
|
"col": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"id": "searchContent",
|
||||||
|
"label": "우편 내용",
|
||||||
|
"placeholder": "우편 내용(공백으로 구분)",
|
||||||
|
"width": "300px",
|
||||||
|
"col": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "select",
|
||||||
|
"id": "status",
|
||||||
|
"label": "이벤트 상태",
|
||||||
|
"optionsRef": "eventStatus",
|
||||||
|
"col": 2
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
"apiInfo": {
|
||||||
|
"functionName": "RewardEventView",
|
||||||
|
"loadOnMount": true,
|
||||||
|
"paramsMapping": [
|
||||||
|
"searchTitle",
|
||||||
|
"searchContent",
|
||||||
|
"status",
|
||||||
|
{"param": "startDate", "transform": "toISOString"},
|
||||||
|
{"param": "endDate", "transform": "toISOString"},
|
||||||
|
"orderBy",
|
||||||
|
"pageSize",
|
||||||
|
"currentPage"
|
||||||
|
],
|
||||||
|
"pageField": "currentPage",
|
||||||
|
"pageSizeField": "pageSize",
|
||||||
|
"orderField": "orderBy"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
"type": "select",
|
"type": "select",
|
||||||
"id": "searchType",
|
"id": "searchType",
|
||||||
"label": "대상",
|
"label": "대상",
|
||||||
"optionsRef": "userSearchType",
|
"optionsRef": "userType",
|
||||||
"col": 1
|
"col": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
"buttons": [
|
"buttons": [
|
||||||
{
|
{
|
||||||
"id": "delete",
|
"id": "delete",
|
||||||
"text": "선택 삭제",
|
"text": "선택 해지",
|
||||||
"theme": "line",
|
"theme": "line",
|
||||||
"disableWhen": "noSelection",
|
"disableWhen": "noSelection",
|
||||||
"requiredAuth": "blackListDelete",
|
"requiredAuth": "blackListDelete",
|
||||||
@@ -73,12 +73,6 @@
|
|||||||
"title": "제재 사유",
|
"title": "제재 사유",
|
||||||
"option_name": "blockSanctions"
|
"option_name": "blockSanctions"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id": "create_by",
|
|
||||||
"type": "text",
|
|
||||||
"width": "150px",
|
|
||||||
"title": "등록자"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "detail",
|
"id": "detail",
|
||||||
"type": "button",
|
"type": "button",
|
||||||
@@ -92,6 +86,13 @@
|
|||||||
"id": "id"
|
"id": "id"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "history",
|
||||||
|
"type": "button",
|
||||||
|
"width": "120px",
|
||||||
|
"title": "히스토리",
|
||||||
|
"text": "히스토리"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"sort": {
|
"sort": {
|
||||||
|
|||||||
@@ -52,6 +52,16 @@ export const authType = {
|
|||||||
menuBannerRead: 50,
|
menuBannerRead: 50,
|
||||||
menuBannerUpdate: 51,
|
menuBannerUpdate: 51,
|
||||||
menuBannerDelete: 52,
|
menuBannerDelete: 52,
|
||||||
|
itemDictionaryRead: 53,
|
||||||
|
rankManagerRead: 54,
|
||||||
|
rankManagerUpdate: 55,
|
||||||
|
rankingRead: 56,
|
||||||
|
rankingUpdate: 57,
|
||||||
|
rankingDelete: 58,
|
||||||
|
worldEventRead: 59,
|
||||||
|
worldEventUpdate: 60,
|
||||||
|
worldEventDelete: 61,
|
||||||
|
craftingDictionaryRead: 62,
|
||||||
|
|
||||||
|
|
||||||
levelReader: 999,
|
levelReader: 999,
|
||||||
@@ -75,20 +85,6 @@ export const adminAuthLevel = {
|
|||||||
DEVELOPER: "Developer",
|
DEVELOPER: "Developer",
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TabList = [
|
|
||||||
{ title: '기본정보' },
|
|
||||||
{ title: '아바타' },
|
|
||||||
{ title: '의상' },
|
|
||||||
{ title: '도구' },
|
|
||||||
{ title: '인벤토리' },
|
|
||||||
{ title: '우편' },
|
|
||||||
{ title: '마이홈' },
|
|
||||||
{ title: '친구목록' },
|
|
||||||
{ title: '타투' },
|
|
||||||
{ title: '퀘스트' },
|
|
||||||
// { title: '클레임' },
|
|
||||||
];
|
|
||||||
|
|
||||||
export const ivenTabType = {
|
export const ivenTabType = {
|
||||||
CLOTH: "cloth",
|
CLOTH: "cloth",
|
||||||
PROP: "prop",
|
PROP: "prop",
|
||||||
@@ -119,6 +115,13 @@ export const commonStatus = {
|
|||||||
delete: "DELETE",
|
delete: "DELETE",
|
||||||
reject: "REJECT",
|
reject: "REJECT",
|
||||||
complete: "COMPLETE",
|
complete: "COMPLETE",
|
||||||
|
cancel: "CANCEL"
|
||||||
|
}
|
||||||
|
|
||||||
|
export const customStatus = {
|
||||||
|
inprogress: "INPROGRESS",
|
||||||
|
expiration: "EXPIRATION",
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ViewTitleCountType = {
|
export const ViewTitleCountType = {
|
||||||
@@ -151,4 +154,10 @@ export const currencyCodeTypes = {
|
|||||||
sapphire: "19010002",
|
sapphire: "19010002",
|
||||||
ruby: "19010005",
|
ruby: "19010005",
|
||||||
calium: "19010003"
|
calium: "19010003"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const languageNames = {
|
||||||
|
'Ko': '한국어',
|
||||||
|
'En': '영어',
|
||||||
|
'Ja': '일본어',
|
||||||
|
};
|
||||||
|
|||||||
@@ -1,198 +0,0 @@
|
|||||||
import { styled } from 'styled-components';
|
|
||||||
import { useState } from 'react';
|
|
||||||
|
|
||||||
import Button from '../../components/common/button/Button';
|
|
||||||
|
|
||||||
import DatePicker, { registerLocale } from 'react-datepicker';
|
|
||||||
import 'react-datepicker/dist/react-datepicker.css';
|
|
||||||
import { getMonth, getYear } from 'date-fns';
|
|
||||||
import range from 'lodash/range';
|
|
||||||
|
|
||||||
import { TextInput, SelectInput, DatePickerWrapper, InputLabel, BtnWrapper } from '../../styles/Components';
|
|
||||||
|
|
||||||
const GoodsLogSearchBar = () => {
|
|
||||||
const [startDate, setStartDate] = useState(new Date());
|
|
||||||
const [endDate, setEndDate] = useState(new Date());
|
|
||||||
const [selectData, setSelectData] = useState('default');
|
|
||||||
const years = range(1990, getYear(new Date()) + 1, 1);
|
|
||||||
const months = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'];
|
|
||||||
|
|
||||||
const handleChange = e => {
|
|
||||||
setSelectData(e.target.value);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<SearchbarStyle2>
|
|
||||||
<SearchRow>
|
|
||||||
<SearchItem>
|
|
||||||
<InputLabel>조회 기간</InputLabel>
|
|
||||||
<DatePickerWrapper>
|
|
||||||
<InputGroup>
|
|
||||||
<DatePicker
|
|
||||||
selected={startDate}
|
|
||||||
onChange={date => setStartDate(date)}
|
|
||||||
className="datepicker"
|
|
||||||
placeholderText="검색기간 선택"
|
|
||||||
calendarClassName="calendar"
|
|
||||||
dateFormat="yyyy - MM - dd"
|
|
||||||
locale="ko"
|
|
||||||
renderCustomHeader={({ date, changeYear, changeMonth, decreaseMonth, increaseMonth, prevMonthButtonDisabled, nextMonthButtonDisabled }) => (
|
|
||||||
<div className="calendar-top">
|
|
||||||
<button
|
|
||||||
className="btn-prev"
|
|
||||||
onClick={e => {
|
|
||||||
e.preventDefault();
|
|
||||||
decreaseMonth();
|
|
||||||
}}
|
|
||||||
disabled={prevMonthButtonDisabled}></button>
|
|
||||||
<select value={getYear(date)} onChange={({ target: { value } }) => changeYear(value)}>
|
|
||||||
{years.map(option => (
|
|
||||||
<option key={option} value={option}>
|
|
||||||
{option}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</select>
|
|
||||||
.
|
|
||||||
<select value={months[getMonth(date)]} onChange={({ target: { value } }) => changeMonth(months.indexOf(value))}>
|
|
||||||
{months.map(option => (
|
|
||||||
<option key={option} value={option}>
|
|
||||||
{option}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</select>
|
|
||||||
<button
|
|
||||||
className="btn-next"
|
|
||||||
onClick={e => {
|
|
||||||
e.preventDefault();
|
|
||||||
increaseMonth();
|
|
||||||
}}
|
|
||||||
disabled={nextMonthButtonDisabled}></button>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<SelectInput>
|
|
||||||
<option value="">00</option>
|
|
||||||
<option value="">01</option>
|
|
||||||
</SelectInput>
|
|
||||||
<SelectInput>
|
|
||||||
<option value="">00</option>
|
|
||||||
<option value="">01</option>
|
|
||||||
</SelectInput>
|
|
||||||
</InputGroup>
|
|
||||||
<span>~</span>
|
|
||||||
<InputGroup>
|
|
||||||
<DatePicker
|
|
||||||
selected={endDate}
|
|
||||||
onChange={date => setEndDate(date)}
|
|
||||||
className="datepicker"
|
|
||||||
placeholderText="검색기간 선택"
|
|
||||||
calendarClassName="calendar"
|
|
||||||
dateFormat="yyyy - MM - dd"
|
|
||||||
minDate = {startDate}
|
|
||||||
locale="ko"
|
|
||||||
renderCustomHeader={({ date, changeYear, changeMonth, decreaseMonth, increaseMonth, prevMonthButtonDisabled, nextMonthButtonDisabled }) => (
|
|
||||||
<div className="calendar-top">
|
|
||||||
<button
|
|
||||||
className="btn-prev"
|
|
||||||
onClick={e => {
|
|
||||||
e.preventDefault();
|
|
||||||
decreaseMonth();
|
|
||||||
}}
|
|
||||||
disabled={prevMonthButtonDisabled}></button>
|
|
||||||
<select value={getYear(date)} onChange={({ target: { value } }) => changeYear(value)}>
|
|
||||||
{years.map(option => (
|
|
||||||
<option key={option} value={option}>
|
|
||||||
{option}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</select>
|
|
||||||
.
|
|
||||||
<select value={months[getMonth(date)]} onChange={({ target: { value } }) => changeMonth(months.indexOf(value))}>
|
|
||||||
{months.map(option => (
|
|
||||||
<option key={option} value={option}>
|
|
||||||
{option}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</select>
|
|
||||||
<button
|
|
||||||
className="btn-next"
|
|
||||||
onClick={e => {
|
|
||||||
e.preventDefault();
|
|
||||||
increaseMonth();
|
|
||||||
}}
|
|
||||||
disabled={nextMonthButtonDisabled}></button>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<SelectInput>
|
|
||||||
<option value="">00</option>
|
|
||||||
<option value="">01</option>
|
|
||||||
</SelectInput>
|
|
||||||
<SelectInput>
|
|
||||||
<option value="">00</option>
|
|
||||||
<option value="">01</option>
|
|
||||||
</SelectInput>
|
|
||||||
</InputGroup>
|
|
||||||
</DatePickerWrapper>
|
|
||||||
</SearchItem>
|
|
||||||
</SearchRow>
|
|
||||||
<SearchRow>
|
|
||||||
<SearchItem>
|
|
||||||
<InputLabel>조회 대상</InputLabel>
|
|
||||||
<TextInput type="text" placeholder="조회 대상 유저의 GUID를 입력하세요." width="600px" />
|
|
||||||
</SearchItem>
|
|
||||||
<BtnWrapper $gap="8px">
|
|
||||||
<Button theme="reset" />
|
|
||||||
<Button theme="gray" text="검색" />
|
|
||||||
</BtnWrapper>
|
|
||||||
</SearchRow>
|
|
||||||
</SearchbarStyle2>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default GoodsLogSearchBar;
|
|
||||||
|
|
||||||
const SearchbarStyle = styled.div`
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 20px 0;
|
|
||||||
font-size: 14px;
|
|
||||||
padding: 20px;
|
|
||||||
border-top: 1px solid #000;
|
|
||||||
border-bottom: 1px solid #000;
|
|
||||||
margin-bottom: 40px;
|
|
||||||
`;
|
|
||||||
const SearchbarStyle2 = styled(SearchbarStyle)`
|
|
||||||
flex-flow: column;
|
|
||||||
gap: 20px;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const SearchRow = styled.div`
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 20px 0;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const InputGroup = styled.div`
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 5px;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const SearchItem = styled.div`
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 20px;
|
|
||||||
margin-right: 50px;
|
|
||||||
|
|
||||||
${TextInput}, ${SelectInput} {
|
|
||||||
height: 35px;
|
|
||||||
}
|
|
||||||
${TextInput} {
|
|
||||||
padding: 0 10px;
|
|
||||||
max-width: 400px;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
168
src/components/DataManage/CurrencyItemLogContent.js
Normal file
168
src/components/DataManage/CurrencyItemLogContent.js
Normal file
@@ -0,0 +1,168 @@
|
|||||||
|
import React, { Fragment, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
|
|
||||||
|
import styled from 'styled-components';
|
||||||
|
import {
|
||||||
|
CircularProgressWrapper,
|
||||||
|
FormWrapper,
|
||||||
|
TableStyle,
|
||||||
|
TableWrapper,
|
||||||
|
} from '../../styles/Components';
|
||||||
|
import { amountDeltaType, CurrencyType } from '../../assets/data';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { numberFormatter } from '../../utils';
|
||||||
|
import { TableSkeleton } from '../Skeleton/TableSkeleton';
|
||||||
|
import { CurrencyItemLogSearchBar, useCurrencyItemLogSearch } from '../searchBar';
|
||||||
|
import { TopButton, ViewTableInfo } from '../common';
|
||||||
|
import Pagination from '../common/Pagination/Pagination';
|
||||||
|
import {
|
||||||
|
INITIAL_PAGE_LIMIT,
|
||||||
|
STORAGE_BUSINESS_LOG_SEARCH,
|
||||||
|
STORAGE_GAME_LOG_CURRENCY_SEARCH,
|
||||||
|
} from '../../assets/data/adminConstants';
|
||||||
|
import ExcelExportButton from '../common/button/ExcelExportButton';
|
||||||
|
import CircularProgress from '../common/CircularProgress';
|
||||||
|
import { GameCurrencyItemLogExport } from '../../apis';
|
||||||
|
import { AnimatedPageWrapper } from '../common/Layout';
|
||||||
|
|
||||||
|
const CurrencyItemLogContent = ({ active }) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const token = sessionStorage.getItem('token');
|
||||||
|
const tableRef = useRef(null);
|
||||||
|
const [downloadState, setDownloadState] = useState({
|
||||||
|
loading: false,
|
||||||
|
progress: 0
|
||||||
|
});
|
||||||
|
|
||||||
|
const {
|
||||||
|
searchParams,
|
||||||
|
loading: dataLoading,
|
||||||
|
data: dataList,
|
||||||
|
handleSearch,
|
||||||
|
handleReset,
|
||||||
|
handlePageChange,
|
||||||
|
handleOrderByChange,
|
||||||
|
handlePageSizeChange,
|
||||||
|
updateSearchParams
|
||||||
|
} = useCurrencyItemLogSearch(token, 500);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if(active) {
|
||||||
|
// 세션 스토리지에서 복사된 메일 데이터 가져오기
|
||||||
|
const paramsData = sessionStorage.getItem(STORAGE_GAME_LOG_CURRENCY_SEARCH);
|
||||||
|
|
||||||
|
if (paramsData) {
|
||||||
|
const searchData = JSON.parse(paramsData);
|
||||||
|
|
||||||
|
handleSearch({
|
||||||
|
start_dt: new Date(searchData.start_dt),
|
||||||
|
end_dt: new Date(searchData.end_dt),
|
||||||
|
search_data: searchData.guid
|
||||||
|
});
|
||||||
|
|
||||||
|
// 사용 후 세션 스토리지 데이터 삭제
|
||||||
|
sessionStorage.removeItem(STORAGE_GAME_LOG_CURRENCY_SEARCH);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [active]);
|
||||||
|
|
||||||
|
const tableHeaders = useMemo(() => {
|
||||||
|
return [
|
||||||
|
// { id: 'logDay', label: '일자', width: '120px' },
|
||||||
|
{ id: 'logTime', label: '일시', width: '150px' },
|
||||||
|
{ id: 'accountId', label: 'account ID', width: '80px' },
|
||||||
|
{ id: 'userGuid', label: 'GUID', width: '200px' },
|
||||||
|
{ id: 'userNickname', label: '아바타명', width: '150px' },
|
||||||
|
{ id: 'tranId', label: '트랜잭션 ID', width: '200px' },
|
||||||
|
{ id: 'action', label: '액션', width: '150px' },
|
||||||
|
{ id: 'currencyType', label: '재화종류', width: '120px' },
|
||||||
|
{ id: 'amountDeltaType', label: '증감유형', width: '120px' },
|
||||||
|
{ id: 'deltaAmount', label: '수량', width: '80px' },
|
||||||
|
// { id: 'deltaAmount', label: '수량원본', width: '120px' },
|
||||||
|
{ id: 'currencyAmount', label: '잔량', width: '80px' },
|
||||||
|
{ id: 'itemId', label: '아이템ID', width: '150px' },
|
||||||
|
];
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
if(!active) return null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AnimatedPageWrapper>
|
||||||
|
<FormWrapper>
|
||||||
|
<CurrencyItemLogSearchBar
|
||||||
|
searchParams={searchParams}
|
||||||
|
onSearch={(newParams, executeSearch = true) => {
|
||||||
|
if (executeSearch) {
|
||||||
|
handleSearch(newParams);
|
||||||
|
} else {
|
||||||
|
updateSearchParams(newParams);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onReset={handleReset}
|
||||||
|
/>
|
||||||
|
</FormWrapper>
|
||||||
|
<ViewTableInfo orderType="asc" pageType="B" total={dataList?.total} total_all={dataList?.total_all}>
|
||||||
|
<ExcelExportButton
|
||||||
|
functionName="GameCurrencyItemLogExport"
|
||||||
|
params={searchParams}
|
||||||
|
fileName={t('FILE_GAME_LOG_CURRENCY_ITEM')}
|
||||||
|
onLoadingChange={setDownloadState}
|
||||||
|
dataSize={dataList?.total_all}
|
||||||
|
/>
|
||||||
|
{downloadState.loading && (
|
||||||
|
<CircularProgressWrapper>
|
||||||
|
<CircularProgress
|
||||||
|
progress={downloadState.progress}
|
||||||
|
size={36}
|
||||||
|
progressColor="#4A90E2"
|
||||||
|
/>
|
||||||
|
</CircularProgressWrapper>
|
||||||
|
)}
|
||||||
|
</ViewTableInfo>
|
||||||
|
{dataLoading ? <TableSkeleton width='100%' count={15} /> :
|
||||||
|
<>
|
||||||
|
<TableWrapper>
|
||||||
|
<TableStyle ref={tableRef}>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
{tableHeaders.map(header => (
|
||||||
|
<th key={header.id} width={header.width}>{header.label}</th>
|
||||||
|
))}
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{dataList?.currency_item_list?.map((item, index) => (
|
||||||
|
<Fragment key={index}>
|
||||||
|
<tr>
|
||||||
|
<td>{item.logTime}</td>
|
||||||
|
<td>{item.accountId}</td>
|
||||||
|
<td>{item.userGuid}</td>
|
||||||
|
<td>{item.userNickname}</td>
|
||||||
|
<td>{item.tranId}</td>
|
||||||
|
<td>{item.action}</td>
|
||||||
|
<td>{CurrencyType.find(data => data.value === item.currencyType)?.name}</td>
|
||||||
|
<td>{amountDeltaType.find(data => data.value === item.amountDeltaType)?.name}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.deltaAmount)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.currencyAmount)}</td>
|
||||||
|
<td>{item.itemIDs}</td>
|
||||||
|
</tr>
|
||||||
|
</Fragment>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</TableStyle>
|
||||||
|
</TableWrapper>
|
||||||
|
{dataList?.currency_item_list &&
|
||||||
|
<Pagination
|
||||||
|
postsPerPage={searchParams.page_size}
|
||||||
|
totalPosts={dataList?.total_all}
|
||||||
|
setCurrentPage={handlePageChange}
|
||||||
|
currentPage={searchParams.page_no}
|
||||||
|
pageLimit={INITIAL_PAGE_LIMIT}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
<TopButton />
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</AnimatedPageWrapper>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default CurrencyItemLogContent;
|
||||||
166
src/components/DataManage/CurrencyLogContent.js
Normal file
166
src/components/DataManage/CurrencyLogContent.js
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
import React, { Fragment, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
|
|
||||||
|
import styled from 'styled-components';
|
||||||
|
import {
|
||||||
|
CircularProgressWrapper,
|
||||||
|
FormWrapper,
|
||||||
|
TableStyle,
|
||||||
|
TableWrapper,
|
||||||
|
} from '../../styles/Components';
|
||||||
|
import { amountDeltaType, CurrencyType } from '../../assets/data';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { numberFormatter } from '../../utils';
|
||||||
|
import { TableSkeleton } from '../Skeleton/TableSkeleton';
|
||||||
|
import { CurrencyLogSearchBar, useCurrencyLogSearch } from '../searchBar';
|
||||||
|
import { TopButton, ViewTableInfo } from '../common';
|
||||||
|
import Pagination from '../common/Pagination/Pagination';
|
||||||
|
import {
|
||||||
|
INITIAL_PAGE_LIMIT,
|
||||||
|
STORAGE_BUSINESS_LOG_SEARCH,
|
||||||
|
STORAGE_GAME_LOG_CURRENCY_SEARCH,
|
||||||
|
} from '../../assets/data/adminConstants';
|
||||||
|
import ExcelExportButton from '../common/button/ExcelExportButton';
|
||||||
|
import CircularProgress from '../common/CircularProgress';
|
||||||
|
import { AnimatedPageWrapper } from '../common/Layout';
|
||||||
|
|
||||||
|
const CurrencyLogContent = ({ active }) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const token = sessionStorage.getItem('token');
|
||||||
|
const tableRef = useRef(null);
|
||||||
|
const [downloadState, setDownloadState] = useState({
|
||||||
|
loading: false,
|
||||||
|
progress: 0
|
||||||
|
});
|
||||||
|
|
||||||
|
const {
|
||||||
|
searchParams,
|
||||||
|
loading: dataLoading,
|
||||||
|
data: dataList,
|
||||||
|
handleSearch,
|
||||||
|
handleReset,
|
||||||
|
handlePageChange,
|
||||||
|
handleOrderByChange,
|
||||||
|
handlePageSizeChange,
|
||||||
|
updateSearchParams
|
||||||
|
} = useCurrencyLogSearch(token, 500);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if(active) {
|
||||||
|
// 세션 스토리지에서 복사된 메일 데이터 가져오기
|
||||||
|
const paramsData = sessionStorage.getItem(STORAGE_GAME_LOG_CURRENCY_SEARCH);
|
||||||
|
|
||||||
|
if (paramsData) {
|
||||||
|
const searchData = JSON.parse(paramsData);
|
||||||
|
|
||||||
|
handleSearch({
|
||||||
|
start_dt: new Date(searchData.start_dt),
|
||||||
|
end_dt: new Date(searchData.end_dt),
|
||||||
|
search_data: searchData.guid
|
||||||
|
});
|
||||||
|
|
||||||
|
// 사용 후 세션 스토리지 데이터 삭제
|
||||||
|
sessionStorage.removeItem(STORAGE_GAME_LOG_CURRENCY_SEARCH);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [active]);
|
||||||
|
|
||||||
|
const tableHeaders = useMemo(() => {
|
||||||
|
return [
|
||||||
|
// { id: 'logDay', label: '일자', width: '120px' },
|
||||||
|
{ id: 'logTime', label: '일시', width: '120px' },
|
||||||
|
{ id: 'accountId', label: 'account ID', width: '80px' },
|
||||||
|
{ id: 'userGuid', label: 'GUID', width: '200px' },
|
||||||
|
{ id: 'userNickname', label: '아바타명', width: '150px' },
|
||||||
|
{ id: 'tranId', label: '트랜잭션 ID', width: '200px' },
|
||||||
|
{ id: 'action', label: '액션', width: '150px' },
|
||||||
|
{ id: 'currencyType', label: '재화종류', width: '120px' },
|
||||||
|
{ id: 'amountDeltaType', label: '증감유형', width: '120px' },
|
||||||
|
{ id: 'deltaAmount', label: '수량', width: '120px' },
|
||||||
|
// { id: 'deltaAmount', label: '수량원본', width: '120px' },
|
||||||
|
{ id: 'currencyAmount', label: '잔량', width: '120px' },
|
||||||
|
];
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
if(!active) return null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AnimatedPageWrapper>
|
||||||
|
<FormWrapper>
|
||||||
|
<CurrencyLogSearchBar
|
||||||
|
searchParams={searchParams}
|
||||||
|
onSearch={(newParams, executeSearch = true) => {
|
||||||
|
if (executeSearch) {
|
||||||
|
handleSearch(newParams);
|
||||||
|
} else {
|
||||||
|
updateSearchParams(newParams);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onReset={handleReset}
|
||||||
|
/>
|
||||||
|
</FormWrapper>
|
||||||
|
<ViewTableInfo orderType="asc" pageType="B" total={dataList?.total} total_all={dataList?.total_all}>
|
||||||
|
<ExcelExportButton
|
||||||
|
functionName="GameCurrencyDetailLogExport"
|
||||||
|
params={searchParams}
|
||||||
|
fileName={t('FILE_GAME_LOG_CURRENCY')}
|
||||||
|
onLoadingChange={setDownloadState}
|
||||||
|
dataSize={dataList?.total_all}
|
||||||
|
/>
|
||||||
|
{downloadState.loading && (
|
||||||
|
<CircularProgressWrapper>
|
||||||
|
<CircularProgress
|
||||||
|
progress={downloadState.progress}
|
||||||
|
size={36}
|
||||||
|
progressColor="#4A90E2"
|
||||||
|
/>
|
||||||
|
</CircularProgressWrapper>
|
||||||
|
)}
|
||||||
|
</ViewTableInfo>
|
||||||
|
{dataLoading ? <TableSkeleton width='100%' count={15} /> :
|
||||||
|
<>
|
||||||
|
<TableWrapper>
|
||||||
|
<TableStyle ref={tableRef}>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
{tableHeaders.map(header => (
|
||||||
|
<th key={header.id} width={header.width}>{header.label}</th>
|
||||||
|
))}
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{dataList?.currency_detail_list?.map((item, index) => (
|
||||||
|
<Fragment key={index}>
|
||||||
|
<tr>
|
||||||
|
<td>{item.logTime}</td>
|
||||||
|
<td>{item.accountId}</td>
|
||||||
|
<td>{item.userGuid}</td>
|
||||||
|
<td>{item.userNickname}</td>
|
||||||
|
<td>{item.tranId}</td>
|
||||||
|
<td>{item.action}</td>
|
||||||
|
<td>{CurrencyType.find(data => data.value === item.currencyType)?.name}</td>
|
||||||
|
<td>{amountDeltaType.find(data => data.value === item.amountDeltaType)?.name}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.deltaAmount)}</td>
|
||||||
|
{/*<td>{item.deltaAmount}</td>*/}
|
||||||
|
<td>{numberFormatter.formatCurrency(item.currencyAmount)}</td>
|
||||||
|
</tr>
|
||||||
|
</Fragment>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</TableStyle>
|
||||||
|
</TableWrapper>
|
||||||
|
{dataList?.currency_detail_list &&
|
||||||
|
<Pagination
|
||||||
|
postsPerPage={searchParams.page_size}
|
||||||
|
totalPosts={dataList?.total_all}
|
||||||
|
setCurrentPage={handlePageChange}
|
||||||
|
currentPage={searchParams.page_no}
|
||||||
|
pageLimit={INITIAL_PAGE_LIMIT}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
<TopButton />
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</AnimatedPageWrapper>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default CurrencyLogContent;
|
||||||
171
src/components/DataManage/ItemLogContent.js
Normal file
171
src/components/DataManage/ItemLogContent.js
Normal file
@@ -0,0 +1,171 @@
|
|||||||
|
import React, { Fragment, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
|
|
||||||
|
import styled from 'styled-components';
|
||||||
|
import {
|
||||||
|
CircularProgressWrapper,
|
||||||
|
FormWrapper,
|
||||||
|
TableStyle,
|
||||||
|
TableWrapper,
|
||||||
|
} from '../../styles/Components';
|
||||||
|
import { amountDeltaType, CurrencyType } from '../../assets/data';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { numberFormatter } from '../../utils';
|
||||||
|
import { TableSkeleton } from '../Skeleton/TableSkeleton';
|
||||||
|
import { ItemLogSearchBar, useItemLogSearch } from '../searchBar';
|
||||||
|
import { TopButton, ViewTableInfo } from '../common';
|
||||||
|
import Pagination from '../common/Pagination/Pagination';
|
||||||
|
import {
|
||||||
|
INITIAL_PAGE_LIMIT,
|
||||||
|
STORAGE_BUSINESS_LOG_SEARCH,
|
||||||
|
STORAGE_GAME_LOG_CURRENCY_SEARCH, STORAGE_GAME_LOG_ITEM_SEARCH,
|
||||||
|
} from '../../assets/data/adminConstants';
|
||||||
|
import ExcelExportButton from '../common/button/ExcelExportButton';
|
||||||
|
import CircularProgress from '../common/CircularProgress';
|
||||||
|
import { countDeltaType, itemTypeLarge } from '../../assets/data/options';
|
||||||
|
import { AnimatedPageWrapper } from '../common/Layout';
|
||||||
|
|
||||||
|
const CurrencyLogContent = ({ active }) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const token = sessionStorage.getItem('token');
|
||||||
|
const tableRef = useRef(null);
|
||||||
|
const [downloadState, setDownloadState] = useState({
|
||||||
|
loading: false,
|
||||||
|
progress: 0
|
||||||
|
});
|
||||||
|
|
||||||
|
const {
|
||||||
|
searchParams,
|
||||||
|
loading: dataLoading,
|
||||||
|
data: dataList,
|
||||||
|
handleSearch,
|
||||||
|
handleReset,
|
||||||
|
handlePageChange,
|
||||||
|
handleOrderByChange,
|
||||||
|
handlePageSizeChange,
|
||||||
|
updateSearchParams
|
||||||
|
} = useItemLogSearch(token, 500);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if(active) {
|
||||||
|
// 세션 스토리지에서 복사된 메일 데이터 가져오기
|
||||||
|
const paramsData = sessionStorage.getItem(STORAGE_GAME_LOG_ITEM_SEARCH);
|
||||||
|
|
||||||
|
if (paramsData) {
|
||||||
|
const searchData = JSON.parse(paramsData);
|
||||||
|
|
||||||
|
handleSearch({
|
||||||
|
start_dt: new Date(searchData.start_dt),
|
||||||
|
end_dt: new Date(searchData.end_dt),
|
||||||
|
search_data: searchData.guid
|
||||||
|
});
|
||||||
|
|
||||||
|
// 사용 후 세션 스토리지 데이터 삭제
|
||||||
|
sessionStorage.removeItem(STORAGE_GAME_LOG_ITEM_SEARCH);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [active]);
|
||||||
|
|
||||||
|
const tableHeaders = useMemo(() => {
|
||||||
|
return [
|
||||||
|
// { id: 'logDay', label: '일자', width: '120px' },
|
||||||
|
{ id: 'logTime', label: '일시', width: '150px' },
|
||||||
|
{ id: 'accountId', label: 'account ID', width: '80px' },
|
||||||
|
{ id: 'userGuid', label: 'GUID', width: '200px' },
|
||||||
|
{ id: 'userNickname', label: '아바타명', width: '150px' },
|
||||||
|
{ id: 'tranId', label: '트랜잭션 ID', width: '200px' },
|
||||||
|
{ id: 'action', label: '액션', width: '120px' },
|
||||||
|
{ id: 'itemId', label: '아이템ID', width: '80px' },
|
||||||
|
{ id: 'itemName', label: '아이템명', width: '150px' },
|
||||||
|
{ id: 'itemTypeLarge', label: 'LargeType', width: '100px' },
|
||||||
|
{ id: 'itemTypeSmall', label: 'SmallType', width: '100px' },
|
||||||
|
{ id: 'countDeltaType', label: '증감유형', width: '80px' },
|
||||||
|
{ id: 'deltaCount', label: '수량', width: '80px' },
|
||||||
|
{ id: 'stackCount', label: '총량', width: '80px' },
|
||||||
|
];
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
if(!active) return null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AnimatedPageWrapper>
|
||||||
|
<FormWrapper>
|
||||||
|
<ItemLogSearchBar
|
||||||
|
searchParams={searchParams}
|
||||||
|
onSearch={(newParams, executeSearch = true) => {
|
||||||
|
if (executeSearch) {
|
||||||
|
handleSearch(newParams);
|
||||||
|
} else {
|
||||||
|
updateSearchParams(newParams);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onReset={handleReset}
|
||||||
|
/>
|
||||||
|
</FormWrapper>
|
||||||
|
<ViewTableInfo orderType="asc" pageType="B" total={dataList?.total} total_all={dataList?.total_all}>
|
||||||
|
<ExcelExportButton
|
||||||
|
functionName="GameItemDetailLogExport"
|
||||||
|
params={searchParams}
|
||||||
|
fileName={t('FILE_GAME_LOG_ITEM')}
|
||||||
|
onLoadingChange={setDownloadState}
|
||||||
|
dataSize={dataList?.total_all}
|
||||||
|
/>
|
||||||
|
{downloadState.loading && (
|
||||||
|
<CircularProgressWrapper>
|
||||||
|
<CircularProgress
|
||||||
|
progress={downloadState.progress}
|
||||||
|
size={36}
|
||||||
|
progressColor="#4A90E2"
|
||||||
|
/>
|
||||||
|
</CircularProgressWrapper>
|
||||||
|
)}
|
||||||
|
</ViewTableInfo>
|
||||||
|
{dataLoading ? <TableSkeleton width='100%' count={15} /> :
|
||||||
|
<>
|
||||||
|
<TableWrapper>
|
||||||
|
<TableStyle ref={tableRef}>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
{tableHeaders.map(header => (
|
||||||
|
<th key={header.id} width={header.width}>{header.label}</th>
|
||||||
|
))}
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{dataList?.item_detail_list?.map((item, index) => (
|
||||||
|
<Fragment key={index}>
|
||||||
|
<tr>
|
||||||
|
<td>{item.logTime}</td>
|
||||||
|
<td>{item.accountId}</td>
|
||||||
|
<td>{item.userGuid}</td>
|
||||||
|
<td>{item.userNickname}</td>
|
||||||
|
<td>{item.tranId}</td>
|
||||||
|
<td>{item.action}</td>
|
||||||
|
<td>{item.itemId}</td>
|
||||||
|
<td>{item.itemName}</td>
|
||||||
|
<td>{itemTypeLarge.find(data => data.value === item.itemTypeLarge)?.name || item.itemTypeLarge}</td>
|
||||||
|
<td>{item.itemTypeSmall}</td>
|
||||||
|
<td>{countDeltaType.find(data => data.value === item.countDeltaType)?.name || item.countDeltaType}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.deltaCount)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.stackCount)}</td>
|
||||||
|
</tr>
|
||||||
|
</Fragment>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</TableStyle>
|
||||||
|
</TableWrapper>
|
||||||
|
{dataList?.item_detail_list &&
|
||||||
|
<Pagination
|
||||||
|
postsPerPage={searchParams.page_size}
|
||||||
|
totalPosts={dataList?.total_all}
|
||||||
|
setCurrentPage={handlePageChange}
|
||||||
|
currentPage={searchParams.page_no}
|
||||||
|
pageLimit={INITIAL_PAGE_LIMIT}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
<TopButton />
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</AnimatedPageWrapper>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default CurrencyLogContent;
|
||||||
@@ -1,219 +0,0 @@
|
|||||||
import { useState } from 'react';
|
|
||||||
import { styled } from 'styled-components';
|
|
||||||
|
|
||||||
import RadioInput from '../common/input/Radio';
|
|
||||||
import Button from '../common/button/Button';
|
|
||||||
|
|
||||||
import DatePicker, { registerLocale } from 'react-datepicker';
|
|
||||||
import { ko } from 'date-fns/esm/locale';
|
|
||||||
import 'react-datepicker/dist/react-datepicker.css';
|
|
||||||
import { getMonth, getYear } from 'date-fns';
|
|
||||||
import range from 'lodash/range';
|
|
||||||
|
|
||||||
import { TextInput, SelectInput, DatePickerWrapper, InputLabel, BtnWrapper } from '../../styles/Components';
|
|
||||||
|
|
||||||
const ItemLogSearchBar = () => {
|
|
||||||
const [startDate, setStartDate] = useState(new Date());
|
|
||||||
const [endDate, setEndDate] = useState(new Date());
|
|
||||||
const [selectData, setSelectData] = useState('default');
|
|
||||||
const years = range(1990, getYear(new Date()) + 1, 1);
|
|
||||||
const months = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'];
|
|
||||||
|
|
||||||
const handleChange = e => {
|
|
||||||
setSelectData(e.target.value);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<SearchbarStyle2>
|
|
||||||
<SearchRow>
|
|
||||||
<RadioGroup>
|
|
||||||
<RadioInput label="기본 조회" id="single" name="receiver" value="default" fontWeight="600" checked={selectData === 'default'} handleChange={handleChange} />
|
|
||||||
<RadioInput label="아이템 소유자 추적" id="multi" name="receiver" value="item" fontWeight="600" checked={selectData === 'item'} handleChange={handleChange} />
|
|
||||||
</RadioGroup>
|
|
||||||
</SearchRow>
|
|
||||||
<SearchRow>
|
|
||||||
<SearchItem>
|
|
||||||
<InputLabel>조회 기간</InputLabel>
|
|
||||||
<DatePickerWrapper>
|
|
||||||
<InputGroup>
|
|
||||||
<DatePicker
|
|
||||||
selected={startDate}
|
|
||||||
onChange={date => setStartDate(date)}
|
|
||||||
className="datepicker"
|
|
||||||
placeholderText="검색기간 선택"
|
|
||||||
calendarClassName="calendar"
|
|
||||||
dateFormat="yyyy - MM - dd"
|
|
||||||
locale="ko"
|
|
||||||
renderCustomHeader={({ date, changeYear, changeMonth, decreaseMonth, increaseMonth, prevMonthButtonDisabled, nextMonthButtonDisabled }) => (
|
|
||||||
<div className="calendar-top">
|
|
||||||
<button
|
|
||||||
className="btn-prev"
|
|
||||||
onClick={e => {
|
|
||||||
e.preventDefault();
|
|
||||||
decreaseMonth();
|
|
||||||
}}
|
|
||||||
disabled={prevMonthButtonDisabled}></button>
|
|
||||||
<select value={getYear(date)} onChange={({ target: { value } }) => changeYear(value)}>
|
|
||||||
{years.map(option => (
|
|
||||||
<option key={option} value={option}>
|
|
||||||
{option}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</select>
|
|
||||||
.
|
|
||||||
<select value={months[getMonth(date)]} onChange={({ target: { value } }) => changeMonth(months.indexOf(value))}>
|
|
||||||
{months.map(option => (
|
|
||||||
<option key={option} value={option}>
|
|
||||||
{option}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</select>
|
|
||||||
<button
|
|
||||||
className="btn-next"
|
|
||||||
onClick={e => {
|
|
||||||
e.preventDefault();
|
|
||||||
increaseMonth();
|
|
||||||
}}
|
|
||||||
disabled={nextMonthButtonDisabled}></button>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<SelectInput>
|
|
||||||
<option value="">00</option>
|
|
||||||
<option value="">01</option>
|
|
||||||
</SelectInput>
|
|
||||||
<SelectInput>
|
|
||||||
<option value="">00</option>
|
|
||||||
<option value="">01</option>
|
|
||||||
</SelectInput>
|
|
||||||
</InputGroup>
|
|
||||||
<span>~</span>
|
|
||||||
<InputGroup>
|
|
||||||
<DatePicker
|
|
||||||
selected={endDate}
|
|
||||||
onChange={date => setEndDate(date)}
|
|
||||||
className="datepicker"
|
|
||||||
placeholderText="검색기간 선택"
|
|
||||||
calendarClassName="calendar"
|
|
||||||
dateFormat="yyyy - MM - dd"
|
|
||||||
minDate = {startDate}
|
|
||||||
locale="ko"
|
|
||||||
renderCustomHeader={({ date, changeYear, changeMonth, decreaseMonth, increaseMonth, prevMonthButtonDisabled, nextMonthButtonDisabled }) => (
|
|
||||||
<div className="calendar-top">
|
|
||||||
<button
|
|
||||||
className="btn-prev"
|
|
||||||
onClick={e => {
|
|
||||||
e.preventDefault();
|
|
||||||
decreaseMonth();
|
|
||||||
}}
|
|
||||||
disabled={prevMonthButtonDisabled}></button>
|
|
||||||
<select value={getYear(date)} onChange={({ target: { value } }) => changeYear(value)}>
|
|
||||||
{years.map(option => (
|
|
||||||
<option key={option} value={option}>
|
|
||||||
{option}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</select>
|
|
||||||
.
|
|
||||||
<select value={months[getMonth(date)]} onChange={({ target: { value } }) => changeMonth(months.indexOf(value))}>
|
|
||||||
{months.map(option => (
|
|
||||||
<option key={option} value={option}>
|
|
||||||
{option}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</select>
|
|
||||||
<button
|
|
||||||
className="btn-next"
|
|
||||||
onClick={e => {
|
|
||||||
e.preventDefault();
|
|
||||||
increaseMonth();
|
|
||||||
}}
|
|
||||||
disabled={nextMonthButtonDisabled}></button>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<SelectInput>
|
|
||||||
<option value="">00</option>
|
|
||||||
<option value="">01</option>
|
|
||||||
</SelectInput>
|
|
||||||
<SelectInput>
|
|
||||||
<option value="">00</option>
|
|
||||||
<option value="">01</option>
|
|
||||||
</SelectInput>
|
|
||||||
</InputGroup>
|
|
||||||
</DatePickerWrapper>
|
|
||||||
</SearchItem>
|
|
||||||
</SearchRow>
|
|
||||||
<SearchRow>
|
|
||||||
{selectData === 'default' ? (
|
|
||||||
<SearchItem>
|
|
||||||
<InputLabel>조회 대상</InputLabel>
|
|
||||||
<TextInput type="text" placeholder="조회 대상 유저의 GUID를 입력하세요." width="600px" />
|
|
||||||
</SearchItem>
|
|
||||||
) : (
|
|
||||||
<SearchItem>
|
|
||||||
<InputLabel>아이템 ID</InputLabel>
|
|
||||||
<TextInput type="text" placeholder="아이템의 GUID를 입력하세요." width="600px" />
|
|
||||||
</SearchItem>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<BtnWrapper $gap="8px">
|
|
||||||
<Button theme="reset" />
|
|
||||||
<Button theme="gray" text="검색" />
|
|
||||||
</BtnWrapper>
|
|
||||||
</SearchRow>
|
|
||||||
</SearchbarStyle2>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ItemLogSearchBar;
|
|
||||||
|
|
||||||
const SearchbarStyle = styled.div`
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 20px 0;
|
|
||||||
font-size: 14px;
|
|
||||||
padding: 20px;
|
|
||||||
border-top: 1px solid #000;
|
|
||||||
border-bottom: 1px solid #000;
|
|
||||||
margin-bottom: 40px;
|
|
||||||
`;
|
|
||||||
const SearchbarStyle2 = styled(SearchbarStyle)`
|
|
||||||
flex-flow: column;
|
|
||||||
gap: 20px;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const SearchRow = styled.div`
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 20px 0;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const InputGroup = styled.div`
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 5px;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const RadioGroup = styled(InputGroup)`
|
|
||||||
gap: 30px;
|
|
||||||
height: 35px;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const SearchItem = styled.div`
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 20px;
|
|
||||||
margin-right: 50px;
|
|
||||||
|
|
||||||
${TextInput}, ${SelectInput} {
|
|
||||||
height: 35px;
|
|
||||||
}
|
|
||||||
${TextInput} {
|
|
||||||
padding: 0 10px;
|
|
||||||
max-width: 400px;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
@@ -2,16 +2,19 @@ import { styled } from 'styled-components';
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
import { Title } from '../../styles/Components';
|
import { Title } from '../../styles/Components';
|
||||||
import { TextInput, BtnWrapper, ButtonClose, ModalText } from '../../styles/Components';
|
import { TextInput, BtnWrapper } from '../../styles/Components';
|
||||||
import Button from '../../components/common/button/Button';
|
import Button from '../../components/common/button/Button';
|
||||||
import Modal from '../../components/common/modal/Modal';
|
import Modal from '../../components/common/modal/Modal';
|
||||||
import { UserChangeNickName } from '../../apis';
|
import { UserChangeNickName } from '../../apis';
|
||||||
|
import { alertTypes } from '../../assets/data/types';
|
||||||
|
import { useAlert } from '../../context/AlertProvider';
|
||||||
|
import { useLoading } from '../../context/LoadingProvider';
|
||||||
|
|
||||||
const NicknameChangeModal = ({ pwPop, handleClick, dataList }) => {
|
const NicknameChangeModal = ({ pwPop, handleClick, dataList }) => {
|
||||||
|
const {showModal, showToast} = useAlert();
|
||||||
|
const {withLoading} = useLoading();
|
||||||
|
|
||||||
let nickName = dataList.char_info && dataList.char_info.character_name;
|
let nickName = dataList.char_info && dataList.char_info.character_name;
|
||||||
const [modifyModal, setModifyModal] = useState('hidden');
|
|
||||||
const [completeModal, setCompleteModal] = useState('hidden');
|
|
||||||
const [completeText, setCompleteText] = useState('');
|
|
||||||
|
|
||||||
const [resultData, setResultData] = useState({
|
const [resultData, setResultData] = useState({
|
||||||
guid: '',
|
guid: '',
|
||||||
@@ -20,42 +23,42 @@ const NicknameChangeModal = ({ pwPop, handleClick, dataList }) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setResultData({ ...resultData, guid: dataList.user_info && dataList.user_info.aid, nickname: dataList.char_info && dataList.char_info.character_name });
|
setResultData({ ...resultData,
|
||||||
|
guid: dataList.user_info && dataList.user_info.aid,
|
||||||
|
nickname: dataList.char_info && dataList.char_info.character_name
|
||||||
|
});
|
||||||
}, [dataList]);
|
}, [dataList]);
|
||||||
|
|
||||||
// 수정 모달창
|
const handleSubmit = async (type, param = null) => {
|
||||||
const handleModifyModal = () => {
|
switch (type) {
|
||||||
if (modifyModal === 'hidden') {
|
|
||||||
setModifyModal('view');
|
case "nicknameChangeSubmit":
|
||||||
} else {
|
showModal('NICKNAME_CHANGES_CONFIRM', {
|
||||||
setModifyModal('hidden');
|
type: alertTypes.confirm,
|
||||||
|
onConfirm: () => handleSubmit('nicknameChange')
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "nicknameChange":
|
||||||
|
const token = sessionStorage.getItem('token');
|
||||||
|
|
||||||
|
await withLoading(async () => {
|
||||||
|
return await UserChangeNickName(token, resultData);
|
||||||
|
}).then(data =>{
|
||||||
|
console.log(data);
|
||||||
|
if(data.result === 'ERROR'){
|
||||||
|
showToast(data.data.message, {type: alertTypes.error});
|
||||||
|
}else{
|
||||||
|
showToast('NICKNAME_CHANGES_COMPLETE', {type: alertTypes.success});
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
showToast(error, {type: alertTypes.error});
|
||||||
|
}).finally(() => {
|
||||||
|
handleClick();
|
||||||
|
});
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
// 완료 모달창
|
|
||||||
const handleCompleteModal = () => {
|
|
||||||
if (completeModal === 'hidden') {
|
|
||||||
setCompleteModal('view');
|
|
||||||
} else {
|
|
||||||
setCompleteModal('hidden');
|
|
||||||
|
|
||||||
handleClick();
|
|
||||||
completeText === '변경이 완료되었습니다.' && window.location.reload();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 수정
|
|
||||||
const handleModifyNotice = async () => {
|
|
||||||
const token = sessionStorage.getItem('token');
|
|
||||||
|
|
||||||
const message = await UserChangeNickName(token, resultData);
|
|
||||||
|
|
||||||
// console.log(message);
|
|
||||||
message.data.data.message !== '수정 하였습니다.' ? setCompleteText('변경 닉네임이 이미 존재합니다.\n다시 시도해주세요.') : setCompleteText('변경이 완료되었습니다.');
|
|
||||||
|
|
||||||
handleCompleteModal();
|
|
||||||
handleModifyModal();
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -82,29 +85,7 @@ const NicknameChangeModal = ({ pwPop, handleClick, dataList }) => {
|
|||||||
</PwSetTable>
|
</PwSetTable>
|
||||||
<BtnWrapper $justify="center" $gap="10px">
|
<BtnWrapper $justify="center" $gap="10px">
|
||||||
<Button theme="line" text="취소" handleClick={handleClick} />
|
<Button theme="line" text="취소" handleClick={handleClick} />
|
||||||
<Button theme="primary" text="변경하기" handleClick={handleModifyModal} />
|
<Button theme="primary" text="변경하기" handleClick={() => handleSubmit('nicknameChangeSubmit')} />
|
||||||
</BtnWrapper>
|
|
||||||
</Modal>
|
|
||||||
|
|
||||||
{/* 확인 모달 */}
|
|
||||||
<Modal min="440px" $padding="40px" $bgcolor="transparent" $view={modifyModal}>
|
|
||||||
<BtnWrapper $justify="flex-end">
|
|
||||||
<ButtonClose onClick={handleModifyModal} />
|
|
||||||
</BtnWrapper>
|
|
||||||
<ModalText $align="center">닉네임을 변경하시겠습니까?</ModalText>
|
|
||||||
<BtnWrapper $gap="10px">
|
|
||||||
<Button text="취소" theme="line" size="large" width="100%" handleClick={handleModifyModal} />
|
|
||||||
<Button text="확인" theme="primary" type="submit" size="large" width="100%" handleClick={handleModifyNotice} />
|
|
||||||
</BtnWrapper>
|
|
||||||
</Modal>
|
|
||||||
{/* 완료 모달 */}
|
|
||||||
<Modal min="440px" $padding="40px" $bgcolor="transparent" $view={completeModal}>
|
|
||||||
<BtnWrapper $justify="flex-end">
|
|
||||||
<ButtonClose onClick={handleCompleteModal} />
|
|
||||||
</BtnWrapper>
|
|
||||||
<ModalText $align="center">{completeText}</ModalText>
|
|
||||||
<BtnWrapper $gap="10px">
|
|
||||||
<Button text="확인" theme="primary" type="submit" size="large" width="100%" handleClick={handleCompleteModal} />
|
|
||||||
</BtnWrapper>
|
</BtnWrapper>
|
||||||
</Modal>
|
</Modal>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -5,15 +5,31 @@ import { BtnWrapper, TableStyle } from '../../styles/Components';
|
|||||||
import Button from '../../components/common/button/Button';
|
import Button from '../../components/common/button/Button';
|
||||||
import Modal from '../../components/common/modal/Modal';
|
import Modal from '../../components/common/modal/Modal';
|
||||||
import { useEffect, useState, Fragment } from 'react';
|
import { useEffect, useState, Fragment } from 'react';
|
||||||
|
import { questStatus } from '../../assets/data/options';
|
||||||
|
import { commonStatus } from '../../assets/data';
|
||||||
|
import { useModal } from '../../hooks/hook';
|
||||||
|
import { alertTypes } from '../../assets/data/types';
|
||||||
|
import { useAlert } from '../../context/AlertProvider';
|
||||||
|
|
||||||
|
const QuestDetailModal = ({ detailPop, handleClick, detailQuest, handleQuestComplete }) => {
|
||||||
|
const { showModal } = useAlert();
|
||||||
|
|
||||||
const QuestDetailModal = ({ detailPop, handleClick, detailQuest }) => {
|
|
||||||
const [detailList, setDetailList] = useState([])
|
const [detailList, setDetailList] = useState([])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
Array.isArray(detailQuest) && setDetailList(detailQuest)
|
Array.isArray(detailQuest.detailQuest) && setDetailList(detailQuest.detailQuest)
|
||||||
|
|
||||||
}, [detailQuest])
|
}, [detailQuest])
|
||||||
// const questlist = [{ taskNo: detailQuest.task_no, taskName: detailQuest.quest_name, counter: detailQuest.counter, state: detailQuest.status }];
|
|
||||||
|
const handleQuestCompleteConfirm = (data) => {
|
||||||
|
const params = {...data, quest_key: detailQuest.quest_key}
|
||||||
|
showModal('QUEST_TASK_COMPLETE_CONFIRM',{
|
||||||
|
type: alertTypes.confirm,
|
||||||
|
onConfirm: () => {
|
||||||
|
handleQuestComplete(params);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Modal $view={detailPop} min="480px">
|
<Modal $view={detailPop} min="480px">
|
||||||
@@ -25,7 +41,8 @@ const QuestDetailModal = ({ detailPop, handleClick, detailQuest }) => {
|
|||||||
<th width="80">Task No</th>
|
<th width="80">Task No</th>
|
||||||
<th>Task Name</th>
|
<th>Task Name</th>
|
||||||
<th width="120">Counter</th>
|
<th width="120">Counter</th>
|
||||||
<th width="120">State</th>
|
<th width="120">상태</th>
|
||||||
|
<th width="120">완료처리</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -36,7 +53,10 @@ const QuestDetailModal = ({ detailPop, handleClick, detailQuest }) => {
|
|||||||
<td>{el.task_no}</td>
|
<td>{el.task_no}</td>
|
||||||
<td>{el.quest_name}</td>
|
<td>{el.quest_name}</td>
|
||||||
<td>{el.counter}</td>
|
<td>{el.counter}</td>
|
||||||
<td>{el.status}</td>
|
<td>{questStatus.find(data => data.value === el.status)?.name}</td>
|
||||||
|
<td>
|
||||||
|
{ el.status === commonStatus.running && <Button text="완료" theme="line" handleClick={() => handleQuestCompleteConfirm(el)} />}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,198 +0,0 @@
|
|||||||
import { styled } from 'styled-components';
|
|
||||||
import { useState } from 'react';
|
|
||||||
|
|
||||||
import Button from '../../components/common/button/Button';
|
|
||||||
|
|
||||||
import DatePicker, { registerLocale } from 'react-datepicker';
|
|
||||||
import 'react-datepicker/dist/react-datepicker.css';
|
|
||||||
import { getMonth, getYear } from 'date-fns';
|
|
||||||
import range from 'lodash/range';
|
|
||||||
|
|
||||||
import { TextInput, SelectInput, DatePickerWrapper, InputLabel, BtnWrapper } from '../../styles/Components';
|
|
||||||
|
|
||||||
const TradeLogSerchBar = () => {
|
|
||||||
const [startDate, setStartDate] = useState(new Date());
|
|
||||||
const [endDate, setEndDate] = useState(new Date());
|
|
||||||
const [selectData, setSelectData] = useState('default');
|
|
||||||
const years = range(1990, getYear(new Date()) + 1, 1);
|
|
||||||
const months = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'];
|
|
||||||
|
|
||||||
const handleChange = e => {
|
|
||||||
setSelectData(e.target.value);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<SearchbarStyle2>
|
|
||||||
<SearchRow>
|
|
||||||
<SearchItem>
|
|
||||||
<InputLabel>조회 기간</InputLabel>
|
|
||||||
<DatePickerWrapper>
|
|
||||||
<InputGroup>
|
|
||||||
<DatePicker
|
|
||||||
selected={startDate}
|
|
||||||
onChange={date => setStartDate(date)}
|
|
||||||
className="datepicker"
|
|
||||||
placeholderText="검색기간 선택"
|
|
||||||
calendarClassName="calendar"
|
|
||||||
dateFormat="yyyy - MM - dd"
|
|
||||||
locale="ko"
|
|
||||||
renderCustomHeader={({ date, changeYear, changeMonth, decreaseMonth, increaseMonth, prevMonthButtonDisabled, nextMonthButtonDisabled }) => (
|
|
||||||
<div className="calendar-top">
|
|
||||||
<button
|
|
||||||
className="btn-prev"
|
|
||||||
onClick={e => {
|
|
||||||
e.preventDefault();
|
|
||||||
decreaseMonth();
|
|
||||||
}}
|
|
||||||
disabled={prevMonthButtonDisabled}></button>
|
|
||||||
<select value={getYear(date)} onChange={({ target: { value } }) => changeYear(value)}>
|
|
||||||
{years.map(option => (
|
|
||||||
<option key={option} value={option}>
|
|
||||||
{option}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</select>
|
|
||||||
.
|
|
||||||
<select value={months[getMonth(date)]} onChange={({ target: { value } }) => changeMonth(months.indexOf(value))}>
|
|
||||||
{months.map(option => (
|
|
||||||
<option key={option} value={option}>
|
|
||||||
{option}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</select>
|
|
||||||
<button
|
|
||||||
className="btn-next"
|
|
||||||
onClick={e => {
|
|
||||||
e.preventDefault();
|
|
||||||
increaseMonth();
|
|
||||||
}}
|
|
||||||
disabled={nextMonthButtonDisabled}></button>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<SelectInput>
|
|
||||||
<option value="">00</option>
|
|
||||||
<option value="">01</option>
|
|
||||||
</SelectInput>
|
|
||||||
<SelectInput>
|
|
||||||
<option value="">00</option>
|
|
||||||
<option value="">01</option>
|
|
||||||
</SelectInput>
|
|
||||||
</InputGroup>
|
|
||||||
<span>~</span>
|
|
||||||
<InputGroup>
|
|
||||||
<DatePicker
|
|
||||||
selected={endDate}
|
|
||||||
onChange={date => setEndDate(date)}
|
|
||||||
className="datepicker"
|
|
||||||
placeholderText="검색기간 선택"
|
|
||||||
calendarClassName="calendar"
|
|
||||||
dateFormat="yyyy - MM - dd"
|
|
||||||
minDate = {startDate}
|
|
||||||
locale="ko"
|
|
||||||
renderCustomHeader={({ date, changeYear, changeMonth, decreaseMonth, increaseMonth, prevMonthButtonDisabled, nextMonthButtonDisabled }) => (
|
|
||||||
<div className="calendar-top">
|
|
||||||
<button
|
|
||||||
className="btn-prev"
|
|
||||||
onClick={e => {
|
|
||||||
e.preventDefault();
|
|
||||||
decreaseMonth();
|
|
||||||
}}
|
|
||||||
disabled={prevMonthButtonDisabled}></button>
|
|
||||||
<select value={getYear(date)} onChange={({ target: { value } }) => changeYear(value)}>
|
|
||||||
{years.map(option => (
|
|
||||||
<option key={option} value={option}>
|
|
||||||
{option}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</select>
|
|
||||||
.
|
|
||||||
<select value={months[getMonth(date)]} onChange={({ target: { value } }) => changeMonth(months.indexOf(value))}>
|
|
||||||
{months.map(option => (
|
|
||||||
<option key={option} value={option}>
|
|
||||||
{option}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</select>
|
|
||||||
<button
|
|
||||||
className="btn-next"
|
|
||||||
onClick={e => {
|
|
||||||
e.preventDefault();
|
|
||||||
increaseMonth();
|
|
||||||
}}
|
|
||||||
disabled={nextMonthButtonDisabled}></button>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<SelectInput>
|
|
||||||
<option value="">00</option>
|
|
||||||
<option value="">01</option>
|
|
||||||
</SelectInput>
|
|
||||||
<SelectInput>
|
|
||||||
<option value="">00</option>
|
|
||||||
<option value="">01</option>
|
|
||||||
</SelectInput>
|
|
||||||
</InputGroup>
|
|
||||||
</DatePickerWrapper>
|
|
||||||
</SearchItem>
|
|
||||||
</SearchRow>
|
|
||||||
<SearchRow>
|
|
||||||
<SearchItem>
|
|
||||||
<InputLabel>조회 대상</InputLabel>
|
|
||||||
<TextInput type="text" placeholder="조회 대상 유저의 GUID를 입력하세요." width="600px" />
|
|
||||||
</SearchItem>
|
|
||||||
<BtnWrapper $gap="8px">
|
|
||||||
<Button theme="reset" />
|
|
||||||
<Button theme="gray" text="검색" />
|
|
||||||
</BtnWrapper>
|
|
||||||
</SearchRow>
|
|
||||||
</SearchbarStyle2>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default TradeLogSerchBar;
|
|
||||||
|
|
||||||
const SearchbarStyle = styled.div`
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 20px 0;
|
|
||||||
font-size: 14px;
|
|
||||||
padding: 20px;
|
|
||||||
border-top: 1px solid #000;
|
|
||||||
border-bottom: 1px solid #000;
|
|
||||||
margin-bottom: 40px;
|
|
||||||
`;
|
|
||||||
const SearchbarStyle2 = styled(SearchbarStyle)`
|
|
||||||
flex-flow: column;
|
|
||||||
gap: 20px;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const SearchRow = styled.div`
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 20px 0;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const InputGroup = styled.div`
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 5px;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const SearchItem = styled.div`
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 20px;
|
|
||||||
margin-right: 50px;
|
|
||||||
|
|
||||||
${TextInput}, ${SelectInput} {
|
|
||||||
height: 35px;
|
|
||||||
}
|
|
||||||
${TextInput} {
|
|
||||||
padding: 0 10px;
|
|
||||||
max-width: 400px;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
146
src/components/DataManage/UserCreateLogContent.js
Normal file
146
src/components/DataManage/UserCreateLogContent.js
Normal file
@@ -0,0 +1,146 @@
|
|||||||
|
import React, { Fragment, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
|
|
||||||
|
import {
|
||||||
|
CircularProgressWrapper,
|
||||||
|
FormWrapper,
|
||||||
|
TableStyle,
|
||||||
|
TableWrapper,
|
||||||
|
} from '../../styles/Components';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { TableSkeleton } from '../Skeleton/TableSkeleton';
|
||||||
|
import { useUserCreateLogSearch, UserCreateLogSearchBar } from '../searchBar';
|
||||||
|
import { TopButton, ViewTableInfo } from '../common';
|
||||||
|
import Pagination from '../common/Pagination/Pagination';
|
||||||
|
import {
|
||||||
|
INITIAL_PAGE_LIMIT,STORAGE_GAME_LOG_USER_CREATE_SEARCH,
|
||||||
|
} from '../../assets/data/adminConstants';
|
||||||
|
import ExcelExportButton from '../common/button/ExcelExportButton';
|
||||||
|
import CircularProgress from '../common/CircularProgress';
|
||||||
|
import { AnimatedPageWrapper } from '../common/Layout';
|
||||||
|
|
||||||
|
const UserCreateLogContent = ({ active }) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const token = sessionStorage.getItem('token');
|
||||||
|
const tableRef = useRef(null);
|
||||||
|
const [downloadState, setDownloadState] = useState({
|
||||||
|
loading: false,
|
||||||
|
progress: 0
|
||||||
|
});
|
||||||
|
|
||||||
|
const {
|
||||||
|
searchParams,
|
||||||
|
loading: dataLoading,
|
||||||
|
data: dataList,
|
||||||
|
handleSearch,
|
||||||
|
handleReset,
|
||||||
|
handlePageChange,
|
||||||
|
updateSearchParams
|
||||||
|
} = useUserCreateLogSearch(token, 500);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if(active) {
|
||||||
|
// 세션 스토리지에서 복사된 메일 데이터 가져오기
|
||||||
|
const paramsData = sessionStorage.getItem(STORAGE_GAME_LOG_USER_CREATE_SEARCH);
|
||||||
|
|
||||||
|
if (paramsData) {
|
||||||
|
const searchData = JSON.parse(paramsData);
|
||||||
|
|
||||||
|
handleSearch({
|
||||||
|
start_dt: new Date(searchData.start_dt),
|
||||||
|
end_dt: new Date(searchData.end_dt),
|
||||||
|
search_data: searchData.guid
|
||||||
|
});
|
||||||
|
|
||||||
|
// 사용 후 세션 스토리지 데이터 삭제
|
||||||
|
sessionStorage.removeItem(STORAGE_GAME_LOG_USER_CREATE_SEARCH);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [active]);
|
||||||
|
|
||||||
|
const tableHeaders = useMemo(() => {
|
||||||
|
return [
|
||||||
|
{ id: 'logDay', label: '일자', width: '120px' },
|
||||||
|
{ id: 'accountId', label: 'account ID', width: '80px' },
|
||||||
|
{ id: 'userGuid', label: 'GUID', width: '200px' },
|
||||||
|
{ id: 'userNickname', label: '아바타명', width: '150px' },
|
||||||
|
{ id: 'createTime', label: '생성일시', width: '200px' },
|
||||||
|
];
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
if(!active) return null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AnimatedPageWrapper>
|
||||||
|
<FormWrapper>
|
||||||
|
<UserCreateLogSearchBar
|
||||||
|
searchParams={searchParams}
|
||||||
|
onSearch={(newParams, executeSearch = true) => {
|
||||||
|
if (executeSearch) {
|
||||||
|
handleSearch(newParams);
|
||||||
|
} else {
|
||||||
|
updateSearchParams(newParams);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onReset={handleReset}
|
||||||
|
/>
|
||||||
|
</FormWrapper>
|
||||||
|
<ViewTableInfo orderType="asc" pageType="B" total={dataList?.total} total_all={dataList?.total_all}>
|
||||||
|
<ExcelExportButton
|
||||||
|
functionName="GameUserCreateLogExport"
|
||||||
|
params={searchParams}
|
||||||
|
fileName={t('FILE_GAME_LOG_USER_CREATE')}
|
||||||
|
onLoadingChange={setDownloadState}
|
||||||
|
dataSize={dataList?.total_all}
|
||||||
|
/>
|
||||||
|
{downloadState.loading && (
|
||||||
|
<CircularProgressWrapper>
|
||||||
|
<CircularProgress
|
||||||
|
progress={downloadState.progress}
|
||||||
|
size={36}
|
||||||
|
progressColor="#4A90E2"
|
||||||
|
/>
|
||||||
|
</CircularProgressWrapper>
|
||||||
|
)}
|
||||||
|
</ViewTableInfo>
|
||||||
|
{dataLoading ? <TableSkeleton width='100%' count={15} /> :
|
||||||
|
<>
|
||||||
|
<TableWrapper>
|
||||||
|
<TableStyle ref={tableRef}>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
{tableHeaders.map(header => (
|
||||||
|
<th key={header.id} width={header.width}>{header.label}</th>
|
||||||
|
))}
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{dataList?.user_create_list?.map((item, index) => (
|
||||||
|
<Fragment key={index}>
|
||||||
|
<tr>
|
||||||
|
<td>{item.logDay}</td>
|
||||||
|
<td>{item.accountId}</td>
|
||||||
|
<td>{item.userGuid}</td>
|
||||||
|
<td>{item.userNickname}</td>
|
||||||
|
<td>{item.createdTime}</td>
|
||||||
|
</tr>
|
||||||
|
</Fragment>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</TableStyle>
|
||||||
|
</TableWrapper>
|
||||||
|
{dataList?.user_create_list &&
|
||||||
|
<Pagination
|
||||||
|
postsPerPage={searchParams.page_size}
|
||||||
|
totalPosts={dataList?.total_all}
|
||||||
|
setCurrentPage={handlePageChange}
|
||||||
|
currentPage={searchParams.page_no}
|
||||||
|
pageLimit={INITIAL_PAGE_LIMIT}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
<TopButton />
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</AnimatedPageWrapper>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default UserCreateLogContent;
|
||||||
@@ -193,10 +193,10 @@ const UserDefaultInfo = ({ userInfo }) => {
|
|||||||
<td colSpan="3">
|
<td colSpan="3">
|
||||||
{dataList.char_info && dataList.char_info.character_name}
|
{dataList.char_info && dataList.char_info.character_name}
|
||||||
<EditButton
|
<EditButton
|
||||||
hidden={true}
|
// hidden={true}
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
handleModalClose('pwChange');
|
handleModalView('pwChange');
|
||||||
}}></EditButton>
|
}}></EditButton>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -219,7 +219,13 @@ const UserDefaultInfo = ({ userInfo }) => {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</UserInfoTable>
|
</UserInfoTable>
|
||||||
</div>
|
</div>
|
||||||
<NicknameChangeModal pwPop={modalState.pwChangeModal} handleClick={() => handleModalClose('pwChange')} dataList={dataList} />
|
<NicknameChangeModal
|
||||||
|
pwPop={modalState.pwChangeModal}
|
||||||
|
handleClick={() => {
|
||||||
|
handleModalClose('pwChange');
|
||||||
|
fetchData();
|
||||||
|
}}
|
||||||
|
dataList={dataList} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -93,12 +93,6 @@ const UserInfoTable = styled.table`
|
|||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
tr:first-child {
|
|
||||||
th,
|
|
||||||
td {
|
|
||||||
border-top: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
th,
|
th,
|
||||||
td {
|
td {
|
||||||
height: 36px;
|
height: 36px;
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ const UserInventoryInfo = ({ userInfo }) => {
|
|||||||
<th width="120">ID</th>
|
<th width="120">ID</th>
|
||||||
<th width="50%">아이템</th>
|
<th width="50%">아이템</th>
|
||||||
<th width="100">보유개수</th>
|
<th width="100">보유개수</th>
|
||||||
<th width="60">삭제</th>
|
{/*<th width="60">삭제</th>*/}
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -205,9 +205,9 @@ const UserInventoryInfo = ({ userInfo }) => {
|
|||||||
<td>{el.item_id}</td>
|
<td>{el.item_id}</td>
|
||||||
<td>{el.item_name}</td>
|
<td>{el.item_name}</td>
|
||||||
<td>{el.count}</td>
|
<td>{el.count}</td>
|
||||||
<td>
|
{/*<td>*/}
|
||||||
<Button theme={authDelete ? "line" : "disable"} id={el.item_guid} name="single" text="삭제" handleClick={e => {handleDeleteConfirmModal(el, type)}} disabled={!authDelete}/>
|
{/* <Button theme={authDelete ? "line" : "disable"} id={el.item_guid} name="single" text="삭제" handleClick={e => {handleDeleteConfirmModal(el, type)}} disabled={!authDelete}/>*/}
|
||||||
</td>
|
{/*</td>*/}
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
@@ -246,136 +246,6 @@ const UserInventoryInfo = ({ userInfo }) => {
|
|||||||
modalText={t('DEL_COMPLETE')}
|
modalText={t('DEL_COMPLETE')}
|
||||||
handleComplete={handleDeleteComplete}
|
handleComplete={handleDeleteComplete}
|
||||||
/>
|
/>
|
||||||
{/* <InfoSubTitle>의상 탭</InfoSubTitle>
|
|
||||||
<UserTableWrapper>
|
|
||||||
<UserDefaultTable>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th width="80">no.</th>
|
|
||||||
<th width="120">ID</th>
|
|
||||||
<th width="50%">아이템</th>
|
|
||||||
<th width="100">보유개수</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{dataList &&
|
|
||||||
dataList.inventory_list.cloth.map((el, idx) => {
|
|
||||||
return (
|
|
||||||
<tr key={idx}>
|
|
||||||
<td>{idx + 1}</td>
|
|
||||||
<td>{el.item_id}</td>
|
|
||||||
<td>{el.item_name}</td>
|
|
||||||
<td>{el.count}</td>
|
|
||||||
</tr>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</tbody>
|
|
||||||
</UserDefaultTable>
|
|
||||||
</UserTableWrapper>
|
|
||||||
<InfoSubTitle>소품 탭</InfoSubTitle>
|
|
||||||
<UserTableWrapper>
|
|
||||||
<UserDefaultTable>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th width="80">no.</th>
|
|
||||||
<th width="120">ID</th>
|
|
||||||
<th width="50%">아이템</th>
|
|
||||||
<th width="100">보유개수</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{dataList &&
|
|
||||||
dataList.inventory_list.prop.map((el, idx) => {
|
|
||||||
return (
|
|
||||||
<tr key={idx}>
|
|
||||||
<td>{idx + 1}</td>
|
|
||||||
<td>{el.item_id}</td>
|
|
||||||
<td>{el.item_name}</td>
|
|
||||||
<td>{el.count}</td>
|
|
||||||
</tr>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</tbody>
|
|
||||||
</UserDefaultTable>
|
|
||||||
</UserTableWrapper>
|
|
||||||
<InfoSubTitle>미용 탭</InfoSubTitle>
|
|
||||||
<UserTableWrapper>
|
|
||||||
<UserDefaultTable>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th width="80">no.</th>
|
|
||||||
<th width="120">ID</th>
|
|
||||||
<th width="50%">아이템</th>
|
|
||||||
<th width="100">보유개수</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{dataList &&
|
|
||||||
dataList.inventory_list.beauty.map((el, idx) => {
|
|
||||||
return (
|
|
||||||
<tr key={idx}>
|
|
||||||
<td>{idx + 1}</td>
|
|
||||||
<td>{el.item_id}</td>
|
|
||||||
<td>{el.item_name}</td>
|
|
||||||
<td>{el.count}</td>
|
|
||||||
</tr>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</tbody>
|
|
||||||
</UserDefaultTable>
|
|
||||||
</UserTableWrapper>
|
|
||||||
<InfoSubTitle>타투 탭</InfoSubTitle>
|
|
||||||
<UserTableWrapper>
|
|
||||||
<UserDefaultTable>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th width="80">no.</th>
|
|
||||||
<th width="120">ID</th>
|
|
||||||
<th width="50%">아이템</th>
|
|
||||||
<th width="100">보유개수</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{dataList &&
|
|
||||||
dataList.inventory_list.tattoo.map((el, idx) => {
|
|
||||||
return (
|
|
||||||
<tr key={idx}>
|
|
||||||
<td>{idx + 1}</td>
|
|
||||||
<td>{el.item_id}</td>
|
|
||||||
<td>{el.item_name}</td>
|
|
||||||
<td>{el.count}</td>
|
|
||||||
</tr>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</tbody>
|
|
||||||
</UserDefaultTable>
|
|
||||||
</UserTableWrapper>
|
|
||||||
<InfoSubTitle>기타 탭</InfoSubTitle>
|
|
||||||
<UserTableWrapper>
|
|
||||||
<UserDefaultTable>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th width="80">슬롯 no.</th>
|
|
||||||
<th width="320">ID</th>
|
|
||||||
<th width="50%">아이템</th>
|
|
||||||
<th width="100">보유개수</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{dataList &&
|
|
||||||
dataList.inventory_list.etc.map((el, idx) => {
|
|
||||||
return (
|
|
||||||
<tr key={idx}>
|
|
||||||
<td>{idx + 1}</td>
|
|
||||||
<td>{el.item_id}</td>
|
|
||||||
<td>{el.item_name}</td>
|
|
||||||
<td>{el.count}</td>
|
|
||||||
</tr>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</tbody>
|
|
||||||
</UserDefaultTable>
|
|
||||||
</UserTableWrapper> */}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
159
src/components/DataManage/UserLoginLogContent.js
Normal file
159
src/components/DataManage/UserLoginLogContent.js
Normal file
@@ -0,0 +1,159 @@
|
|||||||
|
import React, { Fragment, useEffect, useMemo, useRef, useState } from 'react';
|
||||||
|
|
||||||
|
import {
|
||||||
|
CircularProgressWrapper,
|
||||||
|
FormWrapper,
|
||||||
|
TableStyle,
|
||||||
|
TableWrapper,
|
||||||
|
} from '../../styles/Components';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { TableSkeleton } from '../Skeleton/TableSkeleton';
|
||||||
|
import { useUserLoginLogSearch, UserLoginLogSearchBar } from '../searchBar';
|
||||||
|
import { TopButton, ViewTableInfo } from '../common';
|
||||||
|
import Pagination from '../common/Pagination/Pagination';
|
||||||
|
import {
|
||||||
|
INITIAL_PAGE_LIMIT, STORAGE_GAME_LOG_USER_LOGIN_SEARCH,
|
||||||
|
} from '../../assets/data/adminConstants';
|
||||||
|
import ExcelExportButton from '../common/button/ExcelExportButton';
|
||||||
|
import CircularProgress from '../common/CircularProgress';
|
||||||
|
import { AnimatedPageWrapper } from '../common/Layout';
|
||||||
|
import { numberFormatter } from '../../utils';
|
||||||
|
|
||||||
|
const UserLoginLogContent = ({ active }) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const token = sessionStorage.getItem('token');
|
||||||
|
const tableRef = useRef(null);
|
||||||
|
const [downloadState, setDownloadState] = useState({
|
||||||
|
loading: false,
|
||||||
|
progress: 0
|
||||||
|
});
|
||||||
|
|
||||||
|
const {
|
||||||
|
searchParams,
|
||||||
|
loading: dataLoading,
|
||||||
|
data: dataList,
|
||||||
|
handleSearch,
|
||||||
|
handleReset,
|
||||||
|
handlePageChange,
|
||||||
|
handleOrderByChange,
|
||||||
|
handlePageSizeChange,
|
||||||
|
updateSearchParams
|
||||||
|
} = useUserLoginLogSearch(token, 500);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if(active) {
|
||||||
|
// 세션 스토리지에서 복사된 메일 데이터 가져오기
|
||||||
|
const paramsData = sessionStorage.getItem(STORAGE_GAME_LOG_USER_LOGIN_SEARCH);
|
||||||
|
|
||||||
|
if (paramsData) {
|
||||||
|
const searchData = JSON.parse(paramsData);
|
||||||
|
|
||||||
|
handleSearch({
|
||||||
|
start_dt: new Date(searchData.start_dt),
|
||||||
|
end_dt: new Date(searchData.end_dt),
|
||||||
|
search_data: searchData.guid
|
||||||
|
});
|
||||||
|
|
||||||
|
// 사용 후 세션 스토리지 데이터 삭제
|
||||||
|
sessionStorage.removeItem(STORAGE_GAME_LOG_USER_LOGIN_SEARCH);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [active]);
|
||||||
|
|
||||||
|
const tableHeaders = useMemo(() => {
|
||||||
|
return [
|
||||||
|
{ id: 'logDay', label: '일자', width: '100px' },
|
||||||
|
{ id: 'accountId', label: 'account ID', width: '80px' },
|
||||||
|
{ id: 'userGuid', label: 'GUID', width: '180px' },
|
||||||
|
{ id: 'userNickname', label: '아바타명', width: '150px' },
|
||||||
|
{ id: 'tranId', label: '트랜잭션 ID', width: '200px' },
|
||||||
|
{ id: 'loginTime', label: '로그인시간', width: '150px' },
|
||||||
|
{ id: 'logoutTime', label: '로그아웃시간', width: '120px' },
|
||||||
|
{ id: 'serverType', label: '서버종류', width: '80px' },
|
||||||
|
{ id: 'languageType', label: '언어', width: '80px' },
|
||||||
|
{ id: 'playtime', label: '플레이시간(분)', width: '80px' },
|
||||||
|
];
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
if(!active) return null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AnimatedPageWrapper>
|
||||||
|
<FormWrapper>
|
||||||
|
<UserLoginLogSearchBar
|
||||||
|
searchParams={searchParams}
|
||||||
|
onSearch={(newParams, executeSearch = true) => {
|
||||||
|
if (executeSearch) {
|
||||||
|
handleSearch(newParams);
|
||||||
|
} else {
|
||||||
|
updateSearchParams(newParams);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onReset={handleReset}
|
||||||
|
/>
|
||||||
|
</FormWrapper>
|
||||||
|
<ViewTableInfo orderType="asc" pageType="B" total={dataList?.total} total_all={dataList?.total_all}>
|
||||||
|
<ExcelExportButton
|
||||||
|
functionName="GameUserLoginLogExport"
|
||||||
|
params={searchParams}
|
||||||
|
fileName={t('FILE_GAME_LOG_USER_LOGIN')}
|
||||||
|
onLoadingChange={setDownloadState}
|
||||||
|
dataSize={dataList?.total_all}
|
||||||
|
/>
|
||||||
|
{downloadState.loading && (
|
||||||
|
<CircularProgressWrapper>
|
||||||
|
<CircularProgress
|
||||||
|
progress={downloadState.progress}
|
||||||
|
size={36}
|
||||||
|
progressColor="#4A90E2"
|
||||||
|
/>
|
||||||
|
</CircularProgressWrapper>
|
||||||
|
)}
|
||||||
|
</ViewTableInfo>
|
||||||
|
{dataLoading ? <TableSkeleton width='100%' count={15} /> :
|
||||||
|
<>
|
||||||
|
<TableWrapper>
|
||||||
|
<TableStyle ref={tableRef}>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
{tableHeaders.map(header => (
|
||||||
|
<th key={header.id} width={header.width}>{header.label}</th>
|
||||||
|
))}
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{dataList?.user_login_list?.map((item, index) => (
|
||||||
|
<Fragment key={index}>
|
||||||
|
<tr>
|
||||||
|
<td>{item.logDay}</td>
|
||||||
|
<td>{item.accountId}</td>
|
||||||
|
<td>{item.userGuid}</td>
|
||||||
|
<td>{item.userNickname}</td>
|
||||||
|
<td>{item.tranId}</td>
|
||||||
|
<td>{item.loginTime}</td>
|
||||||
|
<td>{item.logoutTime}</td>
|
||||||
|
<td>{item.serverType}</td>
|
||||||
|
<td>{item.languageType}</td>
|
||||||
|
<td>{numberFormatter.formatSecondToMinuts(item.playtime)}</td>
|
||||||
|
</tr>
|
||||||
|
</Fragment>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</TableStyle>
|
||||||
|
</TableWrapper>
|
||||||
|
{dataList?.user_login_list &&
|
||||||
|
<Pagination
|
||||||
|
postsPerPage={searchParams.page_size}
|
||||||
|
totalPosts={dataList?.total_all}
|
||||||
|
setCurrentPage={handlePageChange}
|
||||||
|
currentPage={searchParams.page_no}
|
||||||
|
pageLimit={INITIAL_PAGE_LIMIT}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
<TopButton />
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</AnimatedPageWrapper>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default UserLoginLogContent;
|
||||||
@@ -1,12 +1,10 @@
|
|||||||
import { useState, Fragment, useEffect } from 'react';
|
import { useState, Fragment, useEffect, memo } from 'react';
|
||||||
|
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
import MailDetailModal from '../../components/DataManage/MailDetailModal';
|
import MailDetailModal from '../../components/DataManage/MailDetailModal';
|
||||||
import { SelectInput, TextInput } from '../../styles/Components';
|
import { SelectInput, TextInput } from '../../styles/Components';
|
||||||
import { UserMailDelete, UserMailItemDelete, UserMailView } from '../../apis';
|
import { UserMailDelete, UserMailItemDelete, UserMailView } from '../../apis';
|
||||||
import ConfirmModal from '../common/modal/ConfirmModal';
|
|
||||||
import CompletedModal from '../common/modal/CompletedModal';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import CustomConfirmModal from '../common/modal/CustomConfirmModal';
|
import CustomConfirmModal from '../common/modal/CustomConfirmModal';
|
||||||
import { authType, ivenTabType, opMailType } from '../../assets/data';
|
import { authType, ivenTabType, opMailType } from '../../assets/data';
|
||||||
@@ -17,17 +15,55 @@ import { TableSkeleton } from '../Skeleton/TableSkeleton';
|
|||||||
import { opPickupType, opReadType, opYNType } from '../../assets/data/options';
|
import { opPickupType, opReadType, opYNType } from '../../assets/data/options';
|
||||||
import { useDynamoDBPagination, useModal } from '../../hooks/hook';
|
import { useDynamoDBPagination, useModal } from '../../hooks/hook';
|
||||||
import { DynamoPagination } from '../common';
|
import { DynamoPagination } from '../common';
|
||||||
|
import { useLoading } from '../../context/LoadingProvider';
|
||||||
|
import { useAlert } from '../../context/AlertProvider';
|
||||||
|
import { alertTypes } from '../../assets/data/types';
|
||||||
|
|
||||||
|
const ConfirmChild = memo(({ maxCount }) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [localCount, setLocalCount] = useState('1');
|
||||||
|
const {showToast} = useAlert();
|
||||||
|
|
||||||
|
const handleChange = (e) => {
|
||||||
|
let value = e.target.value;
|
||||||
|
|
||||||
|
if (value === '0' || value === '-0') {
|
||||||
|
value = '1';
|
||||||
|
} else if (value < 0) {
|
||||||
|
value = Math.abs(value).toString();
|
||||||
|
} else if(Number(value) > maxCount) {
|
||||||
|
showToast('DEL_COUNT_CHECK', {type: alertTypes.warning});
|
||||||
|
value = maxCount.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
setLocalCount(value);
|
||||||
|
};
|
||||||
|
|
||||||
|
return(
|
||||||
|
<InputItem>
|
||||||
|
<p>{t('DEL_COUNT_CONFIRM', {count: maxCount})}</p>
|
||||||
|
<TextInput
|
||||||
|
id="user-mail-item-count-input"
|
||||||
|
placeholder="수량"
|
||||||
|
type="number"
|
||||||
|
value={localCount}
|
||||||
|
onChange={handleChange}
|
||||||
|
width="200px"
|
||||||
|
/>
|
||||||
|
</InputItem>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
const UserMailInfo = ({ userInfo }) => {
|
const UserMailInfo = ({ userInfo }) => {
|
||||||
const token = sessionStorage.getItem('token');
|
const token = sessionStorage.getItem('token');
|
||||||
const { t } = useTranslation();
|
|
||||||
const authInfo = useRecoilValue(authList);
|
const authInfo = useRecoilValue(authList);
|
||||||
|
const {withLoading} = useLoading();
|
||||||
|
const {showModal, showToast} = useAlert();
|
||||||
|
|
||||||
// 받은 우편, 보낸 우편
|
// 받은 우편, 보낸 우편
|
||||||
const [option, setOption] = useState('RECEIVE');
|
const [option, setOption] = useState('RECEIVE');
|
||||||
const [detail, setDetail] = useState({ title: '', content: '', item_list: [], mail_guid: '' });
|
const [detail, setDetail] = useState({ title: '', content: '', item_list: [], mail_guid: '' });
|
||||||
const [deleteSelected, setDeleteSelected] = useState({});
|
const [deleteSelected, setDeleteSelected] = useState({});
|
||||||
const [itemUpdateCount, setItemUpdateCount] = useState('1');
|
|
||||||
const [authDelete, setAuthDelete] = useState(false);
|
const [authDelete, setAuthDelete] = useState(false);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@@ -36,10 +72,7 @@ const UserMailInfo = ({ userInfo }) => {
|
|||||||
handleModalClose
|
handleModalClose
|
||||||
} = useModal({
|
} = useModal({
|
||||||
detail: 'hidden',
|
detail: 'hidden',
|
||||||
deleteItem: 'hidden',
|
deleteItem: 'hidden'
|
||||||
deleteSubmit: 'hidden',
|
|
||||||
deleteComplete: 'hidden',
|
|
||||||
deleteItemComplete: 'hidden'
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const fetchMailData = async (page, startKey) => {
|
const fetchMailData = async (page, startKey) => {
|
||||||
@@ -74,32 +107,14 @@ const UserMailInfo = ({ userInfo }) => {
|
|||||||
setDetail({ title: title, content: content, item_list: itmeList, mail_guid: mail_guid });
|
setDetail({ title: title, content: content, item_list: itmeList, mail_guid: mail_guid });
|
||||||
};
|
};
|
||||||
|
|
||||||
// 우편 아이템 삭제 개수 처리
|
|
||||||
const handleItemCount = e => {
|
|
||||||
if (e.target.value === '0' || e.target.value === '-0') {
|
|
||||||
setItemUpdateCount('1');
|
|
||||||
e.target.value = '1';
|
|
||||||
} else if (e.target.value < 0) {
|
|
||||||
let plusNum = Math.abs(e.target.value);
|
|
||||||
setItemUpdateCount(plusNum);
|
|
||||||
} else if(e.target.value > deleteSelected.count){
|
|
||||||
alert(t('DEL_COUNT_CHECK'));
|
|
||||||
setItemUpdateCount(deleteSelected.count);
|
|
||||||
} else {
|
|
||||||
setItemUpdateCount(e.target.value);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleModalSubmit = async (type, param = null) => {
|
const handleModalSubmit = async (type, param = null) => {
|
||||||
let params;
|
let params;
|
||||||
let result;
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "detail":
|
case "detail":
|
||||||
handleModalView('deleteSubmit');
|
showModal('USER_MAIL_DEL_CONFIRM', {
|
||||||
break;
|
type: alertTypes.confirm,
|
||||||
case "deleteItem":
|
onConfirm: () => handleModalSubmit('deleteSubmit')
|
||||||
setDeleteSelected(param);
|
});
|
||||||
handleModalView('deleteItem');
|
|
||||||
break;
|
break;
|
||||||
case "deleteSubmit":
|
case "deleteSubmit":
|
||||||
params = {}
|
params = {}
|
||||||
@@ -107,58 +122,64 @@ const UserMailInfo = ({ userInfo }) => {
|
|||||||
params.guid = userInfo.guid;
|
params.guid = userInfo.guid;
|
||||||
params.mail_guid = detail.mail_guid;
|
params.mail_guid = detail.mail_guid;
|
||||||
|
|
||||||
result = await UserMailDelete(token, params);
|
await withLoading(async () => {
|
||||||
|
return await UserMailDelete(token, params);
|
||||||
|
}).then(data => {
|
||||||
|
if(data.result === "SUCCESS") {
|
||||||
|
showToast('DEL_COMPLETE', {type: alertTypes.success});
|
||||||
|
}else{
|
||||||
|
showToast(data.data.message, {type: alertTypes.error});
|
||||||
|
}
|
||||||
|
}).catch(e => {
|
||||||
|
showToast(e, {type: alertTypes.error});
|
||||||
|
});
|
||||||
|
|
||||||
handleModalClose('deleteSubmit');
|
break;
|
||||||
handleModalView('deleteComplete');
|
case "deleteItem":
|
||||||
|
setDeleteSelected(param);
|
||||||
|
handleModalView('deleteItem');
|
||||||
break;
|
break;
|
||||||
case "deleteItemSubmit":
|
case "deleteItemSubmit":
|
||||||
|
//랜더링 문제로 dom에서 값을 찾아 가져온다.
|
||||||
|
const inputElement = document.getElementById("user-mail-item-count-input");
|
||||||
|
|
||||||
|
if(inputElement === null) showToast('INPUT_VALUE_ERROR',{type: alertTypes.error});
|
||||||
|
const count = inputElement.value;
|
||||||
|
|
||||||
params = {}
|
params = {}
|
||||||
params.type = option;
|
params.type = option;
|
||||||
params.guid = userInfo.guid;
|
params.guid = userInfo.guid;
|
||||||
params.mail_guid = detail.mail_guid;
|
params.mail_guid = detail.mail_guid;
|
||||||
params.item_id = deleteSelected.item_id;
|
params.item_id = deleteSelected.item_id;
|
||||||
params.parrent_count = deleteSelected.count;
|
params.parrent_count = deleteSelected.count;
|
||||||
params.count = itemUpdateCount;
|
params.count = count;
|
||||||
|
|
||||||
result = await UserMailItemDelete(token, params);
|
await withLoading(async () => {
|
||||||
if(result.result === "SUCCESS"){
|
return await UserMailItemDelete(token, params);
|
||||||
if(deleteSelected.count <= itemUpdateCount){
|
}).then(data => {
|
||||||
const item_idx = detail.item_list.findIndex(item => item.item_id === deleteSelected.item_id);
|
if(data.result === "SUCCESS") {
|
||||||
if(item_idx >= 0) {
|
if(deleteSelected.count <= count){
|
||||||
detail.item_list.splice(item_idx, 1);
|
const item_idx = detail.item_list.findIndex(item => item.item_id === params.item_id);
|
||||||
|
if(item_idx >= 0) {
|
||||||
|
detail.item_list.splice(item_idx, 1);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
deleteSelected.count = deleteSelected.count - count;
|
||||||
}
|
}
|
||||||
|
showToast('DEL_ITEM_COMPLETE', {type: alertTypes.success});
|
||||||
}else{
|
}else{
|
||||||
deleteSelected.count = deleteSelected.count - itemUpdateCount;
|
showToast(data.data.message, {type: alertTypes.error});
|
||||||
}
|
}
|
||||||
}
|
}).catch(e => {
|
||||||
handleModalClose('deleteItem');
|
showToast(e, {type: alertTypes.error});
|
||||||
handleModalView('deleteItemComplete');
|
}).finally(() => {
|
||||||
break;
|
handleModalClose('deleteItem');
|
||||||
case "deleteComplete":
|
fetchPage(pagination.currentPage);
|
||||||
handleModalClose('deleteComplete');
|
});
|
||||||
handleModalClose('detail');
|
|
||||||
// const idx = dataList.mail_list.findIndex(mail => mail.mail_guid === detail.mail_guid);
|
|
||||||
// if(idx >= 0) {
|
|
||||||
// dataList.mail_list.splice(idx, 1);
|
|
||||||
// }
|
|
||||||
fetchPage(pagination.currentPage);
|
|
||||||
break;
|
|
||||||
case "deleteItemComplete":
|
|
||||||
handleModalClose('deleteItemComplete');
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const ConfirmChild = () => {
|
|
||||||
return(
|
|
||||||
<InputItem>
|
|
||||||
<p>{t('DEL_COUNT_CONFIRM', {count: deleteSelected.count})}</p>
|
|
||||||
<TextInput placeholder="수량" type="number" value={itemUpdateCount} onChange={e => handleItemCount(e)} width="200px" />
|
|
||||||
</InputItem>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
loading ? <TableSkeleton count={10}/> :
|
loading ? <TableSkeleton count={10}/> :
|
||||||
<>
|
<>
|
||||||
@@ -195,7 +216,6 @@ const UserMailInfo = ({ userInfo }) => {
|
|||||||
<th width="100">첨부 아이템</th>
|
<th width="100">첨부 아이템</th>
|
||||||
<th width="80">수령</th>
|
<th width="80">수령</th>
|
||||||
<th width="80">시스템 우편</th>
|
<th width="80">시스템 우편</th>
|
||||||
{/* <th width="170">수령 일자</th> */}
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -218,9 +238,6 @@ const UserMailInfo = ({ userInfo }) => {
|
|||||||
<td>{opYNType.find(type => type.value === (mail.item_list.length > 0)).name}</td>
|
<td>{opYNType.find(type => type.value === (mail.item_list.length > 0)).name}</td>
|
||||||
<td>{opPickupType.find(type => type.value === mail.is_get_item).name}</td>
|
<td>{opPickupType.find(type => type.value === mail.is_get_item).name}</td>
|
||||||
<td>{opYNType.find(type => type.value === mail.is_system_mail).name}</td>
|
<td>{opYNType.find(type => type.value === mail.is_system_mail).name}</td>
|
||||||
{/* <td>
|
|
||||||
{mail.is_get_item_dt && String(new Date(new Date(mail.is_get_item_dt).setHours(new Date(mail.is_get_item_dt).getHours() + 9)).toLocaleString())}
|
|
||||||
</td> */}
|
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
@@ -268,7 +285,6 @@ const UserMailInfo = ({ userInfo }) => {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
||||||
{/*상세*/}
|
{/*상세*/}
|
||||||
<MailDetailModal
|
<MailDetailModal
|
||||||
mailModal={modalState.detailModal}
|
mailModal={modalState.detailModal}
|
||||||
@@ -279,32 +295,19 @@ const UserMailInfo = ({ userInfo }) => {
|
|||||||
handleItemDelete={(param) => handleModalSubmit('deleteItem', param)}
|
handleItemDelete={(param) => handleModalSubmit('deleteItem', param)}
|
||||||
authDelete={authDelete}
|
authDelete={authDelete}
|
||||||
/>
|
/>
|
||||||
{/*메일 삭제 모달*/}
|
|
||||||
<ConfirmModal
|
|
||||||
modalText={t('USER_MAIL_DEL_CONFIRM')}
|
|
||||||
view={modalState.deleteSubmitModal}
|
|
||||||
handleSubmit={() => handleModalSubmit('deleteSubmit')}
|
|
||||||
handleCancel={() => handleModalClose('deleteSubmit')}
|
|
||||||
handleClose={() => handleModalClose('deleteSubmit')}
|
|
||||||
/>
|
|
||||||
<CompletedModal
|
|
||||||
view={modalState.deleteCompleteModal}
|
|
||||||
modalText={t('DEL_COMPLETE')}
|
|
||||||
handleComplete={() => handleModalSubmit('deleteComplete')}
|
|
||||||
/>
|
|
||||||
{/*메일 아이템 삭제 모달*/}
|
{/*메일 아이템 삭제 모달*/}
|
||||||
<CustomConfirmModal
|
<CustomConfirmModal
|
||||||
ChildView={ConfirmChild}
|
ChildView={() => (
|
||||||
|
<ConfirmChild
|
||||||
|
maxCount={deleteSelected.count}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
view={modalState.deleteItemModal}
|
view={modalState.deleteItemModal}
|
||||||
handleSubmit={() => handleModalSubmit('deleteItemSubmit')}
|
handleSubmit={() => handleModalSubmit('deleteItemSubmit')}
|
||||||
handleCancel={() => handleModalClose('deleteItem')}
|
handleCancel={() => handleModalClose('deleteItem')}
|
||||||
handleClose={() => handleModalClose('deleteItem')}
|
handleClose={() => handleModalClose('deleteItem')}
|
||||||
/>
|
/>
|
||||||
<CompletedModal
|
|
||||||
view={modalState.deleteItemCompleteModal}
|
|
||||||
modalText={t('DEL_ITEM_COMPLETE')}
|
|
||||||
handleComplete={() => handleModalSubmit('deleteItemComplete')}
|
|
||||||
/>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -393,31 +396,4 @@ const SelectContainer = styled.div`
|
|||||||
select {
|
select {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
}
|
}
|
||||||
`;
|
|
||||||
|
|
||||||
const PaginationButtons = styled.div`
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 10px;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const PaginationButton = styled.button`
|
|
||||||
background-color: ${props => props.disabled ? '#e0e0e0' : '#6c7eb7'};
|
|
||||||
color: ${props => props.disabled ? '#a0a0a0' : 'white'};
|
|
||||||
border: none;
|
|
||||||
padding: 6px 12px;
|
|
||||||
border-radius: 4px;
|
|
||||||
font-size: 12px;
|
|
||||||
cursor: ${props => props.disabled ? 'not-allowed' : 'pointer'};
|
|
||||||
transition: background-color 0.2s;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: ${props => props.disabled ? '#e0e0e0' : '#5a6a9b'};
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const PageInfo = styled.div`
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #666;
|
|
||||||
`;
|
`;
|
||||||
@@ -1,18 +1,16 @@
|
|||||||
import styled from 'styled-components';
|
|
||||||
import Button from '../common/button/Button';
|
|
||||||
import { InfoSubTitle, UserDefaultTable, UserInfoTable, UserTableWrapper } from '../../styles/ModuleComponents';
|
import { InfoSubTitle, UserDefaultTable, UserInfoTable, UserTableWrapper } from '../../styles/ModuleComponents';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useRecoilValue } from 'recoil';
|
|
||||||
import { authList } from '../../store/authList';
|
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { TableSkeleton } from '../Skeleton/TableSkeleton';
|
import { TableSkeleton } from '../Skeleton/TableSkeleton';
|
||||||
import { UserInventoryView, UserMyhomeView } from '../../apis';
|
import { UserMyhomeView } from '../../apis';
|
||||||
|
import { SelectInput } from '../../styles/Components';
|
||||||
|
|
||||||
const UserMyHomeInfo = ({ userInfo }) => {
|
const UserMyHomeInfo = ({ userInfo }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const [dataList, setDataList] = useState();
|
const [dataList, setDataList] = useState();
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
|
const [selectedHome, setSelectedHome] = useState('');
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if(userInfo && Object.keys(userInfo).length > 0) {
|
if(userInfo && Object.keys(userInfo).length > 0) {
|
||||||
@@ -23,11 +21,18 @@ const UserMyHomeInfo = ({ userInfo }) => {
|
|||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
const token = sessionStorage.getItem('token');
|
const token = sessionStorage.getItem('token');
|
||||||
await UserMyhomeView(token, userInfo.guid).then(data => {
|
await UserMyhomeView(token, userInfo.guid).then(data => {
|
||||||
setDataList(data.myhome_info);
|
setDataList(data);
|
||||||
|
if (data.myhome_info && data.myhome_info.length > 0) {
|
||||||
|
setSelectedHome(data.myhome_info[0].myhome_guid);
|
||||||
|
}
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleHomeChange = (e) => {
|
||||||
|
setSelectedHome(e.target.value);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
loading ? <TableSkeleton count={15}/> :
|
loading ? <TableSkeleton count={15}/> :
|
||||||
dataList &&
|
dataList &&
|
||||||
@@ -36,7 +41,13 @@ const UserMyHomeInfo = ({ userInfo }) => {
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th>마이 홈명</th>
|
<th>마이 홈명</th>
|
||||||
<td>{dataList.myhome_name}</td>
|
<SelectInput onChange={handleHomeChange} value={selectedHome}>
|
||||||
|
{dataList.myhome_info && dataList.myhome_info.map((data, index) => (
|
||||||
|
<option key={index} value={data.myhome_guid}>
|
||||||
|
{data.myhome_name}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</SelectInput>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</UserInfoTable>
|
</UserInfoTable>
|
||||||
@@ -51,15 +62,19 @@ const UserMyHomeInfo = ({ userInfo }) => {
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{dataList.prop_list && dataList.prop_list.map((el, idx) => {
|
{dataList.myhome_info.find(home => home.myhome_guid === selectedHome)?.prop_list?.map((el, idx) => (
|
||||||
return (
|
<tr key={idx}>
|
||||||
<tr key={idx}>
|
<td>{idx + 1}</td>
|
||||||
<td>{idx + 1}</td>
|
<td>{el.item_id}</td>
|
||||||
<td>{el.item_id}</td>
|
<td>{el.item_name}</td>
|
||||||
<td>{el.item_name}</td>
|
</tr>
|
||||||
</tr>
|
))}
|
||||||
);
|
{(!dataList.myhome_info.find(home => home.myhome_guid === selectedHome)?.prop_list ||
|
||||||
})}
|
dataList.myhome_info.find(home => home.myhome_guid === selectedHome)?.prop_list.length === 0) && (
|
||||||
|
<tr>
|
||||||
|
<td colSpan="3" style={{textAlign: 'center'}}>{t('TABLE_DATA_NOT_FOUND')}</td>
|
||||||
|
</tr>
|
||||||
|
)}
|
||||||
</tbody>
|
</tbody>
|
||||||
</UserDefaultTable>
|
</UserDefaultTable>
|
||||||
</UserTableWrapper>
|
</UserTableWrapper>
|
||||||
|
|||||||
@@ -3,15 +3,22 @@ import { useState, useEffect, Fragment } from 'react';
|
|||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import Button from '../../components/common/button/Button';
|
import Button from '../../components/common/button/Button';
|
||||||
import QuestDetailModal from '../../components/DataManage/QuestDetailModal';
|
import QuestDetailModal from '../../components/DataManage/QuestDetailModal';
|
||||||
import { UserQuestView } from '../../apis/Users';
|
import { UserQuestTaskComplete, UserQuestView } from '../../apis/Users';
|
||||||
import { convertKTC } from '../../utils';
|
import { convertKTC } from '../../utils';
|
||||||
import { TableSkeleton } from '../Skeleton/TableSkeleton';
|
import { TableSkeleton } from '../Skeleton/TableSkeleton';
|
||||||
|
import { useAlert } from '../../context/AlertProvider';
|
||||||
|
import { CaliumCharge } from '../../apis';
|
||||||
|
import { alertTypes } from '../../assets/data/types';
|
||||||
|
import { useLoading } from '../../context/LoadingProvider';
|
||||||
|
import { questCompleteStatusType } from '../../assets/data/options';
|
||||||
|
|
||||||
const UserQuestInfo = ({ userInfo }) => {
|
const UserQuestInfo = ({ userInfo }) => {
|
||||||
const [detailPop, setDetailPop] = useState('hidden');
|
const [detailPop, setDetailPop] = useState('hidden');
|
||||||
const [dataList, setDataList] = useState({});
|
const [dataList, setDataList] = useState({});
|
||||||
const [detailQuest, setDetailQuest] = useState({});
|
const [detailQuest, setDetailQuest] = useState({});
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
|
const { showModal, showToast } = useAlert();
|
||||||
|
const { withLoading } = useLoading();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if(userInfo && Object.keys(userInfo).length > 0) {
|
if(userInfo && Object.keys(userInfo).length > 0) {
|
||||||
@@ -30,10 +37,30 @@ const UserQuestInfo = ({ userInfo }) => {
|
|||||||
const handleClick = data => {
|
const handleClick = data => {
|
||||||
if (detailPop === 'hidden') {
|
if (detailPop === 'hidden') {
|
||||||
setDetailPop('view');
|
setDetailPop('view');
|
||||||
setDetailQuest(data.detailQuest);
|
setDetailQuest(data);
|
||||||
} else setDetailPop('hidden');
|
} else setDetailPop('hidden');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleQuestComplete = async data => {
|
||||||
|
const token = sessionStorage.getItem('token');
|
||||||
|
await withLoading(async () => {
|
||||||
|
const params = {...data, guid: userInfo.guid};
|
||||||
|
return await UserQuestTaskComplete(token, params);
|
||||||
|
}).then(data => {
|
||||||
|
if (data.result === "SUCCESS") {
|
||||||
|
showToast('QUEST_TASK_COMPLETE', { type: alertTypes.success });
|
||||||
|
} else {
|
||||||
|
showToast(data.data.message, { type: alertTypes.error });
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
showToast('API_FAIL', { type: alertTypes.error });
|
||||||
|
}).finally(() => {
|
||||||
|
handleClick();
|
||||||
|
fetchData();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
loading ? <TableSkeleton /> :
|
loading ? <TableSkeleton /> :
|
||||||
<>
|
<>
|
||||||
@@ -59,7 +86,7 @@ const UserQuestInfo = ({ userInfo }) => {
|
|||||||
<td>{el.quest_id}</td>
|
<td>{el.quest_id}</td>
|
||||||
<td>{el.quest_name}</td>
|
<td>{el.quest_name}</td>
|
||||||
<td>{el.quest_type}</td>
|
<td>{el.quest_type}</td>
|
||||||
<td>{el.status}</td>
|
<td>{questCompleteStatusType.find(data => el.status === data.value).name || el.status}</td>
|
||||||
<td>{convertKTC(el.quest_assign_time, false)}</td>
|
<td>{convertKTC(el.quest_assign_time, false)}</td>
|
||||||
<td>{convertKTC(el.quest_complete_time, false)}</td>
|
<td>{convertKTC(el.quest_complete_time, false)}</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -72,7 +99,7 @@ const UserQuestInfo = ({ userInfo }) => {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</QuestTable>
|
</QuestTable>
|
||||||
</UserTableWrapper>
|
</UserTableWrapper>
|
||||||
<QuestDetailModal detailPop={detailPop} handleClick={handleClick} detailQuest={detailQuest} />
|
<QuestDetailModal detailPop={detailPop} handleClick={handleClick} detailQuest={detailQuest} handleQuestComplete={handleQuestComplete} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,57 +0,0 @@
|
|||||||
import { styled } from 'styled-components';
|
|
||||||
import Button from '../../components/common/button/Button';
|
|
||||||
|
|
||||||
import { FormWrapper, InputLabel, TextInput, SelectInput, BtnWrapper } from '../../styles/Components';
|
|
||||||
|
|
||||||
const UserSearchBar = () => {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<FormWrapper>
|
|
||||||
<SearchbarStyle>
|
|
||||||
<SearchItem>
|
|
||||||
<InputLabel>유저 조회</InputLabel>
|
|
||||||
<TextInput type="text" width="300px" placeholder="조회 대상 유저의 GUID를 입력하세요." />
|
|
||||||
</SearchItem>
|
|
||||||
<BtnWrapper $gap="8px">
|
|
||||||
<Button theme="reset" />
|
|
||||||
<Button
|
|
||||||
theme="primary"
|
|
||||||
text="검색"
|
|
||||||
handleClick={e => {
|
|
||||||
e.preventDefault();
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</BtnWrapper>
|
|
||||||
</SearchbarStyle>
|
|
||||||
</FormWrapper>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default UserSearchBar;
|
|
||||||
|
|
||||||
const SearchbarStyle = styled.div`
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 20px 0;
|
|
||||||
font-size: 14px;
|
|
||||||
padding: 20px;
|
|
||||||
border-top: 1px solid #000;
|
|
||||||
border-bottom: 1px solid #000;
|
|
||||||
margin-bottom: 40px;
|
|
||||||
`;
|
|
||||||
const SearchItem = styled.div`
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 20px;
|
|
||||||
margin-right: 50px;
|
|
||||||
|
|
||||||
${TextInput}, ${SelectInput} {
|
|
||||||
height: 35px;
|
|
||||||
}
|
|
||||||
${TextInput} {
|
|
||||||
padding: 0 10px;
|
|
||||||
max-width: 400px;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
153
src/components/DataManage/UserSnapshotLogContent.js
Normal file
153
src/components/DataManage/UserSnapshotLogContent.js
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
import React, { Fragment, useMemo, useRef, useState } from 'react';
|
||||||
|
|
||||||
|
import {
|
||||||
|
CircularProgressWrapper,
|
||||||
|
FormWrapper,
|
||||||
|
TableStyle,
|
||||||
|
TableWrapper,
|
||||||
|
} from '../../styles/Components';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { TableSkeleton } from '../Skeleton/TableSkeleton';
|
||||||
|
import { UserSnapshotLogSearchBar, useUserSnapshotLogSearch } from '../searchBar';
|
||||||
|
import { TopButton, ViewTableInfo } from '../common';
|
||||||
|
import Pagination from '../common/Pagination/Pagination';
|
||||||
|
import {
|
||||||
|
INITIAL_PAGE_LIMIT,
|
||||||
|
} from '../../assets/data/adminConstants';
|
||||||
|
import ExcelExportButton from '../common/button/ExcelExportButton';
|
||||||
|
import CircularProgress from '../common/CircularProgress';
|
||||||
|
import { AnimatedPageWrapper } from '../common/Layout';
|
||||||
|
import { numberFormatter } from '../../utils';
|
||||||
|
|
||||||
|
const UserSnapshotLogContent = ({ active }) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const token = sessionStorage.getItem('token');
|
||||||
|
const tableRef = useRef(null);
|
||||||
|
const [downloadState, setDownloadState] = useState({
|
||||||
|
loading: false,
|
||||||
|
progress: 0
|
||||||
|
});
|
||||||
|
|
||||||
|
const {
|
||||||
|
searchParams,
|
||||||
|
loading: dataLoading,
|
||||||
|
data: dataList,
|
||||||
|
handleSearch,
|
||||||
|
handleReset,
|
||||||
|
handlePageChange,
|
||||||
|
updateSearchParams
|
||||||
|
} = useUserSnapshotLogSearch(token, 500);
|
||||||
|
|
||||||
|
const tableHeaders = useMemo(() => {
|
||||||
|
return [
|
||||||
|
{ id: 'logDay', label: '일자', width: '80px' },
|
||||||
|
{ id: 'accountId', label: 'account ID', width: '80px' },
|
||||||
|
{ id: 'userGuid', label: 'GUID', width: '180px' },
|
||||||
|
{ id: 'userNickname', label: '아바타명', width: '150px' },
|
||||||
|
{ id: 'gold', label: '골드', width: '80px' },
|
||||||
|
{ id: 'sapphire', label: '사파이어', width: '80px' },
|
||||||
|
{ id: 'calium', label: '칼리움', width: '80px' },
|
||||||
|
{ id: 'ruby', label: '루비', width: '80px' },
|
||||||
|
{ id: 'item_13080002', label: '퀘스트 메달', width: '80px' },
|
||||||
|
{ id: 'item_13080004', label: '보급품 메달', width: '80px' },
|
||||||
|
{ id: 'item_13080005', label: '제작 메달', width: '80px' },
|
||||||
|
{ id: 'item_13080006', label: '에테론 315 포드', width: '80px' },
|
||||||
|
{ id: 'item_13080007', label: '에테론 316 포드', width: '80px' },
|
||||||
|
{ id: 'item_13080008', label: '에테론 317 포드', width: '80px' },
|
||||||
|
{ id: 'item_13080009', label: '에테론 318 포드', width: '80px' },
|
||||||
|
{ id: 'item_11570001', label: '강화잉크', width: '80px' },
|
||||||
|
{ id: 'item_11570002', label: '연성잉크', width: '80px' },
|
||||||
|
{ id: 'lastLogoutTime', label: '마지막 로그아웃 일자', width: '150px' },
|
||||||
|
];
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
if(!active) return null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AnimatedPageWrapper>
|
||||||
|
<FormWrapper>
|
||||||
|
<UserSnapshotLogSearchBar
|
||||||
|
searchParams={searchParams}
|
||||||
|
onSearch={(newParams, executeSearch = true) => {
|
||||||
|
if (executeSearch) {
|
||||||
|
handleSearch(newParams);
|
||||||
|
} else {
|
||||||
|
updateSearchParams(newParams);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onReset={handleReset}
|
||||||
|
/>
|
||||||
|
</FormWrapper>
|
||||||
|
<ViewTableInfo orderType="asc" pageType="B" total={dataList?.total} total_all={dataList?.total_all}>
|
||||||
|
<ExcelExportButton
|
||||||
|
functionName="GameUserSnapshotLogExport"
|
||||||
|
params={searchParams}
|
||||||
|
fileName={t('FILE_GAME_LOG_USER_SNAPSHOT')}
|
||||||
|
onLoadingChange={setDownloadState}
|
||||||
|
dataSize={dataList?.total_all}
|
||||||
|
/>
|
||||||
|
{downloadState.loading && (
|
||||||
|
<CircularProgressWrapper>
|
||||||
|
<CircularProgress
|
||||||
|
progress={downloadState.progress}
|
||||||
|
size={36}
|
||||||
|
progressColor="#4A90E2"
|
||||||
|
/>
|
||||||
|
</CircularProgressWrapper>
|
||||||
|
)}
|
||||||
|
</ViewTableInfo>
|
||||||
|
{dataLoading ? <TableSkeleton width='100%' count={15} /> :
|
||||||
|
<>
|
||||||
|
<TableWrapper>
|
||||||
|
<TableStyle ref={tableRef}>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
{tableHeaders.map(header => (
|
||||||
|
<th key={header.id} width={header.width}>{header.label}</th>
|
||||||
|
))}
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{dataList?.snapshot_list?.map((item, index) => (
|
||||||
|
<Fragment key={index}>
|
||||||
|
<tr>
|
||||||
|
<td>{item.logDay}</td>
|
||||||
|
<td>{item.accountId}</td>
|
||||||
|
<td>{item.userGuid}</td>
|
||||||
|
<td>{item.userNickname}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.gold)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.sapphire)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.calium)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.ruby)}</td>
|
||||||
|
<td>{item.item_13080002}</td>
|
||||||
|
<td>{item.item_13080004}</td>
|
||||||
|
<td>{item.item_13080005}</td>
|
||||||
|
<td>{item.item_13080006}</td>
|
||||||
|
<td>{item.item_13080007}</td>
|
||||||
|
<td>{item.item_13080008}</td>
|
||||||
|
<td>{item.item_13080009}</td>
|
||||||
|
<td>{item.item_11570001}</td>
|
||||||
|
<td>{item.item_11570002}</td>
|
||||||
|
<td>{item.lastLogoutTime}</td>
|
||||||
|
</tr>
|
||||||
|
</Fragment>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</TableStyle>
|
||||||
|
</TableWrapper>
|
||||||
|
{dataList?.snapshot_list &&
|
||||||
|
<Pagination
|
||||||
|
postsPerPage={searchParams.page_size}
|
||||||
|
totalPosts={dataList?.total_all}
|
||||||
|
setCurrentPage={handlePageChange}
|
||||||
|
currentPage={searchParams.page_no}
|
||||||
|
pageLimit={INITIAL_PAGE_LIMIT}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
<TopButton />
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</AnimatedPageWrapper>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default UserSnapshotLogContent;
|
||||||
@@ -4,7 +4,7 @@ import { useState, useEffect } from 'react';
|
|||||||
import { UserTattooView } from '../../apis/Users';
|
import { UserTattooView } from '../../apis/Users';
|
||||||
import { TableSkeleton } from '../Skeleton/TableSkeleton';
|
import { TableSkeleton } from '../Skeleton/TableSkeleton';
|
||||||
|
|
||||||
const UserTatttooInfo = ({ userInfo }) => {
|
const UserTattooInfo = ({ userInfo }) => {
|
||||||
const [dataList, setDataList] = useState();
|
const [dataList, setDataList] = useState();
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ const UserTatttooInfo = ({ userInfo }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default UserTatttooInfo;
|
export default UserTattooInfo;
|
||||||
|
|
||||||
const UserDefaultTable = styled.table`
|
const UserDefaultTable = styled.table`
|
||||||
border: 1px solid #e8eaec;
|
border: 1px solid #e8eaec;
|
||||||
|
|||||||
@@ -1,312 +1,279 @@
|
|||||||
import { useEffect, useState } from 'react';
|
import React, { Fragment, useMemo, useRef, useState } from 'react';
|
||||||
import { styled } from 'styled-components';
|
|
||||||
import Button from '../../components/common/button/Button';
|
|
||||||
|
|
||||||
import { CurrencyIndexExport, CurrencyIndexView } from '../../apis';
|
import {
|
||||||
import { SelectInput, TableStyle, TableInfo, ListOption, InputLabel } from '../../styles/Components';
|
TableStyle,
|
||||||
|
FormWrapper,
|
||||||
|
TableWrapper, CircularProgressWrapper, TotalRow,
|
||||||
|
} from '../../styles/Components';
|
||||||
|
|
||||||
import CreditSeacrhBar from '../../components/IndexManage/CreditSearchBar';
|
import { useCurrencyIndexSearch } from '../searchBar';
|
||||||
import { uniqBy } from 'lodash';
|
import { Button, TopButton, ViewTableInfo } from '../common';
|
||||||
import { sumBy } from 'lodash';
|
import { TableSkeleton } from '../Skeleton/TableSkeleton';
|
||||||
|
import { numberFormatter } from '../../utils';
|
||||||
|
import {STORAGE_GAME_LOG_CURRENCY_SEARCH, } from '../../assets/data/adminConstants';
|
||||||
|
import ExcelExportButton from '../common/button/ExcelExportButton';
|
||||||
|
import CircularProgress from '../common/CircularProgress';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import CurrencyUserIndexSearchBar from '../searchBar/CurrencyUserIndexSearchBar';
|
||||||
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
import { AnimatedPageWrapper } from '../common/Layout';
|
||||||
|
|
||||||
const CreditContent = () => {
|
const CreditContent = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
const token = sessionStorage.getItem('token');
|
const token = sessionStorage.getItem('token');
|
||||||
let d = new Date();
|
const navigate = useNavigate();
|
||||||
const START_DATE = new Date(new Date(d.setDate(d.getDate() - 1)).setHours(0, 0, 0, 0));
|
const tableRef = useRef(null);
|
||||||
const END_DATE = new Date();
|
const [downloadState, setDownloadState] = useState({
|
||||||
const CURRENCY_LIST = [
|
loading: false,
|
||||||
{ "key": "Gold", "name": "골드" },
|
progress: 0
|
||||||
{ "key": "Sapphire", "name": "사파이어" },
|
});
|
||||||
{ "key": "Calium", "name": "칼리움" },
|
|
||||||
{ "key": "Onyxium", "name": "오닉시움" }
|
|
||||||
];
|
|
||||||
|
|
||||||
const [sendDate, setSendDate] = useState(START_DATE);
|
const {
|
||||||
const [finishDate, setFinishDate] = useState(END_DATE);
|
searchParams,
|
||||||
const [currencyType, setCurrencyType] = useState('Gold');
|
loading: dataLoading,
|
||||||
const [currencyText, setCurrencyText] = useState('골드');
|
data: dataList,
|
||||||
|
handleSearch,
|
||||||
|
handleReset,
|
||||||
|
updateSearchParams
|
||||||
|
} = useCurrencyIndexSearch(token);
|
||||||
|
|
||||||
const [dataList, setDataList] = useState([]);
|
const tableHeaders = useMemo(() => {
|
||||||
const [routeData, setRouteData] = useState([]);
|
return [
|
||||||
|
// 기본 컬럼 (rowSpan=2)
|
||||||
|
{ id: 'logDay', label: '일자', width: '100px', rowSpan: 2 },
|
||||||
|
{ id: 'accountId', label: 'account ID', width: '80px', rowSpan: 2 },
|
||||||
|
{ id: 'userGuid', label: 'GUID', width: '200px', rowSpan: 2 },
|
||||||
|
{ id: 'userNickname', label: '아바타명', width: '150px', rowSpan: 2 },
|
||||||
|
|
||||||
|
// 획득량 그룹 헤더 (첫 번째 행에만 표시)
|
||||||
|
{ id: 'acquired', label: '획득', width: '400px', colSpan: 5, groupHeader: true },
|
||||||
|
|
||||||
|
// 획득량 컬럼 (두 번째 행에만 표시)
|
||||||
|
{ id: 'sapphireAcquired', label: '사파이어', width: '80px', groupRow: true },
|
||||||
|
{ id: 'goldAcquired', label: '골드', width: '80px', groupRow: true },
|
||||||
|
{ id: 'caliumAcquired', label: '칼리움', width: '80px', groupRow: true },
|
||||||
|
{ id: 'beamAcquired', label: 'BEAM', width: '80px', groupRow: true },
|
||||||
|
{ id: 'rubyAcquired', label: '루비', width: '80px', groupRow: true },
|
||||||
|
|
||||||
|
// 소모량 그룹 헤더 (첫 번째 행에만 표시)
|
||||||
|
{ id: 'consumed', label: '소모', width: '400px', colSpan: 5, groupHeader: true },
|
||||||
|
|
||||||
|
// 소모량 컬럼 (두 번째 행에만 표시)
|
||||||
|
{ id: 'sapphireConsumed', label: '사파이어', width: '80px', groupRow: true },
|
||||||
|
{ id: 'goldConsumed', label: '골드', width: '80px', groupRow: true },
|
||||||
|
{ id: 'caliumConsumed', label: '칼리움', width: '80px', groupRow: true },
|
||||||
|
{ id: 'beamConsumed', label: 'BEAM', width: '80px', groupRow: true },
|
||||||
|
{ id: 'rubyConsumed', label: '루비', width: '80px', groupRow: true },
|
||||||
|
|
||||||
|
// 계 컬럼 (rowSpan=2)
|
||||||
|
{ id: 'sapphireNet', label: '사파이어 계', width: '80px', rowSpan: 2 },
|
||||||
|
{ id: 'goldNet', label: '골드 계', width: '80px', rowSpan: 2 },
|
||||||
|
{ id: 'caliumNet', label: '칼리움 계', width: '80px', rowSpan: 2 },
|
||||||
|
{ id: 'beamNet', label: 'BEAM 계', width: '80px', rowSpan: 2 },
|
||||||
|
{ id: 'rubyNet', label: '루비 계', width: '80px', rowSpan: 2 },
|
||||||
|
|
||||||
|
// 기타 컬럼 (rowSpan=2)
|
||||||
|
{ id: 'totalCurrencies', label: '활동 수', width: '80px', rowSpan: 2 },
|
||||||
|
{ id: 'detail', label: '상세', width: '100px', rowSpan: 2 }
|
||||||
|
];
|
||||||
|
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
const totals = useMemo(() => {
|
||||||
fetchData(sendDate, finishDate, currencyType);
|
if (!dataList?.currency_list?.length) return null;
|
||||||
}, [currencyType]);
|
|
||||||
|
|
||||||
const fetchData = async (startDate, endDate) => {
|
return dataList.currency_list.reduce((acc, item) => {
|
||||||
const newStartDate = new Date(startDate);
|
return {
|
||||||
const newEndDate = new Date(endDate);
|
sapphireAcquired: (acc.sapphireAcquired || 0) + (item.sapphireAcquired || 0),
|
||||||
|
sapphireConsumed: (acc.sapphireConsumed || 0) + (item.sapphireConsumed || 0),
|
||||||
|
goldAcquired: (acc.goldAcquired || 0) + (item.goldAcquired || 0),
|
||||||
|
goldConsumed: (acc.goldConsumed || 0) + (item.goldConsumed || 0),
|
||||||
|
caliumAcquired: (acc.caliumAcquired || 0) + (item.caliumAcquired || 0),
|
||||||
|
caliumConsumed: (acc.caliumConsumed || 0) + (item.caliumConsumed || 0),
|
||||||
|
beamAcquired: (acc.beamAcquired || 0) + (item.beamAcquired || 0),
|
||||||
|
beamConsumed: (acc.beamConsumed || 0) + (item.beamConsumed || 0),
|
||||||
|
rubyAcquired: (acc.rubyAcquired || 0) + (item.rubyAcquired || 0),
|
||||||
|
rubyConsumed: (acc.rubyConsumed || 0) + (item.rubyConsumed || 0),
|
||||||
|
sapphireNet: (acc.sapphireNet || 0) + (item.sapphireNet || 0),
|
||||||
|
goldNet: (acc.goldNet || 0) + (item.goldNet || 0),
|
||||||
|
caliumNet: (acc.caliumNet || 0) + (item.caliumNet || 0),
|
||||||
|
beamNet: (acc.beamNet || 0) + (item.beamNet || 0),
|
||||||
|
rubyNet: (acc.rubyNet || 0) + (item.rubyNet || 0),
|
||||||
|
totalCurrencies: (acc.totalCurrencies || 0) + (item.totalCurrencies || 0),
|
||||||
|
};
|
||||||
|
}, {});
|
||||||
|
}, [dataList?.currency_list]);
|
||||||
|
|
||||||
const startDateToLocal =
|
const handleModalSubmit = async (type, param = null) => {
|
||||||
newStartDate.getFullYear() +
|
switch (type) {
|
||||||
'-' +
|
case "detail":
|
||||||
(newStartDate.getMonth() + 1 < 9 ? '0' + (newStartDate.getMonth() + 1) : newStartDate.getMonth() + 1) +
|
const params = {
|
||||||
'-' +
|
tab: "CURRENCY",
|
||||||
(newStartDate.getDate() < 9 ? '0' + newStartDate.getDate() : newStartDate.getDate());
|
start_dt: (() => {
|
||||||
|
const date = new Date(param.logDay);
|
||||||
|
return date;
|
||||||
|
})(),
|
||||||
|
end_dt: (() => {
|
||||||
|
const date = new Date(param.logDay);
|
||||||
|
date.setDate(date.getDate() + 1);
|
||||||
|
return date;
|
||||||
|
})(),
|
||||||
|
guid: param.userGuid
|
||||||
|
};
|
||||||
|
|
||||||
const endDateToLocal =
|
// 복사한 데이터를 세션 스토리지에 저장
|
||||||
newEndDate.getFullYear() +
|
sessionStorage.setItem(STORAGE_GAME_LOG_CURRENCY_SEARCH, JSON.stringify(params));
|
||||||
'-' +
|
navigate('/datamanage/gamelogview');
|
||||||
(newEndDate.getMonth() + 1 < 9 ? '0' + (newEndDate.getMonth() + 1) : newEndDate.getMonth() + 1) +
|
break;
|
||||||
'-' +
|
}
|
||||||
(newEndDate.getDate() < 9 ? '0' + newEndDate.getDate() : newEndDate.getDate());
|
}
|
||||||
|
|
||||||
setDataList(await CurrencyIndexView(token, startDateToLocal, endDateToLocal, currencyType));
|
|
||||||
|
|
||||||
|
|
||||||
setSendDate(startDateToLocal);
|
|
||||||
setFinishDate(endDateToLocal);
|
|
||||||
setRoutArray(await CurrencyIndexView(token, startDateToLocal, endDateToLocal, currencyType));
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleCurrencyChange = e => {
|
|
||||||
let value = e.target.value;
|
|
||||||
setCurrencyType(value);
|
|
||||||
CURRENCY_LIST.filter(data => data.key === value).map(data => {
|
|
||||||
setCurrencyText(data.name);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
//route data
|
|
||||||
const setRoutArray = async (data) => {
|
|
||||||
let routeArray = [];
|
|
||||||
let routeAcqArr = [];
|
|
||||||
let routeConArr = [];
|
|
||||||
|
|
||||||
//생산량 route
|
|
||||||
data.list && data.list[0].daily_data.filter(routeData => routeData.delta_type === 'ACQUIRE').map(routeData => {
|
|
||||||
routeData.data.map(routeData => {
|
|
||||||
if(!routeAcqArr.includes(routeData.route) ){
|
|
||||||
routeAcqArr.push(routeData.route);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
routeArray.ACQUIRE = routeAcqArr;
|
|
||||||
|
|
||||||
//소진량 route
|
|
||||||
data.list && data.list[0].daily_data.filter(routeData => routeData.delta_type === 'CONSUME').map(routeData => {
|
|
||||||
routeData.data.map(routeData => {
|
|
||||||
if(!routeConArr.includes(routeData.route) ){
|
|
||||||
routeConArr.push(routeData.route);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
routeArray.CONSUME = routeConArr;
|
|
||||||
|
|
||||||
setRouteData(routeArray);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 엑셀 다운로드
|
|
||||||
const handleXlsxExport = () => {
|
|
||||||
const fileName = 'Caliverse_Credit_Index.xlsx';
|
|
||||||
CurrencyIndexExport(token, fileName, sendDate, finishDate, currencyType);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<AnimatedPageWrapper>
|
||||||
|
<FormWrapper>
|
||||||
<CreditSeacrhBar fetchData={fetchData} />
|
<CurrencyUserIndexSearchBar
|
||||||
<TableInfo2>
|
searchParams={searchParams}
|
||||||
<SelectInput onChange={handleCurrencyChange}>
|
onSearch={(newParams, executeSearch = true) => {
|
||||||
{CURRENCY_LIST.map((item, index) => (
|
if (executeSearch) {
|
||||||
<option value={item.key} key={index}>
|
handleSearch(newParams);
|
||||||
{item.name}
|
} else {
|
||||||
</option>
|
updateSearchParams(newParams);
|
||||||
))}
|
}
|
||||||
</SelectInput>
|
}}
|
||||||
<ListOption>
|
onReset={handleReset}
|
||||||
<Button theme="line" text="엑셀 다운로드" handleClick={handleXlsxExport} />
|
/>
|
||||||
</ListOption>
|
</FormWrapper>
|
||||||
</TableInfo2>
|
<ViewTableInfo >
|
||||||
<TableWrapper>
|
<ExcelExportButton
|
||||||
<EconomicTable>
|
functionName="GameCurrencyLogExport"
|
||||||
<thead>
|
params={searchParams}
|
||||||
<tr>
|
fileName={t('FILE_CURRENCY_INDEX')}
|
||||||
<th colSpan="2" className="text-center" width="300">
|
onLoadingChange={setDownloadState}
|
||||||
Product
|
dataSize={dataList?.length}
|
||||||
</th>
|
/>
|
||||||
{dataList.list && uniqBy(dataList.list, 'date').map(data =>
|
{downloadState.loading && (
|
||||||
<th width="160" key={data.date}>{data.date}</th>
|
<CircularProgressWrapper>
|
||||||
|
<CircularProgress
|
||||||
|
progress={downloadState.progress}
|
||||||
|
size={36}
|
||||||
|
progressColor="#4A90E2"
|
||||||
|
/>
|
||||||
|
</CircularProgressWrapper>
|
||||||
|
)}
|
||||||
|
</ViewTableInfo>
|
||||||
|
{dataLoading ? <TableSkeleton width='100%' count={15} /> :
|
||||||
|
<>
|
||||||
|
<TableWrapper>
|
||||||
|
<TableStyle ref={tableRef}>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
{/* 첫 번째 행 - 기본 컬럼 + 그룹 헤더 + rowSpan=2 컬럼 */}
|
||||||
|
{tableHeaders.map(header => {
|
||||||
|
if (header.groupRow) return null; // 두 번째 행의 컬럼은 첫 번째 행에서 건너뜀
|
||||||
|
|
||||||
|
return (
|
||||||
|
<th
|
||||||
|
key={header.id}
|
||||||
|
width={header.width}
|
||||||
|
rowSpan={header.rowSpan}
|
||||||
|
colSpan={header.colSpan}
|
||||||
|
>
|
||||||
|
{header.label}
|
||||||
|
</th>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
{/* 두 번째 행 - 그룹 내 하위 컬럼만 */}
|
||||||
|
{tableHeaders.map(header => {
|
||||||
|
if (!header.groupRow) return null; // 첫 번째 행이나 rowSpan=2 컬럼은 두 번째 행에서 건너뜀
|
||||||
|
|
||||||
|
return (
|
||||||
|
<th key={header.id} width={header.width}>
|
||||||
|
{header.label}
|
||||||
|
</th>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
{totals && (
|
||||||
|
<TotalRow>
|
||||||
|
<td colSpan="4">합계</td>
|
||||||
|
{/* 획득 그룹 합계 */}
|
||||||
|
<td>{numberFormatter.formatCurrency(totals.sapphireAcquired)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(totals.goldAcquired)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(totals.caliumAcquired)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(totals.beamAcquired)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(totals.rubyAcquired)}</td>
|
||||||
|
|
||||||
|
{/* 소모 그룹 합계 */}
|
||||||
|
<td>{numberFormatter.formatCurrency(totals.sapphireConsumed)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(totals.goldConsumed)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(totals.caliumConsumed)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(totals.beamConsumed)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(totals.rubyConsumed)}</td>
|
||||||
|
|
||||||
|
{/* 계 합계 */}
|
||||||
|
<td>{numberFormatter.formatCurrency(totals.sapphireNet)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(totals.goldNet)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(totals.caliumNet)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(totals.beamNet)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(totals.rubyNet)}</td>
|
||||||
|
|
||||||
|
<td>{totals.totalCurrencies}</td>
|
||||||
|
<td>-</td>
|
||||||
|
</TotalRow>
|
||||||
)}
|
)}
|
||||||
</tr>
|
{dataList?.currency_list?.map((item, index) => (
|
||||||
</thead>
|
<Fragment key={index}>
|
||||||
<tbody>
|
<tr>
|
||||||
<tr>
|
{/* 기본 정보 */}
|
||||||
<TableTitle colSpan="2">(Total) {currencyText} 생산량</TableTitle>
|
<td>{item.logDay}</td>
|
||||||
{dataList.list &&
|
<td>{item.accountId}</td>
|
||||||
dataList.list.map((data) =>
|
<td>{item.userGuid}</td>
|
||||||
(data.total).filter(totalData => data.date === totalData.date && totalData.delta_type === 'ACQUIRE')
|
<td>{item.userNickname}</td>
|
||||||
.map((totalData, index) => (
|
|
||||||
<TableData key={index}
|
{/* 획득 그룹 */}
|
||||||
$state={totalData.dif !== "" && totalData.dif !== "Infinity" ? "danger" : ""}>
|
<td>{numberFormatter.formatCurrency(item.sapphireAcquired)}</td>
|
||||||
{totalData.quantity}
|
<td>{numberFormatter.formatCurrency(item.goldAcquired)}</td>
|
||||||
{
|
<td>{numberFormatter.formatCurrency(item.caliumAcquired)}</td>
|
||||||
totalData.dif !== "" && totalData.dif !== "Infinity"
|
<td>{numberFormatter.formatCurrency(item.beamAcquired)}</td>
|
||||||
? (<span>({totalData.dif})</span>)
|
<td>{numberFormatter.formatCurrency(item.rubyAcquired)}</td>
|
||||||
: ("")
|
|
||||||
}
|
{/* 소모 그룹 */}
|
||||||
</TableData>
|
<td>{numberFormatter.formatCurrency(item.sapphireConsumed)}</td>
|
||||||
)
|
<td>{numberFormatter.formatCurrency(item.goldConsumed)}</td>
|
||||||
))
|
<td>{numberFormatter.formatCurrency(item.caliumConsumed)}</td>
|
||||||
}
|
<td>{numberFormatter.formatCurrency(item.beamConsumed)}</td>
|
||||||
</tr>
|
<td>{numberFormatter.formatCurrency(item.rubyConsumed)}</td>
|
||||||
<tr>
|
|
||||||
<TableTitle colSpan="2">(Total) {currencyText} 소진량</TableTitle>
|
{/* 계 */}
|
||||||
{dataList.list &&
|
<td>{numberFormatter.formatCurrency(item.sapphireNet)}</td>
|
||||||
dataList.list.map((data) =>
|
<td>{numberFormatter.formatCurrency(item.goldNet)}</td>
|
||||||
(data.total).filter(totalData => data.date === totalData.date && totalData.delta_type === 'CONSUME')
|
<td>{numberFormatter.formatCurrency(item.caliumNet)}</td>
|
||||||
.map((totalData, index) => (
|
<td>{numberFormatter.formatCurrency(item.beamNet)}</td>
|
||||||
<TableData key={index}
|
<td>{numberFormatter.formatCurrency(item.rubyNet)}</td>
|
||||||
$state={totalData.dif !== "" && totalData.dif !== "Infinity" ? "danger" : ""}>
|
|
||||||
{totalData.quantity}
|
<td>{item.totalCurrencies}</td>
|
||||||
{
|
<td>
|
||||||
totalData.dif !== "" && totalData.dif !== "Infinity"
|
<Button theme="line" text="상세보기"
|
||||||
? (<span>({totalData.dif})</span>)
|
handleClick={e => handleModalSubmit('detail', item)} />
|
||||||
: ("")
|
</td>
|
||||||
}
|
</tr>
|
||||||
</TableData>
|
</Fragment>
|
||||||
)
|
))}
|
||||||
))
|
</tbody>
|
||||||
}
|
</TableStyle>
|
||||||
</tr>
|
</TableWrapper>
|
||||||
<tr>
|
<TopButton />
|
||||||
<TableTitle colSpan="2">(Total) {currencyText} 보유량</TableTitle>
|
</>
|
||||||
{dataList.list &&
|
}
|
||||||
dataList.list.map((data, index) => (
|
</AnimatedPageWrapper>
|
||||||
<TableData key={index}>
|
|
||||||
{sumBy(
|
|
||||||
data.total.filter(totalData => data.date === totalData.date && totalData.delta_type === 'ACQUIRE'),
|
|
||||||
'quantity',
|
|
||||||
) -
|
|
||||||
sumBy(
|
|
||||||
data.total.filter(totalData => data.date === totalData.date && totalData.delta_type === 'CONSUME'),
|
|
||||||
'quantity',
|
|
||||||
)}
|
|
||||||
</TableData>
|
|
||||||
))
|
|
||||||
}
|
|
||||||
</tr>
|
|
||||||
{/* 획득 GET */}
|
|
||||||
{
|
|
||||||
routeData.ACQUIRE && routeData.ACQUIRE.map((route, index) => (
|
|
||||||
<tr key={index}>
|
|
||||||
<TableTitle>GET</TableTitle>
|
|
||||||
<TableTitle>{route}</TableTitle>
|
|
||||||
{dataList.list &&
|
|
||||||
dataList.list.map((data) =>
|
|
||||||
data.daily_data.filter(dailyData => data.date === dailyData.date && dailyData.delta_type === 'ACQUIRE')
|
|
||||||
.map(dailyData => (dailyData.data).filter(routeData => data.date === routeData.date && routeData.route === route)
|
|
||||||
.map((routeData, i) => (
|
|
||||||
<TableData key={i} data={routeData.date}>{routeData.quantity}</TableData>
|
|
||||||
)))
|
|
||||||
)
|
|
||||||
}
|
|
||||||
</tr>
|
|
||||||
))
|
|
||||||
}
|
|
||||||
{/* 소진 USE CONSUME */}
|
|
||||||
{
|
|
||||||
routeData.CONSUME && routeData.CONSUME.map((route, index) => (
|
|
||||||
<tr key={index}>
|
|
||||||
<TableTitle>USE</TableTitle>
|
|
||||||
<TableTitle>{route}</TableTitle>
|
|
||||||
{dataList.list &&
|
|
||||||
dataList.list.map((data) =>
|
|
||||||
data.daily_data.filter(dailyData => data.date === dailyData.date && dailyData.delta_type === 'CONSUME')
|
|
||||||
.map(dailyData => (dailyData.data).filter(routeData => data.date === routeData.date && routeData.route === route)
|
|
||||||
.map((routeData, i) => (
|
|
||||||
<TableData key={i} data={routeData.date}>{routeData.quantity}</TableData>
|
|
||||||
)))
|
|
||||||
)
|
|
||||||
}
|
|
||||||
</tr>
|
|
||||||
))
|
|
||||||
}
|
|
||||||
</tbody>
|
|
||||||
</EconomicTable>
|
|
||||||
</TableWrapper>
|
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default CreditContent;
|
export default CreditContent;
|
||||||
|
|
||||||
const TableWrapper = styled.div`
|
|
||||||
width: 100%;
|
|
||||||
min-width: 680px;
|
|
||||||
overflow: auto;
|
|
||||||
&::-webkit-scrollbar {
|
|
||||||
height: 4px;
|
|
||||||
}
|
|
||||||
&::-webkit-scrollbar-thumb {
|
|
||||||
background: #666666;
|
|
||||||
}
|
|
||||||
&::-webkit-scrollbar-track {
|
|
||||||
background: #d9d9d9;
|
|
||||||
}
|
|
||||||
${TableStyle} {
|
|
||||||
width: 100%;
|
|
||||||
min-width: 900px;
|
|
||||||
th {
|
|
||||||
&.cell-nru {
|
|
||||||
background: #f0f0f0;
|
|
||||||
border-left: 1px solid #aaa;
|
|
||||||
border-right: 1px solid #aaa;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
td {
|
|
||||||
&.blank {
|
|
||||||
background: #f9f9f9;
|
|
||||||
}
|
|
||||||
&.cell-nru {
|
|
||||||
background: #fafafa;
|
|
||||||
border-left: 1px solid #aaa;
|
|
||||||
border-right: 1px solid #aaa;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const TableInfo2 = styled(TableInfo)`
|
|
||||||
justify-content: space-between;
|
|
||||||
${InputLabel} {
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
${SelectInput} {
|
|
||||||
width: auto;
|
|
||||||
min-width: 100px;
|
|
||||||
height: 24px;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const TableDate = styled.th`
|
|
||||||
color: ${props => (props.$state === 'danger' ? '#d60000' : '#2c2c2c')};
|
|
||||||
`;
|
|
||||||
|
|
||||||
const TableData = styled.td`
|
|
||||||
|
|
||||||
background: ${props => (props.$state === 'danger' ? '#d60000' : props.$state === 'blank' ? '#F9F9F9' : 'transparent')};
|
|
||||||
color: ${props => (props.$state === 'danger' ? '#fff' : '#2c2c2c')};
|
|
||||||
`;
|
|
||||||
|
|
||||||
const perData = styled.span`
|
|
||||||
display: ${props => (props.$view === 'hidden' ? 'none' : 'block')};
|
|
||||||
`;
|
|
||||||
|
|
||||||
const TableTitle = styled.td`
|
|
||||||
text-align: center;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const EconomicTable = styled(TableStyle)`
|
|
||||||
${TableData} {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
tbody {
|
|
||||||
tr:nth-child(1),
|
|
||||||
tr:nth-child(2),
|
|
||||||
tr:nth-child(3) {
|
|
||||||
background: #f5fcff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
126
src/components/IndexManage/CurrencyAcquireContent.js
Normal file
126
src/components/IndexManage/CurrencyAcquireContent.js
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
import React, { Fragment, useMemo, useRef } from 'react';
|
||||||
|
|
||||||
|
import {
|
||||||
|
TableStyle,
|
||||||
|
FormWrapper,
|
||||||
|
TableWrapper, ListOption,
|
||||||
|
} from '../../styles/Components';
|
||||||
|
|
||||||
|
import { useCurrencyAcquireIndexSearch, CurrencyAcquireIndexSearchBar } from '../searchBar';
|
||||||
|
import { TopButton, ViewTableInfo } from '../common';
|
||||||
|
import { TableSkeleton } from '../Skeleton/TableSkeleton';
|
||||||
|
import { numberFormatter } from '../../utils';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { AnimatedPageWrapper } from '../common/Layout';
|
||||||
|
import CSVDownloadButton from '../common/button/CsvDownButton';
|
||||||
|
|
||||||
|
const CurrencyAcquireContent = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const token = sessionStorage.getItem('token');
|
||||||
|
const tableRef = useRef(null);
|
||||||
|
|
||||||
|
const {
|
||||||
|
searchParams,
|
||||||
|
loading: dataLoading,
|
||||||
|
data: dataList,
|
||||||
|
handleSearch,
|
||||||
|
handleReset,
|
||||||
|
updateSearchParams
|
||||||
|
} = useCurrencyAcquireIndexSearch(token);
|
||||||
|
|
||||||
|
const tableHeaders = useMemo(() => {
|
||||||
|
return [
|
||||||
|
{ id: 'logDay', label: '일자', width: '100px' },
|
||||||
|
{ id: 'mail', label: '우편', width: '80px' },
|
||||||
|
{ id: 'ShopSell', label: '상점 판매', width: '80px' },
|
||||||
|
{ id: 'ShopPurchase', label: '상점 구매', width: '80px' },
|
||||||
|
{ id: 'seasonPass', label: '시즌 패스', width: '80px' },
|
||||||
|
{ id: 'claim', label: '클레임', width: '80px' },
|
||||||
|
{ id: 'quest', label: '퀘스트', width: '80px' },
|
||||||
|
{ id: 'ugq', label: 'UGQ', width: '80px' },
|
||||||
|
{ id: 'battleObject', label: '보급품 상자', width: '80px' },
|
||||||
|
{ id: 'randomBox', label: '랜덤박스', width: '80px' },
|
||||||
|
{ id: 'landRent', label: '랜드 임대', width: '80px' },
|
||||||
|
{ id: 'caliumExchange', label: '칼리움 교환소', width: '80px' },
|
||||||
|
{ id: 'caliumConverter', label: '칼리움 컨버터', width: '80px' },
|
||||||
|
{ id: 'beaconShop', label: '비컨 상점', width: '80px' },
|
||||||
|
{ id: 'etc', label: '기타', width: '80px' },
|
||||||
|
{ id: 'summary', label: '합계', width: '80px' },
|
||||||
|
];
|
||||||
|
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AnimatedPageWrapper>
|
||||||
|
<FormWrapper>
|
||||||
|
<CurrencyAcquireIndexSearchBar
|
||||||
|
searchParams={searchParams}
|
||||||
|
onSearch={(newParams, executeSearch = true) => {
|
||||||
|
if (executeSearch) {
|
||||||
|
handleSearch(newParams);
|
||||||
|
} else {
|
||||||
|
updateSearchParams(newParams);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onReset={handleReset}
|
||||||
|
/>
|
||||||
|
</FormWrapper>
|
||||||
|
<ViewTableInfo >
|
||||||
|
<ListOption>
|
||||||
|
<CSVDownloadButton tableRef={tableRef} fileName={t('FILE_INDEX_CURRENCY_ACQUIRE')} />
|
||||||
|
</ListOption>
|
||||||
|
</ViewTableInfo>
|
||||||
|
{dataLoading ? <TableSkeleton width='100%' count={15} /> :
|
||||||
|
<>
|
||||||
|
<TableWrapper>
|
||||||
|
<TableStyle ref={tableRef}>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
{tableHeaders.map(header => {
|
||||||
|
return (
|
||||||
|
<th
|
||||||
|
key={header.id}
|
||||||
|
width={header.width}
|
||||||
|
colSpan={header.colSpan}
|
||||||
|
>
|
||||||
|
{header.label}
|
||||||
|
</th>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
{dataList?.currency_list?.map((item, index) => (
|
||||||
|
<Fragment key={index}>
|
||||||
|
<tr>
|
||||||
|
<td>{item.logDay}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.MailTaken)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.ShopSell)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.ShopPurchase)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.SeasonPassTakeReward)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.ClaimReward)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency((item.actionSummary.QuestMainReward || 0) + (item.actionSummary.QuestTaskUpdate || 0))}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.UgqAbort)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.RewardProp)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.ItemRandomBoxUse)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.GainLandProfit)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.ConvertExchangeCalium)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.ConvertCalium)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency((item.actionSummary.BeaconSell || 0) + (item.actionSummary.BeaconShopReceivePaymentForSales || 0))}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.MoneyChange)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.totalDeltaAmount)}</td>
|
||||||
|
</tr>
|
||||||
|
</Fragment>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</TableStyle>
|
||||||
|
</TableWrapper>
|
||||||
|
<TopButton />
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</AnimatedPageWrapper>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default CurrencyAcquireContent;
|
||||||
109
src/components/IndexManage/CurrencyAssetsContent.js
Normal file
109
src/components/IndexManage/CurrencyAssetsContent.js
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
import React, { Fragment, useMemo, useRef } from 'react';
|
||||||
|
|
||||||
|
import {
|
||||||
|
TableStyle,
|
||||||
|
FormWrapper,
|
||||||
|
TableWrapper, ListOption
|
||||||
|
} from '../../styles/Components';
|
||||||
|
|
||||||
|
import {
|
||||||
|
AssetsIndexSearchBar, useAssetsIndexSearch,
|
||||||
|
} from '../searchBar';
|
||||||
|
import { TopButton, ViewTableInfo } from '../common';
|
||||||
|
import { TableSkeleton } from '../Skeleton/TableSkeleton';
|
||||||
|
import { numberFormatter } from '../../utils';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { AnimatedPageWrapper } from '../common/Layout';
|
||||||
|
import CSVDownloadButton from '../common/button/CsvDownButton';
|
||||||
|
import DailyDashBoard from './DailyCaliumDashBoard';
|
||||||
|
|
||||||
|
const CurrencyAssetsContent = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const token = sessionStorage.getItem('token');
|
||||||
|
const tableRef = useRef(null);
|
||||||
|
|
||||||
|
const {
|
||||||
|
searchParams,
|
||||||
|
loading: dataLoading,
|
||||||
|
data: dataList,
|
||||||
|
handleSearch,
|
||||||
|
handleReset,
|
||||||
|
updateSearchParams
|
||||||
|
} = useAssetsIndexSearch(token);
|
||||||
|
|
||||||
|
const tableHeaders = useMemo(() => {
|
||||||
|
return [
|
||||||
|
{ id: 'logDay', label: '일자', width: '100px' },
|
||||||
|
{ id: 'userCount', label: '유저수', width: '100px' },
|
||||||
|
{ id: 'gold', label: '골드', width: '100px' },
|
||||||
|
{ id: 'sapphire', label: '사파이어', width: '100px' },
|
||||||
|
{ id: 'calium', label: '칼리움', width: '100px' },
|
||||||
|
{ id: 'ruby', label: '루비', width: '100px' }
|
||||||
|
];
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AnimatedPageWrapper>
|
||||||
|
<DailyDashBoard />
|
||||||
|
<FormWrapper>
|
||||||
|
<AssetsIndexSearchBar
|
||||||
|
searchParams={searchParams}
|
||||||
|
onSearch={(newParams, executeSearch = true) => {
|
||||||
|
if (executeSearch) {
|
||||||
|
handleSearch(newParams);
|
||||||
|
} else {
|
||||||
|
updateSearchParams(newParams);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onReset={handleReset}
|
||||||
|
/>
|
||||||
|
</FormWrapper>
|
||||||
|
<ViewTableInfo >
|
||||||
|
<ListOption>
|
||||||
|
<CSVDownloadButton tableRef={tableRef} fileName={t('FILE_INDEX_ASSETS_CURRENCY')} />
|
||||||
|
</ListOption>
|
||||||
|
</ViewTableInfo>
|
||||||
|
{dataLoading ? <TableSkeleton width='100%' count={15} /> :
|
||||||
|
<>
|
||||||
|
<TableWrapper>
|
||||||
|
<TableStyle ref={tableRef}>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
{tableHeaders.map(header => {
|
||||||
|
return (
|
||||||
|
<th
|
||||||
|
key={header.id}
|
||||||
|
width={header.width}
|
||||||
|
colSpan={header.colSpan}
|
||||||
|
>
|
||||||
|
{header.label}
|
||||||
|
</th>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
{dataList?.assets_list?.map((data, index) => (
|
||||||
|
<Fragment key={index}>
|
||||||
|
<tr>
|
||||||
|
<td>{data.logDay}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(data.userCount)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(data.gold)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(data.sapphire)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(data.calium)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(data.ruby)}</td>
|
||||||
|
</tr>
|
||||||
|
</Fragment>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</TableStyle>
|
||||||
|
</TableWrapper>
|
||||||
|
<TopButton />
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</AnimatedPageWrapper>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default CurrencyAssetsContent;
|
||||||
128
src/components/IndexManage/CurrencyConsumeContent.js
Normal file
128
src/components/IndexManage/CurrencyConsumeContent.js
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
import React, { Fragment, useMemo, useRef } from 'react';
|
||||||
|
|
||||||
|
import {
|
||||||
|
TableStyle,
|
||||||
|
FormWrapper,
|
||||||
|
TableWrapper, ListOption,
|
||||||
|
} from '../../styles/Components';
|
||||||
|
|
||||||
|
import {
|
||||||
|
useCurrencyConsumeIndexSearch, CurrencyConsumeIndexSearchBar,
|
||||||
|
} from '../searchBar';
|
||||||
|
import { TopButton, ViewTableInfo } from '../common';
|
||||||
|
import { TableSkeleton } from '../Skeleton/TableSkeleton';
|
||||||
|
import { numberFormatter } from '../../utils';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { AnimatedPageWrapper } from '../common/Layout';
|
||||||
|
import CSVDownloadButton from '../common/button/CsvDownButton';
|
||||||
|
|
||||||
|
const CurrencyConsumeContent = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const token = sessionStorage.getItem('token');
|
||||||
|
const tableRef = useRef(null);
|
||||||
|
|
||||||
|
const {
|
||||||
|
searchParams,
|
||||||
|
loading: dataLoading,
|
||||||
|
data: dataList,
|
||||||
|
handleSearch,
|
||||||
|
handleReset,
|
||||||
|
updateSearchParams
|
||||||
|
} = useCurrencyConsumeIndexSearch(token);
|
||||||
|
|
||||||
|
const tableHeaders = useMemo(() => {
|
||||||
|
return [
|
||||||
|
{ id: 'logDay', label: '일자', width: '100px' },
|
||||||
|
{ id: 'itemBuy', label: '아이템 구매', width: '80px' },
|
||||||
|
{ id: 'ShopPurchase', label: '상점 구매', width: '80px' },
|
||||||
|
{ id: 'ShopRePurchase', label: '상점 재구매', width: '80px' },
|
||||||
|
{ id: 'beaconShop', label: '비컨상점', width: '80px' },
|
||||||
|
{ id: 'beacon', label: '비컨', width: '80px' },
|
||||||
|
{ id: 'taxi', label: '택시', width: '80px' },
|
||||||
|
{ id: 'farming', label: '파밍', width: '80px' },
|
||||||
|
{ id: 'seasonPass', label: '시즌 패스', width: '80px' },
|
||||||
|
{ id: 'caliumExchange', label: '칼리움 교환소', width: '80px' },
|
||||||
|
{ id: 'caliumConverter', label: '칼리움 컨버터', width: '80px' },
|
||||||
|
{ id: 'rent', label: '랜드 렌탈', width: '80px' },
|
||||||
|
{ id: 'landAuction', label: '랜드 경매', width: '80px' },
|
||||||
|
{ id: 'ugq', label: 'UGQ', width: '80px' },
|
||||||
|
{ id: 'etc', label: '기타', width: '80px' },
|
||||||
|
{ id: 'summary', label: '합계', width: '80px' },
|
||||||
|
];
|
||||||
|
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AnimatedPageWrapper>
|
||||||
|
<FormWrapper>
|
||||||
|
<CurrencyConsumeIndexSearchBar
|
||||||
|
searchParams={searchParams}
|
||||||
|
onSearch={(newParams, executeSearch = true) => {
|
||||||
|
if (executeSearch) {
|
||||||
|
handleSearch(newParams);
|
||||||
|
} else {
|
||||||
|
updateSearchParams(newParams);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onReset={handleReset}
|
||||||
|
/>
|
||||||
|
</FormWrapper>
|
||||||
|
<ViewTableInfo >
|
||||||
|
<ListOption>
|
||||||
|
<CSVDownloadButton tableRef={tableRef} fileName={t('FILE_INDEX_CURRENCY_CONSUME')} />
|
||||||
|
</ListOption>
|
||||||
|
</ViewTableInfo>
|
||||||
|
{dataLoading ? <TableSkeleton width='100%' count={15} /> :
|
||||||
|
<>
|
||||||
|
<TableWrapper>
|
||||||
|
<TableStyle ref={tableRef}>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
{tableHeaders.map(header => {
|
||||||
|
return (
|
||||||
|
<th
|
||||||
|
key={header.id}
|
||||||
|
width={header.width}
|
||||||
|
colSpan={header.colSpan}
|
||||||
|
>
|
||||||
|
{header.label}
|
||||||
|
</th>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
{dataList?.currency_list?.map((item, index) => (
|
||||||
|
<Fragment key={index}>
|
||||||
|
<tr>
|
||||||
|
<td>{item.logDay}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.ItemBuy)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.ShopPurchase)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.ShopRePurchase)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency((item.actionSummary.BeaconShopRegisterItem || 0) + (item.actionSummary.BeaconShopPurchaseItem || 0))}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency((item.actionSummary.BeaconCreate || 0) + (item.actionSummary.BeaconEdit || 0) + (item.actionSummary.BeaconAppearanceCustomize || 0))}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.TaxiMove)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.FarmingStart)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.SeasonPassBuyCharged)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.ConvertExchangeCalium)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.ConvertCalium)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.RentFloor)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.LandAuctionBid)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.UgqAssign)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency((item.actionSummary.MoneyChange ||0) + (item.actionSummary.RenewalShopProducts ||0) + (item.actionSummary.CharacterAppearanceCustomize ||0))}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.totalDeltaAmount)}</td>
|
||||||
|
</tr>
|
||||||
|
</Fragment>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</TableStyle>
|
||||||
|
</TableWrapper>
|
||||||
|
<TopButton />
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</AnimatedPageWrapper>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default CurrencyConsumeContent;
|
||||||
@@ -1,110 +0,0 @@
|
|||||||
import { useEffect, useState } from 'react';
|
|
||||||
|
|
||||||
import Button from '../../components/common/button/Button';
|
|
||||||
|
|
||||||
import { TableStyle, TableInfo, ListOption, IndexTableWrap } from '../../styles/Components';
|
|
||||||
import { DailySearchBar } from '../../components/IndexManage/index';
|
|
||||||
import { DailyActiveUserExport, DailyActiveUserView } from '../../apis';
|
|
||||||
|
|
||||||
const PlayTimeContent = () => {
|
|
||||||
const token = sessionStorage.getItem('token');
|
|
||||||
let d = new Date();
|
|
||||||
const START_DATE = new Date(new Date(d.setDate(d.getDate() - 1)).setHours(0, 0, 0, 0));
|
|
||||||
const END_DATE = new Date();
|
|
||||||
|
|
||||||
const [dataList, setDataList] = useState([]);
|
|
||||||
const [resultData, setResultData] = useState([]);
|
|
||||||
|
|
||||||
const [sendDate, setSendDate] = useState(START_DATE);
|
|
||||||
const [finishDate, setFinishDate] = useState(END_DATE);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
fetchData(START_DATE, END_DATE);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
// DAU 데이터
|
|
||||||
const fetchData = async (startDate, endDate) => {
|
|
||||||
const startDateToLocal =
|
|
||||||
startDate.getFullYear() +
|
|
||||||
'-' +
|
|
||||||
(startDate.getMonth() + 1 < 9 ? '0' + (startDate.getMonth() + 1) : startDate.getMonth() + 1) +
|
|
||||||
'-' +
|
|
||||||
(startDate.getDate() < 9 ? '0' + startDate.getDate() : startDate.getDate());
|
|
||||||
|
|
||||||
const endDateToLocal =
|
|
||||||
endDate.getFullYear() +
|
|
||||||
'-' +
|
|
||||||
(endDate.getMonth() + 1 < 9 ? '0' + (endDate.getMonth() + 1) : endDate.getMonth() + 1) +
|
|
||||||
'-' +
|
|
||||||
(endDate.getDate() < 9 ? '0' + endDate.getDate() : endDate.getDate());
|
|
||||||
|
|
||||||
// await DailyActiveUserView(token, startDateToLocal, endDateToLocal).then(data => {
|
|
||||||
// console.log(data);
|
|
||||||
// setDataList(data);
|
|
||||||
// });
|
|
||||||
|
|
||||||
setSendDate(startDateToLocal);
|
|
||||||
setFinishDate(endDateToLocal);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 검색 함수
|
|
||||||
const handleSearch = (send_dt, end_dt) => {
|
|
||||||
fetchData(send_dt, end_dt);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 엑셀 다운로드
|
|
||||||
const handleXlsxExport = () => {
|
|
||||||
const fileName = 'Caliverse_Dau.xlsx';
|
|
||||||
DailyActiveUserExport(token, fileName, sendDate, finishDate);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<DailySearchBar setResultData={setResultData} resultData={resultData} handleSearch={handleSearch} fetchData={fetchData} />
|
|
||||||
<TableInfo>
|
|
||||||
<ListOption>
|
|
||||||
<Button theme="line" text="엑셀 다운로드" handleClick={handleXlsxExport} />
|
|
||||||
</ListOption>
|
|
||||||
</TableInfo>
|
|
||||||
<IndexTableWrap>
|
|
||||||
<TableStyle>
|
|
||||||
<caption></caption>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th rowSpan="1" width="45">
|
|
||||||
일자
|
|
||||||
</th>
|
|
||||||
<th colSpan="1" width="30">
|
|
||||||
DAU
|
|
||||||
</th>
|
|
||||||
{/*<th colSpan="1" width="30">*/}
|
|
||||||
{/* DALC*/}
|
|
||||||
{/*</th>*/}
|
|
||||||
<th colSpan="1" width="30">
|
|
||||||
DGLC
|
|
||||||
</th>
|
|
||||||
{/*<th colSpan="1" width="30">*/}
|
|
||||||
{/* MaxAU*/}
|
|
||||||
{/*</th>*/}
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
{dataList && (dataList || []).map((data, index) => (
|
|
||||||
<tr key={index}>
|
|
||||||
<td>{data.date}</td>
|
|
||||||
<td>{data.dau}</td>
|
|
||||||
{/*<td>{data.dalc}</td>*/}
|
|
||||||
<td>{data.dglc}</td>
|
|
||||||
{/*<td>{data.maxAu}</td>*/}
|
|
||||||
</tr>
|
|
||||||
))}
|
|
||||||
</tbody>
|
|
||||||
</TableStyle>
|
|
||||||
</IndexTableWrap>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default PlayTimeContent;
|
|
||||||
|
|
||||||
141
src/components/IndexManage/DailyCaliumDashBoard.js
Normal file
141
src/components/IndexManage/DailyCaliumDashBoard.js
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
import { dashboardCaliumIndex } from '../../apis';
|
||||||
|
|
||||||
|
import { styled } from 'styled-components';
|
||||||
|
import TitleArrow from '../../assets/img/icon/icon-title.png';
|
||||||
|
|
||||||
|
const DailyDashBoard = () => {
|
||||||
|
const [boardState, setBoardState] = useState('active');
|
||||||
|
const [totalData, setTotalData] = useState([]);
|
||||||
|
|
||||||
|
const handleBoard = () => {
|
||||||
|
if (boardState === 'active') {
|
||||||
|
setBoardState('inactive');
|
||||||
|
} else {
|
||||||
|
setBoardState('active');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
fetchData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const fetchData = async () => {
|
||||||
|
const token = sessionStorage.getItem('token');
|
||||||
|
await dashboardCaliumIndex(token).then(data => {
|
||||||
|
setTotalData(data.dashboard_calium);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const dashboardItems = [
|
||||||
|
{
|
||||||
|
title: '컨버터 칼리움 보유량',
|
||||||
|
value: totalData.total_calium || 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '컨버터 변환 효율',
|
||||||
|
value: `${totalData.converter_rate || 0}%`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '인플레이션 가중치',
|
||||||
|
value: `${totalData.inflation_rate || 0}%`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '칼리움 누적 총량',
|
||||||
|
value: totalData.cumulative_calium || 0
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<DailyBoardWrapper>
|
||||||
|
{totalData &&
|
||||||
|
<DailyBoard>
|
||||||
|
<BoardTitle onClick={handleBoard} $state={boardState}>
|
||||||
|
Daily Dashboard
|
||||||
|
</BoardTitle>
|
||||||
|
<BoardInfo $state={boardState}>
|
||||||
|
<BoxWrapper>
|
||||||
|
{dashboardItems?.map((item, index) => (
|
||||||
|
<InfoItem key={index}>
|
||||||
|
<InfoTitle>{item.title}</InfoTitle>
|
||||||
|
<InfoValue>
|
||||||
|
{item.value}
|
||||||
|
</InfoValue>
|
||||||
|
</InfoItem>
|
||||||
|
))}
|
||||||
|
</BoxWrapper>
|
||||||
|
</BoardInfo>
|
||||||
|
</DailyBoard>
|
||||||
|
}
|
||||||
|
</DailyBoardWrapper>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default DailyDashBoard;
|
||||||
|
|
||||||
|
const DailyBoardWrapper = styled.div`
|
||||||
|
padding-top: 20px;
|
||||||
|
border-top: 1px solid #000;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const DailyBoard = styled.div`
|
||||||
|
background: #f6f6f6;
|
||||||
|
border-radius: 10px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const BoardTitle = styled.div`
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: 600;
|
||||||
|
line-height: 52px;
|
||||||
|
padding: 0 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
&:after {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
width: 11px;
|
||||||
|
height: 52px;
|
||||||
|
margin-left: 10px;
|
||||||
|
background: url(${TitleArrow}) 50% 50% no-repeat;
|
||||||
|
position: absolute;
|
||||||
|
transform: ${props => (props.$state === 'active' ? 'rotate(0)' : 'rotate(180deg)')};
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
const BoardInfo = styled.div`
|
||||||
|
padding: 20px;
|
||||||
|
border-top: 1px solid #d9d9d9;
|
||||||
|
display: ${props => (props.$state === 'active' ? 'block' : 'none')};
|
||||||
|
`;
|
||||||
|
|
||||||
|
const BoxWrapper = styled.div`
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 20px;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const InfoItem = styled.div`
|
||||||
|
width: 18%;
|
||||||
|
background: #fff;
|
||||||
|
padding: 15px 20px;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
border-radius: 15px;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const InfoTitle = styled.div`
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 600;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const InfoValue = styled.div`
|
||||||
|
display: inline-flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin: 5px 0;
|
||||||
|
gap: 5px 0;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 600;
|
||||||
|
`;
|
||||||
@@ -26,7 +26,6 @@ const DailyDashBoard = ({ content }) => {
|
|||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
const token = sessionStorage.getItem('token');
|
const token = sessionStorage.getItem('token');
|
||||||
await userTotalIndex(token).then(data => {
|
await userTotalIndex(token).then(data => {
|
||||||
console.log(data);
|
|
||||||
setTotalData(data.dashboard);
|
setTotalData(data.dashboard);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,111 +0,0 @@
|
|||||||
import { Fragment, useEffect, useState } from 'react';
|
|
||||||
|
|
||||||
import Button from '../common/button/Button';
|
|
||||||
|
|
||||||
import { TableStyle, TableInfo, ListOption, IndexTableWrap } from '../../styles/Components';
|
|
||||||
import { DailySearchBar } from './index';
|
|
||||||
import { DailyMedalView } from '../../apis';
|
|
||||||
|
|
||||||
const DailyMedalContent = () => {
|
|
||||||
const token = sessionStorage.getItem('token');
|
|
||||||
let d = new Date();
|
|
||||||
const START_DATE = new Date(new Date(d.setDate(d.getDate() - 1)).setHours(0, 0, 0, 0));
|
|
||||||
const END_DATE = new Date();
|
|
||||||
|
|
||||||
const [dataList, setDataList] = useState([]);
|
|
||||||
const [resultData, setResultData] = useState([]);
|
|
||||||
|
|
||||||
const [sendDate, setSendDate] = useState(START_DATE);
|
|
||||||
const [finishDate, setFinishDate] = useState(END_DATE);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
fetchData(START_DATE, END_DATE);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const fetchData = async (startDate, endDate) => {
|
|
||||||
const startDateToLocal =
|
|
||||||
startDate.getFullYear() +
|
|
||||||
'-' +
|
|
||||||
(startDate.getMonth() + 1 < 9 ? '0' + (startDate.getMonth() + 1) : startDate.getMonth() + 1) +
|
|
||||||
'-' +
|
|
||||||
(startDate.getDate() < 9 ? '0' + startDate.getDate() : startDate.getDate());
|
|
||||||
|
|
||||||
const endDateToLocal =
|
|
||||||
endDate.getFullYear() +
|
|
||||||
'-' +
|
|
||||||
(endDate.getMonth() + 1 < 9 ? '0' + (endDate.getMonth() + 1) : endDate.getMonth() + 1) +
|
|
||||||
'-' +
|
|
||||||
(endDate.getDate() < 9 ? '0' + endDate.getDate() : endDate.getDate());
|
|
||||||
|
|
||||||
setDataList(await DailyMedalView(token, startDateToLocal, endDateToLocal));
|
|
||||||
|
|
||||||
setSendDate(startDateToLocal);
|
|
||||||
setFinishDate(endDateToLocal);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 검색 함수
|
|
||||||
const handleSearch = (send_dt, end_dt) => {
|
|
||||||
fetchData(send_dt, end_dt);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 엑셀 다운로드
|
|
||||||
const handleXlsxExport = () => {
|
|
||||||
const fileName = 'Caliverse_Daily_Medal.xlsx';
|
|
||||||
//DailyActiveUserExport(token, fileName, sendDate, finishDate);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<DailySearchBar setResultData={setResultData} resultData={resultData} handleSearch={handleSearch} fetchData={fetchData} />
|
|
||||||
<TableInfo>
|
|
||||||
<ListOption>
|
|
||||||
<Button theme="line" text="엑셀 다운로드" handleClick={handleXlsxExport} />
|
|
||||||
</ListOption>
|
|
||||||
</TableInfo>
|
|
||||||
<IndexTableWrap>
|
|
||||||
<TableStyle>
|
|
||||||
<caption></caption>
|
|
||||||
<thead >
|
|
||||||
<tr>
|
|
||||||
<th rowSpan="1" width="20">
|
|
||||||
일자
|
|
||||||
</th>
|
|
||||||
<th colSpan="1" width="30">
|
|
||||||
UserID
|
|
||||||
</th>
|
|
||||||
<th colSpan="1" width="30">
|
|
||||||
닉네임
|
|
||||||
</th>
|
|
||||||
<th colSpan="1" width="30">
|
|
||||||
Item ID
|
|
||||||
</th>
|
|
||||||
<th colSpan="1" width="30">
|
|
||||||
획득량
|
|
||||||
</th>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
{(dataList || []).map((data, index) => (
|
|
||||||
<tr key={index}>
|
|
||||||
<td>{data.date}</td>
|
|
||||||
<td>{data.dau}</td>
|
|
||||||
<td>{data.dalc}</td>
|
|
||||||
<td>{data.dglc}</td>
|
|
||||||
<td>{data.maxAu}</td>
|
|
||||||
{Array.from({ length: 24 }, (_, i) => (
|
|
||||||
<td key={i}>{data['h' + i]}</td>
|
|
||||||
))}
|
|
||||||
</tr>
|
|
||||||
))}
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</TableStyle>
|
|
||||||
</IndexTableWrap>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default DailyMedalContent;
|
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { styled } from 'styled-components';
|
import { styled } from 'styled-components';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
import DecoSearchBar from '../../components/IndexManage/DecoSearchBar';
|
import DecoSearchBar from '../searchBar/DecoSearchBar';
|
||||||
import Button from '../../components/common/button/Button';
|
import Button from '../../components/common/button/Button';
|
||||||
|
|
||||||
import { TableStyle, TableInfo, ListOption } from '../../styles/Components';
|
import { TableStyle, TableInfo, ListOption } from '../../styles/Components';
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { useEffect, useState } from 'react';
|
|||||||
import { TableStyle, TableInfo, ListOption } from '../../styles/Components';
|
import { TableStyle, TableInfo, ListOption } from '../../styles/Components';
|
||||||
|
|
||||||
import Button from '../../components/common/button/Button';
|
import Button from '../../components/common/button/Button';
|
||||||
import InstanceSearchBar from '../../components/IndexManage/InstanceSearchBar';
|
import InstanceSearchBar from '../searchBar/InstanceSearchBar';
|
||||||
import { InstanceIndexExport, InstanceIndexView } from '../../apis';
|
import { InstanceIndexExport, InstanceIndexView } from '../../apis';
|
||||||
|
|
||||||
const InstanceContent = () => {
|
const InstanceContent = () => {
|
||||||
|
|||||||
152
src/components/IndexManage/ItemAcquireContent.js
Normal file
152
src/components/IndexManage/ItemAcquireContent.js
Normal file
@@ -0,0 +1,152 @@
|
|||||||
|
import React, { Fragment, useMemo, useRef } from 'react';
|
||||||
|
|
||||||
|
import {
|
||||||
|
TableStyle,
|
||||||
|
FormWrapper,
|
||||||
|
TableWrapper, ListOption, TextInput, TableInfoContent, Notice,
|
||||||
|
} from '../../styles/Components';
|
||||||
|
|
||||||
|
import { ItemAcquireIndexSearchBar, useItemAcquireIndexSearch } from '../searchBar';
|
||||||
|
import { TopButton, ViewTableInfo } from '../common';
|
||||||
|
import { TableSkeleton } from '../Skeleton/TableSkeleton';
|
||||||
|
import { numberFormatter } from '../../utils';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { AnimatedPageWrapper } from '../common/Layout';
|
||||||
|
import CSVDownloadButton from '../common/button/CsvDownButton';
|
||||||
|
|
||||||
|
const ItemAcquireContent = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const token = sessionStorage.getItem('token');
|
||||||
|
const tableRef = useRef(null);
|
||||||
|
|
||||||
|
const {
|
||||||
|
searchParams,
|
||||||
|
loading: dataLoading,
|
||||||
|
data: dataList,
|
||||||
|
handleSearch,
|
||||||
|
handleReset,
|
||||||
|
updateSearchParams
|
||||||
|
} = useItemAcquireIndexSearch(token);
|
||||||
|
|
||||||
|
const tableHeaders = useMemo(() => {
|
||||||
|
return [
|
||||||
|
{ id: 'logDay', label: '일자', width: '100px' },
|
||||||
|
{ id: 'mail', label: '우편', width: '80px' },
|
||||||
|
{ id: 'shopPurchase', label: '상점 구매', width: '80px' },
|
||||||
|
{ id: 'shopRePurchase', label: '상점 재구매', width: '80px' },
|
||||||
|
{ id: 'itemBuy', label: '아이템 구매', width: '80px' },
|
||||||
|
{ id: 'itemUse', label: '아이템 사용', width: '80px' },
|
||||||
|
{ id: 'seasonPass', label: '시즌 패스', width: '80px' },
|
||||||
|
{ id: 'claim', label: '클레임', width: '80px' },
|
||||||
|
{ id: 'quest', label: '퀘스트', width: '80px' },
|
||||||
|
{ id: 'ugq', label: 'UGQ', width: '80px' },
|
||||||
|
{ id: 'battleObject', label: '배틀맵', width: '80px' },
|
||||||
|
{ id: 'runRace', label: '런레이스', width: '80px' },
|
||||||
|
{ id: 'prop', label: '보급품 상자', width: '80px' },
|
||||||
|
{ id: 'randomBox', label: '랜덤박스', width: '80px' },
|
||||||
|
{ id: 'beacon', label: '비컨', width: '80px' },
|
||||||
|
{ id: 'beaconShop', label: '비컨 상점', width: '80px' },
|
||||||
|
{ id: 'myHome', label: '마이홈', width: '80px' },
|
||||||
|
{ id: 'craft', label: '크래프트', width: '80px' },
|
||||||
|
{ id: 'etc', label: '기타', width: '80px' },
|
||||||
|
{ id: 'summary', label: '합계', width: '80px' },
|
||||||
|
];
|
||||||
|
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AnimatedPageWrapper>
|
||||||
|
<FormWrapper>
|
||||||
|
<ItemAcquireIndexSearchBar
|
||||||
|
searchParams={searchParams}
|
||||||
|
onSearch={(newParams, executeSearch = true) => {
|
||||||
|
if (executeSearch) {
|
||||||
|
handleSearch(newParams);
|
||||||
|
} else {
|
||||||
|
updateSearchParams(newParams);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onReset={handleReset}
|
||||||
|
/>
|
||||||
|
</FormWrapper>
|
||||||
|
<ViewTableInfo >
|
||||||
|
{dataList?.item_list && dataList.item_list.length > 0 &&
|
||||||
|
<TableInfoContent>
|
||||||
|
<TextInput
|
||||||
|
type="text"
|
||||||
|
value={dataList.item_list[0].itemId}
|
||||||
|
width="100px"
|
||||||
|
readOnly
|
||||||
|
/>
|
||||||
|
<TextInput
|
||||||
|
type="text"
|
||||||
|
value={dataList.item_list[0].itemName}
|
||||||
|
width="150px"
|
||||||
|
readOnly
|
||||||
|
/>
|
||||||
|
<Notice $color='#F15F5F'>* 확인되지 않은 액션이 있을 수 있습니다</Notice>
|
||||||
|
</TableInfoContent>
|
||||||
|
}
|
||||||
|
<ListOption>
|
||||||
|
<CSVDownloadButton tableRef={tableRef} fileName={t('FILE_INDEX_ITEM_ACQUIRE')} />
|
||||||
|
</ListOption>
|
||||||
|
</ViewTableInfo>
|
||||||
|
{dataLoading ? <TableSkeleton width='100%' count={15} /> :
|
||||||
|
<>
|
||||||
|
<TableWrapper>
|
||||||
|
<TableStyle ref={tableRef}>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
{tableHeaders.map(header => {
|
||||||
|
return (
|
||||||
|
<th
|
||||||
|
key={header.id}
|
||||||
|
width={header.width}
|
||||||
|
colSpan={header.colSpan}
|
||||||
|
>
|
||||||
|
{header.label}
|
||||||
|
</th>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
{dataList?.item_list?.map((item, index) => (
|
||||||
|
<Fragment key={index}>
|
||||||
|
<tr>
|
||||||
|
<td>{item.logDay}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.MailTaken)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.ShopPurchase)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.ShopRePurchase)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.ItemBuy)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.ItemUse)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.SeasonPassTakeReward)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.ClaimReward)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency((item.actionSummary.QuestMainReward || 0) + (item.actionSummary.QuestTaskUpdate || 0) + (item.actionSummary.QuestMainTask || 0))}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.UgqAbort)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency((item.actionSummary.BattleRoundStateUpdate || 0) + (item.actionSummary.BattlePodCombatOccupyReward || 0) + (item.actionSummary.BattleObjectInteraction || 0))}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency((item.actionSummary.RunRaceFinishReward || 0) + (item.actionSummary.RunRaceRespawnReward || 0))}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.RewardProp)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.ItemRandomBoxUse)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency((item.actionSummary.BeaconCreate || 0) + (item.actionSummary.BeaconEdit || 0))}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency((item.actionSummary.BeaconShopPurchaseItem || 0))}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency((item.actionSummary.DeleteMyhome || 0) + (item.actionSummary.SaveMyhome || 0))}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency((item.actionSummary.CraftFinish || 0) + (item.actionSummary.CraftStop || 0))}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency((item.actionSummary.CheatCommandItem || 0) + (item.actionSummary.CharacterAppearanceUpdate || 0)
|
||||||
|
+ (item.actionSummary.ItemTattooLevelUp || 0) + (item.actionSummary.UserCreate || 0) + (item.actionSummary.JoinInstance || 0))}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.totalDeltaCount)}</td>
|
||||||
|
</tr>
|
||||||
|
</Fragment>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</TableStyle>
|
||||||
|
</TableWrapper>
|
||||||
|
<TopButton />
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</AnimatedPageWrapper>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ItemAcquireContent;
|
||||||
119
src/components/IndexManage/ItemAssetsContent.js
Normal file
119
src/components/IndexManage/ItemAssetsContent.js
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
import React, { Fragment, useMemo, useRef } from 'react';
|
||||||
|
|
||||||
|
import {
|
||||||
|
TableStyle,
|
||||||
|
FormWrapper,
|
||||||
|
TableWrapper, ListOption
|
||||||
|
} from '../../styles/Components';
|
||||||
|
|
||||||
|
import {
|
||||||
|
AssetsIndexSearchBar, useAssetsIndexSearch,
|
||||||
|
} from '../searchBar';
|
||||||
|
import { TopButton, ViewTableInfo } from '../common';
|
||||||
|
import { TableSkeleton } from '../Skeleton/TableSkeleton';
|
||||||
|
import { numberFormatter } from '../../utils';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { AnimatedPageWrapper } from '../common/Layout';
|
||||||
|
import CSVDownloadButton from '../common/button/CsvDownButton';
|
||||||
|
import DailyDashBoard from './DailyCaliumDashBoard';
|
||||||
|
|
||||||
|
const ItemAssetsContent = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const token = sessionStorage.getItem('token');
|
||||||
|
const tableRef = useRef(null);
|
||||||
|
|
||||||
|
const {
|
||||||
|
searchParams,
|
||||||
|
loading: dataLoading,
|
||||||
|
data: dataList,
|
||||||
|
handleSearch,
|
||||||
|
handleReset,
|
||||||
|
updateSearchParams
|
||||||
|
} = useAssetsIndexSearch(token);
|
||||||
|
|
||||||
|
const tableHeaders = useMemo(() => {
|
||||||
|
return [
|
||||||
|
{ id: 'logDay', label: '일자', width: '100px' },
|
||||||
|
{ id: 'userCount', label: '유저수', width: '100px' },
|
||||||
|
{ id: 'item_13080002', label: '퀘스트 메달', width: '100px' },
|
||||||
|
{ id: 'item_13080004', label: '보급품 메달', width: '100px' },
|
||||||
|
{ id: 'item_13080005', label: '제작 메달', width: '100px' },
|
||||||
|
{ id: 'item_13080006', label: '에테론 315 포드', width: '100px' },
|
||||||
|
{ id: 'item_13080007', label: '에테론 316 포드', width: '100px' },
|
||||||
|
{ id: 'item_13080008', label: '에테론 317 포드', width: '100px' },
|
||||||
|
{ id: 'item_13080009', label: '에테론 318 포드', width: '100px' },
|
||||||
|
{ id: 'item_11570001', label: '강화 잉크', width: '100px' },
|
||||||
|
{ id: 'item_11570002', label: '연성 잉크', width: '100px' }
|
||||||
|
];
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AnimatedPageWrapper>
|
||||||
|
<DailyDashBoard />
|
||||||
|
<FormWrapper>
|
||||||
|
<AssetsIndexSearchBar
|
||||||
|
searchParams={searchParams}
|
||||||
|
onSearch={(newParams, executeSearch = true) => {
|
||||||
|
if (executeSearch) {
|
||||||
|
handleSearch(newParams);
|
||||||
|
} else {
|
||||||
|
updateSearchParams(newParams);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onReset={handleReset}
|
||||||
|
/>
|
||||||
|
</FormWrapper>
|
||||||
|
<ViewTableInfo >
|
||||||
|
<ListOption>
|
||||||
|
<CSVDownloadButton tableRef={tableRef} fileName={t('FILE_INDEX_ASSETS_ITEM')} />
|
||||||
|
</ListOption>
|
||||||
|
</ViewTableInfo>
|
||||||
|
{dataLoading ? <TableSkeleton width='100%' count={15} /> :
|
||||||
|
<>
|
||||||
|
<TableWrapper>
|
||||||
|
<TableStyle ref={tableRef}>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
{tableHeaders.map(header => {
|
||||||
|
return (
|
||||||
|
<th
|
||||||
|
key={header.id}
|
||||||
|
width={header.width}
|
||||||
|
colSpan={header.colSpan}
|
||||||
|
>
|
||||||
|
{header.label}
|
||||||
|
</th>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
{dataList?.assets_list?.map((data, index) => (
|
||||||
|
<Fragment key={index}>
|
||||||
|
<tr>
|
||||||
|
<td>{data.logDay}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(data.userCount)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(data.item_13080002)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(data.item_13080004)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(data.item_13080005)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(data.item_13080006)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(data.item_13080007)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(data.item_13080008)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(data.item_13080009)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(data.item_11570001)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(data.item_11570002)}</td>
|
||||||
|
</tr>
|
||||||
|
</Fragment>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</TableStyle>
|
||||||
|
</TableWrapper>
|
||||||
|
<TopButton />
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</AnimatedPageWrapper>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ItemAssetsContent;
|
||||||
143
src/components/IndexManage/ItemConsumeContent.js
Normal file
143
src/components/IndexManage/ItemConsumeContent.js
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
import React, { Fragment, useMemo, useRef } from 'react';
|
||||||
|
|
||||||
|
import {
|
||||||
|
TableStyle,
|
||||||
|
FormWrapper,
|
||||||
|
TableWrapper, ListOption, TableInfoContent, TextInput, Label, Notice,
|
||||||
|
} from '../../styles/Components';
|
||||||
|
|
||||||
|
import {
|
||||||
|
ItemAcquireIndexSearchBar,
|
||||||
|
ItemConsumeIndexSearchBar,
|
||||||
|
useItemAcquireIndexSearch,
|
||||||
|
useItemConsumeIndexSearch,
|
||||||
|
} from '../searchBar';
|
||||||
|
import { TopButton, ViewTableInfo } from '../common';
|
||||||
|
import { TableSkeleton } from '../Skeleton/TableSkeleton';
|
||||||
|
import { numberFormatter } from '../../utils';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { AnimatedPageWrapper } from '../common/Layout';
|
||||||
|
import CSVDownloadButton from '../common/button/CsvDownButton';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
|
||||||
|
const ItemConsumeContent = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const token = sessionStorage.getItem('token');
|
||||||
|
const tableRef = useRef(null);
|
||||||
|
|
||||||
|
const {
|
||||||
|
searchParams,
|
||||||
|
loading: dataLoading,
|
||||||
|
data: dataList,
|
||||||
|
handleSearch,
|
||||||
|
handleReset,
|
||||||
|
updateSearchParams
|
||||||
|
} = useItemConsumeIndexSearch(token);
|
||||||
|
|
||||||
|
const tableHeaders = useMemo(() => {
|
||||||
|
return [
|
||||||
|
{ id: 'logDay', label: '일자', width: '100px' },
|
||||||
|
{ id: 'shopSell', label: '상점 판매', width: '80px' },
|
||||||
|
{ id: 'itemUse', label: '아이템 사용', width: '80px' },
|
||||||
|
{ id: 'beaconShop', label: '비컨상점', width: '80px' },
|
||||||
|
{ id: 'beacon', label: '비컨', width: '80px' },
|
||||||
|
{ id: 'quest', label: '퀘스트', width: '80px' },
|
||||||
|
{ id: 'ugq', label: 'UGQ', width: '80px' },
|
||||||
|
{ id: 'randomBox', label: '랜덤박스', width: '80px' },
|
||||||
|
{ id: 'myHome', label: '마이홈', width: '80px' },
|
||||||
|
{ id: 'craft', label: '크래프트', width: '80px' },
|
||||||
|
{ id: 'etc', label: '기타', width: '80px' },
|
||||||
|
{ id: 'summary', label: '합계', width: '80px' },
|
||||||
|
];
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AnimatedPageWrapper>
|
||||||
|
<FormWrapper>
|
||||||
|
<ItemConsumeIndexSearchBar
|
||||||
|
searchParams={searchParams}
|
||||||
|
onSearch={(newParams, executeSearch = true) => {
|
||||||
|
if (executeSearch) {
|
||||||
|
handleSearch(newParams);
|
||||||
|
} else {
|
||||||
|
updateSearchParams(newParams);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onReset={handleReset}
|
||||||
|
/>
|
||||||
|
</FormWrapper>
|
||||||
|
<ViewTableInfo >
|
||||||
|
{dataList?.item_list && dataList.item_list.length > 0 &&
|
||||||
|
<TableInfoContent>
|
||||||
|
<TextInput
|
||||||
|
type="text"
|
||||||
|
value={dataList.item_list[0].itemId}
|
||||||
|
width="100px"
|
||||||
|
readOnly
|
||||||
|
/>
|
||||||
|
<TextInput
|
||||||
|
type="text"
|
||||||
|
value={dataList.item_list[0].itemName}
|
||||||
|
width="300px"
|
||||||
|
readOnly
|
||||||
|
/>
|
||||||
|
<Notice $color='#F15F5F'>* 확인되지 않은 액션이 있을 수 있습니다</Notice>
|
||||||
|
</TableInfoContent>
|
||||||
|
}
|
||||||
|
<ListOption>
|
||||||
|
<CSVDownloadButton tableRef={tableRef} fileName={t('FILE_INDEX_ITEM_CONSUME')} />
|
||||||
|
</ListOption>
|
||||||
|
</ViewTableInfo>
|
||||||
|
{dataLoading ? <TableSkeleton width='100%' count={15} /> :
|
||||||
|
<>
|
||||||
|
<TableWrapper>
|
||||||
|
<TableStyle ref={tableRef}>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
{tableHeaders.map(header => {
|
||||||
|
return (
|
||||||
|
<th
|
||||||
|
key={header.id}
|
||||||
|
width={header.width}
|
||||||
|
colSpan={header.colSpan}
|
||||||
|
>
|
||||||
|
{header.label}
|
||||||
|
</th>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
{dataList?.item_list?.map((item, index) => (
|
||||||
|
<Fragment key={index}>
|
||||||
|
<tr>
|
||||||
|
<td>{item.logDay}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.ShopSell)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.ItemUse)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency((item.actionSummary.BeaconShopRegisterItem || 0))}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency((item.actionSummary.BeaconEdit || 0) + (item.actionSummary.BeaconCreate || 0))}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency((item.actionSummary.QuestTaskUpdate || 0))}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.UgqAbort)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.actionSummary.ItemRandomBoxUse)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency((item.actionSummary.SaveMyhome || 0))}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency((item.actionSummary.CraftStart || 0))}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(
|
||||||
|
(item.actionSummary.SummonParty || 0) + (item.actionSummary.ItemDestroy || 0) + (item.actionSummary.CreatePartyInstance || 0) + (item.actionSummary.ItemTattooChangeAttribute || 0)
|
||||||
|
+ (item.actionSummary.CheatCommandItem || 0) + (item.actionSummary.ItemDestoryByExpiration || 0) + (item.actionSummary.ItemDestroyByUser || 0) + (item.actionSummary.ItemTattooLevelUp || 0)
|
||||||
|
)}</td>
|
||||||
|
<td>{numberFormatter.formatCurrency(item.totalDeltaCount)}</td>
|
||||||
|
</tr>
|
||||||
|
</Fragment>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</TableStyle>
|
||||||
|
</TableWrapper>
|
||||||
|
<TopButton />
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
</AnimatedPageWrapper>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ItemConsumeContent;
|
||||||
@@ -5,7 +5,7 @@ import Button from '../../components/common/button/Button';
|
|||||||
|
|
||||||
import { SelectInput, TableStyle, TableInfo, ListOption, InputLabel, InputGroup } from '../../styles/Components';
|
import { SelectInput, TableStyle, TableInfo, ListOption, InputLabel, InputGroup } from '../../styles/Components';
|
||||||
|
|
||||||
import ItemSearchBar from '../../components/IndexManage/ItemSearchBar';
|
import ItemSearchBar from '../searchBar/ItemSearchBar';
|
||||||
import { ItemIndexExport, ItemIndexView } from '../../apis';
|
import { ItemIndexExport, ItemIndexView } from '../../apis';
|
||||||
|
|
||||||
const ItemContent = () => {
|
const ItemContent = () => {
|
||||||
|
|||||||
@@ -1,112 +0,0 @@
|
|||||||
import { Fragment, useEffect, useState } from 'react';
|
|
||||||
|
|
||||||
import Button from '../../components/common/button/Button';
|
|
||||||
|
|
||||||
import { TableStyle, TableInfo, ListOption, IndexTableWrap } from '../../styles/Components';
|
|
||||||
import { PlayTimeSearchBar } from '../../components/IndexManage/index';
|
|
||||||
import { PlaytimeIndexExport, PlaytimeIndexView } from '../../apis';
|
|
||||||
|
|
||||||
const PlayTimeContent = () => {
|
|
||||||
const token = sessionStorage.getItem('token');
|
|
||||||
let d = new Date();
|
|
||||||
const START_DATE = new Date(new Date(d.setDate(d.getDate() - 1)).setHours(0, 0, 0, 0));
|
|
||||||
const END_DATE = new Date();
|
|
||||||
|
|
||||||
const [dataList, setDataList] = useState([]);
|
|
||||||
const [resultData, setResultData] = useState([]);
|
|
||||||
|
|
||||||
const [sendDate, setSendDate] = useState(START_DATE);
|
|
||||||
const [finishDate, setFinishDate] = useState(END_DATE);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
fetchData(START_DATE, END_DATE);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
// 이용자 지표 데이터
|
|
||||||
const fetchData = async (startDate, endDate) => {
|
|
||||||
const startDateToLocal =
|
|
||||||
startDate.getFullYear() +
|
|
||||||
'-' +
|
|
||||||
(startDate.getMonth() + 1 < 9 ? '0' + (startDate.getMonth() + 1) : startDate.getMonth() + 1) +
|
|
||||||
'-' +
|
|
||||||
(startDate.getDate() < 9 ? '0' + startDate.getDate() : startDate.getDate());
|
|
||||||
|
|
||||||
const endDateToLocal =
|
|
||||||
endDate.getFullYear() +
|
|
||||||
'-' +
|
|
||||||
(endDate.getMonth() + 1 < 9 ? '0' + (endDate.getMonth() + 1) : endDate.getMonth() + 1) +
|
|
||||||
'-' +
|
|
||||||
(endDate.getDate() < 9 ? '0' + endDate.getDate() : endDate.getDate());
|
|
||||||
|
|
||||||
setDataList(await PlaytimeIndexView(token, startDateToLocal, endDateToLocal));
|
|
||||||
|
|
||||||
setSendDate(startDateToLocal);
|
|
||||||
setFinishDate(endDateToLocal);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 검색 함수
|
|
||||||
const handleSearch = (send_dt, end_dt) => {
|
|
||||||
fetchData(send_dt, end_dt);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 엑셀 다운로드
|
|
||||||
const handleXlsxExport = () => {
|
|
||||||
const fileName = 'Caliverse_PlayTime_Index.xlsx';
|
|
||||||
PlaytimeIndexExport(token, fileName, sendDate, finishDate);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<PlayTimeSearchBar setResultData={setResultData} resultData={resultData} handleSearch={handleSearch} fetchData={fetchData} />
|
|
||||||
<TableInfo>
|
|
||||||
<ListOption>
|
|
||||||
<Button theme="line" text="엑셀 다운로드" handleClick={handleXlsxExport} />
|
|
||||||
</ListOption>
|
|
||||||
</TableInfo>
|
|
||||||
<IndexTableWrap>
|
|
||||||
<TableStyle>
|
|
||||||
<caption></caption>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th rowSpan="2" width="140">
|
|
||||||
일자
|
|
||||||
</th>
|
|
||||||
<th colSpan="4" width="520">
|
|
||||||
유저수
|
|
||||||
</th>
|
|
||||||
<th rowSpan="2" width="160">
|
|
||||||
총 누적 플레이타임(분)
|
|
||||||
</th>
|
|
||||||
<th rowSpan="2" width="160">
|
|
||||||
1인당 평균 플레이타임(분)
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th>30분 이내</th>
|
|
||||||
<th>30분 ~ 1시간</th>
|
|
||||||
<th>1시간 ~ 3시간</th>
|
|
||||||
<th>3시간 이상</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{dataList.playtime &&
|
|
||||||
dataList.playtime.map(time => (
|
|
||||||
<tr key={time.date}>
|
|
||||||
<td>{time.date}</td>
|
|
||||||
{time.user_cnt.map((cnt, index) => (
|
|
||||||
<td className="text-left" key={index}>
|
|
||||||
{cnt}
|
|
||||||
</td>
|
|
||||||
))}
|
|
||||||
<td className="text-left">{time.total_time}</td>
|
|
||||||
<td className="text-left">{time.average_time}</td>
|
|
||||||
</tr>
|
|
||||||
))}
|
|
||||||
</tbody>
|
|
||||||
</TableStyle>
|
|
||||||
</IndexTableWrap>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default PlayTimeContent;
|
|
||||||
@@ -1,108 +1,76 @@
|
|||||||
import { Fragment, useEffect, useState } from 'react';
|
import React, { Fragment, useRef } from 'react';
|
||||||
|
|
||||||
import Button from '../../components/common/button/Button';
|
|
||||||
|
|
||||||
import { TableStyle, TableInfo, ListOption, IndexTableWrap } from '../../styles/Components';
|
import { TableStyle, TableInfo, ListOption, IndexTableWrap } from '../../styles/Components';
|
||||||
import { RetentionSearchBar } from '../../components/IndexManage/index';
|
import { AnimatedPageWrapper } from '../common/Layout';
|
||||||
import { RetentionIndexExport, RetentionIndexView } from '../../apis';
|
import { useRetentionSearch, RetentionSearchBar } from '../searchBar';
|
||||||
|
import { TableSkeleton } from '../Skeleton/TableSkeleton';
|
||||||
|
import { numberFormatter } from '../../utils';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import CSVDownloadButton from '../common/button/CsvDownButton';
|
||||||
|
|
||||||
const RetentionContent = () => {
|
const RetentionContent = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const tableRef = useRef(null);
|
||||||
const token = sessionStorage.getItem('token');
|
const token = sessionStorage.getItem('token');
|
||||||
let d = new Date();
|
|
||||||
const START_DATE = new Date(new Date(d.setDate(d.getDate() - 1)).setHours(0, 0, 0, 0));
|
|
||||||
const END_DATE = new Date(new Date(d.setDate(d.getDate() - 1)).setHours(24, 0, 0, 0));
|
|
||||||
|
|
||||||
const [dataList, setDataList] = useState([]);
|
const {
|
||||||
const [resultData, setResultData] = useState([]);
|
searchParams,
|
||||||
const [retentionData, setRetention] = useState(1);
|
loading: dataLoading,
|
||||||
|
data: dataList,
|
||||||
|
handleSearch,
|
||||||
|
handleReset,
|
||||||
|
updateSearchParams
|
||||||
|
} = useRetentionSearch(token);
|
||||||
|
|
||||||
const [sendDate, setSendDate] = useState(START_DATE);
|
|
||||||
const [finishDate, setFinishDate] = useState(END_DATE);
|
|
||||||
const [excelBtn, setExcelBtn] = useState(true); //true 시 비활성화
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
fetchData(START_DATE, END_DATE);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
// Retention 지표 데이터
|
|
||||||
const fetchData = async (startDate, endDate) => {
|
|
||||||
const startDateToLocal =
|
|
||||||
startDate.getFullYear() +
|
|
||||||
'-' +
|
|
||||||
(startDate.getMonth() + 1 < 9 ? '0' + (startDate.getMonth() + 1) : startDate.getMonth() + 1) +
|
|
||||||
'-' +
|
|
||||||
(startDate.getDate() < 9 ? '0' + startDate.getDate() : startDate.getDate());
|
|
||||||
|
|
||||||
const endDateToLocal =
|
|
||||||
endDate.getFullYear() +
|
|
||||||
'-' +
|
|
||||||
(endDate.getMonth() + 1 < 9 ? '0' + (endDate.getMonth() + 1) : endDate.getMonth() + 1) +
|
|
||||||
'-' +
|
|
||||||
(endDate.getDate() < 9 ? '0' + endDate.getDate() : endDate.getDate());
|
|
||||||
|
|
||||||
setDataList(await RetentionIndexView(token, startDateToLocal, endDateToLocal));
|
|
||||||
|
|
||||||
console.log(dataList);
|
|
||||||
|
|
||||||
setSendDate(startDateToLocal);
|
|
||||||
setFinishDate(endDateToLocal);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 검색 함수
|
|
||||||
const handleSearch = (send_dt, end_dt) => {
|
|
||||||
fetchData(send_dt, end_dt);
|
|
||||||
setRetention(resultData.retention);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 엑셀 다운로드
|
|
||||||
const handleXlsxExport = () => {
|
|
||||||
const fileName = 'Caliverse_Retention_Index.xlsx';
|
|
||||||
|
|
||||||
if(!excelBtn){
|
|
||||||
RetentionIndexExport(token, fileName, sendDate, finishDate);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<AnimatedPageWrapper>
|
||||||
<RetentionSearchBar setResultData={setResultData} resultData={resultData}
|
<RetentionSearchBar
|
||||||
handleSearch={handleSearch} fetchData={fetchData} setRetention={setRetention} setExcelBtn={setExcelBtn} />
|
searchParams={searchParams}
|
||||||
|
onSearch={(newParams, executeSearch = true) => {
|
||||||
|
if (executeSearch) {
|
||||||
|
handleSearch(newParams);
|
||||||
|
} else {
|
||||||
|
updateSearchParams(newParams);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onReset={handleReset}
|
||||||
|
/>
|
||||||
<TableInfo>
|
<TableInfo>
|
||||||
<ListOption>
|
<ListOption>
|
||||||
<Button
|
<CSVDownloadButton tableRef={tableRef} fileName={t('FILE_INDEX_USER_RETENTION')} />
|
||||||
theme={excelBtn === true ? "disable" : "line"}
|
|
||||||
text="엑셀 다운로드"
|
|
||||||
disabled={handleXlsxExport}
|
|
||||||
handleClick={handleXlsxExport} />
|
|
||||||
</ListOption>
|
</ListOption>
|
||||||
</TableInfo>
|
</TableInfo>
|
||||||
<IndexTableWrap>
|
{dataLoading ? <TableSkeleton width='100%' count={15} /> :
|
||||||
<TableStyle>
|
<IndexTableWrap>
|
||||||
<caption></caption>
|
<TableStyle ref={tableRef}>
|
||||||
<thead>
|
<caption></caption>
|
||||||
<tr>
|
<thead>
|
||||||
{/* <th width="100">국가</th> */}
|
<tr>
|
||||||
<th width="150">일자</th>
|
<th>일자</th>
|
||||||
<th className="cell-nru">NRU</th>
|
<th>NRU</th>
|
||||||
{[...Array(Number(retentionData))].map((value, index) => {
|
<th>D+1</th>
|
||||||
return <th key={index}>{`D+${index + 1}`}</th>;
|
<th>D+7</th>
|
||||||
})}
|
<th>D+30</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{dataList.retention &&
|
{dataList?.map((data, index) => (
|
||||||
dataList.retention.map(data => (
|
<Fragment key={index}>
|
||||||
<tr className="cell-nru-th" key={data.date}>
|
<tr>
|
||||||
<td>{data.date}</td>
|
<td>{data.logDay}</td>
|
||||||
{data['d-day'].map((day, index) => (
|
<td>{data.totalCreated}</td>
|
||||||
<td key={index}>{day.dif}</td>
|
<td>{numberFormatter.formatPercent(data.d1_rate)}</td>
|
||||||
))}
|
<td>{numberFormatter.formatPercent(data.d7_rate)}</td>
|
||||||
</tr>
|
<td>{numberFormatter.formatPercent(data.d30_rate)}</td>
|
||||||
))}
|
</tr>
|
||||||
</tbody>
|
</Fragment>
|
||||||
</TableStyle>
|
))}
|
||||||
</IndexTableWrap>
|
</tbody>
|
||||||
</>
|
</TableStyle>
|
||||||
|
</IndexTableWrap>
|
||||||
|
}
|
||||||
|
</AnimatedPageWrapper>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,166 +0,0 @@
|
|||||||
import { useEffect, useState } from 'react';
|
|
||||||
import { styled } from 'styled-components';
|
|
||||||
import Button from '../../components/common/button/Button';
|
|
||||||
import DatePickerComponent from '../common/Date/DatePickerComponent';
|
|
||||||
|
|
||||||
import { FormWrapper, InputLabel, TextInput, SelectInput, BtnWrapper, InputGroup, DatePickerWrapper, AlertText } from '../../styles/Components';
|
|
||||||
|
|
||||||
const RetentionSearchBar = ({ resultData, setResultData, handleSearch, fetchData, setRetention, setExcelBtn }) => {
|
|
||||||
// 초기 날짜 세팅
|
|
||||||
let d = new Date();
|
|
||||||
const START_DATE = new Date(new Date(d.setDate(d.getDate() - 1)).setHours(0, 0, 0, 0));
|
|
||||||
const END_DATE = new Date(new Date(d.setDate(d.getDate() - 1)).setHours(24, 0, 0, 0));
|
|
||||||
const [errorMessage, setErrorMessage] = useState('');
|
|
||||||
const [period, setPeriod] = useState(0);
|
|
||||||
|
|
||||||
// resultData에 임의 날짜 넣어주기
|
|
||||||
useEffect(() => {
|
|
||||||
setResultData({
|
|
||||||
send_dt: START_DATE,
|
|
||||||
end_dt: '',
|
|
||||||
retention: 0,
|
|
||||||
});
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
// 발송 날짜 세팅 로직
|
|
||||||
const handleSelectedDate = data => {
|
|
||||||
const sendDate = new Date(data);
|
|
||||||
const resultSendData = new Date(sendDate.getFullYear(), sendDate.getMonth(), sendDate.getDate());
|
|
||||||
|
|
||||||
const resultEndDate = new Date(resultSendData);
|
|
||||||
resultEndDate.setDate(resultEndDate.getDate() + Number(resultData.retention));
|
|
||||||
|
|
||||||
setResultData({ ...resultData, send_dt: resultSendData, end_dt: resultEndDate });
|
|
||||||
};
|
|
||||||
|
|
||||||
// // 발송 날짜 세팅 로직
|
|
||||||
// const handleEndDate = data => {
|
|
||||||
// const endDate = new Date(data);
|
|
||||||
// const resultSendData = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate());
|
|
||||||
|
|
||||||
// setResultData({ ...resultData, end_dt: resultSendData });
|
|
||||||
// };
|
|
||||||
|
|
||||||
// Retention 세팅 로직
|
|
||||||
const handleRetention = e => {
|
|
||||||
const value = e.target.value;
|
|
||||||
|
|
||||||
const resultEndDate = new Date(resultData.send_dt);
|
|
||||||
resultEndDate.setDate(resultEndDate.getDate() + Number(value));
|
|
||||||
|
|
||||||
setResultData({ ...resultData, end_dt: resultEndDate, retention: value });
|
|
||||||
setPeriod(value);
|
|
||||||
};
|
|
||||||
|
|
||||||
//Retention 범위 선택 후 disable 처리 로직
|
|
||||||
const handleSearchBtn = e => {
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
if(period == 0) {
|
|
||||||
setErrorMessage("필수값을 선택하세요.");
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
setErrorMessage("");
|
|
||||||
setExcelBtn(false); //활성화
|
|
||||||
handleSearch(resultData.send_dt, resultData.end_dt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleReset = e => {
|
|
||||||
e.preventDefault();
|
|
||||||
setResultData({ send_dt: START_DATE, end_dt: '', retention: 0 });
|
|
||||||
setRetention(1);
|
|
||||||
setErrorMessage("");
|
|
||||||
setPeriod(1);
|
|
||||||
setExcelBtn(true); //비활성화
|
|
||||||
|
|
||||||
fetchData(START_DATE, END_DATE);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<FormWrapper>
|
|
||||||
<SearchbarStyle>
|
|
||||||
<SearchItem>
|
|
||||||
<InputLabel>집계 기준일</InputLabel>
|
|
||||||
<InputGroup>
|
|
||||||
<DatePickerWrapper>
|
|
||||||
<DatePickerComponent
|
|
||||||
name="시작 일자" selectedDate={resultData.send_dt}
|
|
||||||
handleSelectedDate={data => handleSelectedDate(data)}
|
|
||||||
maxDate={new Date()} />
|
|
||||||
<span>~</span>
|
|
||||||
<DatePickerComponent
|
|
||||||
name="종료 일자"
|
|
||||||
selectedDate={resultData.end_dt}
|
|
||||||
maxDate={new Date()}
|
|
||||||
readOnly={true}
|
|
||||||
disabled={true}
|
|
||||||
type="retention" />
|
|
||||||
</DatePickerWrapper>
|
|
||||||
</InputGroup>
|
|
||||||
</SearchItem>
|
|
||||||
<SearchItem>
|
|
||||||
<InputLabel>Retention 범위</InputLabel>
|
|
||||||
<SelectInput
|
|
||||||
onChange={e => handleRetention(e)} value={resultData.retention}>
|
|
||||||
<option value={0}>선택</option>
|
|
||||||
<option value={1}>D+1</option>
|
|
||||||
<option value={7}>D+7</option>
|
|
||||||
<option value={30}>D+30</option>
|
|
||||||
</SelectInput>
|
|
||||||
</SearchItem>
|
|
||||||
{/* 기획 보류 */}
|
|
||||||
{/* <SearchItem>
|
|
||||||
<InputLabel>조회 국가</InputLabel>
|
|
||||||
<SelectInput>
|
|
||||||
<option value="">ALL</option>
|
|
||||||
<option value="">KR</option>
|
|
||||||
<option value="">EN</option>
|
|
||||||
<option value="">JP</option>
|
|
||||||
<option value="">TH</option>
|
|
||||||
</SelectInput>
|
|
||||||
</SearchItem> */}
|
|
||||||
<BtnWrapper $gap="8px">
|
|
||||||
<Button theme="reset" handleClick={handleReset} />
|
|
||||||
<Button
|
|
||||||
theme="search"
|
|
||||||
text="검색"
|
|
||||||
handleClick={handleSearchBtn}
|
|
||||||
/>
|
|
||||||
<AlertText>{errorMessage}</AlertText>
|
|
||||||
</BtnWrapper>
|
|
||||||
</SearchbarStyle>
|
|
||||||
</FormWrapper>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default RetentionSearchBar;
|
|
||||||
|
|
||||||
const SearchbarStyle = styled.div`
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 20px 0;
|
|
||||||
font-size: 14px;
|
|
||||||
padding: 20px;
|
|
||||||
border-top: 1px solid #000;
|
|
||||||
border-bottom: 1px solid #000;
|
|
||||||
margin-bottom: 40px;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const SearchItem = styled.div`
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 20px;
|
|
||||||
margin-right: 50px;
|
|
||||||
|
|
||||||
${TextInput}, ${SelectInput} {
|
|
||||||
height: 35px;
|
|
||||||
}
|
|
||||||
${TextInput} {
|
|
||||||
padding: 0 10px;
|
|
||||||
max-width: 400px;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
import { Fragment, useEffect, useState } from 'react';
|
|
||||||
|
|
||||||
import Button from '../../components/common/button/Button';
|
|
||||||
|
|
||||||
import { TableStyle, TableInfo, ListOption, IndexTableWrap } from '../../styles/Components';
|
|
||||||
import { SegmentSearchBar } from '../../components/IndexManage/index';
|
|
||||||
import { SegmentIndexExport, SegmentIndexView } from '../../apis';
|
|
||||||
|
|
||||||
const SegmentContent = () => {
|
|
||||||
const token = sessionStorage.getItem('token');
|
|
||||||
const END_DATE = new Date();
|
|
||||||
|
|
||||||
const [dataList, setDataList] = useState([]);
|
|
||||||
const [resultData, setResultData] = useState([]);
|
|
||||||
|
|
||||||
const [finishDate, setFinishDate] = useState(END_DATE);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
fetchData(END_DATE);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
// Retention 지표 데이터
|
|
||||||
const fetchData = async endDate => {
|
|
||||||
const endDateToLocal =
|
|
||||||
endDate.getFullYear() +
|
|
||||||
'-' +
|
|
||||||
(endDate.getMonth() + 1 < 9 ? '0' + (endDate.getMonth() + 1) : endDate.getMonth() + 1) +
|
|
||||||
'-' +
|
|
||||||
(endDate.getDate() < 9 ? '0' + endDate.getDate() : endDate.getDate());
|
|
||||||
|
|
||||||
setDataList(await SegmentIndexView(token, endDateToLocal));
|
|
||||||
setFinishDate(endDateToLocal);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 검색 함수
|
|
||||||
const handleSearch = end_dt => {
|
|
||||||
fetchData(end_dt);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 엑셀 다운로드
|
|
||||||
const handleXlsxExport = () => {
|
|
||||||
const fileName = 'Caliverse_Segment_Index.xlsx';
|
|
||||||
SegmentIndexExport(token, fileName, finishDate);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<SegmentSearchBar setResultData={setResultData} resultData={resultData} handleSearch={handleSearch} fetchData={fetchData} />
|
|
||||||
<TableInfo>
|
|
||||||
<ListOption>
|
|
||||||
<Button theme="line" text="엑셀 다운로드" handleClick={handleXlsxExport} />
|
|
||||||
</ListOption>
|
|
||||||
</TableInfo>
|
|
||||||
<IndexTableWrap>
|
|
||||||
<TableStyle>
|
|
||||||
<caption></caption>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th colSpan="1" width="200">
|
|
||||||
{dataList && dataList.start_dt} ~ {dataList && dataList.end_dt}
|
|
||||||
</th>
|
|
||||||
<th colSpan="2" width="400">
|
|
||||||
KIP
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
{/* <th>국가</th> */}
|
|
||||||
<th>세그먼트 분류</th>
|
|
||||||
<th>AU</th>
|
|
||||||
<th>AU Percentage by User Segment (%)</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{dataList && dataList.segment &&
|
|
||||||
dataList.segment.map((segment, index) => (
|
|
||||||
<tr key={index}>
|
|
||||||
{/* <td rowSpan="6">TH</td> */}
|
|
||||||
<td>{segment.type}</td>
|
|
||||||
<td>{segment.au}</td>
|
|
||||||
<td>{segment.dif}</td>
|
|
||||||
</tr>
|
|
||||||
))}
|
|
||||||
</tbody>
|
|
||||||
</TableStyle>
|
|
||||||
</IndexTableWrap>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default SegmentContent;
|
|
||||||
@@ -1,15 +1,14 @@
|
|||||||
import { Fragment, useEffect, useRef, useState } from 'react';
|
import { useEffect, useRef, useState } from 'react';
|
||||||
|
|
||||||
import Button from '../../components/common/button/Button';
|
import { TableStyle, TableInfo, ListOption, IndexTableWrap } from '../../styles/Components';
|
||||||
|
import { DailyDashBoard } from '../../components/IndexManage/index';
|
||||||
|
|
||||||
import { Title, TableStyle, TableInfo, ListOption, IndexTableWrap } from '../../styles/Components';
|
import { userIndexView } from '../../apis';
|
||||||
import { UserIndexSearchBar, DailyDashBoard } from '../../components/IndexManage/index';
|
|
||||||
|
|
||||||
import { userIndexView, userIndexExport } from '../../apis';
|
|
||||||
import Loading from '../common/Loading';
|
|
||||||
import { ExcelDownButton } from '../common';
|
import { ExcelDownButton } from '../common';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { formatStringDate } from '../../utils';
|
import { formatStringDate } from '../../utils';
|
||||||
|
import { AnimatedPageWrapper } from '../common/Layout';
|
||||||
|
import { UserIndexSearchBar } from '../searchBar';
|
||||||
|
|
||||||
const UserContent = () => {
|
const UserContent = () => {
|
||||||
const token = sessionStorage.getItem('token');
|
const token = sessionStorage.getItem('token');
|
||||||
@@ -24,20 +23,6 @@ const UserContent = () => {
|
|||||||
const [dataList, setDataList] = useState([]);
|
const [dataList, setDataList] = useState([]);
|
||||||
const [resultData, setResultData] = useState([]);
|
const [resultData, setResultData] = useState([]);
|
||||||
|
|
||||||
// const [sendDate, setSendDate] = useState(START_DATE);
|
|
||||||
// const [finishDate, setFinishDate] = useState(END_DATE);
|
|
||||||
|
|
||||||
const headers = [
|
|
||||||
{key: 'date', label: '일자'},
|
|
||||||
{key: 'nru', label: 'NRU'},
|
|
||||||
{key: 'ugqCreate', label: '일자'},
|
|
||||||
{key: 'dglc', label: '일자'},
|
|
||||||
{key: 'dau', label: '일자'},
|
|
||||||
{key: 'mcu', label: '일자'},
|
|
||||||
{key: 'date', label: '일자'},
|
|
||||||
{key: 'date', label: '일자'},
|
|
||||||
]
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchData(START_DATE, END_DATE);
|
fetchData(START_DATE, END_DATE);
|
||||||
}, []);
|
}, []);
|
||||||
@@ -54,8 +39,6 @@ const UserContent = () => {
|
|||||||
setLoading(false);
|
setLoading(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
// setSendDate(startDateToLocal);
|
|
||||||
// setFinishDate(endDateToLocal);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 검색 함수
|
// 검색 함수
|
||||||
@@ -63,14 +46,8 @@ const UserContent = () => {
|
|||||||
fetchData(send_dt, end_dt);
|
fetchData(send_dt, end_dt);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 엑셀 다운로드
|
|
||||||
// const handleXlsxExport = () => {
|
|
||||||
// const fileName = 'Caliverse_User_Index.xlsx';
|
|
||||||
// userIndexExport(token, fileName, sendDate, finishDate);
|
|
||||||
// };
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<AnimatedPageWrapper>
|
||||||
<DailyDashBoard />
|
<DailyDashBoard />
|
||||||
<UserIndexSearchBar setResultData={setResultData} resultData={resultData} handleSearch={handleSearch} fetchData={fetchData} />
|
<UserIndexSearchBar setResultData={setResultData} resultData={resultData} handleSearch={handleSearch} fetchData={fetchData} />
|
||||||
<TableInfo>
|
<TableInfo>
|
||||||
@@ -125,8 +102,7 @@ const UserContent = () => {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</TableStyle>
|
</TableStyle>
|
||||||
</IndexTableWrap>
|
</IndexTableWrap>
|
||||||
{loading && <Loading/>}
|
</AnimatedPageWrapper>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,219 +0,0 @@
|
|||||||
import { styled } from 'styled-components';
|
|
||||||
import { useState, useEffect } from 'react';
|
|
||||||
|
|
||||||
import { TableStyle, TableInfo, ListOption } from '../../styles/Components';
|
|
||||||
|
|
||||||
import Button from '../../components/common/button/Button';
|
|
||||||
import VBPSearchBar from '../../components/IndexManage/VBPSearchBar';
|
|
||||||
import { VBPIndexExport, VbpIndexView } from '../../apis';
|
|
||||||
|
|
||||||
const VBPContent = () => {
|
|
||||||
const token = sessionStorage.getItem('token');
|
|
||||||
let d = new Date();
|
|
||||||
const START_DATE = new Date(new Date(d.setDate(d.getDate() - 1)).setHours(0, 0, 0, 0));
|
|
||||||
const END_DATE = new Date();
|
|
||||||
|
|
||||||
const [sendDate, setSendDate] = useState(START_DATE);
|
|
||||||
const [finishDate, setFinishDate] = useState(END_DATE);
|
|
||||||
|
|
||||||
const [dataList, setDataList] = useState([]);
|
|
||||||
useEffect(() => {
|
|
||||||
fetchData(START_DATE, END_DATE);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
// console.log(dataList);
|
|
||||||
|
|
||||||
const fetchData = async (startDate, endDate) => {
|
|
||||||
const startDateToLocal =
|
|
||||||
startDate.getFullYear() +
|
|
||||||
'-' +
|
|
||||||
(startDate.getMonth() + 1 < 9 ? '0' + (startDate.getMonth() + 1) : startDate.getMonth() + 1) +
|
|
||||||
'-' +
|
|
||||||
(startDate.getDate() < 9 ? '0' + startDate.getDate() : startDate.getDate());
|
|
||||||
|
|
||||||
const endDateToLocal =
|
|
||||||
endDate.getFullYear() +
|
|
||||||
'-' +
|
|
||||||
(endDate.getMonth() + 1 < 9 ? '0' + (endDate.getMonth() + 1) : endDate.getMonth() + 1) +
|
|
||||||
'-' +
|
|
||||||
(endDate.getDate() < 9 ? '0' + endDate.getDate() : endDate.getDate());
|
|
||||||
|
|
||||||
setDataList(await VbpIndexView(token, startDateToLocal, endDateToLocal));
|
|
||||||
|
|
||||||
setSendDate(startDateToLocal);
|
|
||||||
setFinishDate(endDateToLocal);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 엑셀 다운로드
|
|
||||||
const handleXlsxExport = () => {
|
|
||||||
const fileName = 'Caliverse_VBP_Index.xlsx';
|
|
||||||
VBPIndexExport(token, fileName, sendDate, finishDate);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<VBPSearchBar fetchData={fetchData} />
|
|
||||||
<TableInfo>
|
|
||||||
<ListOption>
|
|
||||||
<Button theme="line" text="엑셀 다운로드" handleClick={handleXlsxExport} />
|
|
||||||
</ListOption>
|
|
||||||
</TableInfo>
|
|
||||||
<TableWrapper>
|
|
||||||
<EconomicTable>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th colSpan="2" className="text-center" width="300">
|
|
||||||
Product
|
|
||||||
</th>
|
|
||||||
<th width="160">2023-08-07</th>
|
|
||||||
<th width="160">2023-08-08</th>
|
|
||||||
<th width="160">2023-08-09</th>
|
|
||||||
<th width="160">2023-08-10</th>
|
|
||||||
<th width="160">2023-08-11</th>
|
|
||||||
<th width="160">2023-08-12</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<TableTitle colSpan="2">(Total) VBP 생산량</TableTitle>
|
|
||||||
<TableData>500000</TableData>
|
|
||||||
<TableData>500000</TableData>
|
|
||||||
<TableData>500000</TableData>
|
|
||||||
<TableData>500000</TableData>
|
|
||||||
<TableData>500000</TableData>
|
|
||||||
<TableData>500000</TableData>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<TableTitle colSpan="2">(Total) VBP 소진량</TableTitle>
|
|
||||||
<TableData>490000</TableData>
|
|
||||||
<TableData>490000</TableData>
|
|
||||||
<TableData>490000</TableData>
|
|
||||||
<TableData>490000</TableData>
|
|
||||||
<TableData>490000</TableData>
|
|
||||||
<TableData>490000</TableData>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<TableTitle colSpan="2">(Total) VBP 보유량</TableTitle>
|
|
||||||
<TableData>3.2M</TableData>
|
|
||||||
<TableData>3.3M</TableData>
|
|
||||||
<TableData>3.3M</TableData>
|
|
||||||
<TableData>3.4M</TableData>
|
|
||||||
<TableData>3.5M</TableData>
|
|
||||||
<TableData>3.5M</TableData>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<TableTitle rowSpan="2">GET</TableTitle>
|
|
||||||
<TableTitle>퀘스트 보상</TableTitle>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<TableTitle>시즌패스 보상</TableTitle>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<TableTitle rowSpan="2">USE</TableTitle>
|
|
||||||
<TableTitle>퀘스트 보상</TableTitle>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<TableTitle>시즌패스 보상</TableTitle>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
<TableData>150000</TableData>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
{/* {mokupData.map((data, index) => (
|
|
||||||
<Fragment key={index}>
|
|
||||||
<tr>
|
|
||||||
<td>{data.date}</td>
|
|
||||||
<td>{data.name}</td>
|
|
||||||
<td>{data.trader}</td>
|
|
||||||
<td>{data.id}</td>
|
|
||||||
<td>{data.key}</td>
|
|
||||||
</tr>
|
|
||||||
</Fragment>
|
|
||||||
))} */}
|
|
||||||
</tbody>
|
|
||||||
</EconomicTable>
|
|
||||||
</TableWrapper>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default VBPContent;
|
|
||||||
|
|
||||||
const TableWrapper = styled.div`
|
|
||||||
width: 100%;
|
|
||||||
min-width: 680px;
|
|
||||||
overflow: auto;
|
|
||||||
&::-webkit-scrollbar {
|
|
||||||
height: 4px;
|
|
||||||
}
|
|
||||||
&::-webkit-scrollbar-thumb {
|
|
||||||
background: #666666;
|
|
||||||
}
|
|
||||||
&::-webkit-scrollbar-track {
|
|
||||||
background: #d9d9d9;
|
|
||||||
}
|
|
||||||
${TableStyle} {
|
|
||||||
width: 100%;
|
|
||||||
min-width: 900px;
|
|
||||||
th {
|
|
||||||
&.cell-nru {
|
|
||||||
background: #f0f0f0;
|
|
||||||
border-left: 1px solid #aaa;
|
|
||||||
border-right: 1px solid #aaa;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
td {
|
|
||||||
&.blank {
|
|
||||||
background: #f9f9f9;
|
|
||||||
}
|
|
||||||
&.cell-nru {
|
|
||||||
background: #fafafa;
|
|
||||||
border-left: 1px solid #aaa;
|
|
||||||
border-right: 1px solid #aaa;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const TableData = styled.td`
|
|
||||||
background: ${props => (props.$state === 'danger' ? '#d60000' : props.$state === 'blank' ? '#F9F9F9' : 'transparent')};
|
|
||||||
color: ${props => (props.$state === 'danger' ? '#fff' : '#2c2c2c')};
|
|
||||||
`;
|
|
||||||
|
|
||||||
const TableTitle = styled.td`
|
|
||||||
text-align: center;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const EconomicTable = styled(TableStyle)`
|
|
||||||
${TableData} {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
tbody {
|
|
||||||
tr:nth-child(1),
|
|
||||||
tr:nth-child(2),
|
|
||||||
tr:nth-child(3) {
|
|
||||||
background: #f5fcff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
@@ -1,27 +1,17 @@
|
|||||||
import UserIndexSearchBar from "./UserIndexSearchBar";
|
|
||||||
import RetentionSearchBar from "./RetentionSearchBar";
|
|
||||||
import SegmentSearchBar from "./SegmentSearchBar";
|
|
||||||
import DailyDashBoard from "./DailyDashBoard";
|
import DailyDashBoard from "./DailyDashBoard";
|
||||||
import PlayTimeSearchBar from "./PlayTimeSearchBar";
|
|
||||||
import UserContent from "./UserContent";
|
import UserContent from "./UserContent";
|
||||||
import PlayTimeContent from "./PlayTimeContent";
|
|
||||||
import RetentionContent from "./RetentionContent";
|
import RetentionContent from "./RetentionContent";
|
||||||
import SegmentContent from "./SegmentContent";
|
import CurrencyConsumeContent from "./CurrencyConsumeContent";
|
||||||
import DailyActiveUserContent from "./DailyActiveUserContent";
|
import CurrencyAcquireContent from "./CurrencyAcquireContent";
|
||||||
import DailyMedalContent from "./DailyMedalContent";
|
import ItemAcquireContent from "./ItemAcquireContent";
|
||||||
import DailySearchBar from "./DailySearchBar";
|
import ItemConsumeContent from "./ItemConsumeContent";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
UserIndexSearchBar,
|
DailyDashBoard,
|
||||||
RetentionSearchBar,
|
|
||||||
SegmentSearchBar,
|
|
||||||
DailyDashBoard,
|
|
||||||
PlayTimeSearchBar,
|
|
||||||
UserContent,
|
UserContent,
|
||||||
SegmentContent,
|
|
||||||
RetentionContent,
|
RetentionContent,
|
||||||
PlayTimeContent,
|
CurrencyConsumeContent,
|
||||||
DailySearchBar,
|
CurrencyAcquireContent,
|
||||||
DailyActiveUserContent,
|
ItemAcquireContent,
|
||||||
DailyMedalContent,
|
ItemConsumeContent
|
||||||
};
|
};
|
||||||
@@ -5,6 +5,7 @@ import { MenuImageDelete, MenuImageUpload } from '../../apis';
|
|||||||
import { IMAGE_MAX_SIZE } from '../../assets/data/adminConstants';
|
import { IMAGE_MAX_SIZE } from '../../assets/data/adminConstants';
|
||||||
import { useAlert } from '../../context/AlertProvider';
|
import { useAlert } from '../../context/AlertProvider';
|
||||||
import { alertTypes } from '../../assets/data/types';
|
import { alertTypes } from '../../assets/data/types';
|
||||||
|
import { ImagePreview } from '../../styles/Components';
|
||||||
|
|
||||||
const ImageUploadBtn = ({ disabled,
|
const ImageUploadBtn = ({ disabled,
|
||||||
onImageUpload,
|
onImageUpload,
|
||||||
@@ -31,6 +32,18 @@ const ImageUploadBtn = ({ disabled,
|
|||||||
|
|
||||||
if (!file) return;
|
if (!file) return;
|
||||||
|
|
||||||
|
const koreanRegex = /[ㄱ-ㅎ|ㅏ-ㅣ|가-힣]/;
|
||||||
|
if (koreanRegex.test(file.name)) {
|
||||||
|
showToast('FILE_KOREAN_NAME_WARNING', {
|
||||||
|
type: alertTypes.warning
|
||||||
|
});
|
||||||
|
if (document.querySelector('#fileinput')) {
|
||||||
|
document.querySelector('#fileinput').value = '';
|
||||||
|
}
|
||||||
|
onFileDelete();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 이미지 파일 확장자 체크
|
// 이미지 파일 확장자 체크
|
||||||
const fileExt = file.name.split('.').pop().toLowerCase();
|
const fileExt = file.name.split('.').pop().toLowerCase();
|
||||||
if (fileExt !== 'png' && fileExt !== 'jpg' && fileExt !== 'jpeg') {
|
if (fileExt !== 'png' && fileExt !== 'jpg' && fileExt !== 'jpeg') {
|
||||||
@@ -220,14 +233,6 @@ const PreviewContainer = styled.div`
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const ImagePreview = styled.img`
|
|
||||||
width: 100%;
|
|
||||||
height: 180px;
|
|
||||||
object-fit: contain;
|
|
||||||
border-radius: 4px 4px 0 0;
|
|
||||||
background-color: #f6f6f6;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const PreviewInfo = styled.div`
|
const PreviewInfo = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|||||||
@@ -3,8 +3,12 @@ import { useEffect, useState } from 'react';
|
|||||||
|
|
||||||
import { MailExcelDown, MailMultiRegsit } from '../../apis';
|
import { MailExcelDown, MailMultiRegsit } from '../../apis';
|
||||||
import { AlertText } from '../../styles/Components';
|
import { AlertText } from '../../styles/Components';
|
||||||
|
import { useAlert } from '../../context/AlertProvider';
|
||||||
|
import { alertTypes } from '../../assets/data/types';
|
||||||
|
|
||||||
|
const MailRegistUploadBtn = ({ disabled, setResultData, resultData, downloadData, disabledBtn, setExcelFile, handleDetailDelete, excelName, setExcelName, status }) => {
|
||||||
|
const {showToast} = useAlert();
|
||||||
|
|
||||||
const MailRegistUploadBtn = ({ disabled, setResultData, resultData, downloadData, disabledBtn, setExcelFile, alertMessage, setAlertMessage, handleDetailDelete, excelName, setExcelName, status }) => {
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
excelName && setExcelName(null);
|
excelName && setExcelName(null);
|
||||||
}, [downloadData]);
|
}, [downloadData]);
|
||||||
@@ -12,6 +16,12 @@ const MailRegistUploadBtn = ({ disabled, setResultData, resultData, downloadData
|
|||||||
const handleFile = async e => {
|
const handleFile = async e => {
|
||||||
const token = sessionStorage.getItem('token');
|
const token = sessionStorage.getItem('token');
|
||||||
|
|
||||||
|
if(e.target.files[0].name.includes('sample')){
|
||||||
|
document.querySelector('#fileinput').value = '';
|
||||||
|
showToast('UPLOAD_FILENAME_SAMPLE_WARNING', {type: alertTypes.warning});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setExcelFile(e.target.files[0]);
|
setExcelFile(e.target.files[0]);
|
||||||
setExcelName(e.target.files[0].name);
|
setExcelName(e.target.files[0].name);
|
||||||
|
|
||||||
@@ -21,11 +31,9 @@ const MailRegistUploadBtn = ({ disabled, setResultData, resultData, downloadData
|
|||||||
if (message === 'Excel 파일을 선택해주세요.'
|
if (message === 'Excel 파일을 선택해주세요.'
|
||||||
|| message === 'Maximum upload size exceeded'
|
|| message === 'Maximum upload size exceeded'
|
||||||
|| message === "guid(32자)를 확인해주세요.") {
|
|| message === "guid(32자)를 확인해주세요.") {
|
||||||
setAlertMessage('유효하지 않은 파일입니다.');
|
showToast('FILE_NOT_EXIT_ERROR', {type: alertTypes.warning});
|
||||||
} else if (message === '중복된 유저 정보가 있습니다.') {
|
} else if (message === '중복된 유저 정보가 있습니다.') {
|
||||||
setAlertMessage('중복된 유저 정보가 있습니다.');
|
showToast('DUPLICATE_USER', {type: alertTypes.warning});
|
||||||
} else {
|
|
||||||
setAlertMessage('');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handlePostGuid(updateData);
|
handlePostGuid(updateData);
|
||||||
@@ -33,7 +41,6 @@ const MailRegistUploadBtn = ({ disabled, setResultData, resultData, downloadData
|
|||||||
|
|
||||||
// 저장된 엑셀 파일 -> API 로 전송
|
// 저장된 엑셀 파일 -> API 로 전송
|
||||||
const handlePostGuid = fileName => {
|
const handlePostGuid = fileName => {
|
||||||
// console.log("fileName.data.data.file_name", fileName.data.data.file_name)
|
|
||||||
setResultData({ ...resultData, file_name: fileName.data.data.file_name });
|
setResultData({ ...resultData, file_name: fileName.data.data.file_name });
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -51,10 +58,8 @@ const MailRegistUploadBtn = ({ disabled, setResultData, resultData, downloadData
|
|||||||
await MailExcelDown(token, downloadData ? downloadData : 'mail_sample.xlsx');
|
await MailExcelDown(token, downloadData ? downloadData : 'mail_sample.xlsx');
|
||||||
};
|
};
|
||||||
|
|
||||||
// console.log('undefinedFile 컴포넌트에서 ', undefinedFile);
|
console.log("excelName", excelName);
|
||||||
// console.log('excelFile ...', excelFile);
|
console.log("downloadData", downloadData);
|
||||||
|
|
||||||
// console.log("excelName", excelName);
|
|
||||||
// console.log(resultData);
|
// console.log(resultData);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -78,21 +83,19 @@ const MailRegistUploadBtn = ({ disabled, setResultData, resultData, downloadData
|
|||||||
)}
|
)}
|
||||||
{/* 등록 페이지 : 파일이 있을 때 파일 삭제용 버튼 */}
|
{/* 등록 페이지 : 파일이 있을 때 파일 삭제용 버튼 */}
|
||||||
{excelName ? (
|
{excelName ? (
|
||||||
<>
|
<FileButton
|
||||||
<FileButton
|
disabled={disabled}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
handleFileDelete();
|
handleFileDelete();
|
||||||
setExcelName(null);
|
setExcelName(null);
|
||||||
}}>
|
}}>
|
||||||
파일 삭제
|
파일 삭제
|
||||||
</FileButton>
|
</FileButton>
|
||||||
<AlertText>{alertMessage}</AlertText>
|
|
||||||
</>
|
|
||||||
) : // 상세 페이지 : 저장된 파일이 복수일 때
|
) : // 상세 페이지 : 저장된 파일이 복수일 때
|
||||||
resultData.guid && resultData.receive_type === 'MULTIPLE' ? (
|
resultData.guid && resultData.receive_type === 'MULTIPLE' ? (
|
||||||
<>
|
<>
|
||||||
<FileButton
|
<FileButton
|
||||||
disabled={resultData.is_reserve === false && disabledBtn || status === 'FINISH'}
|
disabled={disabled}
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
handleDetailDelete(e);
|
handleDetailDelete(e);
|
||||||
setExcelName(null);
|
setExcelName(null);
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import styled, { css } from 'styled-components';
|
import styled, { css } from 'styled-components';
|
||||||
import { useForm } from 'react-hook-form';
|
|
||||||
import { useState, useEffect, Fragment } from 'react';
|
import { useState, useEffect, Fragment } from 'react';
|
||||||
import Button from '../common/button/Button';
|
import Button from '../common/button/Button';
|
||||||
|
|
||||||
@@ -7,9 +6,14 @@ import Modal from '../common/modal/Modal';
|
|||||||
import { Title, BtnWrapper, InputGroup, TableStyle, AlertText } from '../../styles/Components';
|
import { Title, BtnWrapper, InputGroup, TableStyle, AlertText } from '../../styles/Components';
|
||||||
|
|
||||||
import { BlackListExcelDown, BlackListMultipleUpload } from '../../apis';
|
import { BlackListExcelDown, BlackListMultipleUpload } from '../../apis';
|
||||||
|
import { useLoading } from '../../context/LoadingProvider';
|
||||||
|
import { useAlert } from '../../context/AlertProvider';
|
||||||
|
import { alertTypes } from '../../assets/data/types';
|
||||||
|
|
||||||
const UserBlockUploadBtn = ({ disabled, setGuidList, guidList, typeError, setTypeError }) => {
|
const UserBlockUploadBtn = ({ disabled, setGuidList, guidList, typeError, setTypeError }) => {
|
||||||
const token = sessionStorage.getItem('token');
|
const token = sessionStorage.getItem('token');
|
||||||
|
const {withLoading} = useLoading();
|
||||||
|
const {showToast} = useAlert();
|
||||||
|
|
||||||
// onchange states
|
// onchange states
|
||||||
const [file, setFile] = useState(null);
|
const [file, setFile] = useState(null);
|
||||||
@@ -30,7 +34,15 @@ const UserBlockUploadBtn = ({ disabled, setGuidList, guidList, typeError, setTyp
|
|||||||
let fileTypes = ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv'];
|
let fileTypes = ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv'];
|
||||||
|
|
||||||
setFile(e.target.files[0]);
|
setFile(e.target.files[0]);
|
||||||
setGuidList(await BlackListMultipleUpload(token, e.target.files[0]));
|
|
||||||
|
await withLoading(async () => {
|
||||||
|
return await BlackListMultipleUpload(token, e.target.files[0]);
|
||||||
|
}).then(data => {
|
||||||
|
setGuidList(data);
|
||||||
|
}).catch(e => {
|
||||||
|
showToast(e, {type: alertTypes.error});
|
||||||
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleFileDelete = e => {
|
const handleFileDelete = e => {
|
||||||
@@ -75,9 +87,10 @@ const UserBlockUploadBtn = ({ disabled, setGuidList, guidList, typeError, setTyp
|
|||||||
</InputGroup>
|
</InputGroup>
|
||||||
</FileWrapper>
|
</FileWrapper>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Modal $bgcolor="transparent" min="300px" $view={previewModal}>
|
<Modal $bgcolor="transparent" min="300px" $view={previewModal}>
|
||||||
<Title $align="center">업로드 미리보기</Title>
|
<Title $align="center">업로드 미리보기</Title>
|
||||||
<Count>총 제재 인원 : 45</Count>
|
<Count>총 제재 인원 : {guidList.length}</Count>
|
||||||
<TableWrapper>
|
<TableWrapper>
|
||||||
<TableStyle>
|
<TableStyle>
|
||||||
<thead>
|
<thead>
|
||||||
|
|||||||
@@ -1,27 +1,28 @@
|
|||||||
import BoardInfoModal from './modal/BoardInfoModal';
|
import BoardInfoModal from '../modal/BoardInfoModal';
|
||||||
import BoardRegistModal from './modal/BoardRegistModal';
|
import BoardRegistModal from '../modal/BoardRegistModal';
|
||||||
import MailDetailModal from './modal/MailDetailModal';
|
import MailDetailModal from '../modal/MailDetailModal';
|
||||||
import LandAuctionModal from './modal/LandAuctionModal'
|
import LandAuctionModal from '../modal/LandAuctionModal'
|
||||||
import BattleEventModal from './modal/BattleEventModal'
|
import BattleEventModal from '../modal/BattleEventModal'
|
||||||
import ReportListAnswerModal from './modal/ReportListAnswerModal';
|
import ReportListAnswerModal from '../modal/ReportListAnswerModal';
|
||||||
import ReportListDetailModal from './modal/ReportListDetailModal';
|
import ReportListDetailModal from '../modal/ReportListDetailModal';
|
||||||
import UserBlockDetailModal from './modal/UserBlockDetailModal';
|
import UserBlockDetailModal from '../modal/UserBlockDetailModal';
|
||||||
import OwnerChangeModal from './modal/OwnerChangeModal';
|
import OwnerChangeModal from '../modal/OwnerChangeModal';
|
||||||
//searchbar
|
//searchbar
|
||||||
import SearchFilter from './searchBar/SearchFilter';
|
import SearchFilter from '../searchBar/SearchFilter';
|
||||||
import ReportListSearchBar from './searchBar/ReportListSearchBar';
|
import ReportListSearchBar from '../searchBar/ReportListSearchBar';
|
||||||
import UserBlockSearchBar from './searchBar/UserBlockSearchBar';
|
import UserBlockSearchBar from '../searchBar/UserBlockSearchBar';
|
||||||
import EventListSearchBar from './searchBar/EventListSearchBar';
|
import EventListSearchBar from '../searchBar/EventListSearchBar';
|
||||||
import LandAuctionSearchBar from './searchBar/LandAuctionSearchBar'
|
import LandAuctionSearchBar from '../searchBar/LandAuctionSearchBar'
|
||||||
import MailListSearchBar from './searchBar/MailListSearchBar';
|
import MailListSearchBar from '../searchBar/MailListSearchBar';
|
||||||
import LandInfoSearchBar from './searchBar/LandInfoSearchBar';
|
import LandInfoSearchBar from '../searchBar/LandInfoSearchBar';
|
||||||
import BusinessLogSearchBar from './searchBar/BusinessLogSearchBar';
|
import BusinessLogSearchBar from '../searchBar/BusinessLogSearchBar';
|
||||||
import DataInitSearchBar from './searchBar/DataInitSearchBar';
|
import DataInitSearchBar from '../searchBar/DataInitSearchBar';
|
||||||
import LogViewSearchBar from './searchBar/LogViewSearchBar';
|
import LogViewSearchBar from '../searchBar/LogViewSearchBar';
|
||||||
import AdminViewSearchBar from './searchBar/AdminViewSearchBar';
|
import AdminViewSearchBar from '../searchBar/AdminViewSearchBar';
|
||||||
import CaliumRequestSearchBar from './searchBar/CaliumRequestSearchBar';
|
import CaliumRequestSearchBar from '../searchBar/CaliumRequestSearchBar';
|
||||||
|
import CurrencyLogSearchBar from '../searchBar/CurrencyLogSearchBar';
|
||||||
|
|
||||||
import CommonSearchBar from './searchBar/CommonSearchBar';
|
import CommonSearchBar from '../searchBar/CommonSearchBar';
|
||||||
import useCommonSearch from '../../hooks/useCommonSearch';
|
import useCommonSearch from '../../hooks/useCommonSearch';
|
||||||
|
|
||||||
//etc
|
//etc
|
||||||
@@ -35,6 +36,7 @@ export {
|
|||||||
MailListSearchBar,
|
MailListSearchBar,
|
||||||
LandInfoSearchBar,
|
LandInfoSearchBar,
|
||||||
BusinessLogSearchBar,
|
BusinessLogSearchBar,
|
||||||
|
CurrencyLogSearchBar,
|
||||||
DataInitSearchBar,
|
DataInitSearchBar,
|
||||||
LogViewSearchBar,
|
LogViewSearchBar,
|
||||||
AdminViewSearchBar,
|
AdminViewSearchBar,
|
||||||
|
|||||||
@@ -1,428 +0,0 @@
|
|||||||
import React, { useState, Fragment, useEffect } from 'react';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
|
||||||
import Button from '../../common/button/Button';
|
|
||||||
|
|
||||||
import {
|
|
||||||
Title,
|
|
||||||
BtnWrapper,
|
|
||||||
SearchBarAlert, SelectInput,
|
|
||||||
} from '../../../styles/Components';
|
|
||||||
|
|
||||||
import {
|
|
||||||
FormInput,
|
|
||||||
FormLabel,
|
|
||||||
MessageWrapper,
|
|
||||||
FormRowGroup,
|
|
||||||
FormStatusBar,
|
|
||||||
FormStatusLabel,
|
|
||||||
FormStatusWarning,
|
|
||||||
FormButtonContainer,
|
|
||||||
} from '../../../styles/ModuleComponents';
|
|
||||||
import { Modal, SingleDatePicker, SingleTimePicker } from '../../common';
|
|
||||||
import { NONE, TYPE_MODIFY, TYPE_REGISTRY } from '../../../assets/data/adminConstants';
|
|
||||||
import { convertKTCDate } from '../../../utils';
|
|
||||||
import {
|
|
||||||
battleEventHotTime,
|
|
||||||
battleEventRoundCount,
|
|
||||||
battleEventStatus,
|
|
||||||
battleRepeatType,
|
|
||||||
} from '../../../assets/data/options';
|
|
||||||
import { BattleEventModify, BattleEventSingleRegist } from '../../../apis/Battle';
|
|
||||||
import { alertTypes, battleEventStatusType } from '../../../assets/data/types';
|
|
||||||
import { isValidDayRange } from '../../../utils/date';
|
|
||||||
import { useAlert } from '../../../context/AlertProvider';
|
|
||||||
import { useLoading } from '../../../context/LoadingProvider';
|
|
||||||
|
|
||||||
const BattleEventModal = ({ modalType, detailView, handleDetailView, content, setDetailData, configData, rewardData }) => {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const token = sessionStorage.getItem('token');
|
|
||||||
const { showToast, showModal } = useAlert();
|
|
||||||
const {withLoading} = useLoading();
|
|
||||||
|
|
||||||
const [isNullValue, setIsNullValue] = useState(false);
|
|
||||||
const [resultData, setResultData] = useState(initData);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if(modalType === TYPE_MODIFY && content && Object.keys(content).length > 0){
|
|
||||||
setResultData({
|
|
||||||
group_id: content.group_id,
|
|
||||||
event_id: content.event_id,
|
|
||||||
event_name: content.event_name,
|
|
||||||
repeat_type: content.repeat_type,
|
|
||||||
config_id: content.config_id,
|
|
||||||
reward_group_id: content.reward_group_id,
|
|
||||||
round_count: content.round_count,
|
|
||||||
hot_time: content.hot_time,
|
|
||||||
round_time: content.round_time,
|
|
||||||
status: content.status,
|
|
||||||
event_start_dt: convertKTCDate(content.event_start_dt),
|
|
||||||
event_end_dt: content.event_end_dt,
|
|
||||||
event_operation_time: content.event_operation_time,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, [modalType, content]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if(modalType === TYPE_REGISTRY && configData?.length > 0){
|
|
||||||
setResultData(prev => ({
|
|
||||||
...prev,
|
|
||||||
round_count: configData[0].default_round_count
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}, [modalType, configData]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (checkCondition()) {
|
|
||||||
setIsNullValue(false);
|
|
||||||
} else {
|
|
||||||
setIsNullValue(true);
|
|
||||||
}
|
|
||||||
}, [resultData]);
|
|
||||||
|
|
||||||
// 시작 날짜 변경 핸들러
|
|
||||||
const handleStartDateChange = (date) => {
|
|
||||||
if (!date) return;
|
|
||||||
|
|
||||||
const newDate = new Date(date);
|
|
||||||
|
|
||||||
if(resultData.repeat_type !== NONE && resultData.event_end_dt){
|
|
||||||
const endDate = new Date(resultData.event_end_dt);
|
|
||||||
const startDay = new Date(newDate.getFullYear(), newDate.getMonth(), newDate.getDate());
|
|
||||||
const endDay = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate());
|
|
||||||
|
|
||||||
if (endDay <= startDay) {
|
|
||||||
showToast('DATE_START_DIFF_END_WARNING', {type: alertTypes.warning});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setResultData(prev => ({
|
|
||||||
...prev,
|
|
||||||
event_start_dt: newDate
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
|
|
||||||
// 시작 시간 변경 핸들러
|
|
||||||
const handleStartTimeChange = (time) => {
|
|
||||||
if (!time) return;
|
|
||||||
|
|
||||||
const newDateTime = resultData.event_start_dt
|
|
||||||
? new Date(resultData.event_start_dt)
|
|
||||||
: new Date();
|
|
||||||
|
|
||||||
newDateTime.setHours(
|
|
||||||
time.getHours(),
|
|
||||||
time.getMinutes(),
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
setResultData(prev => ({
|
|
||||||
...prev,
|
|
||||||
event_start_dt: newDateTime
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
|
|
||||||
// 종료 날짜 변경 핸들러
|
|
||||||
const handleEndDateChange = (date) => {
|
|
||||||
if (!date || !resultData.event_start_dt) return;
|
|
||||||
|
|
||||||
const startDate = new Date(resultData.event_start_dt);
|
|
||||||
const endDate = new Date(date);
|
|
||||||
|
|
||||||
// 일자만 비교하기 위해 년/월/일만 추출
|
|
||||||
const startDay = new Date(startDate.getFullYear(), startDate.getMonth(), startDate.getDate());
|
|
||||||
const endDay = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate());
|
|
||||||
|
|
||||||
if (endDay <= startDay) {
|
|
||||||
showToast('DATE_START_DIFF_END_WARNING', {type: alertTypes.warning});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
setResultData(prev => ({
|
|
||||||
...prev,
|
|
||||||
event_end_dt: endDate
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleConfigChange = (e) => {
|
|
||||||
const config = configData.find(data => String(data.id) === String(e.target.value));
|
|
||||||
if (config) {
|
|
||||||
setResultData({
|
|
||||||
...resultData,
|
|
||||||
config_id: config.id,
|
|
||||||
round_time: config.round_time
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
showToast('Config not found for value:', e.target.value, {type: alertTypes.warning});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleReset = () => {
|
|
||||||
setDetailData({});
|
|
||||||
setResultData(initData);
|
|
||||||
handleDetailView();
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleSubmit = async (type, param = null) => {
|
|
||||||
switch (type) {
|
|
||||||
case "submit":
|
|
||||||
if (!checkCondition()) return;
|
|
||||||
|
|
||||||
const minAllowedTime = new Date(new Date().getTime() + 10 * 60000);
|
|
||||||
const startDt = resultData.event_start_dt;
|
|
||||||
const endDt = resultData.event_end_dt;
|
|
||||||
if (modalType === TYPE_REGISTRY && startDt < minAllowedTime) {
|
|
||||||
showToast('BATTLE_EVENT_MODAL_START_DT_WARNING', {type: alertTypes.warning});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(resultData.repeat_type !== 'NONE' && !isValidDayRange(startDt, endDt)) {
|
|
||||||
showToast('BATTLE_EVENT_MODAL_START_DT_WARNING', {type: alertTypes.warning});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//화면에 머물면서 상태는 안바꼈을 경우가 있기에 시작시간 지났을경우 차단
|
|
||||||
if (modalType === TYPE_REGISTRY && startDt < new Date()) {
|
|
||||||
showToast('BATTLE_EVENT_MODAL_START_DT_WARNING', {type: alertTypes.warning});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(resultData.round_time === 0){
|
|
||||||
const config = configData.find(data => data.id === resultData.config_id);
|
|
||||||
setResultData({ ...resultData, round_time: config.round_time });
|
|
||||||
}
|
|
||||||
|
|
||||||
showModal(isView('modify') ? 'BATTLE_EVENT_UPDATE_CONFIRM' : 'BATTLE_EVENT_REGIST_CONFIRM', {
|
|
||||||
type: alertTypes.confirm,
|
|
||||||
onConfirm: () => handleSubmit('registConfirm')
|
|
||||||
});
|
|
||||||
|
|
||||||
break;
|
|
||||||
case "registConfirm":
|
|
||||||
if(isView('modify')){
|
|
||||||
await withLoading( async () => {
|
|
||||||
return await BattleEventModify(token, content?.id, resultData);
|
|
||||||
}).then(data => {
|
|
||||||
if(data.result === "SUCCESS") {
|
|
||||||
showToast('UPDATE_COMPLETED', {type: alertTypes.success});
|
|
||||||
}else if(data.result === "ERROR_BATTLE_EVENT_TIME_OVER"){
|
|
||||||
showToast('BATTLE_EVENT_MODAL_TIME_CHECK_WARNING', {type: alertTypes.error});
|
|
||||||
}else{
|
|
||||||
showToast('UPDATE_FAIL', {type: alertTypes.error});
|
|
||||||
}
|
|
||||||
}).catch(reason => {
|
|
||||||
showToast('API_FAIL', {type: alertTypes.error});
|
|
||||||
}).finally(() => {
|
|
||||||
handleReset();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
await withLoading( async () => {
|
|
||||||
return await BattleEventSingleRegist(token, resultData);
|
|
||||||
}).then(data => {
|
|
||||||
if(data.result === "SUCCESS") {
|
|
||||||
showToast('REGIST_COMPLTE', {type: alertTypes.success});
|
|
||||||
}else if(data.result === "ERROR_BATTLE_EVENT_TIME_OVER"){
|
|
||||||
showToast('BATTLE_EVENT_MODAL_TIME_CHECK_WARNING', {type: alertTypes.error});
|
|
||||||
}else{
|
|
||||||
showToast('REGIST_FAIL', {type: alertTypes.error});
|
|
||||||
}
|
|
||||||
}).catch(reason => {
|
|
||||||
showToast('API_FAIL', {type: alertTypes.error});
|
|
||||||
}).finally(() => {
|
|
||||||
handleReset();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const checkCondition = () => {
|
|
||||||
return (
|
|
||||||
resultData.event_start_dt !== ''
|
|
||||||
&& resultData.group_id !== ''
|
|
||||||
&& resultData.event_name !== ''
|
|
||||||
&& (resultData.repeat_type === 'NONE' || (resultData.repeat_type !== 'NONE' && resultData.event_end_dt !== ''))
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const isView = (label) => {
|
|
||||||
switch (label) {
|
|
||||||
case "modify":
|
|
||||||
return modalType === TYPE_MODIFY && (content?.status === battleEventStatusType.stop);
|
|
||||||
case "start_dt":
|
|
||||||
case "repeat":
|
|
||||||
case "registry":
|
|
||||||
return modalType === TYPE_REGISTRY
|
|
||||||
case "end_dt":
|
|
||||||
case "group":
|
|
||||||
case "name":
|
|
||||||
case "config":
|
|
||||||
case "reward":
|
|
||||||
case "round":
|
|
||||||
case "hot":
|
|
||||||
return modalType === TYPE_REGISTRY || (modalType === TYPE_MODIFY &&(content?.status === battleEventStatusType.stop));
|
|
||||||
default:
|
|
||||||
return modalType === TYPE_MODIFY && (content?.status !== battleEventStatusType.stop);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Modal min="760px" $view={detailView}>
|
|
||||||
<Title $align="center">{isView('registry') ? "전투시스템 이벤트 등록" : isView('modify') ? "전투시스템 이벤트 수정" : "전투시스템 이벤트 상세"}</Title>
|
|
||||||
<MessageWrapper>
|
|
||||||
<FormRowGroup>
|
|
||||||
<FormLabel>그룹 ID</FormLabel>
|
|
||||||
<FormInput
|
|
||||||
type="text"
|
|
||||||
disabled={!isView('group')}
|
|
||||||
width='150px'
|
|
||||||
value={resultData?.group_id}
|
|
||||||
onChange={e => setResultData({ ...resultData, group_id: e.target.value })}
|
|
||||||
/>
|
|
||||||
<FormLabel>이벤트명</FormLabel>
|
|
||||||
<FormInput
|
|
||||||
type="text"
|
|
||||||
disabled={!isView('name')}
|
|
||||||
width='300px'
|
|
||||||
value={resultData?.event_name}
|
|
||||||
onChange={e => setResultData({ ...resultData, event_name: e.target.value })}
|
|
||||||
/>
|
|
||||||
</FormRowGroup>
|
|
||||||
<FormRowGroup>
|
|
||||||
<SingleDatePicker
|
|
||||||
label="시작일자"
|
|
||||||
disabled={!isView('start_dt')}
|
|
||||||
dateLabel="시작 일자"
|
|
||||||
onDateChange={handleStartDateChange}
|
|
||||||
selectedDate={resultData?.event_start_dt}
|
|
||||||
/>
|
|
||||||
<SingleTimePicker
|
|
||||||
label="시작시간"
|
|
||||||
disabled={!isView('start_dt')}
|
|
||||||
selectedTime={resultData?.event_start_dt}
|
|
||||||
onTimeChange={handleStartTimeChange}
|
|
||||||
/>
|
|
||||||
</FormRowGroup>
|
|
||||||
<FormRowGroup>
|
|
||||||
<FormLabel>반복</FormLabel>
|
|
||||||
<SelectInput value={resultData?.repeat_type} onChange={e => setResultData({ ...resultData, repeat_type: e.target.value })} disabled={!isView('repeat')} width="150px">
|
|
||||||
{battleRepeatType.map((data, index) => (
|
|
||||||
<option key={index} value={data.value}>
|
|
||||||
{data.name}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</SelectInput>
|
|
||||||
{resultData?.repeat_type !== 'NONE' &&
|
|
||||||
<SingleDatePicker
|
|
||||||
label="종료일자"
|
|
||||||
disabled={!isView('end_dt')}
|
|
||||||
dateLabel="종료 일자"
|
|
||||||
onDateChange={handleEndDateChange}
|
|
||||||
selectedDate={resultData?.event_end_dt}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
</FormRowGroup>
|
|
||||||
<FormRowGroup>
|
|
||||||
<FormLabel>라운드 시간</FormLabel>
|
|
||||||
<SelectInput value={resultData.config_id} onChange={handleConfigChange} disabled={!isView('config')} width="200px">
|
|
||||||
{configData && configData?.map((data, index) => (
|
|
||||||
<option key={index} value={data.id}>
|
|
||||||
{data.desc}({data.id})
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</SelectInput>
|
|
||||||
<FormLabel>라운드 수</FormLabel>
|
|
||||||
<SelectInput value={resultData.round_count} onChange={e => setResultData({ ...resultData, round_count: e.target.value })} disabled={!isView('round')} width="100px">
|
|
||||||
{battleEventRoundCount.map((data, index) => (
|
|
||||||
<option key={index} value={data}>
|
|
||||||
{data}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</SelectInput>
|
|
||||||
</FormRowGroup>
|
|
||||||
<FormRowGroup>
|
|
||||||
<FormLabel>배정 포드</FormLabel>
|
|
||||||
<SelectInput value={resultData.reward_group_id} onChange={e => setResultData({ ...resultData, reward_group_id: e.target.value })} disabled={!isView('reward')} width="200px">
|
|
||||||
{rewardData && rewardData?.map((data, index) => (
|
|
||||||
<option key={index} value={data.group_id}>
|
|
||||||
{data.desc}({data.group_id})
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</SelectInput>
|
|
||||||
<FormLabel>핫타임</FormLabel>
|
|
||||||
<SelectInput value={resultData.hot_time} onChange={e => setResultData({ ...resultData, hot_time: e.target.value })} disabled={!isView('hot')} width="100px">
|
|
||||||
{battleEventHotTime.map((data, index) => (
|
|
||||||
<option key={index} value={data}>
|
|
||||||
{data}배
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</SelectInput>
|
|
||||||
</FormRowGroup>
|
|
||||||
|
|
||||||
{!isView() && isNullValue && <SearchBarAlert $marginTop="25px" $align="right">{t('REQUIRED_VALUE_CHECK')}</SearchBarAlert>}
|
|
||||||
</MessageWrapper>
|
|
||||||
|
|
||||||
<BtnWrapper $gap="10px" $marginTop="10px">
|
|
||||||
<FormStatusBar>
|
|
||||||
<FormStatusLabel>
|
|
||||||
현재상태: {battleEventStatus.find(data => data.value === content?.status)?.name || "등록"}
|
|
||||||
</FormStatusLabel>
|
|
||||||
<FormStatusWarning>
|
|
||||||
{isView('registry') ? '' : t('BATTLE_EVENT_MODAL_STATUS_WARNING')}
|
|
||||||
</FormStatusWarning>
|
|
||||||
</FormStatusBar>
|
|
||||||
<FormButtonContainer $gap="5px">
|
|
||||||
{isView() ?
|
|
||||||
<Button
|
|
||||||
text="확인"
|
|
||||||
name="확인버튼"
|
|
||||||
theme="line"
|
|
||||||
handleClick={() => handleReset()}
|
|
||||||
/>
|
|
||||||
:
|
|
||||||
<>
|
|
||||||
<Button
|
|
||||||
text="취소"
|
|
||||||
theme="line"
|
|
||||||
handleClick={() => showModal('CANCEL_CONFIRM', {
|
|
||||||
type: alertTypes.confirm,
|
|
||||||
onConfirm: () => handleReset()
|
|
||||||
})}
|
|
||||||
/>
|
|
||||||
<Button
|
|
||||||
type="submit"
|
|
||||||
text={isView('modify') ? "수정" : "등록"}
|
|
||||||
name="등록버튼"
|
|
||||||
theme={
|
|
||||||
checkCondition()
|
|
||||||
? 'primary'
|
|
||||||
: 'disable'
|
|
||||||
}
|
|
||||||
handleClick={() => handleSubmit('submit')}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
</FormButtonContainer>
|
|
||||||
</BtnWrapper>
|
|
||||||
</Modal>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const initData = {
|
|
||||||
group_id: '',
|
|
||||||
event_name: '',
|
|
||||||
repeat_type: 'NONE',
|
|
||||||
config_id: 1,
|
|
||||||
round_time: 0,
|
|
||||||
reward_group_id: 1,
|
|
||||||
round_count: 1,
|
|
||||||
hot_time: 1,
|
|
||||||
event_start_dt: '',
|
|
||||||
event_end_dt: ''
|
|
||||||
}
|
|
||||||
|
|
||||||
export default BattleEventModal;
|
|
||||||
|
|
||||||
@@ -1,523 +0,0 @@
|
|||||||
import { useState, useEffect, Fragment } from 'react';
|
|
||||||
|
|
||||||
import { Title, SelectInput, BtnWrapper, TextInput, Label, InputLabel, Textarea, SearchBarAlert } from '../../../styles/Components';
|
|
||||||
import Button from '../../common/button/Button';
|
|
||||||
import Modal from '../../common/modal/Modal';
|
|
||||||
import { EventIsItem, EventModify } from '../../../apis';
|
|
||||||
|
|
||||||
import { authList } from '../../../store/authList';
|
|
||||||
import { useRecoilValue } from 'recoil';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
|
||||||
import { authType, benItems, commonStatus, wellType } from '../../../assets/data';
|
|
||||||
import {
|
|
||||||
AppendRegistBox, AppendRegistTable, AreaBtnClose,
|
|
||||||
BtnDelete, DetailInputItem, DetailInputRow,
|
|
||||||
DetailModalWrapper, RegistGroup, DetailRegistInfo, DetailState,
|
|
||||||
Item, ItemList, LangArea
|
|
||||||
} from '../../../styles/ModuleComponents';
|
|
||||||
import { convertKTC, combineDateTime, timeDiffMinute, convertKTCDate } from '../../../utils';
|
|
||||||
import DateTimeInput from '../../common/input/DateTimeInput';
|
|
||||||
import { useLoading } from '../../../context/LoadingProvider';
|
|
||||||
import { useAlert } from '../../../context/AlertProvider';
|
|
||||||
import { alertTypes } from '../../../assets/data/types';
|
|
||||||
|
|
||||||
const EventDetailModal = ({ detailView, handleDetailView, content, setDetailData }) => {
|
|
||||||
const userInfo = useRecoilValue(authList);
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const token = sessionStorage.getItem('token');
|
|
||||||
const {withLoading} = useLoading();
|
|
||||||
const {showModal, showToast} = useAlert();
|
|
||||||
|
|
||||||
const id = content && content.id;
|
|
||||||
const updateAuth = userInfo.auth_list && userInfo.auth_list.some(auth => auth.id === authType.eventUpdate);
|
|
||||||
|
|
||||||
const [time, setTime] = useState({
|
|
||||||
start_hour: '00',
|
|
||||||
start_min: '00',
|
|
||||||
end_hour: '00',
|
|
||||||
end_min: '00',
|
|
||||||
}); //시간 정보
|
|
||||||
|
|
||||||
const [item, setItem] = useState('');
|
|
||||||
const [itemCount, setItemCount] = useState('');
|
|
||||||
const [resource, setResource] = useState('19010001');
|
|
||||||
const [resourceCount, setResourceCount] = useState('');
|
|
||||||
|
|
||||||
const [resultData, setResultData] = useState({});
|
|
||||||
|
|
||||||
const [isNullValue, setIsNullValue] = useState(false);
|
|
||||||
// 과거 판단
|
|
||||||
const [isPast, setIsPast] = useState(false);
|
|
||||||
const [isChanged, setIsChanged] = useState(false);
|
|
||||||
|
|
||||||
const [btnValidation, setBtnValidation] = useState(false);
|
|
||||||
const [isReadOnly, setIsReadOnly] = useState(false);
|
|
||||||
const [itemCheckMsg, setItemCheckMsg] = useState('');
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if(content){
|
|
||||||
const start_dt_KTC = convertKTCDate(content.start_dt)
|
|
||||||
const end_dt_KTC = convertKTCDate(content.end_dt)
|
|
||||||
|
|
||||||
setResultData({
|
|
||||||
start_dt: start_dt_KTC,
|
|
||||||
end_dt: end_dt_KTC,
|
|
||||||
event_type: content.event_type,
|
|
||||||
mail_list: content.mail_list,
|
|
||||||
item_list: content.item_list,
|
|
||||||
});
|
|
||||||
|
|
||||||
setTime({ ...time,
|
|
||||||
start_hour: String(start_dt_KTC.getHours()).padStart(2, '0'),
|
|
||||||
start_min: String(start_dt_KTC.getMinutes()).padStart(2, '0'),
|
|
||||||
end_hour: String(end_dt_KTC.getHours()).padStart(2, '0'),
|
|
||||||
end_min: String(end_dt_KTC.getMinutes()).padStart(2, '0')
|
|
||||||
});
|
|
||||||
|
|
||||||
start_dt_KTC < (new Date) ? setIsPast(true) : setIsPast(false);
|
|
||||||
content.mail_list.length === 1 && setBtnValidation(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
setItem('');
|
|
||||||
|
|
||||||
}, [content]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if(!updateAuth || isPast){
|
|
||||||
setIsReadOnly(true);
|
|
||||||
}else{
|
|
||||||
setIsReadOnly(false);
|
|
||||||
}
|
|
||||||
}, [updateAuth, isPast]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (conditionCheck()) {
|
|
||||||
setIsNullValue(false);
|
|
||||||
} else {
|
|
||||||
setIsNullValue(true);
|
|
||||||
}
|
|
||||||
}, [resultData]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setItemCheckMsg('');
|
|
||||||
}, [item]);
|
|
||||||
|
|
||||||
// 아이템 수량 숫자 체크
|
|
||||||
const handleItemCount = e => {
|
|
||||||
if (e.target.value === '0' || e.target.value === '-0') {
|
|
||||||
setItemCount('1');
|
|
||||||
e.target.value = '1';
|
|
||||||
} else if (e.target.value < 0) {
|
|
||||||
let plusNum = Math.abs(e.target.value);
|
|
||||||
setItemCount(plusNum);
|
|
||||||
} else {
|
|
||||||
setItemCount(e.target.value);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 아이템 추가
|
|
||||||
const handleItemList = async () => {
|
|
||||||
if(benItems.includes(item)){
|
|
||||||
showToast('MAIL_ITEM_ADD_BEN', {type: alertTypes.warning});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(item.length === 0 || itemCount.length === 0) return;
|
|
||||||
|
|
||||||
const result = await EventIsItem(token, {item: item});
|
|
||||||
|
|
||||||
if(result.data.result === "ERROR"){
|
|
||||||
setItemCheckMsg(t('NOT_ITEM'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const itemIndex = resultData.item_list.findIndex((data) => data.item === item);
|
|
||||||
if (itemIndex !== -1) {
|
|
||||||
setItemCheckMsg(t('MAIL_ITEM_ADD_DUPL'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const newItem = { item: item, item_cnt: itemCount, item_name: result.data.data.item_info.item_name };
|
|
||||||
|
|
||||||
resultData.item_list.push(newItem);
|
|
||||||
|
|
||||||
setIsChanged(true);
|
|
||||||
setItem('');
|
|
||||||
setItemCount('');
|
|
||||||
};
|
|
||||||
|
|
||||||
// 아이템 삭제
|
|
||||||
const onItemRemove = id => {
|
|
||||||
let filterList = resultData.item_list && resultData.item_list.filter(item => item !== resultData.item_list[id]);
|
|
||||||
setIsChanged(true);
|
|
||||||
|
|
||||||
setResultData({ ...resultData, item_list: filterList });
|
|
||||||
};
|
|
||||||
|
|
||||||
// 자원 수량 숫자 체크
|
|
||||||
const handleResourceCount = e => {
|
|
||||||
if (e.target.value === '0' || e.target.value === '-0') {
|
|
||||||
setResourceCount('1');
|
|
||||||
e.target.value = '1';
|
|
||||||
} else if (e.target.value < 0) {
|
|
||||||
let plusNum = Math.abs(e.target.value);
|
|
||||||
setResourceCount(plusNum);
|
|
||||||
} else {
|
|
||||||
setResourceCount(e.target.value);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 자원 추가
|
|
||||||
const handleResourceList = (e) => {
|
|
||||||
if(resource.length === 0 || resourceCount.length === 0) return;
|
|
||||||
|
|
||||||
const itemIndex = resultData.item_list.findIndex(
|
|
||||||
(item) => item.item === resource
|
|
||||||
);
|
|
||||||
|
|
||||||
if (itemIndex !== -1) {
|
|
||||||
const item_cnt = resultData.item_list[itemIndex].item_cnt;
|
|
||||||
resultData.item_list[itemIndex].item_cnt = Number(item_cnt) + Number(resourceCount);
|
|
||||||
} else {
|
|
||||||
const name = wellType.find(well => well.value === resource).name;
|
|
||||||
const newItem = { item: resource, item_cnt: resourceCount, item_name: name };
|
|
||||||
resultData.item_list.push(newItem);
|
|
||||||
}
|
|
||||||
setIsChanged(true);
|
|
||||||
setResource('')
|
|
||||||
setResourceCount('');
|
|
||||||
};
|
|
||||||
|
|
||||||
// 입력창 삭제
|
|
||||||
const onLangDelete = language => {
|
|
||||||
let filterList = resultData.mail_list && resultData.mail_list.filter(el => el.language !== language);
|
|
||||||
|
|
||||||
if (filterList.length === 1) setBtnValidation(true);
|
|
||||||
|
|
||||||
setIsChanged(true);
|
|
||||||
setResultData({ ...resultData, mail_list: filterList });
|
|
||||||
};
|
|
||||||
|
|
||||||
// 날짜 처리
|
|
||||||
const handleDateChange = (data, type) => {
|
|
||||||
const date = new Date(data);
|
|
||||||
setResultData({
|
|
||||||
...resultData,
|
|
||||||
[`${type}_dt`]: combineDateTime(date, time[`${type}_hour`], time[`${type}_min`]),
|
|
||||||
});
|
|
||||||
setIsChanged(true);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 시간 처리
|
|
||||||
const handleTimeChange = (e, type) => {
|
|
||||||
const { id, value } = e.target;
|
|
||||||
const newTime = { ...time, [`${type}_${id}`]: value };
|
|
||||||
setTime(newTime);
|
|
||||||
|
|
||||||
const date = resultData[`${type}_dt`] ? new Date(resultData[`${type}_dt`]) : new Date();
|
|
||||||
|
|
||||||
setResultData({
|
|
||||||
...resultData,
|
|
||||||
[`${type}_dt`]: combineDateTime(date, newTime[`${type}_hour`], newTime[`${type}_min`]),
|
|
||||||
});
|
|
||||||
setIsChanged(true);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 확인 버튼 후 다 초기화
|
|
||||||
const handleReset = () => {
|
|
||||||
setBtnValidation(false);
|
|
||||||
setIsNullValue(false);
|
|
||||||
setIsChanged(false);
|
|
||||||
};
|
|
||||||
|
|
||||||
const conditionCheck = () => {
|
|
||||||
return (
|
|
||||||
content && content.mail_list.every(data => data.content !== '' && data.title !== '') &&
|
|
||||||
isChanged
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleSubmit = async (type, param = null) => {
|
|
||||||
switch (type) {
|
|
||||||
case "submit":
|
|
||||||
if (!conditionCheck()) return;
|
|
||||||
|
|
||||||
showModal('MAIL_UPDATE_SAVE', {
|
|
||||||
type: alertTypes.confirm,
|
|
||||||
onConfirm: () => handleSubmit('updateConfirm')
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
case "updateConfirm":
|
|
||||||
const timeDiff = timeDiffMinute(resultData.start_dt, (new Date))
|
|
||||||
// 이벤트 시작 30분전이나 이미 SystemMail이 add된 상태에서는 수정할 수 없다.
|
|
||||||
if(content.add_flag || timeDiff <= 30){
|
|
||||||
showToast('EVENT_TIME_LIMIT_UPDATE', {type: alertTypes.warning});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
withLoading( async () => {
|
|
||||||
return await EventModify(token, id, resultData);
|
|
||||||
}).catch(error => {
|
|
||||||
showToast('API_FAIL', {type: alertTypes.error});
|
|
||||||
}).finally(() => {
|
|
||||||
showToast('UPDATE_COMPLETED', {type: alertTypes.success});
|
|
||||||
handleDetailView();
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const detailState = (status) => {
|
|
||||||
switch (status) {
|
|
||||||
case commonStatus.wait:
|
|
||||||
return <DetailState>대기</DetailState>;
|
|
||||||
case commonStatus.running:
|
|
||||||
return <DetailState>진행중</DetailState>;
|
|
||||||
case commonStatus.finish:
|
|
||||||
return <DetailState result={commonStatus.finish}>완료</DetailState>;
|
|
||||||
case commonStatus.fail:
|
|
||||||
return <DetailState result={commonStatus.fail}>실패</DetailState>;
|
|
||||||
case commonStatus.delete:
|
|
||||||
return <DetailState result={commonStatus.delete}>삭제</DetailState>;
|
|
||||||
default:
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Modal min="960px" $view={detailView}>
|
|
||||||
<Title $align="center">이벤트 상세 정보</Title>
|
|
||||||
{content &&
|
|
||||||
<DetailRegistInfo>
|
|
||||||
<span>등록자 : {content.create_by}</span>
|
|
||||||
<span>등록일 : {convertKTC(content.create_dt, false)}</span>
|
|
||||||
{typeof content.update_by !== 'undefined' && (
|
|
||||||
<>
|
|
||||||
<span>수정자 : {content.update_by}</span>
|
|
||||||
<span>수정일 : {convertKTC(content.update_dt, false)}</span>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</DetailRegistInfo>
|
|
||||||
}
|
|
||||||
<DetailModalWrapper>
|
|
||||||
{content &&
|
|
||||||
<RegistGroup>
|
|
||||||
<DetailInputRow>
|
|
||||||
<DateTimeInput
|
|
||||||
title="이벤트 기간"
|
|
||||||
dateName="시작 일자"
|
|
||||||
selectedDate={convertKTCDate(content.start_dt)}
|
|
||||||
handleSelectedDate={data => handleDateChange(data, 'start')}
|
|
||||||
onChange={e => handleTimeChange(e, 'start')}
|
|
||||||
|
|
||||||
/>
|
|
||||||
<DateTimeInput
|
|
||||||
dateName="종료 일자"
|
|
||||||
selectedDate={convertKTCDate(content.end_dt)}
|
|
||||||
handleSelectedDate={data => handleDateChange(data, 'end')}
|
|
||||||
onChange={e => handleTimeChange(e, 'end')}
|
|
||||||
/>
|
|
||||||
</DetailInputRow>
|
|
||||||
<DetailInputRow>
|
|
||||||
<DetailInputItem>
|
|
||||||
<InputLabel>이벤트 상태</InputLabel>
|
|
||||||
<div>{detailState(content.status)}</div>
|
|
||||||
</DetailInputItem>
|
|
||||||
{content.status === commonStatus.delete &&
|
|
||||||
<DetailInputItem>
|
|
||||||
<InputLabel>삭제 사유</InputLabel>
|
|
||||||
<div>{content.delete_desc}</div>
|
|
||||||
</DetailInputItem>
|
|
||||||
}
|
|
||||||
</DetailInputRow>
|
|
||||||
|
|
||||||
</RegistGroup>
|
|
||||||
}
|
|
||||||
{resultData.mail_list &&
|
|
||||||
resultData.mail_list.map(data => {
|
|
||||||
return (
|
|
||||||
<Fragment key={data.language}>
|
|
||||||
<AppendRegistBox>
|
|
||||||
<LangArea>
|
|
||||||
언어 : {data.language}
|
|
||||||
{btnValidation === false && !isReadOnly ? (
|
|
||||||
<AreaBtnClose
|
|
||||||
onClick={e => {
|
|
||||||
e.preventDefault();
|
|
||||||
onLangDelete(data.language);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<AreaBtnClose opacity="10%" />
|
|
||||||
)}
|
|
||||||
</LangArea>
|
|
||||||
<AppendRegistTable>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<th width="120">
|
|
||||||
<Label>제목</Label>
|
|
||||||
</th>
|
|
||||||
<td>
|
|
||||||
<DetailInputItem>
|
|
||||||
<TextInput
|
|
||||||
placeholder="우편 제목 입력"
|
|
||||||
maxLength="30"
|
|
||||||
id={data.language}
|
|
||||||
value={data.title}
|
|
||||||
readOnly={isReadOnly}
|
|
||||||
onChange={e => {
|
|
||||||
let list = [...resultData.mail_list];
|
|
||||||
let findIndex = resultData.mail_list && resultData.mail_list.findIndex(item => item.language === e.target.id);
|
|
||||||
list[findIndex].title = e.target.value.trimStart();
|
|
||||||
|
|
||||||
setResultData({ ...resultData, mail_list: list });
|
|
||||||
setIsChanged(true);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</DetailInputItem>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th>
|
|
||||||
<Label>내용</Label>
|
|
||||||
</th>
|
|
||||||
<td>
|
|
||||||
<Textarea
|
|
||||||
value={data.content}
|
|
||||||
readOnly={isReadOnly}
|
|
||||||
id={data.language}
|
|
||||||
onChange={e => {
|
|
||||||
if (e.target.value.length > 2000) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let list = [...resultData.mail_list];
|
|
||||||
let findIndex = resultData.mail_list && resultData.mail_list.findIndex(item => item.language === e.target.id);
|
|
||||||
list[findIndex].content = e.target.value.trimStart();
|
|
||||||
|
|
||||||
setResultData({ ...resultData, mail_list: list });
|
|
||||||
setIsChanged(true);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</AppendRegistTable>
|
|
||||||
</AppendRegistBox>
|
|
||||||
</Fragment>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
<AppendRegistBox>
|
|
||||||
<AppendRegistTable>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<th width="120">
|
|
||||||
<Label>아이템 첨부</Label>
|
|
||||||
</th>
|
|
||||||
<td>
|
|
||||||
<DetailInputItem>
|
|
||||||
<TextInput
|
|
||||||
placeholder="Item Meta id 입력"
|
|
||||||
value={item}
|
|
||||||
onChange={e => {
|
|
||||||
let list = [];
|
|
||||||
list = e.target.value.trimStart();
|
|
||||||
setItem(list);
|
|
||||||
}}
|
|
||||||
disabled={isReadOnly}
|
|
||||||
/>
|
|
||||||
<TextInput
|
|
||||||
placeholder="수량"
|
|
||||||
value={itemCount}
|
|
||||||
type="number"
|
|
||||||
onChange={e => handleItemCount(e)}
|
|
||||||
width="90px"
|
|
||||||
disabled={isReadOnly}
|
|
||||||
/>
|
|
||||||
<Button
|
|
||||||
text="추가"
|
|
||||||
theme={itemCount.length === 0 || item.length === 0 ? 'disable' : 'search'}
|
|
||||||
handleClick={handleItemList}
|
|
||||||
/>
|
|
||||||
{itemCheckMsg && <SearchBarAlert>{itemCheckMsg}</SearchBarAlert>}
|
|
||||||
</DetailInputItem>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th width="120">
|
|
||||||
<Label>자원 첨부</Label>
|
|
||||||
</th>
|
|
||||||
<td>
|
|
||||||
<DetailInputItem>
|
|
||||||
<SelectInput onChange={e => setResource(e.target.value)} value={resource} disabled={isReadOnly}>
|
|
||||||
{wellType.map((data, index) => (
|
|
||||||
<option key={index} value={data.value}>
|
|
||||||
{data.name}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</SelectInput>
|
|
||||||
<TextInput
|
|
||||||
placeholder="수량"
|
|
||||||
type="number"
|
|
||||||
value={resourceCount}
|
|
||||||
disabled={isReadOnly}
|
|
||||||
onChange={e => handleResourceCount(e)}
|
|
||||||
width="200px"
|
|
||||||
/>
|
|
||||||
<Button
|
|
||||||
text="추가"
|
|
||||||
theme={resourceCount.length === 0 || resource.length === 0 ? 'disable' : 'search'}
|
|
||||||
handleClick={handleResourceList}
|
|
||||||
width="100px"
|
|
||||||
height="35px"
|
|
||||||
errorMessage={isReadOnly} />
|
|
||||||
</DetailInputItem>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
{resultData.item_list && (
|
|
||||||
<ItemList>
|
|
||||||
{resultData.item_list.map((data, index) => {
|
|
||||||
return (
|
|
||||||
<Item key={index}>
|
|
||||||
<span>
|
|
||||||
{data.item_name}[{data.item}] ({data.item_cnt})
|
|
||||||
</span>
|
|
||||||
{!isReadOnly && <BtnDelete onClick={() => onItemRemove(index)}></BtnDelete>}
|
|
||||||
</Item>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</ItemList>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</AppendRegistTable>
|
|
||||||
</AppendRegistBox>
|
|
||||||
</DetailModalWrapper>
|
|
||||||
<BtnWrapper $justify="flex-end" $gap="10px" $paddingTop="20px">
|
|
||||||
<Button
|
|
||||||
text="확인"
|
|
||||||
theme="line"
|
|
||||||
name="확인버튼"
|
|
||||||
handleClick={() => {
|
|
||||||
handleDetailView();
|
|
||||||
handleReset();
|
|
||||||
setDetailData('');
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
{!isReadOnly && (
|
|
||||||
<Button
|
|
||||||
type="submit"
|
|
||||||
text="수정"
|
|
||||||
id="수정버튼"
|
|
||||||
theme={conditionCheck() ? 'primary' : 'disable'}
|
|
||||||
handleClick={() => handleSubmit('submit')}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</BtnWrapper>
|
|
||||||
</Modal>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default EventDetailModal;
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,979 +0,0 @@
|
|||||||
import { styled } from 'styled-components';
|
|
||||||
import RadioInput from '../../common/input/Radio';
|
|
||||||
import { useState, useEffect, Fragment } from 'react';
|
|
||||||
import CheckBox from '../../common/input/CheckBox';
|
|
||||||
|
|
||||||
import { Title, SelectInput, BtnWrapper, TextInput, Label, InputLabel, DatePickerWrapper, Textarea, ModalText, ButtonClose, SearchBarAlert } from '../../../styles/Components';
|
|
||||||
import Button from '../../common/button/Button';
|
|
||||||
import Modal from '../../common/modal/Modal';
|
|
||||||
|
|
||||||
import IconDelete from '../../../assets/img/icon/icon-delete.png';
|
|
||||||
import CloseIcon from '../../../assets/img/icon/icon-close.png';
|
|
||||||
import DatePickerComponent from '../../common/Date/DatePickerComponent';
|
|
||||||
import MailRegistUploadBtn from '../MailRegistUploadBtn';
|
|
||||||
import { benItems, HourList, MinuteList, modalTypes, wellType } from '../../../assets/data';
|
|
||||||
import { EventModify, MailModify } from '../../../apis';
|
|
||||||
|
|
||||||
import { authList } from '../../../store/authList';
|
|
||||||
import { useRecoilValue } from 'recoil';
|
|
||||||
import { convertKTC, convertKTCDate, timeDiffMinute } from '../../../utils';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
|
||||||
import DynamicModal from '../../common/modal/DynamicModal';
|
|
||||||
|
|
||||||
const MailDetailModal = ({ detailView, handleDetailView, content }) => {
|
|
||||||
const userInfo = useRecoilValue(authList);
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const token = sessionStorage.getItem('token');
|
|
||||||
|
|
||||||
const id = content && content.id;
|
|
||||||
const onlyView = userInfo.auth_list && !userInfo.auth_list.some(auth => auth.id === 23);
|
|
||||||
const updateAuth = userInfo.auth_list && userInfo.auth_list.some(auth => auth.id === 23);
|
|
||||||
|
|
||||||
const [sendHour, setSendHour] = useState('00');
|
|
||||||
const [sendMin, setSendMin] = useState('00');
|
|
||||||
|
|
||||||
const [item, setItem] = useState('');
|
|
||||||
const [itemCount, setItemCount] = useState('');
|
|
||||||
const [resource, setResource] = useState('19010001');
|
|
||||||
const [resourceCount, setResourceCount] = useState('');
|
|
||||||
|
|
||||||
const [modifyModal, setModifyModal] = useState('hidden');
|
|
||||||
const [completeModal, setCompleteModal] = useState('hidden');
|
|
||||||
const [resultData, setResultData] = useState({});
|
|
||||||
|
|
||||||
const [modalState, setModalState] = useState({
|
|
||||||
updateConfirmModal: 'hidden',
|
|
||||||
updateCompleteModal: 'hidden',
|
|
||||||
});
|
|
||||||
|
|
||||||
const [isNullValue, setIsNullValue] = useState(false);
|
|
||||||
// 과거 판단
|
|
||||||
const [isPast, setIsPast] = useState(false);
|
|
||||||
const [isChanged, setIsChanged] = useState(false);
|
|
||||||
const [isItemNullValue, setIsItemNullValue] = useState(false);
|
|
||||||
|
|
||||||
const [excelFile, setExcelFile] = useState(content.target ? content.target : '');
|
|
||||||
const [excelName, setExcelName] = useState(null);
|
|
||||||
const [downloadData, setDownLoadData] = useState(null);
|
|
||||||
|
|
||||||
const [btnValidation, setBtnValidation] = useState(false);
|
|
||||||
const [updateMessage, setUpdateMessage] = useState('수정이 완료되었습니다.');
|
|
||||||
const [alertMessage, setAlertMessage] = useState('');
|
|
||||||
const [undefinedFile, setUndefinedFile] = useState(false);
|
|
||||||
const [disabledBtn, setDisabledBtn] = useState(false); // 예약 발송 확인용
|
|
||||||
const [alertMsg, setAlertMsg] = useState('');
|
|
||||||
|
|
||||||
const KOREAN_TIME = content && convertKTCDate(content.send_dt);
|
|
||||||
|
|
||||||
const initialData = {
|
|
||||||
send_hour: content && KOREAN_TIME.getHours() < 10 ? '0' + content && KOREAN_TIME.getHours() : content && KOREAN_TIME.getHours(),
|
|
||||||
send_min: content && KOREAN_TIME.getMinutes() < 10 ? '0' + content && KOREAN_TIME.getMinutes() : content && KOREAN_TIME.getMinutes(),
|
|
||||||
send_status: content && content.send_status,
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
document.querySelector('#fileinput').value = '';
|
|
||||||
|
|
||||||
setResultData({
|
|
||||||
is_reserve: content && content.is_reserve,
|
|
||||||
send_dt: content && KOREAN_TIME,
|
|
||||||
mail_type: content && content.mail_type,
|
|
||||||
receive_type: content && content.receive_type,
|
|
||||||
user_type: content && content.user_type,
|
|
||||||
mail_list: content && content.mail_list,
|
|
||||||
item_list: content && content.item_list,
|
|
||||||
guid: content && content.target,
|
|
||||||
});
|
|
||||||
|
|
||||||
content && content.mail_list.length === 1 && setBtnValidation(true);
|
|
||||||
content && content.is_reserve === false && setBtnValidation(true);
|
|
||||||
|
|
||||||
setItem('');
|
|
||||||
KOREAN_TIME < new Date ? setIsPast(true) : setIsPast(false);
|
|
||||||
setExcelFile(content && content.target);
|
|
||||||
setDownLoadData(content && content.target);
|
|
||||||
setDisabledBtn(content && content.is_reserve && false);
|
|
||||||
|
|
||||||
// 복수 or 단일일 때 content.target을 exel name 으로 지정
|
|
||||||
(content && content.receive_type === 'MULTIPLE') ?
|
|
||||||
setExcelName(content && content.target)
|
|
||||||
: setExcelName('')
|
|
||||||
|
|
||||||
}, [content]);
|
|
||||||
|
|
||||||
// console.log('downloadData', downloadData);
|
|
||||||
// console.log('isPast', isPast);
|
|
||||||
// console.log("guid", resultData.guid)
|
|
||||||
// console.log("메일 형식", content && content.receive_type," 엑셀네임", excelName)
|
|
||||||
|
|
||||||
// 아이템 수량 숫자 체크
|
|
||||||
const handleItemCount = e => {
|
|
||||||
if (e.target.value === '0' || e.target.value === '-0') {
|
|
||||||
setItemCount('1');
|
|
||||||
e.target.value = '1';
|
|
||||||
} else if (e.target.value < 0) {
|
|
||||||
let plusNum = Math.abs(e.target.value);
|
|
||||||
setItemCount(plusNum);
|
|
||||||
} else {
|
|
||||||
setItemCount(e.target.value);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 아이템 추가
|
|
||||||
const handleItemList = () => {
|
|
||||||
if(benItems.includes(item)){
|
|
||||||
setAlertMsg(t('MAIL_ITEM_ADD_BEN'))
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
item.length === 0 || itemCount.length === 0 ? setIsItemNullValue(true) : setIsItemNullValue(false);
|
|
||||||
|
|
||||||
if (item.length === '' || itemCount.length === 0 || itemCount <= 0) {
|
|
||||||
setIsItemNullValue(true);
|
|
||||||
} else if (item.length !== 0) {
|
|
||||||
setIsItemNullValue(false);
|
|
||||||
setIsChanged(true);
|
|
||||||
|
|
||||||
const newItem = { item: item, item_cnt: itemCount };
|
|
||||||
resultData.item_list.push(newItem);
|
|
||||||
|
|
||||||
setItem('');
|
|
||||||
setItemCount('');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 아이템 삭제
|
|
||||||
const onItemRemove = id => {
|
|
||||||
let filterList = resultData.item_list && resultData.item_list.filter(item => item !== resultData.item_list[id]);
|
|
||||||
setIsChanged(true);
|
|
||||||
|
|
||||||
// console.log('filterList', filterList);
|
|
||||||
|
|
||||||
setResultData({ ...resultData, item_list: filterList });
|
|
||||||
};
|
|
||||||
|
|
||||||
// 자원 수량 숫자 체크
|
|
||||||
const handleResourceCount = e => {
|
|
||||||
if (e.target.value === '0' || e.target.value === '-0') {
|
|
||||||
setResourceCount('1');
|
|
||||||
e.target.value = '1';
|
|
||||||
} else if (e.target.value < 0) {
|
|
||||||
let plusNum = Math.abs(e.target.value);
|
|
||||||
setResourceCount(plusNum);
|
|
||||||
} else {
|
|
||||||
setResourceCount(e.target.value);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 자원 추가
|
|
||||||
const handleResourceList = () => {
|
|
||||||
resourceCount.length === 0 ? setIsItemNullValue(true) : setIsItemNullValue(false);
|
|
||||||
|
|
||||||
if (resourceCount.length === 0 || resourceCount <= 0) {
|
|
||||||
setIsItemNullValue(true);
|
|
||||||
} else {
|
|
||||||
setIsItemNullValue(false);
|
|
||||||
const name = wellType.find(well => well.value === resource).name;
|
|
||||||
const newItem = { item: resource, item_cnt: resourceCount, item_name: name };
|
|
||||||
|
|
||||||
resultData.item_list.push(newItem);
|
|
||||||
|
|
||||||
setResourceCount('');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 입력창 삭제
|
|
||||||
const onLangDelete = language => {
|
|
||||||
let filterList = resultData.mail_list && resultData.mail_list.filter(el => el.language !== language);
|
|
||||||
|
|
||||||
if (filterList.length === 1) setBtnValidation(true);
|
|
||||||
|
|
||||||
setIsChanged(true);
|
|
||||||
setResultData({ ...resultData, mail_list: filterList });
|
|
||||||
};
|
|
||||||
|
|
||||||
// 발송 날짜 세팅 로직
|
|
||||||
const handleSelectedDate = data => {
|
|
||||||
const sendDate = new Date(data);
|
|
||||||
|
|
||||||
const resultSendData = new Date(sendDate.getFullYear(), sendDate.getMonth(), sendDate.getDate(), sendHour, sendMin);
|
|
||||||
|
|
||||||
setIsChanged(true);
|
|
||||||
setResultData({ ...resultData, send_dt: resultSendData });
|
|
||||||
};
|
|
||||||
|
|
||||||
// 발송 시간 세팅 로직
|
|
||||||
const handleSendTime = e => {
|
|
||||||
if (e.target.id === 'hour') setSendHour(e.target.value);
|
|
||||||
else if (e.target.id === 'min') setSendMin(e.target.value);
|
|
||||||
|
|
||||||
const sendDate = new Date(resultData.send_dt);
|
|
||||||
const result = new Date(sendDate.getFullYear(), sendDate.getMonth(), sendDate.getDate(), e.target.id === 'hour' ? e.target.value : sendHour, e.target.id === 'min' ? e.target.value : sendMin);
|
|
||||||
|
|
||||||
setIsChanged(true);
|
|
||||||
setResultData({ ...resultData, send_dt: result });
|
|
||||||
};
|
|
||||||
|
|
||||||
// 우편 상세 정보 수정
|
|
||||||
const handleModifyModal = () => {
|
|
||||||
if (
|
|
||||||
resultData.mail_list.map(data => data.content === '' || data.title === '').includes(true) ||
|
|
||||||
(resultData.receive_type === 'MULTIPLE' ? excelFile === null : resultData.guid === '') ||
|
|
||||||
resultData.send_dt.length === 0 ||
|
|
||||||
resultData.mail_type === 'SELECT' ||
|
|
||||||
isChanged === false ||
|
|
||||||
alertMessage
|
|
||||||
) {
|
|
||||||
isChanged === true && setIsNullValue(true);
|
|
||||||
} else {
|
|
||||||
// 복수로 수정하거나 복수로 등록할 때 항상 excel name을 넘겨줘야합니다.
|
|
||||||
content && content.receive_type === 'MULTIPLE' ? setResultData({ ...resultData, file_name: excelName === null ? downloadData : excelName }) : setExcelName('');
|
|
||||||
|
|
||||||
// setExcelName(content && content.target)
|
|
||||||
|
|
||||||
setIsNullValue(false);
|
|
||||||
if (modifyModal === 'hidden') {
|
|
||||||
setModifyModal('view');
|
|
||||||
} else {
|
|
||||||
setModifyModal('hidden');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 상세 정보 단일 체크
|
|
||||||
const handleSingleBtn = () => {
|
|
||||||
if (content && content.is_reserve === true && !onlyView && !isPast) {
|
|
||||||
setResultData({ ...resultData, guid: '' });
|
|
||||||
delete resultData.file_name;
|
|
||||||
|
|
||||||
document.querySelector('#fileinput').value = '';
|
|
||||||
|
|
||||||
setExcelFile(null);
|
|
||||||
setIsChanged(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
// 상세 정보 복수 체크
|
|
||||||
const handleMultiBtn = () => {
|
|
||||||
if (content && content.is_reserve === true) {
|
|
||||||
delete resultData.guid;
|
|
||||||
}
|
|
||||||
setIsChanged(true);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 완료 모달창
|
|
||||||
const handleCompleteModal = () => {
|
|
||||||
if (completeModal === 'hidden') {
|
|
||||||
setCompleteModal('view');
|
|
||||||
} else {
|
|
||||||
setCompleteModal('hidden');
|
|
||||||
|
|
||||||
window.location.reload();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 메일 수정 버튼
|
|
||||||
const handleModifyMail = () => {
|
|
||||||
|
|
||||||
if(resultData.receive_type === 'MULTIPLE') {
|
|
||||||
delete resultData.guid
|
|
||||||
|
|
||||||
MailModify(token, id, resultData);
|
|
||||||
} else {
|
|
||||||
MailModify(token, id, resultData);
|
|
||||||
}
|
|
||||||
|
|
||||||
handleCompleteModal();
|
|
||||||
handleModifyModal();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 확인 버튼 후 다 초기화
|
|
||||||
const handleReset = () => {
|
|
||||||
setBtnValidation(false);
|
|
||||||
setIsNullValue(false);
|
|
||||||
setIsChanged(false);
|
|
||||||
setUndefinedFile(false);
|
|
||||||
setIsItemNullValue(false);
|
|
||||||
setAlertMessage('');
|
|
||||||
setExcelFile(null);
|
|
||||||
setExcelName(null);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 상세 페이지에서 파일 삭제
|
|
||||||
const handleDetailDelete = e => {
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
if (content && content.is_reserve === true) {
|
|
||||||
setDownLoadData(undefined);
|
|
||||||
setUndefinedFile(true);
|
|
||||||
setResultData({ ...resultData, guid: '' });
|
|
||||||
delete resultData.file_name;
|
|
||||||
|
|
||||||
document.querySelector('#fileinput').value = '';
|
|
||||||
|
|
||||||
setExcelFile(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
setIsChanged(true);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleModalView = (type) => {
|
|
||||||
setModalState((prevState) => ({
|
|
||||||
...prevState,
|
|
||||||
[`${type}Modal`]: 'view',
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleModalClose = (type) => {
|
|
||||||
setModalState((prevState) => ({
|
|
||||||
...prevState,
|
|
||||||
[`${type}Modal`]: 'hidden',
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleSubmit = async (type, param = null) => {
|
|
||||||
switch (type) {
|
|
||||||
case "submit":
|
|
||||||
// if (!conditionCheck()) return;
|
|
||||||
|
|
||||||
handleModalView('updateConfirm');
|
|
||||||
break;
|
|
||||||
case "updateConfirm":
|
|
||||||
const timeDiff = timeDiffMinute(resultData.start_dt, (new Date))
|
|
||||||
// 이벤트 시작 30분전이나 이미 SystemMail이 add된 상태에서는 수정할 수 없다.
|
|
||||||
if(content.add_flag || timeDiff <= 30){
|
|
||||||
setAlertMsg(t('EVENT_TIME_LIMIT_UPDATE'));
|
|
||||||
handleModalClose('updateConfirm');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
EventModify(token, id, resultData);
|
|
||||||
handleModalClose('updateConfirm');
|
|
||||||
handleModalView('updateComplete');
|
|
||||||
break;
|
|
||||||
case "updateComplete":
|
|
||||||
handleModalClose('updateComplete');
|
|
||||||
window.location.reload();
|
|
||||||
break;
|
|
||||||
case "warning":
|
|
||||||
setAlertMsg('');
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Modal min="960px" $view={detailView}>
|
|
||||||
<Title $align="center">우편 상세 정보</Title>
|
|
||||||
|
|
||||||
<RegistInfo>
|
|
||||||
<span>등록자 : {content && content.create_by}</span>
|
|
||||||
<span>등록일 : {content && convertKTC(content.create_dt, false)}</span>
|
|
||||||
{content && typeof content.update_by !== 'undefined' && (
|
|
||||||
<>
|
|
||||||
<span>수정자 : {content && content.update_by}</span>
|
|
||||||
<span>수정일 : {content && convertKTC(content.update_dt, false)}</span>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</RegistInfo>
|
|
||||||
<ModalWrapper>
|
|
||||||
<RegistGroup>
|
|
||||||
<InputRow>
|
|
||||||
<CheckBox
|
|
||||||
label="예약 발송"
|
|
||||||
id="reserve"
|
|
||||||
checked={resultData && resultData.is_reserve}
|
|
||||||
setData={e => {
|
|
||||||
setResultData({ ...resultData, is_reserve: e.target.checked });
|
|
||||||
setDisabledBtn(e.target.checked);
|
|
||||||
setIsChanged(true);
|
|
||||||
}}
|
|
||||||
disabled={(content && content.is_reserve === false) || onlyView}
|
|
||||||
/>
|
|
||||||
{content && content.is_reserve === false ? (
|
|
||||||
<></>
|
|
||||||
) : (
|
|
||||||
content &&
|
|
||||||
content.is_reserve === true &&
|
|
||||||
resultData.is_reserve === true && (
|
|
||||||
<InputItem>
|
|
||||||
<InputLabel>발송 시간</InputLabel>
|
|
||||||
<InputGroup>
|
|
||||||
<DatePickerWrapper>
|
|
||||||
<DatePickerComponent
|
|
||||||
readOnly={(content && content.is_reserve === false) || onlyView || isPast}
|
|
||||||
name={initialData.send_dt}
|
|
||||||
selectedDate={resultData ? resultData.send_dt : initialData.send_dt}
|
|
||||||
handleSelectedDate={data => handleSelectedDate(data)}
|
|
||||||
pastDate={new Date()}
|
|
||||||
/>
|
|
||||||
</DatePickerWrapper>
|
|
||||||
<SelectInput
|
|
||||||
onChange={e => handleSendTime(e)}
|
|
||||||
id="hour"
|
|
||||||
disabled={(content && content.is_reserve === false) || onlyView || isPast}
|
|
||||||
value={
|
|
||||||
resultData && String(new Date(resultData.send_dt).getHours()) < 10
|
|
||||||
? '0' + String(new Date(resultData.send_dt).getHours())
|
|
||||||
: resultData && String(new Date(resultData.send_dt).getHours())
|
|
||||||
}>
|
|
||||||
{HourList.map(hour => (
|
|
||||||
<option
|
|
||||||
value={hour}
|
|
||||||
key={hour}
|
|
||||||
// selected={
|
|
||||||
// resultData && String(new Date(resultData.send_dt).getHours()) < 10
|
|
||||||
// ? '0' + String(new Date(resultData.send_dt).getHours()) === hour
|
|
||||||
// : resultData && String(new Date(resultData.send_dt).getHours()) === hour
|
|
||||||
// ? 'selected'
|
|
||||||
// : ''
|
|
||||||
// }
|
|
||||||
>
|
|
||||||
{hour}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</SelectInput>
|
|
||||||
<SelectInput
|
|
||||||
onChange={e => {
|
|
||||||
handleSendTime(e);
|
|
||||||
setIsChanged(true);
|
|
||||||
}}
|
|
||||||
id="min"
|
|
||||||
disabled={(content && content.is_reserve === false) || onlyView || isPast}
|
|
||||||
value={
|
|
||||||
resultData && String(new Date(resultData.send_dt).getMinutes()) < 10
|
|
||||||
? '0' + String(new Date(resultData.send_dt).getMinutes())
|
|
||||||
: resultData && String(new Date(resultData.send_dt).getMinutes())
|
|
||||||
}>
|
|
||||||
{MinuteList.map(min => (
|
|
||||||
<option
|
|
||||||
value={min}
|
|
||||||
key={min}
|
|
||||||
// selected={
|
|
||||||
// resultData && String(new Date(resultData.send_dt).getMinutes()) < 10
|
|
||||||
// ? '0' + String(new Date(resultData.send_dt).getMinutes()) === min
|
|
||||||
// : resultData && String(new Date(resultData.send_dt).getMinutes()) === min
|
|
||||||
// ? 'selected'
|
|
||||||
// : ''
|
|
||||||
// }
|
|
||||||
>
|
|
||||||
{min}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</SelectInput>
|
|
||||||
</InputGroup>
|
|
||||||
</InputItem>
|
|
||||||
)
|
|
||||||
)}
|
|
||||||
<InputItem>
|
|
||||||
<InputLabel>우편 타입</InputLabel>
|
|
||||||
<SelectInput
|
|
||||||
onChange={e => {
|
|
||||||
setResultData({ ...resultData, mail_type: e.target.value });
|
|
||||||
setIsChanged(true);
|
|
||||||
}}
|
|
||||||
value={content && resultData.mail_type}
|
|
||||||
disabled={(content && content.is_reserve === false) || onlyView || isPast}>
|
|
||||||
<option value="SELECT">타입 선택</option>
|
|
||||||
<option value="SYSTEM_GUID">시스템 안내</option>
|
|
||||||
<option value="INSPECTION_COMPENSATION">점검 보상</option>
|
|
||||||
<option value="RECOVER_COMPENSATION">복구 보상</option>
|
|
||||||
<option value="EVENT_COMPENSATION">이벤트 보상</option>
|
|
||||||
</SelectInput>
|
|
||||||
</InputItem>
|
|
||||||
<InputItem>
|
|
||||||
<InputLabel>발송상태</InputLabel>
|
|
||||||
<div>
|
|
||||||
{content && initialData.send_status === 'WAIT' && <MailState>대기</MailState>}
|
|
||||||
{content && initialData.send_status === 'FINISH' && <MailState result="success">완료</MailState>}
|
|
||||||
{content && initialData.send_status === 'FAIL' && <MailState result="fail">실패</MailState>}
|
|
||||||
</div>
|
|
||||||
</InputItem>
|
|
||||||
</InputRow>
|
|
||||||
<MailReceiver>
|
|
||||||
<InputItem>
|
|
||||||
<InputLabel>수신대상</InputLabel>
|
|
||||||
<InputItem>
|
|
||||||
<SelectInput onChange={e => setResultData({ ...resultData, user_type: e.target.value })} value={resultData.user_type} disabled={(content && content.is_reserve === false) || onlyView || isPast}>
|
|
||||||
<option value="GUID">GUID</option>
|
|
||||||
<option value="NICKNAME">아바타명</option>
|
|
||||||
</SelectInput>
|
|
||||||
</InputItem>
|
|
||||||
<div>
|
|
||||||
<InputGroup>
|
|
||||||
<RadioInput
|
|
||||||
label="단일"
|
|
||||||
id="SINGLE"
|
|
||||||
name="receiver"
|
|
||||||
value="SINGLE"
|
|
||||||
disabled={(content && content.is_reserve === false) || onlyView || isPast}
|
|
||||||
fontWeight="600"
|
|
||||||
checked={resultData.receive_type === 'SINGLE'}
|
|
||||||
handleChange={e => {
|
|
||||||
setResultData({ ...resultData, receive_type: e.target.id });
|
|
||||||
setIsChanged(true);
|
|
||||||
}}
|
|
||||||
handleClick={handleSingleBtn}
|
|
||||||
/>
|
|
||||||
<TextInput
|
|
||||||
placeholder={resultData.user_type === "GUID" ? "GUID 입력" : resultData.user_type === "NICKNAME" ? "아바타명 입력" : "이메일 입력"}
|
|
||||||
disabled={resultData.receive_type !== 'SINGLE' || (content && content.is_reserve === false) || onlyView || isPast}
|
|
||||||
// defaultValue={resultData.receive_type === 'SINGLE' && resultData.guid !== '' ? content.target : ''}
|
|
||||||
value={resultData.receive_type === 'SINGLE' && resultData.guid !== '' ? resultData.guid : ''}
|
|
||||||
onChange={e => {
|
|
||||||
let list = [...resultData.guid];
|
|
||||||
list = e.target.value;
|
|
||||||
setResultData({ ...resultData, guid: list });
|
|
||||||
setIsChanged(true);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</InputGroup>
|
|
||||||
{content && resultData.receive_type === 'MULTIPLE' && typeof resultData.guid !== 'undefined' ? (
|
|
||||||
<InputGroup>
|
|
||||||
<RadioInput
|
|
||||||
label="복수"
|
|
||||||
id="MULTIPLE"
|
|
||||||
name="receiver"
|
|
||||||
value="MULTIPLE"
|
|
||||||
fontWeight="600"
|
|
||||||
checked={content && resultData.receive_type === 'MULTIPLE'}
|
|
||||||
disabled
|
|
||||||
/>
|
|
||||||
<MailRegistUploadBtn
|
|
||||||
disabled={resultData.receive_type !== 'MULTIPLE'}
|
|
||||||
downloadData={downloadData}
|
|
||||||
setResultData={setResultData}
|
|
||||||
resultData={resultData}
|
|
||||||
handleDetailDelete={handleDetailDelete}
|
|
||||||
setExcelFile={setExcelFile}
|
|
||||||
alertMessage={alertMessage}
|
|
||||||
setAlertMessage={setAlertMessage}
|
|
||||||
undefinedFile={undefinedFile}
|
|
||||||
disabledBtn={disabledBtn}
|
|
||||||
excelName={excelName}
|
|
||||||
setExcelName={setExcelName}
|
|
||||||
status={initialData.send_status}
|
|
||||||
/>
|
|
||||||
</InputGroup>
|
|
||||||
) : (
|
|
||||||
<InputGroup>
|
|
||||||
<RadioInput
|
|
||||||
label="복수"
|
|
||||||
id="MULTIPLE"
|
|
||||||
name="receiver"
|
|
||||||
value="MULTIPLE"
|
|
||||||
fontWeight="600"
|
|
||||||
disabled={(content && content.is_reserve === false) || onlyView || isPast}
|
|
||||||
handleChange={e => setResultData({ ...resultData, receive_type: e.target.id })}
|
|
||||||
handleClick={handleMultiBtn}
|
|
||||||
/>
|
|
||||||
<MailRegistUploadBtn
|
|
||||||
setUpdateMessage={setUpdateMessage}
|
|
||||||
disabled={resultData.receive_type !== 'MULTIPLE'}
|
|
||||||
setResultData={setResultData}
|
|
||||||
resultData={resultData}
|
|
||||||
excelFile={excelFile}
|
|
||||||
setExcelFile={setExcelFile}
|
|
||||||
alertMessage={alertMessage}
|
|
||||||
setAlertMessage={setAlertMessage}
|
|
||||||
undefinedFile={undefinedFile}
|
|
||||||
handleDetailDelete={handleDetailDelete}
|
|
||||||
disabledBtn={disabledBtn}
|
|
||||||
excelName={excelName}
|
|
||||||
setExcelName={setExcelName}
|
|
||||||
status={initialData.send_status}
|
|
||||||
/>
|
|
||||||
</InputGroup>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</InputItem>
|
|
||||||
</MailReceiver>
|
|
||||||
</RegistGroup>
|
|
||||||
{resultData.mail_list &&
|
|
||||||
resultData.mail_list.map(data => {
|
|
||||||
return (
|
|
||||||
<Fragment key={data.language}>
|
|
||||||
<MailRegistBox>
|
|
||||||
<LangArea>
|
|
||||||
언어 : {data.language}
|
|
||||||
{btnValidation === false ? (
|
|
||||||
<BtnClose
|
|
||||||
onClick={e => {
|
|
||||||
e.preventDefault();
|
|
||||||
onLangDelete(data.language);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<BtnClose opacity="10%" />
|
|
||||||
)}
|
|
||||||
</LangArea>
|
|
||||||
<MailRegistTable>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<th width="120">
|
|
||||||
<Label>제목</Label>
|
|
||||||
</th>
|
|
||||||
<td>
|
|
||||||
<InputItem>
|
|
||||||
<TextInput
|
|
||||||
placeholder="우편 제목 입력"
|
|
||||||
maxLength="30"
|
|
||||||
id={data.language}
|
|
||||||
value={data.title}
|
|
||||||
readOnly={(content && content.is_reserve === false) || onlyView || isPast}
|
|
||||||
onChange={e => {
|
|
||||||
let list = [...resultData.mail_list];
|
|
||||||
let findIndex = resultData.mail_list && resultData.mail_list.findIndex(item => item.language === e.target.id);
|
|
||||||
list[findIndex].title = e.target.value.trimStart();
|
|
||||||
|
|
||||||
setResultData({ ...resultData, mail_list: list });
|
|
||||||
setIsChanged(true);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</InputItem>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th>
|
|
||||||
<Label>내용</Label>
|
|
||||||
</th>
|
|
||||||
<td>
|
|
||||||
<Textarea
|
|
||||||
value={data.content}
|
|
||||||
readOnly={(content && content.is_reserve === false) || onlyView || isPast}
|
|
||||||
id={data.language}
|
|
||||||
onChange={e => {
|
|
||||||
if (e.target.value.length > 2000) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let list = [...resultData.mail_list];
|
|
||||||
let findIndex = resultData.mail_list && resultData.mail_list.findIndex(item => item.language === e.target.id);
|
|
||||||
list[findIndex].content = e.target.value.trimStart();
|
|
||||||
|
|
||||||
setResultData({ ...resultData, mail_list: list });
|
|
||||||
setIsChanged(true);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</MailRegistTable>
|
|
||||||
</MailRegistBox>
|
|
||||||
</Fragment>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
<MailRegistBox>
|
|
||||||
<MailRegistTable>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<th width="120">
|
|
||||||
<Label>아이템 첨부</Label>
|
|
||||||
</th>
|
|
||||||
<td>
|
|
||||||
<InputItem>
|
|
||||||
<TextInput
|
|
||||||
placeholder="Item Meta id 입력"
|
|
||||||
value={item}
|
|
||||||
onChange={e => {
|
|
||||||
let list = [];
|
|
||||||
list = e.target.value.trimStart();
|
|
||||||
setItem(list);
|
|
||||||
}}
|
|
||||||
disabled={(content && content.is_reserve === false) || onlyView || isPast}
|
|
||||||
/>
|
|
||||||
<TextInput
|
|
||||||
placeholder="수량"
|
|
||||||
value={itemCount}
|
|
||||||
type="number"
|
|
||||||
onChange={e => handleItemCount(e)}
|
|
||||||
width="90px"
|
|
||||||
disabled={(content && content.is_reserve === false) || onlyView || isPast}
|
|
||||||
/>
|
|
||||||
<Button
|
|
||||||
text="추가"
|
|
||||||
theme={itemCount.length === 0 || item.length === 0 ? 'disable' : 'search'}
|
|
||||||
handleClick={handleItemList}
|
|
||||||
errorMessage={(content && content.is_reserve === false) || onlyView || isPast}
|
|
||||||
/>
|
|
||||||
</InputItem>
|
|
||||||
{/* {isItemNullValue && <SearchBarAlert $marginTop="15px">필수값을 입력해주세요.</SearchBarAlert>}
|
|
||||||
<div>
|
|
||||||
{resultData.item_list && (
|
|
||||||
<ItemList>
|
|
||||||
{content &&
|
|
||||||
resultData.item_list.map((data, index) => {
|
|
||||||
return (
|
|
||||||
<Item key={index}>
|
|
||||||
<span>
|
|
||||||
{data.item}({data.item_cnt})
|
|
||||||
</span>
|
|
||||||
{(content && content.is_reserve === false) ||
|
|
||||||
(updateAuth && <BtnDelete onClick={() => onItemRemove(index)}></BtnDelete>) ||
|
|
||||||
isPast
|
|
||||||
}
|
|
||||||
</Item>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</ItemList>
|
|
||||||
)}
|
|
||||||
</div> */}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th width="120">
|
|
||||||
<Label>자원 첨부</Label>
|
|
||||||
</th>
|
|
||||||
<td>
|
|
||||||
<InputItem>
|
|
||||||
<SelectInput onChange={e => setResource(e.target.value)} value={resource} disabled={(content && content.is_reserve === false) || onlyView || isPast}>
|
|
||||||
{wellType.map((data, index) => (
|
|
||||||
<option key={index} value={data.value}>
|
|
||||||
{data.name}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</SelectInput>
|
|
||||||
<TextInput placeholder="수량" type="number" value={resourceCount} disabled={(content && content.is_reserve === false) || onlyView || isPast} onChange={e => handleResourceCount(e)} width="200px" />
|
|
||||||
<Button text="추가" theme={resourceCount.length === 0 || resource.length === 0 ? 'disable' : 'search'} handleClick={handleResourceList} width="100px" height="35px" errorMessage={(content && content.is_reserve === false) || onlyView || isPast} />
|
|
||||||
</InputItem>
|
|
||||||
{isItemNullValue && <SearchBarAlert $marginTop="15px">필수값을 입력해주세요.</SearchBarAlert>}
|
|
||||||
|
|
||||||
<div>
|
|
||||||
{resultData.item_list && (
|
|
||||||
<ItemList>
|
|
||||||
{resultData.item_list.map((data, index) => {
|
|
||||||
return (
|
|
||||||
<Item key={index}>
|
|
||||||
<span>
|
|
||||||
{data.item_name}[{data.item}] ({data.item_cnt})
|
|
||||||
</span>
|
|
||||||
{(content && content.is_reserve === true) || onlyView || isPast && <BtnDelete onClick={() => onItemRemove(index)}></BtnDelete>}
|
|
||||||
</Item>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</ItemList>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</MailRegistTable>
|
|
||||||
</MailRegistBox>
|
|
||||||
</ModalWrapper>
|
|
||||||
<BtnWrapper $justify="flex-end" $gap="10px" $paddingTop="20px">
|
|
||||||
<Button
|
|
||||||
text="확인"
|
|
||||||
theme="line"
|
|
||||||
name="확인버튼"
|
|
||||||
handleClick={() => {
|
|
||||||
handleDetailView();
|
|
||||||
handleReset();
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
{(updateAuth && content && content.is_reserve === true) && !isPast && (
|
|
||||||
<Button
|
|
||||||
type="submit"
|
|
||||||
text="수정"
|
|
||||||
id="수정버튼"
|
|
||||||
theme={
|
|
||||||
(content && content.mail_list.map(data => data.content === '' || data.title === '').includes(true)) ||
|
|
||||||
(resultData.receive_type === 'MULTIPLE' ? excelFile === null : resultData.guid === '') ||
|
|
||||||
resultData.mail_type === 'SELECT' ||
|
|
||||||
isChanged === false ||
|
|
||||||
alertMessage.length > 1
|
|
||||||
? 'disable'
|
|
||||||
: 'primary'
|
|
||||||
}
|
|
||||||
handleClick={() => {
|
|
||||||
handleModifyModal();
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</BtnWrapper>
|
|
||||||
</Modal>
|
|
||||||
{/* 확인 모달 */}
|
|
||||||
<Modal min="440px" $padding="40px" $bgcolor="transparent" $view={modifyModal}>
|
|
||||||
<BtnWrapper $justify="flex-end">
|
|
||||||
<ButtonClose onClick={handleModifyModal} />
|
|
||||||
</BtnWrapper>
|
|
||||||
<ModalText $align="center">
|
|
||||||
우편 정보 수정사항을 <br />
|
|
||||||
저장하시겠습니까?
|
|
||||||
</ModalText>
|
|
||||||
<BtnWrapper $gap="10px">
|
|
||||||
<Button text="취소" theme="line" size="large" width="100%" handleClick={handleModifyModal} />
|
|
||||||
<Button text="확인" theme="primary" type="submit" size="large" width="100%" handleClick={handleModifyMail} />
|
|
||||||
</BtnWrapper>
|
|
||||||
</Modal>
|
|
||||||
{/* 완료 모달 */}
|
|
||||||
<Modal min="440px" $padding="40px" $bgcolor="transparent" $view={completeModal}>
|
|
||||||
<BtnWrapper $justify="flex-end">
|
|
||||||
<ButtonClose onClick={handleCompleteModal} />
|
|
||||||
</BtnWrapper>
|
|
||||||
<ModalText $align="center">수정이 완료되었습니다. </ModalText>
|
|
||||||
<BtnWrapper $gap="10px">
|
|
||||||
<Button text="확인" theme="primary" type="submit" size="large" width="100%" handleClick={handleCompleteModal} />
|
|
||||||
</BtnWrapper>
|
|
||||||
</Modal>
|
|
||||||
{/* 경고 모달 */}
|
|
||||||
<DynamicModal
|
|
||||||
modalType={modalTypes.completed}
|
|
||||||
view={alertMsg ? 'view' : 'hidden'}
|
|
||||||
modalText={alertMsg}
|
|
||||||
handleSubmit={() => handleSubmit('warning')}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default MailDetailModal;
|
|
||||||
|
|
||||||
const InputItem = styled.div`
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 20px;
|
|
||||||
${TextInput},${SelectInput} {
|
|
||||||
height: 35px;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
${TextInput} {
|
|
||||||
padding: 0 15px;
|
|
||||||
}
|
|
||||||
${SelectInput} {
|
|
||||||
width: max-content;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const ModalWrapper = styled.div`
|
|
||||||
max-height: 70vh;
|
|
||||||
padding-bottom: 5px;
|
|
||||||
overflow: auto;
|
|
||||||
&::-webkit-scrollbar {
|
|
||||||
width: 4px;
|
|
||||||
}
|
|
||||||
&::-webkit-scrollbar-thumb {
|
|
||||||
background: #666666;
|
|
||||||
}
|
|
||||||
&::-webkit-scrollbar-track {
|
|
||||||
background: #d9d9d9;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const RegistInfo = styled.div`
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
gap: 50px;
|
|
||||||
font-size: 14px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const BtnClose = styled.button`
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
background: url(${CloseIcon}) 50% 50% no-repeat;
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
transform: translate(0, -50%);
|
|
||||||
right: 20px;
|
|
||||||
opacity: ${props => props.opacity};
|
|
||||||
`;
|
|
||||||
|
|
||||||
const LangArea = styled.div`
|
|
||||||
background: #f9f9f9;
|
|
||||||
padding: 10px 20px;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 600;
|
|
||||||
position: relative;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const MailRegistBox = styled.div`
|
|
||||||
margin-bottom: 20px;
|
|
||||||
border-top: 1px solid #999;
|
|
||||||
border-bottom: 1px solid #999;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const MailRegistTable = styled.table`
|
|
||||||
th,
|
|
||||||
td {
|
|
||||||
padding: 15px 0;
|
|
||||||
}
|
|
||||||
td {
|
|
||||||
${TextInput} {
|
|
||||||
max-width: 600px;
|
|
||||||
}
|
|
||||||
${Textarea} {
|
|
||||||
width: 100%;
|
|
||||||
border: 1px solid #d9d9d9;
|
|
||||||
border-radius: 5px;
|
|
||||||
height: 150px;
|
|
||||||
padding: 15px;
|
|
||||||
&:focus {
|
|
||||||
border: 1px solid #2c2c2c;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const RegistGroup = styled.div`
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
flex-flow: column;
|
|
||||||
gap: 20px;
|
|
||||||
padding: 20px;
|
|
||||||
border-top: 1px solid #000;
|
|
||||||
border-bottom: 1px solid #000;
|
|
||||||
font-size: 14px;
|
|
||||||
margin-bottom: 40px;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const InputRow = styled.div`
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 20px 50px;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const InputGroup = styled.div`
|
|
||||||
display: flex;
|
|
||||||
gap: 5px;
|
|
||||||
align-items: center;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const MailReceiver = styled.div`
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-start;
|
|
||||||
${InputItem} {
|
|
||||||
align-items: flex-start;
|
|
||||||
}
|
|
||||||
${InputLabel} {
|
|
||||||
line-height: 35px;
|
|
||||||
}
|
|
||||||
${TextInput} {
|
|
||||||
margin-left: 20px;
|
|
||||||
width: 400px;
|
|
||||||
}
|
|
||||||
${InputGroup} {
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const MailState = styled.span`
|
|
||||||
font-weight: 600;
|
|
||||||
color: ${props => (props.result === 'success' ? '#08994B' : props.result === 'fail' ? '#ff0000' : '#2c2c2c')};
|
|
||||||
`;
|
|
||||||
|
|
||||||
const ItemList = styled.ul`
|
|
||||||
display: flex;
|
|
||||||
gap: 20px;
|
|
||||||
padding: 10px 20px;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const Item = styled.li`
|
|
||||||
display: flex;
|
|
||||||
gap: 5px;
|
|
||||||
align-items: center;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const BtnDelete = styled.button`
|
|
||||||
width: 12px;
|
|
||||||
height: 12px;
|
|
||||||
background: url(${IconDelete}) 50% 50% no-repeat;
|
|
||||||
`;
|
|
||||||
@@ -1,206 +0,0 @@
|
|||||||
import { Fragment, useState } from 'react';
|
|
||||||
import { styled } from 'styled-components';
|
|
||||||
|
|
||||||
import { Title, TableStyle, BtnWrapper, TextInput } from '../../../styles/Components';
|
|
||||||
import Modal from '../../common/modal/Modal';
|
|
||||||
import Button from '../../common/button/Button';
|
|
||||||
import { convertKTC } from '../../../utils';
|
|
||||||
|
|
||||||
const UserBlockDetailModal = ({ stateModal, handleModal, data }) => {
|
|
||||||
const history = data.history;
|
|
||||||
|
|
||||||
const type = [
|
|
||||||
{ value: 'ACCESS_RESTRICTIONS', name: '접근 제한' },
|
|
||||||
{ value: 'CHATTING_RESTRICTIONS', name: '채팅 제한' },
|
|
||||||
];
|
|
||||||
|
|
||||||
const sanctions = [
|
|
||||||
{ value: 'BAD_BEHAVIOR', name: '비매너 행위' },
|
|
||||||
{ value: 'INAPPROPRIATE_NAME', name: '불건전 이름 사용' },
|
|
||||||
{ value: 'CASH_TRANSACTION', name: '현금거래 행위' },
|
|
||||||
{ value: 'GAME_INTERFERENCE', name: '게임 진행 방해' },
|
|
||||||
{ value: 'SERVICE_INTERFERENCE', name: '운영서비스 방해' },
|
|
||||||
{ value: 'ACCOUNT_IMPERSONATION', name: '계정도용' },
|
|
||||||
{ value: 'BUG_ABUSE', name: '버그/어뷰징' },
|
|
||||||
{ value: 'ILLEGAL_PROGRAM', name: '불법프로그램 사용' },
|
|
||||||
{ value: 'PERSONAL_INFO_LEAK', name: '개인정보 유출' },
|
|
||||||
{ value: 'ADMIN_IMPERSONATION', name: '운영자 사칭' },
|
|
||||||
];
|
|
||||||
|
|
||||||
const period = [
|
|
||||||
{ value: 'WARNING', name: '경고' },
|
|
||||||
{ value: 'D1', name: '1일' },
|
|
||||||
{ value: 'D3', name: '3일' },
|
|
||||||
{ value: 'D7', name: '7일' },
|
|
||||||
{ value: 'D15', name: '15일' },
|
|
||||||
{ value: 'D30', name: '30일' },
|
|
||||||
{ value: 'PERMANENT', name: '영구정지' },
|
|
||||||
];
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Modal min="960px" $view={stateModal}>
|
|
||||||
<Title $align="center">이용자 제재 상세 정보</Title>
|
|
||||||
<RegistInfo>
|
|
||||||
<span>등록자 : {data.create_by}</span>
|
|
||||||
<span>등록일 : {convertKTC(data.create_dt, false)}</span>
|
|
||||||
</RegistInfo>
|
|
||||||
<BlockDetailState>
|
|
||||||
<table>
|
|
||||||
<caption></caption>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<th width="100px">유저 GUID</th>
|
|
||||||
<td>
|
|
||||||
<TextInput value={data && data.guid || ''} disabled />
|
|
||||||
</td>
|
|
||||||
<th width="100px">아바타명</th>
|
|
||||||
<td>
|
|
||||||
<TextInput value={data && data.nickname || ''} disabled />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th>제재 방식</th>
|
|
||||||
<td>
|
|
||||||
<TextInput value={type.map(item => item.value === data.type && item.name).filter(data => data !== false) || ''} disabled />
|
|
||||||
</td>
|
|
||||||
<th></th>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th>제재 기간</th>
|
|
||||||
<td colSpan="3">
|
|
||||||
<InputWrapper>
|
|
||||||
<TextInput value={period.map(item => item.value === data.period && item.name).filter(data => data !== false) || ''} disabled />
|
|
||||||
<span>시작일 : {convertKTC(data.start_dt, false)}</span>
|
|
||||||
<span>종료일 : {convertKTC(data.end_dt, false)}</span>
|
|
||||||
</InputWrapper>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th>제재 사유</th>
|
|
||||||
<td>
|
|
||||||
<TextInput value={sanctions.map(item => item.value === data.sanctions && item.name).filter(data => data !== false) || ''} disabled />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</BlockDetailState>
|
|
||||||
|
|
||||||
<BlockCount>전체 제재 이력({history && history.length}건)</BlockCount>
|
|
||||||
<BlockHistory>
|
|
||||||
<TableStyle>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>일자</th>
|
|
||||||
<th width="10%">제재 기간</th>
|
|
||||||
<th width="10%">제재 방식</th>
|
|
||||||
<th width="20%">제재 사유</th>
|
|
||||||
<th width="20%">등록자</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{history &&
|
|
||||||
history.map((content, index) => (
|
|
||||||
<Fragment key={index}>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
{convertKTC(content.start_dt, false)} ~
|
|
||||||
{convertKTC(content.end_dt, false)}
|
|
||||||
</td>
|
|
||||||
<td>{period.map(item => item.value === data.period && item.name)}</td>
|
|
||||||
<td>{type.map(item => item.value === data.type && item.name)}</td>
|
|
||||||
<td>{sanctions.map(item => item.value === data.sanctions && item.name)}</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
</Fragment>
|
|
||||||
))}
|
|
||||||
</tbody>
|
|
||||||
</TableStyle>
|
|
||||||
</BlockHistory>
|
|
||||||
<BlockNotice>※ 삭제된 제재 이력은 표시되지 않습니다.</BlockNotice>
|
|
||||||
<BtnWrapper $justify="flex-end">
|
|
||||||
<Button text="확인" theme="line" handleClick={handleModal} />
|
|
||||||
</BtnWrapper>
|
|
||||||
</Modal>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default UserBlockDetailModal;
|
|
||||||
|
|
||||||
const BlockDetailState = styled.div`
|
|
||||||
border-top: 1px solid #000;
|
|
||||||
border-bottom: 1px solid #000;
|
|
||||||
padding: 15px 10px;
|
|
||||||
font-size: 14px;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
input {
|
|
||||||
height: 35px;
|
|
||||||
max-width: 330px;
|
|
||||||
font-size: 14px;
|
|
||||||
padding: 5px 10px;
|
|
||||||
}
|
|
||||||
table {
|
|
||||||
tr {
|
|
||||||
th,
|
|
||||||
td {
|
|
||||||
padding: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const RegistInfo = styled.div`
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
gap: 50px;
|
|
||||||
font-size: 14px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const BlockCount = styled.div`
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 500;
|
|
||||||
line-height: 1.6;
|
|
||||||
padding-bottom: 5px;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const BlockHistory = styled.div`
|
|
||||||
max-height: 324px;
|
|
||||||
position: relative;
|
|
||||||
overflow: auto;
|
|
||||||
border-top: 1px solid #000;
|
|
||||||
${TableStyle} {
|
|
||||||
border-collapse: separate;
|
|
||||||
&:before {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
th {
|
|
||||||
position: sticky;
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
tbody {
|
|
||||||
tr:first-child {
|
|
||||||
color: #d60000;
|
|
||||||
}
|
|
||||||
tr:last-child td {
|
|
||||||
border-bottom: 1px solid #e8eaec;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const BlockNotice = styled.span`
|
|
||||||
font-size: 12px;
|
|
||||||
color: #686868;
|
|
||||||
padding-left: 10px;
|
|
||||||
font-weight: 300;
|
|
||||||
line-height: 2;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const InputWrapper = styled.div`
|
|
||||||
display: flex;
|
|
||||||
gap: 20px;
|
|
||||||
align-items: center;
|
|
||||||
`;
|
|
||||||
@@ -1,526 +0,0 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
|
||||||
import { getOptionsArray } from '../../../utils';
|
|
||||||
import {
|
|
||||||
SelectInput,
|
|
||||||
SearchBarAlert
|
|
||||||
} from '../../../styles/Components';
|
|
||||||
import {
|
|
||||||
FormInput, FormInputSuffix, FormInputSuffixWrapper,
|
|
||||||
FormLabel,
|
|
||||||
FormRowGroup,
|
|
||||||
FormStatusBar,
|
|
||||||
FormStatusLabel,
|
|
||||||
FormStatusWarning,
|
|
||||||
} from '../../../styles/ModuleComponents';
|
|
||||||
import { CheckBox, SingleDatePicker, SingleTimePicker } from '../../common';
|
|
||||||
import Button from '../../common/button/Button';
|
|
||||||
import styled from 'styled-components';
|
|
||||||
import ImageUploadBtn from '../../ServiceManage/ImageUploadBtn';
|
|
||||||
|
|
||||||
const CaliForm = ({
|
|
||||||
config, // 폼 설정 JSON
|
|
||||||
mode, // 'create', 'update', 'view' 중 하나
|
|
||||||
initialData, // 초기 데이터
|
|
||||||
externalData, // 외부 데이터(옵션 등)
|
|
||||||
onSubmit, // 제출 핸들러
|
|
||||||
onCancel, // 취소 핸들러
|
|
||||||
className, // 추가 CSS 클래스
|
|
||||||
onFieldValidation, // 필드 유효성 검사 콜백
|
|
||||||
formRef // 폼 ref
|
|
||||||
}) => {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const [formData, setFormData] = useState({ ...(config?.initData || {}), ...(initialData || {}) });
|
|
||||||
const [errors, setErrors] = useState({});
|
|
||||||
const [isFormValid, setIsFormValid] = useState(false);
|
|
||||||
|
|
||||||
// 필드 변경 핸들러
|
|
||||||
const handleFieldChange = (fieldId, value) => {
|
|
||||||
setFormData(prev => ({
|
|
||||||
...prev,
|
|
||||||
[fieldId]: value
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
|
|
||||||
// 날짜 변경 핸들러
|
|
||||||
const handleDateChange = (fieldId, date) => {
|
|
||||||
if (!date) return;
|
|
||||||
setFormData(prev => ({
|
|
||||||
...prev,
|
|
||||||
[fieldId]: date
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
|
|
||||||
// 시간 변경 핸들러
|
|
||||||
const handleTimeChange = (fieldId, time) => {
|
|
||||||
if (!time) return;
|
|
||||||
|
|
||||||
const newDateTime = formData[fieldId] ? new Date(formData[fieldId]) : new Date();
|
|
||||||
newDateTime.setHours(time.getHours(), time.getMinutes(), 0, 0);
|
|
||||||
|
|
||||||
setFormData(prev => ({
|
|
||||||
...prev,
|
|
||||||
[fieldId]: newDateTime
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
|
|
||||||
// 폼 유효성 검사
|
|
||||||
useEffect(() => {
|
|
||||||
const validateForm = () => {
|
|
||||||
const newErrors = {};
|
|
||||||
let isValid = true;
|
|
||||||
|
|
||||||
if (!config) return false;
|
|
||||||
|
|
||||||
// 필수 필드 검사
|
|
||||||
const requiredFields = config.fields
|
|
||||||
.filter(f =>
|
|
||||||
f.visibleOn.includes(mode) &&
|
|
||||||
f.validations?.includes("required")
|
|
||||||
)
|
|
||||||
.map(f => f.id);
|
|
||||||
|
|
||||||
requiredFields.forEach(fieldId => {
|
|
||||||
if (!formData[fieldId] && formData[fieldId] !== 0) {
|
|
||||||
newErrors[fieldId] = t('REQUIRED_FIELD');
|
|
||||||
isValid = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// 조건부 유효성 검사
|
|
||||||
if (config.validations && config.validations[mode]) {
|
|
||||||
for (const validation of config.validations[mode]) {
|
|
||||||
const conditionResult = evaluateCondition(validation.condition, {
|
|
||||||
...formData,
|
|
||||||
current_time: new Date().getTime()
|
|
||||||
});
|
|
||||||
|
|
||||||
if (conditionResult) {
|
|
||||||
// 전체 폼 검증 오류
|
|
||||||
newErrors._form = t(validation.message);
|
|
||||||
isValid = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setErrors(newErrors);
|
|
||||||
setIsFormValid(isValid);
|
|
||||||
|
|
||||||
if (onFieldValidation) {
|
|
||||||
onFieldValidation(isValid, newErrors);
|
|
||||||
}
|
|
||||||
|
|
||||||
return isValid;
|
|
||||||
};
|
|
||||||
|
|
||||||
validateForm();
|
|
||||||
}, [config, formData, mode, t, onFieldValidation]);
|
|
||||||
|
|
||||||
// 간단한 조건식 평가 함수
|
|
||||||
const evaluateCondition = (conditionStr, context) => {
|
|
||||||
try {
|
|
||||||
const fn = new Function(...Object.keys(context), `return ${conditionStr}`);
|
|
||||||
return fn(...Object.values(context));
|
|
||||||
} catch (e) {
|
|
||||||
console.error('Error evaluating condition:', e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 필드 렌더링
|
|
||||||
const renderField = (field) => {
|
|
||||||
const isEditable = field.editableOn.includes(mode);
|
|
||||||
const value = formData[field.id] !== undefined ? formData[field.id] : '';
|
|
||||||
const hasError = errors[field.id];
|
|
||||||
|
|
||||||
switch (field.type) {
|
|
||||||
case 'text':
|
|
||||||
return (
|
|
||||||
<div className="form-field">
|
|
||||||
<FormInput
|
|
||||||
type="text"
|
|
||||||
value={value}
|
|
||||||
onChange={e => handleFieldChange(field.id, e.target.value)}
|
|
||||||
disabled={!isEditable}
|
|
||||||
width={field.width}
|
|
||||||
className={hasError ? 'error' : ''}
|
|
||||||
/>
|
|
||||||
{hasError && <div className="field-error">{hasError}</div>}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
case 'number':
|
|
||||||
return (
|
|
||||||
<div className="form-field">
|
|
||||||
<FormInput
|
|
||||||
type="number"
|
|
||||||
value={value}
|
|
||||||
onChange={e => handleFieldChange(field.id, Number(e.target.value))}
|
|
||||||
disabled={!isEditable}
|
|
||||||
width={field.width}
|
|
||||||
min={field.min}
|
|
||||||
max={field.max}
|
|
||||||
step={field.step || 1}
|
|
||||||
className={hasError ? 'error' : ''}
|
|
||||||
/>
|
|
||||||
{hasError && <div className="field-error">{hasError}</div>}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
case 'select':
|
|
||||||
let options = [];
|
|
||||||
|
|
||||||
if (field.optionsKey) {
|
|
||||||
// 옵션 설정에서 가져오기
|
|
||||||
options = getOptionsArray(field.optionsKey);
|
|
||||||
} else if (field.dataSource && externalData) {
|
|
||||||
// 외부 데이터 소스 사용
|
|
||||||
const dataSource = externalData[field.dataSource] || [];
|
|
||||||
|
|
||||||
options = dataSource.map(item => ({
|
|
||||||
value: item[field.valueField],
|
|
||||||
label: field.displayFormat
|
|
||||||
? field.displayFormat.replace('{value}', item[field.valueField])
|
|
||||||
.replace('{display}', item[field.displayField])
|
|
||||||
: `${item[field.displayField]}(${item[field.valueField]})`
|
|
||||||
}));
|
|
||||||
} else if (field.options) {
|
|
||||||
options = field.options;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="form-field">
|
|
||||||
<SelectInput
|
|
||||||
value={value}
|
|
||||||
onChange={e => handleFieldChange(field.id, e.target.value)}
|
|
||||||
disabled={!isEditable}
|
|
||||||
width={field.width}
|
|
||||||
className={hasError ? 'error' : ''}
|
|
||||||
>
|
|
||||||
{options.map((option, index) => (
|
|
||||||
<option key={index} value={option.value}>
|
|
||||||
{option.label}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</SelectInput>
|
|
||||||
{hasError && <div className="field-error">{hasError}</div>}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
case 'datePicker':
|
|
||||||
return (
|
|
||||||
<div className="form-field">
|
|
||||||
<SingleDatePicker
|
|
||||||
label={field.label}
|
|
||||||
disabled={!isEditable}
|
|
||||||
dateLabel={field.dateLabel}
|
|
||||||
onDateChange={date => handleDateChange(field.id, date)}
|
|
||||||
selectedDate={value}
|
|
||||||
minDate={field.minDate}
|
|
||||||
maxDate={field.maxDate}
|
|
||||||
className={hasError ? 'error' : ''}
|
|
||||||
/>
|
|
||||||
{hasError && <div className="field-error">{hasError}</div>}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
case 'timePicker':
|
|
||||||
return (
|
|
||||||
<div className="form-field">
|
|
||||||
<SingleTimePicker
|
|
||||||
label={field.label}
|
|
||||||
disabled={!isEditable}
|
|
||||||
selectedTime={value}
|
|
||||||
onTimeChange={time => handleTimeChange(field.id, time)}
|
|
||||||
className={hasError ? 'error' : ''}
|
|
||||||
/>
|
|
||||||
{hasError && <div className="field-error">{hasError}</div>}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
case 'status':
|
|
||||||
let statusText = "";
|
|
||||||
if (field.optionsKey && formData[field.statusField]) {
|
|
||||||
const statusOptions = getOptionsArray(field.optionsKey);
|
|
||||||
const statusItem = statusOptions.find(item => item.value === formData[field.statusField]);
|
|
||||||
statusText = statusItem ? statusItem.name : "등록";
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="form-field">
|
|
||||||
<FormStatusBar>
|
|
||||||
<FormStatusLabel>
|
|
||||||
{field.label}: {statusText}
|
|
||||||
</FormStatusLabel>
|
|
||||||
{mode === 'update' && field.warningMessage && (
|
|
||||||
<FormStatusWarning>
|
|
||||||
{t(field.warningMessage)}
|
|
||||||
</FormStatusWarning>
|
|
||||||
)}
|
|
||||||
</FormStatusBar>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
case 'dateTimeRange':
|
|
||||||
return (
|
|
||||||
<div className="form-field">
|
|
||||||
<div className="date-time-range">
|
|
||||||
<SingleDatePicker
|
|
||||||
label={field.startDateLabel}
|
|
||||||
disabled={!isEditable}
|
|
||||||
dateLabel={field.startDateLabel}
|
|
||||||
onDateChange={date => handleDateChange(field.startDateField, date)}
|
|
||||||
selectedDate={formData[field.startDateField]}
|
|
||||||
/>
|
|
||||||
<SingleTimePicker
|
|
||||||
disabled={!isEditable}
|
|
||||||
selectedTime={formData[field.startDateField]}
|
|
||||||
onTimeChange={time => handleTimeChange(field.startDateField, time)}
|
|
||||||
/>
|
|
||||||
<SingleDatePicker
|
|
||||||
label={field.endDateLabel}
|
|
||||||
disabled={!isEditable}
|
|
||||||
dateLabel={field.endDateLabel}
|
|
||||||
onDateChange={date => handleDateChange(field.endDateField, date)}
|
|
||||||
selectedDate={formData[field.endDateField]}
|
|
||||||
/>
|
|
||||||
<SingleTimePicker
|
|
||||||
disabled={!isEditable}
|
|
||||||
selectedTime={formData[field.endDateField]}
|
|
||||||
onTimeChange={time => handleTimeChange(field.endDateField, time)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
{hasError && <div className="field-error">{hasError}</div>}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
case 'imageUpload':
|
|
||||||
const imageLanguage = field.language;
|
|
||||||
const imageList = formData.image_list || [];
|
|
||||||
const imageData = imageList.find(img => img.language === imageLanguage) || { content: '' };
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="form-field">
|
|
||||||
<LanguageWrapper>
|
|
||||||
<LanguageLabel>{imageLanguage}</LanguageLabel>
|
|
||||||
<ImageUploadBtn
|
|
||||||
onImageUpload={(file, fileName) => {
|
|
||||||
const updatedImageList = [...imageList];
|
|
||||||
const index = updatedImageList.findIndex(img => img.language === imageLanguage);
|
|
||||||
|
|
||||||
if (index !== -1) {
|
|
||||||
updatedImageList[index] = {
|
|
||||||
...updatedImageList[index],
|
|
||||||
content: fileName
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
updatedImageList.push({
|
|
||||||
language: imageLanguage,
|
|
||||||
content: fileName
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
handleFieldChange('image_list', updatedImageList);
|
|
||||||
}}
|
|
||||||
onFileDelete={() => {
|
|
||||||
const updatedImageList = [...imageList];
|
|
||||||
const index = updatedImageList.findIndex(img => img.language === imageLanguage);
|
|
||||||
|
|
||||||
if (index !== -1) {
|
|
||||||
updatedImageList[index] = {
|
|
||||||
...updatedImageList[index],
|
|
||||||
content: ''
|
|
||||||
};
|
|
||||||
|
|
||||||
handleFieldChange('image_list', updatedImageList);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
fileName={imageData.content}
|
|
||||||
disabled={!isEditable}
|
|
||||||
/>
|
|
||||||
</LanguageWrapper>
|
|
||||||
{hasError && <div className="field-error">{hasError}</div>}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
case 'checkbox':
|
|
||||||
return (
|
|
||||||
<div className="form-field">
|
|
||||||
<CheckBox
|
|
||||||
label={field.label}
|
|
||||||
id={field.id}
|
|
||||||
checked={formData[field.id] || false}
|
|
||||||
setData={e => handleFieldChange(field.id, e.target.checked)}
|
|
||||||
disabled={!isEditable}
|
|
||||||
/>
|
|
||||||
{hasError && <div className="field-error">{hasError}</div>}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
case 'textWithSuffix':
|
|
||||||
const linkLanguage = field.suffix;
|
|
||||||
const linkList = formData.link_list || [];
|
|
||||||
const linkData = linkList.find(link => link.language === linkLanguage) || { content: '' };
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="form-field">
|
|
||||||
{field.label && <FormLabel>{field.label}</FormLabel>}
|
|
||||||
<FormInputSuffixWrapper>
|
|
||||||
<FormInput
|
|
||||||
type="text"
|
|
||||||
value={linkData.content}
|
|
||||||
onChange={e => {
|
|
||||||
const updatedLinkList = [...linkList];
|
|
||||||
const index = updatedLinkList.findIndex(link => link.language === linkLanguage);
|
|
||||||
|
|
||||||
if (index !== -1) {
|
|
||||||
updatedLinkList[index] = {
|
|
||||||
...updatedLinkList[index],
|
|
||||||
content: e.target.value
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
updatedLinkList.push({
|
|
||||||
language: linkLanguage,
|
|
||||||
content: e.target.value
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
handleFieldChange('link_list', updatedLinkList);
|
|
||||||
}}
|
|
||||||
disabled={!isEditable}
|
|
||||||
width={field.width}
|
|
||||||
suffix="true"
|
|
||||||
/>
|
|
||||||
<FormInputSuffix>{linkLanguage}</FormInputSuffix>
|
|
||||||
</FormInputSuffixWrapper>
|
|
||||||
{hasError && <div className="field-error">{hasError}</div>}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
|
|
||||||
default:
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 조건부 렌더링을 위한 필드 필터링
|
|
||||||
const getVisibleFields = () => {
|
|
||||||
if (!config) return [];
|
|
||||||
|
|
||||||
return config.fields.filter(field => {
|
|
||||||
if (!field.visibleOn.includes(mode)) return false;
|
|
||||||
|
|
||||||
// 조건부 표시 필드 처리
|
|
||||||
if (field.conditional) {
|
|
||||||
const { field: condField, operator, value } = field.conditional;
|
|
||||||
|
|
||||||
if (operator === "==" && formData[condField] !== value) return false;
|
|
||||||
if (operator === "!=" && formData[condField] === value) return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 그리드 기반 필드 렌더링
|
|
||||||
const renderGridFields = () => {
|
|
||||||
if (!config) return null;
|
|
||||||
|
|
||||||
const visibleFields = getVisibleFields();
|
|
||||||
const { rows, columns } = config.grid;
|
|
||||||
|
|
||||||
// 그리드 레이아웃 생성
|
|
||||||
return (
|
|
||||||
<div className="form-grid" style={{ display: 'grid', gridTemplateColumns: `repeat(${columns}, 1fr)`, gap: '10px' }}>
|
|
||||||
{visibleFields.map((field) => {
|
|
||||||
const { row, col, width } = field.position;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
key={field.id}
|
|
||||||
className="form-cell"
|
|
||||||
style={{
|
|
||||||
gridRow: row + 1,
|
|
||||||
gridColumn: `${col + 1} / span ${width}`,
|
|
||||||
padding: '5px'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<FormRowGroup>
|
|
||||||
<FormLabel>{field.label}{field.validations?.includes("required") && <span className="required">*</span>}</FormLabel>
|
|
||||||
{renderField(field)}
|
|
||||||
</FormRowGroup>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 버튼 렌더링
|
|
||||||
const renderButtons = () => {
|
|
||||||
if (!config || !config.actions || !config.actions[mode]) return null;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="form-actions">
|
|
||||||
{config.actions[mode].map(action => (
|
|
||||||
<Button
|
|
||||||
key={action.id}
|
|
||||||
text={action.label}
|
|
||||||
theme={action.theme}
|
|
||||||
handleClick={() => {
|
|
||||||
if (action.action === 'submit') {
|
|
||||||
if (isFormValid) {
|
|
||||||
onSubmit(formData);
|
|
||||||
}
|
|
||||||
} else if (action.action === 'close' || action.action === 'cancel') {
|
|
||||||
onCancel();
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
disabled={action.action === 'submit' && !isFormValid}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!config) return <div>로딩 중...</div>;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={`json-config-form ${className || ''}`} ref={formRef}>
|
|
||||||
<div className="form-content">
|
|
||||||
{renderGridFields()}
|
|
||||||
|
|
||||||
{errors._form && (
|
|
||||||
<SearchBarAlert $marginTop="15px" $align="right">
|
|
||||||
{errors._form}
|
|
||||||
</SearchBarAlert>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="form-footer">
|
|
||||||
{renderButtons()}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default CaliForm;
|
|
||||||
|
|
||||||
const LanguageWrapper = styled.div`
|
|
||||||
width: ${props => props.width || '100%'};
|
|
||||||
//margin-bottom: 20px;
|
|
||||||
padding-bottom: 20px;
|
|
||||||
padding-left: 90px;
|
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
border-bottom: none;
|
|
||||||
margin-bottom: 0;
|
|
||||||
padding-bottom: 0;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const LanguageLabel = styled.h4`
|
|
||||||
color: #444;
|
|
||||||
margin: 0 0 10px 20px;
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 500;
|
|
||||||
`;
|
|
||||||
@@ -1,79 +1,29 @@
|
|||||||
import React from 'react';
|
import { DatePicker } from 'antd';
|
||||||
import DatePickerComponent from './DatePickerComponent';
|
import dayjs from 'dayjs';
|
||||||
import { DatePickerWrapper } from '../../../styles/Components';
|
|
||||||
import {
|
const { RangePicker } = DatePicker;
|
||||||
FormRowGroup,
|
|
||||||
FormLabel,
|
|
||||||
DateContainer,
|
|
||||||
DateTimeWrapper,
|
|
||||||
DateTimeGroup,
|
|
||||||
} from '../../../styles/ModuleComponents';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
|
||||||
|
|
||||||
const DateRangePicker = ({
|
const DateRangePicker = ({
|
||||||
label,
|
value,
|
||||||
startDate,
|
onChange,
|
||||||
endDate,
|
format,
|
||||||
onStartDateChange,
|
showTime = true,
|
||||||
onEndDateChange,
|
size = 'middle',
|
||||||
pastDate = new Date(),
|
...props
|
||||||
disabled,
|
|
||||||
startLabel = '시작 일자',
|
|
||||||
endLabel = '종료 일자',
|
|
||||||
setAlert,
|
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation();
|
|
||||||
|
|
||||||
const handleStartDate = (date) => {
|
|
||||||
const newDate = new Date(date);
|
|
||||||
onStartDateChange(newDate);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleEndDate = (date) => {
|
|
||||||
let newDate = new Date(date);
|
|
||||||
|
|
||||||
if (startDate && newDate < startDate) {
|
|
||||||
setAlert(t('DATE_START_DIFF_END'));
|
|
||||||
newDate = new Date(startDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
onEndDateChange(newDate);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FormRowGroup>
|
<RangePicker
|
||||||
<FormLabel>{label}</FormLabel>
|
showTime={showTime}
|
||||||
<DateTimeWrapper>
|
value={value ? [dayjs(value[0]), dayjs(value[1])] : [null, null]}
|
||||||
<DateTimeGroup>
|
format={format || 'YYYY-MM-DD HH:mm:ss'}
|
||||||
<DateContainer>
|
onChange={onChange}
|
||||||
<DatePickerWrapper>
|
placeholder={['시작 일시', '종료 일시']}
|
||||||
<DatePickerComponent
|
size={size}
|
||||||
name={startLabel}
|
allowClear={false}
|
||||||
handleSelectedDate={handleStartDate}
|
{...props}
|
||||||
selectedDate={startDate}
|
/>
|
||||||
pastDate={pastDate}
|
|
||||||
disabled={disabled}
|
|
||||||
/>
|
|
||||||
</DatePickerWrapper>
|
|
||||||
</DateContainer>
|
|
||||||
</DateTimeGroup>
|
|
||||||
|
|
||||||
<DateTimeGroup>
|
|
||||||
<DateContainer>
|
|
||||||
<DatePickerWrapper>
|
|
||||||
<DatePickerComponent
|
|
||||||
name={endLabel}
|
|
||||||
handleSelectedDate={handleEndDate}
|
|
||||||
selectedDate={endDate}
|
|
||||||
pastDate={pastDate}
|
|
||||||
disabled={disabled}
|
|
||||||
/>
|
|
||||||
</DatePickerWrapper>
|
|
||||||
</DateContainer>
|
|
||||||
</DateTimeGroup>
|
|
||||||
</DateTimeWrapper>
|
|
||||||
</FormRowGroup>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export default DateRangePicker;
|
export default DateRangePicker;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { NavLink, useNavigate } from 'react-router-dom';
|
import { NavLink, useNavigate, useLocation } from 'react-router-dom';
|
||||||
import arrowIcon from '../../../assets/img/icon/icon-tab.png';
|
import { ConfigProvider, Menu, theme } from 'antd';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { authList } from '../../../store/authList';
|
import { authList } from '../../../store/authList';
|
||||||
@@ -7,7 +7,6 @@ import Modal from '../modal/Modal';
|
|||||||
import { BtnWrapper, ButtonClose, ModalText } from '../../../styles/Components';
|
import { BtnWrapper, ButtonClose, ModalText } from '../../../styles/Components';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import Button from '../button/Button';
|
import Button from '../button/Button';
|
||||||
import { useLocation } from 'react-router-dom';
|
|
||||||
import { AuthInfo } from '../../../apis';
|
import { AuthInfo } from '../../../apis';
|
||||||
import { getMenuConfig } from '../../../utils';
|
import { getMenuConfig } from '../../../utils';
|
||||||
import { adminAuthLevel } from '../../../assets/data/types';
|
import { adminAuthLevel } from '../../../assets/data/types';
|
||||||
@@ -15,47 +14,55 @@ import { adminAuthLevel } from '../../../assets/data/types';
|
|||||||
const Navi = () => {
|
const Navi = () => {
|
||||||
const token = sessionStorage.getItem('token');
|
const token = sessionStorage.getItem('token');
|
||||||
const userInfo = useRecoilValue(authList);
|
const userInfo = useRecoilValue(authList);
|
||||||
const menu = getMenuConfig(userInfo);
|
const menuConfig = getMenuConfig(userInfo);
|
||||||
|
|
||||||
const [modalClose, setModalClose] = useState('hidden');
|
|
||||||
const [logoutModalClose, setLogoutModalClose] = useState('hidden');
|
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
const [modalClose, setModalClose] = useState('hidden');
|
||||||
|
const [logoutModalClose, setLogoutModalClose] = useState('hidden');
|
||||||
|
const [openKeys, setOpenKeys] = useState([]);
|
||||||
|
const [selectedKeys, setSelectedKeys] = useState([]);
|
||||||
|
|
||||||
|
// 현재 경로에 따라 선택된 메뉴와 열린 서브메뉴 설정
|
||||||
|
useEffect(() => {
|
||||||
|
const path = location.pathname.split('/');
|
||||||
|
if (path.length > 1) {
|
||||||
|
// 첫 번째 경로(예: /usermanage)를 기반으로 openKeys 설정
|
||||||
|
setOpenKeys([path[1]]);
|
||||||
|
|
||||||
|
// 전체 경로(예: /usermanage/adminview)를 기반으로 selectedKeys 설정
|
||||||
|
if (path.length > 2) {
|
||||||
|
setSelectedKeys([`${path[1]}/${path[2]}`]);
|
||||||
|
} else {
|
||||||
|
setSelectedKeys([path[1]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [location.pathname]);
|
||||||
|
|
||||||
const handleToken = async () => {
|
const handleToken = async () => {
|
||||||
const tokenStatus = await AuthInfo(token);
|
const tokenStatus = await AuthInfo(token);
|
||||||
|
if (tokenStatus.message === '잘못된 타입의 토큰입니다.') {
|
||||||
tokenStatus.message === '잘못된 타입의 토큰입니다.' && setLogoutModalClose('view');
|
setLogoutModalClose('view');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleToken();
|
handleToken();
|
||||||
}, [token]);
|
}, [token]);
|
||||||
|
|
||||||
const handleTopMenu = e => {
|
// 메뉴 아이템 클릭 핸들러
|
||||||
e.preventDefault();
|
const handleMenuClick = ({ key }) => {
|
||||||
e.target.classList.toggle('active');
|
handleToken();
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleLink = e => {
|
// 서브메뉴 열기/닫기 핸들러
|
||||||
let topActive = document.querySelectorAll('nav .active');
|
const handleOpenChange = (keys) => {
|
||||||
let currentTopMenu = e.target.closest('ul').previousSibling;
|
setOpenKeys(keys);
|
||||||
for (let i = 0; i < topActive.length; i++) {
|
|
||||||
if (topActive[i] !== currentTopMenu) {
|
|
||||||
topActive[i].classList.remove('active');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
handleToken();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 등록 완료 모달
|
// 등록 완료 모달
|
||||||
const handleModalClose = () => {
|
const handleModalClose = () => {
|
||||||
if (modalClose === 'hidden') {
|
setModalClose(modalClose === 'hidden' ? 'view' : 'hidden');
|
||||||
setModalClose('view');
|
|
||||||
} else {
|
|
||||||
setModalClose('hidden');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 로그아웃 안내 모달
|
// 로그아웃 안내 모달
|
||||||
@@ -65,7 +72,6 @@ const Navi = () => {
|
|||||||
} else {
|
} else {
|
||||||
setLogoutModalClose('hidden');
|
setLogoutModalClose('hidden');
|
||||||
sessionStorage.removeItem('token');
|
sessionStorage.removeItem('token');
|
||||||
|
|
||||||
navigate('/');
|
navigate('/');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -79,41 +85,56 @@ const Navi = () => {
|
|||||||
default:
|
default:
|
||||||
return submenu.authLevel === adminAuthLevel.NONE && userInfo.auth_list && userInfo.auth_list.some(auth => auth.id === submenu.id);
|
return submenu.authLevel === adminAuthLevel.NONE && userInfo.auth_list && userInfo.auth_list.some(auth => auth.id === submenu.id);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
|
const getMenuItems = () => {
|
||||||
|
return menuConfig
|
||||||
|
.filter(item => item.access)
|
||||||
|
.map(item => ({
|
||||||
|
key: item.link.substring(1),
|
||||||
|
label: item.title,
|
||||||
|
children: item.submenu.map(submenu => ({
|
||||||
|
key: `${item.link.substring(1)}/${submenu.link.split('/').pop()}`,
|
||||||
|
label: (
|
||||||
|
<MenuItemLink
|
||||||
|
to={isClickable(submenu) ? submenu.link : location.pathname}
|
||||||
|
$isclickable={isClickable(submenu) ? 'true' : 'false'}
|
||||||
|
onClick={(e) => {
|
||||||
|
if (!isClickable(submenu)) {
|
||||||
|
e.preventDefault();
|
||||||
|
handleModalClose();
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{submenu.title}
|
||||||
|
</MenuItemLink>
|
||||||
|
),
|
||||||
|
disabled: !isClickable(submenu)
|
||||||
|
}))
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<nav>
|
<StyledNavWrapper>
|
||||||
<ul>
|
<ConfigProvider
|
||||||
{menu.map((item, idx) => {
|
theme={{
|
||||||
return (
|
algorithm: theme.darkAlgorithm,
|
||||||
<li key={idx}>
|
}}
|
||||||
{item.access && (
|
>
|
||||||
<TopMenu to={item.link} onClick={handleTopMenu}>
|
<StyledMenu
|
||||||
{item.title}
|
theme="dark"
|
||||||
</TopMenu>
|
mode="inline"
|
||||||
)}
|
openKeys={openKeys}
|
||||||
<SubMenu>
|
selectedKeys={selectedKeys}
|
||||||
{item.submenu && userInfo &&
|
onOpenChange={handleOpenChange}
|
||||||
item.submenu.map((submenu, idx) => {
|
onClick={handleMenuClick}
|
||||||
return (
|
items={getMenuItems()}
|
||||||
<SubMenuItem key={idx} $isclickable={isClickable(submenu) ? 'true' : 'false'}>
|
multiple={true}
|
||||||
<NavLink
|
/>
|
||||||
to={isClickable(submenu) ? submenu.link : location.pathname}
|
</ConfigProvider>
|
||||||
onClick={e => {
|
</StyledNavWrapper>
|
||||||
isClickable(submenu) ? handleLink(e) : handleModalClose();
|
|
||||||
}}>
|
|
||||||
{submenu.title}
|
|
||||||
</NavLink>
|
|
||||||
</SubMenuItem>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</SubMenu>
|
|
||||||
</li>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
{/* 접근 불가 모달 */}
|
{/* 접근 불가 모달 */}
|
||||||
<Modal min="440px" $padding="40px" $bgcolor="transparent" $view={modalClose}>
|
<Modal min="440px" $padding="40px" $bgcolor="transparent" $view={modalClose}>
|
||||||
<BtnWrapper $justify="flex-end">
|
<BtnWrapper $justify="flex-end">
|
||||||
@@ -145,61 +166,15 @@ const Navi = () => {
|
|||||||
|
|
||||||
export default Navi;
|
export default Navi;
|
||||||
|
|
||||||
const TopMenu = styled(NavLink)`
|
const StyledNavWrapper = styled.div`
|
||||||
padding: 16px 30px;
|
`;
|
||||||
width: 100%;
|
|
||||||
text-align: left;
|
|
||||||
border-bottom: 1px solid #888;
|
|
||||||
position: relative;
|
|
||||||
color: #fff;
|
|
||||||
|
|
||||||
&:before {
|
const StyledMenu = styled(Menu)`
|
||||||
content: '';
|
`;
|
||||||
display: block;
|
|
||||||
width: 12px;
|
const MenuItemLink = styled(NavLink)`
|
||||||
height: 12px;
|
|
||||||
position: absolute;
|
|
||||||
right: 30px;
|
|
||||||
top: 50%;
|
|
||||||
transform: translate(0, -50%);
|
|
||||||
background: url('${arrowIcon}') -12px 0 no-repeat;
|
|
||||||
}
|
|
||||||
&:hover,
|
|
||||||
&.active {
|
&.active {
|
||||||
background: #444;
|
font-weight: ${props => (props.$isclickable === 'false' ? 400 : 600)};
|
||||||
}
|
}
|
||||||
&.active ~ ul {
|
`;
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
&.active:before {
|
|
||||||
background: url('${arrowIcon}') 0 0 no-repeat;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const SubMenu = styled.ul`
|
|
||||||
display: none;
|
|
||||||
`;
|
|
||||||
|
|
||||||
const SubMenuItem = styled.li`
|
|
||||||
background: #eee;
|
|
||||||
border-bottom: 1px solid #ccc;
|
|
||||||
color: #2c2c2c;
|
|
||||||
a {
|
|
||||||
width: 100%;
|
|
||||||
padding: 16px 30px;
|
|
||||||
color: ${props => (props.$isclickable === 'false' ? '#818181' : '#2c2c2c')};
|
|
||||||
text-align: left;
|
|
||||||
&:hover,
|
|
||||||
&.active {
|
|
||||||
color: ${props => (props.$isclickable === 'false' ? '#818181' : '#2c2c2c')};
|
|
||||||
font-weight: ${props => (props.$isclickable === 'false' ? 400 : 600)};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
const BackGround = styled.div`
|
|
||||||
background: #eee2;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
z-index: 100;
|
|
||||||
`;
|
|
||||||
205
src/components/common/Header/Navi_bak.js
Normal file
205
src/components/common/Header/Navi_bak.js
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
import { NavLink, useNavigate } from 'react-router-dom';
|
||||||
|
import arrowIcon from '../../../assets/img/icon/icon-tab.png';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
import { useRecoilValue } from 'recoil';
|
||||||
|
import { authList } from '../../../store/authList';
|
||||||
|
import Modal from '../modal/Modal';
|
||||||
|
import { BtnWrapper, ButtonClose, ModalText } from '../../../styles/Components';
|
||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
import Button from '../button/Button';
|
||||||
|
import { useLocation } from 'react-router-dom';
|
||||||
|
import { AuthInfo } from '../../../apis';
|
||||||
|
import { getMenuConfig } from '../../../utils';
|
||||||
|
import { adminAuthLevel } from '../../../assets/data/types';
|
||||||
|
|
||||||
|
const Navi = () => {
|
||||||
|
const token = sessionStorage.getItem('token');
|
||||||
|
const userInfo = useRecoilValue(authList);
|
||||||
|
const menu = getMenuConfig(userInfo);
|
||||||
|
|
||||||
|
const [modalClose, setModalClose] = useState('hidden');
|
||||||
|
const [logoutModalClose, setLogoutModalClose] = useState('hidden');
|
||||||
|
const location = useLocation();
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
const handleToken = async () => {
|
||||||
|
const tokenStatus = await AuthInfo(token);
|
||||||
|
|
||||||
|
tokenStatus.message === '잘못된 타입의 토큰입니다.' && setLogoutModalClose('view');
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
handleToken();
|
||||||
|
}, [token]);
|
||||||
|
|
||||||
|
const handleTopMenu = e => {
|
||||||
|
e.preventDefault();
|
||||||
|
e.target.classList.toggle('active');
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleLink = e => {
|
||||||
|
let topActive = document.querySelectorAll('nav .active');
|
||||||
|
let currentTopMenu = e.target.closest('ul').previousSibling;
|
||||||
|
for (let i = 0; i < topActive.length; i++) {
|
||||||
|
if (topActive[i] !== currentTopMenu) {
|
||||||
|
topActive[i].classList.remove('active');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
handleToken();
|
||||||
|
};
|
||||||
|
|
||||||
|
// 등록 완료 모달
|
||||||
|
const handleModalClose = () => {
|
||||||
|
if (modalClose === 'hidden') {
|
||||||
|
setModalClose('view');
|
||||||
|
} else {
|
||||||
|
setModalClose('hidden');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 로그아웃 안내 모달
|
||||||
|
const handleConfirmClose = () => {
|
||||||
|
if (logoutModalClose === 'hidden') {
|
||||||
|
setLogoutModalClose('view');
|
||||||
|
} else {
|
||||||
|
setLogoutModalClose('hidden');
|
||||||
|
sessionStorage.removeItem('token');
|
||||||
|
|
||||||
|
navigate('/');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const isClickable = (submenu) => {
|
||||||
|
switch (userInfo.auth_level_type) {
|
||||||
|
case adminAuthLevel.DEVELOPER:
|
||||||
|
case adminAuthLevel.READER:
|
||||||
|
case adminAuthLevel.MASTER:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return submenu.authLevel === adminAuthLevel.NONE && userInfo.auth_list && userInfo.auth_list.some(auth => auth.id === submenu.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<nav>
|
||||||
|
<ul>
|
||||||
|
{menu.map((item, idx) => {
|
||||||
|
return (
|
||||||
|
<li key={idx}>
|
||||||
|
{item.access && (
|
||||||
|
<TopMenu to={item.link} onClick={handleTopMenu}>
|
||||||
|
{item.title}
|
||||||
|
</TopMenu>
|
||||||
|
)}
|
||||||
|
<SubMenu>
|
||||||
|
{item.submenu && userInfo &&
|
||||||
|
item.submenu.map((submenu, idx) => {
|
||||||
|
return (
|
||||||
|
<SubMenuItem key={idx} $isclickable={isClickable(submenu) ? 'true' : 'false'}>
|
||||||
|
<NavLink
|
||||||
|
to={isClickable(submenu) ? submenu.link : location.pathname}
|
||||||
|
onClick={e => {
|
||||||
|
isClickable(submenu) ? handleLink(e) : handleModalClose();
|
||||||
|
}}>
|
||||||
|
{submenu.title}
|
||||||
|
</NavLink>
|
||||||
|
</SubMenuItem>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</SubMenu>
|
||||||
|
</li>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
{/* 접근 불가 모달 */}
|
||||||
|
<Modal min="440px" $padding="40px" $bgcolor="transparent" $view={modalClose}>
|
||||||
|
<BtnWrapper $justify="flex-end">
|
||||||
|
<ButtonClose onClick={handleModalClose} />
|
||||||
|
</BtnWrapper>
|
||||||
|
<ModalText $align="center">
|
||||||
|
해당 메뉴에 대한 조회 권한이 없습니다.
|
||||||
|
<br />
|
||||||
|
권한 등급을 변경 후 다시 이용해주세요.
|
||||||
|
</ModalText>
|
||||||
|
<BtnWrapper $gap="10px">
|
||||||
|
<Button text="확인" theme="primary" type="submit" size="large" width="100%" handleClick={handleModalClose} />
|
||||||
|
</BtnWrapper>
|
||||||
|
</Modal>
|
||||||
|
|
||||||
|
{/* 로그아웃 안내 모달 */}
|
||||||
|
<Modal min="440px" $padding="40px" $bgcolor="transparent" $view={logoutModalClose}>
|
||||||
|
<BtnWrapper $justify="flex-end">
|
||||||
|
<ButtonClose onClick={handleConfirmClose} />
|
||||||
|
</BtnWrapper>
|
||||||
|
<ModalText $align="center">로그아웃 되었습니다.</ModalText>
|
||||||
|
<BtnWrapper $gap="10px">
|
||||||
|
<Button text="확인" theme="primary" type="submit" size="large" width="100%" handleClick={handleConfirmClose} />
|
||||||
|
</BtnWrapper>
|
||||||
|
</Modal>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Navi;
|
||||||
|
|
||||||
|
const TopMenu = styled(NavLink)`
|
||||||
|
padding: 16px 30px;
|
||||||
|
width: 100%;
|
||||||
|
text-align: left;
|
||||||
|
border-bottom: 1px solid #888;
|
||||||
|
position: relative;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
content: '';
|
||||||
|
display: block;
|
||||||
|
width: 12px;
|
||||||
|
height: 12px;
|
||||||
|
position: absolute;
|
||||||
|
right: 30px;
|
||||||
|
top: 50%;
|
||||||
|
transform: translate(0, -50%);
|
||||||
|
background: url('${arrowIcon}') -12px 0 no-repeat;
|
||||||
|
}
|
||||||
|
&:hover,
|
||||||
|
&.active {
|
||||||
|
background: #444;
|
||||||
|
}
|
||||||
|
&.active ~ ul {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
&.active:before {
|
||||||
|
background: url('${arrowIcon}') 0 0 no-repeat;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
const SubMenu = styled.ul`
|
||||||
|
display: none;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const SubMenuItem = styled.li`
|
||||||
|
background: #eee;
|
||||||
|
border-bottom: 1px solid #ccc;
|
||||||
|
color: #2c2c2c;
|
||||||
|
a {
|
||||||
|
width: 100%;
|
||||||
|
padding: 16px 30px;
|
||||||
|
color: ${props => (props.$isclickable === 'false' ? '#818181' : '#2c2c2c')};
|
||||||
|
text-align: left;
|
||||||
|
&:hover,
|
||||||
|
&.active {
|
||||||
|
color: ${props => (props.$isclickable === 'false' ? '#818181' : '#2c2c2c')};
|
||||||
|
font-weight: ${props => (props.$isclickable === 'false' ? 400 : 600)};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
const BackGround = styled.div`
|
||||||
|
background: #eee2;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 100;
|
||||||
|
`;
|
||||||
@@ -1,20 +1,24 @@
|
|||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import UserIcon from '../../../assets/img/icon/icon-profile.png';
|
import { Layout, Avatar, Button as AntButton, Typography, Tooltip, Breadcrumb } from 'antd';
|
||||||
|
import { UserOutlined, LogoutOutlined, HomeOutlined } from '@ant-design/icons'
|
||||||
|
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import Modal from '../modal/Modal';
|
|
||||||
import CloseIcon from '../../../assets/img/icon/icon-close.png';
|
|
||||||
import Button from '../../common/button/Button';
|
|
||||||
|
|
||||||
import { useRecoilState } from 'recoil';
|
import { useRecoilState } from 'recoil';
|
||||||
import { Link, useNavigate } from 'react-router-dom';
|
import { Link, useNavigate, useLocation } from 'react-router-dom';
|
||||||
import { AuthLogout, AuthInfo } from '../../../apis';
|
import { AuthLogout, AuthInfo } from '../../../apis';
|
||||||
import { BtnWrapper, ModalText } from '../../../styles/Components';
|
|
||||||
import { authList } from '../../../store/authList';
|
import { authList } from '../../../store/authList';
|
||||||
|
import { alertTypes } from '../../../assets/data/types';
|
||||||
|
import { useAlert } from '../../../context/AlertProvider';
|
||||||
|
import { menuConfig } from '../../../assets/data/menuConfig';
|
||||||
|
|
||||||
|
const { Header } = Layout;
|
||||||
|
const { Text } = Typography;
|
||||||
|
|
||||||
const Profile = () => {
|
const Profile = () => {
|
||||||
|
const location = useLocation();
|
||||||
|
const { showModal } = useAlert();
|
||||||
const [infoData, setInfoData] = useRecoilState(authList);
|
const [infoData, setInfoData] = useRecoilState(authList);
|
||||||
const [errorModal, setErrorModal] = useState('hidden');
|
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
@@ -40,91 +44,123 @@ const Profile = () => {
|
|||||||
|
|
||||||
// 필수값 입력 모달창
|
// 필수값 입력 모달창
|
||||||
const handleErrorModal = () => {
|
const handleErrorModal = () => {
|
||||||
if (errorModal === 'hidden') {
|
showModal('USER_LOGOUT_CONFIRM', {
|
||||||
setErrorModal('view');
|
type: alertTypes.confirm,
|
||||||
} else {
|
onConfirm: () => handleLogout()
|
||||||
setErrorModal('hidden');
|
});
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 카테고리별 첫 번째 아이템 링크 찾기
|
||||||
|
const getFirstItemLink = (categoryKey) => {
|
||||||
|
const category = menuConfig[categoryKey];
|
||||||
|
if (!category || !category.items) return `/${categoryKey}`;
|
||||||
|
|
||||||
|
// 첫 번째 visible 아이템 찾기
|
||||||
|
const firstVisibleItem = Object.entries(category.items)
|
||||||
|
.find(([_, item]) => item.view !== false);
|
||||||
|
|
||||||
|
if (!firstVisibleItem) return `/${categoryKey}`;
|
||||||
|
return `/${categoryKey}/${firstVisibleItem[0]}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
const pathSnippets = location.pathname.split('/').filter(i => i);
|
||||||
|
|
||||||
|
const breadcrumbItems = [
|
||||||
|
{
|
||||||
|
title: <Link to="/"><HomeOutlined /></Link>,
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
if (pathSnippets.length > 0) {
|
||||||
|
// 첫 번째 경로 (메인 카테고리)
|
||||||
|
const mainCategory = pathSnippets[0];
|
||||||
|
if (menuConfig[mainCategory]) {
|
||||||
|
const firstItemLink = getFirstItemLink(mainCategory);
|
||||||
|
|
||||||
|
breadcrumbItems.push({
|
||||||
|
title: <Link to={firstItemLink}>{menuConfig[mainCategory].title}</Link>
|
||||||
|
});
|
||||||
|
|
||||||
|
// 두 번째 경로 (서브 카테고리)
|
||||||
|
if (pathSnippets.length > 1) {
|
||||||
|
const subCategory = pathSnippets[1];
|
||||||
|
if (menuConfig[mainCategory].items[subCategory]) {
|
||||||
|
breadcrumbItems.push({
|
||||||
|
title: menuConfig[mainCategory].items[subCategory].title
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ProfileWrapper>
|
<StyledHeader>
|
||||||
<UserWrapper>{infoData.name && <Username>{infoData.name.length > 20 ? infoData.name.slice(0, 20) + '...' : infoData.name}님</Username>}</UserWrapper>
|
<StyledBreadcrumb items={breadcrumbItems} />
|
||||||
<Link>
|
<ProfileContainer>
|
||||||
<LogoutBtn onClick={handleErrorModal}>로그아웃</LogoutBtn>
|
<StyledAvatar
|
||||||
</Link>
|
size={32}
|
||||||
</ProfileWrapper>
|
icon={<UserOutlined />}
|
||||||
{/* 로그아웃 확인 모달 */}
|
/>
|
||||||
<Modal min="440px" $padding="40px" $bgcolor="transparent" $view={errorModal}>
|
{infoData.name &&
|
||||||
<BtnWrapper $justify="flex-end">
|
<StyledUsername>
|
||||||
<ButtonClose onClick={handleErrorModal} />
|
{infoData.name.length > 20 ? infoData.name.slice(0, 20) + '...' : infoData.name}님
|
||||||
</BtnWrapper>
|
</StyledUsername>
|
||||||
<ModalText $align="center">
|
}
|
||||||
로그아웃 하시겠습니까?
|
<Tooltip title="로그아웃">
|
||||||
<br />
|
<StyledLogoutButton
|
||||||
(로그아웃 시 저장되지 않은 값은 초기화 됩니다.)
|
type="text"
|
||||||
</ModalText>
|
icon={<LogoutOutlined />}
|
||||||
<BtnWrapper $gap="10px">
|
onClick={handleErrorModal}
|
||||||
<Button text="취소" theme="line" size="large" width="100%" handleClick={handleErrorModal} />
|
/>
|
||||||
<Button text="확인" theme="primary" type="submit" size="large" width="100%" handleClick={handleLogout} />
|
</Tooltip>
|
||||||
</BtnWrapper>
|
</ProfileContainer>
|
||||||
</Modal>
|
|
||||||
|
</StyledHeader>
|
||||||
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Profile;
|
export default Profile;
|
||||||
|
|
||||||
const ProfileWrapper = styled.div`
|
const StyledHeader = styled(Header)`
|
||||||
background: #f6f6f6;
|
background: #f6f6f6;
|
||||||
padding: 20px;
|
padding: 0 20px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
height: 64px;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const StyledBreadcrumb = styled(Breadcrumb)`
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 600;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const ProfileContainer = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 30px;
|
|
||||||
word-break: break-all;
|
|
||||||
justify-content: flex-end;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const LogoutBtn = styled.button`
|
const StyledAvatar = styled(Avatar)`
|
||||||
color: #2c2c2c;
|
|
||||||
line-height: 1;
|
|
||||||
border-bottom: 0.5px solid #2c2c2c;
|
|
||||||
font-size: 13px;
|
|
||||||
font-weight: 300;
|
|
||||||
border-radius: 0;
|
|
||||||
letter-spacing: 0;
|
|
||||||
width: max-content;
|
|
||||||
height: max-content;
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const UserWrapper = styled.div`
|
const StyledUsername = styled(Text)`
|
||||||
padding-left: 35px;
|
font-weight: 600;
|
||||||
position: relative;
|
font-size: 18px;
|
||||||
font-size: 18px;
|
color: rgba(0, 0, 0, 0.85);
|
||||||
display: flex;
|
|
||||||
|
|
||||||
&:before {
|
|
||||||
background: url('${UserIcon}') 50% 50% no-repeat;
|
|
||||||
width: 24px;
|
|
||||||
height: 24px;
|
|
||||||
content: '';
|
|
||||||
display: block;
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
top: 50%;
|
|
||||||
transform: translate(0, -50%);
|
|
||||||
}
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const Username = styled.div`
|
const StyledLogoutButton = styled(AntButton)`
|
||||||
font-weight: 700;
|
color: rgba(0, 0, 0, 0.45);
|
||||||
padding-right: 3px;
|
transition: color 0.3s;
|
||||||
`;
|
font-size: 18px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: #1677ff;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
const ButtonClose = styled.button`
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
background: url(${CloseIcon}) 50% 50% no-repeat;
|
|
||||||
`;
|
`;
|
||||||
|
|||||||
41
src/components/common/Layout/AnimatedPageWrapper.js
Normal file
41
src/components/common/Layout/AnimatedPageWrapper.js
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { motion } from 'framer-motion';
|
||||||
|
|
||||||
|
const pageVariants = {
|
||||||
|
initial: {
|
||||||
|
opacity: 0,
|
||||||
|
x: 20
|
||||||
|
},
|
||||||
|
animate: {
|
||||||
|
opacity: 1,
|
||||||
|
x: 0,
|
||||||
|
transition: {
|
||||||
|
duration: 0.3,
|
||||||
|
ease: "easeInOut"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
exit: {
|
||||||
|
opacity: 0,
|
||||||
|
x: -20,
|
||||||
|
transition: {
|
||||||
|
duration: 0.2,
|
||||||
|
ease: "easeInOut"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const AnimatedPageWrapper = ({ children }) => {
|
||||||
|
return (
|
||||||
|
<motion.div
|
||||||
|
initial="initial"
|
||||||
|
animate="animate"
|
||||||
|
exit="exit"
|
||||||
|
variants={pageVariants}
|
||||||
|
style={{ width: '100%', height: '100%' }}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</motion.div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default AnimatedPageWrapper;
|
||||||
370
src/components/common/Layout/DetailGrid.js
Normal file
370
src/components/common/Layout/DetailGrid.js
Normal file
@@ -0,0 +1,370 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { Row, Col, Form, Input, Select, DatePicker, TimePicker, InputNumber, Switch, Button, Checkbox } from 'antd';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
import { AnimatedTabs } from '../index';
|
||||||
|
const { RangePicker } = DatePicker;
|
||||||
|
const { TextArea } = Input;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 위치 지정 가능한 그리드 형태 상세 정보 표시 컴포넌트
|
||||||
|
* @param {Array} items - 표시할 항목 배열 (row, col, rowSpan, colSpan 속성 추가)
|
||||||
|
* @param {Object} formData - 폼 데이터 객체
|
||||||
|
* @param {Function} onChange - 값 변경 시 호출할 함수
|
||||||
|
* @param {boolean} disabled - 전체 비활성화 여부
|
||||||
|
* @param {number} columns - 그리드의 총 컬럼 수 (기본값: 4)
|
||||||
|
*/
|
||||||
|
const DetailGrid = ({ items, formData, onChange, disabled = false, columns = 4 }) => {
|
||||||
|
// 항목을 행과 열 위치별로 그룹화
|
||||||
|
const positionedItems = {};
|
||||||
|
|
||||||
|
// 각 항목의 위치 및 span 정보 처리
|
||||||
|
items.forEach(item => {
|
||||||
|
const rowIndex = item.row || 0;
|
||||||
|
const colIndex = item.col || 0;
|
||||||
|
|
||||||
|
if (!positionedItems[rowIndex]) {
|
||||||
|
positionedItems[rowIndex] = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
positionedItems[rowIndex][colIndex] = {
|
||||||
|
...item,
|
||||||
|
rowSpan: item.rowSpan || 1,
|
||||||
|
colSpan: item.colSpan || 1
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
// 행 번호 목록 (정렬)
|
||||||
|
const rows = Object.keys(positionedItems).map(Number).sort((a, b) => a - b);
|
||||||
|
|
||||||
|
// 항목에 따른 컴포넌트 렌더링 함수
|
||||||
|
const renderComponent = (item) => {
|
||||||
|
const {
|
||||||
|
type,
|
||||||
|
key,
|
||||||
|
keys,
|
||||||
|
label,
|
||||||
|
value,
|
||||||
|
options,
|
||||||
|
placeholder,
|
||||||
|
disabled: itemDisabled,
|
||||||
|
width,
|
||||||
|
handler,
|
||||||
|
min,
|
||||||
|
max,
|
||||||
|
step,
|
||||||
|
format,
|
||||||
|
required,
|
||||||
|
showTime,
|
||||||
|
tabItems,
|
||||||
|
activeKey,
|
||||||
|
onTabChange,
|
||||||
|
maxLength,
|
||||||
|
rows: textareaRows
|
||||||
|
} = item;
|
||||||
|
|
||||||
|
// 현재 값 가져오기 (formData에서 또는 항목에서)
|
||||||
|
const currentValue = formData[key] !== undefined ? formData[key] : value;
|
||||||
|
|
||||||
|
// 컴포넌트 공통 속성
|
||||||
|
const commonProps = {
|
||||||
|
id: key,
|
||||||
|
disabled: disabled || itemDisabled,
|
||||||
|
style: width ? { width, fontSize: '15px' } : { width: '100%', fontSize: '15px' }
|
||||||
|
};
|
||||||
|
|
||||||
|
// 항목 타입에 따른 컴포넌트 렌더링
|
||||||
|
switch (type) {
|
||||||
|
case 'text':
|
||||||
|
return <Input
|
||||||
|
{...commonProps}
|
||||||
|
value={currentValue}
|
||||||
|
onChange={(e) => onChange(key, e.target.value, handler)}
|
||||||
|
placeholder={placeholder || `${label} 입력`}
|
||||||
|
/>;
|
||||||
|
|
||||||
|
case 'number':
|
||||||
|
return <InputNumber
|
||||||
|
{...commonProps}
|
||||||
|
value={currentValue}
|
||||||
|
min={min}
|
||||||
|
max={max}
|
||||||
|
step={step || 1}
|
||||||
|
onChange={(value) => onChange(key, value, handler)}
|
||||||
|
placeholder={placeholder || `${label} 입력`}
|
||||||
|
/>;
|
||||||
|
|
||||||
|
case 'display':
|
||||||
|
return <Input
|
||||||
|
{...commonProps}
|
||||||
|
value={currentValue || ''}
|
||||||
|
readOnly
|
||||||
|
style={{
|
||||||
|
...commonProps.style,
|
||||||
|
backgroundColor: '#f5f5f5',
|
||||||
|
cursor: 'default'
|
||||||
|
}}
|
||||||
|
placeholder={placeholder || ''}
|
||||||
|
/>;
|
||||||
|
|
||||||
|
case 'textarea':
|
||||||
|
return <TextArea
|
||||||
|
{...commonProps}
|
||||||
|
value={currentValue || ''}
|
||||||
|
onChange={(e) => onChange(key, e.target.value, handler)}
|
||||||
|
placeholder={placeholder}
|
||||||
|
maxLength={maxLength}
|
||||||
|
rows={textareaRows || 4}
|
||||||
|
showCount={!!maxLength}
|
||||||
|
/>;
|
||||||
|
|
||||||
|
case 'select':
|
||||||
|
return (
|
||||||
|
<Select
|
||||||
|
{...commonProps}
|
||||||
|
value={currentValue}
|
||||||
|
onChange={(value) => onChange(key, value, handler)}
|
||||||
|
placeholder={placeholder || `${label} 선택`}
|
||||||
|
popupMatchSelectWidth={false}
|
||||||
|
>
|
||||||
|
{options && options.map((option) => (
|
||||||
|
<Select.Option key={option.value} value={option.value}>
|
||||||
|
{option.name}
|
||||||
|
</Select.Option>
|
||||||
|
))}
|
||||||
|
</Select>
|
||||||
|
);
|
||||||
|
|
||||||
|
case 'date':
|
||||||
|
return (
|
||||||
|
<DatePicker
|
||||||
|
{...commonProps}
|
||||||
|
allowClear={false}
|
||||||
|
showTime={showTime || false}
|
||||||
|
value={currentValue ? dayjs(currentValue) : null}
|
||||||
|
format={format || 'YYYY-MM-DD'}
|
||||||
|
onChange={(date) => onChange(key, date, handler)}
|
||||||
|
placeholder={placeholder || `${label} 선택`}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
|
case 'dateRange':
|
||||||
|
return (
|
||||||
|
<RangePicker
|
||||||
|
{...commonProps}
|
||||||
|
showTime={showTime !== false}
|
||||||
|
value={keys ? [
|
||||||
|
formData[keys.start] ? dayjs(formData[keys.start]) : null,
|
||||||
|
formData[keys.end] ? dayjs(formData[keys.end]) : null
|
||||||
|
] : (currentValue ? [
|
||||||
|
currentValue.start ? dayjs(currentValue.start) : null,
|
||||||
|
currentValue.end ? dayjs(currentValue.end) : null
|
||||||
|
] : null)}
|
||||||
|
format={format || 'YYYY-MM-DD HH:mm:ss'}
|
||||||
|
onChange={(dates) => {
|
||||||
|
if (dates && dates.length === 2) {
|
||||||
|
// 두 개의 별도 필드에 각각 업데이트
|
||||||
|
if (item.keys) {
|
||||||
|
// 두 개의 onChange를 순차적으로 호출하는 대신
|
||||||
|
// 한 번에 두 필드를 모두 업데이트하는 방식으로 변경
|
||||||
|
const updatedData = {
|
||||||
|
...formData,
|
||||||
|
[item.keys.start]: dates[0],
|
||||||
|
[item.keys.end]: dates[1]
|
||||||
|
};
|
||||||
|
|
||||||
|
// handler가 있으면 handler 실행, 없으면 직접 onChange 호출
|
||||||
|
if (handler) {
|
||||||
|
handler(dates, key, updatedData);
|
||||||
|
} else {
|
||||||
|
// onChange를 통해 전체 업데이트된 데이터를 전달
|
||||||
|
onChange('dateRange_update', updatedData, null);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 기존 방식 지원 (하위 호환성)
|
||||||
|
onChange(key, {
|
||||||
|
start: dates[0],
|
||||||
|
end: dates[1]
|
||||||
|
}, handler);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 두 필드 모두 비우기
|
||||||
|
if (item.keys) {
|
||||||
|
const updatedData = {
|
||||||
|
...formData,
|
||||||
|
[item.keys.start]: null,
|
||||||
|
[item.keys.end]: null
|
||||||
|
};
|
||||||
|
|
||||||
|
if (handler) {
|
||||||
|
handler(null, key, updatedData);
|
||||||
|
} else {
|
||||||
|
onChange('dateRange_update', updatedData, null);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
onChange(key, { start: null, end: null }, handler);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
placeholder={[
|
||||||
|
item.startLabel || '시작 일시',
|
||||||
|
item.endLabel || '종료 일시'
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
|
case 'time':
|
||||||
|
return (
|
||||||
|
<TimePicker
|
||||||
|
{...commonProps}
|
||||||
|
value={currentValue ? dayjs(currentValue, 'HH:mm') : null}
|
||||||
|
format={format || 'HH:mm'}
|
||||||
|
onChange={(time) => onChange(key, time, handler)}
|
||||||
|
placeholder={placeholder || `${label} 선택`}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
|
case 'switch':
|
||||||
|
return (
|
||||||
|
<Switch
|
||||||
|
checked={currentValue}
|
||||||
|
onChange={(checked) => onChange(key, checked, handler)}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
|
case 'checkbox':
|
||||||
|
return (
|
||||||
|
<Checkbox
|
||||||
|
checked={currentValue}
|
||||||
|
disabled={disabled || itemDisabled}
|
||||||
|
onChange={(e) => onChange(key, e.target.checked, handler)}
|
||||||
|
>
|
||||||
|
{item.checkboxLabel}
|
||||||
|
</Checkbox>
|
||||||
|
);
|
||||||
|
|
||||||
|
case 'status':
|
||||||
|
return <StatusDisplay status={currentValue} />;
|
||||||
|
|
||||||
|
case 'tab':
|
||||||
|
return <AnimatedTabs
|
||||||
|
items={tabItems}
|
||||||
|
activeKey={activeKey}
|
||||||
|
onChange={onTabChange}
|
||||||
|
/>
|
||||||
|
|
||||||
|
case 'custom':
|
||||||
|
return item.render ? item.render(formData, onChange) : null;
|
||||||
|
|
||||||
|
case 'label':
|
||||||
|
default:
|
||||||
|
return <div style={{
|
||||||
|
padding: '4px 11px',
|
||||||
|
minHeight: '32px',
|
||||||
|
lineHeight: '24px',
|
||||||
|
fontSize: '15px',
|
||||||
|
color: currentValue ? '#000' : '#bfbfbf'
|
||||||
|
}}>
|
||||||
|
{currentValue || placeholder || ''}
|
||||||
|
</div>;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 각 셀의 폭 계산 (Ant Design의 24-컬럼 시스템 기준)
|
||||||
|
const colWidth = 24 / columns;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<GridContainer>
|
||||||
|
<Form layout="horizontal">
|
||||||
|
{rows.map(rowIndex => {
|
||||||
|
const rowItems = positionedItems[rowIndex];
|
||||||
|
const cols = Object.keys(rowItems).map(Number).sort((a, b) => a - b);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Row key={`row-${rowIndex}`} gutter={[16, 16]}>
|
||||||
|
{cols.map(colIndex => {
|
||||||
|
const item = rowItems[colIndex];
|
||||||
|
const itemColSpan = Math.min(item.colSpan * colWidth, 24);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Col
|
||||||
|
key={`${item.key}-${rowIndex}-${colIndex}`}
|
||||||
|
span={itemColSpan}
|
||||||
|
xs={24}
|
||||||
|
sm={itemColSpan}
|
||||||
|
>
|
||||||
|
<Form.Item
|
||||||
|
label={item.label}
|
||||||
|
required={item.required}
|
||||||
|
tooltip={item.tooltip}
|
||||||
|
>
|
||||||
|
{renderComponent(item)}
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Row>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Form>
|
||||||
|
</GridContainer>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 상태 표시 컴포넌트
|
||||||
|
const StatusDisplay = ({ status }) => {
|
||||||
|
let color = '';
|
||||||
|
let text = '';
|
||||||
|
|
||||||
|
const lowerStatus = typeof status === 'string' ? status.toLowerCase() : status;
|
||||||
|
|
||||||
|
switch (lowerStatus) {
|
||||||
|
case 'wait':
|
||||||
|
color = '#FAAD14';
|
||||||
|
text = '대기';
|
||||||
|
break;
|
||||||
|
case 'running':
|
||||||
|
color = '#4287f5';
|
||||||
|
text = '진행중';
|
||||||
|
break;
|
||||||
|
case 'finish':
|
||||||
|
color = '#d9d9d9';
|
||||||
|
text = '만료';
|
||||||
|
break;
|
||||||
|
case 'fail':
|
||||||
|
color = '#ff4d4f';
|
||||||
|
text = '실패';
|
||||||
|
break;
|
||||||
|
case 'delete':
|
||||||
|
color = '#ff4d4f';
|
||||||
|
text = '삭제';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
color = '#DEBB46';
|
||||||
|
text = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<StatusTag color={color}>
|
||||||
|
{text}
|
||||||
|
</StatusTag>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const GridContainer = styled.div`
|
||||||
|
width: 100%;
|
||||||
|
padding: 16px 0;
|
||||||
|
font-size: 15px;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const StatusTag = styled.div`
|
||||||
|
display: inline-block;
|
||||||
|
padding: 2px 8px;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: ${props => props.color};
|
||||||
|
color: white;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 500;
|
||||||
|
`;
|
||||||
|
|
||||||
|
export default DetailGrid;
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user